	.file	"14713.c"
	.intel_syntax noprefix
	.text
	.globl	verbosity
	.bss
	.align 4
	.type	verbosity, @object
	.size	verbosity, 4
verbosity:
	.zero	4
	.text
	.type	swap32, @function
swap32:
.LFB6:
	.cfi_startproc
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	shr	eax, 24
	mov	edx, eax
	mov	eax, DWORD PTR -4[rbp]
	shr	eax, 8
	and	eax, 65280
	or	edx, eax
	mov	eax, DWORD PTR -4[rbp]
	sal	eax, 8
	and	eax, 16711680
	or	edx, eax
	mov	eax, DWORD PTR -4[rbp]
	sal	eax, 24
	or	eax, edx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap32, .-swap32
	.type	swaf16, @function
swaf16:
.LFB7:
	.cfi_startproc
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, edi
	mov	WORD PTR -4[rbp], ax
	movzx	eax, WORD PTR -4[rbp]
	shr	ax, 8
	mov	edx, eax
	movzx	eax, WORD PTR -4[rbp]
	sal	eax, 8
	or	eax, edx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	swaf16, .-swaf16
	.globl	sdataSizes
	.bss
	.align 8
	.type	sdataSizes, @object
	.size	sdataSizes, 8
sdataSizes:
	.zero	8
	.globl	sbssSizes
	.align 8
	.type	sbssSizes, @object
	.size	sbssSizes, 8
sbssSizes:
	.zero	8
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: %s [-h] [-v] [--] elf-file dol-file\n"
	.align 8
.LC1:
	.string	" Convert an ELF file to a DOL file (by segments)\n"
.LC2:
	.string	" Options:\n"
.LC3:
	.string	"  -h    Show this help\n"
	.align 8
.LC4:
	.string	"  -v    Be more verbose (twice for even more)\n"
	.text
	.globl	usage
	.type	usage, @function
usage:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 49
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 10
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 46
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	usage, .-usage
	.section	.rodata
.LC5:
	.string	"Error while "
.LC6:
	.string	"EOF while %s\n"
.LC7:
	.string	"Unknown error while %s\n"
	.text
	.globl	ferrordie
	.type	ferrordie, @function
ferrordie:
.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	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	ferror@PLT
	test	eax, eax
	je	.L7
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 12
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	je	.L8
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -16[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -16[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE9:
	.size	ferrordie, .-ferrordie
	.globl	add_bss
	.type	add_bss, @function
add_bss:
.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 -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 336[rax]
	and	eax, 1
	test	eax, eax
	je	.L10
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 216[rax]
	mov	edi, eax
	call	swap32
	mov	DWORD PTR -8[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 220[rax]
	mov	edi, eax
	call	swap32
	mov	DWORD PTR -4[rbp], eax
	mov	edx, DWORD PTR -8[rbp]
	mov	eax, DWORD PTR -4[rbp]
	add	eax, edx
	cmp	DWORD PTR -28[rbp], eax
	jne	.L12
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -32[rbp]
	add	eax, edx
	mov	edi, eax
	call	swap32
	mov	rdx, QWORD PTR -24[rbp]
	mov	DWORD PTR 220[rdx], eax
	jmp	.L12
.L10:
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	swap32
	mov	rdx, QWORD PTR -24[rbp]
	mov	DWORD PTR 216[rdx], eax
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	swap32
	mov	rdx, QWORD PTR -24[rbp]
	mov	DWORD PTR 220[rdx], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 336[rax]
	or	eax, 1
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 336[rax], edx
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	add_bss, .-add_bss
	.globl	increment_bss_size
	.type	increment_bss_size, @function
increment_bss_size:
.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 -28[rbp], esi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 220[rax]
	mov	edi, eax
	call	swap32
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	add	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	swap32
	mov	rdx, QWORD PTR -24[rbp]
	mov	DWORD PTR 220[rdx], eax
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	increment_bss_size, .-increment_bss_size
	.section	.rodata
.LC8:
	.string	"wii"
.LC9:
	.string	"Reading ELF file...\n"
.LC10:
	.string	"rb"
.LC11:
	.string	"Could not open ELF file"
.LC12:
	.string	"reading ELF header"
.LC13:
	.string	"\177ELF"
.LC14:
	.string	"Invalid ELF header\n"
.LC15:
	.string	"Invalid ELF class\n"
.LC16:
	.string	"Invalid ELF byte order\n"
.LC17:
	.string	"Invalid ELF ident version\n"
.LC18:
	.string	"Invalid ELF version\n"
.LC19:
	.string	"ELF is not an executable\n"
.LC20:
	.string	"Machine is not PowerPC\n"
.LC21:
	.string	"ELF has no entrypoint\n"
.LC22:
	.string	"Valid ELF header found\n"
.LC23:
	.string	"ELF has no program headers\n"
	.align 8
.LC24:
	.string	"Invalid program header entry size\n"
.LC25:
	.string	"reading ELF program headers"
	.align 8
.LC26:
	.string	"PHDR %d: 0x%x [0x%x] -> 0x%08x [0x%x] flags 0x%x\n"
	.align 8
.LC27:
	.string	"Warning: non-readable segment %d\n"
	.align 8
.LC28:
	.string	"Warning: writable and executable segment %d\n"
	.align 8
.LC29:
	.string	"Error: TEXT segment %d memory size (0x%x) smaller than file size (0x%x)\n"
	.align 8
.LC30:
	.string	"Error: Too many TEXT segments\n"
	.align 8
.LC31:
	.string	"Error: segment %d memory size (0x%x) is smaller than file size (0x%x)\n"
	.align 8
.LC32:
	.string	"Error: Too many DATA segments\n"
	.align 8
.LC33:
	.string	"Skipping empty program header %d\n"
	.align 8
.LC34:
	.string	"Skipping program header %d of type %d\n"
.LC35:
	.string	"Segments:\n"
	.align 8
.LC36:
	.string	" TEXT %d: 0x%08x [0x%x] from ELF offset 0x%x\n"
	.align 8
.LC37:
	.string	" DATA %d: 0x%08x [0x%x] from ELF offset 0x%x\n"
.LC38:
	.string	" BSS segment: 0x%08x [0x%x]\n"
	.text
	.globl	read_elf_segments
	.type	read_elf_segments, @function
read_elf_segments:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 160
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	QWORD PTR -152[rbp], rdi
	mov	QWORD PTR -160[rbp], rsi
	mov	DWORD PTR -164[rbp], edx
	mov	QWORD PTR -176[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -164[rbp]
	add	eax, 1
	mov	DWORD PTR -128[rbp], eax
	mov	eax, DWORD PTR -164[rbp]
	add	eax, 2
	mov	DWORD PTR -124[rbp], eax
	mov	rax, QWORD PTR -176[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	sete	al
	movzx	eax, al
	mov	DWORD PTR -120[rbp], eax
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L15
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 20
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
.L15:
	mov	rax, QWORD PTR -160[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	rdx, QWORD PTR -152[rbp]
	mov	QWORD PTR 344[rdx], rax
	mov	rax, QWORD PTR -152[rbp]
	mov	rax, QWORD PTR 344[rax]
	test	rax, rax
	jne	.L16
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	mov	rax, QWORD PTR -152[rbp]
	mov	rdx, QWORD PTR 344[rax]
	lea	rax, -80[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 52
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -116[rbp], eax
	cmp	DWORD PTR -116[rbp], 1
	je	.L17
	mov	rax, QWORD PTR -152[rbp]
	mov	rax, QWORD PTR 344[rax]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	call	ferrordie
.L17:
	lea	rax, -80[rbp]
	mov	edx, 4
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	je	.L18
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 19
	mov	esi, 1
	lea	rdi, .LC14[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L18:
	movzx	eax, BYTE PTR -76[rbp]
	cmp	al, 1
	je	.L19
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 18
	mov	esi, 1
	lea	rdi, .LC15[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L19:
	movzx	eax, BYTE PTR -75[rbp]
	cmp	al, 2
	je	.L20
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC16[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L20:
	movzx	eax, BYTE PTR -74[rbp]
	cmp	al, 1
	je	.L21
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC17[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L21:
	mov	eax, DWORD PTR -60[rbp]
	mov	edi, eax
	call	swap32
	cmp	eax, 1
	je	.L22
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 20
	mov	esi, 1
	lea	rdi, .LC18[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L22:
	movzx	eax, WORD PTR -64[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	swaf16
	cmp	ax, 2
	je	.L23
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 25
	mov	esi, 1
	lea	rdi, .LC19[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	movzx	eax, WORD PTR -62[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	swaf16
	cmp	ax, 20
	je	.L24
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC20[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L24:
	mov	eax, DWORD PTR -56[rbp]
	mov	edi, eax
	call	swap32
	test	eax, eax
	jne	.L25
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC21[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L25:
	mov	edx, DWORD PTR -56[rbp]
	mov	rax, QWORD PTR -152[rbp]
	mov	DWORD PTR 224[rax], edx
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L26
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC22[rip]
	call	fwrite@PLT
.L26:
	movzx	eax, WORD PTR -36[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	swaf16
	mov	WORD PTR -134[rbp], ax
	mov	eax, DWORD PTR -52[rbp]
	mov	edi, eax
	call	swap32
	mov	DWORD PTR -112[rbp], eax
	cmp	WORD PTR -134[rbp], 0
	je	.L27
	cmp	DWORD PTR -112[rbp], 0
	jne	.L28
.L27:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 27
	mov	esi, 1
	lea	rdi, .LC23[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L28:
	movzx	eax, WORD PTR -38[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	swaf16
	cmp	ax, 32
	je	.L29
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 34
	mov	esi, 1
	lea	rdi, .LC24[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L29:
	movzx	eax, WORD PTR -134[rbp]
	sal	rax, 5
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -88[rbp], rax
	mov	ecx, DWORD PTR -112[rbp]
	mov	rax, QWORD PTR -152[rbp]
	mov	rax, QWORD PTR 344[rax]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	test	eax, eax
	jns	.L30
	mov	rax, QWORD PTR -152[rbp]
	mov	rax, QWORD PTR 344[rax]
	lea	rsi, .LC25[rip]
	mov	rdi, rax
	call	ferrordie
.L30:
	mov	rax, QWORD PTR -152[rbp]
	mov	rcx, QWORD PTR 344[rax]
	movzx	edx, WORD PTR -134[rbp]
	mov	rax, QWORD PTR -88[rbp]
	mov	esi, 32
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -116[rbp], eax
	movzx	eax, WORD PTR -134[rbp]
	cmp	DWORD PTR -116[rbp], eax
	je	.L31
	mov	rax, QWORD PTR -152[rbp]
	mov	rax, QWORD PTR 344[rax]
	lea	rsi, .LC25[rip]
	mov	rdi, rax
	call	ferrordie
.L31:
	mov	DWORD PTR -132[rbp], 0
	jmp	.L32
.L50:
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	swap32
	cmp	eax, 1
	jne	.L33
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	mov	edi, eax
	call	swap32
	mov	DWORD PTR -108[rbp], eax
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 8[rax]
	mov	edi, eax
	call	swap32
	mov	DWORD PTR -104[rbp], eax
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 16[rax]
	mov	edi, eax
	call	swap32
	mov	DWORD PTR -100[rbp], eax
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 20[rax]
	mov	edi, eax
	call	swap32
	mov	DWORD PTR -96[rbp], eax
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 24[rax]
	mov	edi, eax
	call	swap32
	mov	DWORD PTR -92[rbp], eax
	cmp	DWORD PTR -96[rbp], 0
	je	.L34
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L35
	mov	rax, QWORD PTR stderr[rip]
	mov	r8d, DWORD PTR -104[rbp]
	mov	edi, DWORD PTR -100[rbp]
	mov	ecx, DWORD PTR -108[rbp]
	mov	edx, DWORD PTR -132[rbp]
	mov	esi, DWORD PTR -92[rbp]
	push	rsi
	mov	esi, DWORD PTR -96[rbp]
	push	rsi
	mov	r9d, r8d
	mov	r8d, edi
	lea	rsi, .LC26[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	rsp, 16
.L35:
	mov	eax, DWORD PTR -92[rbp]
	and	eax, 1
	test	eax, eax
	je	.L36
	mov	eax, DWORD PTR -92[rbp]
	and	eax, 4
	test	eax, eax
	jne	.L37
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -132[rbp]
	lea	rsi, .LC27[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L37:
	mov	eax, DWORD PTR -92[rbp]
	and	eax, 2
	test	eax, eax
	je	.L38
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -132[rbp]
	lea	rsi, .LC28[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L38:
	mov	eax, DWORD PTR -100[rbp]
	cmp	eax, DWORD PTR -96[rbp]
	jbe	.L39
	mov	rax, QWORD PTR stderr[rip]
	mov	esi, DWORD PTR -100[rbp]
	mov	ecx, DWORD PTR -96[rbp]
	mov	edx, DWORD PTR -132[rbp]
	mov	r8d, esi
	lea	rsi, .LC29[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L39:
	mov	eax, DWORD PTR -96[rbp]
	cmp	eax, DWORD PTR -100[rbp]
	jbe	.L40
	mov	eax, DWORD PTR -96[rbp]
	sub	eax, DWORD PTR -100[rbp]
	mov	edx, eax
	mov	ecx, DWORD PTR -104[rbp]
	mov	eax, DWORD PTR -100[rbp]
	add	ecx, eax
	mov	rax, QWORD PTR -152[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	add_bss
.L40:
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 256[rax]
	cmp	eax, 6
	jle	.L41
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC30[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L41:
	mov	rax, QWORD PTR -152[rbp]
	mov	ebx, DWORD PTR 256[rax]
	mov	eax, DWORD PTR -104[rbp]
	mov	edi, eax
	call	swap32
	mov	rdx, QWORD PTR -152[rbp]
	movsx	rcx, ebx
	add	rcx, 16
	mov	DWORD PTR 8[rdx+rcx*4], eax
	mov	rax, QWORD PTR -152[rbp]
	mov	ebx, DWORD PTR 256[rax]
	mov	eax, DWORD PTR -100[rbp]
	mov	edi, eax
	call	swap32
	mov	rdx, QWORD PTR -152[rbp]
	movsx	rcx, ebx
	add	rcx, 36
	mov	DWORD PTR [rdx+rcx*4], eax
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR 256[rax]
	mov	rax, QWORD PTR -152[rbp]
	movsx	rdx, edx
	lea	rcx, 64[rdx]
	mov	edx, DWORD PTR -108[rbp]
	mov	DWORD PTR 8[rax+rcx*4], edx
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 256[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -152[rbp]
	mov	DWORD PTR 256[rax], edx
	jmp	.L42
.L36:
	mov	eax, DWORD PTR -92[rbp]
	and	eax, 4
	test	eax, eax
	jne	.L43
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -132[rbp]
	lea	rsi, .LC27[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L43:
	cmp	DWORD PTR -100[rbp], 0
	jne	.L44
	mov	edx, DWORD PTR -96[rbp]
	mov	ecx, DWORD PTR -104[rbp]
	mov	rax, QWORD PTR -152[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	add_bss
	mov	eax, DWORD PTR -132[rbp]
	cmp	DWORD PTR -124[rbp], eax
	jne	.L45
	mov	eax, DWORD PTR -96[rbp]
	mov	DWORD PTR sbssSizes[rip], eax
	jmp	.L42
.L45:
	cmp	DWORD PTR -120[rbp], 0
	je	.L42
	mov	eax, DWORD PTR -124[rbp]
	lea	edx, 2[rax]
	mov	eax, DWORD PTR -132[rbp]
	cmp	edx, eax
	jne	.L42
	mov	eax, DWORD PTR -96[rbp]
	mov	DWORD PTR sbssSizes[rip+4], eax
	jmp	.L42
.L44:
	mov	eax, DWORD PTR -100[rbp]
	cmp	eax, DWORD PTR -96[rbp]
	jbe	.L46
	mov	rax, QWORD PTR stderr[rip]
	mov	esi, DWORD PTR -100[rbp]
	mov	ecx, DWORD PTR -96[rbp]
	mov	edx, DWORD PTR -132[rbp]
	mov	r8d, esi
	lea	rsi, .LC31[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L46:
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 260[rax]
	cmp	eax, 10
	jle	.L47
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC32[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L47:
	mov	eax, DWORD PTR -132[rbp]
	cmp	DWORD PTR -128[rbp], eax
	jne	.L48
	mov	eax, DWORD PTR -96[rbp]
	mov	DWORD PTR sdataSizes[rip], eax
	jmp	.L49
.L48:
	cmp	DWORD PTR -120[rbp], 0
	je	.L49
	mov	eax, DWORD PTR -128[rbp]
	lea	edx, 2[rax]
	mov	eax, DWORD PTR -132[rbp]
	cmp	edx, eax
	jne	.L49
	mov	eax, DWORD PTR -96[rbp]
	mov	DWORD PTR sdataSizes[rip+4], eax
.L49:
	mov	rax, QWORD PTR -152[rbp]
	mov	ebx, DWORD PTR 260[rax]
	mov	eax, DWORD PTR -104[rbp]
	mov	edi, eax
	call	swap32
	mov	rdx, QWORD PTR -152[rbp]
	movsx	rcx, ebx
	add	rcx, 24
	mov	DWORD PTR 4[rdx+rcx*4], eax
	mov	rax, QWORD PTR -152[rbp]
	mov	ebx, DWORD PTR 260[rax]
	mov	eax, DWORD PTR -100[rbp]
	mov	edi, eax
	call	swap32
	mov	rdx, QWORD PTR -152[rbp]
	movsx	rcx, ebx
	add	rcx, 40
	mov	DWORD PTR 12[rdx+rcx*4], eax
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR 260[rax]
	mov	rax, QWORD PTR -152[rbp]
	movsx	rdx, edx
	lea	rcx, 72[rdx]
	mov	edx, DWORD PTR -108[rbp]
	mov	DWORD PTR 4[rax+rcx*4], edx
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 260[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -152[rbp]
	mov	DWORD PTR 260[rax], edx
	jmp	.L42
.L34:
	mov	eax, DWORD PTR verbosity[rip]
	test	eax, eax
	jle	.L42
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -132[rbp]
	lea	rsi, .LC33[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L42
.L33:
	mov	eax, DWORD PTR verbosity[rip]
	test	eax, eax
	jle	.L42
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	swap32
	mov	ecx, eax
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -132[rbp]
	lea	rsi, .LC34[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L42:
	add	DWORD PTR -132[rbp], 1
.L32:
	movzx	eax, WORD PTR -134[rbp]
	cmp	DWORD PTR -132[rbp], eax
	jl	.L50
	mov	edx, DWORD PTR sdataSizes[rip]
	mov	rax, QWORD PTR -152[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	increment_bss_size
	mov	edx, DWORD PTR sdataSizes[rip+4]
	mov	rax, QWORD PTR -152[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	increment_bss_size
	mov	edx, DWORD PTR sbssSizes[rip]
	mov	rax, QWORD PTR -152[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	increment_bss_size
	mov	edx, DWORD PTR sbssSizes[rip+4]
	mov	rax, QWORD PTR -152[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	increment_bss_size
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L57
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 10
	mov	esi, 1
	lea	rdi, .LC35[rip]
	call	fwrite@PLT
	mov	DWORD PTR -132[rbp], 0
	jmp	.L52
.L53:
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR -132[rbp]
	movsx	rdx, edx
	add	rdx, 64
	mov	r12d, DWORD PTR 8[rax+rdx*4]
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR -132[rbp]
	movsx	rdx, edx
	add	rdx, 36
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	ebx, eax
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR -132[rbp]
	movsx	rdx, edx
	add	rdx, 16
	mov	eax, DWORD PTR 8[rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	ecx, eax
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -132[rbp]
	mov	r9d, r12d
	mov	r8d, ebx
	lea	rsi, .LC36[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -132[rbp], 1
.L52:
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 256[rax]
	cmp	DWORD PTR -132[rbp], eax
	jl	.L53
	mov	DWORD PTR -132[rbp], 0
	jmp	.L54
.L55:
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR -132[rbp]
	movsx	rdx, edx
	add	rdx, 72
	mov	r12d, DWORD PTR 4[rax+rdx*4]
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR -132[rbp]
	movsx	rdx, edx
	add	rdx, 40
	mov	eax, DWORD PTR 12[rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	ebx, eax
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR -132[rbp]
	movsx	rdx, edx
	add	rdx, 24
	mov	eax, DWORD PTR 4[rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	ecx, eax
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -132[rbp]
	mov	r9d, r12d
	mov	r8d, ebx
	lea	rsi, .LC37[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -132[rbp], 1
.L54:
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 260[rax]
	cmp	DWORD PTR -132[rbp], eax
	jl	.L55
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 336[rax]
	and	eax, 1
	test	eax, eax
	je	.L57
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 220[rax]
	mov	edi, eax
	call	swap32
	mov	ebx, eax
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 216[rax]
	mov	edi, eax
	call	swap32
	mov	edx, eax
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, ebx
	lea	rsi, .LC38[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L57:
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L56
	call	__stack_chk_fail@PLT
.L56:
	lea	rsp, -16[rbp]
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	read_elf_segments, .-read_elf_segments
	.section	.rodata
.LC39:
	.string	"Laying out DOL file...\n"
.LC40:
	.string	" TEXT segment %d at 0x%x\n"
.LC41:
	.string	" DATA segment %d at 0x%x\n"
	.align 8
.LC42:
	.string	"Note: adding dummy TEXT segment to work around IOS bug\n"
	.align 8
.LC43:
	.string	"Note: adding dummy DATA segment to work around IOS bug\n"
	.text
	.globl	map_dol
	.type	map_dol, @function
map_dol:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L59
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC39[rip]
	call	fwrite@PLT
.L59:
	mov	DWORD PTR -8[rbp], 256
	mov	DWORD PTR -4[rbp], 0
	jmp	.L60
.L62:
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L61
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, DWORD PTR -8[rbp]
	mov	edx, DWORD PTR -4[rbp]
	lea	rsi, .LC40[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L61:
	mov	eax, DWORD PTR -8[rbp]
	mov	edi, eax
	call	swap32
	mov	rdx, QWORD PTR -24[rbp]
	mov	ecx, DWORD PTR -4[rbp]
	movsx	rcx, ecx
	mov	DWORD PTR [rdx+rcx*4], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR -4[rbp]
	movsx	rdx, edx
	add	rdx, 36
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	edx, DWORD PTR -8[rbp]
	add	eax, edx
	add	eax, 31
	and	eax, -32
	mov	DWORD PTR -8[rbp], eax
	add	DWORD PTR -4[rbp], 1
.L60:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 256[rax]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L62
	mov	DWORD PTR -4[rbp], 0
	jmp	.L63
.L65:
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L64
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, DWORD PTR -8[rbp]
	mov	edx, DWORD PTR -4[rbp]
	lea	rsi, .LC41[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L64:
	mov	eax, DWORD PTR -8[rbp]
	mov	edi, eax
	call	swap32
	mov	rdx, QWORD PTR -24[rbp]
	mov	ecx, DWORD PTR -4[rbp]
	movsx	rcx, ecx
	add	rcx, 4
	mov	DWORD PTR 12[rdx+rcx*4], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR -4[rbp]
	movsx	rdx, edx
	add	rdx, 40
	mov	eax, DWORD PTR 12[rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	edx, DWORD PTR -8[rbp]
	add	eax, edx
	add	eax, 31
	and	eax, -32
	mov	DWORD PTR -8[rbp], eax
	add	DWORD PTR -4[rbp], 1
.L63:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 260[rax]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L65
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 256[rax]
	test	eax, eax
	jne	.L66
	mov	eax, DWORD PTR verbosity[rip]
	test	eax, eax
	jle	.L67
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 55
	mov	esi, 1
	lea	rdi, .LC42[rip]
	call	fwrite@PLT
.L67:
	mov	edi, 256
	call	swap32
	mov	rdx, QWORD PTR -24[rbp]
	mov	DWORD PTR [rdx], eax
.L66:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 260[rax]
	test	eax, eax
	jne	.L70
	mov	eax, DWORD PTR verbosity[rip]
	test	eax, eax
	jle	.L69
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 55
	mov	esi, 1
	lea	rdi, .LC43[rip]
	call	fwrite@PLT
.L69:
	mov	edi, 256
	call	swap32
	mov	rdx, QWORD PTR -24[rbp]
	mov	DWORD PTR 28[rdx], eax
.L70:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	map_dol, .-map_dol
	.section	.rodata
.LC44:
	.string	"reading ELF segment data"
.LC45:
	.string	"writing DOL segment data"
	.text
	.globl	fcpy
	.type	fcpy, @function
fcpy:
.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, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -52[rbp], edx
	mov	DWORD PTR -56[rbp], ecx
	mov	DWORD PTR -60[rbp], r8d
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR -24[rbp], eax
	mov	ecx, DWORD PTR -56[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	test	eax, eax
	jns	.L72
	mov	rax, QWORD PTR -48[rbp]
	lea	rsi, .LC44[rip]
	mov	rdi, rax
	call	ferrordie
.L72:
	mov	ecx, DWORD PTR -52[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	test	eax, eax
	jns	.L73
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC45[rip]
	mov	rdi, rax
	call	ferrordie
.L73:
	mov	eax, 1048576
	cmp	DWORD PTR -24[rbp], 1048576
	cmovle	eax, DWORD PTR -24[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	jmp	.L74
.L77:
	mov	eax, 1048576
	cmp	DWORD PTR -24[rbp], 1048576
	cmovle	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	je	.L75
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -48[rbp]
	lea	rsi, .LC44[rip]
	mov	rdi, rax
	call	ferrordie
.L75:
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	je	.L76
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC45[rip]
	mov	rdi, rax
	call	ferrordie
.L76:
	mov	eax, DWORD PTR -20[rbp]
	sub	DWORD PTR -24[rbp], eax
.L74:
	cmp	DWORD PTR -24[rbp], 0
	jne	.L77
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	fcpy, .-fcpy
	.section	.rodata
.LC46:
	.string	"Writing DOL file...\n"
.LC47:
	.string	"wb"
.LC48:
	.string	"Could not open DOL file"
.LC49:
	.string	"DOL header:\n"
	.align 8
.LC50:
	.string	" TEXT %d @ 0x%08x [0x%x] off 0x%x\n"
	.align 8
.LC51:
	.string	" DATA %d @ 0x%08x [0x%x] off 0x%x\n"
.LC52:
	.string	" BSS @ 0x%08x [0x%x]\n"
.LC53:
	.string	" Entry: 0x%08x\n"
.LC54:
	.string	"Writing DOL header...\n"
.LC55:
	.string	"writing DOL header"
.LC56:
	.string	"Writing TEXT segment %d...\n"
.LC57:
	.string	"Writing DATA segment %d...\n"
.LC58:
	.string	"All done!\n"
	.text
	.globl	write_dol
	.type	write_dol, @function
write_dol:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 304
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	QWORD PTR -312[rbp], rdi
	mov	QWORD PTR -320[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	rcx, QWORD PTR [rax]
	mov	rbx, QWORD PTR 8[rax]
	mov	QWORD PTR -288[rbp], rcx
	mov	QWORD PTR -280[rbp], rbx
	mov	rcx, QWORD PTR 16[rax]
	mov	rbx, QWORD PTR 24[rax]
	mov	QWORD PTR -272[rbp], rcx
	mov	QWORD PTR -264[rbp], rbx
	mov	rcx, QWORD PTR 32[rax]
	mov	rbx, QWORD PTR 40[rax]
	mov	QWORD PTR -256[rbp], rcx
	mov	QWORD PTR -248[rbp], rbx
	mov	rcx, QWORD PTR 48[rax]
	mov	rbx, QWORD PTR 56[rax]
	mov	QWORD PTR -240[rbp], rcx
	mov	QWORD PTR -232[rbp], rbx
	mov	rcx, QWORD PTR 64[rax]
	mov	rbx, QWORD PTR 72[rax]
	mov	QWORD PTR -224[rbp], rcx
	mov	QWORD PTR -216[rbp], rbx
	mov	rcx, QWORD PTR 80[rax]
	mov	rbx, QWORD PTR 88[rax]
	mov	QWORD PTR -208[rbp], rcx
	mov	QWORD PTR -200[rbp], rbx
	mov	rcx, QWORD PTR 96[rax]
	mov	rbx, QWORD PTR 104[rax]
	mov	QWORD PTR -192[rbp], rcx
	mov	QWORD PTR -184[rbp], rbx
	mov	rcx, QWORD PTR 112[rax]
	mov	rbx, QWORD PTR 120[rax]
	mov	QWORD PTR -176[rbp], rcx
	mov	QWORD PTR -168[rbp], rbx
	mov	rcx, QWORD PTR 128[rax]
	mov	rbx, QWORD PTR 136[rax]
	mov	QWORD PTR -160[rbp], rcx
	mov	QWORD PTR -152[rbp], rbx
	mov	rcx, QWORD PTR 144[rax]
	mov	rbx, QWORD PTR 152[rax]
	mov	QWORD PTR -144[rbp], rcx
	mov	QWORD PTR -136[rbp], rbx
	mov	rcx, QWORD PTR 160[rax]
	mov	rbx, QWORD PTR 168[rax]
	mov	QWORD PTR -128[rbp], rcx
	mov	QWORD PTR -120[rbp], rbx
	mov	rcx, QWORD PTR 176[rax]
	mov	rbx, QWORD PTR 184[rax]
	mov	QWORD PTR -112[rbp], rcx
	mov	QWORD PTR -104[rbp], rbx
	mov	rcx, QWORD PTR 192[rax]
	mov	rbx, QWORD PTR 200[rax]
	mov	QWORD PTR -96[rbp], rcx
	mov	QWORD PTR -88[rbp], rbx
	mov	rcx, QWORD PTR 208[rax]
	mov	rbx, QWORD PTR 216[rax]
	mov	QWORD PTR -80[rbp], rcx
	mov	QWORD PTR -72[rbp], rbx
	mov	rcx, QWORD PTR 224[rax]
	mov	rbx, QWORD PTR 232[rax]
	mov	QWORD PTR -64[rbp], rcx
	mov	QWORD PTR -56[rbp], rbx
	mov	rdx, QWORD PTR 248[rax]
	mov	rax, QWORD PTR 240[rax]
	mov	QWORD PTR -48[rbp], rax
	mov	QWORD PTR -40[rbp], rdx
	mov	DWORD PTR -304[rbp], 0
	jmp	.L79
.L80:
	mov	eax, DWORD PTR -304[rbp]
	cdqe
	add	rax, 36
	mov	eax, DWORD PTR -288[rbp+rax*4]
	mov	edi, eax
	call	swap32
	add	eax, 31
	and	eax, -32
	mov	edi, eax
	call	swap32
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 36
	mov	DWORD PTR -288[rbp+rdx*4], eax
	add	DWORD PTR -304[rbp], 1
.L79:
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 256[rax]
	cmp	DWORD PTR -304[rbp], eax
	jl	.L80
	mov	DWORD PTR -304[rbp], 0
	jmp	.L81
.L82:
	mov	eax, DWORD PTR -304[rbp]
	cdqe
	add	rax, 40
	mov	eax, DWORD PTR -276[rbp+rax*4]
	mov	edi, eax
	call	swap32
	add	eax, 31
	and	eax, -32
	mov	edi, eax
	call	swap32
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 40
	mov	DWORD PTR -276[rbp+rdx*4], eax
	add	DWORD PTR -304[rbp], 1
.L81:
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 260[rax]
	cmp	DWORD PTR -304[rbp], eax
	jl	.L82
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L83
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 20
	mov	esi, 1
	lea	rdi, .LC46[rip]
	call	fwrite@PLT
.L83:
	mov	rax, QWORD PTR -320[rbp]
	lea	rsi, .LC47[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -296[rbp], rax
	cmp	QWORD PTR -296[rbp], 0
	jne	.L84
	lea	rdi, .LC48[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L84:
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L85
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 12
	mov	esi, 1
	lea	rdi, .LC49[rip]
	call	fwrite@PLT
	mov	DWORD PTR -304[rbp], 0
	jmp	.L86
.L87:
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	r12d, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 36
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	ebx, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 16
	mov	eax, DWORD PTR 8[rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	ecx, eax
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -304[rbp]
	mov	r9d, r12d
	mov	r8d, ebx
	lea	rsi, .LC50[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -304[rbp], 1
.L86:
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 256[rax]
	mov	edx, 1
	test	eax, eax
	cmovle	eax, edx
	cmp	DWORD PTR -304[rbp], eax
	jl	.L87
	mov	DWORD PTR -304[rbp], 0
	jmp	.L88
.L89:
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 4
	mov	eax, DWORD PTR 12[rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	r12d, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 40
	mov	eax, DWORD PTR 12[rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	ebx, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 24
	mov	eax, DWORD PTR 4[rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	ecx, eax
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -304[rbp]
	mov	r9d, r12d
	mov	r8d, ebx
	lea	rsi, .LC51[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -304[rbp], 1
.L88:
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 260[rax]
	mov	edx, 1
	test	eax, eax
	cmovle	eax, edx
	cmp	DWORD PTR -304[rbp], eax
	jl	.L89
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 216[rax]
	mov	edi, eax
	call	swap32
	test	eax, eax
	je	.L90
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 220[rax]
	mov	edi, eax
	call	swap32
	test	eax, eax
	je	.L90
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 220[rax]
	mov	edi, eax
	call	swap32
	mov	ebx, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 216[rax]
	mov	edi, eax
	call	swap32
	mov	edx, eax
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, ebx
	lea	rsi, .LC52[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L90:
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 224[rax]
	mov	edi, eax
	call	swap32
	mov	edx, eax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC53[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC54[rip]
	call	fwrite@PLT
.L85:
	mov	rdx, QWORD PTR -296[rbp]
	lea	rax, -288[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 256
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -300[rbp], eax
	cmp	DWORD PTR -300[rbp], 1
	je	.L91
	mov	rax, QWORD PTR -296[rbp]
	lea	rsi, .LC55[rip]
	mov	rdi, rax
	call	ferrordie
.L91:
	mov	DWORD PTR -304[rbp], 0
	jmp	.L92
.L94:
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L93
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -304[rbp]
	lea	rsi, .LC56[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L93:
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 36
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	r12d, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 64
	mov	ebx, DWORD PTR 8[rax+rdx*4]
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	edx, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	rsi, QWORD PTR 344[rax]
	mov	rax, QWORD PTR -296[rbp]
	mov	r8d, r12d
	mov	ecx, ebx
	mov	rdi, rax
	call	fcpy
	add	DWORD PTR -304[rbp], 1
.L92:
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 256[rax]
	cmp	DWORD PTR -304[rbp], eax
	jl	.L94
	mov	DWORD PTR -304[rbp], 0
	jmp	.L95
.L97:
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L96
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -304[rbp]
	lea	rsi, .LC57[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L96:
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 40
	mov	eax, DWORD PTR 12[rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	r12d, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 72
	mov	ebx, DWORD PTR 4[rax+rdx*4]
	mov	rax, QWORD PTR -312[rbp]
	mov	edx, DWORD PTR -304[rbp]
	movsx	rdx, edx
	add	rdx, 4
	mov	eax, DWORD PTR 12[rax+rdx*4]
	mov	edi, eax
	call	swap32
	mov	edx, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	rsi, QWORD PTR 344[rax]
	mov	rax, QWORD PTR -296[rbp]
	mov	r8d, r12d
	mov	ecx, ebx
	mov	rdi, rax
	call	fcpy
	add	DWORD PTR -304[rbp], 1
.L95:
	mov	rax, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR 260[rax]
	cmp	DWORD PTR -304[rbp], eax
	jl	.L97
	mov	eax, DWORD PTR verbosity[rip]
	cmp	eax, 1
	jle	.L98
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 10
	mov	esi, 1
	lea	rdi, .LC58[rip]
	call	fwrite@PLT
.L98:
	mov	rax, QWORD PTR -312[rbp]
	mov	rax, QWORD PTR 344[rax]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -296[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L99
	call	__stack_chk_fail@PLT
.L99:
	add	rsp, 304
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	write_dol, .-write_dol
	.section	.rodata
.LC59:
	.string	"-h"
.LC60:
	.string	"-v"
.LC61:
	.string	"--"
.LC62:
	.string	"Unrecognized option %s\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 432
	mov	DWORD PTR -420[rbp], edi
	mov	QWORD PTR -432[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -420[rbp], 1
	jg	.L101
	mov	rax, QWORD PTR -432[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	usage
	mov	eax, 1
	jmp	.L111
.L101:
	mov	rax, QWORD PTR -432[rbp]
	add	rax, 8
	mov	QWORD PTR -400[rbp], rax
	sub	DWORD PTR -420[rbp], 1
	jmp	.L103
.L109:
	mov	rax, QWORD PTR -400[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC59[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L104
	mov	rax, QWORD PTR -432[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	usage
	mov	eax, 1
	jmp	.L111
.L104:
	mov	rax, QWORD PTR -400[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC60[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L105
	mov	eax, DWORD PTR verbosity[rip]
	add	eax, 1
	mov	DWORD PTR verbosity[rip], eax
	jmp	.L113
.L105:
	mov	rax, QWORD PTR -400[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC61[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L107
	add	QWORD PTR -400[rbp], 8
	sub	DWORD PTR -420[rbp], 1
	jmp	.L108
.L107:
	mov	rax, QWORD PTR -400[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC62[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -432[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	usage
	mov	eax, 1
	jmp	.L111
.L113:
	add	QWORD PTR -400[rbp], 8
	sub	DWORD PTR -420[rbp], 1
.L103:
	cmp	DWORD PTR -420[rbp], 0
	je	.L108
	mov	rax, QWORD PTR -400[rbp]
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	je	.L109
.L108:
	cmp	DWORD PTR -420[rbp], 1
	jg	.L110
	mov	rax, QWORD PTR -432[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	usage
	mov	edi, 1
	call	exit@PLT
.L110:
	mov	rax, QWORD PTR -400[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -392[rbp], rax
	mov	rax, QWORD PTR -400[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -384[rbp], rax
	mov	rax, QWORD PTR -400[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -404[rbp], eax
	mov	rax, QWORD PTR -400[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	QWORD PTR -376[rbp], rax
	lea	rax, -368[rbp]
	mov	edx, 352
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rcx, QWORD PTR -376[rbp]
	mov	edx, DWORD PTR -404[rbp]
	mov	rsi, QWORD PTR -392[rbp]
	lea	rax, -368[rbp]
	mov	rdi, rax
	call	read_elf_segments
	lea	rax, -368[rbp]
	mov	rdi, rax
	call	map_dol
	mov	rdx, QWORD PTR -384[rbp]
	lea	rax, -368[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	write_dol
	mov	eax, 0
.L111:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L112
	call	__stack_chk_fail@PLT
.L112:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.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	"14713.c"
	.text
	.global	verbosity
	.bss
	.align	2
	.type	verbosity, %object
	.size	verbosity, 4
verbosity:
	.space	4
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	swap32, %function
swap32:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	lsr	r2, r3, #24
	ldr	r3, [fp, #-8]
	lsr	r3, r3, #8
	and	r3, r3, #65280
	orr	r2, r2, r3
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #8
	and	r3, r3, #16711680
	orr	r2, r2, r3
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #24
	orr	r3, r2, r3
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	swap32, .-swap32
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	swaf16, %function
swaf16:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	mov	r3, r0
	strh	r3, [fp, #-6]	@ movhi
	ldrh	r3, [fp, #-6]
	lsr	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldrh	r3, [fp, #-6]
	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
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	swaf16, .-swaf16
	.global	sdataSizes
	.bss
	.align	2
	.type	sdataSizes, %object
	.size	sdataSizes, 8
sdataSizes:
	.space	8
	.global	sbssSizes
	.align	2
	.type	sbssSizes, %object
	.size	sbssSizes, 8
sbssSizes:
	.space	8
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s [-h] [-v] [--] elf-file dol-file\012\000"
	.align	2
.LC1:
	.ascii	" Convert an ELF file to a DOL file (by segments)\012"
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	" Options:\012\000"
	.align	2
.LC3:
	.ascii	"  -h    Show this help\012\000"
	.align	2
.LC4:
	.ascii	"  -v    Be more verbose (twice for even more)\012\000"
	.text
	.align	2
	.global	usage
	.syntax unified
	.arm
	.fpu softvfp
	.type	usage, %function
usage:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, .L6
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L6+4
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L6
	ldr	r3, [r3]
	mov	r2, #49
	mov	r1, #1
	ldr	r0, .L6+8
	bl	fwrite
	ldr	r3, .L6
	ldr	r3, [r3]
	mov	r2, #10
	mov	r1, #1
	ldr	r0, .L6+12
	bl	fwrite
	ldr	r3, .L6
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L6+16
	bl	fwrite
	ldr	r3, .L6
	ldr	r3, [r3]
	mov	r2, #46
	mov	r1, #1
	ldr	r0, .L6+20
	bl	fwrite
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	usage, .-usage
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Error while \000"
	.align	2
.LC6:
	.ascii	"EOF while %s\012\000"
	.align	2
.LC7:
	.ascii	"Unknown error while %s\012\000"
	.text
	.align	2
	.global	ferrordie
	.syntax unified
	.arm
	.fpu softvfp
	.type	ferrordie, %function
ferrordie:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	ferror
	mov	r3, r0
	cmp	r3, #0
	beq	.L9
	ldr	r3, .L11
	ldr	r3, [r3]
	mov	r2, #12
	mov	r1, #1
	ldr	r0, .L11+4
	bl	fwrite
	ldr	r0, [fp, #-12]
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	ldr	r0, [fp, #-8]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	ldr	r3, .L11
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	ldr	r1, .L11+8
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L10:
	ldr	r3, .L11
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	ldr	r1, .L11+12
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L12:
	.align	2
.L11:
	.word	stderr
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	ferrordie, .-ferrordie
	.align	2
	.global	add_bss
	.syntax unified
	.arm
	.fpu softvfp
	.type	add_bss, %function
add_bss:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #336]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L14
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #216]
	mov	r0, r3
	bl	swap32
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #220]
	mov	r0, r3
	bl	swap32
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bne	.L16
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-24]
	add	r3, r2, r3
	mov	r0, r3
	bl	swap32
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r2, [r3, #220]
	b	.L16
.L14:
	ldr	r0, [fp, #-20]
	bl	swap32
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r2, [r3, #216]
	ldr	r0, [fp, #-24]
	bl	swap32
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r2, [r3, #220]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #336]
	orr	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3, #336]
.L16:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	add_bss, .-add_bss
	.align	2
	.global	increment_bss_size
	.syntax unified
	.arm
	.fpu softvfp
	.type	increment_bss_size, %function
increment_bss_size:
	@ 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]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #220]
	mov	r0, r3
	bl	swap32
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	swap32
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r2, [r3, #220]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	increment_bss_size, .-increment_bss_size
	.section	.rodata
	.align	2
.LC8:
	.ascii	"wii\000"
	.align	2
.LC9:
	.ascii	"Reading ELF file...\012\000"
	.align	2
.LC10:
	.ascii	"rb\000"
	.align	2
.LC11:
	.ascii	"Could not open ELF file\000"
	.align	2
.LC12:
	.ascii	"reading ELF header\000"
	.align	2
.LC13:
	.ascii	"\177ELF\000"
	.align	2
.LC14:
	.ascii	"Invalid ELF header\012\000"
	.align	2
.LC15:
	.ascii	"Invalid ELF class\012\000"
	.align	2
.LC16:
	.ascii	"Invalid ELF byte order\012\000"
	.align	2
.LC17:
	.ascii	"Invalid ELF ident version\012\000"
	.align	2
.LC18:
	.ascii	"Invalid ELF version\012\000"
	.align	2
.LC19:
	.ascii	"ELF is not an executable\012\000"
	.align	2
.LC20:
	.ascii	"Machine is not PowerPC\012\000"
	.align	2
.LC21:
	.ascii	"ELF has no entrypoint\012\000"
	.align	2
.LC22:
	.ascii	"Valid ELF header found\012\000"
	.align	2
.LC23:
	.ascii	"ELF has no program headers\012\000"
	.align	2
.LC24:
	.ascii	"Invalid program header entry size\012\000"
	.align	2
.LC25:
	.ascii	"reading ELF program headers\000"
	.align	2
.LC26:
	.ascii	"PHDR %d: 0x%x [0x%x] -> 0x%08x [0x%x] flags 0x%x\012"
	.ascii	"\000"
	.align	2
.LC27:
	.ascii	"Warning: non-readable segment %d\012\000"
	.align	2
.LC28:
	.ascii	"Warning: writable and executable segment %d\012\000"
	.align	2
.LC29:
	.ascii	"Error: TEXT segment %d memory size (0x%x) smaller t"
	.ascii	"han file size (0x%x)\012\000"
	.align	2
.LC30:
	.ascii	"Error: Too many TEXT segments\012\000"
	.align	2
.LC31:
	.ascii	"Error: segment %d memory size (0x%x) is smaller tha"
	.ascii	"n file size (0x%x)\012\000"
	.align	2
.LC32:
	.ascii	"Error: Too many DATA segments\012\000"
	.align	2
.LC33:
	.ascii	"Skipping empty program header %d\012\000"
	.align	2
.LC34:
	.ascii	"Skipping program header %d of type %d\012\000"
	.align	2
.LC35:
	.ascii	"Segments:\012\000"
	.align	2
.LC36:
	.ascii	" TEXT %d: 0x%08x [0x%x] from ELF offset 0x%x\012\000"
	.align	2
.LC37:
	.ascii	" DATA %d: 0x%08x [0x%x] from ELF offset 0x%x\012\000"
	.align	2
.LC38:
	.ascii	" BSS segment: 0x%08x [0x%x]\012\000"
	.align	2
.LC39:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_elf_segments
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_elf_segments, %function
read_elf_segments:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #144
	str	r0, [fp, #-128]
	str	r1, [fp, #-132]
	str	r2, [fp, #-136]
	str	r3, [fp, #-140]
	ldr	r3, .L62
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-136]
	add	r3, r3, #1
	str	r3, [fp, #-112]
	ldr	r3, [fp, #-136]
	add	r3, r3, #2
	str	r3, [fp, #-108]
	ldr	r1, .L62+4
	ldr	r0, [fp, #-140]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-104]
	ldr	r3, .L62+8
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L19
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #20
	mov	r1, #1
	ldr	r0, .L62+16
	bl	fwrite
.L19:
	ldr	r1, .L62+20
	ldr	r0, [fp, #-132]
	bl	fopen
	mov	r2, r0
	ldr	r3, [fp, #-128]
	str	r2, [r3, #340]
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #340]
	cmp	r3, #0
	bne	.L20
	ldr	r0, .L62+24
	bl	perror
	mov	r0, #1
	bl	exit
.L20:
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #340]
	sub	r0, fp, #68
	mov	r2, #1
	mov	r1, #52
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-100]
	ldr	r3, [fp, #-100]
	cmp	r3, #1
	beq	.L21
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #340]
	ldr	r1, .L62+28
	mov	r0, r3
	bl	ferrordie
.L21:
	sub	r3, fp, #68
	mov	r2, #4
	ldr	r1, .L62+32
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L22
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #19
	mov	r1, #1
	ldr	r0, .L62+36
	bl	fwrite
	mov	r0, #1
	bl	exit
.L22:
	ldrb	r3, [fp, #-64]	@ zero_extendqisi2
	cmp	r3, #1
	beq	.L23
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #18
	mov	r1, #1
	ldr	r0, .L62+40
	bl	fwrite
	mov	r0, #1
	bl	exit
.L23:
	ldrb	r3, [fp, #-63]	@ zero_extendqisi2
	cmp	r3, #2
	beq	.L24
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L62+44
	bl	fwrite
	mov	r0, #1
	bl	exit
.L24:
	ldrb	r3, [fp, #-62]	@ zero_extendqisi2
	cmp	r3, #1
	beq	.L25
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L62+48
	bl	fwrite
	mov	r0, #1
	bl	exit
.L25:
	ldr	r3, [fp, #-48]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	cmp	r3, #1
	beq	.L26
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #20
	mov	r1, #1
	ldr	r0, .L62+52
	bl	fwrite
	mov	r0, #1
	bl	exit
.L26:
	ldrh	r3, [fp, #-52]
	mov	r0, r3
	bl	swaf16
	mov	r3, r0
	cmp	r3, #2
	beq	.L27
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L62+56
	bl	fwrite
	mov	r0, #1
	bl	exit
.L27:
	ldrh	r3, [fp, #-50]
	mov	r0, r3
	bl	swaf16
	mov	r3, r0
	cmp	r3, #20
	beq	.L28
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L62+60
	bl	fwrite
	mov	r0, #1
	bl	exit
.L28:
	ldr	r3, [fp, #-44]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	cmp	r3, #0
	bne	.L29
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L62+64
	bl	fwrite
	mov	r0, #1
	bl	exit
.L29:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-128]
	str	r2, [r3, #224]
	ldr	r3, .L62+8
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L30
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L62+68
	bl	fwrite
.L30:
	ldrh	r3, [fp, #-24]
	mov	r0, r3
	bl	swaf16
	mov	r3, r0
	strh	r3, [fp, #-118]	@ movhi
	ldr	r3, [fp, #-40]
	mov	r0, r3
	bl	swap32
	str	r0, [fp, #-96]
	ldrh	r3, [fp, #-118]
	cmp	r3, #0
	beq	.L31
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	bne	.L32
.L31:
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #27
	mov	r1, #1
	ldr	r0, .L62+72
	bl	fwrite
	mov	r0, #1
	bl	exit
.L32:
	ldrh	r3, [fp, #-26]
	mov	r0, r3
	bl	swaf16
	mov	r3, r0
	cmp	r3, #32
	beq	.L33
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #34
	mov	r1, #1
	ldr	r0, .L62+76
	bl	fwrite
	mov	r0, #1
	bl	exit
.L33:
	ldrh	r3, [fp, #-118]
	lsl	r3, r3, #5
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-92]
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #340]
	ldr	r1, [fp, #-96]
	mov	r2, #0
	mov	r0, r3
	bl	fseek
	mov	r3, r0
	cmp	r3, #0
	bge	.L34
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #340]
	ldr	r1, .L62+80
	mov	r0, r3
	bl	ferrordie
.L34:
	ldrh	r2, [fp, #-118]
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #340]
	mov	r1, #32
	ldr	r0, [fp, #-92]
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-100]
	ldrh	r3, [fp, #-118]
	ldr	r2, [fp, #-100]
	cmp	r2, r3
	beq	.L35
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #340]
	ldr	r1, .L62+80
	mov	r0, r3
	bl	ferrordie
.L35:
	mov	r3, #0
	str	r3, [fp, #-116]
	b	.L36
.L54:
	ldr	r3, [fp, #-116]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	cmp	r3, #1
	bne	.L37
	ldr	r3, [fp, #-116]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	swap32
	str	r0, [fp, #-88]
	ldr	r3, [fp, #-116]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	swap32
	str	r0, [fp, #-84]
	ldr	r3, [fp, #-116]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	ldr	r3, [r3, #16]
	mov	r0, r3
	bl	swap32
	str	r0, [fp, #-80]
	ldr	r3, [fp, #-116]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	ldr	r3, [r3, #20]
	mov	r0, r3
	bl	swap32
	str	r0, [fp, #-76]
	ldr	r3, [fp, #-116]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	ldr	r3, [r3, #24]
	mov	r0, r3
	bl	swap32
	str	r0, [fp, #-72]
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	beq	.L38
	ldr	r3, .L62+8
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L39
	ldr	r3, .L62+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-72]
	str	r3, [sp, #12]
	ldr	r3, [fp, #-76]
	str	r3, [sp, #8]
	ldr	r3, [fp, #-84]
	str	r3, [sp, #4]
	ldr	r3, [fp, #-80]
	str	r3, [sp]
	ldr	r3, [fp, #-88]
	ldr	r2, [fp, #-116]
	ldr	r1, .L62+84
	bl	fprintf
.L39:
	ldr	r3, [fp, #-72]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L40
	ldr	r3, [fp, #-72]
	and	r3, r3, #4
	cmp	r3, #0
	bne	.L41
	ldr	r3, .L62+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-116]
	ldr	r1, .L62+88
	mov	r0, r3
	bl	fprintf
.L41:
	ldr	r3, [fp, #-72]
	and	r3, r3, #2
	cmp	r3, #0
	beq	.L42
	ldr	r3, .L62+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-116]
	ldr	r1, .L62+92
	mov	r0, r3
	bl	fprintf
.L42:
	ldr	r2, [fp, #-80]
	ldr	r3, [fp, #-76]
	cmp	r2, r3
	bls	.L43
	ldr	r3, .L62+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-80]
	str	r3, [sp]
	ldr	r3, [fp, #-76]
	ldr	r2, [fp, #-116]
	ldr	r1, .L62+96
	bl	fprintf
	mov	r0, #1
	bl	exit
.L43:
	ldr	r2, [fp, #-76]
	ldr	r3, [fp, #-80]
	cmp	r2, r3
	bls	.L44
	ldr	r2, [fp, #-84]
	ldr	r3, [fp, #-80]
	add	r1, r2, r3
	ldr	r2, [fp, #-76]
	ldr	r3, [fp, #-80]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r0, [fp, #-128]
	bl	add_bss
.L44:
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #256]
	cmp	r3, #6
	ble	.L45
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L62+100
	bl	fwrite
	mov	r0, #1
	bl	exit
.L45:
	ldr	r3, [fp, #-128]
	ldr	r4, [r3, #256]
	ldr	r0, [fp, #-84]
	bl	swap32
	mov	r1, r0
	ldr	r3, [fp, #-128]
	add	r2, r4, #18
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-128]
	ldr	r4, [r3, #256]
	ldr	r0, [fp, #-80]
	bl	swap32
	mov	r1, r0
	ldr	r3, [fp, #-128]
	add	r2, r4, #36
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-128]
	ldr	r2, [r3, #256]
	ldr	r3, [fp, #-128]
	add	r2, r2, #66
	ldr	r1, [fp, #-88]
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #256]
	add	r2, r3, #1
	ldr	r3, [fp, #-128]
	str	r2, [r3, #256]
	b	.L46
.L40:
	ldr	r3, [fp, #-72]
	and	r3, r3, #4
	cmp	r3, #0
	bne	.L47
	ldr	r3, .L62+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-116]
	ldr	r1, .L62+88
	mov	r0, r3
	bl	fprintf
.L47:
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	bne	.L48
	ldr	r2, [fp, #-76]
	ldr	r1, [fp, #-84]
	ldr	r0, [fp, #-128]
	bl	add_bss
	ldr	r3, [fp, #-116]
	ldr	r2, [fp, #-108]
	cmp	r2, r3
	bne	.L49
	ldr	r2, .L62+104
	ldr	r3, [fp, #-76]
	str	r3, [r2]
	b	.L46
.L49:
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	beq	.L46
	ldr	r3, [fp, #-108]
	add	r2, r3, #2
	ldr	r3, [fp, #-116]
	cmp	r2, r3
	bne	.L46
	ldr	r2, .L62+104
	ldr	r3, [fp, #-76]
	str	r3, [r2, #4]
	b	.L46
.L48:
	ldr	r2, [fp, #-80]
	ldr	r3, [fp, #-76]
	cmp	r2, r3
	bls	.L50
	ldr	r3, .L62+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-80]
	str	r3, [sp]
	ldr	r3, [fp, #-76]
	ldr	r2, [fp, #-116]
	ldr	r1, .L62+108
	bl	fprintf
	mov	r0, #1
	bl	exit
.L50:
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #260]
	cmp	r3, #10
	ble	.L51
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L62+112
	bl	fwrite
	mov	r0, #1
	bl	exit
.L51:
	ldr	r3, [fp, #-116]
	ldr	r2, [fp, #-112]
	cmp	r2, r3
	bne	.L52
	ldr	r2, .L62+116
	ldr	r3, [fp, #-76]
	str	r3, [r2]
	b	.L53
.L52:
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	beq	.L53
	ldr	r3, [fp, #-112]
	add	r2, r3, #2
	ldr	r3, [fp, #-116]
	cmp	r2, r3
	bne	.L53
	ldr	r2, .L62+116
	ldr	r3, [fp, #-76]
	str	r3, [r2, #4]
.L53:
	ldr	r3, [fp, #-128]
	ldr	r4, [r3, #260]
	ldr	r0, [fp, #-84]
	bl	swap32
	mov	r1, r0
	ldr	r2, [fp, #-128]
	add	r3, r4, #24
	lsl	r3, r3, #2
	add	r3, r2, r3
	str	r1, [r3, #4]
	ldr	r3, [fp, #-128]
	ldr	r4, [r3, #260]
	ldr	r0, [fp, #-80]
	bl	swap32
	mov	r1, r0
	ldr	r2, [fp, #-128]
	add	r3, r4, #42
	lsl	r3, r3, #2
	add	r3, r2, r3
	str	r1, [r3, #4]
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #260]
	ldr	r2, [fp, #-128]
	add	r3, r3, #72
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-88]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #260]
	add	r2, r3, #1
	ldr	r3, [fp, #-128]
	str	r2, [r3, #260]
	b	.L46
.L38:
	ldr	r3, .L62+8
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L46
	ldr	r3, .L62+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-116]
	ldr	r1, .L62+120
	mov	r0, r3
	bl	fprintf
	b	.L46
.L37:
	ldr	r3, .L62+8
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L46
	ldr	r3, .L62+12
	ldr	r4, [r3]
	ldr	r3, [fp, #-116]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	ldr	r2, [fp, #-116]
	ldr	r1, .L62+124
	mov	r0, r4
	bl	fprintf
.L46:
	ldr	r3, [fp, #-116]
	add	r3, r3, #1
	str	r3, [fp, #-116]
.L36:
	ldrh	r3, [fp, #-118]
	ldr	r2, [fp, #-116]
	cmp	r2, r3
	blt	.L54
	ldr	r3, .L62+116
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-128]
	bl	increment_bss_size
	ldr	r3, .L62+116
	ldr	r3, [r3, #4]
	mov	r1, r3
	ldr	r0, [fp, #-128]
	bl	increment_bss_size
	ldr	r3, .L62+104
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-128]
	bl	increment_bss_size
	ldr	r3, .L62+104
	ldr	r3, [r3, #4]
	mov	r1, r3
	ldr	r0, [fp, #-128]
	bl	increment_bss_size
	ldr	r3, .L62+8
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L61
	ldr	r3, .L62+12
	ldr	r3, [r3]
	mov	r2, #10
	mov	r1, #1
	ldr	r0, .L62+128
	bl	fwrite
	mov	r3, #0
	str	r3, [fp, #-116]
	b	.L56
.L57:
	ldr	r3, .L62+12
	ldr	r4, [r3]
	ldr	r3, [fp, #-128]
	ldr	r2, [fp, #-116]
	add	r2, r2, #18
	ldr	r3, [r3, r2, lsl #2]
	mov	r0, r3
	bl	swap32
	mov	r5, r0
	ldr	r3, [fp, #-128]
	ldr	r2, [fp, #-116]
	add	r2, r2, #36
	ldr	r3, [r3, r2, lsl #2]
	mov	r0, r3
	bl	swap32
	mov	r1, r0
	ldr	r3, [fp, #-128]
	ldr	r2, [fp, #-116]
	add	r2, r2, #66
	ldr	r3, [r3, r2, lsl #2]
	str	r3, [sp, #4]
	str	r1, [sp]
	mov	r3, r5
	ldr	r2, [fp, #-116]
	ldr	r1, .L62+132
	mov	r0, r4
	bl	fprintf
	ldr	r3, [fp, #-116]
	add	r3, r3, #1
	str	r3, [fp, #-116]
.L56:
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #256]
	ldr	r2, [fp, #-116]
	cmp	r2, r3
	blt	.L57
	mov	r3, #0
	str	r3, [fp, #-116]
	b	.L58
.L59:
	ldr	r3, .L62+12
	ldr	r4, [r3]
	ldr	r2, [fp, #-128]
	ldr	r3, [fp, #-116]
	add	r3, r3, #24
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	swap32
	mov	r5, r0
	ldr	r2, [fp, #-128]
	ldr	r3, [fp, #-116]
	add	r3, r3, #42
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	swap32
	mov	r1, r0
	ldr	r2, [fp, #-128]
	ldr	r3, [fp, #-116]
	add	r3, r3, #72
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	str	r3, [sp, #4]
	str	r1, [sp]
	mov	r3, r5
	ldr	r2, [fp, #-116]
	ldr	r1, .L62+136
	mov	r0, r4
	bl	fprintf
	ldr	r3, [fp, #-116]
	add	r3, r3, #1
	str	r3, [fp, #-116]
.L58:
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #260]
	ldr	r2, [fp, #-116]
	cmp	r2, r3
	blt	.L59
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #336]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L61
	ldr	r3, .L62+12
	ldr	r4, [r3]
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #216]
	mov	r0, r3
	bl	swap32
	mov	r5, r0
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #220]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L62+140
	mov	r0, r4
	bl	fprintf
.L61:
	nop
	ldr	r3, .L62
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L60
	bl	__stack_chk_fail
.L60:
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L63:
	.align	2
.L62:
	.word	.LC39
	.word	.LC8
	.word	verbosity
	.word	stderr
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.word	.LC26
	.word	.LC27
	.word	.LC28
	.word	.LC29
	.word	.LC30
	.word	sbssSizes
	.word	.LC31
	.word	.LC32
	.word	sdataSizes
	.word	.LC33
	.word	.LC34
	.word	.LC35
	.word	.LC36
	.word	.LC37
	.word	.LC38
	.size	read_elf_segments, .-read_elf_segments
	.section	.rodata
	.align	2
.LC40:
	.ascii	"Laying out DOL file...\012\000"
	.align	2
.LC41:
	.ascii	" TEXT segment %d at 0x%x\012\000"
	.align	2
.LC42:
	.ascii	" DATA segment %d at 0x%x\012\000"
	.align	2
.LC43:
	.ascii	"Note: adding dummy TEXT segment to work around IOS "
	.ascii	"bug\012\000"
	.align	2
.LC44:
	.ascii	"Note: adding dummy DATA segment to work around IOS "
	.ascii	"bug\012\000"
	.text
	.align	2
	.global	map_dol
	.syntax unified
	.arm
	.fpu softvfp
	.type	map_dol, %function
map_dol:
	@ 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]
	ldr	r3, .L77
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L65
	ldr	r3, .L77+4
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L77+8
	bl	fwrite
.L65:
	mov	r3, #256
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L66
.L68:
	ldr	r3, .L77
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L67
	ldr	r3, .L77+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	ldr	r1, .L77+12
	bl	fprintf
.L67:
	ldr	r0, [fp, #-12]
	bl	swap32
	mov	r1, r0
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	add	r2, r2, #36
	ldr	r3, [r3, r2, lsl #2]
	mov	r0, r3
	bl	swap32
	mov	r2, r0
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	add	r3, r3, #31
	bic	r3, r3, #31
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L66:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #256]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L68
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L69
.L71:
	ldr	r3, .L77
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L70
	ldr	r3, .L77+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	ldr	r1, .L77+16
	bl	fprintf
.L70:
	ldr	r0, [fp, #-12]
	bl	swap32
	mov	r1, r0
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	add	r3, r3, #6
	lsl	r3, r3, #2
	add	r3, r2, r3
	str	r1, [r3, #4]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	add	r3, r3, #42
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	swap32
	mov	r2, r0
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	add	r3, r3, #31
	bic	r3, r3, #31
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L69:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #260]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L71
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #256]
	cmp	r3, #0
	bne	.L72
	ldr	r3, .L77
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L73
	ldr	r3, .L77+4
	ldr	r3, [r3]
	mov	r2, #55
	mov	r1, #1
	ldr	r0, .L77+20
	bl	fwrite
.L73:
	mov	r0, #256
	bl	swap32
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r2, [r3]
.L72:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #260]
	cmp	r3, #0
	bne	.L76
	ldr	r3, .L77
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L75
	ldr	r3, .L77+4
	ldr	r3, [r3]
	mov	r2, #55
	mov	r1, #1
	ldr	r0, .L77+24
	bl	fwrite
.L75:
	mov	r0, #256
	bl	swap32
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r2, [r3, #28]
.L76:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L78:
	.align	2
.L77:
	.word	verbosity
	.word	stderr
	.word	.LC40
	.word	.LC41
	.word	.LC42
	.word	.LC43
	.word	.LC44
	.size	map_dol, .-map_dol
	.section	.rodata
	.align	2
.LC45:
	.ascii	"reading ELF segment data\000"
	.align	2
.LC46:
	.ascii	"writing DOL segment data\000"
	.text
	.align	2
	.global	fcpy
	.syntax unified
	.arm
	.fpu softvfp
	.type	fcpy, %function
fcpy:
	@ args = 4, 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, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	str	r3, [fp, #-44]
	ldr	r3, [fp, #4]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-44]
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-36]
	bl	fseek
	mov	r3, r0
	cmp	r3, #0
	bge	.L80
	ldr	r1, .L86
	ldr	r0, [fp, #-36]
	bl	ferrordie
.L80:
	ldr	r3, [fp, #-40]
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	fseek
	mov	r3, r0
	cmp	r3, #0
	bge	.L81
	ldr	r1, .L86+4
	ldr	r0, [fp, #-32]
	bl	ferrordie
.L81:
	ldr	r3, [fp, #-24]
	cmp	r3, #1048576
	movlt	r3, r3
	movge	r3, #1048576
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	b	.L82
.L85:
	ldr	r3, [fp, #-24]
	cmp	r3, #1048576
	movlt	r3, r3
	movge	r3, #1048576
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-36]
	mov	r1, #1
	ldr	r0, [fp, #-20]
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	beq	.L83
	ldr	r0, [fp, #-20]
	bl	free
	ldr	r1, .L86
	ldr	r0, [fp, #-36]
	bl	ferrordie
.L83:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-32]
	mov	r1, #1
	ldr	r0, [fp, #-20]
	bl	fwrite
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	beq	.L84
	ldr	r0, [fp, #-20]
	bl	free
	ldr	r1, .L86+4
	ldr	r0, [fp, #-32]
	bl	ferrordie
.L84:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	sub	r3, r2, r3
	str	r3, [fp, #-24]
.L82:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L85
	ldr	r0, [fp, #-20]
	bl	free
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L87:
	.align	2
.L86:
	.word	.LC45
	.word	.LC46
	.size	fcpy, .-fcpy
	.section	.rodata
	.align	2
.LC47:
	.ascii	"Writing DOL file...\012\000"
	.align	2
.LC48:
	.ascii	"wb\000"
	.align	2
.LC49:
	.ascii	"Could not open DOL file\000"
	.align	2
.LC50:
	.ascii	"DOL header:\012\000"
	.align	2
.LC51:
	.ascii	" TEXT %d @ 0x%08x [0x%x] off 0x%x\012\000"
	.align	2
.LC52:
	.ascii	" DATA %d @ 0x%08x [0x%x] off 0x%x\012\000"
	.align	2
.LC53:
	.ascii	" BSS @ 0x%08x [0x%x]\012\000"
	.align	2
.LC54:
	.ascii	" Entry: 0x%08x\012\000"
	.align	2
.LC55:
	.ascii	"Writing DOL header...\012\000"
	.align	2
.LC56:
	.ascii	"writing DOL header\000"
	.align	2
.LC57:
	.ascii	"Writing TEXT segment %d...\012\000"
	.align	2
.LC58:
	.ascii	"Writing DATA segment %d...\012\000"
	.align	2
.LC59:
	.ascii	"All done!\012\000"
	.align	2
.LC60:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	write_dol
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_dol, %function
write_dol:
	@ args = 0, pretend = 0, frame = 280
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, fp, lr}
	add	fp, sp, #16
	sub	sp, sp, #292
	str	r0, [fp, #-296]
	str	r1, [fp, #-300]
	ldr	r3, .L110
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	ldr	r2, [fp, #-296]
	sub	r3, fp, #280
	mov	r1, r2
	mov	r2, #256
	mov	r0, r3
	bl	memcpy
	mov	r3, #0
	str	r3, [fp, #-292]
	b	.L89
.L90:
	ldr	r3, [fp, #-292]
	add	r3, r3, #36
	lsl	r3, r3, #2
	sub	r2, fp, #20
	add	r3, r2, r3
	ldr	r3, [r3, #-260]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	add	r3, r3, #31
	bic	r3, r3, #31
	mov	r0, r3
	bl	swap32
	mov	r2, r0
	ldr	r3, [fp, #-292]
	add	r3, r3, #36
	lsl	r3, r3, #2
	sub	r1, fp, #20
	add	r3, r1, r3
	str	r2, [r3, #-260]
	ldr	r3, [fp, #-292]
	add	r3, r3, #1
	str	r3, [fp, #-292]
.L89:
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #256]
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	blt	.L90
	mov	r3, #0
	str	r3, [fp, #-292]
	b	.L91
.L92:
	ldr	r3, [fp, #-292]
	add	r3, r3, #42
	lsl	r3, r3, #2
	sub	r2, fp, #20
	add	r3, r2, r3
	ldr	r3, [r3, #-256]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	add	r3, r3, #31
	bic	r3, r3, #31
	mov	r0, r3
	bl	swap32
	mov	r2, r0
	ldr	r3, [fp, #-292]
	add	r3, r3, #42
	lsl	r3, r3, #2
	sub	r1, fp, #20
	add	r3, r1, r3
	str	r2, [r3, #-256]
	ldr	r3, [fp, #-292]
	add	r3, r3, #1
	str	r3, [fp, #-292]
.L91:
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #260]
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	blt	.L92
	ldr	r3, .L110+4
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L93
	ldr	r3, .L110+8
	ldr	r3, [r3]
	mov	r2, #20
	mov	r1, #1
	ldr	r0, .L110+12
	bl	fwrite
.L93:
	ldr	r1, .L110+16
	ldr	r0, [fp, #-300]
	bl	fopen
	str	r0, [fp, #-288]
	ldr	r3, [fp, #-288]
	cmp	r3, #0
	bne	.L94
	ldr	r0, .L110+20
	bl	perror
	mov	r0, #1
	bl	exit
.L94:
	ldr	r3, .L110+4
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L95
	ldr	r3, .L110+8
	ldr	r3, [r3]
	mov	r2, #12
	mov	r1, #1
	ldr	r0, .L110+24
	bl	fwrite
	mov	r3, #0
	str	r3, [fp, #-292]
	b	.L96
.L97:
	ldr	r3, .L110+8
	ldr	r4, [r3]
	ldr	r3, [fp, #-296]
	ldr	r2, [fp, #-292]
	add	r2, r2, #18
	ldr	r3, [r3, r2, lsl #2]
	mov	r0, r3
	bl	swap32
	mov	r6, r0
	ldr	r3, [fp, #-296]
	ldr	r2, [fp, #-292]
	add	r2, r2, #36
	ldr	r3, [r3, r2, lsl #2]
	mov	r0, r3
	bl	swap32
	mov	r5, r0
	ldr	r3, [fp, #-296]
	ldr	r2, [fp, #-292]
	ldr	r3, [r3, r2, lsl #2]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	str	r3, [sp, #4]
	str	r5, [sp]
	mov	r3, r6
	ldr	r2, [fp, #-292]
	ldr	r1, .L110+28
	mov	r0, r4
	bl	fprintf
	ldr	r3, [fp, #-292]
	add	r3, r3, #1
	str	r3, [fp, #-292]
.L96:
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #256]
	cmp	r3, #1
	movge	r3, r3
	movlt	r3, #1
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	blt	.L97
	mov	r3, #0
	str	r3, [fp, #-292]
	b	.L98
.L99:
	ldr	r3, .L110+8
	ldr	r4, [r3]
	ldr	r2, [fp, #-296]
	ldr	r3, [fp, #-292]
	add	r3, r3, #24
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	swap32
	mov	r6, r0
	ldr	r2, [fp, #-296]
	ldr	r3, [fp, #-292]
	add	r3, r3, #42
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	swap32
	mov	r5, r0
	ldr	r2, [fp, #-296]
	ldr	r3, [fp, #-292]
	add	r3, r3, #6
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	str	r3, [sp, #4]
	str	r5, [sp]
	mov	r3, r6
	ldr	r2, [fp, #-292]
	ldr	r1, .L110+32
	mov	r0, r4
	bl	fprintf
	ldr	r3, [fp, #-292]
	add	r3, r3, #1
	str	r3, [fp, #-292]
.L98:
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #260]
	cmp	r3, #1
	movge	r3, r3
	movlt	r3, #1
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	blt	.L99
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #216]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	cmp	r3, #0
	beq	.L100
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #220]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	cmp	r3, #0
	beq	.L100
	ldr	r3, .L110+8
	ldr	r4, [r3]
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #216]
	mov	r0, r3
	bl	swap32
	mov	r5, r0
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #220]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L110+36
	mov	r0, r4
	bl	fprintf
.L100:
	ldr	r3, .L110+8
	ldr	r4, [r3]
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #224]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L110+40
	mov	r0, r4
	bl	fprintf
	ldr	r3, .L110+8
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L110+44
	bl	fwrite
.L95:
	sub	r0, fp, #280
	ldr	r3, [fp, #-288]
	mov	r2, #1
	mov	r1, #256
	bl	fwrite
	mov	r3, r0
	str	r3, [fp, #-284]
	ldr	r3, [fp, #-284]
	cmp	r3, #1
	beq	.L101
	ldr	r1, .L110+48
	ldr	r0, [fp, #-288]
	bl	ferrordie
.L101:
	mov	r3, #0
	str	r3, [fp, #-292]
	b	.L102
.L104:
	ldr	r3, .L110+4
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L103
	ldr	r3, .L110+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-292]
	ldr	r1, .L110+52
	mov	r0, r3
	bl	fprintf
.L103:
	ldr	r3, [fp, #-296]
	ldr	r4, [r3, #340]
	ldr	r3, [fp, #-296]
	ldr	r2, [fp, #-292]
	ldr	r3, [r3, r2, lsl #2]
	mov	r0, r3
	bl	swap32
	mov	r6, r0
	ldr	r3, [fp, #-296]
	ldr	r2, [fp, #-292]
	add	r2, r2, #66
	ldr	r5, [r3, r2, lsl #2]
	ldr	r3, [fp, #-296]
	ldr	r2, [fp, #-292]
	add	r2, r2, #36
	ldr	r3, [r3, r2, lsl #2]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	str	r3, [sp]
	mov	r3, r5
	mov	r2, r6
	mov	r1, r4
	ldr	r0, [fp, #-288]
	bl	fcpy
	ldr	r3, [fp, #-292]
	add	r3, r3, #1
	str	r3, [fp, #-292]
.L102:
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #256]
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	blt	.L104
	mov	r3, #0
	str	r3, [fp, #-292]
	b	.L105
.L107:
	ldr	r3, .L110+4
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L106
	ldr	r3, .L110+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-292]
	ldr	r1, .L110+56
	mov	r0, r3
	bl	fprintf
.L106:
	ldr	r3, [fp, #-296]
	ldr	r4, [r3, #340]
	ldr	r2, [fp, #-296]
	ldr	r3, [fp, #-292]
	add	r3, r3, #6
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	swap32
	mov	r6, r0
	ldr	r2, [fp, #-296]
	ldr	r3, [fp, #-292]
	add	r3, r3, #72
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r5, [r3, #4]
	ldr	r2, [fp, #-296]
	ldr	r3, [fp, #-292]
	add	r3, r3, #42
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	swap32
	mov	r3, r0
	str	r3, [sp]
	mov	r3, r5
	mov	r2, r6
	mov	r1, r4
	ldr	r0, [fp, #-288]
	bl	fcpy
	ldr	r3, [fp, #-292]
	add	r3, r3, #1
	str	r3, [fp, #-292]
.L105:
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #260]
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	blt	.L107
	ldr	r3, .L110+4
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L108
	ldr	r3, .L110+8
	ldr	r3, [r3]
	mov	r2, #10
	mov	r1, #1
	ldr	r0, .L110+60
	bl	fwrite
.L108:
	ldr	r3, [fp, #-296]
	ldr	r3, [r3, #340]
	mov	r0, r3
	bl	fclose
	ldr	r0, [fp, #-288]
	bl	fclose
	nop
	ldr	r3, .L110
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L109
	bl	__stack_chk_fail
.L109:
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r5, r6, fp, pc}
.L111:
	.align	2
.L110:
	.word	.LC60
	.word	verbosity
	.word	stderr
	.word	.LC47
	.word	.LC48
	.word	.LC49
	.word	.LC50
	.word	.LC51
	.word	.LC52
	.word	.LC53
	.word	.LC54
	.word	.LC55
	.word	.LC56
	.word	.LC57
	.word	.LC58
	.word	.LC59
	.size	write_dol, .-write_dol
	.section	.rodata
	.align	2
.LC61:
	.ascii	"-h\000"
	.align	2
.LC62:
	.ascii	"-v\000"
	.align	2
.LC63:
	.ascii	"--\000"
	.align	2
.LC64:
	.ascii	"Unrecognized option %s\012\000"
	.align	2
.LC65:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 376
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #376
	str	r0, [fp, #-376]
	str	r1, [fp, #-380]
	ldr	r3, .L126
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-376]
	cmp	r3, #1
	bgt	.L113
	ldr	r3, [fp, #-380]
	ldr	r3, [r3]
	mov	r0, r3
	bl	usage
	mov	r3, #1
	b	.L123
.L113:
	ldr	r3, [fp, #-380]
	add	r3, r3, #4
	str	r3, [fp, #-372]
	ldr	r3, [fp, #-376]
	sub	r3, r3, #1
	str	r3, [fp, #-376]
	b	.L115
.L121:
	ldr	r3, [fp, #-372]
	ldr	r3, [r3]
	ldr	r1, .L126+4
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L116
	ldr	r3, [fp, #-380]
	ldr	r3, [r3]
	mov	r0, r3
	bl	usage
	mov	r3, #1
	b	.L123
.L116:
	ldr	r3, [fp, #-372]
	ldr	r3, [r3]
	ldr	r1, .L126+8
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L117
	ldr	r3, .L126+12
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L126+12
	str	r3, [r2]
	b	.L125
.L117:
	ldr	r3, [fp, #-372]
	ldr	r3, [r3]
	ldr	r1, .L126+16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L119
	ldr	r3, [fp, #-372]
	add	r3, r3, #4
	str	r3, [fp, #-372]
	ldr	r3, [fp, #-376]
	sub	r3, r3, #1
	str	r3, [fp, #-376]
	b	.L120
.L119:
	ldr	r3, .L126+20
	ldr	r0, [r3]
	ldr	r3, [fp, #-372]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L126+24
	bl	fprintf
	ldr	r3, [fp, #-380]
	ldr	r3, [r3]
	mov	r0, r3
	bl	usage
	mov	r3, #1
	b	.L123
.L125:
	ldr	r3, [fp, #-372]
	add	r3, r3, #4
	str	r3, [fp, #-372]
	ldr	r3, [fp, #-376]
	sub	r3, r3, #1
	str	r3, [fp, #-376]
.L115:
	ldr	r3, [fp, #-376]
	cmp	r3, #0
	beq	.L120
	ldr	r3, [fp, #-372]
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	beq	.L121
.L120:
	ldr	r3, [fp, #-376]
	cmp	r3, #1
	bgt	.L122
	ldr	r3, [fp, #-380]
	ldr	r3, [r3]
	mov	r0, r3
	bl	usage
	mov	r0, #1
	bl	exit
.L122:
	ldr	r3, [fp, #-372]
	ldr	r3, [r3]
	str	r3, [fp, #-368]
	ldr	r3, [fp, #-372]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-364]
	ldr	r3, [fp, #-372]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	str	r3, [fp, #-360]
	ldr	r3, [fp, #-372]
	ldr	r3, [r3, #12]
	str	r3, [fp, #-356]
	sub	r3, fp, #352
	mov	r2, #344
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r0, fp, #352
	ldr	r3, [fp, #-356]
	ldr	r2, [fp, #-360]
	ldr	r1, [fp, #-368]
	bl	read_elf_segments
	sub	r3, fp, #352
	mov	r0, r3
	bl	map_dol
	sub	r3, fp, #352
	ldr	r1, [fp, #-364]
	mov	r0, r3
	bl	write_dol
	mov	r3, #0
.L123:
	ldr	r2, .L126
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L124
	bl	__stack_chk_fail
.L124:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L127:
	.align	2
.L126:
	.word	.LC65
	.word	.LC61
	.word	.LC62
	.word	verbosity
	.word	.LC63
	.word	stderr
	.word	.LC64
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
