	.file	"147014220.c"
	.intel_syntax noprefix
	.text
	.data
	.align 4
	.type	verbose_level, @object
	.size	verbose_level, 4
verbose_level:
	.long	1
	.text
	.type	new_patch, @function
new_patch:
.LFB6:
	.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 -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	DWORD PTR -36[rbp], ecx
	mov	QWORD PTR -48[rbp], r8
	jmp	.L2
.L4:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	add	rax, 24
	mov	QWORD PTR -24[rbp], rax
.L2:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L3
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR 4[rax]
	cmp	DWORD PTR -32[rbp], eax
	ja	.L4
.L3:
	mov	esi, 32
	mov	edi, 1
	call	calloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -28[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -32[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -36[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -48[rbp]
	mov	QWORD PTR 16[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 24[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new_patch, .-new_patch
	.type	free_patch, @function
free_patch:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	jmp	.L6
.L7:
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
.L6:
	cmp	QWORD PTR -24[rbp], 0
	jne	.L7
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	free_patch, .-free_patch
	.section	.rodata
.LC0:
	.string	"EOF"
.LC1:
	.string	"EOF RECORD detected\n"
.LC2:
	.string	"RECORD! offset=%d size=%d\n"
.LC3:
	.string	"%s: Truncated file detected\n"
	.text
	.type	read_record, @function
read_record:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -56[rbp], rdi
	mov	DWORD PTR -60[rbp], esi
	mov	QWORD PTR -72[rbp], rdx
	mov	QWORD PTR -80[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rcx, -11[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	edx, 3
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 2
	jle	.L25
	lea	rax, -11[rbp]
	mov	edx, 3
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	jne	.L11
	mov	eax, DWORD PTR verbose_level[rip]
	cmp	eax, 2
	jle	.L12
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 20
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
.L12:
	mov	rax, QWORD PTR -72[rbp]
	mov	DWORD PTR [rax], 0
	mov	eax, 0
	jmp	.L23
.L11:
	movzx	eax, BYTE PTR -11[rbp]
	movzx	eax, al
	sal	eax, 16
	and	eax, 16711680
	mov	edx, eax
	movzx	eax, BYTE PTR -10[rbp]
	movzx	eax, al
	sal	eax, 8
	movzx	eax, ax
	or	edx, eax
	movzx	eax, BYTE PTR -9[rbp]
	movzx	eax, al
	or	eax, edx
	mov	DWORD PTR -44[rbp], eax
	lea	rcx, -15[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	edx, 2
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 1
	jle	.L26
	movzx	eax, BYTE PTR -15[rbp]
	movzx	eax, al
	sal	eax, 8
	movzx	edx, ax
	movzx	eax, BYTE PTR -14[rbp]
	movzx	eax, al
	or	eax, edx
	mov	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR verbose_level[rip]
	cmp	eax, 2
	jle	.L15
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, DWORD PTR -40[rbp]
	mov	edx, DWORD PTR -44[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L15:
	cmp	DWORD PTR -40[rbp], 0
	je	.L16
	mov	eax, DWORD PTR -40[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	edx, DWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -48[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	cmp	DWORD PTR -48[rbp], eax
	je	.L17
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L10
.L17:
	mov	rsi, QWORD PTR -24[rbp]
	mov	ecx, DWORD PTR -40[rbp]
	mov	edx, DWORD PTR -44[rbp]
	mov	rax, QWORD PTR -80[rbp]
	mov	r8, rsi
	mov	esi, 1
	mov	rdi, rax
	call	new_patch
	jmp	.L18
.L16:
	lea	rcx, -13[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	edx, 2
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 1
	jle	.L27
	movzx	eax, BYTE PTR -13[rbp]
	movzx	eax, al
	sal	eax, 8
	movzx	edx, ax
	movzx	eax, BYTE PTR -12[rbp]
	movzx	eax, al
	or	eax, edx
	mov	DWORD PTR -36[rbp], eax
	mov	edi, 1
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 1
	je	.L21
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L10
.L21:
	mov	rsi, QWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -36[rbp]
	mov	edx, DWORD PTR -44[rbp]
	mov	rax, QWORD PTR -80[rbp]
	mov	r8, rsi
	mov	esi, 0
	mov	rdi, rax
	call	new_patch
.L18:
	mov	rax, QWORD PTR -72[rbp]
	mov	DWORD PTR [rax], 0
	mov	eax, -1
	jmp	.L23
.L25:
	nop
	jmp	.L10
.L26:
	nop
	jmp	.L10
.L27:
	nop
.L10:
	mov	eax, DWORD PTR verbose_level[rip]
	test	eax, eax
	jle	.L22
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L22:
	mov	rax, QWORD PTR -72[rbp]
	mov	DWORD PTR [rax], 1
	mov	eax, 0
.L23:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	read_record, .-read_record
	.section	.rodata
.LC4:
	.string	"the_stack_data/147014220.c"
.LC5:
	.string	"patchfile != NULL"
.LC6:
	.string	"PATCH"
.LC7:
	.string	"%s: Header signature invalid\n"
.LC8:
	.string	"%s: Error reading patch file\n"
	.text
	.type	load_patch, @function
load_patch:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 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
	cmp	QWORD PTR -40[rbp], 0
	jne	.L29
	lea	rcx, __PRETTY_FUNCTION__.5[rip]
	mov	edx, 171
	lea	rsi, .LC4[rip]
	lea	rdi, .LC5[rip]
	call	__assert_fail@PLT
.L29:
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	jns	.L30
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	eax, -1
	jmp	.L40
.L30:
	lea	rcx, -13[rbp]
	mov	eax, DWORD PTR -24[rbp]
	mov	edx, 5
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 4
	jle	.L43
	lea	rax, -13[rbp]
	mov	edx, 5
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	je	.L34
	mov	eax, DWORD PTR verbose_level[rip]
	test	eax, eax
	jle	.L44
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -40[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L44
.L34:
	mov	DWORD PTR -28[rbp], 0
	nop
.L37:
	mov	rcx, QWORD PTR -48[rbp]
	lea	rdx, -28[rbp]
	mov	esi, DWORD PTR -24[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	read_record
	test	eax, eax
	jne	.L37
	mov	eax, DWORD PTR -28[rbp]
	test	eax, eax
	je	.L38
	mov	eax, DWORD PTR verbose_level[rip]
	test	eax, eax
	jle	.L45
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -40[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L45
.L38:
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	jmp	.L40
.L43:
	nop
.L33:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	perror@PLT
	jmp	.L36
.L44:
	nop
	jmp	.L36
.L45:
	nop
.L36:
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, -1
.L40:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	load_patch, .-load_patch
	.section	.rodata
.LC9:
	.string	"%s:bytes=%zd\n"
	.text
	.type	discard, @function
discard:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 576
	mov	QWORD PTR -552[rbp], rdi
	mov	DWORD PTR -556[rbp], esi
	mov	QWORD PTR -568[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR verbose_level[rip]
	cmp	eax, 2
	jle	.L48
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -568[rbp]
	mov	rcx, rdx
	lea	rdx, __func__.4[rip]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L48
.L51:
	mov	eax, 512
	cmp	QWORD PTR -568[rbp], 512
	cmovbe	rax, QWORD PTR -568[rbp]
	mov	DWORD PTR -532[rbp], eax
	mov	eax, DWORD PTR -532[rbp]
	movsx	rdx, eax
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -556[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -532[rbp], eax
	cmp	DWORD PTR -532[rbp], 0
	jns	.L49
	mov	rax, QWORD PTR -552[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	eax, -1
	jmp	.L52
.L49:
	mov	eax, DWORD PTR -532[rbp]
	cdqe
	sub	QWORD PTR -568[rbp], rax
.L48:
	cmp	QWORD PTR -568[rbp], 0
	jne	.L51
	mov	eax, 0
.L52:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L53
	call	__stack_chk_fail@PLT
.L53:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	discard, .-discard
	.type	copy_data, @function
copy_data:
.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, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	mov	QWORD PTR -48[rbp], rcx
	mov	eax, DWORD PTR verbose_level[rip]
	cmp	eax, 2
	jle	.L55
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -48[rbp]
	mov	rcx, rdx
	lea	rdx, __func__.3[rip]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L55:
	mov	DWORD PTR -8[rbp], 0
	jmp	.L56
.L59:
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	lea	rcx, [rdx+rax]
	mov	rdx, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L57
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	eax, -1
	jmp	.L58
.L57:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sub	QWORD PTR -48[rbp], rax
	mov	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -8[rbp], eax
.L56:
	cmp	QWORD PTR -48[rbp], 0
	jne	.L59
	mov	eax, 0
.L58:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	copy_data, .-copy_data
	.type	copy_file, @function
copy_file:
.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, 576
	mov	QWORD PTR -552[rbp], rdi
	mov	DWORD PTR -556[rbp], esi
	mov	QWORD PTR -568[rbp], rdx
	mov	DWORD PTR -560[rbp], ecx
	mov	QWORD PTR -576[rbp], r8
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR verbose_level[rip]
	cmp	eax, 2
	jle	.L62
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -576[rbp]
	mov	rcx, rdx
	lea	rdx, __func__.2[rip]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L62
.L66:
	mov	eax, 512
	cmp	QWORD PTR -576[rbp], 512
	cmovbe	rax, QWORD PTR -576[rbp]
	mov	DWORD PTR -532[rbp], eax
	mov	eax, DWORD PTR -532[rbp]
	movsx	rdx, eax
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -556[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -532[rbp], eax
	cmp	DWORD PTR -532[rbp], 0
	jns	.L63
	mov	rax, QWORD PTR -552[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	eax, -1
	jmp	.L67
.L63:
	mov	eax, DWORD PTR -532[rbp]
	movsx	rcx, eax
	mov	edx, DWORD PTR -560[rbp]
	mov	rsi, QWORD PTR -568[rbp]
	lea	rax, -528[rbp]
	mov	rdi, rax
	call	copy_data
	test	eax, eax
	je	.L65
	mov	eax, -1
	jmp	.L67
.L65:
	mov	eax, DWORD PTR -532[rbp]
	cdqe
	sub	QWORD PTR -576[rbp], rax
.L62:
	cmp	QWORD PTR -576[rbp], 0
	jne	.L66
	mov	eax, 0
.L67:
	mov	rdi, QWORD PTR -8[rbp]
	sub	rdi, QWORD PTR fs:40
	je	.L68
	call	__stack_chk_fail@PLT
.L68:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	copy_file, .-copy_file
	.section	.rodata
.LC10:
	.string	"%s:to EOF\n"
	.text
	.type	copy_file_remaining, @function
copy_file_remaining:
.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, 576
	mov	QWORD PTR -552[rbp], rdi
	mov	DWORD PTR -556[rbp], esi
	mov	QWORD PTR -568[rbp], rdx
	mov	DWORD PTR -560[rbp], ecx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR verbose_level[rip]
	cmp	eax, 2
	jle	.L71
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, __func__.1[rip]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L71
.L74:
	cmp	DWORD PTR -532[rbp], 0
	jns	.L72
	mov	rax, QWORD PTR -552[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	eax, -1
	jmp	.L75
.L72:
	mov	eax, DWORD PTR -532[rbp]
	movsx	rcx, eax
	mov	edx, DWORD PTR -560[rbp]
	mov	rsi, QWORD PTR -568[rbp]
	lea	rax, -528[rbp]
	mov	rdi, rax
	call	copy_data
	test	eax, eax
	je	.L71
	mov	eax, -1
	jmp	.L75
.L71:
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -556[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -532[rbp], eax
	cmp	DWORD PTR -532[rbp], 0
	jne	.L74
	mov	eax, 0
.L75:
	mov	rdi, QWORD PTR -8[rbp]
	sub	rdi, QWORD PTR fs:40
	je	.L76
	call	__stack_chk_fail@PLT
.L76:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	copy_file_remaining, .-copy_file_remaining
	.type	fill_data, @function
fill_data:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 576
	mov	eax, edi
	mov	QWORD PTR -560[rbp], rsi
	mov	DWORD PTR -552[rbp], edx
	mov	QWORD PTR -568[rbp], rcx
	mov	BYTE PTR -548[rbp], al
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR verbose_level[rip]
	cmp	eax, 2
	jle	.L78
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -568[rbp]
	mov	rcx, rdx
	lea	rdx, __func__.0[rip]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L78:
	movzx	ecx, BYTE PTR -548[rbp]
	lea	rax, -528[rbp]
	mov	edx, 512
	mov	esi, ecx
	mov	rdi, rax
	call	memset@PLT
	jmp	.L79
.L82:
	mov	eax, 512
	cmp	QWORD PTR -568[rbp], 512
	cmovbe	rax, QWORD PTR -568[rbp]
	mov	DWORD PTR -532[rbp], eax
	mov	eax, DWORD PTR -532[rbp]
	movsx	rcx, eax
	mov	edx, DWORD PTR -552[rbp]
	mov	rsi, QWORD PTR -560[rbp]
	lea	rax, -528[rbp]
	mov	rdi, rax
	call	copy_data
	test	eax, eax
	je	.L80
	mov	eax, -1
	jmp	.L83
.L80:
	mov	eax, DWORD PTR -532[rbp]
	cdqe
	sub	QWORD PTR -568[rbp], rax
.L79:
	cmp	QWORD PTR -568[rbp], 0
	jne	.L82
	mov	eax, 0
.L83:
	mov	rdi, QWORD PTR -8[rbp]
	sub	rdi, QWORD PTR fs:40
	je	.L84
	call	__stack_chk_fail@PLT
.L84:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	fill_data, .-fill_data
	.section	.rodata
.LC11:
	.string	"WRITE %d-%d\n"
.LC12:
	.string	"PATCH %d-%d\n"
.LC13:
	.string	"WRITE %d-EOF\n"
	.text
	.type	apply_patch, @function
apply_patch:
.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, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -52[rbp], edx
	mov	QWORD PTR -64[rbp], rcx
	mov	DWORD PTR -56[rbp], r8d
	mov	DWORD PTR -24[rbp], 0
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L86
.L95:
	mov	eax, DWORD PTR verbose_level[rip]
	cmp	eax, 1
	jle	.L87
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 4[rax]
	lea	ecx, -1[rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -24[rbp]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L87:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 4[rax]
	sub	eax, DWORD PTR -24[rbp]
	mov	eax, eax
	mov	QWORD PTR -8[rbp], rax
	mov	rdi, QWORD PTR -8[rbp]
	mov	ecx, DWORD PTR -56[rbp]
	mov	rdx, QWORD PTR -64[rbp]
	mov	esi, DWORD PTR -52[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	r8, rdi
	mov	rdi, rax
	call	copy_file
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	je	.L88
	mov	eax, -1
	jmp	.L89
.L88:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	add	eax, edx
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR verbose_level[rip]
	cmp	eax, 1
	jle	.L90
	mov	eax, DWORD PTR -24[rbp]
	lea	ecx, -1[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L90:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	edx, eax
	mov	ecx, DWORD PTR -52[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	discard
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	je	.L91
	mov	eax, -1
	jmp	.L89
.L91:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	je	.L92
	cmp	eax, 1
	jne	.L93
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	ecx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	edx, DWORD PTR -56[rbp]
	mov	rsi, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	copy_data
	mov	DWORD PTR -20[rbp], eax
	jmp	.L93
.L92:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	ecx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 16[rax]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	edx, DWORD PTR -56[rbp]
	mov	rsi, QWORD PTR -64[rbp]
	mov	edi, eax
	call	fill_data
	mov	DWORD PTR -20[rbp], eax
	nop
.L93:
	cmp	DWORD PTR -20[rbp], 0
	je	.L94
	mov	eax, -1
	jmp	.L89
.L94:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	QWORD PTR -16[rbp], rax
.L86:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L95
	mov	eax, DWORD PTR verbose_level[rip]
	cmp	eax, 1
	jle	.L96
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -24[rbp]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L96:
	mov	ecx, DWORD PTR -56[rbp]
	mov	rdx, QWORD PTR -64[rbp]
	mov	esi, DWORD PTR -52[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	copy_file_remaining
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	je	.L97
	mov	eax, -1
	jmp	.L89
.L97:
	mov	eax, 0
.L89:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	apply_patch, .-apply_patch
	.section	.rodata
.LC14:
	.string	"%s: Error loading patch\n"
	.text
	.type	patch, @function
patch:
.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, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -56[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -16[rbp], 0
	lea	rdx, -16[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	load_patch
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L99
	mov	eax, DWORD PTR verbose_level[rip]
	test	eax, eax
	jle	.L100
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -40[rbp]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L100:
	mov	eax, -1
	jmp	.L105
.L99:
	mov	rax, QWORD PTR -48[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	jns	.L102
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	eax, -1
	jmp	.L105
.L102:
	mov	rax, QWORD PTR -56[rbp]
	mov	edx, 438
	mov	esi, 193
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jns	.L103
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	perror@PLT
	nop
.L104:
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free_patch
	mov	eax, -1
	jmp	.L105
.L103:
	mov	rax, QWORD PTR -16[rbp]
	mov	edi, DWORD PTR -20[rbp]
	mov	rcx, QWORD PTR -56[rbp]
	mov	edx, DWORD PTR -24[rbp]
	mov	rsi, QWORD PTR -48[rbp]
	mov	r8d, edi
	mov	rdi, rax
	call	apply_patch
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free_patch
	mov	eax, DWORD PTR -28[rbp]
.L105:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L106
	call	__stack_chk_fail@PLT
.L106:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	patch, .-patch
	.section	.rodata
	.align 8
.LC15:
	.string	"Usage: %s [-hvq] patchfile in out\n"
.LC16:
	.string	"hvq"
.LC17:
	.string	"%s: Failed to patch\n"
	.text
	.globl	main
	.type	main, @function
main:
.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	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -24[rbp], 0
	mov	QWORD PTR -16[rbp], 0
	mov	QWORD PTR -8[rbp], 0
	jmp	.L108
.L113:
	cmp	DWORD PTR -32[rbp], 113
	je	.L109
	cmp	DWORD PTR -32[rbp], 118
	je	.L110
	jmp	.L111
.L117:
	nop
.L111:
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L112
.L110:
	mov	eax, DWORD PTR verbose_level[rip]
	add	eax, 1
	mov	DWORD PTR verbose_level[rip], eax
	jmp	.L108
.L109:
	mov	DWORD PTR verbose_level[rip], 0
	nop
.L108:
	mov	rcx, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR -36[rbp]
	lea	rdx, .LC16[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR -32[rbp], eax
	cmp	DWORD PTR -32[rbp], -1
	jne	.L113
	mov	eax, DWORD PTR optind[rip]
	add	eax, 2
	cmp	DWORD PTR -36[rbp], eax
	jle	.L117
	mov	eax, DWORD PTR optind[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -24[rbp], rax
	mov	eax, DWORD PTR optind[rip]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	mov	eax, DWORD PTR optind[rip]
	cdqe
	add	rax, 2
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rdx, QWORD PTR -8[rbp]
	mov	rcx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	patch
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L115
	mov	eax, DWORD PTR verbose_level[rip]
	test	eax, eax
	jle	.L116
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC17[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L116:
	mov	eax, 1
	jmp	.L112
.L115:
	mov	eax, 0
.L112:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	main, .-main
	.section	.rodata
	.align 8
	.type	__PRETTY_FUNCTION__.5, @object
	.size	__PRETTY_FUNCTION__.5, 11
__PRETTY_FUNCTION__.5:
	.string	"load_patch"
	.align 8
	.type	__func__.4, @object
	.size	__func__.4, 8
__func__.4:
	.string	"discard"
	.align 8
	.type	__func__.3, @object
	.size	__func__.3, 10
__func__.3:
	.string	"copy_data"
	.align 8
	.type	__func__.2, @object
	.size	__func__.2, 10
__func__.2:
	.string	"copy_file"
	.align 16
	.type	__func__.1, @object
	.size	__func__.1, 20
__func__.1:
	.string	"copy_file_remaining"
	.align 8
	.type	__func__.0, @object
	.size	__func__.0, 10
__func__.0:
	.string	"fill_data"
	.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	"147014220.c"
	.text
	.data
	.align	2
	.type	verbose_level, %object
	.size	verbose_level, 4
verbose_level:
	.word	1
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	new_patch, %function
new_patch:
	@ args = 4, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	str	r3, [fp, #-28]
	b	.L2
.L4:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	add	r3, r3, #16
	str	r3, [fp, #-16]
.L2:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L3
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bhi	.L4
.L3:
	mov	r1, #20
	mov	r0, #1
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-24]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-28]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #4]
	str	r2, [r3, #12]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	str	r2, [r3, #16]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	new_patch, .-new_patch
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	free_patch, %function
free_patch:
	@ 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]
	b	.L6
.L7:
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #12]
	mov	r0, r3
	bl	free
	ldr	r0, [fp, #-8]
	bl	free
.L6:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L7
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	free_patch, .-free_patch
	.section	.rodata
	.align	2
.LC0:
	.ascii	"EOF\000"
	.align	2
.LC1:
	.ascii	"EOF RECORD detected\012\000"
	.align	2
.LC2:
	.ascii	"RECORD! offset=%d size=%d\012\000"
	.align	2
.LC3:
	.ascii	"%s: Truncated file detected\012\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_record, %function
read_record:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	str	r2, [fp, #-56]
	str	r3, [fp, #-60]
	ldr	r3, .L28
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #12
	mov	r2, #3
	mov	r1, r3
	ldr	r0, [fp, #-52]
	bl	read
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #2
	ble	.L25
	sub	r3, fp, #12
	mov	r2, #3
	ldr	r1, .L28+4
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L11
	ldr	r3, .L28+8
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L12
	ldr	r3, .L28+12
	ldr	r3, [r3]
	mov	r2, #20
	mov	r1, #1
	ldr	r0, .L28+16
	bl	fwrite
.L12:
	ldr	r3, [fp, #-56]
	mov	r2, #0
	str	r2, [r3]
	mov	r3, #0
	b	.L23
.L11:
	ldrb	r3, [fp, #-12]	@ zero_extendqisi2
	lsl	r3, r3, #16
	and	r2, r3, #16711680
	ldrb	r3, [fp, #-11]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	orr	r3, r2, r3
	ldrb	r2, [fp, #-10]	@ zero_extendqisi2
	orr	r3, r3, r2
	str	r3, [fp, #-36]
	sub	r3, fp, #20
	mov	r2, #2
	mov	r1, r3
	ldr	r0, [fp, #-52]
	bl	read
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	ble	.L26
	ldrb	r3, [fp, #-20]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldrb	r2, [fp, #-19]	@ zero_extendqisi2
	orr	r3, r3, r2
	str	r3, [fp, #-32]
	ldr	r3, .L28+8
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L15
	ldr	r3, .L28+12
	ldr	r0, [r3]
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-36]
	ldr	r1, .L28+20
	bl	fprintf
.L15:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L16
	ldr	r0, [fp, #-32]
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-52]
	bl	read
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-40]
	cmp	r2, r3
	beq	.L17
	ldr	r0, [fp, #-24]
	bl	free
	b	.L10
.L17:
	ldr	r3, [fp, #-24]
	str	r3, [sp]
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-36]
	mov	r1, #1
	ldr	r0, [fp, #-60]
	bl	new_patch
	b	.L18
.L16:
	sub	r3, fp, #16
	mov	r2, #2
	mov	r1, r3
	ldr	r0, [fp, #-52]
	bl	read
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	ble	.L27
	ldrb	r3, [fp, #-16]	@ zero_extendqisi2
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldrb	r2, [fp, #-15]	@ zero_extendqisi2
	orr	r3, r3, r2
	str	r3, [fp, #-28]
	mov	r0, #1
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-44]
	sub	r3, fp, #44
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-52]
	bl	read
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	beq	.L21
	ldr	r3, [fp, #-44]
	mov	r0, r3
	bl	free
	b	.L10
.L21:
	ldr	r3, [fp, #-44]
	str	r3, [sp]
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-36]
	mov	r1, #0
	ldr	r0, [fp, #-60]
	bl	new_patch
.L18:
	ldr	r3, [fp, #-56]
	mov	r2, #0
	str	r2, [r3]
	mvn	r3, #0
	b	.L23
.L25:
	nop
	b	.L10
.L26:
	nop
	b	.L10
.L27:
	nop
.L10:
	ldr	r3, .L28+8
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L22
	ldr	r3, .L28+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-48]
	ldr	r1, .L28+24
	mov	r0, r3
	bl	fprintf
.L22:
	ldr	r3, [fp, #-56]
	mov	r2, #1
	str	r2, [r3]
	mov	r3, #0
.L23:
	ldr	r2, .L28
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L24
	bl	__stack_chk_fail
.L24:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC4
	.word	.LC0
	.word	verbose_level
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	read_record, .-read_record
	.section	.rodata
	.align	2
.LC5:
	.ascii	"the_stack_data/147014220.c\000"
	.align	2
.LC6:
	.ascii	"patchfile != NULL\000"
	.align	2
.LC7:
	.ascii	"PATCH\000"
	.align	2
.LC8:
	.ascii	"%s: Header signature invalid\012\000"
	.align	2
.LC9:
	.ascii	"%s: Error reading patch file\012\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	load_patch, %function
load_patch:
	@ 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, .L48
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L31
	ldr	r3, .L48+4
	mov	r2, #171
	ldr	r1, .L48+8
	ldr	r0, .L48+12
	bl	__assert_fail
.L31:
	mov	r1, #0
	ldr	r0, [fp, #-32]
	bl	open
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L32
	ldr	r0, [fp, #-32]
	bl	perror
	mvn	r3, #0
	b	.L42
.L32:
	sub	r3, fp, #16
	mov	r2, #5
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	read
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #4
	ble	.L45
	sub	r3, fp, #16
	mov	r2, #5
	ldr	r1, .L48+16
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L36
	ldr	r3, .L48+20
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L46
	ldr	r3, .L48+24
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	ldr	r1, .L48+28
	mov	r0, r3
	bl	fprintf
	b	.L46
.L36:
	mov	r3, #0
	str	r3, [fp, #-28]
	nop
.L39:
	sub	r2, fp, #28
	ldr	r3, [fp, #-36]
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-32]
	bl	read_record
	mov	r3, r0
	cmp	r3, #0
	bne	.L39
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L40
	ldr	r3, .L48+20
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L47
	ldr	r3, .L48+24
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	ldr	r1, .L48+32
	mov	r0, r3
	bl	fprintf
	b	.L47
.L40:
	ldr	r0, [fp, #-24]
	bl	close
	mov	r3, #0
	b	.L42
.L45:
	nop
.L35:
	ldr	r0, [fp, #-32]
	bl	perror
	b	.L38
.L46:
	nop
	b	.L38
.L47:
	nop
.L38:
	ldr	r0, [fp, #-24]
	bl	close
	mvn	r3, #0
.L42:
	ldr	r2, .L48
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L43
	bl	__stack_chk_fail
.L43:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L49:
	.align	2
.L48:
	.word	.LC10
	.word	__PRETTY_FUNCTION__.6103
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	verbose_level
	.word	stderr
	.word	.LC8
	.word	.LC9
	.size	load_patch, .-load_patch
	.section	.rodata
	.align	2
.LC11:
	.ascii	"%s:bytes=%zd\012\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	discard, %function
discard:
	@ args = 0, pretend = 0, frame = 536
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #536
	str	r0, [fp, #-528]
	str	r1, [fp, #-532]
	str	r2, [fp, #-536]
	ldr	r3, .L58
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L58+4
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L52
	ldr	r3, .L58+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-536]
	ldr	r2, .L58+12
	ldr	r1, .L58+16
	bl	fprintf
	b	.L52
.L55:
	ldr	r3, [fp, #-536]
	cmp	r3, #512
	movcc	r3, r3
	movcs	r3, #512
	str	r3, [fp, #-524]
	ldr	r2, [fp, #-524]
	sub	r3, fp, #520
	mov	r1, r3
	ldr	r0, [fp, #-532]
	bl	read
	str	r0, [fp, #-524]
	ldr	r3, [fp, #-524]
	cmp	r3, #0
	bge	.L53
	ldr	r0, [fp, #-528]
	bl	perror
	mvn	r3, #0
	b	.L56
.L53:
	ldr	r3, [fp, #-524]
	ldr	r2, [fp, #-536]
	sub	r3, r2, r3
	str	r3, [fp, #-536]
.L52:
	ldr	r3, [fp, #-536]
	cmp	r3, #0
	bne	.L55
	mov	r3, #0
.L56:
	ldr	r2, .L58
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L57
	bl	__stack_chk_fail
.L57:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L59:
	.align	2
.L58:
	.word	.LC12
	.word	verbose_level
	.word	stderr
	.word	__func__.6116
	.word	.LC11
	.size	discard, .-discard
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	copy_data, %function
copy_data:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	str	r3, [fp, #-28]
	ldr	r3, .L66
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L61
	ldr	r3, .L66+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-28]
	ldr	r2, .L66+8
	ldr	r1, .L66+12
	bl	fprintf
.L61:
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L62
.L65:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-28]
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	write
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L63
	ldr	r0, [fp, #-20]
	bl	perror
	mvn	r3, #0
	b	.L64
.L63:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-28]
	sub	r3, r2, r3
	str	r3, [fp, #-28]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-12]
.L62:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L65
	mov	r3, #0
.L64:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L67:
	.align	2
.L66:
	.word	verbose_level
	.word	stderr
	.word	__func__.6128
	.word	.LC11
	.size	copy_data, .-copy_data
	.section	.rodata
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	copy_file, %function
copy_file:
	@ args = 4, pretend = 0, frame = 536
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #536
	str	r0, [fp, #-528]
	str	r1, [fp, #-532]
	str	r2, [fp, #-536]
	str	r3, [fp, #-540]
	ldr	r3, .L77
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L77+4
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L70
	ldr	r3, .L77+8
	ldr	r0, [r3]
	ldr	r3, [fp, #4]
	ldr	r2, .L77+12
	ldr	r1, .L77+16
	bl	fprintf
	b	.L70
.L74:
	ldr	r3, [fp, #4]
	cmp	r3, #512
	movcc	r3, r3
	movcs	r3, #512
	str	r3, [fp, #-524]
	ldr	r2, [fp, #-524]
	sub	r3, fp, #520
	mov	r1, r3
	ldr	r0, [fp, #-532]
	bl	read
	str	r0, [fp, #-524]
	ldr	r3, [fp, #-524]
	cmp	r3, #0
	bge	.L71
	ldr	r0, [fp, #-528]
	bl	perror
	mvn	r3, #0
	b	.L75
.L71:
	ldr	r3, [fp, #-524]
	sub	r0, fp, #520
	ldr	r2, [fp, #-540]
	ldr	r1, [fp, #-536]
	bl	copy_data
	mov	r3, r0
	cmp	r3, #0
	beq	.L73
	mvn	r3, #0
	b	.L75
.L73:
	ldr	r3, [fp, #-524]
	ldr	r2, [fp, #4]
	sub	r3, r2, r3
	str	r3, [fp, #4]
.L70:
	ldr	r3, [fp, #4]
	cmp	r3, #0
	bne	.L74
	mov	r3, #0
.L75:
	ldr	r2, .L77
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L76
	bl	__stack_chk_fail
.L76:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L78:
	.align	2
.L77:
	.word	.LC13
	.word	verbose_level
	.word	stderr
	.word	__func__.6141
	.word	.LC11
	.size	copy_file, .-copy_file
	.section	.rodata
	.align	2
.LC14:
	.ascii	"%s:to EOF\012\000"
	.align	2
.LC15:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	copy_file_remaining, %function
copy_file_remaining:
	@ args = 0, pretend = 0, frame = 536
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #536
	str	r0, [fp, #-528]
	str	r1, [fp, #-532]
	str	r2, [fp, #-536]
	str	r3, [fp, #-540]
	ldr	r3, .L87
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L87+4
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L81
	ldr	r3, .L87+8
	ldr	r3, [r3]
	ldr	r2, .L87+12
	ldr	r1, .L87+16
	mov	r0, r3
	bl	fprintf
	b	.L81
.L84:
	ldr	r3, [fp, #-524]
	cmp	r3, #0
	bge	.L82
	ldr	r0, [fp, #-528]
	bl	perror
	mvn	r3, #0
	b	.L85
.L82:
	ldr	r3, [fp, #-524]
	sub	r0, fp, #520
	ldr	r2, [fp, #-540]
	ldr	r1, [fp, #-536]
	bl	copy_data
	mov	r3, r0
	cmp	r3, #0
	beq	.L81
	mvn	r3, #0
	b	.L85
.L81:
	sub	r3, fp, #520
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [fp, #-532]
	bl	read
	str	r0, [fp, #-524]
	ldr	r3, [fp, #-524]
	cmp	r3, #0
	bne	.L84
	mov	r3, #0
.L85:
	ldr	r2, .L87
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L86
	bl	__stack_chk_fail
.L86:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L88:
	.align	2
.L87:
	.word	.LC15
	.word	verbose_level
	.word	stderr
	.word	__func__.6153
	.word	.LC14
	.size	copy_file_remaining, .-copy_file_remaining
	.section	.rodata
	.align	2
.LC16:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	fill_data, %function
fill_data:
	@ args = 0, pretend = 0, frame = 536
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #536
	str	r1, [fp, #-532]
	str	r2, [fp, #-536]
	str	r3, [fp, #-540]
	mov	r3, r0
	strb	r3, [fp, #-525]
	ldr	r3, .L97
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L97+4
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L90
	ldr	r3, .L97+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-540]
	ldr	r2, .L97+12
	ldr	r1, .L97+16
	bl	fprintf
.L90:
	ldrb	r1, [fp, #-525]	@ zero_extendqisi2
	sub	r3, fp, #520
	mov	r2, #512
	mov	r0, r3
	bl	memset
	b	.L91
.L94:
	ldr	r3, [fp, #-540]
	cmp	r3, #512
	movcc	r3, r3
	movcs	r3, #512
	str	r3, [fp, #-524]
	ldr	r3, [fp, #-524]
	sub	r0, fp, #520
	ldr	r2, [fp, #-536]
	ldr	r1, [fp, #-532]
	bl	copy_data
	mov	r3, r0
	cmp	r3, #0
	beq	.L92
	mvn	r3, #0
	b	.L95
.L92:
	ldr	r3, [fp, #-524]
	ldr	r2, [fp, #-540]
	sub	r3, r2, r3
	str	r3, [fp, #-540]
.L91:
	ldr	r3, [fp, #-540]
	cmp	r3, #0
	bne	.L94
	mov	r3, #0
.L95:
	ldr	r2, .L97
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L96
	bl	__stack_chk_fail
.L96:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L98:
	.align	2
.L97:
	.word	.LC16
	.word	verbose_level
	.word	stderr
	.word	__func__.6165
	.word	.LC11
	.size	fill_data, .-fill_data
	.section	.rodata
	.align	2
.LC17:
	.ascii	"WRITE %d-%d\012\000"
	.align	2
.LC18:
	.ascii	"PATCH %d-%d\012\000"
	.align	2
.LC19:
	.ascii	"WRITE %d-EOF\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	apply_patch, %function
apply_patch:
	@ args = 4, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-16]
	b	.L100
.L109:
	ldr	r3, .L112
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L101
	ldr	r3, .L112+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	sub	r3, r3, #1
	ldr	r2, [fp, #-20]
	ldr	r1, .L112+8
	bl	fprintf
.L101:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	str	r3, [sp]
	ldr	r3, [fp, #4]
	ldr	r2, [fp, #-36]
	ldr	r1, [fp, #-32]
	ldr	r0, [fp, #-28]
	bl	copy_file
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L102
	mvn	r3, #0
	b	.L103
.L102:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #8]
	add	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, .L112
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L104
	ldr	r3, .L112+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	ldr	r1, .L112+12
	bl	fprintf
.L104:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #8]
	mov	r2, r3
	ldr	r1, [fp, #-32]
	ldr	r0, [fp, #-28]
	bl	discard
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L105
	mvn	r3, #0
	b	.L103
.L105:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L106
	cmp	r3, #1
	bne	.L107
	ldr	r3, [fp, #-16]
	ldr	r0, [r3, #12]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #8]
	ldr	r2, [fp, #4]
	ldr	r1, [fp, #-36]
	bl	copy_data
	str	r0, [fp, #-12]
	b	.L107
.L106:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #12]
	ldrb	r0, [r3]	@ zero_extendqisi2
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #8]
	ldr	r2, [fp, #4]
	ldr	r1, [fp, #-36]
	bl	fill_data
	str	r0, [fp, #-12]
	nop
.L107:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L108
	mvn	r3, #0
	b	.L103
.L108:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-16]
.L100:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L109
	ldr	r3, .L112
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L110
	ldr	r3, .L112+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	ldr	r1, .L112+16
	mov	r0, r3
	bl	fprintf
.L110:
	ldr	r3, [fp, #4]
	ldr	r2, [fp, #-36]
	ldr	r1, [fp, #-32]
	ldr	r0, [fp, #-28]
	bl	copy_file_remaining
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L111
	mvn	r3, #0
	b	.L103
.L111:
	mov	r3, #0
.L103:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L113:
	.align	2
.L112:
	.word	verbose_level
	.word	stderr
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.size	apply_patch, .-apply_patch
	.section	.rodata
	.align	2
.LC20:
	.ascii	"%s: Error loading patch\012\000"
	.align	2
.LC21:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	patch, %function
patch:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	ldr	r3, .L123
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-24]
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	load_patch
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L115
	ldr	r3, .L123+4
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L116
	ldr	r3, .L123+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	ldr	r1, .L123+12
	mov	r0, r3
	bl	fprintf
.L116:
	mvn	r3, #0
	b	.L121
.L115:
	mov	r1, #0
	ldr	r0, [fp, #-36]
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L118
	ldr	r0, [fp, #-36]
	bl	perror
	mvn	r3, #0
	b	.L121
.L118:
	ldr	r2, .L123+16
	mov	r1, #193
	ldr	r0, [fp, #-40]
	bl	open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L119
	ldr	r0, [fp, #-40]
	bl	perror
	nop
.L120:
	ldr	r0, [fp, #-16]
	bl	close
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	free_patch
	mvn	r3, #0
	b	.L121
.L119:
	ldr	r0, [fp, #-24]
	ldr	r3, [fp, #-12]
	str	r3, [sp]
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-16]
	ldr	r1, [fp, #-36]
	bl	apply_patch
	str	r0, [fp, #-20]
	ldr	r0, [fp, #-12]
	bl	close
	ldr	r0, [fp, #-16]
	bl	close
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	free_patch
	ldr	r3, [fp, #-20]
.L121:
	ldr	r2, .L123
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L122
	bl	__stack_chk_fail
.L122:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L124:
	.align	2
.L123:
	.word	.LC21
	.word	verbose_level
	.word	stderr
	.word	.LC20
	.word	438
	.size	patch, .-patch
	.section	.rodata
	.align	2
.LC22:
	.ascii	"Usage: %s [-hvq] patchfile in out\012\000"
	.align	2
.LC23:
	.ascii	"hvq\000"
	.align	2
.LC24:
	.ascii	"%s: Failed to patch\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L126
.L131:
	ldr	r3, [fp, #-12]
	cmp	r3, #113
	beq	.L127
	ldr	r3, [fp, #-12]
	cmp	r3, #118
	beq	.L128
	b	.L129
.L135:
	nop
.L129:
	ldr	r3, .L136
	ldr	r0, [r3]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L136+4
	bl	fprintf
	mov	r3, #1
	b	.L130
.L128:
	ldr	r3, .L136+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L136+8
	str	r3, [r2]
	b	.L126
.L127:
	ldr	r3, .L136+8
	mov	r2, #0
	str	r2, [r3]
	nop
.L126:
	ldr	r2, .L136+12
	ldr	r1, [fp, #-36]
	ldr	r0, [fp, #-32]
	bl	getopt
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L131
	ldr	r3, .L136+16
	ldr	r3, [r3]
	add	r3, r3, #2
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	ble	.L135
	ldr	r3, .L136+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	ldr	r3, .L136+16
	ldr	r3, [r3]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-20]
	ldr	r3, .L136+16
	ldr	r3, [r3]
	add	r3, r3, #2
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-16]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-24]
	bl	patch
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L133
	ldr	r3, .L136+8
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L134
	ldr	r3, .L136
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	ldr	r1, .L136+20
	mov	r0, r3
	bl	fprintf
.L134:
	mov	r3, #1
	b	.L130
.L133:
	mov	r3, #0
.L130:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L137:
	.align	2
.L136:
	.word	stderr
	.word	.LC22
	.word	verbose_level
	.word	.LC23
	.word	optind
	.word	.LC24
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.6103, %object
	.size	__PRETTY_FUNCTION__.6103, 11
__PRETTY_FUNCTION__.6103:
	.ascii	"load_patch\000"
	.align	2
	.type	__func__.6116, %object
	.size	__func__.6116, 8
__func__.6116:
	.ascii	"discard\000"
	.align	2
	.type	__func__.6128, %object
	.size	__func__.6128, 10
__func__.6128:
	.ascii	"copy_data\000"
	.align	2
	.type	__func__.6141, %object
	.size	__func__.6141, 10
__func__.6141:
	.ascii	"copy_file\000"
	.align	2
	.type	__func__.6153, %object
	.size	__func__.6153, 20
__func__.6153:
	.ascii	"copy_file_remaining\000"
	.align	2
	.type	__func__.6165, %object
	.size	__func__.6165, 10
__func__.6165:
	.ascii	"fill_data\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
