	.file	"977434.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.ascii	"usage:\n   this program converts from one text "
	.string	"file format to another\n   - unix files use only 0x0A for newline\n   - macintosh files use 0x0D for newline\n   - msdos files use 0x0D 0x0A for newline\n   - syntax: crnl <from_format> <to_format> file [file ...]\n   - where 'format' is one of: -dos -unix -mac"
	.text
	.type	usage, @function
usage:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	usage, .-usage
	.local	warnings
	.comm	warnings,4,4
	.section	.rodata
	.align 8
.LC1:
	.string	"warning, last line has no newline\n"
	.align 8
.LC2:
	.string	"warning, found 0x0A without preceding 0x0D, is this really a dos file?\n"
	.align 8
.LC3:
	.string	"error, 0x0A without 0x0D, is this really a dos file?\n"
	.align 8
.LC4:
	.string	"error, found line > %d chars long\n"
	.text
	.type	get_dos, @function
get_dos:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	mov	DWORD PTR -8[rbp], 0
.L11:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L3
	cmp	DWORD PTR -8[rbp], 0
	je	.L4
	mov	eax, DWORD PTR warnings[rip]
	and	eax, 1
	test	eax, eax
	jne	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 34
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR warnings[rip]
	or	eax, 1
	mov	DWORD PTR warnings[rip], eax
.L5:
	mov	eax, DWORD PTR -8[rbp]
	jmp	.L6
.L4:
	mov	eax, -1
	jmp	.L6
.L3:
	cmp	DWORD PTR -4[rbp], 10
	jne	.L7
	mov	eax, DWORD PTR warnings[rip]
	and	eax, 2
	test	eax, eax
	jne	.L7
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 71
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR warnings[rip]
	or	eax, 2
	mov	DWORD PTR warnings[rip], eax
.L7:
	cmp	DWORD PTR -4[rbp], 13
	jne	.L8
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 10
	je	.L9
	mov	eax, DWORD PTR warnings[rip]
	and	eax, 4
	test	eax, eax
	jne	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 53
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR warnings[rip]
	or	eax, 4
	mov	DWORD PTR warnings[rip], eax
.L9:
	mov	eax, DWORD PTR -8[rbp]
	jmp	.L6
.L8:
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -4[rbp]
	mov	BYTE PTR [rax], dl
	add	DWORD PTR -8[rbp], 1
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jne	.L11
	mov	eax, DWORD PTR warnings[rip]
	and	eax, 8
	test	eax, eax
	jne	.L11
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -36[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR warnings[rip]
	or	eax, 8
	mov	DWORD PTR warnings[rip], eax
	jmp	.L11
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_dos, .-get_dos
	.section	.rodata
	.align 8
.LC5:
	.string	"warning, 0x0A character found in input, is this really a mac file?\n"
	.text
	.type	get_mac, @function
get_mac:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	mov	DWORD PTR -8[rbp], 0
.L20:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L13
	cmp	DWORD PTR -8[rbp], 0
	je	.L14
	mov	eax, DWORD PTR warnings[rip]
	and	eax, 16
	test	eax, eax
	jne	.L15
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 34
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR warnings[rip]
	or	eax, 16
	mov	DWORD PTR warnings[rip], eax
.L15:
	mov	eax, DWORD PTR -8[rbp]
	jmp	.L16
.L14:
	mov	eax, -1
	jmp	.L16
.L13:
	cmp	DWORD PTR -4[rbp], 10
	jne	.L17
	mov	eax, DWORD PTR warnings[rip]
	and	eax, 32
	test	eax, eax
	jne	.L17
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 67
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR warnings[rip]
	or	eax, 32
	mov	DWORD PTR warnings[rip], eax
.L17:
	cmp	DWORD PTR -4[rbp], 13
	jne	.L18
	mov	eax, DWORD PTR -8[rbp]
	jmp	.L16
.L18:
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -4[rbp]
	mov	BYTE PTR [rax], dl
	add	DWORD PTR -8[rbp], 1
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jne	.L20
	mov	eax, DWORD PTR warnings[rip]
	and	eax, 64
	test	eax, eax
	jne	.L20
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -36[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR warnings[rip]
	or	eax, 64
	mov	DWORD PTR warnings[rip], eax
	jmp	.L20
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	get_mac, .-get_mac
	.section	.rodata
	.align 8
.LC6:
	.string	"warning, 0x0D character found in input, is this really a unix file?\n"
	.text
	.type	get_unix, @function
get_unix:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	mov	DWORD PTR -8[rbp], 0
.L29:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L22
	cmp	DWORD PTR -8[rbp], 0
	je	.L23
	mov	eax, DWORD PTR warnings[rip]
	and	eax, 128
	test	eax, eax
	jne	.L24
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 34
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR warnings[rip]
	or	al, -128
	mov	DWORD PTR warnings[rip], eax
.L24:
	mov	eax, DWORD PTR -8[rbp]
	jmp	.L25
.L23:
	mov	eax, -1
	jmp	.L25
.L22:
	cmp	DWORD PTR -4[rbp], 13
	jne	.L26
	mov	eax, DWORD PTR warnings[rip]
	and	eax, 256
	test	eax, eax
	jne	.L26
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 68
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR warnings[rip]
	or	ah, 1
	mov	DWORD PTR warnings[rip], eax
.L26:
	cmp	DWORD PTR -4[rbp], 10
	jne	.L27
	mov	eax, DWORD PTR -8[rbp]
	jmp	.L25
.L27:
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -4[rbp]
	mov	BYTE PTR [rax], dl
	add	DWORD PTR -8[rbp], 1
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jne	.L29
	mov	eax, DWORD PTR warnings[rip]
	and	eax, 512
	test	eax, eax
	jne	.L29
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -36[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR warnings[rip]
	or	ah, 2
	mov	DWORD PTR warnings[rip], eax
	jmp	.L29
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	get_unix, .-get_unix
	.type	put_dos, @function
put_dos:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR -20[rbp], edx
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 13
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 10
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 2
	movsx	rsi, eax
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	put_dos, .-put_dos
	.type	put_mac, @function
put_mac:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR -20[rbp], edx
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 13
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 1
	movsx	rsi, eax
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	put_mac, .-put_mac
	.type	put_unix, @function
put_unix:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR -20[rbp], edx
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 10
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 1
	movsx	rsi, eax
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	put_unix, .-put_unix
	.section	.rodata
.LC7:
	.string	"%s~"
	.align 8
.LC8:
	.string	"error, cannot rename file '%s'\n"
.LC9:
	.string	"r"
	.align 8
.LC10:
	.string	"error, cannot open input file '%s'\n"
.LC11:
	.string	"w"
	.align 8
.LC12:
	.string	"error, cannot open output file '%s'\n"
	.text
	.type	convert_file, @function
convert_file:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 592
	mov	QWORD PTR -568[rbp], rdi
	mov	QWORD PTR -576[rbp], rsi
	mov	QWORD PTR -584[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR -568[rbp]
	lea	rax, -528[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rdx, -528[rbp]
	mov	rax, QWORD PTR -568[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rename@PLT
	test	eax, eax
	jns	.L34
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -568[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L34:
	lea	rax, -528[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -544[rbp], rax
	cmp	QWORD PTR -544[rbp], 0
	jne	.L35
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -528[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L35:
	mov	rax, QWORD PTR -568[rbp]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -536[rbp], rax
	cmp	QWORD PTR -536[rbp], 0
	jne	.L37
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -568[rbp]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L38:
	mov	edx, DWORD PTR -548[rbp]
	lea	rcx, -528[rbp]
	mov	rax, QWORD PTR -536[rbp]
	mov	r8, QWORD PTR -584[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	r8
.L37:
	lea	rcx, -528[rbp]
	mov	rax, QWORD PTR -544[rbp]
	mov	r8, QWORD PTR -576[rbp]
	mov	edx, 510
	mov	rsi, rcx
	mov	rdi, rax
	call	r8
	mov	DWORD PTR -548[rbp], eax
	cmp	DWORD PTR -548[rbp], -1
	jne	.L38
	mov	rax, QWORD PTR -544[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -536[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	convert_file, .-convert_file
	.section	.data.rel.local,"aw"
	.align 16
	.type	readers, @object
	.size	readers, 24
readers:
	.quad	get_dos
	.quad	get_mac
	.quad	get_unix
	.align 16
	.type	writers, @object
	.size	writers, 24
writers:
	.quad	put_dos
	.quad	put_mac
	.quad	put_unix
	.section	.rodata
.LC13:
	.string	"-dos"
.LC14:
	.string	"-mac"
.LC15:
	.string	"-unix"
	.text
	.type	arg_to_index, @function
arg_to_index:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L41
	mov	eax, 0
	jmp	.L42
.L41:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L43
	mov	eax, 1
	jmp	.L42
.L43:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L44
	mov	eax, 2
	jmp	.L42
.L44:
	mov	eax, -1
.L42:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	arg_to_index, .-arg_to_index
	.section	.rodata
	.align 8
.LC16:
	.string	"converting %s to %s is a pointless conversion\n"
	.text
	.globl	crnl_main
	.type	crnl_main, @function
crnl_main:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	cmp	DWORD PTR -20[rbp], 3
	jg	.L46
	call	usage
.L46:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	arg_to_index
	mov	DWORD PTR -8[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	arg_to_index
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -8[rbp], -1
	je	.L47
	cmp	DWORD PTR -4[rbp], -1
	jne	.L48
.L47:
	call	usage
.L48:
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jne	.L49
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 16
	mov	rcx, QWORD PTR [rax]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC16[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L50
.L49:
	mov	DWORD PTR -12[rbp], 3
	jmp	.L51
.L52:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, writers[rip]
	mov	rdx, QWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, readers[rip]
	mov	rcx, QWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rsi, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rsi
	mov	rax, QWORD PTR [rax]
	mov	rsi, rcx
	mov	rdi, rax
	call	convert_file
	add	DWORD PTR -12[rbp], 1
.L51:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L52
	mov	eax, 0
.L50:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	crnl_main, .-crnl_main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"977434.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage:\012   this program converts from one text fi"
	.ascii	"le format to another\012   - unix files use only 0x"
	.ascii	"0A for newline\012   - macintosh files use 0x0D for"
	.ascii	" newline\012   - msdos files use 0x0D 0x0A for newl"
	.ascii	"ine\012   - syntax: crnl <from_format> <to_format> "
	.ascii	"file [file ...]\012   - where 'format' is one of: -"
	.ascii	"dos -unix -mac\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	usage, %function
usage:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L2
	bl	puts
	mov	r0, #1
	bl	exit
.L3:
	.align	2
.L2:
	.word	.LC0
	.size	usage, .-usage
	.local	warnings
	.comm	warnings,4,4
	.section	.rodata
	.align	2
.LC1:
	.ascii	"warning, last line has no newline\012\000"
	.align	2
.LC2:
	.ascii	"warning, found 0x0A without preceding 0x0D, is this"
	.ascii	" really a dos file?\012\000"
	.align	2
.LC3:
	.ascii	"error, 0x0A without 0x0D, is this really a dos file"
	.ascii	"?\012\000"
	.align	2
.LC4:
	.ascii	"error, found line > %d chars long\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_dos, %function
get_dos:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-12]
.L13:
	ldr	r0, [fp, #-16]
	bl	fgetc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L5
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L6
	ldr	r3, .L14
	ldr	r3, [r3]
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L7
	ldr	r3, .L14+4
	ldr	r3, [r3]
	mov	r2, #34
	mov	r1, #1
	ldr	r0, .L14+8
	bl	fwrite
	ldr	r3, .L14
	ldr	r3, [r3]
	orr	r3, r3, #1
	ldr	r2, .L14
	str	r3, [r2]
.L7:
	ldr	r3, [fp, #-12]
	b	.L8
.L6:
	mvn	r3, #0
	b	.L8
.L5:
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	bne	.L9
	ldr	r3, .L14
	ldr	r3, [r3]
	and	r3, r3, #2
	cmp	r3, #0
	bne	.L9
	ldr	r3, .L14+4
	ldr	r3, [r3]
	mov	r2, #71
	mov	r1, #1
	ldr	r0, .L14+12
	bl	fwrite
	ldr	r3, .L14
	ldr	r3, [r3]
	orr	r3, r3, #2
	ldr	r2, .L14
	str	r3, [r2]
.L9:
	ldr	r3, [fp, #-8]
	cmp	r3, #13
	bne	.L10
	ldr	r0, [fp, #-16]
	bl	fgetc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	beq	.L11
	ldr	r3, .L14
	ldr	r3, [r3]
	and	r3, r3, #4
	cmp	r3, #0
	bne	.L11
	ldr	r3, .L14+4
	ldr	r3, [r3]
	mov	r2, #53
	mov	r1, #1
	ldr	r0, .L14+16
	bl	fwrite
	ldr	r3, .L14
	ldr	r3, [r3]
	orr	r3, r3, #4
	ldr	r2, .L14
	str	r3, [r2]
.L11:
	ldr	r3, [fp, #-12]
	b	.L8
.L10:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bne	.L13
	ldr	r3, .L14
	ldr	r3, [r3]
	and	r3, r3, #8
	cmp	r3, #0
	bne	.L13
	ldr	r3, .L14+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	ldr	r1, .L14+20
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L14
	ldr	r3, [r3]
	orr	r3, r3, #8
	ldr	r2, .L14
	str	r3, [r2]
	b	.L13
.L8:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	warnings
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	get_dos, .-get_dos
	.section	.rodata
	.align	2
.LC5:
	.ascii	"warning, 0x0A character found in input, is this rea"
	.ascii	"lly a mac file?\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_mac, %function
get_mac:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-12]
.L24:
	ldr	r0, [fp, #-16]
	bl	fgetc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L17
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L18
	ldr	r3, .L25
	ldr	r3, [r3]
	and	r3, r3, #16
	cmp	r3, #0
	bne	.L19
	ldr	r3, .L25+4
	ldr	r3, [r3]
	mov	r2, #34
	mov	r1, #1
	ldr	r0, .L25+8
	bl	fwrite
	ldr	r3, .L25
	ldr	r3, [r3]
	orr	r3, r3, #16
	ldr	r2, .L25
	str	r3, [r2]
.L19:
	ldr	r3, [fp, #-12]
	b	.L20
.L18:
	mvn	r3, #0
	b	.L20
.L17:
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	bne	.L21
	ldr	r3, .L25
	ldr	r3, [r3]
	and	r3, r3, #32
	cmp	r3, #0
	bne	.L21
	ldr	r3, .L25+4
	ldr	r3, [r3]
	mov	r2, #67
	mov	r1, #1
	ldr	r0, .L25+12
	bl	fwrite
	ldr	r3, .L25
	ldr	r3, [r3]
	orr	r3, r3, #32
	ldr	r2, .L25
	str	r3, [r2]
.L21:
	ldr	r3, [fp, #-8]
	cmp	r3, #13
	bne	.L22
	ldr	r3, [fp, #-12]
	b	.L20
.L22:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bne	.L24
	ldr	r3, .L25
	ldr	r3, [r3]
	and	r3, r3, #64
	cmp	r3, #0
	bne	.L24
	ldr	r3, .L25+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	ldr	r1, .L25+16
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L25
	ldr	r3, [r3]
	orr	r3, r3, #64
	ldr	r2, .L25
	str	r3, [r2]
	b	.L24
.L20:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	warnings
	.word	stderr
	.word	.LC1
	.word	.LC5
	.word	.LC4
	.size	get_mac, .-get_mac
	.section	.rodata
	.align	2
.LC6:
	.ascii	"warning, 0x0D character found in input, is this rea"
	.ascii	"lly a unix file?\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_unix, %function
get_unix:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-12]
.L35:
	ldr	r0, [fp, #-16]
	bl	fgetc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L28
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L29
	ldr	r3, .L36
	ldr	r3, [r3]
	and	r3, r3, #128
	cmp	r3, #0
	bne	.L30
	ldr	r3, .L36+4
	ldr	r3, [r3]
	mov	r2, #34
	mov	r1, #1
	ldr	r0, .L36+8
	bl	fwrite
	ldr	r3, .L36
	ldr	r3, [r3]
	orr	r3, r3, #128
	ldr	r2, .L36
	str	r3, [r2]
.L30:
	ldr	r3, [fp, #-12]
	b	.L31
.L29:
	mvn	r3, #0
	b	.L31
.L28:
	ldr	r3, [fp, #-8]
	cmp	r3, #13
	bne	.L32
	ldr	r3, .L36
	ldr	r3, [r3]
	and	r3, r3, #256
	cmp	r3, #0
	bne	.L32
	ldr	r3, .L36+4
	ldr	r3, [r3]
	mov	r2, #68
	mov	r1, #1
	ldr	r0, .L36+12
	bl	fwrite
	ldr	r3, .L36
	ldr	r3, [r3]
	orr	r3, r3, #256
	ldr	r2, .L36
	str	r3, [r2]
.L32:
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	bne	.L33
	ldr	r3, [fp, #-12]
	b	.L31
.L33:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bne	.L35
	ldr	r3, .L36
	ldr	r3, [r3]
	and	r3, r3, #512
	cmp	r3, #0
	bne	.L35
	ldr	r3, .L36+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	ldr	r1, .L36+16
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L36
	ldr	r3, [r3]
	orr	r3, r3, #512
	ldr	r2, .L36
	str	r3, [r2]
	b	.L35
.L31:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L37:
	.align	2
.L36:
	.word	warnings
	.word	stderr
	.word	.LC1
	.word	.LC6
	.word	.LC4
	.size	get_unix, .-get_unix
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	put_dos, %function
put_dos:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #13
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #10
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #2
	mov	r1, r3
	ldr	r3, [fp, #-8]
	mov	r2, #1
	ldr	r0, [fp, #-12]
	bl	fwrite
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	put_dos, .-put_dos
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	put_mac, %function
put_mac:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #13
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r3, [fp, #-8]
	mov	r2, #1
	ldr	r0, [fp, #-12]
	bl	fwrite
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	put_mac, .-put_mac
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	put_unix, %function
put_unix:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #10
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r3, [fp, #-8]
	mov	r2, #1
	ldr	r0, [fp, #-12]
	bl	fwrite
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	put_unix, .-put_unix
	.section	.rodata
	.align	2
.LC7:
	.ascii	"%s~\000"
	.align	2
.LC8:
	.ascii	"error, cannot rename file '%s'\012\000"
	.align	2
.LC9:
	.ascii	"r\000"
	.align	2
.LC10:
	.ascii	"error, cannot open input file '%s'\012\000"
	.align	2
.LC11:
	.ascii	"w\000"
	.align	2
.LC12:
	.ascii	"error, cannot open output file '%s'\012\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	convert_file, %function
convert_file:
	@ args = 0, pretend = 0, frame = 544
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #544
	str	r0, [fp, #-536]
	str	r1, [fp, #-540]
	str	r2, [fp, #-544]
	ldr	r3, .L48
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #520
	ldr	r2, [fp, #-536]
	ldr	r1, .L48+4
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #520
	mov	r1, r3
	ldr	r0, [fp, #-536]
	bl	rename
	mov	r3, r0
	cmp	r3, #0
	bge	.L42
	ldr	r3, .L48+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-536]
	ldr	r1, .L48+12
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L42:
	sub	r3, fp, #520
	ldr	r1, .L48+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-532]
	ldr	r3, [fp, #-532]
	cmp	r3, #0
	bne	.L43
	ldr	r3, .L48+8
	ldr	r3, [r3]
	sub	r2, fp, #520
	ldr	r1, .L48+20
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L43:
	ldr	r1, .L48+24
	ldr	r0, [fp, #-536]
	bl	fopen
	str	r0, [fp, #-528]
	ldr	r3, [fp, #-528]
	cmp	r3, #0
	bne	.L45
	ldr	r3, .L48+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-536]
	ldr	r1, .L48+28
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L46:
	sub	r1, fp, #520
	ldr	r3, [fp, #-544]
	ldr	r2, [fp, #-524]
	ldr	r0, [fp, #-528]
	blx	r3
.L45:
	sub	r1, fp, #520
	ldr	r3, [fp, #-540]
	ldr	r2, .L48+32
	ldr	r0, [fp, #-532]
	blx	r3
	str	r0, [fp, #-524]
	ldr	r3, [fp, #-524]
	cmn	r3, #1
	bne	.L46
	ldr	r0, [fp, #-532]
	bl	fclose
	ldr	r0, [fp, #-528]
	bl	fclose
	nop
	ldr	r3, .L48
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L47
	bl	__stack_chk_fail
.L47:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L49:
	.align	2
.L48:
	.word	.LC13
	.word	.LC7
	.word	stderr
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	510
	.size	convert_file, .-convert_file
	.data
	.align	2
	.type	readers, %object
	.size	readers, 12
readers:
	.word	get_dos
	.word	get_mac
	.word	get_unix
	.align	2
	.type	writers, %object
	.size	writers, 12
writers:
	.word	put_dos
	.word	put_mac
	.word	put_unix
	.section	.rodata
	.align	2
.LC14:
	.ascii	"-dos\000"
	.align	2
.LC15:
	.ascii	"-mac\000"
	.align	2
.LC16:
	.ascii	"-unix\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	arg_to_index, %function
arg_to_index:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r1, .L55
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L51
	mov	r3, #0
	b	.L52
.L51:
	ldr	r1, .L55+4
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L53
	mov	r3, #1
	b	.L52
.L53:
	ldr	r1, .L55+8
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L54
	mov	r3, #2
	b	.L52
.L54:
	mvn	r3, #0
.L52:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L56:
	.align	2
.L55:
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.size	arg_to_index, .-arg_to_index
	.section	.rodata
	.align	2
.LC17:
	.ascii	"converting %s to %s is a pointless conversion\012\000"
	.text
	.align	2
	.global	crnl_main
	.syntax unified
	.arm
	.fpu softvfp
	.type	crnl_main, %function
crnl_main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-24]
	cmp	r3, #3
	bgt	.L58
	bl	usage
.L58:
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	arg_to_index
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	arg_to_index
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L59
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L60
.L59:
	bl	usage
.L60:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	bne	.L61
	ldr	r3, .L65
	ldr	r0, [r3]
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r2, [r3]
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L65+4
	bl	fprintf
	mvn	r3, #0
	b	.L62
.L61:
	mov	r3, #3
	str	r3, [fp, #-16]
	b	.L63
.L64:
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r0, [r3]
	ldr	r2, .L65+8
	ldr	r3, [fp, #-12]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r2, .L65+12
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	mov	r2, r3
	bl	convert_file
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L63:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L64
	mov	r3, #0
.L62:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L66:
	.align	2
.L65:
	.word	stderr
	.word	.LC17
	.word	readers
	.word	writers
	.size	crnl_main, .-crnl_main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
