	.file	"514332.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"r"
	.align 8
.LC1:
	.string	"   Can't open '%s' for reading.\n"
.LC2:
	.string	"r+"
	.align 8
.LC3:
	.string	"   Can't open '%s' for writing.\n"
.LC4:
	.string	"Not able to get file size %s"
.LC5:
	.string	"Not able to merge %s"
	.text
	.globl	merge_flash
	.type	merge_flash, @function
merge_flash:
.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, 80
	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	DWORD PTR -44[rbp], 0
	mov	DWORD PTR -40[rbp], 0
	mov	DWORD PTR -36[rbp], 0
	mov	rax, QWORD PTR -56[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L2
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L1
.L2:
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	DWORD PTR -40[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -64[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L4
	mov	rax, QWORD PTR -64[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L1
.L4:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	DWORD PTR -36[rbp], eax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	rewind@PLT
	mov	eax, DWORD PTR -68[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	eax, DWORD PTR -40[rbp]
	add	eax, 1
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	DWORD PTR -40[rbp], 0
	jg	.L5
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
.L5:
	mov	eax, DWORD PTR -40[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -32[rbp], eax
	cmp	DWORD PTR -72[rbp], 1
	jne	.L6
	mov	DWORD PTR -44[rbp], 0
	jmp	.L7
.L8:
	mov	eax, DWORD PTR -40[rbp]
	sub	eax, DWORD PTR -44[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -44[rbp], 1
.L7:
	cmp	DWORD PTR -44[rbp], 32
	jle	.L8
.L6:
	mov	eax, DWORD PTR -40[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	je	.L9
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
.L9:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 0
	mov	esi, 16384000
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge_flash, .-merge_flash
	.section	.rodata
	.align 8
.LC6:
	.string	"dd if=/dev/zero bs=1M count=4  | tr \"\\000\" \"\\377\" >  esp32flash.bin"
.LC7:
	.string	"esp32flash.bin"
	.align 8
.LC8:
	.string	"build/bootloader/bootloader.bin"
.LC9:
	.string	"build/default.bin"
	.align 8
.LC10:
	.string	"cp esp32flash.bin ~/qemu_esp32"
	.text
	.globl	main
	.type	main, @function
main:
.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	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	lea	rdi, .LC6[rip]
	call	system@PLT
	mov	ecx, 0
	mov	edx, 4096
	lea	rsi, .LC7[rip]
	lea	rdi, .LC8[rip]
	call	merge_flash
	mov	ecx, 0
	mov	edx, 32768
	lea	rsi, .LC7[rip]
	lea	rdi, .LC9[rip]
	call	merge_flash
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	ecx, 0
	mov	edx, 65536
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	merge_flash
	lea	rdi, .LC10[rip]
	call	system@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"514332.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"   Can't open '%s' for reading.\012\000"
	.align	2
.LC2:
	.ascii	"r+\000"
	.align	2
.LC3:
	.ascii	"   Can't open '%s' for writing.\012\000"
	.align	2
.LC4:
	.ascii	"Not able to get file size %s\000"
	.align	2
.LC5:
	.ascii	"Not able to merge %s\000"
	.text
	.align	2
	.global	merge_flash
	.syntax unified
	.arm
	.fpu softvfp
	.type	merge_flash, %function
merge_flash:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	str	r2, [fp, #-48]
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-28]
	ldr	r1, .L10
	ldr	r0, [fp, #-40]
	bl	fopen
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L2
	ldr	r1, [fp, #-40]
	ldr	r0, .L10+4
	bl	printf
	b	.L1
.L2:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-24]
	bl	fseek
	ldr	r0, [fp, #-24]
	bl	ftell
	str	r0, [fp, #-32]
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-24]
	bl	fseek
	ldr	r1, .L10+8
	ldr	r0, [fp, #-44]
	bl	fopen
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L4
	ldr	r1, [fp, #-44]
	ldr	r0, .L10+12
	bl	printf
	b	.L1
.L4:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-20]
	bl	fseek
	ldr	r0, [fp, #-20]
	bl	ftell
	str	r0, [fp, #-28]
	ldr	r0, [fp, #-20]
	bl	rewind
	mov	r2, #0
	ldr	r1, [fp, #-48]
	ldr	r0, [fp, #-20]
	bl	fseek
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bgt	.L5
	ldr	r1, [fp, #-40]
	ldr	r0, .L10+16
	bl	printf
.L5:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-24]
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-52]
	cmp	r3, #1
	bne	.L6
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L7
.L8:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-36]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, r2
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L7:
	ldr	r3, [fp, #-36]
	cmp	r3, #32
	ble	.L8
.L6:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-20]
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	fwrite
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	beq	.L9
	ldr	r1, [fp, #-40]
	ldr	r0, .L10+20
	bl	printf
.L9:
	ldr	r0, [fp, #-24]
	bl	fclose
	mov	r2, #0
	mov	r1, #16384000
	ldr	r0, [fp, #-20]
	bl	fseek
	ldr	r0, [fp, #-20]
	bl	fclose
	ldr	r0, [fp, #-16]
	bl	free
.L1:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	merge_flash, .-merge_flash
	.section	.rodata
	.align	2
.LC6:
	.ascii	"dd if=/dev/zero bs=1M count=4  | tr \"\\000\" \"\\3"
	.ascii	"77\" >  esp32flash.bin\000"
	.align	2
.LC7:
	.ascii	"esp32flash.bin\000"
	.align	2
.LC8:
	.ascii	"build/bootloader/bootloader.bin\000"
	.align	2
.LC9:
	.ascii	"build/default.bin\000"
	.align	2
.LC10:
	.ascii	"cp esp32flash.bin ~/qemu_esp32\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r0, .L14
	bl	system
	mov	r3, #0
	mov	r2, #4096
	ldr	r1, .L14+4
	ldr	r0, .L14+8
	bl	merge_flash
	mov	r3, #0
	mov	r2, #32768
	ldr	r1, .L14+4
	ldr	r0, .L14+12
	bl	merge_flash
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r0, [r3]
	mov	r3, #0
	mov	r2, #65536
	ldr	r1, .L14+4
	bl	merge_flash
	ldr	r0, .L14+16
	bl	system
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
