	.file	"391269.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: HXF2IHFS <hxf_img> <ihfs_img> [ihfs_size]\n"
	.text
	.globl	usage
	.type	usage, @function
usage:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 49
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	usage, .-usage
	.section	.rodata
	.align 8
.LC1:
	.string	"Starting sanity check for HXF image..."
	.align 8
.LC2:
	.string	"  Checking for HXF signature..."
	.align 8
.LC3:
	.string	"  Checking for unknown value 1..."
.LC4:
	.string	"0100"
.LC5:
	.string	"  Checking for length..."
	.align 8
.LC6:
	.string	"  Checking for unknown value 3..."
.LC7:
	.string	"  Checking for id..."
	.align 8
.LC8:
	.string	"Chinachip PMP firmware V1.0"
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.align 8
.LC9:
	.string	"  Checking for file completeness..."
	.text
	.globl	hxf_sanity
	.type	hxf_sanity, @function
hxf_sanity:
.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, 256
	mov	DWORD PTR -244[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -244[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	lea	rcx, -224[rbp]
	mov	eax, DWORD PTR -244[rbp]
	mov	edx, 64
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -224[rbp]
	cmp	eax, 1178878295
	je	.L3
	mov	eax, 1
	jmp	.L18
.L3:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rax, -224[rbp]
	add	rax, 4
	mov	edx, 4
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	je	.L5
	mov	eax, 1
	jmp	.L18
.L5:
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rdx, -160[rbp]
	mov	eax, DWORD PTR -244[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fstat@PLT
	mov	eax, DWORD PTR -204[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -112[rbp]
	cmp	rdx, rax
	je	.L6
	mov	eax, 1
	jmp	.L18
.L6:
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -196[rbp]
	test	eax, eax
	je	.L7
	mov	eax, 1
	jmp	.L18
.L7:
	lea	rdi, .LC7[rip]
	call	puts@PLT
	lea	rax, -224[rbp]
	add	rax, 32
	mov	edx, 32
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	je	.L8
	mov	eax, 1
	jmp	.L18
.L8:
	lea	rdi, .LC9[rip]
	call	puts@PLT
.L16:
	lea	rcx, -240[rbp]
	mov	eax, DWORD PTR -244[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -232[rbp], eax
	cmp	DWORD PTR -232[rbp], 4
	je	.L9
	mov	eax, 1
	jmp	.L18
.L9:
	mov	eax, DWORD PTR -240[rbp]
	test	eax, eax
	je	.L21
	mov	eax, DWORD PTR -240[rbp]
	add	eax, 1
	movsx	rcx, eax
	mov	eax, DWORD PTR -244[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	mov	DWORD PTR -232[rbp], eax
	cmp	DWORD PTR -232[rbp], 0
	jns	.L12
	mov	eax, 1
	jmp	.L18
.L12:
	lea	rcx, -236[rbp]
	mov	eax, DWORD PTR -244[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -232[rbp], eax
	cmp	DWORD PTR -232[rbp], 4
	je	.L13
	mov	eax, 1
	jmp	.L18
.L13:
	mov	eax, DWORD PTR -236[rbp]
	test	eax, eax
	jg	.L14
	mov	eax, 1
	jmp	.L18
.L14:
	mov	eax, DWORD PTR -236[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -244[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	mov	DWORD PTR -232[rbp], eax
	cmp	DWORD PTR -232[rbp], 0
	jns	.L16
	mov	eax, 1
	jmp	.L18
.L21:
	nop
	mov	eax, DWORD PTR -244[rbp]
	mov	edx, 1
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	mov	DWORD PTR -228[rbp], eax
	mov	eax, DWORD PTR -228[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -112[rbp]
	cmp	rdx, rax
	je	.L17
	mov	eax, 1
	jmp	.L18
.L17:
	mov	eax, 0
.L18:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	hxf_sanity, .-hxf_sanity
	.globl	hxf_ihfs_compatible
	.type	hxf_ihfs_compatible, @function
hxf_ihfs_compatible:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 0
	mov	esi, 64
	mov	edi, eax
	call	lseek@PLT
	mov	DWORD PTR -12[rbp], 0
.L27:
	lea	rcx, -20[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	eax, DWORD PTR -20[rbp]
	test	eax, eax
	je	.L32
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, 56
	jle	.L25
	mov	eax, 1
	jmp	.L29
.L25:
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 1
	movsx	rcx, eax
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	lea	rcx, -16[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	eax, DWORD PTR -16[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	add	DWORD PTR -12[rbp], 1
	jmp	.L27
.L32:
	nop
	cmp	DWORD PTR -12[rbp], 2048
	jle	.L28
	mov	eax, 1
	jmp	.L29
.L28:
	mov	eax, 0
.L29:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	hxf_ihfs_compatible, .-hxf_ihfs_compatible
	.globl	hxf_to_ihfs
	.type	hxf_to_ihfs, @function
hxf_to_ihfs:
.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, 1072
	mov	DWORD PTR -1060[rbp], edi
	mov	DWORD PTR -1064[rbp], esi
	mov	DWORD PTR -1068[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -1068[rbp]
	lea	edx, 511[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 9
	mov	DWORD PTR -1048[rbp], eax
	mov	eax, DWORD PTR -1068[rbp]
	cdq
	shr	edx, 23
	add	eax, edx
	and	eax, 511
	sub	eax, edx
	mov	DWORD PTR -1044[rbp], eax
	mov	DWORD PTR -1052[rbp], 0
	jmp	.L34
.L35:
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1060[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1064[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	add	DWORD PTR -1052[rbp], 1
.L34:
	mov	eax, DWORD PTR -1052[rbp]
	cmp	eax, DWORD PTR -1048[rbp]
	jl	.L35
	cmp	DWORD PTR -1044[rbp], 0
	jle	.L38
	mov	eax, DWORD PTR -1044[rbp]
	movsx	rdx, eax
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1060[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	eax, DWORD PTR -1044[rbp]
	movsx	rdx, eax
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1064[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, 512
	sub	eax, DWORD PTR -1044[rbp]
	movsx	rdx, eax
	lea	rax, -528[rbp]
	mov	esi, 255
	mov	rdi, rax
	call	memset@PLT
	mov	eax, 512
	sub	eax, DWORD PTR -1044[rbp]
	movsx	rdx, eax
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -1064[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
.L38:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	hxf_to_ihfs, .-hxf_to_ihfs
	.section	.rodata
.LC10:
	.string	"Non-HXF format!"
.LC11:
	.string	"Sanity check OK"
.LC12:
	.string	"HXF info:"
.LC13:
	.string	"  Signature: 0x%08x\n"
.LC14:
	.string	"  Unknown1: %s\n"
.LC15:
	.string	"  Timestamp: %s\n"
.LC16:
	.string	"  File size: %d bytes\n"
.LC17:
	.string	"  Unknown2: 0x%08x\n"
.LC18:
	.string	"  Unknown3: 0x%08x\n"
.LC19:
	.string	"  Identifier: %s\n"
	.align 8
.LC20:
	.string	"This HXF image can't be converted into IHFS"
	.align 8
.LC21:
	.string	"HXF can be converted into IHFS"
	.align 8
.LC22:
	.string	"Something wrong happened during IHFS image creation at %d\n"
.LC23:
	.string	"Done!"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	r11, -131072[rsp]
.LPSRL0:
	sub	rsp, 4096
	or	DWORD PTR [rsp], 0
	cmp	rsp, r11
	jne	.LPSRL0
	sub	rsp, 1856
	mov	DWORD PTR -132916[rbp], edi
	mov	QWORD PTR -132928[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -132916[rbp], 3
	je	.L40
	cmp	DWORD PTR -132916[rbp], 4
	je	.L40
	mov	eax, 0
	call	usage
.L40:
	mov	rax, QWORD PTR -132928[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, -132800[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	eax, DWORD PTR -132776[rbp]
	and	eax, 61440
	cmp	eax, 32768
	je	.L41
	mov	eax, 0
	call	usage
.L41:
	cmp	DWORD PTR -132916[rbp], 3
	jne	.L42
	mov	DWORD PTR -132892[rbp], 65273856
	jmp	.L43
.L42:
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -132928[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -132892[rbp], eax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L44
	cmp	DWORD PTR -132892[rbp], 0
	js	.L44
	mov	eax, DWORD PTR -132892[rbp]
	and	eax, 511
	test	eax, eax
	je	.L43
.L44:
	mov	eax, 0
	call	usage
.L43:
	mov	rax, QWORD PTR -132928[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -132884[rbp], eax
	mov	eax, DWORD PTR -132884[rbp]
	mov	edi, eax
	call	hxf_sanity
	test	eax, eax
	je	.L45
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L61
.L45:
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -132884[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	lea	rcx, -132864[rbp]
	mov	eax, DWORD PTR -132884[rbp]
	mov	edx, 64
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -132864[rbp]
	mov	esi, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -132864[rbp]
	lea	rcx, 4[rax]
	lea	rax, -1072[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	mov	BYTE PTR -1068[rbp], 0
	lea	rax, -1072[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -132864[rbp]
	lea	rcx, 8[rax]
	lea	rax, -1072[rbp]
	mov	edx, 12
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	mov	BYTE PTR -1060[rbp], 0
	lea	rax, -1072[rbp]
	mov	rsi, rax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -132844[rbp]
	mov	esi, eax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -132840[rbp]
	mov	esi, eax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -132836[rbp]
	mov	esi, eax
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -132864[rbp]
	add	rax, 32
	mov	rsi, rax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -132884[rbp]
	mov	edi, eax
	call	hxf_ihfs_compatible
	test	eax, eax
	je	.L47
	lea	rdi, .LC20[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L61
.L47:
	lea	rdi, .LC21[rip]
	call	puts@PLT
	mov	DWORD PTR -132656[rbp], 1229473363
	mov	eax, DWORD PTR -132892[rbp]
	lea	edx, 511[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 9
	mov	DWORD PTR -132652[rbp], eax
	mov	DWORD PTR -132648[rbp], 4
	mov	DWORD PTR -132644[rbp], -4096
	mov	rax, QWORD PTR -132856[rbp]
	mov	QWORD PTR -132640[rbp], rax
	mov	eax, DWORD PTR -132848[rbp]
	mov	DWORD PTR -132632[rbp], eax
	mov	DWORD PTR -132628[rbp], 0
	lea	rax, -132656[rbp]
	add	rax, 32
	mov	edx, 476
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -132148[rbp], 1437226410
	lea	rax, -132144[rbp]
	mov	edx, 131072
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR -132884[rbp]
	mov	edx, 0
	mov	esi, 64
	mov	edi, eax
	call	lseek@PLT
	mov	rax, QWORD PTR -132928[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	edx, 420
	mov	esi, 577
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -132880[rbp], eax
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 0
	mov	esi, 133120
	mov	edi, eax
	call	lseek@PLT
	mov	DWORD PTR -132896[rbp], 0
	jmp	.L48
.L51:
	lea	rcx, -132904[rbp]
	mov	eax, DWORD PTR -132884[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	eax, DWORD PTR -132904[rbp]
	test	eax, eax
	je	.L63
	mov	eax, DWORD PTR -132904[rbp]
	add	eax, 1
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -132872[rbp], rax
	mov	eax, DWORD PTR -132904[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -132872[rbp]
	mov	eax, DWORD PTR -132884[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	eax, DWORD PTR -132904[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -132872[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	lea	rcx, -132905[rbp]
	mov	eax, DWORD PTR -132884[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	lea	rcx, -132900[rbp]
	mov	eax, DWORD PTR -132884[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	lea	rdx, -132144[rbp]
	mov	eax, DWORD PTR -132896[rbp]
	cdqe
	sal	rax, 6
	lea	rcx, [rdx+rax]
	mov	rax, QWORD PTR -132872[rbp]
	mov	edx, 56
	mov	rsi, rax
	mov	rdi, rcx
	call	strncpy@PLT
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 1
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	lea	rdx, 511[rax]
	test	rax, rax
	cmovs	rax, rdx
	sar	rax, 9
	mov	edx, eax
	mov	eax, DWORD PTR -132896[rbp]
	cdqe
	sal	rax, 6
	add	rax, rbp
	sub	rax, 132088
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -132900[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -132896[rbp]
	cdqe
	sal	rax, 6
	add	rax, rbp
	sub	rax, 132084
	mov	DWORD PTR [rax], edx
	mov	edx, DWORD PTR -132900[rbp]
	mov	ecx, DWORD PTR -132880[rbp]
	mov	eax, DWORD PTR -132884[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	hxf_to_ihfs
	mov	rax, QWORD PTR -132872[rbp]
	mov	rdi, rax
	call	free@PLT
	add	DWORD PTR -132896[rbp], 1
.L48:
	mov	eax, DWORD PTR -132884[rbp]
	mov	edx, 1
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	mov	edx, DWORD PTR -132844[rbp]
	mov	edx, edx
	cmp	rax, rdx
	jl	.L51
	jmp	.L50
.L63:
	nop
.L50:
	mov	eax, DWORD PTR -132896[rbp]
	mov	DWORD PTR -132628[rbp], eax
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 1
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	mov	DWORD PTR -132888[rbp], eax
	mov	eax, DWORD PTR -132888[rbp]
	and	eax, 511
	test	eax, eax
	je	.L52
	mov	eax, DWORD PTR -132888[rbp]
	mov	esi, eax
	lea	rdi, .LC22[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L61
.L52:
	mov	eax, DWORD PTR -132888[rbp]
	cmp	eax, DWORD PTR -132892[rbp]
	jge	.L53
	cmp	DWORD PTR -132888[rbp], 34865151
	jg	.L53
	lea	rax, -528[rbp]
	mov	edx, 512
	mov	esi, 255
	mov	rdi, rax
	call	memset@PLT
	mov	eax, 34865152
	sub	eax, DWORD PTR -132888[rbp]
	lea	edx, 511[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 9
	mov	DWORD PTR -132876[rbp], eax
	mov	DWORD PTR -132896[rbp], 0
	jmp	.L54
.L55:
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	add	DWORD PTR -132896[rbp], 1
.L54:
	mov	eax, DWORD PTR -132896[rbp]
	cmp	eax, DWORD PTR -132876[rbp]
	jl	.L55
	mov	DWORD PTR -132888[rbp], 34865152
.L53:
	mov	eax, DWORD PTR -132888[rbp]
	cmp	eax, DWORD PTR -132892[rbp]
	jge	.L56
	mov	DWORD PTR -132896[rbp], 0
	jmp	.L57
.L58:
	mov	eax, DWORD PTR -132896[rbp]
	cdqe
	mov	BYTE PTR -1040[rbp+rax], -34
	mov	eax, DWORD PTR -132896[rbp]
	add	eax, 1
	cdqe
	mov	BYTE PTR -1040[rbp+rax], -83
	mov	eax, DWORD PTR -132896[rbp]
	add	eax, 2
	cdqe
	mov	BYTE PTR -1040[rbp+rax], -6
	mov	eax, DWORD PTR -132896[rbp]
	add	eax, 3
	cdqe
	mov	BYTE PTR -1040[rbp+rax], -50
	add	DWORD PTR -132896[rbp], 4
.L57:
	cmp	DWORD PTR -132896[rbp], 511
	jle	.L58
	mov	eax, DWORD PTR -132892[rbp]
	sub	eax, DWORD PTR -132888[rbp]
	lea	edx, 511[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 9
	mov	DWORD PTR -132876[rbp], eax
	mov	DWORD PTR -132896[rbp], 0
	jmp	.L59
.L60:
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	add	DWORD PTR -132896[rbp], 1
.L59:
	mov	eax, DWORD PTR -132896[rbp]
	cmp	eax, DWORD PTR -132876[rbp]
	jl	.L60
.L56:
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	lea	rcx, -132656[rbp]
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	lea	rax, -528[rbp]
	mov	edx, 512
	mov	esi, 255
	mov	rdi, rax
	call	memset@PLT
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	lea	rcx, -132144[rbp]
	mov	eax, DWORD PTR -132880[rbp]
	mov	edx, 131072
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -132884[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -132880[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rdi, .LC23[rip]
	call	puts@PLT
	mov	eax, 0
.L61:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L62
	call	__stack_chk_fail@PLT
.L62:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"391269.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: HXF2IHFS <hxf_img> <ihfs_img> [ihfs_size]\012"
	.ascii	"\000"
	.text
	.align	2
	.global	usage
	.syntax unified
	.arm
	.fpu softvfp
	.type	usage, %function
usage:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #49
	mov	r1, #1
	ldr	r0, .L2+4
	bl	fwrite
	mov	r0, #1
	bl	exit
.L3:
	.align	2
.L2:
	.word	stderr
	.word	.LC0
	.size	usage, .-usage
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Starting sanity check for HXF image...\000"
	.align	2
.LC2:
	.ascii	"  Checking for HXF signature...\000"
	.align	2
.LC3:
	.ascii	"  Checking for unknown value 1...\000"
	.align	2
.LC4:
	.ascii	"0100\000"
	.align	2
.LC5:
	.ascii	"  Checking for length...\000"
	.align	2
.LC6:
	.ascii	"  Checking for unknown value 3...\000"
	.align	2
.LC7:
	.ascii	"  Checking for id...\000"
	.align	2
.LC8:
	.ascii	"Chinachip PMP firmware V1.0\000\000\000\000\000\000"
	.align	2
.LC9:
	.ascii	"  Checking for file completeness...\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	hxf_sanity
	.syntax unified
	.arm
	.fpu softvfp
	.type	hxf_sanity, %function
hxf_sanity:
	@ args = 0, pretend = 0, frame = 184
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #184
	str	r0, [fp, #-184]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L24+4
	bl	puts
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-184]
	bl	lseek
	sub	r3, fp, #72
	mov	r2, #64
	mov	r1, r3
	ldr	r0, [fp, #-184]
	bl	read
	ldr	r0, .L24+8
	bl	puts
	ldr	r3, [fp, #-72]
	ldr	r2, .L24+12
	cmp	r3, r2
	beq	.L5
	mov	r3, #1
	b	.L20
.L5:
	ldr	r0, .L24+16
	bl	puts
	sub	r3, fp, #72
	add	r3, r3, #4
	mov	r2, #4
	ldr	r1, .L24+20
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	mov	r3, #1
	b	.L20
.L7:
	ldr	r0, .L24+24
	bl	puts
	sub	r3, fp, #164
	mov	r1, r3
	ldr	r0, [fp, #-184]
	bl	fstat
	ldr	r3, [fp, #-52]
	ldr	r2, [fp, #-120]
	cmp	r3, r2
	beq	.L8
	mov	r3, #1
	b	.L20
.L8:
	ldr	r0, .L24+28
	bl	puts
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	beq	.L9
	mov	r3, #1
	b	.L20
.L9:
	ldr	r0, .L24+32
	bl	puts
	sub	r3, fp, #72
	add	r3, r3, #32
	mov	r2, #32
	ldr	r1, .L24+36
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	mov	r3, #1
	b	.L20
.L10:
	ldr	r0, .L24+40
	bl	puts
.L18:
	sub	r3, fp, #180
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-184]
	bl	read
	str	r0, [fp, #-172]
	ldr	r3, [fp, #-172]
	cmp	r3, #4
	beq	.L11
	mov	r3, #1
	b	.L20
.L11:
	ldr	r3, [fp, #-180]
	cmp	r3, #0
	beq	.L23
	ldr	r3, [fp, #-180]
	add	r3, r3, #1
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-184]
	bl	lseek
	str	r0, [fp, #-172]
	ldr	r3, [fp, #-172]
	cmp	r3, #0
	bge	.L14
	mov	r3, #1
	b	.L20
.L14:
	sub	r3, fp, #176
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-184]
	bl	read
	str	r0, [fp, #-172]
	ldr	r3, [fp, #-172]
	cmp	r3, #4
	beq	.L15
	mov	r3, #1
	b	.L20
.L15:
	ldr	r3, [fp, #-176]
	cmp	r3, #0
	bgt	.L16
	mov	r3, #1
	b	.L20
.L16:
	ldr	r3, [fp, #-176]
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-184]
	bl	lseek
	str	r0, [fp, #-172]
	ldr	r3, [fp, #-172]
	cmp	r3, #0
	bge	.L18
	mov	r3, #1
	b	.L20
.L23:
	nop
	mov	r2, #1
	mov	r1, #0
	ldr	r0, [fp, #-184]
	bl	lseek
	str	r0, [fp, #-168]
	ldr	r3, [fp, #-120]
	ldr	r2, [fp, #-168]
	cmp	r2, r3
	beq	.L19
	mov	r3, #1
	b	.L20
.L19:
	mov	r3, #0
.L20:
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC10
	.word	.LC1
	.word	.LC2
	.word	1178878295
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	hxf_sanity, .-hxf_sanity
	.section	.rodata
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	hxf_ihfs_compatible
	.syntax unified
	.arm
	.fpu softvfp
	.type	hxf_ihfs_compatible, %function
hxf_ihfs_compatible:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L37
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r1, #64
	ldr	r0, [fp, #-24]
	bl	lseek
	mov	r3, #0
	str	r3, [fp, #-12]
.L31:
	sub	r3, fp, #20
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	read
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L36
	ldr	r3, [fp, #-20]
	cmp	r3, #56
	ble	.L29
	mov	r3, #1
	b	.L33
.L29:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	lseek
	sub	r3, fp, #16
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	read
	ldr	r3, [fp, #-16]
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	lseek
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L31
.L36:
	nop
	ldr	r3, [fp, #-12]
	cmp	r3, #2048
	ble	.L32
	mov	r3, #1
	b	.L33
.L32:
	mov	r3, #0
.L33:
	ldr	r2, .L37
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L34
	bl	__stack_chk_fail
.L34:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L38:
	.align	2
.L37:
	.word	.LC11
	.size	hxf_ihfs_compatible, .-hxf_ihfs_compatible
	.section	.rodata
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	hxf_to_ihfs
	.syntax unified
	.arm
	.fpu softvfp
	.type	hxf_to_ihfs, %function
hxf_to_ihfs:
	@ args = 0, pretend = 0, frame = 1056
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1056
	str	r0, [fp, #-1048]
	str	r1, [fp, #-1052]
	str	r2, [fp, #-1056]
	ldr	r3, .L45
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-1056]
	add	r2, r3, #508
	add	r2, r2, #3
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #9
	str	r3, [fp, #-1040]
	ldr	r3, [fp, #-1056]
	rsbs	r2, r3, #0
	lsl	r3, r3, #23
	lsr	r3, r3, #23
	lsl	r2, r2, #23
	lsr	r2, r2, #23
	rsbpl	r3, r2, #0
	str	r3, [fp, #-1036]
	mov	r3, #0
	str	r3, [fp, #-1044]
	b	.L40
.L41:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [fp, #-1048]
	bl	read
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [fp, #-1052]
	bl	write
	ldr	r3, [fp, #-1044]
	add	r3, r3, #1
	str	r3, [fp, #-1044]
.L40:
	ldr	r2, [fp, #-1044]
	ldr	r3, [fp, #-1040]
	cmp	r2, r3
	blt	.L41
	ldr	r3, [fp, #-1036]
	cmp	r3, #0
	ble	.L44
	ldr	r2, [fp, #-1036]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1048]
	bl	read
	ldr	r2, [fp, #-1036]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1052]
	bl	write
	ldr	r3, [fp, #-1036]
	rsb	r3, r3, #512
	mov	r2, r3
	sub	r3, fp, #520
	mov	r1, #255
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-1036]
	rsb	r3, r3, #512
	mov	r2, r3
	sub	r3, fp, #520
	mov	r1, r3
	ldr	r0, [fp, #-1052]
	bl	write
.L44:
	nop
	ldr	r3, .L45
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L43
	bl	__stack_chk_fail
.L43:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L46:
	.align	2
.L45:
	.word	.LC12
	.size	hxf_to_ihfs, .-hxf_to_ihfs
	.section	.rodata
	.align	2
.LC13:
	.ascii	"Non-HXF format!\000"
	.align	2
.LC14:
	.ascii	"Sanity check OK\000"
	.align	2
.LC15:
	.ascii	"HXF info:\000"
	.align	2
.LC16:
	.ascii	"  Signature: 0x%08x\012\000"
	.align	2
.LC17:
	.ascii	"  Unknown1: %s\012\000"
	.align	2
.LC18:
	.ascii	"  Timestamp: %s\012\000"
	.align	2
.LC19:
	.ascii	"  File size: %d bytes\012\000"
	.align	2
.LC20:
	.ascii	"  Unknown2: 0x%08x\012\000"
	.align	2
.LC21:
	.ascii	"  Unknown3: 0x%08x\012\000"
	.align	2
.LC22:
	.ascii	"  Identifier: %s\012\000"
	.align	2
.LC23:
	.ascii	"This HXF image can't be converted into IHFS\000"
	.align	2
.LC24:
	.ascii	"HXF can be converted into IHFS\000"
	.align	2
.LC25:
	.ascii	"Something wrong happened during IHFS image creation"
	.ascii	" at %d\012\000"
	.align	2
.LC26:
	.ascii	"Done!\000"
	.align	2
.LC27:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 132848
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #132096
	sub	sp, sp, #756
	sub	r3, fp, #131072
	sub	r3, r3, #12
	str	r0, [r3, #-1772]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	str	r1, [r3, #-1776]
	ldr	r3, .L72
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1772]
	cmp	r3, #3
	beq	.L48
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1772]
	cmp	r3, #4
	beq	.L48
	bl	usage
.L48:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1776]
	add	r3, r3, #4
	ldr	r2, [r3]
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #704
	mov	r1, r3
	mov	r0, r2
	bl	stat
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1712]
	and	r3, r3, #61440
	cmp	r3, #32768
	beq	.L49
	bl	usage
.L49:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1772]
	cmp	r3, #3
	bne	.L50
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #65273856
	str	r3, [r2, #-1752]
	b	.L51
.L50:
	bl	__errno_location
	mov	r3, r0
	mov	r2, #0
	str	r2, [r3]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1776]
	add	r3, r3, #12
	ldr	r3, [r3]
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r4, r2
	mov	r2, #10
	mov	r1, #0
	mov	r0, r3
	bl	strtol
	str	r0, [r4, #-1752]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L52
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1752]
	cmp	r3, #0
	blt	.L52
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1752]
	lsl	r3, r3, #23
	lsr	r3, r3, #23
	cmp	r3, #0
	beq	.L51
.L52:
	bl	usage
.L51:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1776]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r4, r2
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [r4, #-1744]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r0, [r3, #-1744]
	bl	hxf_sanity
	mov	r3, r0
	cmp	r3, #0
	beq	.L53
	ldr	r0, .L72+4
	bl	puts
	mov	r3, #1
	b	.L69
.L53:
	ldr	r0, .L72+8
	bl	puts
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [r3, #-1744]
	bl	lseek
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #612
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #64
	mov	r1, r3
	ldr	r0, [r0, #-1744]
	bl	read
	ldr	r0, .L72+12
	bl	puts
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1636]
	mov	r1, r3
	ldr	r0, .L72+16
	bl	printf
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #612
	add	r1, r3, #4
	sub	r3, fp, #1056
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #4
	mov	r0, r3
	bl	strncpy
	mov	r3, #0
	strb	r3, [fp, #-1068]
	sub	r3, fp, #1056
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L72+20
	bl	printf
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #612
	add	r1, r3, #8
	sub	r3, fp, #1056
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #12
	mov	r0, r3
	bl	strncpy
	mov	r3, #0
	strb	r3, [fp, #-1060]
	sub	r3, fp, #1056
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L72+24
	bl	printf
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1616]
	mov	r1, r3
	ldr	r0, .L72+28
	bl	printf
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1612]
	mov	r1, r3
	ldr	r0, .L72+32
	bl	printf
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1608]
	mov	r1, r3
	ldr	r0, .L72+36
	bl	printf
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #612
	add	r3, r3, #32
	mov	r1, r3
	ldr	r0, .L72+40
	bl	printf
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r0, [r3, #-1744]
	bl	hxf_ihfs_compatible
	mov	r3, r0
	cmp	r3, #0
	beq	.L55
	ldr	r0, .L72+44
	bl	puts
	mov	r3, #1
	b	.L69
.L55:
	ldr	r0, .L72+48
	bl	puts
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L72+52
	str	r3, [r2, #-1572]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1752]
	add	r2, r3, #508
	add	r2, r2, #3
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #9
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	str	r2, [r3, #-1568]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #4
	str	r3, [r2, #-1564]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L72+56
	str	r3, [r2, #-1560]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	sub	r2, fp, #131072
	sub	r2, r2, #12
	sub	r3, r3, #1552
	sub	r3, r3, #4
	sub	r2, r2, #1616
	sub	r2, r2, #12
	ldm	r2, {r0, r1, r2}
	stm	r3, {r0, r1, r2}
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1544]
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #548
	add	r3, r3, #32
	mov	r2, #476
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L72+60
	str	r3, [r2, #-1064]
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #36
	mov	r2, #131072
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, #0
	mov	r1, #64
	ldr	r0, [r3, #-1744]
	bl	lseek
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1776]
	add	r3, r3, #8
	ldr	r3, [r3]
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r4, r2
	mov	r2, #420
	ldr	r1, .L72+64
	mov	r0, r3
	bl	open
	str	r0, [r4, #-1740]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, #0
	mov	r1, #133120
	ldr	r0, [r3, #-1740]
	bl	lseek
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1756]
	b	.L56
.L59:
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #740
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [r0, #-1744]
	bl	read
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1764]
	cmp	r3, #0
	beq	.L71
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1764]
	add	r3, r3, #1
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r4, r3
	mov	r0, r2
	bl	malloc
	mov	r3, r0
	str	r3, [r4, #-1736]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1764]
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r1, [r1, #-1736]
	ldr	r0, [r3, #-1744]
	bl	read
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1764]
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1736]
	add	r3, r3, r2
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, .L72+68
	sub	r2, fp, #12
	add	r3, r2, r3
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [r0, #-1744]
	bl	read
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #736
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [r0, #-1744]
	bl	read
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #36
	sub	r2, fp, #131072
	sub	r2, r2, #12
	ldr	r2, [r2, #-1756]
	lsl	r2, r2, #6
	add	r3, r3, r2
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r1, r2
	mov	r2, #56
	ldr	r1, [r1, #-1736]
	mov	r0, r3
	bl	strncpy
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, #1
	mov	r1, #0
	ldr	r0, [r3, #-1740]
	bl	lseek
	mov	r3, r0
	add	r2, r3, #508
	add	r2, r2, #3
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #9
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	lsl	r3, r3, #6
	add	r3, r1, r3
	str	r2, [r3, #-1004]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1760]
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	lsl	r3, r3, #6
	add	r3, r1, r3
	str	r2, [r3, #-1000]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1760]
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r1, r2
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, r3
	ldr	r1, [r1, #-1740]
	ldr	r0, [r0, #-1744]
	bl	hxf_to_ihfs
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r0, [r3, #-1736]
	bl	free
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	add	r3, r3, #1
	str	r3, [r2, #-1756]
.L56:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, #1
	mov	r1, #0
	ldr	r0, [r3, #-1744]
	bl	lseek
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1616]
	cmp	r2, r3
	bcc	.L59
	b	.L58
.L71:
	nop
.L58:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	sub	r2, fp, #131072
	sub	r2, r2, #12
	str	r3, [r2, #-1544]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, #1
	mov	r1, #0
	ldr	r0, [r3, #-1740]
	bl	lseek
	str	r0, [r4, #-1748]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1748]
	lsl	r3, r3, #23
	lsr	r3, r3, #23
	cmp	r3, #0
	beq	.L60
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r1, [r3, #-1748]
	ldr	r0, .L72+72
	bl	printf
	mov	r3, #1
	b	.L69
.L60:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r2, [r2, #-1748]
	ldr	r3, [r3, #-1752]
	cmp	r2, r3
	bge	.L61
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1748]
	cmp	r3, #34865152
	bge	.L61
	sub	r3, fp, #528
	mov	r2, #512
	mov	r1, #255
	mov	r0, r3
	bl	memset
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1748]
	rsb	r3, r3, #34865152
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r1, r2
	add	r2, r3, #508
	add	r2, r2, #3
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #9
	str	r3, [r1, #-1732]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1756]
	b	.L62
.L63:
	sub	r3, fp, #528
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [r0, #-1740]
	bl	write
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	add	r3, r3, #1
	str	r3, [r2, #-1756]
.L62:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r2, [r2, #-1756]
	ldr	r3, [r3, #-1732]
	cmp	r2, r3
	blt	.L63
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #34865152
	str	r3, [r2, #-1748]
.L61:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r2, [r2, #-1748]
	ldr	r3, [r3, #-1752]
	cmp	r2, r3
	bge	.L64
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1756]
	b	.L65
.L66:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	sub	r2, fp, #131072
	sub	r2, r2, #12
	ldr	r2, [r2, #-1756]
	add	r3, r3, r2
	mvn	r2, #33
	strb	r2, [r3]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	add	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	mvn	r2, #82
	strb	r2, [r3, #-1028]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	add	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	mvn	r2, #5
	strb	r2, [r3, #-1028]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	add	r3, r3, #3
	sub	r2, fp, #12
	add	r3, r2, r3
	mvn	r2, #49
	strb	r2, [r3, #-1028]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	add	r3, r3, #4
	str	r3, [r2, #-1756]
.L65:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	cmp	r3, #512
	blt	.L66
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r2, [r2, #-1752]
	ldr	r3, [r3, #-1748]
	sub	r3, r2, r3
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r1, r2
	add	r2, r3, #508
	add	r2, r2, #3
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #9
	str	r3, [r1, #-1732]
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1756]
	b	.L67
.L68:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [r0, #-1740]
	bl	write
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r3, [r3, #-1756]
	add	r3, r3, #1
	str	r3, [r2, #-1756]
.L67:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r2, [r2, #-1756]
	ldr	r3, [r3, #-1732]
	cmp	r2, r3
	blt	.L68
.L64:
	sub	r3, fp, #131072
	sub	r3, r3, #12
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [r3, #-1740]
	bl	lseek
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #548
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [r0, #-1740]
	bl	write
	sub	r3, fp, #528
	mov	r2, #512
	mov	r1, #255
	mov	r0, r3
	bl	memset
	sub	r3, fp, #528
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [r0, #-1740]
	bl	write
	sub	r3, fp, #528
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [r0, #-1740]
	bl	write
	sub	r3, fp, #528
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [r0, #-1740]
	bl	write
	sub	r3, fp, #132096
	sub	r3, r3, #12
	sub	r3, r3, #36
	sub	r2, fp, #131072
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #131072
	mov	r1, r3
	ldr	r0, [r0, #-1740]
	bl	write
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r0, [r3, #-1744]
	bl	close
	sub	r3, fp, #131072
	sub	r3, r3, #12
	ldr	r0, [r3, #-1740]
	bl	close
	ldr	r0, .L72+76
	bl	puts
	mov	r3, #0
.L69:
	ldr	r2, .L72
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L70
	bl	__stack_chk_fail
.L70:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L73:
	.align	2
.L72:
	.word	.LC27
	.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	1229473363
	.word	-4096
	.word	1437226410
	.word	577
	.word	-132837
	.word	.LC25
	.word	.LC26
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
