	.file	"108217.c"
	.intel_syntax noprefix
	.text
	.globl	get16bit
	.type	get16bit, @function
get16bit:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	or	eax, edx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get16bit, .-get16bit
	.globl	get32bit
	.type	get32bit, @function
get32bit:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 24
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 16
	or	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 2
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	or	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 3
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	or	eax, edx
	cdqe
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get32bit, .-get32bit
	.globl	getNameBackwards
	.type	getNameBackwards, @function
getNameBackwards:
.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, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -52[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -52[rbp], 0
	jne	.L8
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	ftell@PLT
	jmp	.L17
.L10:
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 1
	mov	rsi, -2
	mov	rdi, rax
	call	fseek@PLT
.L8:
	mov	rdx, QWORD PTR -40[rbp]
	lea	rax, -18[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	cmp	rax, 1
	jne	.L9
	movzx	eax, BYTE PTR -18[rbp]
	test	al, al
	je	.L10
.L9:
	mov	rax, QWORD PTR -48[rbp]
	mov	BYTE PTR [rax], 0
	mov	DWORD PTR -16[rbp], 1
.L13:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -52[rbp]
	jge	.L11
	movzx	edx, BYTE PTR -18[rbp]
	mov	eax, DWORD PTR -16[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	BYTE PTR [rax], dl
.L11:
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 1
	mov	rsi, -2
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -40[rbp]
	lea	rax, -18[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	movzx	eax, BYTE PTR -18[rbp]
	cmp	al, 1
	je	.L12
	movzx	eax, BYTE PTR -18[rbp]
	test	al, al
	je	.L12
	add	DWORD PTR -16[rbp], 1
	jmp	.L13
.L12:
	add	DWORD PTR -16[rbp], 1
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -52[rbp]
	jl	.L14
	mov	eax, DWORD PTR -52[rbp]
	sub	eax, 1
	mov	DWORD PTR -16[rbp], eax
.L14:
	mov	DWORD PTR -12[rbp], 0
	jmp	.L15
.L16:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -17[rbp], al
	mov	eax, DWORD PTR -16[rbp]
	sub	eax, 1
	sub	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -12[rbp]
	movsx	rcx, edx
	mov	rdx, QWORD PTR -48[rbp]
	add	rdx, rcx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	eax, DWORD PTR -16[rbp]
	sub	eax, 1
	sub	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -17[rbp]
	mov	BYTE PTR [rdx], al
	add	DWORD PTR -12[rbp], 1
.L15:
	mov	eax, DWORD PTR -16[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	cmp	DWORD PTR -12[rbp], eax
	jl	.L16
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	ftell@PLT
.L17:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	getNameBackwards, .-getNameBackwards
	.section	.rodata
.LC0:
	.string	"rb"
.LC1:
	.string	"wb"
	.text
	.globl	openOutFile
	.type	openOutFile, @function
openOutFile:
.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 -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	strlen@PLT
	add	rax, 1
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -24[rbp], rax
	jmp	.L20
.L22:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 92
	jne	.L21
	mov	rax, QWORD PTR -24[rbp]
	mov	BYTE PTR [rax], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 484
	mov	rdi, rax
	mov	eax, 0
	call	mkdir@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	BYTE PTR [rax], 92
.L21:
	add	QWORD PTR -24[rbp], 1
.L20:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L22
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L23
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	rdx, QWORD PTR -48[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	jmp	.L24
.L23:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 1
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	openOutFile, .-openOutFile
	.section	.rodata
.LC2:
	.string	"whdread 0.2\n"
	.align 8
.LC3:
	.string	"Usage: whdread foo.WHD streams.wav [foo.WAV]\n"
.LC4:
	.string	"Error opening %s for reading\n"
	.align 8
.LC5:
	.string	"couldn't guess a corresponding WAV for %s\n"
.LC6:
	.string	"Guessing %s as wav\n"
	.align 8
.LC7:
	.string	"WHD Size: %d\nLast offset: 0x%x\n\n"
.LC8:
	.string	"Error opening %s for output\n"
.LC9:
	.string	"****\ntype=DSP\nname=%s\n"
.LC10:
	.string	"offset=0x%x\nsize=0x%x\n"
.LC11:
	.string	"****\ntype=PCM\nname=%s\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 488
	.cfi_offset 3, -24
	mov	DWORD PTR -484[rbp], edi
	mov	QWORD PTR -496[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -432[rbp], 0
	lea	rdi, .LC2[rip]
	call	puts@PLT
	cmp	DWORD PTR -484[rbp], 3
	je	.L26
	cmp	DWORD PTR -484[rbp], 4
	je	.L26
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 45
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L51
.L26:
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -424[rbp], rax
	cmp	QWORD PTR -424[rbp], 0
	jne	.L28
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L51
.L28:
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -416[rbp], rax
	cmp	QWORD PTR -416[rbp], 0
	jne	.L29
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 16
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L51
.L29:
	cmp	DWORD PTR -484[rbp], 4
	jne	.L30
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -432[rbp], rax
	cmp	QWORD PTR -432[rbp], 0
	jne	.L31
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 24
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L51
.L30:
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 46
	mov	rdi, rax
	call	strrchr@PLT
	mov	QWORD PTR -408[rbp], rax
	cmp	QWORD PTR -408[rbp], 0
	jne	.L32
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L51
.L32:
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 1
	mov	BYTE PTR [rax], 87
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 2
	mov	BYTE PTR [rax], 65
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 3
	mov	BYTE PTR [rax], 86
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -432[rbp], rax
	cmp	QWORD PTR -432[rbp], 0
	jne	.L31
	mov	rax, QWORD PTR -496[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L31:
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -424[rbp]
	lea	rax, -400[rbp]
	mov	rcx, rdx
	mov	edx, 8
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	lea	rax, -400[rbp]
	mov	rdi, rax
	call	get32bit
	mov	rbx, rax
	lea	rax, -400[rbp]
	add	rax, 4
	mov	rdi, rax
	call	get32bit
	mov	rdx, rbx
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -400[rbp]
	mov	rdi, rax
	call	get32bit
	mov	DWORD PTR -472[rbp], eax
	mov	eax, DWORD PTR -472[rbp]
	sub	eax, 4
	movsx	rcx, eax
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	jmp	.L33
.L50:
	lea	rax, -400[rbp]
	mov	rdi, rax
	call	get32bit
	mov	DWORD PTR -452[rbp], eax
	cmp	DWORD PTR -452[rbp], 0
	jne	.L34
	mov	eax, DWORD PTR -472[rbp]
	sub	eax, 8
	movsx	rcx, eax
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -424[rbp]
	lea	rax, -400[rbp]
	mov	rcx, rdx
	mov	edx, 4
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	lea	rax, -400[rbp]
	mov	rdi, rax
	call	get32bit
	mov	DWORD PTR -444[rbp], eax
	mov	eax, DWORD PTR -444[rbp]
	sub	eax, 1
	mov	DWORD PTR -472[rbp], eax
	mov	eax, DWORD PTR -444[rbp]
	add	eax, 80
	movsx	rcx, eax
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -424[rbp]
	lea	rax, -400[rbp]
	mov	rcx, rdx
	mov	edx, 8
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	lea	rax, -400[rbp]
	mov	rdi, rax
	call	get32bit
	mov	DWORD PTR -468[rbp], eax
	lea	rax, -400[rbp]
	add	rax, 4
	mov	rdi, rax
	call	get32bit
	shr	rax
	movabs	rdx, 5270498306774157605
	mul	rdx
	mov	rax, rdx
	shr	rax
	add	rax, 1
	sal	eax, 3
	mov	DWORD PTR -464[rbp], eax
	mov	eax, DWORD PTR -472[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	lea	rcx, -288[rbp]
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 256
	mov	rsi, rcx
	mov	rdi, rax
	call	getNameBackwards
	mov	DWORD PTR -472[rbp], eax
	mov	eax, DWORD PTR -444[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	cmp	QWORD PTR -432[rbp], 0
	je	.L40
	lea	rdx, -440[rbp]
	lea	rax, -288[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	openOutFile
	test	eax, eax
	jne	.L40
	mov	rax, QWORD PTR -440[rbp]
	test	rax, rax
	jne	.L36
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -288[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L51
.L36:
	mov	rdx, QWORD PTR -424[rbp]
	lea	rax, -384[rbp]
	mov	rcx, rdx
	mov	edx, 96
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rdx, QWORD PTR -440[rbp]
	lea	rax, -384[rbp]
	mov	rcx, rdx
	mov	edx, 96
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	eax, DWORD PTR -468[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -432[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	eax, DWORD PTR -464[rbp]
	mov	DWORD PTR -460[rbp], eax
	jmp	.L37
.L38:
	mov	rdx, QWORD PTR -432[rbp]
	lea	rax, -400[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rdx, QWORD PTR -440[rbp]
	lea	rax, -400[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	sub	DWORD PTR -460[rbp], 16
.L37:
	cmp	DWORD PTR -460[rbp], 15
	jg	.L38
	cmp	DWORD PTR -460[rbp], 0
	je	.L39
	mov	eax, DWORD PTR -460[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -432[rbp]
	lea	rax, -400[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rcx, QWORD PTR -440[rbp]
	mov	eax, DWORD PTR -460[rbp]
	movsx	rdx, eax
	lea	rax, -400[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
.L39:
	mov	rax, QWORD PTR -440[rbp]
	mov	rdi, rax
	call	fclose@PLT
	jmp	.L40
.L34:
	cmp	DWORD PTR -452[rbp], 1
	jne	.L53
	sub	DWORD PTR -472[rbp], 50
	mov	eax, DWORD PTR -472[rbp]
	add	eax, 34
	movsx	rcx, eax
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -424[rbp]
	lea	rax, -400[rbp]
	mov	rcx, rdx
	mov	edx, 8
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	lea	rax, -400[rbp]
	mov	rdi, rax
	call	get32bit
	mov	DWORD PTR -468[rbp], eax
	lea	rax, -400[rbp]
	add	rax, 4
	mov	rdi, rax
	call	get32bit
	add	eax, eax
	mov	DWORD PTR -464[rbp], eax
	mov	eax, DWORD PTR -472[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	eax, DWORD PTR -472[rbp]
	mov	DWORD PTR -448[rbp], eax
	lea	rcx, -288[rbp]
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 256
	mov	rsi, rcx
	mov	rdi, rax
	call	getNameBackwards
	mov	DWORD PTR -472[rbp], eax
	mov	eax, DWORD PTR -448[rbp]
	add	eax, 2
	movsx	rcx, eax
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	lea	rdx, -440[rbp]
	lea	rax, -288[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	openOutFile
	test	eax, eax
	jne	.L40
	mov	rax, QWORD PTR -440[rbp]
	test	rax, rax
	jne	.L43
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -288[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L51
.L43:
	mov	rdx, QWORD PTR -424[rbp]
	lea	rax, -384[rbp]
	mov	rcx, rdx
	mov	edx, 48
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rdx, QWORD PTR -440[rbp]
	lea	rax, -384[rbp]
	mov	rcx, rdx
	mov	edx, 48
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	eax, DWORD PTR -468[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -416[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	eax, DWORD PTR -464[rbp]
	mov	DWORD PTR -456[rbp], eax
	jmp	.L44
.L45:
	mov	rdx, QWORD PTR -416[rbp]
	lea	rax, -400[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rdx, QWORD PTR -440[rbp]
	lea	rax, -400[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	sub	DWORD PTR -456[rbp], 16
.L44:
	cmp	DWORD PTR -456[rbp], 15
	jg	.L45
	cmp	DWORD PTR -456[rbp], 0
	je	.L46
	mov	eax, DWORD PTR -456[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -416[rbp]
	lea	rax, -400[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rcx, QWORD PTR -440[rbp]
	mov	eax, DWORD PTR -456[rbp]
	movsx	rdx, eax
	lea	rax, -400[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
.L46:
	mov	rax, QWORD PTR -440[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L40:
	cmp	DWORD PTR -452[rbp], 0
	jne	.L48
	lea	rax, -288[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, DWORD PTR -464[rbp]
	mov	eax, DWORD PTR -468[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
.L48:
	cmp	DWORD PTR -452[rbp], 1
	jne	.L49
	lea	rax, -288[rbp]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, DWORD PTR -464[rbp]
	mov	eax, DWORD PTR -468[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
.L49:
	mov	edi, 10
	call	putchar@PLT
	mov	eax, DWORD PTR -472[rbp]
	sub	eax, 4
	movsx	rcx, eax
	mov	rax, QWORD PTR -424[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
.L33:
	mov	rdx, QWORD PTR -424[rbp]
	lea	rax, -400[rbp]
	mov	rcx, rdx
	mov	edx, 4
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	cmp	rax, 4
	je	.L50
	jmp	.L47
.L53:
	nop
.L47:
	mov	eax, 0
.L51:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L52
	call	__stack_chk_fail@PLT
.L52:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-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	"108217.c"
	.text
	.align	2
	.global	get16bit
	.syntax unified
	.arm
	.fpu softvfp
	.type	get16bit, %function
get16bit:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #16
	asr	r3, r3, #16
	orr	r3, r2, r3
	lsl	r3, r3, #16
	asr	r3, r3, #16
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	get16bit, .-get16bit
	.align	2
	.global	get32bit
	.syntax unified
	.arm
	.fpu softvfp
	.type	get32bit, %function
get32bit:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r2, r3, #24
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #16
	orr	r2, r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #2
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	orr	r3, r2, r3
	ldr	r2, [fp, #-8]
	add	r2, r2, #3
	ldrb	r2, [r2]	@ zero_extendqisi2
	orr	r3, r3, r2
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	get32bit, .-get32bit
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	getNameBackwards
	.syntax unified
	.arm
	.fpu softvfp
	.type	getNameBackwards, %function
getNameBackwards:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r3, .L19
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L8
	ldr	r0, [fp, #-24]
	bl	ftell
	mov	r3, r0
	b	.L17
.L10:
	mov	r2, #1
	mvn	r1, #1
	ldr	r0, [fp, #-24]
	bl	fseek
.L8:
	sub	r0, fp, #18
	ldr	r3, [fp, #-24]
	mov	r2, #1
	mov	r1, #1
	bl	fread
	mov	r3, r0
	cmp	r3, #1
	bne	.L9
	ldrb	r3, [fp, #-18]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L10
.L9:
	ldr	r3, [fp, #-28]
	mov	r2, #0
	strb	r2, [r3]
	mov	r3, #1
	str	r3, [fp, #-16]
.L13:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	bge	.L11
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldrb	r2, [fp, #-18]	@ zero_extendqisi2
	strb	r2, [r3]
.L11:
	mov	r2, #1
	mvn	r1, #1
	ldr	r0, [fp, #-24]
	bl	fseek
	sub	r0, fp, #18
	ldr	r3, [fp, #-24]
	mov	r2, #1
	mov	r1, #1
	bl	fread
	ldrb	r3, [fp, #-18]	@ zero_extendqisi2
	cmp	r3, #1
	beq	.L12
	ldrb	r3, [fp, #-18]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L12
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L13
.L12:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	blt	.L14
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	str	r3, [fp, #-16]
.L14:
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L15
.L16:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldrb	r3, [r3]
	strb	r3, [fp, #-17]
	ldr	r3, [fp, #-16]
	sub	r2, r3, #1
	ldr	r3, [fp, #-12]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r2, r3, r2
	ldr	r3, [fp, #-12]
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	sub	r2, r3, #1
	ldr	r3, [fp, #-12]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldrb	r2, [fp, #-17]
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L15:
	ldr	r3, [fp, #-16]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-12]
	cmp	r3, r2
	blt	.L16
	ldr	r0, [fp, #-24]
	bl	ftell
	mov	r3, r0
.L17:
	ldr	r2, .L19
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC0
	.size	getNameBackwards, .-getNameBackwards
	.section	.rodata
	.align	2
.LC1:
	.ascii	"rb\000"
	.align	2
.LC2:
	.ascii	"wb\000"
	.text
	.align	2
	.global	openOutFile
	.syntax unified
	.arm
	.fpu softvfp
	.type	openOutFile, %function
openOutFile:
	@ 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	r0, [fp, #-24]
	bl	strlen
	mov	r3, r0
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-12]
	bl	strcpy
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-16]
	b	.L22
.L24:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #92
	bne	.L23
	ldr	r3, [fp, #-16]
	mov	r2, #0
	strb	r2, [r3]
	mov	r1, #484
	ldr	r0, [fp, #-12]
	bl	mkdir
	ldr	r3, [fp, #-16]
	mov	r2, #92
	strb	r2, [r3]
.L23:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L22:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L24
	ldr	r1, .L27
	ldr	r0, [fp, #-12]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L25
	ldr	r1, .L27+4
	ldr	r0, [fp, #-12]
	bl	fopen
	mov	r2, r0
	ldr	r3, [fp, #-28]
	str	r2, [r3]
	ldr	r0, [fp, #-12]
	bl	free
	mov	r3, #0
	b	.L26
.L25:
	ldr	r0, [fp, #-8]
	bl	fclose
	mov	r3, #1
.L26:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC1
	.word	.LC2
	.size	openOutFile, .-openOutFile
	.section	.rodata
	.align	2
.LC3:
	.ascii	"whdread 0.2\012\000"
	.align	2
.LC4:
	.ascii	"Usage: whdread foo.WHD streams.wav [foo.WAV]\012\000"
	.align	2
.LC5:
	.ascii	"Error opening %s for reading\012\000"
	.align	2
.LC6:
	.ascii	"couldn't guess a corresponding WAV for %s\012\000"
	.align	2
.LC7:
	.ascii	"Guessing %s as wav\012\000"
	.align	2
.LC8:
	.ascii	"WHD Size: %d\012Last offset: 0x%x\012\012\000"
	.align	2
.LC9:
	.ascii	"Error opening %s for output\012\000"
	.align	2
.LC10:
	.ascii	"****\012type=DSP\012name=%s\012\000"
	.align	2
.LC11:
	.ascii	"offset=0x%x\012size=0x%x\012\000"
	.align	2
.LC12:
	.ascii	"****\012type=PCM\012name=%s\012\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 432
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #436
	str	r0, [fp, #-440]
	str	r1, [fp, #-444]
	ldr	r3, .L58
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-432]
	ldr	r0, .L58+4
	bl	puts
	ldr	r3, [fp, #-440]
	cmp	r3, #3
	beq	.L30
	ldr	r3, [fp, #-440]
	cmp	r3, #4
	beq	.L30
	ldr	r3, .L58+8
	ldr	r3, [r3]
	mov	r2, #45
	mov	r1, #1
	ldr	r0, .L58+12
	bl	fwrite
	mov	r3, #1
	b	.L55
.L30:
	ldr	r3, [fp, #-444]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L58+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-408]
	ldr	r3, [fp, #-408]
	cmp	r3, #0
	bne	.L32
	ldr	r3, .L58+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-444]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L58+20
	bl	fprintf
	mov	r3, #1
	b	.L55
.L32:
	ldr	r3, [fp, #-444]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L58+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-404]
	ldr	r3, [fp, #-404]
	cmp	r3, #0
	bne	.L33
	ldr	r3, .L58+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-444]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L58+20
	bl	fprintf
	mov	r3, #1
	b	.L55
.L33:
	ldr	r3, [fp, #-440]
	cmp	r3, #4
	bne	.L34
	ldr	r3, [fp, #-444]
	add	r3, r3, #12
	ldr	r3, [r3]
	ldr	r1, .L58+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-432]
	ldr	r3, [fp, #-432]
	cmp	r3, #0
	bne	.L35
	ldr	r3, .L58+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-444]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L58+20
	bl	fprintf
	mov	r3, #1
	b	.L55
.L34:
	ldr	r3, [fp, #-444]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, #46
	mov	r0, r3
	bl	strrchr
	str	r0, [fp, #-400]
	ldr	r3, [fp, #-400]
	cmp	r3, #0
	bne	.L36
	ldr	r3, .L58+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-444]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L58+24
	bl	fprintf
	mov	r3, #1
	b	.L55
.L36:
	ldr	r3, [fp, #-400]
	add	r3, r3, #1
	mov	r2, #87
	strb	r2, [r3]
	ldr	r3, [fp, #-400]
	add	r3, r3, #2
	mov	r2, #65
	strb	r2, [r3]
	ldr	r3, [fp, #-400]
	add	r3, r3, #3
	mov	r2, #86
	strb	r2, [r3]
	ldr	r3, [fp, #-444]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L58+28
	bl	printf
	ldr	r3, [fp, #-444]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L58+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-432]
	ldr	r3, [fp, #-432]
	cmp	r3, #0
	bne	.L35
	ldr	r3, .L58+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-444]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L58+20
	bl	fprintf
.L35:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-408]
	bl	fseek
	sub	r0, fp, #384
	ldr	r3, [fp, #-408]
	mov	r2, #8
	mov	r1, #1
	bl	fread
	sub	r3, fp, #384
	add	r3, r3, #4
	mov	r0, r3
	bl	get32bit
	mov	r4, r0
	sub	r3, fp, #384
	mov	r0, r3
	bl	get32bit
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L58+32
	bl	printf
	sub	r3, fp, #384
	mov	r0, r3
	bl	get32bit
	mov	r3, r0
	str	r3, [fp, #-428]
	ldr	r3, [fp, #-428]
	sub	r3, r3, #4
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-408]
	bl	fseek
	b	.L37
.L54:
	sub	r3, fp, #384
	mov	r0, r3
	bl	get32bit
	mov	r3, r0
	str	r3, [fp, #-396]
	ldr	r3, [fp, #-396]
	cmp	r3, #0
	bne	.L38
	ldr	r3, [fp, #-428]
	sub	r3, r3, #8
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-408]
	bl	fseek
	sub	r0, fp, #384
	ldr	r3, [fp, #-408]
	mov	r2, #4
	mov	r1, #1
	bl	fread
	sub	r3, fp, #384
	mov	r0, r3
	bl	get32bit
	mov	r3, r0
	str	r3, [fp, #-388]
	ldr	r3, [fp, #-388]
	sub	r3, r3, #1
	str	r3, [fp, #-428]
	ldr	r3, [fp, #-388]
	add	r3, r3, #80
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-408]
	bl	fseek
	sub	r0, fp, #384
	ldr	r3, [fp, #-408]
	mov	r2, #8
	mov	r1, #1
	bl	fread
	sub	r3, fp, #384
	mov	r0, r3
	bl	get32bit
	mov	r3, r0
	str	r3, [fp, #-424]
	sub	r3, fp, #384
	add	r3, r3, #4
	mov	r0, r3
	bl	get32bit
	mov	r3, r0
	lsr	r3, r3, #1
	ldr	r2, .L58+36
	umull	r1, r3, r2, r3
	lsr	r3, r3, #2
	add	r3, r3, #1
	lsl	r3, r3, #3
	str	r3, [fp, #-420]
	mov	r2, #0
	ldr	r1, [fp, #-428]
	ldr	r0, [fp, #-408]
	bl	fseek
	sub	r3, fp, #272
	mov	r2, #256
	mov	r1, r3
	ldr	r0, [fp, #-408]
	bl	getNameBackwards
	str	r0, [fp, #-428]
	mov	r2, #0
	ldr	r1, [fp, #-388]
	ldr	r0, [fp, #-408]
	bl	fseek
	ldr	r3, [fp, #-432]
	cmp	r3, #0
	beq	.L44
	sub	r2, fp, #436
	sub	r3, fp, #272
	mov	r1, r2
	mov	r0, r3
	bl	openOutFile
	mov	r3, r0
	cmp	r3, #0
	bne	.L44
	ldr	r3, [fp, #-436]
	cmp	r3, #0
	bne	.L40
	ldr	r3, .L58+8
	ldr	r3, [r3]
	sub	r2, fp, #272
	ldr	r1, .L58+40
	mov	r0, r3
	bl	fprintf
	mov	r3, #1
	b	.L55
.L40:
	sub	r0, fp, #368
	ldr	r3, [fp, #-408]
	mov	r2, #96
	mov	r1, #1
	bl	fread
	ldr	r3, [fp, #-436]
	sub	r0, fp, #368
	mov	r2, #96
	mov	r1, #1
	bl	fwrite
	mov	r2, #0
	ldr	r1, [fp, #-424]
	ldr	r0, [fp, #-432]
	bl	fseek
	ldr	r3, [fp, #-420]
	str	r3, [fp, #-416]
	b	.L41
.L42:
	sub	r0, fp, #384
	ldr	r3, [fp, #-432]
	mov	r2, #16
	mov	r1, #1
	bl	fread
	ldr	r3, [fp, #-436]
	sub	r0, fp, #384
	mov	r2, #16
	mov	r1, #1
	bl	fwrite
	ldr	r3, [fp, #-416]
	sub	r3, r3, #16
	str	r3, [fp, #-416]
.L41:
	ldr	r3, [fp, #-416]
	cmp	r3, #15
	bgt	.L42
	ldr	r3, [fp, #-416]
	cmp	r3, #0
	beq	.L43
	ldr	r2, [fp, #-416]
	sub	r0, fp, #384
	ldr	r3, [fp, #-432]
	mov	r1, #1
	bl	fread
	ldr	r2, [fp, #-416]
	ldr	r3, [fp, #-436]
	sub	r0, fp, #384
	mov	r1, #1
	bl	fwrite
.L43:
	ldr	r3, [fp, #-436]
	mov	r0, r3
	bl	fclose
	b	.L44
.L38:
	ldr	r3, [fp, #-396]
	cmp	r3, #1
	bne	.L57
	ldr	r3, [fp, #-428]
	sub	r3, r3, #50
	str	r3, [fp, #-428]
	ldr	r3, [fp, #-428]
	add	r3, r3, #34
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-408]
	bl	fseek
	sub	r0, fp, #384
	ldr	r3, [fp, #-408]
	mov	r2, #8
	mov	r1, #1
	bl	fread
	sub	r3, fp, #384
	mov	r0, r3
	bl	get32bit
	mov	r3, r0
	str	r3, [fp, #-424]
	sub	r3, fp, #384
	add	r3, r3, #4
	mov	r0, r3
	bl	get32bit
	mov	r3, r0
	lsl	r3, r3, #1
	str	r3, [fp, #-420]
	mov	r2, #0
	ldr	r1, [fp, #-428]
	ldr	r0, [fp, #-408]
	bl	fseek
	ldr	r3, [fp, #-428]
	str	r3, [fp, #-392]
	sub	r3, fp, #272
	mov	r2, #256
	mov	r1, r3
	ldr	r0, [fp, #-408]
	bl	getNameBackwards
	str	r0, [fp, #-428]
	ldr	r3, [fp, #-392]
	add	r3, r3, #2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-408]
	bl	fseek
	sub	r2, fp, #436
	sub	r3, fp, #272
	mov	r1, r2
	mov	r0, r3
	bl	openOutFile
	mov	r3, r0
	cmp	r3, #0
	bne	.L44
	ldr	r3, [fp, #-436]
	cmp	r3, #0
	bne	.L47
	ldr	r3, .L58+8
	ldr	r3, [r3]
	sub	r2, fp, #272
	ldr	r1, .L58+40
	mov	r0, r3
	bl	fprintf
	mov	r3, #1
	b	.L55
.L47:
	sub	r0, fp, #368
	ldr	r3, [fp, #-408]
	mov	r2, #48
	mov	r1, #1
	bl	fread
	ldr	r3, [fp, #-436]
	sub	r0, fp, #368
	mov	r2, #48
	mov	r1, #1
	bl	fwrite
	mov	r2, #0
	ldr	r1, [fp, #-424]
	ldr	r0, [fp, #-404]
	bl	fseek
	ldr	r3, [fp, #-420]
	str	r3, [fp, #-412]
	b	.L48
.L49:
	sub	r0, fp, #384
	ldr	r3, [fp, #-404]
	mov	r2, #16
	mov	r1, #1
	bl	fread
	ldr	r3, [fp, #-436]
	sub	r0, fp, #384
	mov	r2, #16
	mov	r1, #1
	bl	fwrite
	ldr	r3, [fp, #-412]
	sub	r3, r3, #16
	str	r3, [fp, #-412]
.L48:
	ldr	r3, [fp, #-412]
	cmp	r3, #15
	bgt	.L49
	ldr	r3, [fp, #-412]
	cmp	r3, #0
	beq	.L50
	ldr	r2, [fp, #-412]
	sub	r0, fp, #384
	ldr	r3, [fp, #-404]
	mov	r1, #1
	bl	fread
	ldr	r2, [fp, #-412]
	ldr	r3, [fp, #-436]
	sub	r0, fp, #384
	mov	r1, #1
	bl	fwrite
.L50:
	ldr	r3, [fp, #-436]
	mov	r0, r3
	bl	fclose
.L44:
	ldr	r3, [fp, #-396]
	cmp	r3, #0
	bne	.L52
	sub	r3, fp, #272
	mov	r1, r3
	ldr	r0, .L58+44
	bl	printf
	ldr	r2, [fp, #-420]
	ldr	r1, [fp, #-424]
	ldr	r0, .L58+48
	bl	printf
.L52:
	ldr	r3, [fp, #-396]
	cmp	r3, #1
	bne	.L53
	sub	r3, fp, #272
	mov	r1, r3
	ldr	r0, .L58+52
	bl	printf
	ldr	r2, [fp, #-420]
	ldr	r1, [fp, #-424]
	ldr	r0, .L58+48
	bl	printf
.L53:
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-428]
	sub	r3, r3, #4
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-408]
	bl	fseek
.L37:
	sub	r0, fp, #384
	ldr	r3, [fp, #-408]
	mov	r2, #4
	mov	r1, #1
	bl	fread
	mov	r3, r0
	cmp	r3, #4
	beq	.L54
	b	.L51
.L57:
	nop
.L51:
	mov	r3, #0
.L55:
	ldr	r2, .L58
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L56
	bl	__stack_chk_fail
.L56:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L59:
	.align	2
.L58:
	.word	.LC13
	.word	.LC3
	.word	stderr
	.word	.LC4
	.word	.LC1
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	-1840700269
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
