	.file	"95450040.c"
	.intel_syntax noprefix
	.text
	.local	options
	.comm	options,8,8
	.section	.rodata
.LC0:
	.string	"vm"
.LC1:
	.string	"extended"
	.align 8
.LC2:
	.string	"[--extended] [--vm] <bootblock> <executable-file> ..."
	.align 8
.LC3:
	.string	"%s: invalid option\nusage: %s %s\n"
	.align 8
.LC4:
	.string	"%s: option --vm not implemented\n"
.LC5:
	.string	"usage: %s %s\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	mov	DWORD PTR options[rip], 0
	mov	DWORD PTR options[rip+4], 0
	jmp	.L2
.L7:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	add	rax, 2
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L3
	mov	DWORD PTR options[rip], 1
	jmp	.L4
.L3:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L5
	mov	DWORD PTR options[rip+4], 1
	jmp	.L4
.L5:
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -16[rbp]
	lea	rcx, .LC2[rip]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	error
.L4:
	sub	DWORD PTR -20[rbp], 1
	add	QWORD PTR -32[rbp], 8
.L2:
	cmp	DWORD PTR -20[rbp], 1
	jle	.L6
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L6
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	je	.L7
.L6:
	mov	eax, DWORD PTR options[rip]
	cmp	eax, 1
	jne	.L8
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	error
.L8:
	cmp	DWORD PTR -20[rbp], 2
	jg	.L9
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, .LC2[rip]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	error
.L9:
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 8[rax]
	mov	eax, DWORD PTR -20[rbp]
	sub	eax, 1
	mov	rsi, rdx
	mov	edi, eax
	call	create_image
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC6:
	.string	"wb+"
.LC7:
	.string	"./image"
.LC8:
	.string	"Cannnot open image file"
.LC9:
	.string	"r"
.LC10:
	.string	"Error: cannot open input file"
.LC11:
	.string	"0x%04lx: %s\n"
.LC12:
	.string	"\tsegmemt %d\n"
	.text
	.type	create_image, @function
create_image:
.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, 208
	mov	DWORD PTR -196[rbp], edi
	mov	QWORD PTR -208[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -180[rbp], 0
	mov	DWORD PTR -176[rbp], 1
	mov	DWORD PTR -168[rbp], 0
	mov	DWORD PTR -164[rbp], 0
	lea	rsi, .LC6[rip]
	lea	rdi, .LC7[rip]
	call	fopen@PLT
	mov	QWORD PTR -160[rbp], rax
	cmp	QWORD PTR -160[rbp], 0
	jne	.L14
	lea	rdi, .LC8[rip]
	call	puts@PLT
	jmp	.L11
.L21:
	mov	rax, QWORD PTR -208[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -152[rbp], rax
	cmp	QWORD PTR -152[rbp], 0
	jne	.L15
	lea	rdi, .LC10[rip]
	call	puts@PLT
	jmp	.L11
.L15:
	mov	rdx, QWORD PTR -152[rbp]
	lea	rax, -80[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	read_ehdr
	mov	rax, QWORD PTR -208[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -172[rbp], 0
	jmp	.L16
.L18:
	mov	eax, DWORD PTR options[rip+4]
	cmp	eax, 1
	jne	.L17
	mov	eax, DWORD PTR -172[rbp]
	mov	esi, eax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
.L17:
	mov	edx, DWORD PTR -172[rbp]
	mov	rcx, QWORD PTR -152[rbp]
	lea	rax, -144[rbp]
	push	QWORD PTR -24[rbp]
	push	QWORD PTR -32[rbp]
	push	QWORD PTR -40[rbp]
	push	QWORD PTR -48[rbp]
	push	QWORD PTR -56[rbp]
	push	QWORD PTR -64[rbp]
	push	QWORD PTR -72[rbp]
	push	QWORD PTR -80[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	read_phdr
	add	rsp, 64
	lea	rcx, -176[rbp]
	lea	rdx, -180[rbp]
	mov	rsi, QWORD PTR -160[rbp]
	mov	rax, QWORD PTR -152[rbp]
	sub	rsp, 8
	push	QWORD PTR -96[rbp]
	push	QWORD PTR -104[rbp]
	push	QWORD PTR -112[rbp]
	push	QWORD PTR -120[rbp]
	push	QWORD PTR -128[rbp]
	push	QWORD PTR -136[rbp]
	push	QWORD PTR -144[rbp]
	push	QWORD PTR -24[rbp]
	push	QWORD PTR -32[rbp]
	push	QWORD PTR -40[rbp]
	push	QWORD PTR -48[rbp]
	push	QWORD PTR -56[rbp]
	push	QWORD PTR -64[rbp]
	push	QWORD PTR -72[rbp]
	push	QWORD PTR -80[rbp]
	mov	rdi, rax
	call	write_segment
	sub	rsp, -128
	add	DWORD PTR -172[rbp], 1
.L16:
	movzx	eax, WORD PTR -24[rbp]
	movzx	eax, ax
	cmp	DWORD PTR -172[rbp], eax
	jl	.L18
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	fclose@PLT
	add	QWORD PTR -208[rbp], 8
	cmp	DWORD PTR -168[rbp], 1
	jne	.L19
	mov	eax, DWORD PTR -180[rbp]
	sub	eax, DWORD PTR -164[rbp]
	mov	edx, DWORD PTR -168[rbp]
	mov	rcx, QWORD PTR -160[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write_os_size
.L19:
	cmp	DWORD PTR -168[rbp], 2
	jne	.L20
	mov	eax, DWORD PTR -180[rbp]
	sub	eax, DWORD PTR -164[rbp]
	mov	edx, DWORD PTR -168[rbp]
	mov	rcx, QWORD PTR -160[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write_os_size
.L20:
	add	DWORD PTR -168[rbp], 1
	mov	eax, DWORD PTR -180[rbp]
	mov	DWORD PTR -164[rbp], eax
.L14:
	mov	eax, DWORD PTR -196[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -196[rbp], edx
	test	eax, eax
	jg	.L21
	mov	rax, QWORD PTR -160[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L11:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	create_image, .-create_image
	.type	read_ehdr, @function
read_ehdr:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 64
	mov	rdi, rax
	call	fread@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	read_ehdr, .-read_ehdr
	.type	read_phdr, @function
read_phdr:
.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 -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	mov	rcx, QWORD PTR 48[rbp]
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	sub	rax, rdx
	sal	rax, 3
	add	rax, rcx
	mov	QWORD PTR -8[rbp], rax
	mov	rcx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 56
	mov	rdi, rax
	call	fread@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	read_phdr, .-read_phdr
	.section	.rodata
.LC13:
	.string	"\t\toffset 0x%lx\tvaddr 0x%lx\n"
.LC14:
	.string	"\t\tfilesz 0x%lx\tmemsz 0x%lx\n"
.LC15:
	.string	"\t\twriting 0x%lx bytes\n"
.LC16:
	.string	"\t\tpadding up to 0x%x\n"
	.text
	.type	write_segment, @function
write_segment:
.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, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	QWORD PTR -48[rbp], rcx
	mov	rax, QWORD PTR 120[rbp]
	add	eax, 511
	and	eax, -512
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR 88[rbp]
	mov	rcx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rsi, QWORD PTR 112[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	je	.L29
	mov	eax, DWORD PTR -12[rbp]
	movsx	rsi, eax
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	DWORD PTR [rax], 0
	jmp	.L30
.L29:
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	lea	rcx, 512[rax]
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	eax, DWORD PTR -12[rbp]
	movsx	rsi, eax
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	add	edx, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], edx
.L30:
	mov	rdx, QWORD PTR 96[rbp]
	mov	rax, QWORD PTR 88[rbp]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR 120[rbp]
	mov	rax, QWORD PTR 112[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR 120[rbp]
	mov	rsi, rax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR [rax]
	add	eax, 512
	mov	esi, eax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	write_segment, .-write_segment
	.section	.rodata
.LC17:
	.string	"os_size: %d sectors\n"
	.text
	.type	write_os_size, @function
write_os_size:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -24[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -20[rbp]
	lea	edx, 511[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 9
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -24[rbp]
	add	eax, 125
	sal	eax, 2
	movsx	rcx, eax
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -32[rbp]
	lea	rax, -12[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 2
	mov	rdi, rax
	call	fwrite@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	write_os_size, .-write_os_size
	.type	error, @function
error:
.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, 224
	mov	QWORD PTR -216[rbp], rdi
	mov	QWORD PTR -168[rbp], rsi
	mov	QWORD PTR -160[rbp], rdx
	mov	QWORD PTR -152[rbp], rcx
	mov	QWORD PTR -144[rbp], r8
	mov	QWORD PTR -136[rbp], r9
	test	al, al
	je	.L35
	movaps	XMMWORD PTR -128[rbp], xmm0
	movaps	XMMWORD PTR -112[rbp], xmm1
	movaps	XMMWORD PTR -96[rbp], xmm2
	movaps	XMMWORD PTR -80[rbp], xmm3
	movaps	XMMWORD PTR -64[rbp], xmm4
	movaps	XMMWORD PTR -48[rbp], xmm5
	movaps	XMMWORD PTR -32[rbp], xmm6
	movaps	XMMWORD PTR -16[rbp], xmm7
.L35:
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -184[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -208[rbp], 8
	mov	DWORD PTR -204[rbp], 48
	lea	rax, 16[rbp]
	mov	QWORD PTR -200[rbp], rax
	lea	rax, -176[rbp]
	mov	QWORD PTR -192[rbp], rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -208[rbp]
	mov	rcx, QWORD PTR -216[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	vfprintf@PLT
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	je	.L36
	mov	edi, 0
	call	perror@PLT
.L36:
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE12:
	.size	error, .-error
	.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	"95450040.c"
	.text
	.local	options
	.comm	options,8,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"vm\000"
	.align	2
.LC1:
	.ascii	"extended\000"
	.align	2
.LC2:
	.ascii	"[--extended] [--vm] <bootblock> <executable-file> ."
	.ascii	"..\000"
	.align	2
.LC3:
	.ascii	"%s: invalid option\012usage: %s %s\012\000"
	.align	2
.LC4:
	.ascii	"%s: option --vm not implemented\012\000"
	.align	2
.LC5:
	.ascii	"usage: %s %s\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, .L11
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L11
	mov	r2, #0
	str	r2, [r3, #4]
	b	.L2
.L7:
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r3, #2
	str	r3, [fp, #-8]
	ldr	r1, .L11+4
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L3
	ldr	r3, .L11
	mov	r2, #1
	str	r2, [r3]
	b	.L4
.L3:
	ldr	r1, .L11+8
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L5
	ldr	r3, .L11
	mov	r2, #1
	str	r2, [r3, #4]
	b	.L4
.L5:
	ldr	r3, .L11+12
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, .L11+16
	bl	error
.L4:
	ldr	r3, [fp, #-16]
	sub	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	str	r3, [fp, #-20]
.L2:
	ldr	r3, [fp, #-16]
	cmp	r3, #1
	ble	.L6
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L6
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	beq	.L7
.L6:
	ldr	r3, .L11
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L8
	ldr	r1, [fp, #-12]
	ldr	r0, .L11+20
	bl	error
.L8:
	ldr	r3, [fp, #-16]
	cmp	r3, #2
	bgt	.L9
	ldr	r2, .L11+12
	ldr	r1, [fp, #-12]
	ldr	r0, .L11+24
	bl	error
.L9:
	ldr	r3, [fp, #-16]
	sub	r2, r3, #1
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	create_image
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	options
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.section	.rodata
	.align	2
.LC6:
	.ascii	"wb+\000"
	.align	2
.LC7:
	.ascii	"./image\000"
	.align	2
.LC8:
	.ascii	"Cannnot open image file\000"
	.align	2
.LC9:
	.ascii	"r\000"
	.align	2
.LC10:
	.ascii	"Error: cannot open input file\000"
	.align	2
.LC11:
	.ascii	"0x%04lx: %s\012\000"
	.align	2
.LC12:
	.ascii	"\011segmemt %d\012\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_image, %function
create_image:
	@ args = 0, pretend = 0, frame = 168
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #292
	str	r0, [fp, #-176]
	str	r1, [fp, #-180]
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-168]
	mov	r3, #1
	str	r3, [fp, #-164]
	mov	r3, #0
	str	r3, [fp, #-156]
	mov	r3, #0
	str	r3, [fp, #-152]
	ldr	r1, .L26+4
	ldr	r0, .L26+8
	bl	fopen
	str	r0, [fp, #-148]
	ldr	r3, [fp, #-148]
	cmp	r3, #0
	bne	.L16
	ldr	r0, .L26+12
	bl	puts
	b	.L13
.L23:
	ldr	r3, [fp, #-180]
	ldr	r3, [r3]
	ldr	r1, .L26+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-144]
	ldr	r3, [fp, #-144]
	cmp	r3, #0
	bne	.L17
	ldr	r0, .L26+20
	bl	puts
	b	.L13
.L17:
	sub	r3, fp, #84
	ldr	r1, [fp, #-144]
	mov	r0, r3
	bl	read_ehdr
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-180]
	ldr	r1, [r1]
	str	r1, [sp]
	ldr	r0, .L26+24
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-160]
	b	.L18
.L20:
	ldr	r3, .L26+28
	ldr	r3, [r3, #4]
	cmp	r3, #1
	bne	.L19
	ldr	r1, [fp, #-160]
	ldr	r0, .L26+32
	bl	printf
.L19:
	sub	r4, fp, #140
	mov	lr, sp
	sub	ip, fp, #84
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2, r3}
	stm	lr, {r0, r1, r2, r3}
	ldr	r2, [fp, #-160]
	ldr	r1, [fp, #-144]
	mov	r0, r4
	bl	read_phdr
	sub	r3, fp, #164
	str	r3, [sp, #116]
	sub	r3, fp, #168
	str	r3, [sp, #112]
	ldr	r3, [fp, #-148]
	str	r3, [sp, #108]
	ldr	r3, [fp, #-144]
	str	r3, [sp, #104]
	add	lr, sp, #48
	sub	ip, fp, #140
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1}
	stm	lr, {r0, r1}
	mov	lr, sp
	sub	ip, fp, #68
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2, r3}
	stm	lr, {r0, r1, r2, r3}
	sub	r3, fp, #84
	ldm	r3, {r0, r1, r2, r3}
	bl	write_segment
	ldr	r3, [fp, #-160]
	add	r3, r3, #1
	str	r3, [fp, #-160]
.L18:
	ldrh	r3, [fp, #-28]
	mov	r2, r3
	ldr	r3, [fp, #-160]
	cmp	r3, r2
	blt	.L20
	ldr	r0, [fp, #-144]
	bl	fclose
	ldr	r3, [fp, #-180]
	add	r3, r3, #4
	str	r3, [fp, #-180]
	ldr	r3, [fp, #-156]
	cmp	r3, #1
	bne	.L21
	ldr	r2, [fp, #-168]
	ldr	r3, [fp, #-152]
	sub	r3, r2, r3
	ldr	r2, [fp, #-156]
	ldr	r1, [fp, #-148]
	mov	r0, r3
	bl	write_os_size
.L21:
	ldr	r3, [fp, #-156]
	cmp	r3, #2
	bne	.L22
	ldr	r2, [fp, #-168]
	ldr	r3, [fp, #-152]
	sub	r3, r2, r3
	ldr	r2, [fp, #-156]
	ldr	r1, [fp, #-148]
	mov	r0, r3
	bl	write_os_size
.L22:
	ldr	r3, [fp, #-156]
	add	r3, r3, #1
	str	r3, [fp, #-156]
	ldr	r3, [fp, #-168]
	str	r3, [fp, #-152]
.L16:
	ldr	r3, [fp, #-176]
	sub	r2, r3, #1
	str	r2, [fp, #-176]
	cmp	r3, #0
	bgt	.L23
	ldr	r0, [fp, #-148]
	bl	fclose
.L13:
	ldr	r3, .L26
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC13
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	options
	.word	.LC12
	.size	create_image, .-create_image
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_ehdr, %function
read_ehdr:
	@ 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	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #64
	ldr	r0, [fp, #-8]
	bl	fread
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	read_ehdr, .-read_ehdr
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_phdr, %function
read_phdr:
	@ args = 64, 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]
	add	r3, fp, #36
	ldmia	r3, {r2-r3}
	mov	r1, r2
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	str	r3, [fp, #-8]
	mov	r2, #0
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-20]
	bl	fseek
	ldr	r3, [fp, #-20]
	mov	r2, #1
	mov	r1, #56
	ldr	r0, [fp, #-16]
	bl	fread
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	read_phdr, .-read_phdr
	.section	.rodata
	.align	2
.LC14:
	.ascii	"\011\011offset 0x%lx\011vaddr 0x%lx\012\000"
	.align	2
.LC15:
	.ascii	"\011\011filesz 0x%lx\011memsz 0x%lx\012\000"
	.align	2
.LC16:
	.ascii	"\011\011writing 0x%lx bytes\012\000"
	.align	2
.LC17:
	.ascii	"\011\011padding up to 0x%x\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_segment, %function
write_segment:
	@ args = 136, pretend = 16, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #16
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	add	ip, fp, #4
	stm	ip, {r0, r1, r2, r3}
	add	r3, fp, #108
	ldmia	r3, {r2-r3}
	mov	r3, r2
	add	r3, r3, #508
	add	r3, r3, #3
	bic	r3, r3, #508
	bic	r3, r3, #3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	add	r3, fp, #76
	ldmia	r3, {r2-r3}
	mov	r3, r2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #124]
	bl	fseek
	add	r3, fp, #100
	ldmia	r3, {r2-r3}
	mov	r1, r2
	ldr	r3, [fp, #124]
	mov	r2, #1
	ldr	r0, [fp, #-8]
	bl	fread
	ldr	r3, [fp, #136]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L33
	ldr	r1, [fp, #-12]
	ldr	r3, [fp, #128]
	mov	r2, #1
	ldr	r0, [fp, #-8]
	bl	fwrite
	ldr	r3, [fp, #136]
	mov	r2, #0
	str	r2, [r3]
	b	.L34
.L33:
	ldr	r3, [fp, #132]
	ldr	r3, [r3]
	add	r3, r3, #512
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #128]
	bl	fseek
	ldr	r1, [fp, #-12]
	ldr	r3, [fp, #128]
	mov	r2, #1
	ldr	r0, [fp, #-8]
	bl	fwrite
	ldr	r3, [fp, #132]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r2, r2, r3
	ldr	r3, [fp, #132]
	str	r2, [r3]
.L34:
	add	r1, fp, #76
	ldmia	r1, {r0-r1}
	add	r3, fp, #84
	ldmia	r3, {r2-r3}
	stm	sp, {r2-r3}
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L36
	bl	printf
	add	r1, fp, #100
	ldmia	r1, {r0-r1}
	add	r3, fp, #108
	ldmia	r3, {r2-r3}
	stm	sp, {r2-r3}
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L36+4
	bl	printf
	add	r3, fp, #108
	ldmia	r3, {r2-r3}
	ldr	r0, .L36+8
	bl	printf
	ldr	r3, [fp, #132]
	ldr	r3, [r3]
	add	r3, r3, #512
	mov	r1, r3
	ldr	r0, .L36+12
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #16
	bx	lr
.L37:
	.align	2
.L36:
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.size	write_segment, .-write_segment
	.section	.rodata
	.align	2
.LC18:
	.ascii	"os_size: %d sectors\012\000"
	.align	2
.LC19:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_os_size, %function
write_os_size:
	@ 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]
	ldr	r3, .L40
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-16]
	add	r2, r3, #508
	add	r2, r2, #3
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #9
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	add	r3, r3, #125
	lsl	r3, r3, #2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	fseek
	sub	r0, fp, #12
	ldr	r3, [fp, #-20]
	mov	r2, #1
	mov	r1, #2
	bl	fwrite
	ldr	r3, [fp, #-12]
	mov	r1, r3
	ldr	r0, .L40+4
	bl	printf
	nop
	ldr	r3, .L40
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L39
	bl	__stack_chk_fail
.L39:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L41:
	.align	2
.L40:
	.word	.LC19
	.word	.LC18
	.size	write_os_size, .-write_os_size
	.section	.rodata
	.align	2
.LC20:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ args = 4, pretend = 16, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 1
	push	{r0, r1, r2, r3}
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, [fp, #4]
	str	r3, [fp, #-16]
	ldr	r3, .L45
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	add	r3, fp, #8
	str	r3, [fp, #-12]
	ldr	r3, .L45+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	vfprintf
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L43
	mov	r0, #0
	bl	perror
.L43:
	mov	r0, #1
	bl	exit
.L46:
	.align	2
.L45:
	.word	.LC20
	.word	stderr
	.size	error, .-error
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
