	.file	"578849.c"
	.intel_syntax noprefix
	.text
	.globl	names
	.bss
	.align 32
	.type	names, @object
	.size	names, 320
names:
	.zero	320
	.globl	trx_version
	.data
	.type	trx_version, @object
	.size	trx_version, 1
trx_version:
	.byte	1
	.globl	trx_max_offset
	.align 4
	.type	trx_max_offset, @object
	.size	trx_max_offset, 4
trx_max_offset:
	.long	3
	.globl	trx_magic
	.align 4
	.type	trx_magic, @object
	.size	trx_magic, 4
trx_magic:
	.long	810697800
	.globl	crc_table
	.bss
	.align 8
	.type	crc_table, @object
	.size	crc_table, 8
crc_table:
	.zero	8
	.globl	trx
	.align 8
	.type	trx, @object
	.size	trx, 8
trx:
	.zero	8
	.globl	trx_count
	.align 4
	.type	trx_count, @object
	.size	trx_count, 4
trx_count:
	.zero	4
	.globl	trx_final
	.align 4
	.type	trx_final, @object
	.size	trx_final, 4
trx_final:
	.zero	4
	.globl	trx_padding
	.align 4
	.type	trx_padding, @object
	.size	trx_padding, 4
trx_padding:
	.zero	4
	.globl	max_time
	.align 8
	.type	max_time, @object
	.size	max_time, 8
max_time:
	.zero	8
	.text
	.globl	crc_init
	.type	crc_init, @function
crc_init:
.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, 16
	mov	rax, QWORD PTR crc_table[rip]
	test	rax, rax
	jne	.L2
	mov	edi, 1024
	call	malloc@PLT
	mov	QWORD PTR crc_table[rip], rax
	mov	rax, QWORD PTR crc_table[rip]
	test	rax, rax
	jne	.L3
	mov	eax, 0
	jmp	.L4
.L3:
	mov	DWORD PTR -8[rbp], 255
	jmp	.L5
.L10:
	mov	eax, DWORD PTR -8[rbp]
	mov	DWORD PTR -12[rbp], eax
	mov	DWORD PTR -4[rbp], 8
	jmp	.L6
.L9:
	mov	eax, DWORD PTR -12[rbp]
	and	eax, 1
	test	eax, eax
	je	.L7
	mov	eax, DWORD PTR -12[rbp]
	shr	eax
	xor	eax, -306674912
	mov	DWORD PTR -12[rbp], eax
	jmp	.L8
.L7:
	shr	DWORD PTR -12[rbp]
.L8:
	sub	DWORD PTR -4[rbp], 1
.L6:
	cmp	DWORD PTR -4[rbp], 0
	jg	.L9
	mov	rdx, QWORD PTR crc_table[rip]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 2
	add	rdx, rax
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rdx], eax
	sub	DWORD PTR -8[rbp], 1
.L5:
	cmp	DWORD PTR -8[rbp], 0
	jns	.L10
.L2:
	mov	eax, 1
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	crc_init, .-crc_init
	.globl	crc_done
	.type	crc_done, @function
crc_done:
.LFB8:
	.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 crc_table[rip]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR crc_table[rip], 0
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	crc_done, .-crc_done
	.globl	crc_calc
	.type	crc_calc, @function
crc_calc:
.LFB9:
	.cfi_startproc
	endbr64
	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	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR -8[rbp], edx
	jmp	.L13
.L14:
	mov	rdx, QWORD PTR crc_table[rip]
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	xor	eax, DWORD PTR -4[rbp]
	mov	eax, eax
	movzx	eax, al
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -4[rbp]
	shr	eax, 8
	xor	eax, edx
	mov	DWORD PTR -4[rbp], eax
	add	QWORD PTR -16[rbp], 1
.L13:
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -8[rbp], edx
	test	eax, eax
	jg	.L14
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	crc_calc, .-crc_calc
	.section	.rodata
	.align 8
.LC0:
	.ascii	"fpkg - Package a firmware\nCopyright (C) 2007 Jonathan Zarat"
	.ascii	"e\n\nUsage: [-v <trx version>] -i <input> [-a <align>] [-i <"
	.ascii	"input>] [-a <align>] {output}\nOutput:\n TRX:            -t "
	.ascii	"<output file>\n Linksys/Cisco:  -l <id>,<output file>\n   W5"
	.ascii	"4G WRT54G / WRT54GL\n   W54U WRTSL54GS\n   W54S WRTS54GS\n  "
	.ascii	" W54s WRT54GS v4\n   N160 WRT160N v3\n   EWCB WRT300N v1\n  "
	.ascii	" 310N WRT310N v1/v2\n   320N WRT320N\n   610N WRT610N v2\n  "
	.ascii	" 32XN E2000\n   61XN E3000\n   4200 E4200\n Motorola:       "
	.ascii	"-m <id>,<output file>\n   0x10577000 WE800\n   0x10577040 WA"
	.ascii	"840\n   0x1057705"
	.string	"0 WR850\n Belkin:         -b <id>,<output file>\n   0x20100322 F7D3301 (Share Max)\n   0x20090928 F7D3302 (Share)\n   0x20091006 F7D4302 (Play)\n   0x00017116 F5D8235 v3\n   0x12345678 QA (QA firmware)\n Asus:           -r <id>,<v1>,<v2>,<v3>,<v4>,<output file>\n\n"
	.text
	.globl	help
	.type	help, @function
help:
.LFB10:
	.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, 791
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE10:
	.size	help, .-help
	.section	.rodata
	.align 8
.LC1:
	.string	"Cannot load another image if an output has already been written.\n"
.LC2:
	.string	"Too many input files.\n"
	.align 8
.LC5:
	.string	"Total size %lu (%.1f KB) is too big. Maximum is %lu (%.1f KB).\n"
.LC6:
	.string	"r"
	.text
	.globl	load_image
	.type	load_image, @function
load_image:
.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, 208
	mov	QWORD PTR -200[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR trx_final[rip]
	test	eax, eax
	je	.L18
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 65
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L18:
	mov	edx, DWORD PTR trx_count[rip]
	mov	eax, DWORD PTR trx_max_offset[rip]
	cmp	edx, eax
	jl	.L19
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L19:
	lea	rdx, -160[rbp]
	mov	rax, QWORD PTR -200[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	test	eax, eax
	je	.L20
	mov	rax, QWORD PTR -200[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L20:
	mov	rdx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR max_time[rip]
	cmp	rdx, rax
	jle	.L21
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR max_time[rip], rax
.L21:
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 3
	and	rax, -4
	mov	QWORD PTR -184[rbp], rax
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, eax
	mov	rax, QWORD PTR -184[rbp]
	add	rax, rdx
	cmp	rax, 33161216
	jle	.L22
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, eax
	mov	rax, QWORD PTR -184[rbp]
	add	rax, rdx
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	movsd	xmm1, QWORD PTR .LC3[rip]
	divsd	xmm0, xmm1
	movq	rdx, xmm0
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	ecx, eax
	mov	rax, QWORD PTR -184[rbp]
	lea	rsi, [rcx+rax]
	mov	rax, QWORD PTR stderr[rip]
	movsd	xmm0, QWORD PTR .LC4[rip]
	movapd	xmm1, xmm0
	mov	ecx, 33161216
	movq	xmm0, rdx
	mov	rdx, rsi
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 2
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L22:
	mov	rdx, QWORD PTR trx[rip]
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	eax, eax
	add	rax, rdx
	mov	QWORD PTR -176[rbp], rax
	mov	rax, QWORD PTR -200[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -168[rbp], rax
	cmp	QWORD PTR -168[rbp], 0
	jne	.L23
	mov	rax, QWORD PTR -200[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	mov	rax, QWORD PTR -112[rbp]
	mov	rsi, rax
	mov	rdx, QWORD PTR trx[rip]
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	eax, eax
	lea	rdi, [rdx+rax]
	mov	rax, QWORD PTR -168[rbp]
	mov	rcx, rax
	mov	edx, 1
	call	fread@PLT
	cmp	rax, 1
	je	.L24
	mov	rax, QWORD PTR -200[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L24:
	mov	rax, QWORD PTR -168[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, DWORD PTR trx_count[rip]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 4
	lea	rdx, names[rip]
	lea	rcx, [rax+rdx]
	mov	rax, QWORD PTR -200[rbp]
	mov	edx, 79
	mov	rsi, rax
	mov	rdi, rcx
	call	strncpy@PLT
	mov	rcx, QWORD PTR trx[rip]
	mov	rdx, QWORD PTR trx[rip]
	mov	eax, DWORD PTR trx_count[rip]
	lea	esi, 1[rax]
	mov	DWORD PTR trx_count[rip], esi
	mov	ecx, DWORD PTR 4[rcx]
	cdqe
	add	rax, 4
	mov	DWORD PTR [rdx+rax*4], ecx
	mov	rax, QWORD PTR trx[rip]
	mov	edx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR -184[rbp]
	mov	ecx, eax
	mov	rax, QWORD PTR trx[rip]
	add	edx, ecx
	mov	DWORD PTR 4[rax], edx
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	load_image, .-load_image
	.section	.rodata
.LC7:
	.string	"Illegal numeric string\n"
	.align 8
.LC8:
	.string	"Cannot align if an output has already been written.\n"
	.align 8
.LC9:
	.string	"Total size %u (%.1f KB) is too big. Maximum is %lu (%.1f KB).\n"
	.text
	.globl	align_trx
	.type	align_trx, @function
align_trx:
.LFB12:
	.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	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 0
	lea	rcx, -24[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	strtoul@PLT
	mov	QWORD PTR -16[rbp], rax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L27
	mov	rax, QWORD PTR -24[rbp]
	cmp	QWORD PTR -40[rbp], rax
	je	.L27
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L28
.L27:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	call	help
.L28:
	mov	eax, DWORD PTR trx_final[rip]
	test	eax, eax
	je	.L29
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 52
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L29:
	mov	rax, QWORD PTR trx[rip]
	mov	edx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR -16[rbp]
	add	eax, edx
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -16[rbp]
	neg	eax
	and	eax, edx
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 33161216
	jbe	.L30
	mov	eax, DWORD PTR -28[rbp]
	test	rax, rax
	js	.L31
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	jmp	.L32
.L31:
	mov	rdx, rax
	shr	rdx
	and	eax, 1
	or	rdx, rax
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rdx
	addsd	xmm0, xmm0
.L32:
	movsd	xmm1, QWORD PTR .LC3[rip]
	divsd	xmm0, xmm1
	movq	rsi, xmm0
	mov	rax, QWORD PTR stderr[rip]
	movsd	xmm0, QWORD PTR .LC4[rip]
	mov	edx, DWORD PTR -28[rbp]
	movapd	xmm1, xmm0
	mov	ecx, 33161216
	movq	xmm0, rsi
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 2
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L30:
	mov	rax, QWORD PTR trx[rip]
	mov	edx, DWORD PTR -28[rbp]
	mov	DWORD PTR 4[rax], edx
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	align_trx, .-align_trx
	.section	.rodata
	.align 8
.LC10:
	.string	"Cannot change trx version after images have already been loaded.\n"
	.align 8
.LC11:
	.string	"TRX version %d is not supported.\n"
	.text
	.globl	set_trx_version
	.type	set_trx_version, @function
set_trx_version:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 0
	lea	rcx, -16[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	strtoul@PLT
	mov	DWORD PTR -20[rbp], eax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L35
	mov	rax, QWORD PTR -16[rbp]
	cmp	QWORD PTR -40[rbp], rax
	je	.L35
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L36
.L35:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	call	help
.L36:
	mov	eax, DWORD PTR trx_count[rip]
	test	eax, eax
	jle	.L37
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 65
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L37:
	cmp	DWORD PTR -20[rbp], 0
	jle	.L38
	cmp	DWORD PTR -20[rbp], 2
	jle	.L39
.L38:
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -20[rbp]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L39:
	mov	eax, DWORD PTR -20[rbp]
	mov	BYTE PTR trx_version[rip], al
	movzx	eax, BYTE PTR trx_version[rip]
	movsx	eax, al
	cmp	eax, 2
	jne	.L40
	mov	DWORD PTR trx_max_offset[rip], 4
	jmp	.L41
.L40:
	mov	DWORD PTR trx_max_offset[rip], 3
	nop
.L41:
	call	trx_header_size@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR trx[rip]
	mov	DWORD PTR 4[rax], edx
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	set_trx_version, .-set_trx_version
	.section	.rodata
.LC12:
	.string	"No image was loaded.\n"
	.text
	.globl	finalize_trx
	.type	finalize_trx, @function
finalize_trx:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -24
	mov	eax, DWORD PTR trx_count[rip]
	test	eax, eax
	jne	.L44
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 21
	mov	esi, 1
	lea	rdi, .LC12[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L44:
	mov	eax, DWORD PTR trx_final[rip]
	test	eax, eax
	je	.L45
	mov	rax, QWORD PTR trx[rip]
	mov	edx, DWORD PTR trx_magic[rip]
	mov	DWORD PTR [rax], edx
	jmp	.L43
.L45:
	mov	DWORD PTR trx_final[rip], 1
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	lea	edx, 4095[rax]
	mov	rax, QWORD PTR trx[rip]
	and	edx, -4096
	mov	DWORD PTR 4[rax], edx
	mov	rax, QWORD PTR trx[rip]
	mov	edx, DWORD PTR trx_magic[rip]
	mov	DWORD PTR [rax], edx
	movzx	eax, BYTE PTR trx_version[rip]
	movsx	eax, al
	sal	eax, 16
	mov	edx, eax
	mov	rax, QWORD PTR trx[rip]
	mov	DWORD PTR 12[rax], edx
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	sub	eax, 12
	mov	edx, eax
	mov	rax, QWORD PTR trx[rip]
	add	rax, 12
	mov	rbx, QWORD PTR trx[rip]
	mov	rsi, rax
	mov	edi, -1
	call	crc_calc
	mov	DWORD PTR 8[rbx], eax
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	sub	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR trx_padding[rip], eax
.L43:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	finalize_trx, .-finalize_trx
	.section	.rodata
.LC13:
	.string	"Creating TRX: %s\n"
.LC14:
	.string	"w"
	.text
	.globl	create_trx
	.type	create_trx, @function
create_trx:
.LFB15:
	.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
	call	finalize_trx
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L48
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, eax
	mov	rax, QWORD PTR trx[rip]
	mov	rdx, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	cmp	rax, 1
	je	.L49
.L48:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L49:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	create_trx, .-create_trx
	.section	.rodata
	.align 8
.LC15:
	.string	"Linksys signature must be 4 characters. \"%s\" is invalid.\n"
.LC16:
	.string	"Creating Linksys %s: %s\n"
	.text
	.globl	create_cytan
	.type	create_cytan, @function
create_cytan:
.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, 1072
	mov	QWORD PTR -1064[rbp], rdi
	mov	QWORD PTR -1072[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -1072[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 4
	je	.L51
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -1072[rbp]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L51:
	call	finalize_trx
	mov	rdx, QWORD PTR -1064[rbp]
	mov	rax, QWORD PTR -1072[rbp]
	mov	rsi, rax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -1040[rbp]
	mov	edx, 32
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rax, QWORD PTR -1072[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -1040[rbp], eax
	mov	DWORD PTR -1026[rbp], 1145975381
	mov	BYTE PTR -1029[rbp], 4
	mov	BYTE PTR -1028[rbp], 20
	mov	BYTE PTR -1027[rbp], 6
	mov	WORD PTR -1020[rbp], 255
	lea	rdi, max_time[rip]
	call	localtime@PLT
	mov	QWORD PTR -1056[rbp], rax
	mov	rax, QWORD PTR -1056[rbp]
	mov	eax, DWORD PTR 20[rax]
	sub	eax, 100
	mov	BYTE PTR -1032[rbp], al
	mov	rax, QWORD PTR -1056[rbp]
	mov	eax, DWORD PTR 16[rax]
	add	eax, 1
	mov	BYTE PTR -1031[rbp], al
	mov	rax, QWORD PTR -1056[rbp]
	mov	eax, DWORD PTR 12[rax]
	mov	BYTE PTR -1030[rbp], al
	lea	rax, -1008[rbp]
	mov	edx, 992
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rax, QWORD PTR -1064[rbp]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -1048[rbp], rax
	cmp	QWORD PTR -1048[rbp], 0
	je	.L52
	mov	rdx, QWORD PTR -1048[rbp]
	lea	rax, -1040[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 32
	mov	rdi, rax
	call	fwrite@PLT
	cmp	rax, 1
	jne	.L52
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, eax
	mov	rax, QWORD PTR trx[rip]
	mov	rdx, QWORD PTR -1048[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	cmp	rax, 1
	jne	.L52
	mov	rdx, QWORD PTR -1048[rbp]
	lea	rax, -1008[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 992
	mov	rdi, rax
	call	fwrite@PLT
	cmp	rax, 1
	je	.L53
.L52:
	mov	rax, QWORD PTR -1064[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L53:
	mov	rax, QWORD PTR -1048[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	create_cytan, .-create_cytan
	.section	.rodata
.LC17:
	.string	"Creating Motorola 0x%08X: %s\n"
	.text
	.globl	create_moto
	.type	create_moto, @function
create_moto:
.LFB17:
	.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	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rcx, -32[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	strtoul@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L56
	call	help
.L56:
	call	finalize_trx
	mov	eax, DWORD PTR -12[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	esi, eax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	htonl@PLT
	mov	DWORD PTR -12[rbp], eax
	lea	rax, -16[rbp]
	add	rax, 4
	mov	edx, 4
	mov	rsi, rax
	mov	edi, -1
	call	crc_calc
	mov	DWORD PTR -16[rbp], eax
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, eax
	mov	rcx, QWORD PTR trx[rip]
	mov	eax, DWORD PTR -16[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	crc_calc
	mov	edi, eax
	call	htonl@PLT
	mov	DWORD PTR -16[rbp], eax
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	je	.L57
	mov	rdx, QWORD PTR -24[rbp]
	lea	rax, -16[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 8
	mov	rdi, rax
	call	fwrite@PLT
	cmp	rax, 1
	jne	.L57
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, eax
	mov	rax, QWORD PTR trx[rip]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	cmp	rax, 1
	je	.L58
.L57:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L58:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L59
	call	__stack_chk_fail@PLT
.L59:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	create_moto, .-create_moto
	.section	.rodata
.LC18:
	.string	","
.LC19:
	.string	"%d.%d.%d.%d"
	.align 8
.LC20:
	.string	"Creating Asus %s firmware to %s\n"
	.text
	.globl	create_asus
	.type	create_asus, @function
create_asus:
.LFB18:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 504
	.cfi_offset 3, -24
	mov	QWORD PTR -504[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rax, -416[rbp]
	mov	edx, 64
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rcx, QWORD PTR -504[rbp]
	lea	rax, -352[rbp]
	mov	edx, 320
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	lea	rax, -352[rbp]
	mov	QWORD PTR -464[rbp], rax
	lea	rax, -464[rbp]
	lea	rsi, .LC18[rip]
	mov	rdi, rax
	call	strsep@PLT
	mov	QWORD PTR -456[rbp], rax
	cmp	QWORD PTR -456[rbp], 0
	jne	.L61
	mov	eax, 0
	jmp	.L67
.L61:
	mov	rax, QWORD PTR -456[rbp]
	lea	rdx, -416[rbp]
	lea	rcx, 4[rdx]
	mov	edx, 12
	mov	rsi, rax
	mov	rdi, rcx
	call	strncpy@PLT
	lea	rax, -464[rbp]
	lea	rsi, .LC18[rip]
	mov	rdi, rax
	call	strsep@PLT
	mov	QWORD PTR -448[rbp], rax
	cmp	QWORD PTR -448[rbp], 0
	jne	.L63
	mov	eax, 0
	jmp	.L67
.L63:
	lea	rdi, -472[rbp]
	lea	rsi, -476[rbp]
	lea	rcx, -480[rbp]
	lea	rdx, -484[rbp]
	mov	rax, QWORD PTR -448[rbp]
	mov	r9, rdi
	mov	r8, rsi
	lea	rsi, .LC19[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	mov	eax, DWORD PTR -484[rbp]
	mov	BYTE PTR -416[rbp], al
	mov	eax, DWORD PTR -480[rbp]
	mov	BYTE PTR -415[rbp], al
	mov	eax, DWORD PTR -476[rbp]
	mov	BYTE PTR -414[rbp], al
	mov	eax, DWORD PTR -472[rbp]
	mov	BYTE PTR -413[rbp], al
	lea	rax, -464[rbp]
	lea	rsi, .LC18[rip]
	mov	rdi, rax
	call	strsep@PLT
	mov	QWORD PTR -440[rbp], rax
	cmp	QWORD PTR -440[rbp], 0
	jne	.L64
	mov	eax, 0
	jmp	.L67
.L64:
	mov	rax, QWORD PTR trx[rip]
	mov	edx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR trx[rip]
	add	edx, 64
	mov	DWORD PTR 4[rax], edx
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR -468[rbp], eax
	mov	eax, DWORD PTR -468[rbp]
	lea	edx, 4095[rax]
	mov	rax, QWORD PTR trx[rip]
	and	edx, -4096
	mov	DWORD PTR 4[rax], edx
	mov	rdx, QWORD PTR trx[rip]
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	eax, eax
	sub	rax, 64
	add	rax, rdx
	mov	QWORD PTR -432[rbp], rax
	mov	rax, QWORD PTR -432[rbp]
	mov	rcx, QWORD PTR -416[rbp]
	mov	rbx, QWORD PTR -408[rbp]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR -400[rbp]
	mov	rbx, QWORD PTR -392[rbp]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rcx, QWORD PTR -384[rbp]
	mov	rbx, QWORD PTR -376[rbp]
	mov	QWORD PTR 32[rax], rcx
	mov	QWORD PTR 40[rax], rbx
	mov	rcx, QWORD PTR -368[rbp]
	mov	rbx, QWORD PTR -360[rbp]
	mov	QWORD PTR 48[rax], rcx
	mov	QWORD PTR 56[rax], rbx
	call	finalize_trx
	mov	rax, QWORD PTR -440[rbp]
	lea	rdx, -416[rbp]
	lea	rcx, 4[rdx]
	mov	rdx, rax
	mov	rsi, rcx
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -440[rbp]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -424[rbp], rax
	cmp	QWORD PTR -424[rbp], 0
	je	.L65
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, eax
	mov	rax, QWORD PTR trx[rip]
	mov	rdx, QWORD PTR -424[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	cmp	rax, 1
	je	.L66
.L65:
	mov	rax, QWORD PTR -440[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L66:
	mov	rax, QWORD PTR -424[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 1
.L67:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L68
	call	__stack_chk_fail@PLT
.L68:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE18:
	.size	create_asus, .-create_asus
	.section	.rodata
.LC21:
	.string	"Not enough memory\n"
.LC22:
	.string	"v:i:a:t:l:m:b:r:"
.LC23:
	.string	"\nTRX Image:"
	.align 8
.LC24:
	.string	" Total Size .... : %u (%.1f KB) (%.1f MB)\n"
	.align 8
.LC25:
	.string	"   Images ...... : %u (0x%08x)\n"
.LC26:
	.string	"   Padding ..... : %d\n"
.LC27:
	.string	" Avail. for jffs :"
	.align 8
.LC28:
	.string	"   4MB, 128K CFE : %d EBs + %d\n"
	.align 8
.LC29:
	.string	"   4MB, 256K CFE : %d EBs + %d\n"
	.align 8
.LC30:
	.string	"   8MB, 256K CFE : %d EBs + %d\n"
	.align 8
.LC31:
	.string	"            Note : Netgear routers have 6 EBs less available!"
.LC32:
	.string	" CRC-32 ........ : %8X\n"
	.align 8
.LC33:
	.string	" 128K Blocks ... : %u (0x%08X)\n"
	.align 8
.LC34:
	.string	"  64K Blocks ... : %u (0x%08X)\n"
.LC35:
	.string	" Offsets:"
.LC36:
	.string	"   %d: 0x%08X  %s\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB19:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 328
	.cfi_offset 3, -24
	mov	DWORD PTR -324[rbp], edi
	mov	QWORD PTR -336[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	edi, 10
	call	putchar@PLT
	call	crc_init
	test	eax, eax
	je	.L70
	mov	esi, 33161216
	mov	edi, 1
	call	calloc@PLT
	mov	QWORD PTR trx[rip], rax
	mov	rax, QWORD PTR trx[rip]
	test	rax, rax
	jne	.L71
.L70:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 18
	mov	esi, 1
	lea	rdi, .LC21[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L71:
	call	trx_header_size@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR trx[rip]
	mov	DWORD PTR 4[rax], edx
	mov	DWORD PTR trx_magic[rip], 810697800
	jmp	.L72
.L90:
	mov	eax, DWORD PTR -316[rbp]
	sub	eax, 97
	cmp	eax, 21
	ja	.L73
	mov	eax, eax
	lea	rdx, 0[0+rax*4]
	lea	rax, .L75[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	lea	rdx, .L75[rip]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L75:
	.long	.L81-.L75
	.long	.L80-.L75
	.long	.L73-.L75
	.long	.L73-.L75
	.long	.L73-.L75
	.long	.L73-.L75
	.long	.L73-.L75
	.long	.L73-.L75
	.long	.L79-.L75
	.long	.L73-.L75
	.long	.L73-.L75
	.long	.L78-.L75
	.long	.L78-.L75
	.long	.L73-.L75
	.long	.L73-.L75
	.long	.L73-.L75
	.long	.L73-.L75
	.long	.L77-.L75
	.long	.L73-.L75
	.long	.L76-.L75
	.long	.L73-.L75
	.long	.L74-.L75
	.text
.L74:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	set_trx_version
	jmp	.L72
.L79:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	load_image
	jmp	.L72
.L81:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	align_trx
	jmp	.L72
.L80:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 255
	jbe	.L82
	call	help
.L82:
	mov	rdx, QWORD PTR optarg[rip]
	lea	rax, -288[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	lea	rax, -288[rbp]
	mov	esi, 44
	mov	rdi, rax
	call	strchr@PLT
	mov	QWORD PTR -296[rbp], rax
	cmp	QWORD PTR -296[rbp], 0
	jne	.L83
	call	help
.L83:
	mov	rax, QWORD PTR -296[rbp]
	mov	BYTE PTR [rax], 0
	add	QWORD PTR -296[rbp], 1
	lea	rcx, -304[rbp]
	lea	rax, -288[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	strtoul@PLT
	mov	DWORD PTR trx_magic[rip], eax
	mov	rax, QWORD PTR -304[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L84
	call	help
.L84:
	mov	rax, QWORD PTR -296[rbp]
	mov	rdi, rax
	call	create_trx
	mov	DWORD PTR trx_magic[rip], 810697800
	jmp	.L72
.L76:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	create_trx
	jmp	.L72
.L78:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 255
	jbe	.L85
	call	help
.L85:
	mov	rdx, QWORD PTR optarg[rip]
	lea	rax, -288[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	lea	rax, -288[rbp]
	mov	esi, 44
	mov	rdi, rax
	call	strchr@PLT
	mov	QWORD PTR -296[rbp], rax
	cmp	QWORD PTR -296[rbp], 0
	jne	.L86
	call	help
.L86:
	mov	rax, QWORD PTR -296[rbp]
	mov	BYTE PTR [rax], 0
	add	QWORD PTR -296[rbp], 1
	cmp	DWORD PTR -316[rbp], 108
	jne	.L87
	lea	rdx, -288[rbp]
	mov	rax, QWORD PTR -296[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	create_cytan
	jmp	.L72
.L87:
	lea	rdx, -288[rbp]
	mov	rax, QWORD PTR -296[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	create_moto
	jmp	.L72
.L77:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	create_asus
	jmp	.L72
.L73:
	call	help
	mov	eax, 1
	jmp	.L105
.L72:
	mov	rcx, QWORD PTR -336[rbp]
	mov	eax, DWORD PTR -324[rbp]
	lea	rdx, .LC22[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR -316[rbp], eax
	cmp	DWORD PTR -316[rbp], -1
	jne	.L90
	mov	DWORD PTR trx_magic[rip], 810697800
	mov	eax, DWORD PTR trx_count[rip]
	test	eax, eax
	jne	.L91
	call	help
	jmp	.L92
.L91:
	call	finalize_trx
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, DWORD PTR trx_padding[rip]
	sub	eax, edx
	mov	ebx, eax
	call	trx_header_size@PLT
	mov	edx, eax
	mov	eax, ebx
	sub	eax, edx
	mov	DWORD PTR -308[rbp], eax
	lea	rdi, .LC23[rip]
	call	puts@PLT
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	eax, eax
	test	rax, rax
	js	.L93
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	jmp	.L94
.L93:
	mov	rdx, rax
	shr	rdx
	and	eax, 1
	or	rdx, rax
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rdx
	addsd	xmm0, xmm0
.L94:
	movsd	xmm1, QWORD PTR .LC3[rip]
	divsd	xmm0, xmm1
	movsd	xmm1, QWORD PTR .LC3[rip]
	movapd	xmm2, xmm0
	divsd	xmm2, xmm1
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	eax, eax
	test	rax, rax
	js	.L95
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	jmp	.L96
.L95:
	mov	rdx, rax
	shr	rdx
	and	eax, 1
	or	rdx, rax
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rdx
	addsd	xmm0, xmm0
.L96:
	movsd	xmm1, QWORD PTR .LC3[rip]
	divsd	xmm0, xmm1
	movq	rdx, xmm0
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	movapd	xmm1, xmm2
	movq	xmm0, rdx
	mov	esi, eax
	lea	rdi, .LC24[rip]
	mov	eax, 2
	call	printf@PLT
	mov	edx, DWORD PTR -308[rbp]
	mov	eax, DWORD PTR -308[rbp]
	mov	esi, eax
	lea	rdi, .LC25[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR trx_padding[rip]
	mov	esi, eax
	lea	rdi, .LC26[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC27[rip]
	call	puts@PLT
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR -308[rbp], eax
	cmp	DWORD PTR -308[rbp], 3997695
	ja	.L97
	mov	eax, 3997696
	sub	eax, DWORD PTR -308[rbp]
	mov	DWORD PTR -312[rbp], eax
	jmp	.L98
.L97:
	mov	DWORD PTR -312[rbp], 0
.L98:
	mov	eax, DWORD PTR -312[rbp]
	movzx	eax, ax
	mov	edx, DWORD PTR -312[rbp]
	mov	ecx, edx
	shr	ecx, 16
	mov	edx, eax
	mov	esi, ecx
	lea	rdi, .LC28[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -308[rbp], 3866623
	ja	.L99
	mov	eax, 3866624
	sub	eax, DWORD PTR -308[rbp]
	mov	DWORD PTR -312[rbp], eax
	jmp	.L100
.L99:
	mov	DWORD PTR -312[rbp], 0
.L100:
	mov	eax, DWORD PTR -312[rbp]
	movzx	eax, ax
	mov	edx, DWORD PTR -312[rbp]
	mov	ecx, edx
	shr	ecx, 16
	mov	edx, eax
	mov	esi, ecx
	lea	rdi, .LC29[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -308[rbp], 8060927
	ja	.L101
	mov	eax, 8060928
	sub	eax, DWORD PTR -308[rbp]
	mov	DWORD PTR -312[rbp], eax
	jmp	.L102
.L101:
	mov	DWORD PTR -312[rbp], 0
.L102:
	mov	eax, DWORD PTR -312[rbp]
	movzx	eax, ax
	mov	edx, DWORD PTR -312[rbp]
	mov	ecx, edx
	shr	ecx, 16
	mov	edx, eax
	mov	esi, ecx
	lea	rdi, .LC30[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC31[rip]
	call	puts@PLT
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 8[rax]
	mov	esi, eax
	lea	rdi, .LC32[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	add	eax, 131071
	shr	eax, 17
	mov	DWORD PTR -308[rbp], eax
	mov	edx, DWORD PTR -308[rbp]
	mov	eax, DWORD PTR -308[rbp]
	mov	esi, eax
	lea	rdi, .LC33[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR trx[rip]
	mov	eax, DWORD PTR 4[rax]
	add	eax, 65535
	shr	eax, 16
	mov	DWORD PTR -308[rbp], eax
	mov	edx, DWORD PTR -308[rbp]
	mov	eax, DWORD PTR -308[rbp]
	mov	esi, eax
	lea	rdi, .LC34[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC35[rip]
	call	puts@PLT
	mov	DWORD PTR -316[rbp], 0
	jmp	.L103
.L104:
	mov	eax, DWORD PTR -316[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 4
	lea	rdx, names[rip]
	lea	rcx, [rax+rdx]
	mov	rax, QWORD PTR trx[rip]
	mov	edx, DWORD PTR -316[rbp]
	movsx	rdx, edx
	add	rdx, 4
	mov	edx, DWORD PTR [rax+rdx*4]
	mov	eax, DWORD PTR -316[rbp]
	mov	esi, eax
	lea	rdi, .LC36[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -316[rbp], 1
.L103:
	mov	eax, DWORD PTR trx_max_offset[rip]
	cmp	DWORD PTR -316[rbp], eax
	jl	.L104
.L92:
	mov	edi, 10
	call	putchar@PLT
	mov	eax, 0
.L105:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L106
	call	__stack_chk_fail@PLT
.L106:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE19:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC3:
	.long	0
	.long	1083179008
	.align 8
.LC4:
	.long	0
	.long	1088397312
	.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	"578849.c"
	.text
	.comm	names,320,4
	.global	trx_version
	.data
	.type	trx_version, %object
	.size	trx_version, 1
trx_version:
	.byte	1
	.global	trx_max_offset
	.align	2
	.type	trx_max_offset, %object
	.size	trx_max_offset, 4
trx_max_offset:
	.word	3
	.global	trx_magic
	.align	2
	.type	trx_magic, %object
	.size	trx_magic, 4
trx_magic:
	.word	810697800
	.global	crc_table
	.bss
	.align	2
	.type	crc_table, %object
	.size	crc_table, 4
crc_table:
	.space	4
	.global	trx
	.align	2
	.type	trx, %object
	.size	trx, 4
trx:
	.space	4
	.global	trx_count
	.align	2
	.type	trx_count, %object
	.size	trx_count, 4
trx_count:
	.space	4
	.global	trx_final
	.align	2
	.type	trx_final, %object
	.size	trx_final, 4
trx_final:
	.space	4
	.comm	trx_padding,4,4
	.global	max_time
	.align	2
	.type	max_time, %object
	.size	max_time, 4
max_time:
	.space	4
	.text
	.align	2
	.global	crc_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	crc_init, %function
crc_init:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L11
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L2
	mov	r0, #1024
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L11
	str	r2, [r3]
	ldr	r3, .L11
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L3
	mov	r3, #0
	b	.L4
.L3:
	mov	r3, #255
	str	r3, [fp, #-12]
	b	.L5
.L10:
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-16]
	mov	r3, #8
	str	r3, [fp, #-8]
	b	.L6
.L9:
	ldr	r3, [fp, #-16]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L7
	ldr	r3, [fp, #-16]
	lsr	r2, r3, #1
	ldr	r3, .L11+4
	eor	r3, r3, r2
	str	r3, [fp, #-16]
	b	.L8
.L7:
	ldr	r3, [fp, #-16]
	lsr	r3, r3, #1
	str	r3, [fp, #-16]
.L8:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
.L6:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bgt	.L9
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
.L5:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L10
.L2:
	mov	r3, #1
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	crc_table
	.word	-306674912
	.size	crc_init, .-crc_init
	.align	2
	.global	crc_done
	.syntax unified
	.arm
	.fpu softvfp
	.type	crc_done, %function
crc_done:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L14
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L14
	mov	r2, #0
	str	r2, [r3]
	nop
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	crc_table
	.size	crc_done, .-crc_done
	.align	2
	.global	crc_calc
	.syntax unified
	.arm
	.fpu softvfp
	.type	crc_calc, %function
crc_calc:
	@ 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, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	b	.L17
.L18:
	ldr	r3, .L20
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r3, [fp, #-8]
	eor	r3, r3, r1
	and	r3, r3, #255
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsr	r3, r3, #8
	eor	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L17:
	ldr	r3, [fp, #-16]
	sub	r2, r3, #1
	str	r2, [fp, #-16]
	cmp	r3, #0
	bgt	.L18
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L21:
	.align	2
.L20:
	.word	crc_table
	.size	crc_calc, .-crc_calc
	.section	.rodata
	.align	2
.LC0:
	.ascii	"fpkg - Package a firmware\012Copyright (C) 2007 Jon"
	.ascii	"athan Zarate\012\012Usage: [-v <trx version>] -i <i"
	.ascii	"nput> [-a <align>] [-i <input>] [-a <align>] {outpu"
	.ascii	"t}\012Output:\012 TRX:            -t <output file>\012"
	.ascii	" Linksys/Cisco:  -l <id>,<output file>\012   W54G W"
	.ascii	"RT54G / WRT54GL\012   W54U WRTSL54GS\012   W54S WRT"
	.ascii	"S54GS\012   W54s WRT54GS v4\012   N160 WRT160N v3\012"
	.ascii	"   EWCB WRT300N v1\012   310N WRT310N v1/v2\012   3"
	.ascii	"20N WRT320N\012   610N WRT610N v2\012   32XN E2000\012"
	.ascii	"   61XN E3000\012   4200 E4200\012 Motorola:       "
	.ascii	"-m <id>,<output file>\012   0x10577000 WE800\012   "
	.ascii	"0x10577040 WA840\012   0x10577050 WR850\012 Belkin:"
	.ascii	"         -b <id>,<output file>\012   0x20100322 F7D"
	.ascii	"3301 (Share Max)\012   0x20090928 F7D3302 (Share)\012"
	.ascii	"   0x20091006 F7D4302 (Play)\012   0x00017116 F5D82"
	.ascii	"35 v3\012   0x12345678 QA (QA firmware)\012 Asus:  "
	.ascii	"         -r <id>,<v1>,<v2>,<v3>,<v4>,<output file>\012"
	.ascii	"\012\000"
	.text
	.align	2
	.global	help
	.syntax unified
	.arm
	.fpu softvfp
	.type	help, %function
help:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L23
	ldr	r3, [r3]
	ldr	r2, .L23+4
	mov	r1, #1
	ldr	r0, .L23+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L24:
	.align	2
.L23:
	.word	stderr
	.word	791
	.word	.LC0
	.size	help, .-help
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Cannot load another image if an output has already "
	.ascii	"been written.\012\000"
	.align	2
.LC2:
	.ascii	"Too many input files.\012\000"
	.global	__aeabi_ui2d
	.global	__aeabi_ddiv
	.align	2
.LC3:
	.ascii	"Total size %lu (%.1f KB) is too big. Maximum is %lu"
	.ascii	" (%.1f KB).\012\000"
	.align	2
.LC4:
	.ascii	"r\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	load_image
	.syntax unified
	.arm
	.fpu softvfp
	.type	load_image, %function
load_image:
	@ args = 0, pretend = 0, frame = 120
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #144
	str	r0, [fp, #-128]
	ldr	r3, .L34
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, .L34+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L26
	ldr	r3, .L34+8
	ldr	r3, [r3]
	mov	r2, #65
	mov	r1, #1
	ldr	r0, .L34+12
	bl	fwrite
	mov	r0, #1
	bl	exit
.L26:
	ldr	r3, .L34+16
	ldr	r2, [r3]
	ldr	r3, .L34+20
	ldr	r3, [r3]
	cmp	r2, r3
	blt	.L27
	ldr	r3, .L34+8
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L34+24
	bl	fwrite
	mov	r0, #1
	bl	exit
.L27:
	sub	r3, fp, #108
	mov	r1, r3
	ldr	r0, [fp, #-128]
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	beq	.L28
	ldr	r0, [fp, #-128]
	bl	perror
	mov	r0, #1
	bl	exit
.L28:
	ldr	r2, [fp, #-36]
	ldr	r3, .L34+28
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L29
	ldr	r3, [fp, #-36]
	ldr	r2, .L34+28
	str	r3, [r2]
.L29:
	ldr	r3, [fp, #-64]
	add	r3, r3, #3
	bic	r3, r3, #3
	str	r3, [fp, #-120]
	ldr	r3, .L34+32
	ldr	r3, [r3]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-120]
	add	r3, r2, r3
	ldr	r2, .L34+36
	cmp	r3, r2
	bls	.L30
	ldr	r3, .L34+8
	ldr	r4, [r3]
	ldr	r3, .L34+32
	ldr	r3, [r3]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-120]
	add	r5, r2, r3
	ldr	r3, .L34+32
	ldr	r3, [r3]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-120]
	add	r3, r2, r3
	mov	r0, r3
	bl	__aeabi_ui2d
	mov	r2, #0
	ldr	r3, .L34+40
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	mov	r2, #0
	ldr	r3, .L34+44
	str	r2, [sp, #16]
	str	r3, [sp, #20]
	ldr	r3, .L34+36
	str	r3, [sp, #8]
	stm	sp, {r0-r1}
	mov	r2, r5
	ldr	r1, .L34+48
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L30:
	ldr	r3, .L34+32
	ldr	r2, [r3]
	ldr	r3, .L34+32
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	add	r3, r2, r3
	str	r3, [fp, #-116]
	ldr	r1, .L34+52
	ldr	r0, [fp, #-128]
	bl	fopen
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	bne	.L31
	ldr	r0, [fp, #-128]
	bl	perror
	mov	r0, #1
	bl	exit
.L31:
	ldr	r3, .L34+32
	ldr	r2, [r3]
	ldr	r3, .L34+32
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	add	r0, r2, r3
	ldr	r3, [fp, #-64]
	mov	r1, r3
	ldr	r3, [fp, #-112]
	mov	r2, #1
	bl	fread
	mov	r3, r0
	cmp	r3, #1
	beq	.L32
	ldr	r0, [fp, #-128]
	bl	perror
	mov	r0, #1
	bl	exit
.L32:
	ldr	r0, [fp, #-112]
	bl	fclose
	ldr	r3, .L34+16
	ldr	r2, [r3]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #4
	ldr	r2, .L34+56
	add	r3, r3, r2
	mov	r2, #79
	ldr	r1, [fp, #-128]
	mov	r0, r3
	bl	strncpy
	ldr	r3, .L34+32
	ldr	r1, [r3]
	ldr	r3, .L34+32
	ldr	r2, [r3]
	ldr	r3, .L34+16
	ldr	r3, [r3]
	add	r0, r3, #1
	ldr	ip, .L34+16
	str	r0, [ip]
	ldr	r1, [r1, #4]
	add	r3, r3, #4
	str	r1, [r2, r3, lsl #2]
	ldr	r3, .L34+32
	ldr	r3, [r3]
	ldr	r1, [r3, #4]
	ldr	r2, [fp, #-120]
	ldr	r3, .L34+32
	ldr	r3, [r3]
	add	r2, r1, r2
	str	r2, [r3, #4]
	nop
	ldr	r3, .L34
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L33
	bl	__stack_chk_fail
.L33:
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L35:
	.align	2
.L34:
	.word	.LC5
	.word	trx_final
	.word	stderr
	.word	.LC1
	.word	trx_count
	.word	trx_max_offset
	.word	.LC2
	.word	max_time
	.word	trx
	.word	33161216
	.word	1083179008
	.word	1088397312
	.word	.LC3
	.word	.LC4
	.word	names
	.size	load_image, .-load_image
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Illegal numeric string\012\000"
	.align	2
.LC7:
	.ascii	"Cannot align if an output has already been written."
	.ascii	"\012\000"
	.align	2
.LC8:
	.ascii	"Total size %u (%.1f KB) is too big. Maximum is %lu "
	.ascii	"(%.1f KB).\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	align_trx
	.syntax unified
	.arm
	.fpu softvfp
	.type	align_trx, %function
align_trx:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #52
	str	r0, [fp, #-32]
	ldr	r3, .L42
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	bl	__errno_location
	mov	r3, r0
	mov	r2, #0
	str	r2, [r3]
	sub	r3, fp, #28
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	strtoul
	str	r0, [fp, #-24]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L37
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	beq	.L37
	ldr	r3, [fp, #-28]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L38
.L37:
	ldr	r3, .L42+4
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L42+8
	bl	fwrite
	bl	help
.L38:
	ldr	r3, .L42+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L39
	ldr	r3, .L42+4
	ldr	r3, [r3]
	mov	r2, #52
	mov	r1, #1
	ldr	r0, .L42+16
	bl	fwrite
	mov	r0, #1
	bl	exit
.L39:
	ldr	r3, .L42+20
	ldr	r3, [r3]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-24]
	add	r3, r2, r3
	sub	r2, r3, #1
	ldr	r3, [fp, #-24]
	rsb	r3, r3, #0
	and	r3, r3, r2
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r2, .L42+24
	cmp	r3, r2
	bls	.L40
	ldr	r3, .L42+4
	ldr	r4, [r3]
	ldr	r0, [fp, #-20]
	bl	__aeabi_ui2d
	mov	r2, #0
	ldr	r3, .L42+28
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	mov	r2, #0
	ldr	r3, .L42+32
	str	r2, [sp, #16]
	str	r3, [sp, #20]
	ldr	r3, .L42+24
	str	r3, [sp, #8]
	stm	sp, {r0-r1}
	ldr	r2, [fp, #-20]
	ldr	r1, .L42+36
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L40:
	ldr	r3, .L42+20
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	str	r2, [r3, #4]
	nop
	ldr	r3, .L42
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L41
	bl	__stack_chk_fail
.L41:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L43:
	.align	2
.L42:
	.word	.LC9
	.word	stderr
	.word	.LC6
	.word	trx_final
	.word	.LC7
	.word	trx
	.word	33161216
	.word	1083179008
	.word	1088397312
	.word	.LC8
	.size	align_trx, .-align_trx
	.section	.rodata
	.align	2
.LC10:
	.ascii	"Cannot change trx version after images have already"
	.ascii	" been loaded.\012\000"
	.align	2
.LC11:
	.ascii	"TRX version %d is not supported.\012\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	set_trx_version
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_trx_version, %function
set_trx_version:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-32]
	ldr	r3, .L53
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	bl	__errno_location
	mov	r3, r0
	mov	r2, #0
	str	r2, [r3]
	sub	r3, fp, #24
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	strtoul
	mov	r3, r0
	str	r3, [fp, #-20]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L45
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	beq	.L45
	ldr	r3, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L46
.L45:
	ldr	r3, .L53+4
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L53+8
	bl	fwrite
	bl	help
.L46:
	ldr	r3, .L53+12
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L47
	ldr	r3, .L53+4
	ldr	r3, [r3]
	mov	r2, #65
	mov	r1, #1
	ldr	r0, .L53+16
	bl	fwrite
	mov	r0, #1
	bl	exit
.L47:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	ble	.L48
	ldr	r3, [fp, #-20]
	cmp	r3, #2
	ble	.L49
.L48:
	ldr	r3, .L53+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	ldr	r1, .L53+20
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L49:
	ldr	r3, [fp, #-20]
	and	r2, r3, #255
	ldr	r3, .L53+24
	strb	r2, [r3]
	ldr	r3, .L53+24
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #2
	bne	.L50
	ldr	r3, .L53+28
	mov	r2, #4
	str	r2, [r3]
	b	.L51
.L50:
	ldr	r3, .L53+28
	mov	r2, #3
	str	r2, [r3]
	nop
.L51:
	ldr	r3, .L53+32
	ldr	r4, [r3]
	bl	trx_header_size
	mov	r3, r0
	str	r3, [r4, #4]
	nop
	ldr	r3, .L53
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L52
	bl	__stack_chk_fail
.L52:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L54:
	.align	2
.L53:
	.word	.LC12
	.word	stderr
	.word	.LC6
	.word	trx_count
	.word	.LC10
	.word	.LC11
	.word	trx_version
	.word	trx_max_offset
	.word	trx
	.size	set_trx_version, .-set_trx_version
	.section	.rodata
	.align	2
.LC13:
	.ascii	"No image was loaded.\012\000"
	.text
	.align	2
	.global	finalize_trx
	.syntax unified
	.arm
	.fpu softvfp
	.type	finalize_trx, %function
finalize_trx:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	ldr	r3, .L59
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L56
	ldr	r3, .L59+4
	ldr	r3, [r3]
	mov	r2, #21
	mov	r1, #1
	ldr	r0, .L59+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L56:
	ldr	r3, .L59+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L57
	ldr	r3, .L59+16
	ldr	r3, [r3]
	ldr	r2, .L59+20
	ldr	r2, [r2]
	str	r2, [r3]
	b	.L55
.L57:
	ldr	r3, .L59+12
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, .L59+16
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	add	r3, r3, #4080
	add	r3, r3, #15
	ldr	r2, .L59+16
	ldr	r2, [r2]
	bic	r3, r3, #4080
	bic	r3, r3, #15
	str	r3, [r2, #4]
	ldr	r3, .L59+16
	ldr	r3, [r3]
	ldr	r2, .L59+20
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r3, .L59+24
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r2, r3, #16
	ldr	r3, .L59+16
	ldr	r3, [r3]
	str	r2, [r3, #12]
	ldr	r3, .L59+16
	ldr	r3, [r3]
	add	r1, r3, #12
	ldr	r3, .L59+16
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L59+16
	ldr	r4, [r3]
	mvn	r0, #0
	bl	crc_calc
	mov	r3, r0
	str	r3, [r4, #8]
	ldr	r3, .L59+16
	ldr	r3, [r3]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r3, .L59+28
	str	r2, [r3]
.L55:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L60:
	.align	2
.L59:
	.word	trx_count
	.word	stderr
	.word	.LC13
	.word	trx_final
	.word	trx
	.word	trx_magic
	.word	trx_version
	.word	trx_padding
	.size	finalize_trx, .-finalize_trx
	.section	.rodata
	.align	2
.LC14:
	.ascii	"Creating TRX: %s\012\000"
	.align	2
.LC15:
	.ascii	"w\000"
	.text
	.align	2
	.global	create_trx
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_trx, %function
create_trx:
	@ 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]
	bl	finalize_trx
	ldr	r1, [fp, #-16]
	ldr	r0, .L64
	bl	printf
	ldr	r1, .L64+4
	ldr	r0, [fp, #-16]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L62
	ldr	r3, .L64+8
	ldr	r0, [r3]
	ldr	r3, .L64+8
	ldr	r3, [r3]
	ldr	r1, [r3, #4]
	ldr	r3, [fp, #-8]
	mov	r2, #1
	bl	fwrite
	mov	r3, r0
	cmp	r3, #1
	beq	.L63
.L62:
	ldr	r0, [fp, #-16]
	bl	perror
	mov	r0, #1
	bl	exit
.L63:
	ldr	r0, [fp, #-8]
	bl	fclose
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L65:
	.align	2
.L64:
	.word	.LC14
	.word	.LC15
	.word	trx
	.size	create_trx, .-create_trx
	.section	.rodata
	.align	2
.LC16:
	.ascii	"Linksys signature must be 4 characters. \"%s\" is i"
	.ascii	"nvalid.\012\000"
	.align	2
.LC17:
	.ascii	"Creating Linksys %s: %s\012\000"
	.align	2
.LC18:
	.ascii	"U2ND\000"
	.align	2
.LC19:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	create_cytan
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_cytan, %function
create_cytan:
	@ args = 0, pretend = 0, frame = 1048
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	sub	sp, sp, #8
	str	r0, [fp, #-1048]
	str	r1, [fp, #-1052]
	ldr	r3, .L71
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, [fp, #-1052]
	bl	strlen
	mov	r3, r0
	cmp	r3, #4
	beq	.L67
	ldr	r3, .L71+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-1052]
	ldr	r1, .L71+8
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L67:
	bl	finalize_trx
	ldr	r2, [fp, #-1048]
	ldr	r1, [fp, #-1052]
	ldr	r0, .L71+12
	bl	printf
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r2, [fp, #-1052]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r2
	mov	r2, #4
	mov	r0, r3
	bl	memcpy
	ldr	r2, .L71+16
	sub	r3, fp, #1016
	sub	r3, r3, #2
	mov	r1, r2
	mov	r2, #4
	mov	r0, r3
	bl	memcpy
	mov	r3, #4
	strb	r3, [fp, #-1021]
	mov	r3, #20
	strb	r3, [fp, #-1020]
	mov	r3, #6
	strb	r3, [fp, #-1019]
	sub	r3, fp, #4
	sub	r3, r3, #1024
	sub	r3, r3, #4
	mov	r2, #255
	strh	r2, [r3, #20]	@ movhi
	ldr	r0, .L71+20
	bl	localtime
	str	r0, [fp, #-1040]
	ldr	r3, [fp, #-1040]
	ldr	r3, [r3, #20]
	and	r3, r3, #255
	sub	r3, r3, #100
	and	r3, r3, #255
	strb	r3, [fp, #-1024]
	ldr	r3, [fp, #-1040]
	ldr	r3, [r3, #16]
	and	r3, r3, #255
	add	r3, r3, #1
	and	r3, r3, #255
	strb	r3, [fp, #-1023]
	ldr	r3, [fp, #-1040]
	ldr	r3, [r3, #12]
	and	r3, r3, #255
	strb	r3, [fp, #-1022]
	sub	r3, fp, #1000
	mov	r2, #992
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r1, .L71+24
	ldr	r0, [fp, #-1048]
	bl	fopen
	str	r0, [fp, #-1036]
	ldr	r3, [fp, #-1036]
	cmp	r3, #0
	beq	.L68
	sub	r0, fp, #1024
	sub	r0, r0, #4
	sub	r0, r0, #4
	ldr	r3, [fp, #-1036]
	mov	r2, #1
	mov	r1, #32
	bl	fwrite
	mov	r3, r0
	cmp	r3, #1
	bne	.L68
	ldr	r3, .L71+28
	ldr	r0, [r3]
	ldr	r3, .L71+28
	ldr	r3, [r3]
	ldr	r1, [r3, #4]
	ldr	r3, [fp, #-1036]
	mov	r2, #1
	bl	fwrite
	mov	r3, r0
	cmp	r3, #1
	bne	.L68
	sub	r0, fp, #1000
	ldr	r3, [fp, #-1036]
	mov	r2, #1
	mov	r1, #992
	bl	fwrite
	mov	r3, r0
	cmp	r3, #1
	beq	.L69
.L68:
	ldr	r0, [fp, #-1048]
	bl	perror
	mov	r0, #1
	bl	exit
.L69:
	ldr	r0, [fp, #-1036]
	bl	fclose
	nop
	ldr	r3, .L71
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L70
	bl	__stack_chk_fail
.L70:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L72:
	.align	2
.L71:
	.word	.LC19
	.word	stderr
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	max_time
	.word	.LC15
	.word	trx
	.size	create_cytan, .-create_cytan
	.section	.rodata
	.align	2
.LC20:
	.ascii	"Creating Motorola 0x%08X: %s\012\000"
	.align	2
.LC21:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	create_moto
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_moto, %function
create_moto:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L78
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #24
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-36]
	bl	strtoul
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L74
	bl	help
.L74:
	bl	finalize_trx
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-32]
	mov	r1, r3
	ldr	r0, .L78+4
	bl	printf
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-12]
	sub	r3, fp, #16
	add	r3, r3, #4
	mov	r2, #4
	mov	r1, r3
	mvn	r0, #0
	bl	crc_calc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r0, [fp, #-16]
	ldr	r3, .L78+8
	ldr	r1, [r3]
	ldr	r3, .L78+8
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	mov	r2, r3
	bl	crc_calc
	mov	r3, r0
	mov	r0, r3
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r1, .L78+12
	ldr	r0, [fp, #-32]
	bl	fopen
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L75
	sub	r0, fp, #16
	ldr	r3, [fp, #-20]
	mov	r2, #1
	mov	r1, #8
	bl	fwrite
	mov	r3, r0
	cmp	r3, #1
	bne	.L75
	ldr	r3, .L78+8
	ldr	r0, [r3]
	ldr	r3, .L78+8
	ldr	r3, [r3]
	ldr	r1, [r3, #4]
	ldr	r3, [fp, #-20]
	mov	r2, #1
	bl	fwrite
	mov	r3, r0
	cmp	r3, #1
	beq	.L76
.L75:
	ldr	r0, [fp, #-32]
	bl	perror
	mov	r0, #1
	bl	exit
.L76:
	ldr	r0, [fp, #-20]
	bl	fclose
	nop
	ldr	r3, .L78
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L77
	bl	__stack_chk_fail
.L77:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L79:
	.align	2
.L78:
	.word	.LC21
	.word	.LC20
	.word	trx
	.word	.LC15
	.size	create_moto, .-create_moto
	.section	.rodata
	.align	2
.LC22:
	.ascii	",\000"
	.align	2
.LC23:
	.ascii	"%d.%d.%d.%d\000"
	.align	2
.LC24:
	.ascii	"Creating Asus %s firmware to %s\012\000"
	.align	2
.LC25:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	create_asus
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_asus, %function
create_asus:
	@ args = 0, pretend = 0, frame = 440
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #448
	str	r0, [fp, #-440]
	ldr	r3, .L89
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #392
	mov	r2, #64
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #328
	mov	r2, #320
	ldr	r1, [fp, #-440]
	mov	r0, r3
	bl	strncpy
	sub	r3, fp, #328
	str	r3, [fp, #-436]
	sub	r3, fp, #436
	ldr	r1, .L89+4
	mov	r0, r3
	bl	strsep
	str	r0, [fp, #-416]
	ldr	r3, [fp, #-416]
	cmp	r3, #0
	bne	.L81
	mov	r3, #0
	b	.L87
.L81:
	sub	r3, fp, #392
	add	r3, r3, #4
	mov	r2, #12
	ldr	r1, [fp, #-416]
	mov	r0, r3
	bl	strncpy
	sub	r3, fp, #436
	ldr	r1, .L89+4
	mov	r0, r3
	bl	strsep
	str	r0, [fp, #-412]
	ldr	r3, [fp, #-412]
	cmp	r3, #0
	bne	.L83
	mov	r3, #0
	b	.L87
.L83:
	sub	r1, fp, #428
	sub	r2, fp, #432
	sub	r3, fp, #420
	str	r3, [sp, #4]
	sub	r3, fp, #424
	str	r3, [sp]
	mov	r3, r1
	ldr	r1, .L89+8
	ldr	r0, [fp, #-412]
	bl	__isoc99_sscanf
	ldr	r3, [fp, #-432]
	and	r3, r3, #255
	strb	r3, [fp, #-392]
	ldr	r3, [fp, #-428]
	and	r3, r3, #255
	strb	r3, [fp, #-391]
	ldr	r3, [fp, #-424]
	and	r3, r3, #255
	strb	r3, [fp, #-390]
	ldr	r3, [fp, #-420]
	and	r3, r3, #255
	strb	r3, [fp, #-389]
	sub	r3, fp, #436
	ldr	r1, .L89+4
	mov	r0, r3
	bl	strsep
	str	r0, [fp, #-408]
	ldr	r3, [fp, #-408]
	cmp	r3, #0
	bne	.L84
	mov	r3, #0
	b	.L87
.L84:
	ldr	r3, .L89+12
	ldr	r3, [r3]
	ldr	r2, [r3, #4]
	ldr	r3, .L89+12
	ldr	r3, [r3]
	add	r2, r2, #64
	str	r2, [r3, #4]
	ldr	r3, .L89+12
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-404]
	ldr	r3, [fp, #-404]
	add	r3, r3, #4080
	add	r3, r3, #15
	ldr	r2, .L89+12
	ldr	r2, [r2]
	bic	r3, r3, #4080
	bic	r3, r3, #15
	str	r3, [r2, #4]
	ldr	r3, .L89+12
	ldr	r2, [r3]
	ldr	r3, .L89+12
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	sub	r3, r3, #64
	add	r3, r2, r3
	str	r3, [fp, #-400]
	ldr	r3, [fp, #-400]
	mov	r0, r3
	sub	r3, fp, #392
	mov	r2, #64
	mov	r1, r3
	bl	memcpy
	bl	finalize_trx
	sub	r3, fp, #392
	add	r3, r3, #4
	ldr	r2, [fp, #-408]
	mov	r1, r3
	ldr	r0, .L89+16
	bl	printf
	ldr	r1, .L89+20
	ldr	r0, [fp, #-408]
	bl	fopen
	str	r0, [fp, #-396]
	ldr	r3, [fp, #-396]
	cmp	r3, #0
	beq	.L85
	ldr	r3, .L89+12
	ldr	r0, [r3]
	ldr	r3, .L89+12
	ldr	r3, [r3]
	ldr	r1, [r3, #4]
	ldr	r3, [fp, #-396]
	mov	r2, #1
	bl	fwrite
	mov	r3, r0
	cmp	r3, #1
	beq	.L86
.L85:
	ldr	r0, [fp, #-408]
	bl	perror
	mov	r0, #1
	bl	exit
.L86:
	ldr	r0, [fp, #-396]
	bl	fclose
	mov	r3, #1
.L87:
	ldr	r2, .L89
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L88
	bl	__stack_chk_fail
.L88:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L90:
	.align	2
.L89:
	.word	.LC25
	.word	.LC22
	.word	.LC23
	.word	trx
	.word	.LC24
	.word	.LC15
	.size	create_asus, .-create_asus
	.section	.rodata
	.align	2
.LC26:
	.ascii	"Not enough memory\012\000"
	.align	2
.LC27:
	.ascii	"v:i:a:t:l:m:b:r:\000"
	.align	2
.LC28:
	.ascii	"\012TRX Image:\000"
	.align	2
.LC29:
	.ascii	" Total Size .... : %u (%.1f KB) (%.1f MB)\012\000"
	.align	2
.LC30:
	.ascii	"   Images ...... : %u (0x%08x)\012\000"
	.align	2
.LC31:
	.ascii	"   Padding ..... : %d\012\000"
	.align	2
.LC32:
	.ascii	" Avail. for jffs :\000"
	.align	2
.LC33:
	.ascii	"   4MB, 128K CFE : %d EBs + %d\012\000"
	.align	2
.LC34:
	.ascii	"   4MB, 256K CFE : %d EBs + %d\012\000"
	.align	2
.LC35:
	.ascii	"   8MB, 256K CFE : %d EBs + %d\012\000"
	.align	2
.LC36:
	.ascii	"            Note : Netgear routers have 6 EBs less "
	.ascii	"available!\000"
	.align	2
.LC37:
	.ascii	" CRC-32 ........ : %8X\012\000"
	.align	2
.LC38:
	.ascii	" 128K Blocks ... : %u (0x%08X)\012\000"
	.align	2
.LC39:
	.ascii	"  64K Blocks ... : %u (0x%08X)\012\000"
	.align	2
.LC40:
	.ascii	" Offsets:\000"
	.align	2
.LC41:
	.ascii	"   %d: 0x%08X  %s\012\000"
	.align	2
.LC42:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 288
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r6, r7, fp, lr}
	add	fp, sp, #16
	sub	sp, sp, #300
	str	r0, [fp, #-304]
	str	r1, [fp, #-308]
	ldr	r3, .L125
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	mov	r0, #10
	bl	putchar
	bl	crc_init
	mov	r3, r0
	cmp	r3, #0
	beq	.L92
	ldr	r1, .L125+4
	mov	r0, #1
	bl	calloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L125+8
	str	r2, [r3]
	ldr	r3, .L125+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L93
.L92:
	ldr	r3, .L125+12
	ldr	r3, [r3]
	mov	r2, #18
	mov	r1, #1
	ldr	r0, .L125+16
	bl	fwrite
	mov	r0, #1
	bl	exit
.L93:
	ldr	r3, .L125+8
	ldr	r4, [r3]
	bl	trx_header_size
	mov	r3, r0
	str	r3, [r4, #4]
	ldr	r3, .L125+20
	ldr	r2, .L125+24
	str	r2, [r3]
	b	.L94
.L112:
	ldr	r3, [fp, #-296]
	sub	r3, r3, #97
	cmp	r3, #21
	ldrls	pc, [pc, r3, asl #2]
	b	.L95
.L97:
	.word	.L103
	.word	.L102
	.word	.L95
	.word	.L95
	.word	.L95
	.word	.L95
	.word	.L95
	.word	.L95
	.word	.L101
	.word	.L95
	.word	.L95
	.word	.L100
	.word	.L100
	.word	.L95
	.word	.L95
	.word	.L95
	.word	.L95
	.word	.L99
	.word	.L95
	.word	.L98
	.word	.L95
	.word	.L96
.L96:
	ldr	r3, .L125+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	set_trx_version
	b	.L94
.L101:
	ldr	r3, .L125+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	load_image
	b	.L94
.L103:
	ldr	r3, .L125+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	align_trx
	b	.L94
.L102:
	ldr	r3, .L125+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r3, #255
	bls	.L104
	bl	help
.L104:
	ldr	r3, .L125+28
	ldr	r2, [r3]
	sub	r3, fp, #280
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	sub	r3, fp, #280
	mov	r1, #44
	mov	r0, r3
	bl	strchr
	str	r0, [fp, #-284]
	ldr	r3, [fp, #-284]
	cmp	r3, #0
	bne	.L105
	bl	help
.L105:
	ldr	r3, [fp, #-284]
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-284]
	add	r3, r3, #1
	str	r3, [fp, #-284]
	sub	r1, fp, #300
	sub	r3, fp, #280
	mov	r2, #0
	mov	r0, r3
	bl	strtoul
	mov	r3, r0
	ldr	r2, .L125+20
	str	r3, [r2]
	ldr	r3, [fp, #-300]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L106
	bl	help
.L106:
	ldr	r0, [fp, #-284]
	bl	create_trx
	ldr	r3, .L125+20
	ldr	r2, .L125+24
	str	r2, [r3]
	b	.L94
.L98:
	ldr	r3, .L125+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	create_trx
	b	.L94
.L100:
	ldr	r3, .L125+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r3, #255
	bls	.L107
	bl	help
.L107:
	ldr	r3, .L125+28
	ldr	r2, [r3]
	sub	r3, fp, #280
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	sub	r3, fp, #280
	mov	r1, #44
	mov	r0, r3
	bl	strchr
	str	r0, [fp, #-284]
	ldr	r3, [fp, #-284]
	cmp	r3, #0
	bne	.L108
	bl	help
.L108:
	ldr	r3, [fp, #-284]
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-284]
	add	r3, r3, #1
	str	r3, [fp, #-284]
	ldr	r3, [fp, #-296]
	cmp	r3, #108
	bne	.L109
	sub	r3, fp, #280
	mov	r1, r3
	ldr	r0, [fp, #-284]
	bl	create_cytan
	b	.L94
.L109:
	sub	r3, fp, #280
	mov	r1, r3
	ldr	r0, [fp, #-284]
	bl	create_moto
	b	.L94
.L99:
	ldr	r3, .L125+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	create_asus
	b	.L94
.L95:
	bl	help
	mov	r3, #1
	b	.L123
.L94:
	ldr	r2, .L125+32
	ldr	r1, [fp, #-308]
	ldr	r0, [fp, #-304]
	bl	getopt
	str	r0, [fp, #-296]
	ldr	r3, [fp, #-296]
	cmn	r3, #1
	bne	.L112
	ldr	r3, .L125+20
	ldr	r2, .L125+24
	str	r2, [r3]
	ldr	r3, .L125+36
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L113
	bl	help
	b	.L114
.L113:
	bl	finalize_trx
	ldr	r3, .L125+8
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	ldr	r2, .L125+40
	ldr	r2, [r2]
	sub	r4, r3, r2
	bl	trx_header_size
	mov	r3, r0
	sub	r3, r4, r3
	str	r3, [fp, #-288]
	ldr	r0, .L125+44
	bl	puts
	ldr	r3, .L125+8
	ldr	r3, [r3]
	ldr	r4, [r3, #4]
	ldr	r3, .L125+8
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	__aeabi_ui2d
	mov	r2, #0
	ldr	r3, .L125+48
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r6, r2
	mov	r7, r3
	ldr	r3, .L125+8
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	__aeabi_ui2d
	mov	r2, #0
	ldr	r3, .L125+48
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	mov	r2, #0
	ldr	r3, .L125+48
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	stm	sp, {r2-r3}
	mov	r2, r6
	mov	r3, r7
	mov	r1, r4
	ldr	r0, .L125+52
	bl	printf
	ldr	r2, [fp, #-288]
	ldr	r1, [fp, #-288]
	ldr	r0, .L125+56
	bl	printf
	ldr	r3, .L125+40
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L125+60
	bl	printf
	ldr	r0, .L125+64
	bl	puts
	ldr	r3, .L125+8
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-288]
	ldr	r3, [fp, #-288]
	cmp	r3, #3997696
	bcs	.L115
	ldr	r3, [fp, #-288]
	rsb	r3, r3, #3997696
	str	r3, [fp, #-292]
	b	.L116
.L115:
	mov	r3, #0
	str	r3, [fp, #-292]
.L116:
	ldr	r3, [fp, #-292]
	lsr	r1, r3, #16
	ldr	r3, [fp, #-292]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r2, r3
	ldr	r0, .L125+68
	bl	printf
	ldr	r3, [fp, #-288]
	cmp	r3, #3866624
	bcs	.L117
	ldr	r3, [fp, #-288]
	rsb	r3, r3, #3866624
	str	r3, [fp, #-292]
	b	.L118
.L117:
	mov	r3, #0
	str	r3, [fp, #-292]
.L118:
	ldr	r3, [fp, #-292]
	lsr	r1, r3, #16
	ldr	r3, [fp, #-292]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r2, r3
	ldr	r0, .L125+72
	bl	printf
	ldr	r3, [fp, #-288]
	cmp	r3, #8060928
	bcs	.L119
	ldr	r3, [fp, #-288]
	rsb	r3, r3, #8060928
	str	r3, [fp, #-292]
	b	.L120
.L119:
	mov	r3, #0
	str	r3, [fp, #-292]
.L120:
	ldr	r3, [fp, #-292]
	lsr	r1, r3, #16
	ldr	r3, [fp, #-292]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r2, r3
	ldr	r0, .L125+76
	bl	printf
	ldr	r0, .L125+80
	bl	puts
	ldr	r3, .L125+8
	ldr	r3, [r3]
	ldr	r3, [r3, #8]
	mov	r1, r3
	ldr	r0, .L125+84
	bl	printf
	ldr	r3, .L125+8
	ldr	r3, [r3]
	ldr	r2, [r3, #4]
	ldr	r3, .L125+88
	add	r3, r2, r3
	lsr	r3, r3, #17
	str	r3, [fp, #-288]
	ldr	r2, [fp, #-288]
	ldr	r1, [fp, #-288]
	ldr	r0, .L125+92
	bl	printf
	ldr	r3, .L125+8
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	add	r3, r3, #65280
	add	r3, r3, #255
	lsr	r3, r3, #16
	str	r3, [fp, #-288]
	ldr	r2, [fp, #-288]
	ldr	r1, [fp, #-288]
	ldr	r0, .L125+96
	bl	printf
	ldr	r0, .L125+100
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-296]
	b	.L121
.L122:
	ldr	r3, .L125+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-296]
	add	r2, r2, #4
	ldr	r1, [r3, r2, lsl #2]
	ldr	r2, [fp, #-296]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #4
	ldr	r2, .L125+104
	add	r3, r3, r2
	mov	r2, r1
	ldr	r1, [fp, #-296]
	ldr	r0, .L125+108
	bl	printf
	ldr	r3, [fp, #-296]
	add	r3, r3, #1
	str	r3, [fp, #-296]
.L121:
	ldr	r3, .L125+112
	ldr	r3, [r3]
	ldr	r2, [fp, #-296]
	cmp	r2, r3
	blt	.L122
.L114:
	mov	r0, #10
	bl	putchar
	mov	r3, #0
.L123:
	ldr	r2, .L125
	ldr	r1, [r2]
	ldr	r2, [fp, #-24]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L124
	bl	__stack_chk_fail
.L124:
	mov	r0, r3
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r6, r7, fp, pc}
.L126:
	.align	2
.L125:
	.word	.LC42
	.word	33161216
	.word	trx
	.word	stderr
	.word	.LC26
	.word	trx_magic
	.word	810697800
	.word	optarg
	.word	.LC27
	.word	trx_count
	.word	trx_padding
	.word	.LC28
	.word	1083179008
	.word	.LC29
	.word	.LC30
	.word	.LC31
	.word	.LC32
	.word	.LC33
	.word	.LC34
	.word	.LC35
	.word	.LC36
	.word	.LC37
	.word	131071
	.word	.LC38
	.word	.LC39
	.word	.LC40
	.word	names
	.word	.LC41
	.word	trx_max_offset
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
