	.file	"879973.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"usage: fixheader.exe romname.bin"
	.text
	.globl	printUsage
	.type	printUsage, @function
printUsage:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC0[rip]
	call	puts@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	printUsage, .-printUsage
	.section	.rodata
.LC1:
	.string	"rb+"
.LC2:
	.string	"error: couldn't open \"%s\"\n"
	.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	cmp	DWORD PTR -52[rbp], 1
	jg	.L3
	call	printUsage
	mov	eax, 0
	jmp	.L4
.L3:
	sub	DWORD PTR -52[rbp], 1
	add	QWORD PTR -64[rbp], 8
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L5
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	jmp	.L4
.L5:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	DWORD PTR -40[rbp], eax
	cmp	DWORD PTR -40[rbp], 511
	jg	.L6
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
	jmp	.L4
.L6:
	mov	eax, DWORD PTR -40[rbp]
	sub	eax, 1
	mov	DWORD PTR -36[rbp], eax
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 0
	mov	esi, 420
	mov	rdi, rax
	call	fseek@PLT
	mov	eax, DWORD PTR -36[rbp]
	shr	eax, 24
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	mov	edi, edx
	call	fputc@PLT
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 16
	movzx	eax, al
	mov	rdx, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 8
	movzx	eax, al
	mov	rdx, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
	mov	eax, DWORD PTR -36[rbp]
	movzx	eax, al
	mov	rdx, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
	mov	WORD PTR -46[rbp], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 0
	mov	esi, 512
	mov	rdi, rax
	call	fseek@PLT
	sub	DWORD PTR -40[rbp], 512
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR -36[rbp]
	movsx	rsi, eax
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fread@PLT
	mov	eax, DWORD PTR -40[rbp]
	sar	eax
	add	eax, 1
	mov	DWORD PTR -44[rbp], eax
	jmp	.L7
.L8:
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	add	WORD PTR -46[rbp], ax
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	add	WORD PTR -46[rbp], ax
.L7:
	sub	DWORD PTR -44[rbp], 1
	cmp	DWORD PTR -44[rbp], 0
	jne	.L8
	mov	eax, DWORD PTR -40[rbp]
	and	eax, 1
	test	eax, eax
	je	.L9
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	add	WORD PTR -46[rbp], ax
.L9:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 0
	mov	esi, 398
	mov	rdi, rax
	call	fseek@PLT
	movzx	eax, WORD PTR -46[rbp]
	shr	ax, 8
	movzx	eax, ax
	mov	rdx, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
	movzx	eax, WORD PTR -46[rbp]
	movzx	eax, al
	mov	rdx, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L4:
	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	"879973.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage: fixheader.exe romname.bin\000"
	.text
	.align	2
	.global	printUsage
	.syntax unified
	.arm
	.fpu softvfp
	.type	printUsage, %function
printUsage:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L2
	bl	puts
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC0
	.size	printUsage, .-printUsage
	.section	.rodata
	.align	2
.LC1:
	.ascii	"rb+\000"
	.align	2
.LC2:
	.ascii	"error: couldn't open \"%s\"\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	bgt	.L5
	bl	printUsage
	mov	r3, #0
	b	.L6
.L5:
	ldr	r3, [fp, #-40]
	sub	r3, r3, #1
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-44]
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	ldr	r1, .L12
	ldr	r0, [fp, #-24]
	bl	fopen
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L7
	ldr	r3, [fp, #-44]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L12+4
	bl	printf
	mov	r3, #0
	b	.L6
.L7:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-20]
	bl	fseek
	ldr	r0, [fp, #-20]
	bl	ftell
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #512
	bge	.L8
	ldr	r0, [fp, #-20]
	bl	fclose
	mov	r3, #0
	b	.L6
.L8:
	ldr	r3, [fp, #-16]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	mov	r2, #0
	mov	r1, #420
	ldr	r0, [fp, #-20]
	bl	fseek
	ldr	r3, [fp, #-12]
	lsr	r3, r3, #24
	ldr	r1, [fp, #-20]
	mov	r0, r3
	bl	fputc
	ldr	r3, [fp, #-12]
	asr	r3, r3, #16
	and	r3, r3, #255
	ldr	r1, [fp, #-20]
	mov	r0, r3
	bl	fputc
	ldr	r3, [fp, #-12]
	asr	r3, r3, #8
	and	r3, r3, #255
	ldr	r1, [fp, #-20]
	mov	r0, r3
	bl	fputc
	ldr	r3, [fp, #-12]
	and	r3, r3, #255
	ldr	r1, [fp, #-20]
	mov	r0, r3
	bl	fputc
	mov	r3, #0
	strh	r3, [fp, #-34]	@ movhi
	mov	r2, #0
	mov	r1, #512
	ldr	r0, [fp, #-20]
	bl	fseek
	ldr	r3, [fp, #-16]
	sub	r3, r3, #512
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-32]
	ldr	r1, [fp, #-12]
	ldr	r3, [fp, #-20]
	mov	r2, #1
	ldr	r0, [fp, #-8]
	bl	fread
	ldr	r3, [fp, #-16]
	asr	r3, r3, #1
	add	r3, r3, #1
	str	r3, [fp, #-28]
	b	.L9
.L10:
	ldr	r3, [fp, #-32]
	add	r2, r3, #1
	str	r2, [fp, #-32]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldrh	r3, [fp, #-34]	@ movhi
	add	r3, r2, r3
	strh	r3, [fp, #-34]	@ movhi
	ldr	r3, [fp, #-32]
	add	r2, r3, #1
	str	r2, [fp, #-32]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldrh	r3, [fp, #-34]	@ movhi
	add	r3, r2, r3
	strh	r3, [fp, #-34]	@ movhi
.L9:
	ldr	r3, [fp, #-28]
	sub	r3, r3, #1
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L10
	ldr	r3, [fp, #-16]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L11
	ldr	r3, [fp, #-32]
	add	r2, r3, #1
	str	r2, [fp, #-32]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldrh	r3, [fp, #-34]	@ movhi
	add	r3, r2, r3
	strh	r3, [fp, #-34]	@ movhi
.L11:
	ldr	r0, [fp, #-8]
	bl	free
	mov	r2, #0
	ldr	r1, .L12+8
	ldr	r0, [fp, #-20]
	bl	fseek
	ldrh	r3, [fp, #-34]
	lsr	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldr	r1, [fp, #-20]
	mov	r0, r3
	bl	fputc
	ldrh	r3, [fp, #-34]
	and	r3, r3, #255
	ldr	r1, [fp, #-20]
	mov	r0, r3
	bl	fputc
	ldr	r0, [fp, #-20]
	bl	fclose
	mov	r3, #0
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC1
	.word	.LC2
	.word	398
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
