	.file	"3262830.c"
	.intel_syntax noprefix
	.text
	.globl	header
	.bss
	.align 32
	.type	header, @object
	.size	header, 192
header:
	.zero	192
	.globl	checksum_without_header
	.align 2
	.type	checksum_without_header, @object
	.size	checksum_without_header, 2
checksum_without_header:
	.zero	2
	.globl	good_header
	.section	.rodata
	.align 32
	.type	good_header, @object
	.size	good_header, 192
good_header:
	.long	-369098706
	.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"
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.long	0
	.value	12592
	.byte	-106
	.byte	0
	.byte	0
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.byte	0
	.byte	0
	.value	0
	.text
	.globl	HeaderComplement
	.type	HeaderComplement, @function
HeaderComplement:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	BYTE PTR -13[rbp], 0
	lea	rax, header[rip+160]
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L2
.L3:
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -8[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	mov	edx, eax
	movzx	eax, BYTE PTR -13[rbp]
	add	eax, edx
	mov	BYTE PTR -13[rbp], al
	add	DWORD PTR -12[rbp], 1
.L2:
	cmp	DWORD PTR -12[rbp], 28
	jle	.L3
	movzx	eax, BYTE PTR -13[rbp]
	mov	edx, -25
	sub	edx, eax
	mov	eax, edx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	HeaderComplement, .-HeaderComplement
	.section	.rodata
	.align 8
.LC0:
	.string	"GBA ROM fixer v1.05 by Dark Fader / BlackThunder / WinterMute / Diegoisawesome "
	.align 8
.LC1:
	.string	"Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_code>] [-m<maker_code>] [-r<version>] [-d<debug>]"
.LC2:
	.string	"parameters:"
	.align 8
.LC3:
	.string	"\t-p              Pad to next exact power of 2. No minimum size!"
	.align 8
.LC4:
	.string	"\t-t[<title>]     Patch title. Stripped filename if none given."
	.align 8
.LC5:
	.string	"\t-c<game_code>   Patch game code (four characters)"
	.align 8
.LC6:
	.string	"\t-m<maker_code>  Patch maker code (two characters)"
	.align 8
.LC7:
	.string	"\t-r<version>     Patch game version (number)"
	.align 8
.LC8:
	.string	"\t-d<debug>       Enable debugging handler and set debug entry point (0 or 1)"
.LC9:
	.string	"Filename needed!"
.LC10:
	.string	"r+b"
.LC11:
	.string	"Error opening input file!"
.LC12:
	.string	"Need value for %s\n"
.LC13:
	.string	"Invalid option: %s\n"
.LC14:
	.string	"ROM fixed!"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 592
	mov	DWORD PTR -580[rbp], edi
	mov	QWORD PTR -592[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -560[rbp], 0
	cmp	DWORD PTR -580[rbp], 1
	jg	.L6
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 10
	call	putchar@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L7
.L6:
	mov	DWORD PTR -576[rbp], 1
	jmp	.L8
.L11:
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	je	.L9
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -560[rbp], rax
	jmp	.L10
.L9:
	add	DWORD PTR -576[rbp], 1
.L8:
	mov	eax, DWORD PTR -576[rbp]
	cmp	eax, DWORD PTR -580[rbp]
	jl	.L11
.L10:
	cmp	QWORD PTR -560[rbp], 0
	jne	.L12
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L7
.L12:
	mov	rax, QWORD PTR -560[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -544[rbp], rax
	cmp	QWORD PTR -544[rbp], 0
	jne	.L13
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L7
.L13:
	mov	rax, QWORD PTR -544[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -544[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 192
	lea	rdi, header[rip]
	call	fread@PLT
	mov	rax, QWORD PTR good_header[rip+4]
	mov	rdx, QWORD PTR good_header[rip+12]
	mov	QWORD PTR header[rip+4], rax
	mov	QWORD PTR header[rip+12], rdx
	mov	rax, QWORD PTR good_header[rip+20]
	mov	rdx, QWORD PTR good_header[rip+28]
	mov	QWORD PTR header[rip+20], rax
	mov	QWORD PTR header[rip+28], rdx
	mov	rax, QWORD PTR good_header[rip+36]
	mov	rdx, QWORD PTR good_header[rip+44]
	mov	QWORD PTR header[rip+36], rax
	mov	QWORD PTR header[rip+44], rdx
	mov	rax, QWORD PTR good_header[rip+52]
	mov	rdx, QWORD PTR good_header[rip+60]
	mov	QWORD PTR header[rip+52], rax
	mov	QWORD PTR header[rip+60], rdx
	mov	rax, QWORD PTR good_header[rip+68]
	mov	rdx, QWORD PTR good_header[rip+76]
	mov	QWORD PTR header[rip+68], rax
	mov	QWORD PTR header[rip+76], rdx
	mov	rax, QWORD PTR good_header[rip+84]
	mov	rdx, QWORD PTR good_header[rip+92]
	mov	QWORD PTR header[rip+84], rax
	mov	QWORD PTR header[rip+92], rdx
	mov	rax, QWORD PTR good_header[rip+100]
	mov	rdx, QWORD PTR good_header[rip+108]
	mov	QWORD PTR header[rip+100], rax
	mov	QWORD PTR header[rip+108], rdx
	mov	rax, QWORD PTR good_header[rip+116]
	mov	rdx, QWORD PTR good_header[rip+124]
	mov	QWORD PTR header[rip+116], rax
	mov	QWORD PTR header[rip+124], rdx
	mov	rax, QWORD PTR good_header[rip+132]
	mov	rdx, QWORD PTR good_header[rip+140]
	mov	QWORD PTR header[rip+132], rax
	mov	QWORD PTR header[rip+140], rdx
	mov	rax, QWORD PTR good_header[rip+148]
	mov	QWORD PTR header[rip+148], rax
	mov	eax, DWORD PTR good_header[rip+156]
	mov	DWORD PTR header[rip+156], eax
	mov	eax, -106
	mov	BYTE PTR header[rip+178], al
	mov	eax, 0
	mov	BYTE PTR header[rip+180], al
	mov	DWORD PTR -576[rbp], 1
	jmp	.L14
.L39:
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L41
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	sub	eax, 99
	cmp	eax, 19
	ja	.L16
	mov	eax, eax
	lea	rdx, 0[0+rax*4]
	lea	rax, .L18[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	lea	rdx, .L18[rip]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L18:
	.long	.L24-.L18
	.long	.L23-.L18
	.long	.L16-.L18
	.long	.L16-.L18
	.long	.L16-.L18
	.long	.L16-.L18
	.long	.L16-.L18
	.long	.L16-.L18
	.long	.L16-.L18
	.long	.L16-.L18
	.long	.L22-.L18
	.long	.L16-.L18
	.long	.L16-.L18
	.long	.L21-.L18
	.long	.L16-.L18
	.long	.L20-.L18
	.long	.L16-.L18
	.long	.L19-.L18
	.long	.L16-.L18
	.long	.L42-.L18
	.text
.L21:
	mov	rax, QWORD PTR -544[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -544[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	DWORD PTR -564[rbp], eax
	mov	DWORD PTR -572[rbp], 31
	jmp	.L25
.L28:
	mov	eax, DWORD PTR -572[rbp]
	mov	edx, DWORD PTR -564[rbp]
	mov	ecx, eax
	sar	edx, cl
	mov	eax, edx
	and	eax, 1
	test	eax, eax
	jne	.L43
	sub	DWORD PTR -572[rbp], 1
.L25:
	cmp	DWORD PTR -572[rbp], 0
	jns	.L28
	jmp	.L27
.L43:
	nop
.L27:
	mov	eax, DWORD PTR -572[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	cmp	DWORD PTR -564[rbp], eax
	je	.L29
	mov	eax, DWORD PTR -572[rbp]
	add	eax, 1
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	sub	eax, DWORD PTR -564[rbp]
	mov	DWORD PTR -568[rbp], eax
	jmp	.L30
.L31:
	mov	rax, QWORD PTR -544[rbp]
	mov	rsi, rax
	mov	edi, 255
	call	fputc@PLT
.L30:
	mov	eax, DWORD PTR -568[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -568[rbp], edx
	test	eax, eax
	jne	.L31
.L29:
	mov	rax, QWORD PTR -544[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	jmp	.L15
.L19:
	lea	rax, -528[rbp]
	mov	edx, 256
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 2
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L32
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rcx, 2[rax]
	lea	rax, -528[rbp]
	mov	edx, 12
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	jmp	.L33
.L32:
	lea	rax, -272[rbp]
	mov	QWORD PTR -552[rbp], rax
	mov	rdx, QWORD PTR -560[rbp]
	lea	rax, -272[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	lea	rax, -272[rbp]
	mov	esi, 92
	mov	rdi, rax
	call	strrchr@PLT
	mov	QWORD PTR -536[rbp], rax
	cmp	QWORD PTR -536[rbp], 0
	je	.L34
	mov	rax, QWORD PTR -536[rbp]
	add	rax, 1
	mov	QWORD PTR -552[rbp], rax
.L34:
	lea	rax, -272[rbp]
	mov	esi, 47
	mov	rdi, rax
	call	strrchr@PLT
	mov	QWORD PTR -536[rbp], rax
	cmp	QWORD PTR -536[rbp], 0
	je	.L35
	mov	rax, QWORD PTR -536[rbp]
	add	rax, 1
	mov	QWORD PTR -552[rbp], rax
.L35:
	lea	rax, -272[rbp]
	mov	esi, 46
	mov	rdi, rax
	call	strrchr@PLT
	mov	QWORD PTR -536[rbp], rax
	cmp	QWORD PTR -536[rbp], 0
	je	.L36
	mov	rax, QWORD PTR -536[rbp]
	mov	BYTE PTR [rax], 0
.L36:
	mov	rcx, QWORD PTR -552[rbp]
	lea	rax, -528[rbp]
	mov	edx, 12
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	mov	rax, QWORD PTR -552[rbp]
	mov	rdi, rax
	call	puts@PLT
.L33:
	mov	rax, QWORD PTR -528[rbp]
	mov	QWORD PTR header[rip+160], rax
	mov	eax, DWORD PTR -520[rbp]
	mov	DWORD PTR header[rip+168], eax
	jmp	.L15
.L24:
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 2
	movzx	eax, BYTE PTR [rax]
	movsx	edx, al
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	add	rax, 3
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	sal	eax, 8
	or	edx, eax
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	add	rax, 4
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	sal	eax, 16
	or	edx, eax
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	add	rax, 5
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	sal	eax, 24
	or	eax, edx
	mov	DWORD PTR header[rip+172], eax
	jmp	.L15
.L22:
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 2
	movzx	eax, BYTE PTR [rax]
	movsx	dx, al
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	add	rax, 3
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	sal	eax, 8
	or	eax, edx
	mov	WORD PTR header[rip+176], ax
	jmp	.L15
.L20:
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 2
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L37
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L15
.L37:
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 2
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	BYTE PTR header[rip+188], al
	jmp	.L15
.L23:
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 2
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L38
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L15
.L38:
	mov	BYTE PTR header[rip+156], -91
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 2
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	sal	eax, 7
	mov	BYTE PTR header[rip+180], al
	jmp	.L15
.L16:
	mov	eax, DWORD PTR -576[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -592[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L15
.L41:
	nop
	jmp	.L15
.L42:
	nop
.L15:
	add	DWORD PTR -576[rbp], 1
.L14:
	mov	eax, DWORD PTR -576[rbp]
	cmp	eax, DWORD PTR -580[rbp]
	jl	.L39
	mov	BYTE PTR header[rip+189], 0
	mov	WORD PTR header[rip+190], 0
	mov	eax, 0
	call	HeaderComplement
	mov	BYTE PTR header[rip+189], al
	mov	rax, QWORD PTR -544[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -544[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 192
	lea	rdi, header[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -544[rbp]
	mov	rdi, rax
	call	fclose@PLT
	lea	rdi, .LC14[rip]
	call	puts@PLT
	mov	eax, 0
.L7:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"3262830.c"
	.text
	.comm	header,192,4
	.global	checksum_without_header
	.bss
	.align	1
	.type	checksum_without_header, %object
	.size	checksum_without_header, 2
checksum_without_header:
	.space	2
	.global	good_header
	.section	.rodata
	.align	2
	.type	good_header, %object
	.size	good_header, 192
good_header:
	.word	-369098706
	.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"
	.ascii	"\000\000\000\000\000\000\000\000\000\000\000\000"
	.word	0
	.short	12592
	.byte	-106
	.byte	0
	.byte	0
	.ascii	"\000\000\000\000\000\000\000"
	.byte	0
	.byte	0
	.short	0
	.text
	.align	2
	.global	HeaderComplement
	.syntax unified
	.arm
	.fpu softvfp
	.type	HeaderComplement, %function
HeaderComplement:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	mov	r3, #0
	strb	r3, [fp, #-13]
	ldr	r3, .L5
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L2
.L3:
	ldr	r3, [fp, #-8]
	add	r2, r3, #1
	str	r2, [fp, #-8]
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldrb	r3, [fp, #-13]
	add	r3, r2, r3
	strb	r3, [fp, #-13]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	cmp	r3, #28
	ble	.L3
	ldrb	r3, [fp, #-13]
	rsb	r3, r3, #-16777216
	add	r3, r3, #16711680
	add	r3, r3, #65280
	add	r3, r3, #231
	and	r3, r3, #255
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L6:
	.align	2
.L5:
	.word	header+160
	.size	HeaderComplement, .-HeaderComplement
	.section	.rodata
	.align	2
.LC0:
	.ascii	"GBA ROM fixer v1.05 by Dark Fader / BlackThunder / "
	.ascii	"WinterMute / Diegoisawesome \000"
	.align	2
.LC1:
	.ascii	"Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_"
	.ascii	"code>] [-m<maker_code>] [-r<version>] [-d<debug>]\000"
	.align	2
.LC2:
	.ascii	"parameters:\000"
	.align	2
.LC3:
	.ascii	"\011-p              Pad to next exact power of 2. N"
	.ascii	"o minimum size!\000"
	.align	2
.LC4:
	.ascii	"\011-t[<title>]     Patch title. Stripped filename "
	.ascii	"if none given.\000"
	.align	2
.LC5:
	.ascii	"\011-c<game_code>   Patch game code (four character"
	.ascii	"s)\000"
	.align	2
.LC6:
	.ascii	"\011-m<maker_code>  Patch maker code (two character"
	.ascii	"s)\000"
	.align	2
.LC7:
	.ascii	"\011-r<version>     Patch game version (number)\000"
	.align	2
.LC8:
	.ascii	"\011-d<debug>       Enable debugging handler and se"
	.ascii	"t debug entry point (0 or 1)\000"
	.align	2
.LC9:
	.ascii	"Filename needed!\000"
	.align	2
.LC10:
	.ascii	"r+b\000"
	.align	2
.LC11:
	.ascii	"Error opening input file!\000"
	.align	2
.LC12:
	.ascii	"Need value for %s\012\000"
	.align	2
.LC13:
	.ascii	"Invalid option: %s\012\000"
	.align	2
.LC14:
	.ascii	"ROM fixed!\000"
	.align	2
.LC15:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 560
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #560
	str	r0, [fp, #-560]
	str	r1, [fp, #-564]
	ldr	r3, .L46
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-548]
	ldr	r3, [fp, #-560]
	cmp	r3, #1
	bgt	.L8
	ldr	r0, .L46+4
	bl	puts
	ldr	r0, .L46+8
	bl	puts
	mov	r0, #10
	bl	putchar
	ldr	r0, .L46+12
	bl	puts
	ldr	r0, .L46+16
	bl	puts
	ldr	r0, .L46+20
	bl	puts
	ldr	r0, .L46+24
	bl	puts
	ldr	r0, .L46+28
	bl	puts
	ldr	r0, .L46+32
	bl	puts
	ldr	r0, .L46+36
	bl	puts
	mvn	r3, #0
	b	.L9
.L8:
	mov	r3, #1
	str	r3, [fp, #-552]
	b	.L10
.L13:
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	beq	.L11
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-548]
	b	.L12
.L11:
	ldr	r3, [fp, #-552]
	add	r3, r3, #1
	str	r3, [fp, #-552]
.L10:
	ldr	r2, [fp, #-552]
	ldr	r3, [fp, #-560]
	cmp	r2, r3
	blt	.L13
.L12:
	ldr	r3, [fp, #-548]
	cmp	r3, #0
	bne	.L14
	ldr	r0, .L46+40
	bl	puts
	mvn	r3, #0
	b	.L9
.L14:
	ldr	r1, .L46+44
	ldr	r0, [fp, #-548]
	bl	fopen
	str	r0, [fp, #-532]
	ldr	r3, [fp, #-532]
	cmp	r3, #0
	bne	.L15
	ldr	r0, .L46+48
	bl	puts
	mvn	r3, #0
	b	.L9
.L15:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-532]
	bl	fseek
	ldr	r3, [fp, #-532]
	mov	r2, #1
	mov	r1, #192
	ldr	r0, .L46+52
	bl	fread
	ldr	r3, .L46+52
	ldr	r2, .L46+56
	add	r3, r3, #4
	add	r1, r2, #4
	mov	r2, #156
	mov	r0, r3
	bl	memcpy
	mov	r2, #150
	ldr	r3, .L46+52
	strb	r2, [r3, #178]
	mov	r2, #0
	ldr	r3, .L46+52
	strb	r2, [r3, #180]
	mov	r3, #1
	str	r3, [fp, #-552]
	b	.L16
.L41:
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L43
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #99
	cmp	r3, #19
	ldrls	pc, [pc, r3, asl #2]
	b	.L18
.L20:
	.word	.L26
	.word	.L25
	.word	.L18
	.word	.L18
	.word	.L18
	.word	.L18
	.word	.L18
	.word	.L18
	.word	.L18
	.word	.L18
	.word	.L24
	.word	.L18
	.word	.L18
	.word	.L23
	.word	.L18
	.word	.L22
	.word	.L18
	.word	.L21
	.word	.L18
	.word	.L44
.L23:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-532]
	bl	fseek
	ldr	r0, [fp, #-532]
	bl	ftell
	str	r0, [fp, #-524]
	mov	r3, #31
	str	r3, [fp, #-544]
	b	.L27
.L30:
	ldr	r2, [fp, #-524]
	ldr	r3, [fp, #-544]
	asr	r3, r2, r3
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L45
	ldr	r3, [fp, #-544]
	sub	r3, r3, #1
	str	r3, [fp, #-544]
.L27:
	ldr	r3, [fp, #-544]
	cmp	r3, #0
	bge	.L30
	b	.L29
.L45:
	nop
.L29:
	mov	r2, #1
	ldr	r3, [fp, #-544]
	lsl	r3, r2, r3
	ldr	r2, [fp, #-524]
	cmp	r2, r3
	beq	.L31
	ldr	r3, [fp, #-544]
	add	r3, r3, #1
	mov	r2, #1
	lsl	r2, r2, r3
	ldr	r3, [fp, #-524]
	sub	r3, r2, r3
	str	r3, [fp, #-540]
	b	.L32
.L33:
	ldr	r1, [fp, #-532]
	mov	r0, #255
	bl	fputc
.L32:
	ldr	r3, [fp, #-540]
	sub	r2, r3, #1
	str	r2, [fp, #-540]
	cmp	r3, #0
	bne	.L33
.L31:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-532]
	bl	fseek
	b	.L17
.L21:
	sub	r3, fp, #520
	mov	r2, #256
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #2
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L34
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r1, r3, #2
	sub	r3, fp, #520
	mov	r2, #12
	mov	r0, r3
	bl	strncpy
	b	.L35
.L34:
	sub	r3, fp, #264
	str	r3, [fp, #-536]
	sub	r3, fp, #264
	ldr	r1, [fp, #-548]
	mov	r0, r3
	bl	strcpy
	sub	r3, fp, #264
	mov	r1, #92
	mov	r0, r3
	bl	strrchr
	str	r0, [fp, #-528]
	ldr	r3, [fp, #-528]
	cmp	r3, #0
	beq	.L36
	ldr	r3, [fp, #-528]
	add	r3, r3, #1
	str	r3, [fp, #-536]
.L36:
	sub	r3, fp, #264
	mov	r1, #47
	mov	r0, r3
	bl	strrchr
	str	r0, [fp, #-528]
	ldr	r3, [fp, #-528]
	cmp	r3, #0
	beq	.L37
	ldr	r3, [fp, #-528]
	add	r3, r3, #1
	str	r3, [fp, #-536]
.L37:
	sub	r3, fp, #264
	mov	r1, #46
	mov	r0, r3
	bl	strrchr
	str	r0, [fp, #-528]
	ldr	r3, [fp, #-528]
	cmp	r3, #0
	beq	.L38
	ldr	r3, [fp, #-528]
	mov	r2, #0
	strb	r2, [r3]
.L38:
	sub	r3, fp, #520
	mov	r2, #12
	ldr	r1, [fp, #-536]
	mov	r0, r3
	bl	strncpy
	ldr	r0, [fp, #-536]
	bl	puts
.L35:
	ldr	r3, .L46+52
	add	r3, r3, #160
	sub	r1, fp, #520
	mov	r2, #12
	mov	r0, r3
	bl	memcpy
	b	.L17
.L26:
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #2
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	orr	r2, r1, r3
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-564]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r3, r3, #4
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #16
	orr	r2, r2, r3
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-564]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r3, r3, #5
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	orr	r3, r2, r3
	mov	r2, r3
	ldr	r3, .L46+52
	and	r1, r2, #255
	mov	r0, #0
	orr	r1, r0, r1
	strb	r1, [r3, #172]
	lsr	r1, r2, #8
	and	r1, r1, #255
	mov	r0, #0
	orr	r1, r0, r1
	strb	r1, [r3, #173]
	lsr	r1, r2, #16
	and	r1, r1, #255
	mov	r0, #0
	orr	r1, r0, r1
	strb	r1, [r3, #174]
	lsr	r2, r2, #24
	mov	r1, #0
	orr	r2, r1, r2
	strb	r2, [r3, #175]
	b	.L17
.L24:
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #2
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-564]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r3, r3, #3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	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
	ldr	r2, .L46+52
	and	r1, r3, #255
	mov	r0, #0
	orr	r1, r0, r1
	strb	r1, [r2, #176]
	lsr	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #0
	orr	r3, r1, r3
	strb	r3, [r2, #177]
	b	.L17
.L22:
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #2
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L39
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L46+60
	bl	printf
	b	.L17
.L39:
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #2
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	mov	r3, r0
	and	r2, r3, #255
	ldr	r3, .L46+52
	strb	r2, [r3, #188]
	b	.L17
.L25:
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #2
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L40
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L46+60
	bl	printf
	b	.L17
.L40:
	ldr	r3, .L46+52
	mvn	r2, #90
	strb	r2, [r3, #156]
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #2
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	mov	r3, r0
	and	r3, r3, #255
	lsl	r3, r3, #7
	and	r2, r3, #255
	ldr	r3, .L46+52
	strb	r2, [r3, #180]
	b	.L17
.L18:
	ldr	r3, [fp, #-552]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-564]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L46+64
	bl	printf
	b	.L17
.L43:
	nop
	b	.L17
.L44:
	nop
.L17:
	ldr	r3, [fp, #-552]
	add	r3, r3, #1
	str	r3, [fp, #-552]
.L16:
	ldr	r2, [fp, #-552]
	ldr	r3, [fp, #-560]
	cmp	r2, r3
	blt	.L41
	ldr	r3, .L46+52
	mov	r2, #0
	strb	r2, [r3, #189]
	ldr	r3, .L46+52
	mov	r2, #0
	strb	r2, [r3, #190]
	mov	r2, #0
	strb	r2, [r3, #191]
	bl	HeaderComplement
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L46+52
	strb	r2, [r3, #189]
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-532]
	bl	fseek
	ldr	r3, [fp, #-532]
	mov	r2, #1
	mov	r1, #192
	ldr	r0, .L46+52
	bl	fwrite
	ldr	r0, [fp, #-532]
	bl	fclose
	ldr	r0, .L46+68
	bl	puts
	mov	r3, #0
.L9:
	ldr	r2, .L46
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L42
	bl	__stack_chk_fail
.L42:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L47:
	.align	2
.L46:
	.word	.LC15
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	header
	.word	good_header
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
