	.file	"161080685.c"
	.intel_syntax noprefix
	.text
	.globl	Write32
	.type	Write32, @function
Write32:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR -16[rbp]
	shr	rax, 24
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -16[rbp]
	shr	rax, 16
	mov	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -16[rbp]
	shr	rax, 8
	mov	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 2
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 3
	mov	rdx, QWORD PTR -16[rbp]
	mov	BYTE PTR [rax], dl
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	Write32, .-Write32
	.globl	Read32
	.type	Read32, @function
Read32:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -8[rbp], 0
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	rax, 24
	or	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	rax, 16
	or	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 2
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	rax, 8
	or	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 3
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	or	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	Read32, .-Read32
	.type	CalcCRC32, @function
CalcCRC32:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	eax, 4294967295
	mov	QWORD PTR -8[rbp], rax
	mov	QWORD PTR -16[rbp], 0
	jmp	.L5
.L6:
	mov	rax, QWORD PTR -8[rbp]
	sal	rax, 8
	mov	rcx, rax
	mov	rax, QWORD PTR -8[rbp]
	shr	rax, 24
	mov	rsi, rax
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -24[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	xor	rax, rsi
	movzx	eax, al
	lea	rdx, 0[0+rax*8]
	lea	rax, crc_table.2[rip]
	mov	rax, QWORD PTR [rdx+rax]
	xor	rax, rcx
	mov	QWORD PTR -8[rbp], rax
	add	QWORD PTR -16[rbp], 1
.L5:
	mov	rax, QWORD PTR -16[rbp]
	cmp	rax, QWORD PTR -32[rbp]
	jb	.L6
	mov	rax, QWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	CalcCRC32, .-CalcCRC32
	.section	.rodata
.LC0:
	.string	"rb"
.LC1:
	.string	"Image file %s not found!\n"
	.align 8
.LC2:
	.string	"UCL compressed files must use algorithm 2e, not %d\n"
	.align 8
.LC3:
	.string	"Generate with: uclpack --best --2e rockbox.bin %s\n"
	.align 8
.LC4:
	.string	"Error: Rombox .ucl file is linked to 0x%08X instead of 0x%08X\n"
	.align 8
.LC5:
	.string	"Exceeding maximum image size %d\n"
	.align 8
.LC6:
	.string	"Read error, expecting %d bytes, got only %d\n"
	.text
	.type	PlaceImage, @function
PlaceImage:
.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, 144
	mov	QWORD PTR -120[rbp], rdi
	mov	QWORD PTR -128[rbp], rsi
	mov	QWORD PTR -136[rbp], rdx
	mov	QWORD PTR -144[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -96[rbp], 150994944
	mov	QWORD PTR -88[rbp], 150995456
	mov	rax, QWORD PTR -120[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -80[rbp], rax
	cmp	QWORD PTR -80[rbp], 0
	jne	.L9
	mov	rax, QWORD PTR -120[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 5
	call	exit@PLT
.L9:
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -112[rbp], rax
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	QWORD PTR -104[rbp], 0
	mov	rdx, QWORD PTR -80[rbp]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	mov	edx, 26
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	lea	rax, -48[rbp]
	mov	edx, 8
	mov	rsi, rax
	lea	rdi, magic.1[rip]
	call	memcmp@PLT
	test	eax, eax
	jne	.L10
	movzx	eax, BYTE PTR -36[rbp]
	cmp	al, 46
	je	.L11
	movzx	eax, BYTE PTR -36[rbp]
	cmp	al, 43
	je	.L11
	movzx	eax, BYTE PTR -36[rbp]
	movzx	eax, al
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -120[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 6
	call	exit@PLT
.L11:
	lea	rax, -48[rbp]
	add	rax, 22
	mov	rdi, rax
	call	Read32
	mov	QWORD PTR -112[rbp], rax
	lea	rax, -48[rbp]
	add	rax, 18
	mov	rdi, rax
	call	Read32
	cmp	QWORD PTR -112[rbp], rax
	jnb	.L12
	mov	QWORD PTR -104[rbp], 1
.L12:
	movzx	eax, BYTE PTR -36[rbp]
	cmp	al, 43
	jne	.L13
	mov	rdx, QWORD PTR -80[rbp]
	lea	rax, -56[rbp]
	mov	rcx, rdx
	mov	edx, 4
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rdx, QWORD PTR -80[rbp]
	lea	rax, -52[rbp]
	mov	rcx, rdx
	mov	edx, 4
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, 1
	mov	rsi, -8
	mov	rdi, rax
	call	fseek@PLT
	lea	rax, -56[rbp]
	mov	rdi, rax
	call	Read32
	mov	QWORD PTR -96[rbp], rax
	mov	rax, QWORD PTR -128[rbp]
	add	rax, 33554448
	cmp	QWORD PTR -96[rbp], rax
	je	.L14
	mov	rax, QWORD PTR -128[rbp]
	lea	rdx, 33554448[rax]
	mov	rax, QWORD PTR -96[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 11
	call	exit@PLT
.L14:
	lea	rax, -52[rbp]
	mov	rdi, rax
	call	Read32
	mov	QWORD PTR -88[rbp], rax
	jmp	.L13
.L10:
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
.L13:
	mov	rdx, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR -112[rbp]
	add	rax, rdx
	add	rax, 16
	cmp	QWORD PTR -144[rbp], rax
	jnb	.L15
	mov	rax, QWORD PTR -144[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 7
	call	exit@PLT
.L15:
	mov	rdx, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR -112[rbp]
	add	rax, rdx
	add	rax, 4111
	and	rax, -4096
	mov	QWORD PTR -72[rbp], rax
	mov	rdx, QWORD PTR -136[rbp]
	mov	rax, QWORD PTR -128[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -96[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	Write32
	mov	rax, QWORD PTR -72[rbp]
	sub	rax, QWORD PTR -128[rbp]
	lea	rdx, -16[rax]
	mov	rax, QWORD PTR -128[rbp]
	lea	rcx, 4[rax]
	mov	rax, QWORD PTR -136[rbp]
	add	rax, rcx
	mov	rsi, rdx
	mov	rdi, rax
	call	Write32
	mov	rax, QWORD PTR -128[rbp]
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -136[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	Write32
	mov	rax, QWORD PTR -128[rbp]
	lea	rdx, 12[rax]
	mov	rax, QWORD PTR -136[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -104[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	Write32
	add	QWORD PTR -128[rbp], 16
	mov	rdx, QWORD PTR -136[rbp]
	mov	rax, QWORD PTR -128[rbp]
	lea	rdi, [rdx+rax]
	mov	rdx, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR -112[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	mov	esi, 1
	call	fread@PLT
	mov	QWORD PTR -64[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	cmp	rax, QWORD PTR -112[rbp]
	je	.L16
	mov	rdx, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR -112[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 8
	call	exit@PLT
.L16:
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -112[rbp]
	add	QWORD PTR -128[rbp], rax
	mov	rax, QWORD PTR -128[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	PlaceImage, .-PlaceImage
	.section	.rodata
.LC7:
	.string	"Usage:"
	.align 8
.LC8:
	.string	"make_firmware <output> <template.bin> <bootloader.ajz> <image1.ucl> {image2.ucl}"
	.align 8
.LC9:
	.string	"<template.bin> is the original firmware from your box"
	.align 8
.LC10:
	.string	"<bootloader.ajz> is the scrambled bootloader"
	.align 8
.LC11:
	.string	"<image1.ucl> is the first image, compressed (recommended) or uncompressed"
	.align 8
.LC12:
	.string	"<image1.ucl> is the second image, compressed (recommended) or uncompressed"
	.align 8
.LC13:
	.string	"More images may follow, but keep the flash size in mind!"
	.align 8
.LC14:
	.string	"Compression must be UCL, algorithm 2e."
	.align 8
.LC15:
	.string	"Generated with: uclpack --best --2e rockbox.bin imageN.ucl"
.LC16:
	.string	"Template file %s not found!\n"
	.align 8
.LC17:
	.string	"Template file %s too small, need at least the header!\n"
.LC18:
	.string	"ARCH"
.LC19:
	.string	"Template file %s invalid!\n"
	.align 8
.LC20:
	.string	"Bootloader file %s not found!\n"
	.align 8
.LC21:
	.string	"Bootloader file %s too short!\n"
.LC22:
	.string	"wb"
	.align 8
.LC23:
	.string	"Output file %s cannot be created!\n"
	.align 8
.LC24:
	.string	"Error writing %d bytes to output file %s!\n"
	.align 8
.LC25:
	.string	"Firmware file generated with %d bytes.\n"
	.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
	sub	rsp, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	cmp	DWORD PTR -68[rbp], 4
	jg	.L20
	lea	rdi, .LC7[rip]
	call	puts@PLT
	lea	rdi, .LC8[rip]
	call	puts@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	lea	rdi, .LC10[rip]
	call	puts@PLT
	lea	rdi, .LC11[rip]
	call	puts@PLT
	lea	rdi, .LC12[rip]
	call	puts@PLT
	lea	rdi, .LC13[rip]
	call	puts@PLT
	lea	rdi, .LC14[rip]
	call	puts@PLT
	lea	rdi, .LC15[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L20:
	mov	edx, 524288
	mov	esi, 255
	lea	rdi, aFirmware.0[rip]
	call	memset@PLT
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L21
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L21:
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, rax
	mov	edx, 256
	mov	esi, 1
	lea	rdi, aFirmware.0[rip]
	call	fread@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	cmp	QWORD PTR -16[rbp], 255
	ja	.L22
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 2
	call	exit@PLT
.L22:
	mov	edx, 4
	lea	rsi, .LC18[rip]
	lea	rdi, aFirmware.0[rip]
	call	strncmp@PLT
	test	eax, eax
	jne	.L23
	mov	DWORD PTR -56[rbp], 1
	mov	QWORD PTR -48[rbp], 256
	jmp	.L24
.L23:
	lea	rdi, aFirmware.0[rip]
	call	Read32
	cmp	rax, 512
	jne	.L25
	mov	DWORD PTR -56[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	lea	rax, aFirmware.0[rip+248]
	mov	rdi, rax
	call	Read32
	mov	QWORD PTR -40[rbp], rax
	lea	rax, aFirmware.0[rip+252]
	mov	rdi, rax
	call	Read32
	mov	QWORD PTR -32[rbp], rax
	jmp	.L24
.L25:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 3
	call	exit@PLT
.L24:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L26
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 4
	call	exit@PLT
.L26:
	cmp	DWORD PTR -56[rbp], 0
	je	.L27
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 0
	mov	esi, 6
	mov	rdi, rax
	call	fseek@PLT
	test	eax, eax
	je	.L27
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC21[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 5
	call	exit@PLT
.L27:
	mov	eax, 524288
	sub	rax, QWORD PTR -48[rbp]
	lea	rcx, aFirmware.0[rip]
	mov	rdx, QWORD PTR -48[rbp]
	lea	rdi, [rcx+rdx]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	mov	esi, 1
	call	fread@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	cmp	DWORD PTR -56[rbp], 0
	je	.L28
	lea	rax, aFirmware.0[rip+4]
	mov	esi, 268432640
	mov	rdi, rax
	call	Write32
	mov	DWORD PTR -52[rbp], 8
	jmp	.L29
.L30:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, aFirmware.0[rip]
	add	rax, rdx
	mov	esi, 33554688
	mov	rdi, rax
	call	Write32
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 4[rax]
	lea	rax, aFirmware.0[rip]
	add	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	Write32
	add	DWORD PTR -52[rbp], 8
.L29:
	cmp	DWORD PTR -52[rbp], 40
	jle	.L30
	jmp	.L31
.L28:
	lea	rdx, aFirmware.0[rip+248]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	Write32
	lea	rdx, aFirmware.0[rip+252]
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	Write32
.L31:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 3
	and	rax, -4
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	add	QWORD PTR -48[rbp], rax
	mov	DWORD PTR -52[rbp], 4
	jmp	.L32
.L34:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, QWORD PTR -48[rbp]
	mov	ecx, 524288
	lea	rdx, aFirmware.0[rip]
	mov	rdi, rax
	call	PlaceImage
	mov	QWORD PTR -48[rbp], rax
	mov	eax, DWORD PTR -68[rbp]
	sub	eax, 1
	cmp	DWORD PTR -52[rbp], eax
	jge	.L33
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 4095
	and	rax, -4096
	mov	QWORD PTR -48[rbp], rax
.L33:
	add	DWORD PTR -52[rbp], 1
.L32:
	mov	eax, DWORD PTR -52[rbp]
	cmp	eax, DWORD PTR -68[rbp]
	jl	.L34
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rax
	lea	rdi, aFirmware.0[rip]
	call	CalcCRC32
	mov	QWORD PTR -8[rbp], rax
	lea	rdx, aFirmware.0[rip]
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	Write32
	add	QWORD PTR -48[rbp], 8
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC22[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L35
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC23[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 9
	call	exit@PLT
.L35:
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	mov	esi, 1
	lea	rdi, aFirmware.0[rip]
	call	fwrite@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -16[rbp]
	cmp	rax, QWORD PTR -48[rbp]
	je	.L36
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rax
	lea	rdi, .LC24[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 10
	call	exit@PLT
.L36:
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rax
	lea	rdi, .LC25[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.section	.rodata
	.align 32
	.type	crc_table.2, @object
	.size	crc_table.2, 2048
crc_table.2:
	.quad	0
	.quad	79764919
	.quad	159529838
	.quad	222504665
	.quad	319059676
	.quad	398814059
	.quad	445009330
	.quad	507990021
	.quad	638119352
	.quad	583659535
	.quad	797628118
	.quad	726387553
	.quad	890018660
	.quad	835552979
	.quad	1015980042
	.quad	944750013
	.quad	1276238704
	.quad	1221641927
	.quad	1167319070
	.quad	1095957929
	.quad	1595256236
	.quad	1540665371
	.quad	1452775106
	.quad	1381403509
	.quad	1780037320
	.quad	1859660671
	.quad	1671105958
	.quad	1733955601
	.quad	2031960084
	.quad	2111593891
	.quad	1889500026
	.quad	1952343757
	.quad	2552477408
	.quad	2632100695
	.quad	2443283854
	.quad	2506133561
	.quad	2334638140
	.quad	2414271883
	.quad	2191915858
	.quad	2254759653
	.quad	3190512472
	.quad	3135915759
	.quad	3081330742
	.quad	3009969537
	.quad	2905550212
	.quad	2850959411
	.quad	2762807018
	.quad	2691435357
	.quad	3560074640
	.quad	3505614887
	.quad	3719321342
	.quad	3648080713
	.quad	3342211916
	.quad	3287746299
	.quad	3467911202
	.quad	3396681109
	.quad	4063920168
	.quad	4143685023
	.quad	4223187782
	.quad	4286162673
	.quad	3779000052
	.quad	3858754371
	.quad	3904687514
	.quad	3967668269
	.quad	881225847
	.quad	809987520
	.quad	1023691545
	.quad	969234094
	.quad	662832811
	.quad	591600412
	.quad	771767749
	.quad	717299826
	.quad	311336399
	.quad	374308984
	.quad	453813921
	.quad	533576470
	.quad	25881363
	.quad	88864420
	.quad	134795389
	.quad	214552010
	.quad	2023205639
	.quad	2086057648
	.quad	1897238633
	.quad	1976864222
	.quad	1804852699
	.quad	1867694188
	.quad	1645340341
	.quad	1724971778
	.quad	1587496639
	.quad	1516133128
	.quad	1461550545
	.quad	1406951526
	.quad	1302016099
	.quad	1230646740
	.quad	1142491917
	.quad	1087903418
	.quad	2896545431
	.quad	2825181984
	.quad	2770861561
	.quad	2716262478
	.quad	3215044683
	.quad	3143675388
	.quad	3055782693
	.quad	3001194130
	.quad	2326604591
	.quad	2389456536
	.quad	2200899649
	.quad	2280525302
	.quad	2578013683
	.quad	2640855108
	.quad	2418763421
	.quad	2498394922
	.quad	3769900519
	.quad	3832873040
	.quad	3912640137
	.quad	3992402750
	.quad	4088425275
	.quad	4151408268
	.quad	4197601365
	.quad	4277358050
	.quad	3334271071
	.quad	3263032808
	.quad	3476998961
	.quad	3422541446
	.quad	3585640067
	.quad	3514407732
	.quad	3694837229
	.quad	3640369242
	.quad	1762451694
	.quad	1842216281
	.quad	1619975040
	.quad	1682949687
	.quad	2047383090
	.quad	2127137669
	.quad	1938468188
	.quad	2001449195
	.quad	1325665622
	.quad	1271206113
	.quad	1183200824
	.quad	1111960463
	.quad	1543535498
	.quad	1489069629
	.quad	1434599652
	.quad	1363369299
	.quad	622672798
	.quad	568075817
	.quad	748617968
	.quad	677256519
	.quad	907627842
	.quad	853037301
	.quad	1067152940
	.quad	995781531
	.quad	51762726
	.quad	131386257
	.quad	177728840
	.quad	240578815
	.quad	269590778
	.quad	349224269
	.quad	429104020
	.quad	491947555
	.quad	4046411278
	.quad	4126034873
	.quad	4172115296
	.quad	4234965207
	.quad	3794477266
	.quad	3874110821
	.quad	3953728444
	.quad	4016571915
	.quad	3609705398
	.quad	3555108353
	.quad	3735388376
	.quad	3664026991
	.quad	3290680682
	.quad	3236090077
	.quad	3449943556
	.quad	3378572211
	.quad	3174993278
	.quad	3120533705
	.quad	3032266256
	.quad	2961025959
	.quad	2923101090
	.quad	2868635157
	.quad	2813903052
	.quad	2742672763
	.quad	2604032198
	.quad	2683796849
	.quad	2461293480
	.quad	2524268063
	.quad	2284983834
	.quad	2364738477
	.quad	2175806836
	.quad	2238787779
	.quad	1569362073
	.quad	1498123566
	.quad	1409854455
	.quad	1355396672
	.quad	1317987909
	.quad	1246755826
	.quad	1192025387
	.quad	1137557660
	.quad	2072149281
	.quad	2135122070
	.quad	1912620623
	.quad	1992383480
	.quad	1753615357
	.quad	1816598090
	.quad	1627664531
	.quad	1707420964
	.quad	295390185
	.quad	358241886
	.quad	404320391
	.quad	483945776
	.quad	43990325
	.quad	106832002
	.quad	186451547
	.quad	266083308
	.quad	932423249
	.quad	861060070
	.quad	1041341759
	.quad	986742920
	.quad	613929101
	.quad	542559546
	.quad	756411363
	.quad	701822548
	.quad	3316196985
	.quad	3244833742
	.quad	3425377559
	.quad	3370778784
	.quad	3601682597
	.quad	3530312978
	.quad	3744426955
	.quad	3689838204
	.quad	3819031489
	.quad	3881883254
	.quad	3928223919
	.quad	4007849240
	.quad	4037393693
	.quad	4100235434
	.quad	4180117107
	.quad	4259748804
	.quad	2310601993
	.quad	2373574846
	.quad	2151335527
	.quad	2231098320
	.quad	2596047829
	.quad	2659030626
	.quad	2470359227
	.quad	2550115596
	.quad	2947551409
	.quad	2876312838
	.quad	2788305887
	.quad	2733848168
	.quad	3165939309
	.quad	3094707162
	.quad	3040238851
	.quad	2985771188
	.align 8
	.type	magic.1, @object
	.size	magic.1, 8
magic.1:
	.string	""
	.ascii	"\351UCL\377\001\032"
	.local	aFirmware.0
	.comm	aFirmware.0,524288,32
	.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	"161080685.c"
	.text
	.align	2
	.global	Write32
	.syntax unified
	.arm
	.fpu softvfp
	.type	Write32, %function
Write32:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-12]
	lsr	r3, r3, #24
	and	r2, r3, #255
	ldr	r3, [fp, #-8]
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	lsr	r2, r3, #16
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	lsr	r2, r3, #8
	ldr	r3, [fp, #-8]
	add	r3, r3, #2
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #3
	ldr	r2, [fp, #-12]
	and	r2, r2, #255
	strb	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	Write32, .-Write32
	.align	2
	.global	Read32
	.syntax unified
	.arm
	.fpu softvfp
	.type	Read32, %function
Read32:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	ldr	r2, [fp, #-8]
	orr	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #16
	ldr	r2, [fp, #-8]
	orr	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r3, r3, #2
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	ldr	r2, [fp, #-8]
	orr	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r3, r3, #3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-8]
	orr	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	Read32, .-Read32
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	CalcCRC32, %function
CalcCRC32:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mvn	r3, #0
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L5
.L6:
	ldr	r3, [fp, #-8]
	lsl	r2, r3, #8
	ldr	r3, [fp, #-8]
	lsr	r1, r3, #24
	ldr	r3, [fp, #-16]
	add	r0, r3, #1
	str	r0, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	eor	r3, r3, r1
	and	r3, r3, #255
	ldr	r1, .L8
	ldr	r3, [r1, r3, lsl #2]
	eor	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L5:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	bcc	.L6
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L9:
	.align	2
.L8:
	.word	crc_table.5357
	.size	CalcCRC32, .-CalcCRC32
	.section	.rodata
	.align	2
.LC0:
	.ascii	"rb\000"
	.align	2
.LC1:
	.ascii	"Image file %s not found!\012\000"
	.align	2
.LC2:
	.ascii	"UCL compressed files must use algorithm 2e, not %d\012"
	.ascii	"\000"
	.align	2
.LC3:
	.ascii	"Generate with: uclpack --best --2e rockbox.bin %s\012"
	.ascii	"\000"
	.align	2
.LC4:
	.ascii	"Error: Rombox .ucl file is linked to 0x%08X instead"
	.ascii	" of 0x%08X\012\000"
	.align	2
.LC5:
	.ascii	"Exceeding maximum image size %d\012\000"
	.align	2
.LC6:
	.ascii	"Read error, expecting %d bytes, got only %d\012\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	PlaceImage, %function
PlaceImage:
	@ args = 0, pretend = 0, frame = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #88
	str	r0, [fp, #-80]
	str	r1, [fp, #-84]
	str	r2, [fp, #-88]
	str	r3, [fp, #-92]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #150994944
	str	r3, [fp, #-64]
	ldr	r3, .L21+4
	str	r3, [fp, #-60]
	ldr	r1, .L21+8
	ldr	r0, [fp, #-80]
	bl	fopen
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L11
	ldr	r1, [fp, #-80]
	ldr	r0, .L21+12
	bl	printf
	mov	r0, #5
	bl	exit
.L11:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-56]
	bl	fseek
	ldr	r0, [fp, #-56]
	bl	ftell
	mov	r3, r0
	str	r3, [fp, #-72]
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-56]
	bl	fseek
	mov	r3, #0
	str	r3, [fp, #-68]
	sub	r0, fp, #36
	ldr	r3, [fp, #-56]
	mov	r2, #26
	mov	r1, #1
	bl	fread
	sub	r3, fp, #36
	mov	r2, #8
	mov	r1, r3
	ldr	r0, .L21+16
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L12
	ldrb	r3, [fp, #-24]	@ zero_extendqisi2
	cmp	r3, #46
	beq	.L13
	ldrb	r3, [fp, #-24]	@ zero_extendqisi2
	cmp	r3, #43
	beq	.L13
	ldrb	r3, [fp, #-24]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L21+20
	bl	printf
	ldr	r1, [fp, #-80]
	ldr	r0, .L21+24
	bl	printf
	mov	r0, #6
	bl	exit
.L13:
	sub	r3, fp, #36
	add	r3, r3, #22
	mov	r0, r3
	bl	Read32
	str	r0, [fp, #-72]
	sub	r3, fp, #36
	add	r3, r3, #18
	mov	r0, r3
	bl	Read32
	mov	r2, r0
	ldr	r3, [fp, #-72]
	cmp	r3, r2
	bcs	.L14
	mov	r3, #1
	str	r3, [fp, #-68]
.L14:
	ldrb	r3, [fp, #-24]	@ zero_extendqisi2
	cmp	r3, #43
	bne	.L15
	sub	r0, fp, #44
	ldr	r3, [fp, #-56]
	mov	r2, #4
	mov	r1, #1
	bl	fread
	sub	r0, fp, #40
	ldr	r3, [fp, #-56]
	mov	r2, #4
	mov	r1, #1
	bl	fread
	mov	r2, #1
	mvn	r1, #7
	ldr	r0, [fp, #-56]
	bl	fseek
	sub	r3, fp, #44
	mov	r0, r3
	bl	Read32
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-84]
	add	r3, r3, #33554432
	add	r3, r3, #16
	ldr	r2, [fp, #-64]
	cmp	r2, r3
	beq	.L16
	ldr	r3, [fp, #-84]
	add	r3, r3, #33554432
	add	r3, r3, #16
	mov	r2, r3
	ldr	r1, [fp, #-64]
	ldr	r0, .L21+28
	bl	printf
	mov	r0, #11
	bl	exit
.L16:
	sub	r3, fp, #40
	mov	r0, r3
	bl	Read32
	str	r0, [fp, #-60]
	b	.L15
.L12:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-56]
	bl	fseek
.L15:
	ldr	r2, [fp, #-84]
	ldr	r3, [fp, #-72]
	add	r3, r2, r3
	add	r3, r3, #16
	ldr	r2, [fp, #-92]
	cmp	r2, r3
	bcs	.L17
	ldr	r1, [fp, #-92]
	ldr	r0, .L21+32
	bl	printf
	mov	r0, #7
	bl	exit
.L17:
	ldr	r2, [fp, #-84]
	ldr	r3, [fp, #-72]
	add	r3, r2, r3
	add	r3, r3, #4096
	add	r3, r3, #15
	bic	r3, r3, #4080
	bic	r3, r3, #15
	str	r3, [fp, #-52]
	ldr	r2, [fp, #-88]
	ldr	r3, [fp, #-84]
	add	r3, r2, r3
	ldr	r1, [fp, #-64]
	mov	r0, r3
	bl	Write32
	ldr	r3, [fp, #-84]
	add	r3, r3, #4
	ldr	r2, [fp, #-88]
	add	r0, r2, r3
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-84]
	sub	r3, r2, r3
	sub	r3, r3, #16
	mov	r1, r3
	bl	Write32
	ldr	r3, [fp, #-84]
	add	r3, r3, #8
	ldr	r2, [fp, #-88]
	add	r3, r2, r3
	ldr	r1, [fp, #-60]
	mov	r0, r3
	bl	Write32
	ldr	r3, [fp, #-84]
	add	r3, r3, #12
	ldr	r2, [fp, #-88]
	add	r3, r2, r3
	ldr	r1, [fp, #-68]
	mov	r0, r3
	bl	Write32
	ldr	r3, [fp, #-84]
	add	r3, r3, #16
	str	r3, [fp, #-84]
	ldr	r2, [fp, #-88]
	ldr	r3, [fp, #-84]
	add	r0, r2, r3
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-72]
	mov	r1, #1
	bl	fread
	str	r0, [fp, #-48]
	ldr	r2, [fp, #-48]
	ldr	r3, [fp, #-72]
	cmp	r2, r3
	beq	.L18
	ldr	r2, [fp, #-48]
	ldr	r1, [fp, #-72]
	ldr	r0, .L21+36
	bl	printf
	mov	r0, #8
	bl	exit
.L18:
	ldr	r0, [fp, #-56]
	bl	fclose
	ldr	r2, [fp, #-84]
	ldr	r3, [fp, #-72]
	add	r3, r2, r3
	str	r3, [fp, #-84]
	ldr	r3, [fp, #-84]
	ldr	r2, .L21
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L20
	bl	__stack_chk_fail
.L20:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC7
	.word	150995456
	.word	.LC0
	.word	.LC1
	.word	magic.5376
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	PlaceImage, .-PlaceImage
	.section	.rodata
	.align	2
.LC8:
	.ascii	"Usage:\000"
	.align	2
.LC9:
	.ascii	"make_firmware <output> <template.bin> <bootloader.a"
	.ascii	"jz> <image1.ucl> {image2.ucl}\000"
	.align	2
.LC10:
	.ascii	"<template.bin> is the original firmware from your b"
	.ascii	"ox\000"
	.align	2
.LC11:
	.ascii	"<bootloader.ajz> is the scrambled bootloader\000"
	.align	2
.LC12:
	.ascii	"<image1.ucl> is the first image, compressed (recomm"
	.ascii	"ended) or uncompressed\000"
	.align	2
.LC13:
	.ascii	"<image1.ucl> is the second image, compressed (recom"
	.ascii	"mended) or uncompressed\000"
	.align	2
.LC14:
	.ascii	"More images may follow, but keep the flash size in "
	.ascii	"mind!\000"
	.align	2
.LC15:
	.ascii	"Compression must be UCL, algorithm 2e.\000"
	.align	2
.LC16:
	.ascii	"Generated with: uclpack --best --2e rockbox.bin ima"
	.ascii	"geN.ucl\000"
	.align	2
.LC17:
	.ascii	"Template file %s not found!\012\000"
	.align	2
.LC18:
	.ascii	"Template file %s too small, need at least the heade"
	.ascii	"r!\012\000"
	.align	2
.LC19:
	.ascii	"ARCH\000"
	.align	2
.LC20:
	.ascii	"Template file %s invalid!\012\000"
	.align	2
.LC21:
	.ascii	"Bootloader file %s not found!\012\000"
	.align	2
.LC22:
	.ascii	"Bootloader file %s too short!\012\000"
	.align	2
.LC23:
	.ascii	"wb\000"
	.align	2
.LC24:
	.ascii	"Output file %s cannot be created!\012\000"
	.align	2
.LC25:
	.ascii	"Error writing %d bytes to output file %s!\012\000"
	.align	2
.LC26:
	.ascii	"Firmware file generated with %d bytes.\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, [fp, #-40]
	cmp	r3, #4
	bgt	.L24
	ldr	r0, .L42
	bl	puts
	ldr	r0, .L42+4
	bl	puts
	ldr	r0, .L42+8
	bl	puts
	ldr	r0, .L42+12
	bl	puts
	ldr	r0, .L42+16
	bl	puts
	ldr	r0, .L42+20
	bl	puts
	ldr	r0, .L42+24
	bl	puts
	ldr	r0, .L42+28
	bl	puts
	ldr	r0, .L42+32
	bl	puts
	mov	r0, #0
	bl	exit
.L24:
	mov	r2, #524288
	mov	r1, #255
	ldr	r0, .L42+36
	bl	memset
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L42+40
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L25
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L42+44
	bl	printf
	mov	r0, #1
	bl	exit
.L25:
	ldr	r3, [fp, #-16]
	mov	r2, #256
	mov	r1, #1
	ldr	r0, .L42+36
	bl	fread
	str	r0, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	fclose
	ldr	r3, [fp, #-12]
	cmp	r3, #255
	bhi	.L26
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L42+48
	bl	printf
	mov	r0, #2
	bl	exit
.L26:
	mov	r2, #4
	ldr	r1, .L42+52
	ldr	r0, .L42+36
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L27
	mov	r3, #1
	str	r3, [fp, #-32]
	mov	r3, #256
	str	r3, [fp, #-36]
	b	.L28
.L27:
	ldr	r0, .L42+36
	bl	Read32
	mov	r3, r0
	cmp	r3, #512
	bne	.L29
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-36]
	ldr	r3, .L42+56
	mov	r0, r3
	bl	Read32
	str	r0, [fp, #-28]
	ldr	r3, .L42+60
	mov	r0, r3
	bl	Read32
	str	r0, [fp, #-24]
	b	.L28
.L29:
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L42+64
	bl	printf
	mov	r0, #3
	bl	exit
.L28:
	ldr	r3, [fp, #-44]
	add	r3, r3, #12
	ldr	r3, [r3]
	ldr	r1, .L42+40
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L30
	ldr	r3, [fp, #-44]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L42+68
	bl	printf
	mov	r0, #4
	bl	exit
.L30:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L31
	mov	r2, #0
	mov	r1, #6
	ldr	r0, [fp, #-16]
	bl	fseek
	mov	r3, r0
	cmp	r3, #0
	beq	.L31
	ldr	r3, [fp, #-44]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L42+72
	bl	printf
	mov	r0, #5
	bl	exit
.L31:
	ldr	r3, [fp, #-36]
	ldr	r2, .L42+36
	add	r0, r3, r2
	ldr	r3, [fp, #-36]
	rsb	r2, r3, #524288
	ldr	r3, [fp, #-16]
	mov	r1, #1
	bl	fread
	str	r0, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	fclose
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L32
	ldr	r3, .L42+76
	ldr	r1, .L42+80
	mov	r0, r3
	bl	Write32
	mov	r3, #8
	str	r3, [fp, #-20]
	b	.L33
.L34:
	ldr	r3, [fp, #-20]
	ldr	r2, .L42+36
	add	r3, r3, r2
	ldr	r1, .L42+84
	mov	r0, r3
	bl	Write32
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r2, .L42+36
	add	r3, r3, r2
	ldr	r1, [fp, #-12]
	mov	r0, r3
	bl	Write32
	ldr	r3, [fp, #-20]
	add	r3, r3, #8
	str	r3, [fp, #-20]
.L33:
	ldr	r3, [fp, #-20]
	cmp	r3, #40
	ble	.L34
	b	.L35
.L32:
	ldr	r3, .L42+56
	ldr	r1, [fp, #-28]
	mov	r0, r3
	bl	Write32
	ldr	r3, .L42+60
	ldr	r1, [fp, #-24]
	mov	r0, r3
	bl	Write32
.L35:
	ldr	r3, [fp, #-12]
	add	r3, r3, #3
	bic	r3, r3, #3
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-36]
	mov	r3, #4
	str	r3, [fp, #-20]
	b	.L36
.L38:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r0, [r3]
	mov	r3, #524288
	ldr	r2, .L42+36
	ldr	r1, [fp, #-36]
	bl	PlaceImage
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-40]
	sub	r3, r3, #1
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bge	.L37
	ldr	r3, [fp, #-36]
	add	r3, r3, #4080
	add	r3, r3, #15
	bic	r3, r3, #4080
	bic	r3, r3, #15
	str	r3, [fp, #-36]
.L37:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L36:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L38
	ldr	r1, [fp, #-36]
	ldr	r0, .L42+36
	bl	CalcCRC32
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-36]
	ldr	r2, .L42+36
	add	r3, r3, r2
	ldr	r1, [fp, #-8]
	mov	r0, r3
	bl	Write32
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L42+88
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L39
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L42+92
	bl	printf
	mov	r0, #9
	bl	exit
.L39:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-36]
	mov	r1, #1
	ldr	r0, .L42+36
	bl	fwrite
	str	r0, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	fclose
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-36]
	cmp	r2, r3
	beq	.L40
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-36]
	ldr	r0, .L42+96
	bl	printf
	mov	r0, #10
	bl	exit
.L40:
	ldr	r1, [fp, #-36]
	ldr	r0, .L42+100
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L43:
	.align	2
.L42:
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	aFirmware.5384
	.word	.LC0
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	aFirmware.5384+248
	.word	aFirmware.5384+252
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	aFirmware.5384+4
	.word	268432640
	.word	33554688
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.word	.LC26
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	crc_table.5357, %object
	.size	crc_table.5357, 1024
crc_table.5357:
	.word	0
	.word	79764919
	.word	159529838
	.word	222504665
	.word	319059676
	.word	398814059
	.word	445009330
	.word	507990021
	.word	638119352
	.word	583659535
	.word	797628118
	.word	726387553
	.word	890018660
	.word	835552979
	.word	1015980042
	.word	944750013
	.word	1276238704
	.word	1221641927
	.word	1167319070
	.word	1095957929
	.word	1595256236
	.word	1540665371
	.word	1452775106
	.word	1381403509
	.word	1780037320
	.word	1859660671
	.word	1671105958
	.word	1733955601
	.word	2031960084
	.word	2111593891
	.word	1889500026
	.word	1952343757
	.word	-1742489888
	.word	-1662866601
	.word	-1851683442
	.word	-1788833735
	.word	-1960329156
	.word	-1880695413
	.word	-2103051438
	.word	-2040207643
	.word	-1104454824
	.word	-1159051537
	.word	-1213636554
	.word	-1284997759
	.word	-1389417084
	.word	-1444007885
	.word	-1532160278
	.word	-1603531939
	.word	-734892656
	.word	-789352409
	.word	-575645954
	.word	-646886583
	.word	-952755380
	.word	-1007220997
	.word	-827056094
	.word	-898286187
	.word	-231047128
	.word	-151282273
	.word	-71779514
	.word	-8804623
	.word	-515967244
	.word	-436212925
	.word	-390279782
	.word	-327299027
	.word	881225847
	.word	809987520
	.word	1023691545
	.word	969234094
	.word	662832811
	.word	591600412
	.word	771767749
	.word	717299826
	.word	311336399
	.word	374308984
	.word	453813921
	.word	533576470
	.word	25881363
	.word	88864420
	.word	134795389
	.word	214552010
	.word	2023205639
	.word	2086057648
	.word	1897238633
	.word	1976864222
	.word	1804852699
	.word	1867694188
	.word	1645340341
	.word	1724971778
	.word	1587496639
	.word	1516133128
	.word	1461550545
	.word	1406951526
	.word	1302016099
	.word	1230646740
	.word	1142491917
	.word	1087903418
	.word	-1398421865
	.word	-1469785312
	.word	-1524105735
	.word	-1578704818
	.word	-1079922613
	.word	-1151291908
	.word	-1239184603
	.word	-1293773166
	.word	-1968362705
	.word	-1905510760
	.word	-2094067647
	.word	-2014441994
	.word	-1716953613
	.word	-1654112188
	.word	-1876203875
	.word	-1796572374
	.word	-525066777
	.word	-462094256
	.word	-382327159
	.word	-302564546
	.word	-206542021
	.word	-143559028
	.word	-97365931
	.word	-17609246
	.word	-960696225
	.word	-1031934488
	.word	-817968335
	.word	-872425850
	.word	-709327229
	.word	-780559564
	.word	-600130067
	.word	-654598054
	.word	1762451694
	.word	1842216281
	.word	1619975040
	.word	1682949687
	.word	2047383090
	.word	2127137669
	.word	1938468188
	.word	2001449195
	.word	1325665622
	.word	1271206113
	.word	1183200824
	.word	1111960463
	.word	1543535498
	.word	1489069629
	.word	1434599652
	.word	1363369299
	.word	622672798
	.word	568075817
	.word	748617968
	.word	677256519
	.word	907627842
	.word	853037301
	.word	1067152940
	.word	995781531
	.word	51762726
	.word	131386257
	.word	177728840
	.word	240578815
	.word	269590778
	.word	349224269
	.word	429104020
	.word	491947555
	.word	-248556018
	.word	-168932423
	.word	-122852000
	.word	-60002089
	.word	-500490030
	.word	-420856475
	.word	-341238852
	.word	-278395381
	.word	-685261898
	.word	-739858943
	.word	-559578920
	.word	-630940305
	.word	-1004286614
	.word	-1058877219
	.word	-845023740
	.word	-916395085
	.word	-1119974018
	.word	-1174433591
	.word	-1262701040
	.word	-1333941337
	.word	-1371866206
	.word	-1426332139
	.word	-1481064244
	.word	-1552294533
	.word	-1690935098
	.word	-1611170447
	.word	-1833673816
	.word	-1770699233
	.word	-2009983462
	.word	-1930228819
	.word	-2119160460
	.word	-2056179517
	.word	1569362073
	.word	1498123566
	.word	1409854455
	.word	1355396672
	.word	1317987909
	.word	1246755826
	.word	1192025387
	.word	1137557660
	.word	2072149281
	.word	2135122070
	.word	1912620623
	.word	1992383480
	.word	1753615357
	.word	1816598090
	.word	1627664531
	.word	1707420964
	.word	295390185
	.word	358241886
	.word	404320391
	.word	483945776
	.word	43990325
	.word	106832002
	.word	186451547
	.word	266083308
	.word	932423249
	.word	861060070
	.word	1041341759
	.word	986742920
	.word	613929101
	.word	542559546
	.word	756411363
	.word	701822548
	.word	-978770311
	.word	-1050133554
	.word	-869589737
	.word	-924188512
	.word	-693284699
	.word	-764654318
	.word	-550540341
	.word	-605129092
	.word	-475935807
	.word	-413084042
	.word	-366743377
	.word	-287118056
	.word	-257573603
	.word	-194731862
	.word	-114850189
	.word	-35218492
	.word	-1984365303
	.word	-1921392450
	.word	-2143631769
	.word	-2063868976
	.word	-1698919467
	.word	-1635936670
	.word	-1824608069
	.word	-1744851700
	.word	-1347415887
	.word	-1418654458
	.word	-1506661409
	.word	-1561119128
	.word	-1129027987
	.word	-1200260134
	.word	-1254728445
	.word	-1309196108
	.align	2
	.type	magic.5376, %object
	.size	magic.5376, 8
magic.5376:
	.ascii	"\000\351UCL\377\001\032"
	.local	aFirmware.5384
	.comm	aFirmware.5384,524288,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
