	.file	"928206.c"
	.intel_syntax noprefix
	.text
	.globl	version
	.data
	.align 8
	.type	version, @object
	.size	version, 8
version:
	.string	"EEPROM_"
	.globl	st_orig
	.align 16
	.type	st_orig, @object
	.size	st_orig, 20
st_orig:
	.ascii	"\016H9h\001`\016Hyh"
	.ascii	"\023K\030`\023H\001`\023I"
	.globl	st_repl
	.align 16
	.type	st_repl, @object
	.size	st_repl, 20
st_repl:
	.string	""
	.string	"H"
	.ascii	"G\001\377\377\byh"
	.string	"\001L G"
	.string	""
	.ascii	"\001\377\377\b"
	.globl	fl_orig
	.align 32
	.type	fl_orig, @object
	.size	fl_orig, 48
fl_orig:
	.string	"\320 "
	.string	"\005\001\210\001\"\b\034\020@\002\034\021\004\b\f"
	.ascii	"(\001\320\033\340"
	.string	"\320!\t\005\001#\fJ\b\210\030@"
	.string	"(\b\321\020x"
	.ascii	"(\370\320\b\210"
	.globl	fl_repl
	.align 32
	.type	fl_repl, @object
	.size	fl_repl, 48
fl_repl:
	.string	"\340 "
	.string	"\005\001\210\001\"\b\034\020@\002\034\021\004\b\f"
	.ascii	"(\001\320\033\340"
	.string	"\340!\t\005\001#\fJ\b\210\030@"
	.string	"(\b\321\020x"
	.ascii	"(\370\320\b\210"
	.globl	p_repl
	.align 32
	.type	p_repl, @object
	.size	p_repl, 376
p_repl:
	.string	"9h'H\201B#\320\211\034\b\210\001(\002\321$Hx`3\340"
	.string	"#"
	.string	"\"\211\034\020\264\001$\bh @["
	.string	"\003C\211\034R\034\006*\367\321\020\2749`\333\001\002 "
	.string	"\002\033\030\016 "
	.string	"\006\033\030{`9\034\b1\b\210\t8\b\200\026\340\025I"
	.string	"#"
	.string	"\"\020\264\001$\bh @["
	.string	"\003C\211\034R\034\006*\367\321\020\274\333\001\002 "
	.string	"\002\033\030\016 "
	.string	"\006\033\030\b;;`\013H9h\001`\nHyh\001`\nH9\034\b1\n\210\200!\t\006\nC\002`\007H"
	.string	"G"
	.string	""
	.string	""
	.string	""
	.string	""
	.string	"\r"
	.string	""
	.string	""
	.string	"\016\004"
	.string	""
	.string	"\016\324"
	.string	""
	.string	"\004\330"
	.string	""
	.string	"\004\334"
	.string	""
	.ascii	"\004\377\377\377\b"
	.string	"\"L\204B \320\200\034\004\210\001%,@\001,\002\321\200\036\036I.\340"
	.string	"#"
	.string	"$\200\034@\264\001&\005h5@["
	.string	"+C\200\034d\034\006,\367\321@\274\333\001\002$$\002\033\031\016$$\006\033\031\031\034\t:\026\340\022H"
	.string	"#"
	.string	"$@\264\001&\005h5@["
	.string	"+C\200\034d\034\006,\367\321@\274\333\001\002$$\002\033\031\016$$\006\033\031\b;\030\034\bL `\bL!`\bI\200 "
	.string	"\006\002C\n`\006L G"
	.string	""
	.string	""
	.string	"\r"
	.string	""
	.string	""
	.string	"\016\004"
	.string	""
	.string	"\016\324"
	.string	""
	.string	"\004\330"
	.string	""
	.string	"\004\334"
	.string	""
	.string	"\004\377\377\377\b"
	.zero	19
	.globl	p_size
	.align 8
	.type	p_size, @object
	.size	p_size, 8
p_size:
	.long	188
	.long	168
	.text
	.globl	find
	.type	find, @function
find:
.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 -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	QWORD PTR -56[rbp], rdx
	mov	DWORD PTR -48[rbp], ecx
	mov	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	QWORD PTR -16[rbp], rax
	mov	eax, DWORD PTR -48[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR -24[rbp], rax
	mov	DWORD PTR -28[rbp], 0
	jmp	.L2
.L6:
	mov	rax, QWORD PTR -40[rbp]
	movzx	edx, BYTE PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	dl, al
	jne	.L3
	add	QWORD PTR -24[rbp], 1
	mov	rax, QWORD PTR -24[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	jne	.L4
	jmp	.L5
.L3:
	mov	rax, QWORD PTR -24[rbp]
	cmp	rax, QWORD PTR -56[rbp]
	je	.L4
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR -24[rbp], rax
	sub	QWORD PTR -40[rbp], 1
.L4:
	add	QWORD PTR -40[rbp], 1
.L2:
	mov	rax, QWORD PTR -40[rbp]
	cmp	rax, QWORD PTR -16[rbp]
	jb	.L6
.L5:
	mov	rax, QWORD PTR -24[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	jne	.L7
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	mov	edx, 1
	sub	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	jmp	.L9
.L7:
	mov	eax, 0
.L9:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	find, .-find
	.globl	find_freespace
	.type	find_freespace, @function
find_freespace:
.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 -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -13[rbp], al
	jmp	.L11
.L12:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, 1
	mov	QWORD PTR -8[rbp], rax
.L11:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	BYTE PTR -13[rbp], al
	je	.L12
	add	QWORD PTR -8[rbp], 1
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	add	eax, 255
	mov	al, 0
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rcx
	cmp	rdx, rax
	jnb	.L13
	mov	rax, QWORD PTR -8[rbp]
	jmp	.L14
.L13:
	mov	eax, 0
.L14:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	find_freespace, .-find_freespace
	.section	.rodata
	.align 8
.LC0:
	.string	"Found SRAM library v%d.%d.%d at offset 0x%x\n"
.LC1:
	.string	"Found free space at 0x%x\n"
.LC2:
	.string	"Patch done!"
.LC3:
	.string	"Couldn't find fl location"
.LC4:
	.string	"Couldn't find st location"
	.text
	.globl	patch_sram
	.type	patch_sram, @function
patch_sram:
.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 -56[rbp], rdi
	mov	DWORD PTR -60[rbp], esi
	mov	eax, DWORD PTR -60[rbp]
	lea	esi, -180[rax]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, 180
	mov	ecx, 7
	lea	rdx, version[rip]
	mov	rdi, rax
	call	find
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	je	.L16
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 8
	movzx	eax, BYTE PTR [rax]
	sub	eax, 48
	mov	BYTE PTR -43[rbp], al
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 9
	movzx	eax, BYTE PTR [rax]
	sub	eax, 48
	mov	BYTE PTR -42[rbp], al
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 10
	movzx	eax, BYTE PTR [rax]
	sub	eax, 48
	mov	BYTE PTR -41[rbp], al
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	movsx	ecx, BYTE PTR -41[rbp]
	movsx	edx, BYTE PTR -42[rbp]
	movsx	eax, BYTE PTR -43[rbp]
	mov	r8, rsi
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	lea	rdx, st_orig[rip]
	add	rdx, rax
	mov	eax, DWORD PTR -60[rbp]
	lea	esi, -180[rax]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, 180
	mov	ecx, 10
	mov	rdi, rax
	call	find
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L17
	mov	rax, QWORD PTR -16[rbp]
	sub	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR -40[rbp], eax
	movsx	eax, BYTE PTR -42[rbp]
	cmp	eax, 1
	je	.L18
	cmp	eax, 2
	je	.L19
	jmp	.L20
.L18:
	mov	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	lea	ecx, 33[rdx]
	cdqe
	imul	rax, rax, 188
	lea	rdx, p_repl[rip+184]
	mov	BYTE PTR [rax+rdx], cl
	mov	eax, DWORD PTR -40[rbp]
	sar	eax, 16
	mov	edx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	mov	ecx, edx
	cdqe
	imul	rax, rax, 188
	lea	rdx, p_repl[rip+186]
	mov	BYTE PTR [rax+rdx], cl
	jmp	.L20
.L19:
	mov	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	lea	ecx, 19[rdx]
	cdqe
	imul	rax, rax, 188
	lea	rdx, p_repl[rip+164]
	mov	BYTE PTR [rax+rdx], cl
	mov	eax, DWORD PTR -40[rbp]
	sar	eax, 8
	mov	edx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	mov	ecx, edx
	cdqe
	imul	rax, rax, 188
	lea	rdx, p_repl[rip+165]
	mov	BYTE PTR [rax+rdx], cl
	mov	eax, DWORD PTR -40[rbp]
	sar	eax, 16
	mov	edx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	mov	ecx, edx
	cdqe
	imul	rax, rax, 188
	lea	rdx, p_repl[rip+166]
	mov	BYTE PTR [rax+rdx], cl
	nop
.L20:
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	lea	rdx, fl_orig[rip]
	add	rdx, rax
	mov	eax, DWORD PTR -60[rbp]
	lea	esi, -180[rax]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, 180
	mov	ecx, 24
	mov	rdi, rax
	call	find
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L21
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	lea	rdx, fl_repl[rip]
	lea	rcx, [rax+rdx]
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 24
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
	mov	ecx, DWORD PTR -60[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	edx, 200
	mov	esi, ecx
	mov	rdi, rax
	call	find_freespace
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], 0
	je	.L16
	mov	rax, QWORD PTR -32[rbp]
	sub	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR -36[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	sub	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	movsx	eax, BYTE PTR -42[rbp]
	cmp	eax, 1
	je	.L22
	cmp	eax, 2
	je	.L23
	jmp	.L24
.L22:
	sub	QWORD PTR -32[rbp], 1
	add	DWORD PTR -40[rbp], 31
	mov	eax, DWORD PTR -40[rbp]
	sar	eax, 8
	mov	edx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	mov	ecx, edx
	cdqe
	imul	rax, rax, 188
	lea	rdx, p_repl[rip+185]
	mov	BYTE PTR [rax+rdx], cl
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 8
	mov	edx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	mov	ecx, edx
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	mov	rdx, rax
	lea	rax, st_repl[rip+5]
	mov	BYTE PTR [rdx+rax], cl
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 16
	mov	edx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	mov	ecx, edx
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	mov	rdx, rax
	lea	rax, st_repl[rip+6]
	mov	BYTE PTR [rdx+rax], cl
	add	QWORD PTR -32[rbp], 1
	jmp	.L24
.L23:
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 8
	mov	edx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	mov	ecx, edx
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	mov	rdx, rax
	lea	rax, st_repl[rip+7]
	mov	BYTE PTR [rdx+rax], cl
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 16
	mov	edx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	mov	ecx, edx
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	mov	rdx, rax
	lea	rax, st_repl[rip+8]
	mov	BYTE PTR [rdx+rax], cl
	nop
.L24:
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	lea	rdx, st_repl[rip]
	lea	rcx, [rax+rdx]
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 10
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, p_size[rip]
	mov	eax, DWORD PTR [rdx+rax]
	movsx	rdx, eax
	movsx	eax, BYTE PTR -42[rbp]
	sub	eax, 1
	cdqe
	imul	rax, rax, 188
	lea	rcx, p_repl[rip]
	add	rcx, rax
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	jmp	.L16
.L21:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	jmp	.L16
.L17:
	lea	rdi, .LC4[rip]
	call	puts@PLT
.L16:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	patch_sram, .-patch_sram
	.globl	fix_roms
	.bss
	.align 4
	.type	fix_roms, @object
	.size	fix_roms, 4
fix_roms:
	.zero	4
	.globl	return_patch
	.align 4
	.type	return_patch, @object
	.size	return_patch, 4
return_patch:
	.zero	4
	.globl	sram_patch
	.align 4
	.type	sram_patch, @object
	.size	sram_patch, 4
sram_patch:
	.zero	4
	.globl	good_header
	.section	.rodata
	.align 32
	.type	good_header, @object
	.size	good_header, 156
good_header:
	.string	"$\377\256Qi\232\242!=\204\202\n\204\344\t\255\021$\213\230\300\201\177!\243R\276\031\223\t\316 \020FJJ\370'1\354X\307\3503\202\343\316\277\205\364\337\224\316K\t\301\224V\212\300\023r\247\374\237\204Ms\243\312\232aX\227\243'\374\003\230v#\035\307a\003\004\256V\2778\204"
	.string	"@\247\016\375\377R\376\003o\2250\361\227\373\300\205`\326\200%\251c\276\003\001N8\342\371\2424\377\273>\003Dx"
	.ascii	"\220\313\210\021:\224e\300|c\207\360<\257\326%\344\2138\n\254"
	.ascii	"r!\324\370\007"
	.globl	visoly
	.align 32
	.type	visoly, @object
	.size	visoly, 132
visoly:
	.string	"\003\024\240\343\001"
	.string	"\217\342\020\377/\341\003\242L\034\032#\001\312\001\301\001;\373\321 G\017\240~\310\r\2000\034"
	.string	"\360\022\370\025\200 \034"
	.string	"\360\016\370\r\200\025\200\017\240\034\200\030\310\036\200 \034"
	.string	"\360\005\370\r\200\rI\017\200\001\337"
	.string	"\337\372'\177"
	.string	"\020\200\001?\374\321pG"
	.string	""
	.string	""
	.string	""
	.string	"\250\3540\t\212F\002\b"
	.string	"\250\354\bxV"
	.string	""
	.string	"TS"
	.string	""
	.string	"4\022"
	.string	""
	.string	"\240h\002\b\315\253"
	.string	""
	.string	".Yk\t\300"
	.string	""
	.ascii	"\b"
	.globl	bin_offset
	.bss
	.align 4
	.type	bin_offset, @object
	.size	bin_offset, 4
bin_offset:
	.zero	4
	.globl	bincount
	.align 4
	.type	bincount, @object
	.size	bincount, 4
bincount:
	.zero	4
	.globl	smallcount
	.data
	.align 4
	.type	smallcount, @object
	.size	smallcount, 4
smallcount:
	.long	1
	.globl	binfiles
	.bss
	.align 32
	.type	binfiles, @object
	.size	binfiles, 1024
binfiles:
	.zero	1024
	.globl	spaces
	.section	.rodata
	.align 32
	.type	spaces, @object
	.size	spaces, 61
spaces:
	.string	"                                                            "
.LC5:
	.string	"%.*s[%s]\n"
.LC6:
	.string	"%.*s%s (%d bytes)\n"
	.text
	.globl	print_tree
	.type	print_tree, @function
print_tree:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	DWORD PTR -12[rbp], esi
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 272[rax]
	test	rax, rax
	je	.L26
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -12[rbp]
	lea	esi, [rdx+rdx]
	mov	rcx, rax
	lea	rdx, spaces[rip]
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 272[rax]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L27
.L28:
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	print_tree
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 264[rax]
	mov	QWORD PTR -8[rbp], rax
.L27:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L28
	jmp	.L30
.L26:
	mov	rax, QWORD PTR -8[rbp]
	mov	ecx, DWORD PTR 256[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -12[rbp]
	lea	esi, [rdx+rdx]
	mov	r8d, ecx
	mov	rcx, rax
	lea	rdx, spaces[rip]
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
.L30:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	print_tree, .-print_tree
	.globl	recsize
	.type	recsize, @function
recsize:
.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 -24[rbp], rdi
	mov	DWORD PTR -12[rbp], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 280[rax]
	cmp	eax, 1
	je	.L32
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 256[rax]
	add	eax, 3
	and	eax, -4
	mov	DWORD PTR -12[rbp], eax
.L32:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 272[rax]
	test	rax, rax
	je	.L33
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 272[rax]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L34
.L35:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	recsize
	add	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	add	eax, 3
	and	eax, -4
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 264[rax]
	mov	QWORD PTR -8[rbp], rax
.L34:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L35
.L33:
	mov	eax, DWORD PTR -12[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	recsize, .-recsize
	.globl	recbinsize
	.type	recbinsize, @function
recbinsize:
.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 -24[rbp], rdi
	mov	DWORD PTR -12[rbp], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 280[rax]
	cmp	eax, 1
	jne	.L38
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 256[rax]
	mov	DWORD PTR -12[rbp], eax
.L38:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 272[rax]
	test	rax, rax
	je	.L39
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 272[rax]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L40
.L41:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	recbinsize
	add	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 264[rax]
	mov	QWORD PTR -8[rbp], rax
.L40:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L41
.L39:
	mov	eax, DWORD PTR -12[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	recbinsize, .-recbinsize
	.globl	cutname
	.type	cutname, @function
cutname:
.LFB12:
	.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, 56
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -52[rbp], edx
	mov	rax, QWORD PTR -48[rbp]
	mov	esi, 46
	mov	rdi, rax
	call	strrchr@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	eax, DWORD PTR -52[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	cmp	QWORD PTR -24[rbp], 0
	je	.L45
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rbx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	rbx, rax
	mov	rdx, rbx
	mov	rax, QWORD PTR -40[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	strcpy@PLT
.L45:
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	cutname, .-cutname
	.section	.rodata
.LC7:
	.string	"rb"
	.text
	.globl	dump_tree
	.type	dump_tree, @function
dump_tree:
.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 2144
	mov	QWORD PTR -10312[rbp], rdi
	mov	QWORD PTR -10320[rbp], rsi
	mov	DWORD PTR -10324[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -10312[rbp]
	mov	rax, QWORD PTR 272[rax]
	test	rax, rax
	je	.L47
	mov	rax, QWORD PTR -10312[rbp]
	mov	rax, QWORD PTR 272[rax]
	mov	QWORD PTR -10288[rbp], rax
	mov	DWORD PTR -10296[rbp], 0
	jmp	.L48
.L49:
	add	DWORD PTR -10296[rbp], 1
	mov	rax, QWORD PTR -10288[rbp]
	mov	rax, QWORD PTR 264[rax]
	mov	QWORD PTR -10288[rbp], rax
.L48:
	cmp	QWORD PTR -10288[rbp], 0
	jne	.L49
	mov	eax, DWORD PTR -10296[rbp]
	cdqe
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	sal	eax, 3
	mov	edx, eax
	mov	eax, DWORD PTR -10324[rbp]
	add	eax, edx
	mov	DWORD PTR -10324[rbp], eax
	mov	rax, QWORD PTR -10312[rbp]
	mov	rax, QWORD PTR 272[rax]
	mov	QWORD PTR -10288[rbp], rax
	mov	DWORD PTR -10296[rbp], 0
	jmp	.L50
.L56:
	lea	rcx, -10256[rbp]
	mov	eax, DWORD PTR -10296[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	mov	edx, 32
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rax, QWORD PTR -10288[rbp]
	mov	esi, 47
	mov	rdi, rax
	call	strrchr@PLT
	mov	QWORD PTR -10280[rbp], rax
	cmp	QWORD PTR -10280[rbp], 0
	je	.L51
	add	QWORD PTR -10280[rbp], 1
	jmp	.L52
.L51:
	mov	rax, QWORD PTR -10288[rbp]
	mov	QWORD PTR -10280[rbp], rax
.L52:
	lea	rcx, -10256[rbp]
	mov	eax, DWORD PTR -10296[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rcx, rax
	mov	rax, QWORD PTR -10280[rbp]
	mov	edx, 31
	mov	rsi, rax
	mov	rdi, rcx
	call	cutname
	mov	rax, QWORD PTR -10288[rbp]
	mov	edx, DWORD PTR 256[rax]
	mov	eax, DWORD PTR -10296[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	sal	rax, 2
	add	rax, rcx
	sal	rax, 3
	add	rax, rbp
	sub	rax, 10224
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -10288[rbp]
	mov	rax, QWORD PTR 272[rax]
	test	rax, rax
	je	.L53
	mov	eax, DWORD PTR -10296[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	sub	rax, 10224
	mov	eax, DWORD PTR [rax]
	or	eax, -2147483648
	mov	ecx, eax
	mov	eax, DWORD PTR -10296[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	sub	rax, 10224
	mov	DWORD PTR [rax], ecx
.L53:
	mov	rax, QWORD PTR -10288[rbp]
	mov	eax, DWORD PTR 280[rax]
	cmp	eax, 1
	jne	.L54
	mov	rax, QWORD PTR -10288[rbp]
	mov	esi, DWORD PTR 284[rax]
	mov	ecx, DWORD PTR bin_offset[rip]
	mov	eax, DWORD PTR -10296[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -10296[rbp], edx
	add	ecx, esi
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	sub	rax, 10220
	mov	DWORD PTR [rax], ecx
	jmp	.L55
.L54:
	mov	eax, DWORD PTR -10296[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -10296[rbp], edx
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	lea	rdx, -10220[rax]
	mov	eax, DWORD PTR -10324[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -10288[rbp]
	mov	rdi, rax
	call	recsize
	mov	DWORD PTR -10292[rbp], eax
	mov	eax, DWORD PTR -10292[rbp]
	add	DWORD PTR -10324[rbp], eax
.L55:
	mov	rax, QWORD PTR -10288[rbp]
	mov	rax, QWORD PTR 264[rax]
	mov	QWORD PTR -10288[rbp], rax
.L50:
	cmp	QWORD PTR -10288[rbp], 0
	jne	.L56
	mov	eax, DWORD PTR -10296[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	mov	rsi, rax
	mov	rdx, QWORD PTR -10320[rbp]
	lea	rax, -10256[rbp]
	mov	rcx, rdx
	mov	rdx, rsi
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -10312[rbp]
	mov	rax, QWORD PTR 272[rax]
	mov	QWORD PTR -10288[rbp], rax
	mov	DWORD PTR -10296[rbp], 0
	jmp	.L57
.L58:
	mov	eax, DWORD PTR -10296[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -10296[rbp], edx
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	sub	rax, 10220
	mov	edx, DWORD PTR [rax]
	mov	rcx, QWORD PTR -10320[rbp]
	mov	rax, QWORD PTR -10288[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	dump_tree
	mov	rax, QWORD PTR -10288[rbp]
	mov	rax, QWORD PTR 264[rax]
	mov	QWORD PTR -10288[rbp], rax
.L57:
	cmp	QWORD PTR -10288[rbp], 0
	jne	.L58
	jmp	.L61
.L47:
	mov	rax, QWORD PTR -10312[rbp]
	mov	eax, DWORD PTR 256[rax]
	test	eax, eax
	je	.L61
	mov	rax, QWORD PTR -10312[rbp]
	mov	eax, DWORD PTR 280[rax]
	cmp	eax, 1
	je	.L61
	mov	rax, QWORD PTR -10312[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -10272[rbp], rax
	mov	rax, QWORD PTR -10312[rbp]
	mov	eax, DWORD PTR 256[rax]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -10264[rbp], rax
	mov	rax, QWORD PTR -10312[rbp]
	mov	eax, DWORD PTR 256[rax]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -10272[rbp]
	mov	rax, QWORD PTR -10264[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -10312[rbp]
	mov	eax, DWORD PTR 256[rax]
	add	eax, 3
	mov	eax, eax
	and	eax, 4294967292
	mov	rdx, rax
	mov	rcx, QWORD PTR -10320[rbp]
	mov	rax, QWORD PTR -10264[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -10272[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -10264[rbp]
	mov	rdi, rax
	call	free@PLT
.L61:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L60
	call	__stack_chk_fail@PLT
.L60:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	dump_tree, .-dump_tree
	.section	.rodata
.LC8:
	.string	"%s/%s"
.LC9:
	.string	"bin"
.LC10:
	.string	"gba"
	.text
	.globl	make_tree
	.type	make_tree, @function
make_tree:
.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, 240
	mov	QWORD PTR -232[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -232[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -212[rbp], eax
	mov	eax, DWORD PTR -212[rbp]
	sub	eax, 1
	mov	rdx, QWORD PTR -232[rbp]
	cdqe
	movzx	eax, BYTE PTR [rdx+rax]
	cmp	al, 47
	jne	.L63
	mov	eax, DWORD PTR -212[rbp]
	sub	eax, 1
	mov	rdx, QWORD PTR -232[rbp]
	cdqe
	mov	BYTE PTR [rdx+rax], 0
.L63:
	mov	rax, QWORD PTR -232[rbp]
	lea	rdx, -160[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	cmp	eax, -1
	je	.L77
	mov	eax, DWORD PTR -136[rbp]
	and	eax, 16384
	test	eax, eax
	je	.L65
	mov	DWORD PTR -216[rbp], 0
	mov	QWORD PTR -200[rbp], 0
	mov	rax, QWORD PTR -232[rbp]
	mov	QWORD PTR 272[rax], 0
	mov	rax, QWORD PTR -232[rbp]
	mov	rdi, rax
	call	opendir@PLT
	mov	QWORD PTR -176[rbp], rax
	mov	QWORD PTR -208[rbp], 0
	jmp	.L66
.L70:
	mov	rax, QWORD PTR -168[rbp]
	add	rax, 19
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 2
	ja	.L67
	mov	rax, QWORD PTR -168[rbp]
	movzx	eax, BYTE PTR 19[rax]
	cmp	al, 46
	je	.L66
.L67:
	mov	edi, 288
	call	malloc@PLT
	mov	QWORD PTR -208[rbp], rax
	mov	rax, QWORD PTR -232[rbp]
	mov	rax, QWORD PTR 272[rax]
	test	rax, rax
	jne	.L68
	mov	rax, QWORD PTR -232[rbp]
	mov	rdx, QWORD PTR -208[rbp]
	mov	QWORD PTR 272[rax], rdx
.L68:
	mov	rax, QWORD PTR -168[rbp]
	lea	rcx, 19[rax]
	mov	rdx, QWORD PTR -232[rbp]
	mov	rax, QWORD PTR -208[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -208[rbp]
	mov	rdi, rax
	call	make_tree
	cmp	QWORD PTR -200[rbp], 0
	je	.L69
	mov	rax, QWORD PTR -200[rbp]
	mov	rdx, QWORD PTR -208[rbp]
	mov	QWORD PTR 264[rax], rdx
.L69:
	mov	rax, QWORD PTR -208[rbp]
	mov	QWORD PTR -200[rbp], rax
	add	DWORD PTR -216[rbp], 1
.L66:
	mov	rax, QWORD PTR -176[rbp]
	mov	rdi, rax
	call	readdir@PLT
	mov	QWORD PTR -168[rbp], rax
	cmp	QWORD PTR -168[rbp], 0
	jne	.L70
	cmp	QWORD PTR -208[rbp], 0
	je	.L71
	mov	rax, QWORD PTR -208[rbp]
	mov	QWORD PTR 264[rax], 0
.L71:
	mov	eax, DWORD PTR -216[rbp]
	cdqe
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	sal	eax, 3
	mov	edx, eax
	mov	rax, QWORD PTR -232[rbp]
	mov	DWORD PTR 256[rax], edx
	mov	rax, QWORD PTR -176[rbp]
	mov	rdi, rax
	call	closedir@PLT
	jmp	.L77
.L65:
	mov	rax, QWORD PTR -232[rbp]
	mov	esi, 46
	mov	rdi, rax
	call	strrchr@PLT
	mov	QWORD PTR -184[rbp], rax
	cmp	QWORD PTR -184[rbp], 0
	je	.L72
	add	QWORD PTR -184[rbp], 1
	mov	rax, QWORD PTR -184[rbp]
	mov	QWORD PTR -192[rbp], rax
	jmp	.L73
.L74:
	mov	rax, QWORD PTR -192[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	call	tolower@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -192[rbp]
	mov	BYTE PTR [rax], dl
	add	QWORD PTR -192[rbp], 1
.L73:
	mov	rax, QWORD PTR -192[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L74
	mov	rax, QWORD PTR -184[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L75
	mov	rax, QWORD PTR -184[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L72
.L75:
	mov	rax, QWORD PTR -232[rbp]
	mov	DWORD PTR 280[rax], 1
	mov	eax, DWORD PTR bincount[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR bincount[rip], edx
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rdx, binfiles[rip]
	mov	rax, QWORD PTR -232[rbp]
	mov	QWORD PTR [rcx+rdx], rax
.L72:
	mov	rax, QWORD PTR -232[rbp]
	mov	QWORD PTR 272[rax], 0
	mov	rax, QWORD PTR -112[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -232[rbp]
	mov	DWORD PTR 256[rax], edx
.L77:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L76
	call	__stack_chk_fail@PLT
.L76:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	make_tree, .-make_tree
	.globl	rootdir
	.bss
	.align 8
	.type	rootdir, @object
	.size	rootdir, 8
rootdir:
	.zero	8
	.data
	.align 4
	.type	magic, @object
	.size	magic, 4
magic:
	.long	-89081154
	.globl	buf
	.bss
	.align 8
	.type	buf, @object
	.size	buf, 8
buf:
	.zero	8
	.globl	align_size
	.data
	.align 4
	.type	align_size, @object
	.size	align_size, 4
align_size:
	.long	32768
	.section	.rodata
.LC11:
	.string	"Fixing ROMS"
.LC12:
	.string	"Applying return-patch"
.LC13:
	.string	"Applying sram-patch"
.LC14:
	.string	"Using XROM alignment"
	.align 8
.LC15:
	.string	"Usage: makefs [options] <infile> <outfile> <rootdir>"
.LC16:
	.string	"Could not open infile (%s)\n"
.LC17:
	.string	"Buf = %08p\n"
.LC18:
	.string	"Shell size %d bytes\n"
.LC19:
	.string	"Open failed!!!!"
	.align 8
.LC20:
	.string	"%p Adding %s (%d bytes) to offset %x\n"
.LC21:
	.string	".bin"
.LC22:
	.string	"Aligning from %p (%p)"
.LC23:
	.string	"to %p (%p)\n"
.LC24:
	.string	"wb"
.LC25:
	.string	"Writing %x => %x bytes\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.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, 440
	.cfi_offset 3, -24
	mov	DWORD PTR -436[rbp], edi
	mov	QWORD PTR -448[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -392[rbp], 0
	mov	QWORD PTR -384[rbp], 0
	mov	QWORD PTR -376[rbp], 0
	mov	edi, 67108864
	call	malloc@PLT
	mov	QWORD PTR buf[rip], rax
	mov	DWORD PTR -424[rbp], 0
	jmp	.L79
.L80:
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, binfiles[rip]
	mov	QWORD PTR [rdx+rax], 0
	add	DWORD PTR -424[rbp], 1
.L79:
	cmp	DWORD PTR -424[rbp], 127
	jle	.L80
	mov	DWORD PTR -424[rbp], 1
	jmp	.L81
.L91:
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -448[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L82
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -448[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	cmp	eax, 120
	je	.L83
	cmp	eax, 120
	jg	.L88
	cmp	eax, 115
	je	.L85
	cmp	eax, 115
	jg	.L88
	cmp	eax, 102
	je	.L86
	cmp	eax, 114
	je	.L87
	jmp	.L88
.L86:
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	DWORD PTR fix_roms[rip], 1
	jmp	.L88
.L87:
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	DWORD PTR return_patch[rip], 1
	jmp	.L88
.L85:
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	DWORD PTR sram_patch[rip], 1
	jmp	.L88
.L83:
	lea	rdi, .LC14[rip]
	call	puts@PLT
	mov	DWORD PTR align_size[rip], 131072
	jmp	.L88
.L82:
	cmp	QWORD PTR -392[rbp], 0
	jne	.L89
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -448[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -392[rbp], rax
	jmp	.L88
.L89:
	cmp	QWORD PTR -384[rbp], 0
	jne	.L90
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -448[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -384[rbp], rax
	jmp	.L88
.L90:
	cmp	QWORD PTR -376[rbp], 0
	jne	.L88
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -448[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -376[rbp], rax
.L88:
	add	DWORD PTR -424[rbp], 1
.L81:
	mov	eax, DWORD PTR -424[rbp]
	cmp	eax, DWORD PTR -436[rbp]
	jl	.L91
	cmp	QWORD PTR -392[rbp], 0
	je	.L92
	cmp	QWORD PTR -384[rbp], 0
	je	.L92
	cmp	QWORD PTR -376[rbp], 0
	jne	.L93
.L92:
	lea	rdi, .LC15[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L105
.L93:
	mov	rdx, QWORD PTR -376[rbp]
	lea	rax, -320[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	QWORD PTR -56[rbp], 0
	mov	rax, QWORD PTR -392[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -360[rbp], rax
	cmp	QWORD PTR -360[rbp], 0
	jne	.L95
	mov	rax, QWORD PTR -392[rbp]
	mov	rsi, rax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	jmp	.L105
.L95:
	lea	rax, -320[rbp]
	mov	rdi, rax
	call	make_tree
	lea	rax, -320[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	print_tree
	mov	rax, QWORD PTR buf[rip]
	mov	edx, eax
	mov	eax, DWORD PTR align_size[rip]
	add	eax, edx
	lea	edx, -1[rax]
	mov	eax, DWORD PTR align_size[rip]
	neg	eax
	and	edx, eax
	mov	rax, QWORD PTR buf[rip]
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -412[rbp], eax
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR buf[rip]
	mov	esi, -1
	mov	rdi, rax
	call	memset@PLT
	mov	rdx, QWORD PTR buf[rip]
	mov	eax, DWORD PTR -412[rbp]
	cdqe
	add	rax, rdx
	mov	QWORD PTR buf[rip], rax
	mov	rax, QWORD PTR buf[rip]
	mov	QWORD PTR -368[rbp], rax
	mov	rax, QWORD PTR -368[rbp]
	mov	rsi, rax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR -360[rbp]
	mov	rax, QWORD PTR -368[rbp]
	mov	rcx, rdx
	mov	edx, 262144
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -408[rbp], eax
	mov	rax, QWORD PTR -360[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, DWORD PTR -408[rbp]
	mov	esi, eax
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -408[rbp]
	cdqe
	add	QWORD PTR -368[rbp], rax
	mov	rax, QWORD PTR -368[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR align_size[rip]
	add	eax, edx
	lea	edx, -1[rax]
	mov	eax, DWORD PTR align_size[rip]
	neg	eax
	and	edx, eax
	mov	rax, QWORD PTR -368[rbp]
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -404[rbp], eax
	mov	eax, DWORD PTR -404[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -368[rbp]
	mov	esi, -1
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR -404[rbp]
	cdqe
	add	QWORD PTR -368[rbp], rax
	mov	rax, QWORD PTR -368[rbp]
	mov	rsi, rax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -368[rbp]
	mov	QWORD PTR -352[rbp], rax
	mov	DWORD PTR -424[rbp], 0
	jmp	.L96
.L104:
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, binfiles[rip]
	mov	rax, QWORD PTR [rdx+rax]
	test	rax, rax
	je	.L97
	mov	DWORD PTR -400[rbp], 0
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, binfiles[rip]
	mov	rax, QWORD PTR [rdx+rax]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -336[rbp], rax
	cmp	QWORD PTR -336[rbp], 0
	jne	.L98
	lea	rdi, .LC19[rip]
	call	puts@PLT
.L98:
	mov	rax, QWORD PTR -368[rbp]
	mov	QWORD PTR -328[rbp], rax
	mov	rdx, QWORD PTR -336[rbp]
	mov	rax, QWORD PTR -368[rbp]
	mov	rcx, rdx
	mov	edx, 33554432
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -408[rbp], eax
	mov	rax, QWORD PTR -336[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rdx, QWORD PTR buf[rip]
	mov	rax, QWORD PTR -328[rbp]
	sub	rax, rdx
	mov	rcx, rax
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, binfiles[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	rsi, rax
	mov	edx, DWORD PTR -408[rbp]
	mov	rax, QWORD PTR -328[rbp]
	mov	r8, rcx
	mov	ecx, edx
	mov	rdx, rsi
	mov	rsi, rax
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, binfiles[rip]
	mov	rax, QWORD PTR [rdx+rax]
	lea	rsi, .LC21[rip]
	mov	rdi, rax
	call	strstr@PLT
	test	rax, rax
	jne	.L99
	mov	DWORD PTR -416[rbp], 0
	mov	eax, DWORD PTR fix_roms[rip]
	test	eax, eax
	je	.L100
	mov	DWORD PTR -420[rbp], 160
	jmp	.L101
.L102:
	mov	eax, DWORD PTR -420[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -328[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	add	DWORD PTR -416[rbp], eax
	add	DWORD PTR -420[rbp], 1
.L101:
	cmp	DWORD PTR -420[rbp], 188
	jle	.L102
	mov	eax, DWORD PTR -416[rbp]
	mov	ecx, eax
	mov	eax, DWORD PTR -420[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -328[rbp]
	add	rax, rdx
	mov	edx, -25
	sub	edx, ecx
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -328[rbp]
	add	rax, 4
	mov	rcx, QWORD PTR good_header[rip]
	mov	rbx, QWORD PTR good_header[rip+8]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR good_header[rip+16]
	mov	rbx, QWORD PTR good_header[rip+24]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rcx, QWORD PTR good_header[rip+32]
	mov	rbx, QWORD PTR good_header[rip+40]
	mov	QWORD PTR 32[rax], rcx
	mov	QWORD PTR 40[rax], rbx
	mov	rcx, QWORD PTR good_header[rip+48]
	mov	rbx, QWORD PTR good_header[rip+56]
	mov	QWORD PTR 48[rax], rcx
	mov	QWORD PTR 56[rax], rbx
	mov	rcx, QWORD PTR good_header[rip+64]
	mov	rbx, QWORD PTR good_header[rip+72]
	mov	QWORD PTR 64[rax], rcx
	mov	QWORD PTR 72[rax], rbx
	mov	rcx, QWORD PTR good_header[rip+80]
	mov	rbx, QWORD PTR good_header[rip+88]
	mov	QWORD PTR 80[rax], rcx
	mov	QWORD PTR 88[rax], rbx
	mov	rcx, QWORD PTR good_header[rip+96]
	mov	rbx, QWORD PTR good_header[rip+104]
	mov	QWORD PTR 96[rax], rcx
	mov	QWORD PTR 104[rax], rbx
	mov	rcx, QWORD PTR good_header[rip+112]
	mov	rbx, QWORD PTR good_header[rip+120]
	mov	QWORD PTR 112[rax], rcx
	mov	QWORD PTR 120[rax], rbx
	mov	rcx, QWORD PTR good_header[rip+128]
	mov	rbx, QWORD PTR good_header[rip+136]
	mov	QWORD PTR 128[rax], rcx
	mov	QWORD PTR 136[rax], rbx
	mov	rdx, QWORD PTR good_header[rip+144]
	mov	QWORD PTR 144[rax], rdx
	mov	edx, DWORD PTR good_header[rip+152]
	mov	DWORD PTR 152[rax], edx
	mov	rax, QWORD PTR -328[rbp]
	add	rax, 178
	mov	BYTE PTR [rax], -106
.L100:
	mov	eax, DWORD PTR sram_patch[rip]
	test	eax, eax
	je	.L103
	mov	edx, DWORD PTR -408[rbp]
	mov	rax, QWORD PTR -328[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	patch_sram
.L103:
	mov	eax, DWORD PTR return_patch[rip]
	test	eax, eax
	je	.L99
	mov	rax, QWORD PTR -328[rbp]
	mov	rcx, QWORD PTR visoly[rip]
	mov	rbx, QWORD PTR visoly[rip+8]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR visoly[rip+16]
	mov	rbx, QWORD PTR visoly[rip+24]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rcx, QWORD PTR visoly[rip+32]
	mov	rbx, QWORD PTR visoly[rip+40]
	mov	QWORD PTR 32[rax], rcx
	mov	QWORD PTR 40[rax], rbx
	mov	rcx, QWORD PTR visoly[rip+48]
	mov	rbx, QWORD PTR visoly[rip+56]
	mov	QWORD PTR 48[rax], rcx
	mov	QWORD PTR 56[rax], rbx
	mov	rcx, QWORD PTR visoly[rip+64]
	mov	rbx, QWORD PTR visoly[rip+72]
	mov	QWORD PTR 64[rax], rcx
	mov	QWORD PTR 72[rax], rbx
	mov	rcx, QWORD PTR visoly[rip+80]
	mov	rbx, QWORD PTR visoly[rip+88]
	mov	QWORD PTR 80[rax], rcx
	mov	QWORD PTR 88[rax], rbx
	mov	rcx, QWORD PTR visoly[rip+96]
	mov	rbx, QWORD PTR visoly[rip+104]
	mov	QWORD PTR 96[rax], rcx
	mov	QWORD PTR 104[rax], rbx
	mov	rcx, QWORD PTR visoly[rip+112]
	mov	rbx, QWORD PTR visoly[rip+120]
	mov	QWORD PTR 112[rax], rcx
	mov	QWORD PTR 120[rax], rbx
	mov	edx, DWORD PTR visoly[rip+128]
	mov	DWORD PTR 128[rax], edx
.L99:
	mov	rax, QWORD PTR -368[rbp]
	sub	rax, QWORD PTR -352[rbp]
	mov	rdx, rax
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, binfiles[rip]
	mov	rax, QWORD PTR [rcx+rax]
	mov	DWORD PTR 284[rax], edx
	mov	eax, DWORD PTR -408[rbp]
	cdqe
	add	QWORD PTR -368[rbp], rax
	mov	rcx, QWORD PTR buf[rip]
	mov	rax, QWORD PTR -368[rbp]
	sub	rax, rcx
	mov	rdx, rax
	mov	rax, QWORD PTR -368[rbp]
	mov	rsi, rax
	lea	rdi, .LC22[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -368[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR align_size[rip]
	add	eax, edx
	lea	edx, -1[rax]
	mov	eax, DWORD PTR align_size[rip]
	neg	eax
	and	edx, eax
	mov	rax, QWORD PTR -368[rbp]
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -396[rbp], eax
	mov	eax, DWORD PTR -396[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -368[rbp]
	mov	esi, -1
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR -396[rbp]
	cdqe
	add	QWORD PTR -368[rbp], rax
	mov	rcx, QWORD PTR buf[rip]
	mov	rax, QWORD PTR -368[rbp]
	sub	rax, rcx
	mov	rdx, rax
	mov	rax, QWORD PTR -368[rbp]
	mov	rsi, rax
	lea	rdi, .LC23[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -368[rbp]
	sub	rax, QWORD PTR -328[rbp]
	mov	rdx, rax
	mov	eax, DWORD PTR -424[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, binfiles[rip]
	mov	rax, QWORD PTR [rcx+rax]
	mov	DWORD PTR 256[rax], edx
.L97:
	add	DWORD PTR -424[rbp], 1
.L96:
	mov	eax, DWORD PTR bincount[rip]
	cmp	DWORD PTR -424[rbp], eax
	jl	.L104
	mov	rax, QWORD PTR -352[rbp]
	sub	rax, QWORD PTR -368[rbp]
	sub	eax, 8
	mov	DWORD PTR bin_offset[rip], eax
	mov	rax, QWORD PTR -384[rbp]
	lea	rsi, .LC24[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -344[rbp], rax
	mov	rax, QWORD PTR -368[rbp]
	sub	rax, QWORD PTR -352[rbp]
	mov	rsi, rax
	mov	rdx, QWORD PTR -344[rbp]
	mov	rax, QWORD PTR -352[rbp]
	mov	rcx, rdx
	mov	rdx, rsi
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -408[rbp], eax
	mov	rdx, QWORD PTR buf[rip]
	mov	rax, QWORD PTR -368[rbp]
	sub	rax, rdx
	mov	rcx, rax
	mov	eax, DWORD PTR -408[rbp]
	mov	edx, eax
	mov	rsi, rcx
	lea	rdi, .LC25[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -344[rbp]
	mov	rcx, rax
	mov	edx, 4
	mov	esi, 1
	lea	rdi, magic[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -344[rbp]
	lea	rdx, -320[rbp]
	lea	rdi, 256[rdx]
	mov	rcx, rax
	mov	edx, 4
	mov	esi, 1
	call	fwrite@PLT
	mov	rcx, QWORD PTR -344[rbp]
	lea	rax, -320[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	dump_tree
	mov	rax, QWORD PTR -344[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L105:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L106
	call	__stack_chk_fail@PLT
.L106:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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	"928206.c"
	.text
	.global	version
	.data
	.align	2
	.type	version, %object
	.size	version, 8
version:
	.ascii	"EEPROM_\000"
	.global	st_orig
	.align	2
	.type	st_orig, %object
	.size	st_orig, 20
st_orig:
	.ascii	"\016H9h\001`\016Hyh"
	.ascii	"\023K\030`\023H\001`\023I"
	.global	st_repl
	.align	2
	.type	st_repl, %object
	.size	st_repl, 20
st_repl:
	.ascii	"\000H\000G\001\377\377\010yh"
	.ascii	"\001L G\000\000\001\377\377\010"
	.global	fl_orig
	.align	2
	.type	fl_orig, %object
	.size	fl_orig, 48
fl_orig:
	.ascii	"\320 \000\005\001\210\001\"\010\034\020@\002\034\021"
	.ascii	"\004\010\014\000(\001\320\033\340"
	.ascii	"\320!\011\005\001#\014J\010\210\030@\000(\010\321\020"
	.ascii	"x\000(\370\320\010\210"
	.global	fl_repl
	.align	2
	.type	fl_repl, %object
	.size	fl_repl, 48
fl_repl:
	.ascii	"\340 \000\005\001\210\001\"\010\034\020@\002\034\021"
	.ascii	"\004\010\014\000(\001\320\033\340"
	.ascii	"\340!\011\005\001#\014J\010\210\030@\000(\010\321\020"
	.ascii	"x\000(\370\320\010\210"
	.global	p_repl
	.align	2
	.type	p_repl, %object
	.size	p_repl, 376
p_repl:
	.ascii	"9h'H\201B#\320\211\034\010\210\001(\002\321$Hx`3\340"
	.ascii	"\000#\000\"\211\034\020\264\001$\010h @[\000\003C\211"
	.ascii	"\034R\034\006*\367\321\020\2749`\333\001\002 \000\002"
	.ascii	"\033\030\016 \000\006\033\030{`9\034\0101\010\210\011"
	.ascii	"8\010\200\026\340\025I\000#\000\"\020\264\001$\010h"
	.ascii	" @[\000\003C\211\034R\034\006*\367\321\020\274\333\001"
	.ascii	"\002 \000\002\033\030\016 \000\006\033\030\010;;`\013"
	.ascii	"H9h\001`\012Hyh\001`\012H9\034\0101\012\210\200!\011"
	.ascii	"\006\012C\002`\007H\000G\000\000\000\000\000\015\000"
	.ascii	"\000\000\016\004\000\000\016\324\000\000\004\330\000"
	.ascii	"\000\004\334\000\000\004\377\377\377\010"
	.ascii	"\"L\204B \320\200\034\004\210\001%,@\001,\002\321\200"
	.ascii	"\036\036I.\340\000#\000$\200\034@\264\001&\005h5@[\000"
	.ascii	"+C\200\034d\034\006,\367\321@\274\333\001\002$$\002"
	.ascii	"\033\031\016$$\006\033\031\031\034\011:\026\340\022"
	.ascii	"H\000#\000$@\264\001&\005h5@[\000+C\200\034d\034\006"
	.ascii	",\367\321@\274\333\001\002$$\002\033\031\016$$\006\033"
	.ascii	"\031\010;\030\034\010L `\010L!`\010I\200 \000\006\002"
	.ascii	"C\012`\006L G\000\000\000\015\000\000\000\016\004\000"
	.ascii	"\000\016\324\000\000\004\330\000\000\004\334\000\000"
	.ascii	"\004\377\377\377\010\000"
	.space	19
	.global	p_size
	.align	2
	.type	p_size, %object
	.size	p_size, 8
p_size:
	.word	188
	.word	168
	.text
	.align	2
	.global	find
	.syntax unified
	.arm
	.fpu softvfp
	.type	find, %function
find:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #36
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L6:
	ldr	r3, [fp, #-24]
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, [fp, #-20]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r2, r3
	bne	.L3
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bne	.L4
	b	.L5
.L3:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	beq	.L4
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	str	r3, [fp, #-24]
.L4:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L2:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	bcc	.L6
.L5:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bne	.L7
	ldr	r3, [fp, #-36]
	rsb	r3, r3, #1
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	b	.L9
.L7:
	mov	r3, #0
.L9:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	find, .-find
	.align	2
	.global	find_freespace
	.syntax unified
	.arm
	.fpu softvfp
	.type	find_freespace, %function
find_freespace:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #36
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r3, [fp, #-28]
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3]
	strb	r3, [fp, #-13]
	b	.L11
.L12:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
.L11:
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3]	@ zero_extendqisi2
	ldrb	r2, [fp, #-13]	@ zero_extendqisi2
	cmp	r2, r3
	beq	.L12
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-24]
	sub	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	add	r3, r3, #255
	bic	r3, r3, #255
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-12]
	add	r2, r2, r3
	ldr	r3, [fp, #-28]
	ldr	r1, [fp, #-24]
	add	r3, r1, r3
	cmp	r2, r3
	bcs	.L13
	ldr	r3, [fp, #-12]
	b	.L14
.L13:
	mov	r3, #0
.L14:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	find_freespace, .-find_freespace
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Found SRAM library v%d.%d.%d at offset 0x%x\012\000"
	.align	2
.LC1:
	.ascii	"Found free space at 0x%x\012\000"
	.align	2
.LC2:
	.ascii	"Patch done!\000"
	.align	2
.LC3:
	.ascii	"Couldn't find fl location\000"
	.align	2
.LC4:
	.ascii	"Couldn't find st location\000"
	.text
	.align	2
	.global	patch_sram
	.syntax unified
	.arm
	.fpu softvfp
	.type	patch_sram, %function
patch_sram:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, [fp, #-40]
	add	r0, r3, #180
	ldr	r3, [fp, #-44]
	sub	r1, r3, #180
	mov	r3, #7
	ldr	r2, .L27
	bl	find
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L16
	ldr	r3, [fp, #-24]
	add	r3, r3, #8
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	strb	r3, [fp, #-31]
	ldr	r3, [fp, #-24]
	add	r3, r3, #9
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	strb	r3, [fp, #-30]
	ldr	r3, [fp, #-24]
	add	r3, r3, #10
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	strb	r3, [fp, #-29]
	ldrb	r1, [fp, #-31]	@ zero_extendqisi2
	ldrb	r0, [fp, #-30]	@ zero_extendqisi2
	ldrb	ip, [fp, #-29]	@ zero_extendqisi2
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-40]
	sub	r3, r2, r3
	str	r3, [sp]
	mov	r3, ip
	mov	r2, r0
	ldr	r0, .L27+4
	bl	printf
	ldr	r3, [fp, #-40]
	add	r0, r3, #180
	ldr	r3, [fp, #-44]
	sub	r1, r3, #180
	ldrb	r3, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, .L27+8
	add	r2, r3, r2
	mov	r3, #10
	bl	find
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L17
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-40]
	sub	r3, r2, r3
	str	r3, [fp, #-16]
	ldrb	r3, [fp, #-30]	@ zero_extendqisi2
	cmp	r3, #1
	beq	.L18
	cmp	r3, #2
	beq	.L19
	b	.L20
.L18:
	ldr	r3, [fp, #-16]
	and	r3, r3, #255
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	add	r3, r3, #33
	and	r0, r3, #255
	ldr	r1, .L27+12
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r3, r3, #184
	mov	r2, r0
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	asr	r3, r3, #16
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	and	r0, r3, #255
	ldr	r1, .L27+12
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r3, r3, #186
	mov	r2, r0
	strb	r2, [r3]
	b	.L20
.L19:
	ldr	r3, [fp, #-16]
	and	r3, r3, #255
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	add	r3, r3, #19
	and	r0, r3, #255
	ldr	r1, .L27+12
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r3, r3, #164
	mov	r2, r0
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	asr	r3, r3, #8
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	and	r0, r3, #255
	ldr	r1, .L27+12
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r3, r3, #165
	mov	r2, r0
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	asr	r3, r3, #16
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	and	r0, r3, #255
	ldr	r1, .L27+12
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r3, r3, #166
	mov	r2, r0
	strb	r2, [r3]
	nop
.L20:
	ldr	r3, [fp, #-40]
	add	r0, r3, #180
	ldr	r3, [fp, #-44]
	sub	r1, r3, #180
	ldrb	r3, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L27+16
	add	r2, r3, r2
	mov	r3, #24
	bl	find
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L21
	ldrb	r3, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, .L27+20
	add	r3, r3, r2
	mov	r2, #24
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	memcpy
	mov	r2, #200
	ldr	r1, [fp, #-44]
	ldr	r0, [fp, #-40]
	bl	find_freespace
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L16
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-40]
	sub	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-40]
	sub	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L27+24
	bl	printf
	ldrb	r3, [fp, #-30]	@ zero_extendqisi2
	cmp	r3, #1
	beq	.L22
	cmp	r3, #2
	beq	.L23
	b	.L24
.L22:
	ldr	r3, [fp, #-28]
	sub	r3, r3, #1
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L25
	ldr	r3, [fp, #-16]
	asr	r3, r3, #8
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	and	r0, r3, #255
	ldr	r1, .L27+12
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r3, r3, #185
	mov	r2, r0
	strb	r2, [r3]
	b	.L26
.L25:
	ldr	r3, [fp, #-16]
	add	r3, r3, #31
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	asr	r3, r3, #8
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	and	r0, r3, #255
	ldr	r1, .L27+12
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r3, r3, #185
	mov	r2, r0
	strb	r2, [r3]
.L26:
	ldr	r3, [fp, #-8]
	asr	r3, r3, #8
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	and	r0, r3, #255
	ldr	r1, .L27+28
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r1, r3
	add	r3, r3, #5
	mov	r2, r0
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	asr	r3, r3, #16
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	and	r0, r3, #255
	ldr	r1, .L27+28
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r1, r3
	add	r3, r3, #6
	mov	r2, r0
	strb	r2, [r3]
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
	b	.L24
.L23:
	ldr	r3, [fp, #-8]
	asr	r3, r3, #8
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	and	r0, r3, #255
	ldr	r1, .L27+28
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r1, r3
	add	r3, r3, #7
	mov	r2, r0
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	asr	r3, r3, #16
	ldrb	r2, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r2, #1
	and	r0, r3, #255
	ldr	r1, .L27+28
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r1, r3
	add	r3, r3, #8
	mov	r2, r0
	strb	r2, [r3]
	nop
.L24:
	ldrb	r3, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, .L27+28
	add	r3, r3, r2
	mov	r2, #10
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	memcpy
	ldrb	r3, [fp, #-30]	@ zero_extendqisi2
	sub	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #2
	ldr	r2, .L27+12
	add	r1, r3, r2
	ldrb	r3, [fp, #-30]	@ zero_extendqisi2
	sub	r3, r3, #1
	ldr	r2, .L27+32
	ldr	r3, [r2, r3, lsl #2]
	mov	r2, r3
	ldr	r0, [fp, #-28]
	bl	memcpy
	ldr	r0, .L27+36
	bl	puts
	b	.L16
.L21:
	ldr	r0, .L27+40
	bl	puts
	b	.L16
.L17:
	ldr	r0, .L27+44
	bl	puts
.L16:
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	version
	.word	.LC0
	.word	st_orig
	.word	p_repl
	.word	fl_orig
	.word	fl_repl
	.word	.LC1
	.word	st_repl
	.word	p_size
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	patch_sram, .-patch_sram
	.global	fix_roms
	.bss
	.align	2
	.type	fix_roms, %object
	.size	fix_roms, 4
fix_roms:
	.space	4
	.global	return_patch
	.align	2
	.type	return_patch, %object
	.size	return_patch, 4
return_patch:
	.space	4
	.global	sram_patch
	.align	2
	.type	sram_patch, %object
	.size	sram_patch, 4
sram_patch:
	.space	4
	.global	good_header
	.section	.rodata
	.align	2
	.type	good_header, %object
	.size	good_header, 156
good_header:
	.ascii	"$\377\256Qi\232\242!=\204\202\012\204\344\011\255\021"
	.ascii	"$\213\230\300\201\177!\243R\276\031\223\011\316 \020"
	.ascii	"FJJ\370'1\354X\307\3503\202\343\316\277\205\364\337"
	.ascii	"\224\316K\011\301\224V\212\300\023r\247\374\237\204"
	.ascii	"Ms\243\312\232aX\227\243'\374\003\230v#\035\307a\003"
	.ascii	"\004\256V\2778\204\000@\247\016\375\377R\376\003o\225"
	.ascii	"0\361\227\373\300\205`\326\200%\251c\276\003\001N8\342"
	.ascii	"\371\2424\377\273>\003Dx\000\220\313\210\021:\224e\300"
	.ascii	"|c\207\360<\257\326%\344\2138\012\254r!\324\370\007"
	.global	visoly
	.align	2
	.type	visoly, %object
	.size	visoly, 132
visoly:
	.ascii	"\003\024\240\343\001\000\217\342\020\377/\341\003\242"
	.ascii	"L\034\032#\001\312\001\301\001;\373\321 G\017\240~\310"
	.ascii	"\015\2000\034\000\360\022\370\025\200 \034\000\360\016"
	.ascii	"\370\015\200\025\200\017\240\034\200\030\310\036\200"
	.ascii	" \034\000\360\005\370\015\200\015I\017\200\001\337\000"
	.ascii	"\337\372'\177\000\020\200\001?\374\321pG\000\000\000"
	.ascii	"\000\250\3540\011\212F\002\010\000\250\354\010xV\000"
	.ascii	"\000TS\000\0004\022\000\000\240h\002\010\315\253\000"
	.ascii	"\000.Yk\011\300\000\000\010"
	.global	bin_offset
	.bss
	.align	2
	.type	bin_offset, %object
	.size	bin_offset, 4
bin_offset:
	.space	4
	.global	bincount
	.align	2
	.type	bincount, %object
	.size	bincount, 4
bincount:
	.space	4
	.global	smallcount
	.data
	.align	2
	.type	smallcount, %object
	.size	smallcount, 4
smallcount:
	.word	1
	.comm	binfiles,512,4
	.global	spaces
	.section	.rodata
	.align	2
	.type	spaces, %object
	.size	spaces, 61
spaces:
	.ascii	"                                                   "
	.ascii	"         \000"
	.align	2
.LC5:
	.ascii	"%.*s[%s]\012\000"
	.align	2
.LC6:
	.ascii	"%.*s%s (%d bytes)\012\000"
	.text
	.align	2
	.global	print_tree
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_tree, %function
print_tree:
	@ args = 0, pretend = 0, frame = 8
	@ 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]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #264]
	cmp	r3, #0
	beq	.L30
	ldr	r3, [fp, #-12]
	lsl	r1, r3, #1
	ldr	r3, [fp, #-8]
	ldr	r2, .L35
	ldr	r0, .L35+4
	bl	printf
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #264]
	str	r3, [fp, #-8]
	b	.L31
.L32:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	print_tree
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #260]
	str	r3, [fp, #-8]
.L31:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L32
	b	.L34
.L30:
	ldr	r3, [fp, #-12]
	lsl	r1, r3, #1
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #256]
	str	r3, [sp]
	mov	r3, r2
	ldr	r2, .L35
	ldr	r0, .L35+8
	bl	printf
.L34:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L36:
	.align	2
.L35:
	.word	spaces
	.word	.LC5
	.word	.LC6
	.size	print_tree, .-print_tree
	.align	2
	.global	recsize
	.syntax unified
	.arm
	.fpu softvfp
	.type	recsize, %function
recsize:
	@ 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, #-16]
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #268]
	cmp	r3, #1
	beq	.L38
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #256]
	add	r3, r3, #3
	bic	r3, r3, #3
	str	r3, [fp, #-8]
.L38:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #264]
	cmp	r3, #0
	beq	.L39
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #264]
	str	r3, [fp, #-12]
	b	.L40
.L41:
	ldr	r0, [fp, #-12]
	bl	recsize
	mov	r2, r0
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	add	r3, r3, #3
	bic	r3, r3, #3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #260]
	str	r3, [fp, #-12]
.L40:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L41
.L39:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	recsize, .-recsize
	.align	2
	.global	recbinsize
	.syntax unified
	.arm
	.fpu softvfp
	.type	recbinsize, %function
recbinsize:
	@ 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, #-16]
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #268]
	cmp	r3, #1
	bne	.L44
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #256]
	str	r3, [fp, #-8]
.L44:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #264]
	cmp	r3, #0
	beq	.L45
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #264]
	str	r3, [fp, #-12]
	b	.L46
.L47:
	ldr	r0, [fp, #-12]
	bl	recbinsize
	mov	r2, r0
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #260]
	str	r3, [fp, #-12]
.L46:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L47
.L45:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	recbinsize, .-recbinsize
	.align	2
	.global	cutname
	.syntax unified
	.arm
	.fpu softvfp
	.type	cutname, %function
cutname:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	mov	r1, #46
	ldr	r0, [fp, #-28]
	bl	strrchr
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-32]
	mov	r2, r3
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-24]
	bl	strncpy
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L51
	ldr	r0, [fp, #-24]
	bl	strlen
	mov	r4, r0
	ldr	r0, [fp, #-16]
	bl	strlen
	mov	r3, r0
	sub	r3, r4, r3
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	strcpy
.L51:
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
	.size	cutname, .-cutname
	.section	.rodata
	.align	2
.LC7:
	.ascii	"rb\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	dump_tree
	.syntax unified
	.arm
	.fpu softvfp
	.type	dump_tree, %function
dump_tree:
	@ args = 0, pretend = 0, frame = 10288
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #10240
	sub	sp, sp, #52
	sub	r3, fp, #8192
	sub	r3, r3, #12
	str	r0, [r3, #-2084]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	str	r1, [r3, #-2088]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	str	r2, [r3, #-2092]
	ldr	r3, .L68
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2084]
	ldr	r3, [r3, #264]
	cmp	r3, #0
	beq	.L53
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2084]
	ldr	r3, [r3, #264]
	str	r3, [r2, #-2072]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-2076]
	b	.L54
.L55:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2076]
	add	r3, r3, #1
	str	r3, [r2, #-2076]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	ldr	r3, [r3, #260]
	str	r3, [r2, #-2072]
.L54:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	cmp	r3, #0
	bne	.L55
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r3, #-2076]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2092]
	add	r3, r2, r3
	sub	r2, fp, #8192
	sub	r2, r2, #12
	str	r3, [r2, #-2092]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2084]
	ldr	r3, [r3, #264]
	str	r3, [r2, #-2072]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-2076]
	b	.L56
.L62:
	sub	r2, fp, #10240
	sub	r2, r2, #12
	sub	r2, r2, #4
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r1, [r3, #-2076]
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #3
	add	r3, r2, r3
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r4, r2
	mov	r1, #47
	mov	r0, r3
	bl	strrchr
	str	r0, [r4, #-2068]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2068]
	cmp	r3, #0
	beq	.L57
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2068]
	add	r3, r3, #1
	str	r3, [r2, #-2068]
	b	.L58
.L57:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	str	r3, [r2, #-2068]
.L58:
	sub	r2, fp, #10240
	sub	r2, r2, #12
	sub	r2, r2, #4
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r1, [r3, #-2076]
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #3
	add	r3, r2, r3
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r1, r2
	mov	r2, #31
	ldr	r1, [r1, #-2068]
	mov	r0, r3
	bl	cutname
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	ldr	r1, [r3, #256]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r0, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r3, #-2076]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r0, r3
	sub	r3, r3, #2016
	sub	r3, r3, #4
	str	r1, [r3]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	ldr	r3, [r3, #264]
	cmp	r3, #0
	beq	.L59
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r3, #-2076]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	sub	r3, r3, #2016
	sub	r3, r3, #4
	ldr	r3, [r3]
	orr	r3, r3, #-2147483648
	mov	r1, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r0, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r3, #-2076]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r0, r3
	sub	r3, r3, #2016
	sub	r3, r3, #4
	str	r1, [r3]
.L59:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	ldr	r3, [r3, #268]
	cmp	r3, #1
	bne	.L60
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	ldr	r1, [r3, #272]
	ldr	r3, .L68+4
	ldr	r3, [r3]
	sub	r2, fp, #8192
	sub	r2, r2, #12
	ldr	r2, [r2, #-2076]
	sub	r0, fp, #8192
	sub	r0, r0, #12
	mov	ip, r0
	add	r0, r2, #1
	str	r0, [ip, #-2076]
	add	r1, r1, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r0, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r0, r3
	sub	r3, r3, #2016
	str	r1, [r3]
	b	.L61
.L60:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r3, #-2076]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r1, r3
	add	r3, r2, #1
	str	r3, [r1, #-2076]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r1, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	sub	r3, r3, #2016
	sub	r2, fp, #8192
	sub	r2, r2, #12
	ldr	r2, [r2, #-2092]
	str	r2, [r3]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-2072]
	bl	recsize
	str	r0, [r4, #-2056]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r2, #-2092]
	ldr	r3, [r3, #-2056]
	add	r3, r2, r3
	str	r3, [r1, #-2092]
.L61:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	ldr	r3, [r3, #260]
	str	r3, [r2, #-2072]
.L56:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	cmp	r3, #0
	bne	.L62
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r3, #-2076]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r0, fp, #10240
	sub	r0, r0, #12
	sub	r0, r0, #4
	ldr	r3, [r3, #-2088]
	mov	r1, #1
	bl	fwrite
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2084]
	ldr	r3, [r3, #264]
	str	r3, [r2, #-2072]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-2076]
	b	.L63
.L64:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r3, #-2076]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r1, r3
	add	r3, r2, #1
	str	r3, [r1, #-2076]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r1, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	sub	r3, r3, #2016
	ldr	r3, [r3]
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r1, r2
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, r3
	ldr	r1, [r1, #-2088]
	ldr	r0, [r0, #-2072]
	bl	dump_tree
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	ldr	r3, [r3, #260]
	str	r3, [r2, #-2072]
.L63:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2072]
	cmp	r3, #0
	bne	.L64
	b	.L67
.L53:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2084]
	ldr	r3, [r3, #256]
	cmp	r3, #0
	beq	.L67
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2084]
	ldr	r3, [r3, #268]
	cmp	r3, #1
	beq	.L67
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2084]
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r4, r2
	ldr	r1, .L68+8
	mov	r0, r3
	bl	fopen
	str	r0, [r4, #-2064]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2084]
	ldr	r3, [r3, #256]
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	mov	r0, r2
	bl	malloc
	mov	r3, r0
	str	r3, [r4, #-2060]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2084]
	ldr	r3, [r3, #256]
	mov	r1, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r0, r2
	ldr	r3, [r3, #-2064]
	mov	r2, r1
	mov	r1, #1
	ldr	r0, [r0, #-2060]
	bl	fread
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-2084]
	ldr	r3, [r3, #256]
	add	r3, r3, #3
	bic	r2, r3, #3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r1, fp, #8192
	sub	r1, r1, #12
	mov	r0, r1
	ldr	r3, [r3, #-2088]
	mov	r1, #1
	ldr	r0, [r0, #-2060]
	bl	fwrite
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-2064]
	bl	fclose
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-2060]
	bl	free
.L67:
	nop
	ldr	r3, .L68
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L66
	bl	__stack_chk_fail
.L66:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L69:
	.align	2
.L68:
	.word	.LC8
	.word	bin_offset
	.word	.LC7
	.size	dump_tree, .-dump_tree
	.section	.rodata
	.align	2
.LC9:
	.ascii	"%s/%s\000"
	.align	2
.LC10:
	.ascii	"bin\000"
	.align	2
.LC11:
	.ascii	"gba\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	make_tree
	.syntax unified
	.arm
	.fpu softvfp
	.type	make_tree, %function
make_tree:
	@ args = 0, pretend = 0, frame = 136
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #136
	str	r0, [fp, #-136]
	ldr	r3, .L86
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-136]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-116]
	ldr	r3, [fp, #-116]
	sub	r3, r3, #1
	ldr	r2, [fp, #-136]
	ldrb	r3, [r2, r3]	@ zero_extendqisi2
	cmp	r3, #47
	bne	.L71
	ldr	r3, [fp, #-116]
	sub	r3, r3, #1
	ldr	r2, [fp, #-136]
	mov	r1, #0
	strb	r1, [r2, r3]
.L71:
	ldr	r3, [fp, #-136]
	sub	r2, fp, #100
	mov	r1, r2
	mov	r0, r3
	bl	stat
	mov	r3, r0
	cmn	r3, #1
	beq	.L85
	ldr	r3, [fp, #-84]
	and	r3, r3, #16384
	cmp	r3, #0
	beq	.L73
	mov	r3, #0
	str	r3, [fp, #-124]
	mov	r3, #0
	str	r3, [fp, #-128]
	ldr	r3, [fp, #-136]
	mov	r2, #0
	str	r2, [r3, #264]
	ldr	r3, [fp, #-136]
	mov	r0, r3
	bl	opendir
	str	r0, [fp, #-108]
	mov	r3, #0
	str	r3, [fp, #-132]
	b	.L74
.L78:
	ldr	r3, [fp, #-104]
	add	r3, r3, #11
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r3, #2
	bhi	.L75
	ldr	r3, [fp, #-104]
	ldrb	r3, [r3, #11]	@ zero_extendqisi2
	cmp	r3, #46
	beq	.L74
.L75:
	mov	r0, #276
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-132]
	ldr	r3, [fp, #-136]
	ldr	r3, [r3, #264]
	cmp	r3, #0
	bne	.L76
	ldr	r3, [fp, #-136]
	ldr	r2, [fp, #-132]
	str	r2, [r3, #264]
.L76:
	ldr	r0, [fp, #-132]
	ldr	r2, [fp, #-136]
	ldr	r3, [fp, #-104]
	add	r3, r3, #11
	ldr	r1, .L86+4
	bl	sprintf
	ldr	r0, [fp, #-132]
	bl	make_tree
	ldr	r3, [fp, #-128]
	cmp	r3, #0
	beq	.L77
	ldr	r3, [fp, #-128]
	ldr	r2, [fp, #-132]
	str	r2, [r3, #260]
.L77:
	ldr	r3, [fp, #-132]
	str	r3, [fp, #-128]
	ldr	r3, [fp, #-124]
	add	r3, r3, #1
	str	r3, [fp, #-124]
.L74:
	ldr	r0, [fp, #-108]
	bl	readdir
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bne	.L78
	ldr	r3, [fp, #-132]
	cmp	r3, #0
	beq	.L79
	ldr	r3, [fp, #-132]
	mov	r2, #0
	str	r2, [r3, #260]
.L79:
	ldr	r2, [fp, #-124]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r2, r3
	ldr	r3, [fp, #-136]
	str	r2, [r3, #256]
	ldr	r0, [fp, #-108]
	bl	closedir
	b	.L85
.L73:
	ldr	r3, [fp, #-136]
	mov	r1, #46
	mov	r0, r3
	bl	strrchr
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	beq	.L80
	ldr	r3, [fp, #-112]
	add	r3, r3, #1
	str	r3, [fp, #-112]
	ldr	r3, [fp, #-112]
	str	r3, [fp, #-120]
	b	.L81
.L82:
	ldr	r3, [fp, #-120]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	tolower
	mov	r3, r0
	and	r2, r3, #255
	ldr	r3, [fp, #-120]
	strb	r2, [r3]
	ldr	r3, [fp, #-120]
	add	r3, r3, #1
	str	r3, [fp, #-120]
.L81:
	ldr	r3, [fp, #-120]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L82
	ldr	r1, .L86+8
	ldr	r0, [fp, #-112]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L83
	ldr	r1, .L86+12
	ldr	r0, [fp, #-112]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L80
.L83:
	ldr	r3, [fp, #-136]
	mov	r2, #1
	str	r2, [r3, #268]
	ldr	r3, .L86+16
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r1, .L86+16
	str	r2, [r1]
	ldr	r1, .L86+20
	ldr	r2, [fp, #-136]
	str	r2, [r1, r3, lsl #2]
.L80:
	ldr	r3, [fp, #-136]
	mov	r2, #0
	str	r2, [r3, #264]
	ldr	r2, [fp, #-56]
	ldr	r3, [fp, #-136]
	str	r2, [r3, #256]
.L85:
	nop
	ldr	r3, .L86
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L84
	bl	__stack_chk_fail
.L84:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L87:
	.align	2
.L86:
	.word	.LC12
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	bincount
	.word	binfiles
	.size	make_tree, .-make_tree
	.global	rootdir
	.bss
	.align	2
	.type	rootdir, %object
	.size	rootdir, 4
rootdir:
	.space	4
	.data
	.align	2
	.type	magic, %object
	.size	magic, 4
magic:
	.word	-89081154
	.comm	buf,4,4
	.global	align_size
	.align	2
	.type	align_size, %object
	.size	align_size, 4
align_size:
	.word	32768
	.section	.rodata
	.align	2
.LC13:
	.ascii	"Fixing ROMS\000"
	.align	2
.LC14:
	.ascii	"Applying return-patch\000"
	.align	2
.LC15:
	.ascii	"Applying sram-patch\000"
	.align	2
.LC16:
	.ascii	"Using XROM alignment\000"
	.align	2
.LC17:
	.ascii	"Usage: makefs [options] <infile> <outfile> <rootdir"
	.ascii	">\000"
	.align	2
.LC18:
	.ascii	"Could not open infile (%s)\012\000"
	.align	2
.LC19:
	.ascii	"Buf = %08p\012\000"
	.align	2
.LC20:
	.ascii	"Shell size %d bytes\012\000"
	.align	2
.LC21:
	.ascii	"Open failed!!!!\000"
	.align	2
.LC22:
	.ascii	"%p Adding %s (%d bytes) to offset %x\012\000"
	.align	2
.LC23:
	.ascii	".bin\000"
	.align	2
.LC24:
	.ascii	"Aligning from %p (%p)\000"
	.align	2
.LC25:
	.ascii	"to %p (%p)\012\000"
	.align	2
.LC26:
	.ascii	"wb\000"
	.align	2
.LC27:
	.ascii	"Writing %x => %x bytes\012\000"
	.align	2
.LC28:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 360
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #368
	str	r0, [fp, #-360]
	str	r1, [fp, #-364]
	ldr	r3, .L118
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-344]
	mov	r3, #0
	str	r3, [fp, #-340]
	mov	r3, #0
	str	r3, [fp, #-336]
	mov	r0, #67108864
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L118+4
	str	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-352]
	b	.L89
.L90:
	ldr	r2, .L118+8
	ldr	r3, [fp, #-352]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-352]
	add	r3, r3, #1
	str	r3, [fp, #-352]
.L89:
	ldr	r3, [fp, #-352]
	cmp	r3, #127
	ble	.L90
	mov	r3, #1
	str	r3, [fp, #-352]
	b	.L91
.L102:
	ldr	r3, [fp, #-352]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-364]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L92
	ldr	r3, [fp, #-352]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-364]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #102
	cmp	r3, #18
	ldrls	pc, [pc, r3, asl #2]
	b	.L99
.L95:
	.word	.L98
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L97
	.word	.L96
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L99
	.word	.L94
.L98:
	ldr	r0, .L118+12
	bl	puts
	ldr	r3, .L118+16
	mov	r2, #1
	str	r2, [r3]
	b	.L99
.L97:
	ldr	r0, .L118+20
	bl	puts
	ldr	r3, .L118+24
	mov	r2, #1
	str	r2, [r3]
	b	.L99
.L96:
	ldr	r0, .L118+28
	bl	puts
	ldr	r3, .L118+32
	mov	r2, #1
	str	r2, [r3]
	b	.L99
.L94:
	ldr	r0, .L118+36
	bl	puts
	ldr	r3, .L118+40
	mov	r2, #131072
	str	r2, [r3]
	b	.L99
.L92:
	ldr	r3, [fp, #-344]
	cmp	r3, #0
	bne	.L100
	ldr	r3, [fp, #-352]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-364]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-344]
	b	.L99
.L100:
	ldr	r3, [fp, #-340]
	cmp	r3, #0
	bne	.L101
	ldr	r3, [fp, #-352]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-364]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-340]
	b	.L99
.L101:
	ldr	r3, [fp, #-336]
	cmp	r3, #0
	bne	.L99
	ldr	r3, [fp, #-352]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-364]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-336]
.L99:
	ldr	r3, [fp, #-352]
	add	r3, r3, #1
	str	r3, [fp, #-352]
.L91:
	ldr	r2, [fp, #-352]
	ldr	r3, [fp, #-360]
	cmp	r2, r3
	blt	.L102
	ldr	r3, [fp, #-344]
	cmp	r3, #0
	beq	.L103
	ldr	r3, [fp, #-340]
	cmp	r3, #0
	beq	.L103
	ldr	r3, [fp, #-336]
	cmp	r3, #0
	bne	.L104
.L103:
	ldr	r0, .L118+44
	bl	puts
	mov	r3, #0
	b	.L116
.L104:
	sub	r3, fp, #284
	ldr	r1, [fp, #-336]
	mov	r0, r3
	bl	strcpy
	mov	r3, #0
	str	r3, [fp, #-24]
	ldr	r1, .L118+48
	ldr	r0, [fp, #-344]
	bl	fopen
	str	r0, [fp, #-324]
	ldr	r3, [fp, #-324]
	cmp	r3, #0
	bne	.L106
	ldr	r1, [fp, #-344]
	ldr	r0, .L118+52
	bl	printf
	mov	r3, #0
	b	.L116
.L106:
	sub	r3, fp, #284
	mov	r0, r3
	bl	make_tree
	sub	r3, fp, #284
	mov	r1, #0
	mov	r0, r3
	bl	print_tree
	ldr	r3, .L118+4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r3, .L118+40
	ldr	r3, [r3]
	add	r3, r2, r3
	sub	r2, r3, #1
	ldr	r3, .L118+40
	ldr	r3, [r3]
	rsb	r3, r3, #0
	and	r3, r3, r2
	ldr	r2, .L118+4
	ldr	r2, [r2]
	sub	r3, r3, r2
	str	r3, [fp, #-320]
	ldr	r3, .L118+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-320]
	mvn	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, .L118+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-320]
	add	r3, r2, r3
	ldr	r2, .L118+4
	str	r3, [r2]
	ldr	r3, .L118+4
	ldr	r3, [r3]
	str	r3, [fp, #-332]
	ldr	r1, [fp, #-332]
	ldr	r0, .L118+56
	bl	printf
	ldr	r3, [fp, #-324]
	mov	r2, #262144
	mov	r1, #1
	ldr	r0, [fp, #-332]
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-316]
	ldr	r0, [fp, #-324]
	bl	fclose
	ldr	r1, [fp, #-316]
	ldr	r0, .L118+60
	bl	printf
	ldr	r3, [fp, #-316]
	ldr	r2, [fp, #-332]
	add	r3, r2, r3
	str	r3, [fp, #-332]
	ldr	r2, [fp, #-332]
	ldr	r3, .L118+40
	ldr	r3, [r3]
	add	r3, r2, r3
	sub	r2, r3, #1
	ldr	r3, .L118+40
	ldr	r3, [r3]
	rsb	r3, r3, #0
	and	r2, r2, r3
	ldr	r3, [fp, #-332]
	sub	r3, r2, r3
	str	r3, [fp, #-312]
	ldr	r3, [fp, #-312]
	mov	r2, r3
	mvn	r1, #0
	ldr	r0, [fp, #-332]
	bl	memset
	ldr	r3, [fp, #-312]
	ldr	r2, [fp, #-332]
	add	r3, r2, r3
	str	r3, [fp, #-332]
	ldr	r1, [fp, #-332]
	ldr	r0, .L118+56
	bl	printf
	ldr	r3, [fp, #-332]
	str	r3, [fp, #-308]
	mov	r3, #0
	str	r3, [fp, #-352]
	b	.L107
.L115:
	ldr	r2, .L118+8
	ldr	r3, [fp, #-352]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	beq	.L108
	mov	r3, #0
	str	r3, [fp, #-300]
	ldr	r2, .L118+8
	ldr	r3, [fp, #-352]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r1, .L118+48
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-296]
	ldr	r3, [fp, #-296]
	cmp	r3, #0
	bne	.L109
	ldr	r0, .L118+64
	bl	puts
.L109:
	ldr	r3, [fp, #-332]
	str	r3, [fp, #-292]
	ldr	r3, [fp, #-296]
	mov	r2, #33554432
	mov	r1, #1
	ldr	r0, [fp, #-332]
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-316]
	ldr	r0, [fp, #-296]
	bl	fclose
	ldr	r2, .L118+8
	ldr	r3, [fp, #-352]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r3, .L118+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-292]
	sub	r3, r2, r3
	str	r3, [sp]
	ldr	r3, [fp, #-316]
	mov	r2, r1
	ldr	r1, [fp, #-292]
	ldr	r0, .L118+68
	bl	printf
	ldr	r2, .L118+8
	ldr	r3, [fp, #-352]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r1, .L118+72
	mov	r0, r3
	bl	strstr
	mov	r3, r0
	cmp	r3, #0
	bne	.L110
	mov	r3, #0
	str	r3, [fp, #-328]
	ldr	r3, .L118+16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L111
	mov	r3, #160
	str	r3, [fp, #-348]
	b	.L112
.L113:
	ldr	r3, [fp, #-348]
	ldr	r2, [fp, #-292]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-328]
	add	r3, r3, r2
	str	r3, [fp, #-328]
	ldr	r3, [fp, #-348]
	add	r3, r3, #1
	str	r3, [fp, #-348]
.L112:
	ldr	r3, [fp, #-348]
	cmp	r3, #188
	ble	.L113
	ldr	r3, [fp, #-328]
	and	r1, r3, #255
	ldr	r3, [fp, #-348]
	ldr	r2, [fp, #-292]
	add	r2, r2, r3
	mvn	r3, #24
	sub	r3, r3, r1
	and	r3, r3, #255
	strb	r3, [r2]
	ldr	r3, [fp, #-292]
	add	r3, r3, #4
	ldr	r2, .L118+76
	mov	r0, r3
	mov	r1, r2
	mov	r3, #156
	mov	r2, r3
	bl	memcpy
	ldr	r3, [fp, #-292]
	add	r3, r3, #178
	mvn	r2, #105
	strb	r2, [r3]
.L111:
	ldr	r3, .L118+32
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L114
	ldr	r1, [fp, #-316]
	ldr	r0, [fp, #-292]
	bl	patch_sram
.L114:
	ldr	r3, .L118+24
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L110
	ldr	r3, [fp, #-292]
	ldr	r2, .L118+80
	mov	r0, r3
	mov	r1, r2
	mov	r3, #132
	mov	r2, r3
	bl	memcpy
.L110:
	ldr	r2, .L118+8
	ldr	r3, [fp, #-352]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r1, [fp, #-332]
	ldr	r2, [fp, #-308]
	sub	r2, r1, r2
	str	r2, [r3, #272]
	ldr	r3, [fp, #-316]
	ldr	r2, [fp, #-332]
	add	r3, r2, r3
	str	r3, [fp, #-332]
	ldr	r3, .L118+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-332]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r1, [fp, #-332]
	ldr	r0, .L118+84
	bl	printf
	ldr	r2, [fp, #-332]
	ldr	r3, .L118+40
	ldr	r3, [r3]
	add	r3, r2, r3
	sub	r2, r3, #1
	ldr	r3, .L118+40
	ldr	r3, [r3]
	rsb	r3, r3, #0
	and	r2, r2, r3
	ldr	r3, [fp, #-332]
	sub	r3, r2, r3
	str	r3, [fp, #-288]
	ldr	r3, [fp, #-288]
	mov	r2, r3
	mvn	r1, #0
	ldr	r0, [fp, #-332]
	bl	memset
	ldr	r3, [fp, #-288]
	ldr	r2, [fp, #-332]
	add	r3, r2, r3
	str	r3, [fp, #-332]
	ldr	r3, .L118+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-332]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r1, [fp, #-332]
	ldr	r0, .L118+88
	bl	printf
	ldr	r2, .L118+8
	ldr	r3, [fp, #-352]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r1, [fp, #-332]
	ldr	r2, [fp, #-292]
	sub	r2, r1, r2
	str	r2, [r3, #256]
.L108:
	ldr	r3, [fp, #-352]
	add	r3, r3, #1
	str	r3, [fp, #-352]
.L107:
	ldr	r3, .L118+92
	ldr	r3, [r3]
	ldr	r2, [fp, #-352]
	cmp	r2, r3
	blt	.L115
	ldr	r2, [fp, #-308]
	ldr	r3, [fp, #-332]
	sub	r3, r2, r3
	sub	r3, r3, #8
	ldr	r2, .L118+96
	str	r3, [r2]
	ldr	r1, .L118+100
	ldr	r0, [fp, #-340]
	bl	fopen
	str	r0, [fp, #-304]
	ldr	r2, [fp, #-332]
	ldr	r3, [fp, #-308]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-304]
	mov	r1, #1
	ldr	r0, [fp, #-308]
	bl	fwrite
	mov	r3, r0
	str	r3, [fp, #-316]
	ldr	r3, .L118+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-332]
	sub	r3, r2, r3
	ldr	r2, [fp, #-316]
	mov	r1, r3
	ldr	r0, .L118+104
	bl	printf
	ldr	r3, [fp, #-304]
	mov	r2, #4
	mov	r1, #1
	ldr	r0, .L118+108
	bl	fwrite
	sub	r3, fp, #284
	add	r0, r3, #256
	ldr	r3, [fp, #-304]
	mov	r2, #4
	mov	r1, #1
	bl	fwrite
	sub	r3, fp, #284
	mov	r2, #0
	ldr	r1, [fp, #-304]
	mov	r0, r3
	bl	dump_tree
	ldr	r0, [fp, #-304]
	bl	fclose
	mov	r3, #0
.L116:
	ldr	r2, .L118
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L117
	bl	__stack_chk_fail
.L117:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L119:
	.align	2
.L118:
	.word	.LC28
	.word	buf
	.word	binfiles
	.word	.LC13
	.word	fix_roms
	.word	.LC14
	.word	return_patch
	.word	.LC15
	.word	sram_patch
	.word	.LC16
	.word	align_size
	.word	.LC17
	.word	.LC7
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	good_header
	.word	visoly
	.word	.LC24
	.word	.LC25
	.word	bincount
	.word	bin_offset
	.word	.LC26
	.word	.LC27
	.word	magic
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
