	.file	"872131.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"usage: mkheader <bin> <hdr> <none|unified-boot>\n"
	.align 8
.LC1:
	.string	"       mkheader <bin> <hdr> <unsecure-boot> <outbin>\n"
	.align 8
.LC2:
	.string	"       mkheader <bin> <hdr> <secure-boot> <outbin> <maxsize>\n"
	.align 8
.LC3:
	.string	"       mkheader <bin> <hdr> <secure-boot> <outbin> <maxsize> <certchain> <files...>\n\n"
	.align 8
.LC4:
	.string	"bin:               Input raw appsbl binary\n"
	.align 8
.LC5:
	.string	"hdr:               Output of appsbl header location\n"
	.align 8
.LC6:
	.string	"outbin:            Output of the signed or unsigned apps boot location\n"
	.align 8
.LC7:
	.string	"maxsize:           Maximum size for certificate chain\n"
	.align 8
.LC8:
	.string	"certchain:         Output of the certchain location\n"
	.align 8
.LC9:
	.string	"files:             Input format <bin signature> <certifcate file(s) for certificate chain>...\n"
	.align 8
.LC10:
	.string	"certificate chain: Files will be concatenated in order to create the certificate chain\n\n"
	.text
	.globl	print_usage
	.type	print_usage, @function
print_usage:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 48
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 53
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 61
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 85
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 43
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 52
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 71
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 54
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 52
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 94
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 88
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	eax, -1
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	print_usage, .-print_usage
	.section	.rodata
	.align 8
.LC11:
	.string	"ERROR: Occured during file concatenation\n"
	.text
	.globl	cat
	.type	cat, @function
cat:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 64
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	DWORD PTR -68[rbp], edx
	mov	DWORD PTR -72[rbp], ecx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	r12, rax
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR -48[rbp], eax
	mov	eax, DWORD PTR -72[rbp]
	mov	edx, eax
	sub	rdx, 1
	mov	QWORD PTR -40[rbp], rdx
	mov	edx, eax
	mov	r10, rdx
	mov	r11d, 0
	mov	edx, eax
	mov	r8, rdx
	mov	r9d, 0
	mov	edx, eax
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	ebx, 16
	mov	edx, 0
	div	rbx
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L4:
	cmp	rsp, rdx
	je	.L5
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L4
.L5:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L6
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L6:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -32[rbp], rax
	mov	DWORD PTR -44[rbp], 0
	jmp	.L7
.L9:
	mov	edx, DWORD PTR -72[rbp]
	mov	rcx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	jne	.L8
	mov	edx, DWORD PTR -72[rbp]
	mov	rcx, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	sub	DWORD PTR -48[rbp], eax
	jmp	.L7
.L8:
	mov	DWORD PTR -48[rbp], 0
.L7:
	cmp	DWORD PTR -48[rbp], 0
	jne	.L9
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	ferror@PLT
	mov	ebx, eax
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	ferror@PLT
	or	eax, ebx
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	je	.L10
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 41
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
.L10:
	mov	eax, DWORD PTR -44[rbp]
	mov	rsp, r12
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	lea	rsp, -16[rbp]
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cat, .-cat
	.section	.rodata
.LC12:
	.string	"unified-boot"
.LC13:
	.string	"secure-boot"
	.align 8
.LC14:
	.string	"ERROR: Missing arguments: [outbin maxsize] | [outbin, maxsize, certchain, signature + certifcate(s)]\n"
.LC15:
	.string	"unsecure-boot"
	.align 8
.LC16:
	.string	"ERROR: Missing arguments: outbin directory\n"
	.align 8
.LC17:
	.string	"ERROR: Missing argument(s): [outbin maxsize] | [outbin, maxsize, certchain, signature + certifcate(s)]\n"
.LC18:
	.string	"cannot stat binary"
	.align 8
.LC19:
	.string	"Image Destination Pointer: 0x%x\n"
	.align 8
.LC20:
	.string	"cannot open header for writing"
.LC21:
	.string	"cannot write header"
.LC22:
	.string	"wb"
.LC23:
	.string	"ERROR: Occured during fopen"
	.align 8
.LC24:
	.string	"Certificate Chain Output File: %s\n"
.LC25:
	.string	"rb"
	.align 8
.LC26:
	.string	"ERROR: Input certificate chain (Size=%d) is larger than the maximum specified (Size=%d)\n"
	.align 8
.LC27:
	.string	"ERROR: Occured during certifcate chain padding\n"
.LC28:
	.string	"Image Output File: %s\n"
.LC29:
	.string	"Done execution"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 472
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -468[rbp], edi
	mov	QWORD PTR -480[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -436[rbp], 0
	mov	DWORD PTR -440[rbp], 0
	mov	DWORD PTR -444[rbp], 0
	mov	DWORD PTR -448[rbp], 0
	mov	DWORD PTR -452[rbp], 0
	cmp	DWORD PTR -468[rbp], 2
	jg	.L14
	mov	eax, 0
	call	print_usage
	jmp	.L62
.L14:
	cmp	DWORD PTR -468[rbp], 4
	jne	.L16
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L17
	mov	DWORD PTR -436[rbp], 1
	jmp	.L16
.L17:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L18
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 101
	mov	esi, 1
	lea	rdi, .LC14[rip]
	call	fwrite@PLT
	mov	eax, 0
	call	print_usage
	jmp	.L62
.L18:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC15[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L16
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 43
	mov	esi, 1
	lea	rdi, .LC16[rip]
	call	fwrite@PLT
	mov	eax, 0
	call	print_usage
	jmp	.L62
.L16:
	cmp	DWORD PTR -468[rbp], 4
	jle	.L19
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L19
	cmp	DWORD PTR -468[rbp], 8
	jg	.L20
	cmp	DWORD PTR -468[rbp], 6
	je	.L20
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 103
	mov	esi, 1
	lea	rdi, .LC17[rip]
	call	fwrite@PLT
	mov	eax, 0
	call	print_usage
	jmp	.L62
.L20:
	mov	DWORD PTR -452[rbp], 1
	mov	DWORD PTR -448[rbp], 256
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 40
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -444[rbp], eax
.L19:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, -208[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	test	eax, eax
	je	.L21
	lea	rdi, .LC18[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L62
.L21:
	cmp	DWORD PTR -436[rbp], 0
	je	.L22
	lea	rax, -288[rbp]
	mov	QWORD PTR -408[rbp], rax
	mov	DWORD PTR -440[rbp], 80
	jmp	.L23
.L22:
	lea	rax, -336[rbp]
	mov	QWORD PTR -408[rbp], rax
	mov	DWORD PTR -440[rbp], 40
.L23:
	mov	rax, QWORD PTR -160[rbp]
	mov	DWORD PTR -432[rbp], eax
	mov	DWORD PTR -428[rbp], 0
	mov	eax, DWORD PTR -428[rbp]
	mov	esi, eax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -408[rbp]
	mov	DWORD PTR [rax], 5
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 4
	mov	DWORD PTR [rax], 3
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 8
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -408[rbp]
	lea	rdx, 12[rax]
	mov	eax, DWORD PTR -428[rbp]
	mov	DWORD PTR [rdx], eax
	mov	edx, DWORD PTR -432[rbp]
	mov	eax, DWORD PTR -444[rbp]
	lea	ecx, [rdx+rax]
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 16
	mov	edx, DWORD PTR -448[rbp]
	add	edx, ecx
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -408[rbp]
	lea	rdx, 20[rax]
	mov	eax, DWORD PTR -432[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 24
	mov	ecx, DWORD PTR -428[rbp]
	mov	edx, DWORD PTR -432[rbp]
	add	edx, ecx
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -408[rbp]
	lea	rdx, 28[rax]
	mov	eax, DWORD PTR -448[rbp]
	mov	DWORD PTR [rdx], eax
	mov	edx, DWORD PTR -432[rbp]
	mov	eax, DWORD PTR -428[rbp]
	lea	ecx, [rdx+rax]
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 32
	mov	edx, DWORD PTR -448[rbp]
	add	edx, ecx
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -408[rbp]
	lea	rdx, 36[rax]
	mov	eax, DWORD PTR -444[rbp]
	mov	DWORD PTR [rdx], eax
	cmp	DWORD PTR -436[rbp], 1
	jne	.L24
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 40
	mov	DWORD PTR [rax], 864249477
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 44
	mov	DWORD PTR [rax], 1
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 48
	mov	DWORD PTR [rax], 2
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 52
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 56
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 60
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 64
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 68
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 72
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -408[rbp]
	add	rax, 76
	mov	DWORD PTR [rax], 0
.L24:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	edx, 420
	mov	esi, 577
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -424[rbp], eax
	cmp	DWORD PTR -424[rbp], 0
	jns	.L25
	lea	rdi, .LC20[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L62
.L25:
	mov	edx, DWORD PTR -440[rbp]
	mov	rcx, QWORD PTR -408[rbp]
	mov	eax, DWORD PTR -424[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	edx, DWORD PTR -440[rbp]
	cmp	rax, rdx
	je	.L26
	lea	rdi, .LC21[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -424[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	unlink@PLT
	mov	eax, -1
	jmp	.L62
.L26:
	mov	eax, DWORD PTR -424[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	DWORD PTR -452[rbp], 0
	je	.L27
	cmp	DWORD PTR -468[rbp], 6
	jle	.L27
	mov	rax, rsp
	mov	r12, rax
	mov	DWORD PTR -420[rbp], 1
	mov	ebx, DWORD PTR -420[rbp]
	mov	eax, ebx
	sub	rax, 1
	mov	QWORD PTR -400[rbp], rax
	mov	eax, ebx
	mov	QWORD PTR -496[rbp], rax
	mov	QWORD PTR -488[rbp], 0
	mov	eax, ebx
	mov	QWORD PTR -512[rbp], rax
	mov	QWORD PTR -504[rbp], 0
	mov	edx, ebx
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	ecx, 16
	mov	edx, 0
	div	rcx
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L28:
	cmp	rsp, rdx
	je	.L29
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L28
.L29:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L30
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L30:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -392[rbp], rax
	mov	DWORD PTR -460[rbp], 0
	mov	DWORD PTR -416[rbp], 0
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 48
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC22[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -384[rbp], rax
	cmp	QWORD PTR -384[rbp], 0
	jne	.L31
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L32
.L31:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 48
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC24[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -464[rbp], 8
	jmp	.L33
.L36:
	mov	eax, DWORD PTR -464[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -480[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC25[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -376[rbp], rax
	cmp	QWORD PTR -376[rbp], 0
	jne	.L34
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L32
.L34:
	mov	eax, DWORD PTR -464[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -480[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rdx, -208[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	rax, QWORD PTR -160[rbp]
	mov	DWORD PTR -456[rbp], eax
	mov	eax, DWORD PTR -456[rbp]
	add	DWORD PTR -460[rbp], eax
	mov	ecx, DWORD PTR -420[rbp]
	mov	edx, DWORD PTR -456[rbp]
	mov	rsi, QWORD PTR -384[rbp]
	mov	rax, QWORD PTR -376[rbp]
	mov	rdi, rax
	call	cat
	test	eax, eax
	je	.L35
	mov	eax, -1
	jmp	.L32
.L35:
	mov	rax, QWORD PTR -376[rbp]
	mov	rdi, rax
	call	fclose@PLT
	add	DWORD PTR -464[rbp], 1
.L33:
	mov	eax, DWORD PTR -464[rbp]
	cmp	eax, DWORD PTR -468[rbp]
	jl	.L36
	mov	edx, ebx
	mov	rax, QWORD PTR -392[rbp]
	mov	esi, 255
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR -444[rbp]
	sub	eax, DWORD PTR -460[rbp]
	mov	DWORD PTR -416[rbp], eax
	cmp	DWORD PTR -416[rbp], 0
	jns	.L37
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, DWORD PTR -444[rbp]
	mov	edx, DWORD PTR -460[rbp]
	lea	rsi, .LC26[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L32
.L37:
	mov	eax, 0
	cmp	DWORD PTR -416[rbp], 0
	cmovns	eax, DWORD PTR -416[rbp]
	mov	DWORD PTR -456[rbp], eax
	jmp	.L38
.L40:
	mov	rax, QWORD PTR -384[rbp]
	mov	rdi, rax
	call	ferror@PLT
	test	eax, eax
	jne	.L39
	mov	edx, DWORD PTR -420[rbp]
	mov	esi, ebx
	mov	rcx, QWORD PTR -384[rbp]
	mov	rax, QWORD PTR -392[rbp]
	mov	rdi, rax
	call	fwrite@PLT
	sub	DWORD PTR -456[rbp], eax
	jmp	.L38
.L39:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 47
	mov	esi, 1
	lea	rdi, .LC27[rip]
	call	fwrite@PLT
	mov	eax, -1
	jmp	.L32
.L38:
	cmp	DWORD PTR -456[rbp], 0
	jne	.L40
	mov	rax, QWORD PTR -384[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC22[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -384[rbp], rax
	cmp	QWORD PTR -384[rbp], 0
	jne	.L41
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L32
.L41:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC28[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC25[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -376[rbp], rax
	cmp	QWORD PTR -376[rbp], 0
	jne	.L42
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L32
.L42:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rdx, -208[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	rax, QWORD PTR -160[rbp]
	mov	edi, eax
	mov	edx, DWORD PTR -420[rbp]
	mov	rsi, QWORD PTR -384[rbp]
	mov	rax, QWORD PTR -376[rbp]
	mov	ecx, edx
	mov	edx, edi
	mov	rdi, rax
	call	cat
	test	eax, eax
	je	.L43
	mov	eax, -1
	jmp	.L32
.L43:
	mov	rax, QWORD PTR -376[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC25[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -376[rbp], rax
	cmp	QWORD PTR -376[rbp], 0
	jne	.L44
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L32
.L44:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, -208[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	rax, QWORD PTR -160[rbp]
	mov	edi, eax
	mov	edx, DWORD PTR -420[rbp]
	mov	rsi, QWORD PTR -384[rbp]
	mov	rax, QWORD PTR -376[rbp]
	mov	ecx, edx
	mov	edx, edi
	mov	rdi, rax
	call	cat
	test	eax, eax
	je	.L45
	mov	eax, -1
	jmp	.L32
.L45:
	mov	rax, QWORD PTR -376[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 56
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC25[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -376[rbp], rax
	cmp	QWORD PTR -376[rbp], 0
	jne	.L46
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L32
.L46:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 56
	mov	rax, QWORD PTR [rax]
	lea	rdx, -208[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	rax, QWORD PTR -160[rbp]
	mov	edi, eax
	mov	edx, DWORD PTR -420[rbp]
	mov	rsi, QWORD PTR -384[rbp]
	mov	rax, QWORD PTR -376[rbp]
	mov	ecx, edx
	mov	edx, edi
	mov	rdi, rax
	call	cat
	test	eax, eax
	je	.L47
	mov	eax, -1
	jmp	.L32
.L47:
	mov	rax, QWORD PTR -376[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 48
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC25[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -376[rbp], rax
	cmp	QWORD PTR -376[rbp], 0
	jne	.L48
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L32
.L48:
	mov	edx, DWORD PTR -416[rbp]
	mov	eax, DWORD PTR -460[rbp]
	lea	edi, [rdx+rax]
	mov	edx, DWORD PTR -420[rbp]
	mov	rsi, QWORD PTR -384[rbp]
	mov	rax, QWORD PTR -376[rbp]
	mov	ecx, edx
	mov	edx, edi
	mov	rdi, rax
	call	cat
	test	eax, eax
	je	.L49
	mov	eax, -1
	jmp	.L32
.L49:
	mov	rax, QWORD PTR -376[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -384[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rsp, r12
	jmp	.L51
.L32:
	mov	rsp, r12
	jmp	.L62
.L27:
	cmp	DWORD PTR -468[rbp], 5
	je	.L52
	cmp	DWORD PTR -468[rbp], 6
	jne	.L51
.L52:
	mov	rax, rsp
	mov	rbx, rax
	mov	DWORD PTR -412[rbp], 1
	mov	eax, DWORD PTR -412[rbp]
	mov	edx, eax
	sub	rdx, 1
	mov	QWORD PTR -368[rbp], rdx
	mov	edx, eax
	mov	r14, rdx
	mov	r15d, 0
	mov	edx, eax
	mov	r12, rdx
	mov	r13d, 0
	mov	edx, eax
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	ecx, 16
	mov	edx, 0
	div	rcx
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L53:
	cmp	rsp, rdx
	je	.L54
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L53
.L54:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L55
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L55:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -360[rbp], rax
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC22[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -352[rbp], rax
	cmp	QWORD PTR -352[rbp], 0
	jne	.L56
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L57
.L56:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC28[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC25[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -344[rbp], rax
	cmp	QWORD PTR -344[rbp], 0
	jne	.L58
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L57
.L58:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rdx, -208[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	rax, QWORD PTR -160[rbp]
	mov	edi, eax
	mov	edx, DWORD PTR -412[rbp]
	mov	rsi, QWORD PTR -352[rbp]
	mov	rax, QWORD PTR -344[rbp]
	mov	ecx, edx
	mov	edx, edi
	mov	rdi, rax
	call	cat
	test	eax, eax
	je	.L59
	mov	eax, -1
	jmp	.L57
.L59:
	mov	rax, QWORD PTR -344[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC25[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -344[rbp], rax
	cmp	QWORD PTR -344[rbp], 0
	jne	.L60
	lea	rdi, .LC23[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L57
.L60:
	mov	rax, QWORD PTR -480[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, -208[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	rax, QWORD PTR -160[rbp]
	mov	edi, eax
	mov	edx, DWORD PTR -412[rbp]
	mov	rsi, QWORD PTR -352[rbp]
	mov	rax, QWORD PTR -344[rbp]
	mov	ecx, edx
	mov	edx, edi
	mov	rdi, rax
	call	cat
	test	eax, eax
	je	.L61
	mov	eax, -1
	jmp	.L57
.L61:
	mov	rax, QWORD PTR -344[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -352[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rsp, rbx
	jmp	.L51
.L57:
	mov	rsp, rbx
	jmp	.L62
.L51:
	lea	rdi, .LC29[rip]
	call	puts@PLT
	mov	eax, 0
.L62:
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L63
	call	__stack_chk_fail@PLT
.L63:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"872131.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage: mkheader <bin> <hdr> <none|unified-boot>\012"
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"       mkheader <bin> <hdr> <unsecure-boot> <outbin"
	.ascii	">\012\000"
	.align	2
.LC2:
	.ascii	"       mkheader <bin> <hdr> <secure-boot> <outbin> "
	.ascii	"<maxsize>\012\000"
	.align	2
.LC3:
	.ascii	"       mkheader <bin> <hdr> <secure-boot> <outbin> "
	.ascii	"<maxsize> <certchain> <files...>\012\012\000"
	.align	2
.LC4:
	.ascii	"bin:               Input raw appsbl binary\012\000"
	.align	2
.LC5:
	.ascii	"hdr:               Output of appsbl header location"
	.ascii	"\012\000"
	.align	2
.LC6:
	.ascii	"outbin:            Output of the signed or unsigned"
	.ascii	" apps boot location\012\000"
	.align	2
.LC7:
	.ascii	"maxsize:           Maximum size for certificate cha"
	.ascii	"in\012\000"
	.align	2
.LC8:
	.ascii	"certchain:         Output of the certchain location"
	.ascii	"\012\000"
	.align	2
.LC9:
	.ascii	"files:             Input format <bin signature> <ce"
	.ascii	"rtifcate file(s) for certificate chain>...\012\000"
	.align	2
.LC10:
	.ascii	"certificate chain: Files will be concatenated in or"
	.ascii	"der to create the certificate chain\012\012\000"
	.text
	.align	2
	.global	print_usage
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_usage, %function
print_usage:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #48
	mov	r1, #1
	ldr	r0, .L3+4
	bl	fwrite
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #53
	mov	r1, #1
	ldr	r0, .L3+8
	bl	fwrite
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #61
	mov	r1, #1
	ldr	r0, .L3+12
	bl	fwrite
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #85
	mov	r1, #1
	ldr	r0, .L3+16
	bl	fwrite
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #43
	mov	r1, #1
	ldr	r0, .L3+20
	bl	fwrite
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #52
	mov	r1, #1
	ldr	r0, .L3+24
	bl	fwrite
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #71
	mov	r1, #1
	ldr	r0, .L3+28
	bl	fwrite
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #54
	mov	r1, #1
	ldr	r0, .L3+32
	bl	fwrite
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #52
	mov	r1, #1
	ldr	r0, .L3+36
	bl	fwrite
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #94
	mov	r1, #1
	ldr	r0, .L3+40
	bl	fwrite
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r2, #88
	mov	r1, #1
	ldr	r0, .L3+44
	bl	fwrite
	mvn	r3, #0
	mov	r0, r3
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	print_usage, .-print_usage
	.section	.rodata
	.align	2
.LC11:
	.ascii	"ERROR: Occured during file concatenation\012\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	cat
	.syntax unified
	.arm
	.fpu softvfp
	.type	cat, %function
cat:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	str	r2, [fp, #-48]
	str	r3, [fp, #-52]
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r5, r3
	ldr	r3, [fp, #-48]
	str	r3, [fp, #-32]
	ldr	ip, [fp, #-52]
	mov	r3, ip
	sub	r3, r3, #1
	str	r3, [fp, #-28]
	mov	r0, ip
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r0, ip
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	add	r3, ip, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L6
.L8:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-52]
	mov	r1, #1
	ldr	r0, [fp, #-24]
	bl	fread
	ldr	r0, [fp, #-40]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	bne	.L7
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-52]
	mov	r1, #1
	ldr	r0, [fp, #-24]
	bl	fwrite
	mov	r2, r0
	ldr	r3, [fp, #-32]
	sub	r3, r3, r2
	str	r3, [fp, #-32]
	b	.L6
.L7:
	mov	r3, #0
	str	r3, [fp, #-32]
.L6:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L8
	ldr	r0, [fp, #-40]
	bl	ferror
	mov	r4, r0
	ldr	r0, [fp, #-44]
	bl	ferror
	mov	r3, r0
	orr	r3, r4, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L9
	ldr	r3, .L12+4
	ldr	r3, [r3]
	mov	r2, #41
	mov	r1, #1
	ldr	r0, .L12+8
	bl	fwrite
.L9:
	ldr	r3, [fp, #-20]
	mov	sp, r5
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC12
	.word	stderr
	.word	.LC11
	.size	cat, .-cat
	.section	.rodata
	.align	2
.LC13:
	.ascii	"unified-boot\000"
	.align	2
.LC14:
	.ascii	"secure-boot\000"
	.align	2
.LC15:
	.ascii	"ERROR: Missing arguments: [outbin maxsize] | [outbi"
	.ascii	"n, maxsize, certchain, signature + certifcate(s)]\012"
	.ascii	"\000"
	.align	2
.LC16:
	.ascii	"unsecure-boot\000"
	.align	2
.LC17:
	.ascii	"ERROR: Missing arguments: outbin directory\012\000"
	.align	2
.LC18:
	.ascii	"ERROR: Missing argument(s): [outbin maxsize] | [out"
	.ascii	"bin, maxsize, certchain, signature + certifcate(s)]"
	.ascii	"\012\000"
	.align	2
.LC19:
	.ascii	"cannot stat binary\000"
	.align	2
.LC20:
	.ascii	"Image Destination Pointer: 0x%x\012\000"
	.align	2
.LC21:
	.ascii	"cannot open header for writing\000"
	.align	2
.LC22:
	.ascii	"cannot write header\000"
	.align	2
.LC23:
	.ascii	"wb\000"
	.align	2
.LC24:
	.ascii	"ERROR: Occured during fopen\000"
	.align	2
.LC25:
	.ascii	"Certificate Chain Output File: %s\012\000"
	.align	2
.LC26:
	.ascii	"rb\000"
	.align	2
.LC27:
	.ascii	"ERROR: Input certificate chain (Size=%d) is larger "
	.ascii	"than the maximum specified (Size=%d)\012\000"
	.align	2
.LC28:
	.ascii	"ERROR: Occured during certifcate chain padding\012\000"
	.align	2
.LC29:
	.ascii	"Image Output File: %s\012\000"
	.align	2
.LC30:
	.ascii	"Done execution\000"
	.align	2
.LC31:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 320
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #320
	str	r0, [fp, #-328]
	str	r1, [fp, #-332]
	ldr	r3, .L59
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-300]
	mov	r3, #0
	str	r3, [fp, #-304]
	mov	r3, #0
	str	r3, [fp, #-312]
	mov	r3, #0
	str	r3, [fp, #-316]
	mov	r3, #0
	str	r3, [fp, #-320]
	ldr	r3, [fp, #-328]
	cmp	r3, #2
	bgt	.L15
	bl	print_usage
	mov	r3, r0
	b	.L57
.L15:
	ldr	r3, [fp, #-328]
	cmp	r3, #4
	bne	.L17
	ldr	r3, [fp, #-332]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L59+4
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L18
	mov	r3, #1
	str	r3, [fp, #-300]
	b	.L17
.L18:
	ldr	r3, [fp, #-332]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L59+8
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L19
	ldr	r3, .L59+12
	ldr	r3, [r3]
	mov	r2, #101
	mov	r1, #1
	ldr	r0, .L59+16
	bl	fwrite
	bl	print_usage
	mov	r3, r0
	b	.L57
.L19:
	ldr	r3, [fp, #-332]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L59+20
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L17
	ldr	r3, .L59+12
	ldr	r3, [r3]
	mov	r2, #43
	mov	r1, #1
	ldr	r0, .L59+24
	bl	fwrite
	bl	print_usage
	mov	r3, r0
	b	.L57
.L17:
	ldr	r3, [fp, #-328]
	cmp	r3, #4
	ble	.L20
	ldr	r3, [fp, #-332]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L59+8
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L20
	ldr	r3, [fp, #-328]
	cmp	r3, #8
	bgt	.L21
	ldr	r3, [fp, #-328]
	cmp	r3, #6
	beq	.L21
	ldr	r3, .L59+12
	ldr	r3, [r3]
	mov	r2, #103
	mov	r1, #1
	ldr	r0, .L59+28
	bl	fwrite
	bl	print_usage
	mov	r3, r0
	b	.L57
.L21:
	mov	r3, #1
	str	r3, [fp, #-320]
	mov	r3, #256
	str	r3, [fp, #-316]
	ldr	r3, [fp, #-332]
	add	r3, r3, #20
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	str	r3, [fp, #-312]
.L20:
	ldr	r3, [fp, #-332]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #228
	mov	r1, r2
	mov	r0, r3
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	beq	.L22
	ldr	r0, .L59+32
	bl	perror
	mvn	r3, #0
	b	.L57
.L22:
	ldr	r3, [fp, #-300]
	cmp	r3, #0
	beq	.L23
	sub	r3, fp, #96
	str	r3, [fp, #-308]
	mov	r3, #80
	str	r3, [fp, #-304]
	b	.L24
.L23:
	sub	r3, fp, #136
	str	r3, [fp, #-308]
	mov	r3, #40
	str	r3, [fp, #-304]
.L24:
	ldr	r3, [fp, #-184]
	str	r3, [fp, #-284]
	mov	r3, #0
	str	r3, [fp, #-280]
	ldr	r1, [fp, #-280]
	ldr	r0, .L59+36
	bl	printf
	ldr	r3, [fp, #-308]
	mov	r2, #5
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #4
	mov	r2, #3
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #8
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #12
	ldr	r2, [fp, #-280]
	str	r2, [r3]
	ldr	r2, [fp, #-284]
	ldr	r3, [fp, #-312]
	add	r1, r2, r3
	ldr	r3, [fp, #-308]
	add	r3, r3, #16
	ldr	r2, [fp, #-316]
	add	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #20
	ldr	r2, [fp, #-284]
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #24
	ldr	r1, [fp, #-280]
	ldr	r2, [fp, #-284]
	add	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #28
	ldr	r2, [fp, #-316]
	str	r2, [r3]
	ldr	r2, [fp, #-284]
	ldr	r3, [fp, #-280]
	add	r1, r2, r3
	ldr	r3, [fp, #-308]
	add	r3, r3, #32
	ldr	r2, [fp, #-316]
	add	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #36
	ldr	r2, [fp, #-312]
	str	r2, [r3]
	ldr	r3, [fp, #-300]
	cmp	r3, #1
	bne	.L25
	ldr	r3, [fp, #-308]
	add	r3, r3, #40
	ldr	r2, .L59+40
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #44
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #48
	mov	r2, #2
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #52
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #56
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #60
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #64
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #68
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #72
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #76
	mov	r2, #0
	str	r2, [r3]
.L25:
	ldr	r3, [fp, #-332]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r2, #420
	ldr	r1, .L59+44
	mov	r0, r3
	bl	open
	str	r0, [fp, #-276]
	ldr	r3, [fp, #-276]
	cmp	r3, #0
	bge	.L26
	ldr	r0, .L59+48
	bl	perror
	mvn	r3, #0
	b	.L57
.L26:
	ldr	r2, [fp, #-304]
	ldr	r1, [fp, #-308]
	ldr	r0, [fp, #-276]
	bl	write
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-304]
	cmp	r3, r2
	beq	.L27
	ldr	r0, .L59+52
	bl	perror
	ldr	r0, [fp, #-276]
	bl	close
	ldr	r3, [fp, #-332]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	unlink
	mvn	r3, #0
	b	.L57
.L27:
	ldr	r0, [fp, #-276]
	bl	close
	ldr	r3, [fp, #-320]
	cmp	r3, #0
	beq	.L28
	ldr	r3, [fp, #-328]
	cmp	r3, #6
	ble	.L28
	mov	r3, sp
	mov	r5, r3
	mov	r3, #1
	str	r3, [fp, #-272]
	ldr	r4, [fp, #-272]
	mov	r3, r4
	sub	r3, r3, #1
	str	r3, [fp, #-268]
	mov	r0, r4
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r0, r4
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	add	r3, r4, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-264]
	mov	r3, #0
	str	r3, [fp, #-292]
	mov	r3, #0
	str	r3, [fp, #-260]
	ldr	r3, [fp, #-332]
	add	r3, r3, #24
	ldr	r3, [r3]
	ldr	r1, .L59+56
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-256]
	ldr	r3, [fp, #-256]
	cmp	r3, #0
	bne	.L29
	ldr	r0, .L59+60
	bl	perror
	mvn	r3, #0
	b	.L30
.L29:
	ldr	r3, [fp, #-332]
	add	r3, r3, #24
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L59+64
	bl	printf
	mov	r3, #8
	str	r3, [fp, #-288]
	b	.L31
.L34:
	ldr	r3, [fp, #-288]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-332]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L59+68
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-252]
	ldr	r3, [fp, #-252]
	cmp	r3, #0
	bne	.L32
	ldr	r0, .L59+60
	bl	perror
	mvn	r3, #0
	b	.L30
.L32:
	ldr	r3, [fp, #-288]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-332]
	add	r3, r2, r3
	ldr	r3, [r3]
	sub	r2, fp, #228
	mov	r1, r2
	mov	r0, r3
	bl	stat
	ldr	r3, [fp, #-184]
	str	r3, [fp, #-296]
	ldr	r2, [fp, #-292]
	ldr	r3, [fp, #-296]
	add	r3, r2, r3
	str	r3, [fp, #-292]
	ldr	r3, [fp, #-272]
	ldr	r2, [fp, #-296]
	ldr	r1, [fp, #-256]
	ldr	r0, [fp, #-252]
	bl	cat
	mov	r3, r0
	cmp	r3, #0
	beq	.L33
	mvn	r3, #0
	b	.L30
.L33:
	ldr	r0, [fp, #-252]
	bl	fclose
	ldr	r3, [fp, #-288]
	add	r3, r3, #1
	str	r3, [fp, #-288]
.L31:
	ldr	r2, [fp, #-288]
	ldr	r3, [fp, #-328]
	cmp	r2, r3
	blt	.L34
	mov	r2, r4
	mov	r1, #255
	ldr	r0, [fp, #-264]
	bl	memset
	ldr	r2, [fp, #-312]
	ldr	r3, [fp, #-292]
	sub	r3, r2, r3
	str	r3, [fp, #-260]
	ldr	r3, [fp, #-260]
	cmp	r3, #0
	bge	.L35
	ldr	r3, .L59+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-312]
	ldr	r2, [fp, #-292]
	ldr	r1, .L59+72
	bl	fprintf
	mvn	r3, #0
	b	.L30
.L35:
	ldr	r3, [fp, #-260]
	bic	r3, r3, r3, asr #31
	str	r3, [fp, #-296]
	b	.L36
.L38:
	ldr	r0, [fp, #-256]
	bl	ferror
	mov	r3, r0
	cmp	r3, #0
	bne	.L37
	ldr	r3, [fp, #-256]
	ldr	r2, [fp, #-272]
	mov	r1, r4
	ldr	r0, [fp, #-264]
	bl	fwrite
	mov	r2, r0
	ldr	r3, [fp, #-296]
	sub	r3, r3, r2
	str	r3, [fp, #-296]
	b	.L36
.L37:
	ldr	r3, .L59+12
	ldr	r3, [r3]
	mov	r2, #47
	mov	r1, #1
	ldr	r0, .L59+76
	bl	fwrite
	mvn	r3, #0
	b	.L30
.L36:
	ldr	r3, [fp, #-296]
	cmp	r3, #0
	bne	.L38
	ldr	r0, [fp, #-256]
	bl	fclose
	ldr	r3, [fp, #-332]
	add	r3, r3, #16
	ldr	r3, [r3]
	ldr	r1, .L59+56
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-256]
	ldr	r3, [fp, #-256]
	cmp	r3, #0
	bne	.L39
	ldr	r0, .L59+60
	bl	perror
	mvn	r3, #0
	b	.L30
.L39:
	ldr	r3, [fp, #-332]
	add	r3, r3, #16
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L59+80
	bl	printf
	ldr	r3, [fp, #-332]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L59+68
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-252]
	ldr	r3, [fp, #-252]
	cmp	r3, #0
	bne	.L40
	ldr	r0, .L59+60
	bl	perror
	mvn	r3, #0
	b	.L30
.L40:
	ldr	r3, [fp, #-332]
	add	r3, r3, #8
	ldr	r3, [r3]
	sub	r2, fp, #228
	mov	r1, r2
	mov	r0, r3
	bl	stat
	ldr	r3, [fp, #-184]
	mov	r2, r3
	ldr	r3, [fp, #-272]
	ldr	r1, [fp, #-256]
	ldr	r0, [fp, #-252]
	bl	cat
	mov	r3, r0
	cmp	r3, #0
	beq	.L41
	mvn	r3, #0
	b	.L30
.L41:
	ldr	r0, [fp, #-252]
	bl	fclose
	ldr	r3, [fp, #-332]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L59+68
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-252]
	ldr	r3, [fp, #-252]
	cmp	r3, #0
	bne	.L42
	ldr	r0, .L59+60
	bl	perror
	mvn	r3, #0
	b	.L30
.L42:
	ldr	r3, [fp, #-332]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #228
	mov	r1, r2
	mov	r0, r3
	bl	stat
	ldr	r3, [fp, #-184]
	mov	r2, r3
	ldr	r3, [fp, #-272]
	ldr	r1, [fp, #-256]
	ldr	r0, [fp, #-252]
	bl	cat
	mov	r3, r0
	cmp	r3, #0
	beq	.L43
	mvn	r3, #0
	b	.L30
.L43:
	ldr	r0, [fp, #-252]
	bl	fclose
	ldr	r3, [fp, #-332]
	add	r3, r3, #28
	ldr	r3, [r3]
	ldr	r1, .L59+68
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-252]
	ldr	r3, [fp, #-252]
	cmp	r3, #0
	bne	.L44
	ldr	r0, .L59+60
	bl	perror
	mvn	r3, #0
	b	.L30
.L44:
	ldr	r3, [fp, #-332]
	add	r3, r3, #28
	ldr	r3, [r3]
	sub	r2, fp, #228
	mov	r1, r2
	mov	r0, r3
	bl	stat
	ldr	r3, [fp, #-184]
	mov	r2, r3
	ldr	r3, [fp, #-272]
	ldr	r1, [fp, #-256]
	ldr	r0, [fp, #-252]
	bl	cat
	mov	r3, r0
	cmp	r3, #0
	beq	.L45
	mvn	r3, #0
	b	.L30
.L45:
	ldr	r0, [fp, #-252]
	bl	fclose
	ldr	r3, [fp, #-332]
	add	r3, r3, #24
	ldr	r3, [r3]
	ldr	r1, .L59+68
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-252]
	ldr	r3, [fp, #-252]
	cmp	r3, #0
	bne	.L46
	ldr	r0, .L59+60
	bl	perror
	mvn	r3, #0
	b	.L30
.L46:
	ldr	r2, [fp, #-260]
	ldr	r3, [fp, #-292]
	add	r2, r2, r3
	ldr	r3, [fp, #-272]
	ldr	r1, [fp, #-256]
	ldr	r0, [fp, #-252]
	bl	cat
	mov	r3, r0
	cmp	r3, #0
	beq	.L47
	mvn	r3, #0
	b	.L30
.L47:
	ldr	r0, [fp, #-252]
	bl	fclose
	ldr	r0, [fp, #-256]
	bl	fclose
	mov	sp, r5
	b	.L49
.L30:
	mov	sp, r5
	b	.L57
.L28:
	ldr	r3, [fp, #-328]
	cmp	r3, #5
	beq	.L50
	ldr	r3, [fp, #-328]
	cmp	r3, #6
	bne	.L49
.L50:
	mov	r3, sp
	mov	r4, r3
	mov	r3, #1
	str	r3, [fp, #-248]
	ldr	ip, [fp, #-248]
	mov	r3, ip
	sub	r3, r3, #1
	str	r3, [fp, #-244]
	mov	r0, ip
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r0, ip
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	add	r3, ip, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-240]
	ldr	r3, [fp, #-332]
	add	r3, r3, #16
	ldr	r3, [r3]
	ldr	r1, .L59+56
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-236]
	ldr	r3, [fp, #-236]
	cmp	r3, #0
	bne	.L51
	ldr	r0, .L59+60
	bl	perror
	mvn	r3, #0
	b	.L52
.L51:
	ldr	r3, [fp, #-332]
	add	r3, r3, #16
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L59+80
	bl	printf
	ldr	r3, [fp, #-332]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L59+68
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-232]
	ldr	r3, [fp, #-232]
	cmp	r3, #0
	bne	.L53
	ldr	r0, .L59+60
	bl	perror
	mvn	r3, #0
	b	.L52
.L53:
	ldr	r3, [fp, #-332]
	add	r3, r3, #8
	ldr	r3, [r3]
	sub	r2, fp, #228
	mov	r1, r2
	mov	r0, r3
	bl	stat
	ldr	r3, [fp, #-184]
	mov	r2, r3
	ldr	r3, [fp, #-248]
	ldr	r1, [fp, #-236]
	ldr	r0, [fp, #-232]
	bl	cat
	mov	r3, r0
	cmp	r3, #0
	beq	.L54
	mvn	r3, #0
	b	.L52
.L54:
	ldr	r0, [fp, #-232]
	bl	fclose
	ldr	r3, [fp, #-332]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L59+68
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-232]
	ldr	r3, [fp, #-232]
	cmp	r3, #0
	bne	.L55
	ldr	r0, .L59+60
	bl	perror
	mvn	r3, #0
	b	.L52
.L55:
	ldr	r3, [fp, #-332]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #228
	mov	r1, r2
	mov	r0, r3
	bl	stat
	ldr	r3, [fp, #-184]
	mov	r2, r3
	ldr	r3, [fp, #-248]
	ldr	r1, [fp, #-236]
	ldr	r0, [fp, #-232]
	bl	cat
	mov	r3, r0
	cmp	r3, #0
	beq	.L56
	mvn	r3, #0
	b	.L52
.L56:
	ldr	r0, [fp, #-232]
	bl	fclose
	ldr	r0, [fp, #-236]
	bl	fclose
	mov	sp, r4
	b	.L49
.L52:
	mov	sp, r4
	b	.L57
.L49:
	ldr	r0, .L59+84
	bl	puts
	mov	r3, #0
.L57:
	ldr	r2, .L59
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L58
	bl	__stack_chk_fail
.L58:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L60:
	.align	2
.L59:
	.word	.LC31
	.word	.LC13
	.word	.LC14
	.word	stderr
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	864249477
	.word	577
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.word	.LC26
	.word	.LC27
	.word	.LC28
	.word	.LC29
	.word	.LC30
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
