	.file	"942119.c"
	.intel_syntax noprefix
	.text
	.globl	extended_flag
	.bss
	.type	extended_flag, @object
	.size	extended_flag, 1
extended_flag:
	.zero	1
	.globl	base_addr
	.align 4
	.type	base_addr, @object
	.size	base_addr, 4
base_addr:
	.zero	4
	.globl	num_sector
	.align 4
	.type	num_sector, @object
	.size	num_sector, 4
num_sector:
	.zero	4
	.section	.rodata
.LC0:
	.string	"the_stack_data/942119.c"
.LC1:
	.string	"*p_magic == elf_magic"
	.align 8
.LC2:
	.string	"ERROR: Boot block is out of memory!"
.LC3:
	.string	"bootblock image info"
.LC4:
	.string	"sectors: %u\n"
	.align 8
.LC5:
	.string	"offset of segment in the file: 0x%x\n"
	.align 8
.LC6:
	.string	"the image's virtural address of segment in memory: 0x%x\n"
	.align 8
.LC7:
	.string	"the file image size of segment: 0x%x\n"
	.align 8
.LC8:
	.string	"the memory image size of segment: 0x%x\n"
	.align 8
.LC9:
	.string	"the size of write to the OS image: 0x%x\n"
.LC10:
	.string	"padding up to 0x%x\n"
	.text
	.globl	write_bootblock
	.type	write_bootblock, @function
write_bootblock:
.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 592
	mov	QWORD PTR -4680[rbp], rdi
	mov	QWORD PTR -4688[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -4680[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -4664[rbp], rax
	mov	rax, QWORD PTR -4688[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -4656[rbp], rax
	mov	QWORD PTR -4648[rbp], 0
	mov	QWORD PTR -4640[rbp], 0
	mov	rdx, QWORD PTR -4656[rbp]
	lea	rax, -4112[rbp]
	mov	rcx, rdx
	mov	edx, 4096
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	lea	rax, -4112[rbp]
	mov	QWORD PTR -4648[rbp], rax
	mov	DWORD PTR -4668[rbp], 1179403647
	lea	rax, -4112[rbp]
	mov	QWORD PTR -4632[rbp], rax
	mov	rax, QWORD PTR -4632[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -4668[rbp], eax
	je	.L2
	lea	rcx, __PRETTY_FUNCTION__.1[rip]
	mov	edx, 25
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	__assert_fail@PLT
.L2:
	mov	DWORD PTR -4672[rbp], 0
	mov	rax, QWORD PTR -4648[rbp]
	mov	eax, DWORD PTR 28[rax]
	mov	edx, eax
	lea	rax, -4112[rbp]
	add	rax, rdx
	mov	QWORD PTR -4640[rbp], rax
	jmp	.L3
.L8:
	mov	eax, DWORD PTR -4672[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4640[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	eax, 1
	jne	.L4
	mov	eax, DWORD PTR -4672[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4640[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 20[rax]
	cmp	eax, 512
	jbe	.L5
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR -4672[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4640[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 8[rax]
	mov	DWORD PTR base_addr[rip], eax
	mov	DWORD PTR num_sector[rip], 1
	mov	eax, DWORD PTR -4672[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4640[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	mov	ecx, eax
	mov	rax, QWORD PTR -4656[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	lea	rax, -4624[rbp]
	mov	edx, 512
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR -4672[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4640[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 16[rax]
	mov	esi, eax
	mov	rdx, QWORD PTR -4656[rbp]
	lea	rax, -4624[rbp]
	mov	rcx, rdx
	mov	rdx, rsi
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	BYTE PTR -4114[rbp], 85
	mov	BYTE PTR -4113[rbp], -86
	mov	rdx, QWORD PTR -4664[rbp]
	lea	rax, -4624[rbp]
	mov	rcx, rdx
	mov	edx, 512
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -4664[rbp]
	mov	rdi, rax
	call	fflush@PLT
	movzx	eax, BYTE PTR extended_flag[rip]
	test	al, al
	je	.L10
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, DWORD PTR num_sector[rip]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4672[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4640[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4672[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4640[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 8[rax]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4672[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4640[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 16[rax]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4672[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4640[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 20[rax]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4672[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4640[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 20[rax]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR num_sector[rip]
	sal	eax, 9
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L10
.L4:
	add	DWORD PTR -4672[rbp], 1
.L3:
	mov	rax, QWORD PTR -4648[rbp]
	movzx	eax, WORD PTR 44[rax]
	movzx	eax, ax
	cmp	DWORD PTR -4672[rbp], eax
	jl	.L8
	jmp	.L7
.L10:
	nop
.L7:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	write_bootblock, .-write_bootblock
	.section	.rodata
.LC11:
	.string	"kernel image info"
	.text
	.globl	write_kernel
	.type	write_kernel, @function
write_kernel:
.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 608
	mov	QWORD PTR -4696[rbp], rdi
	mov	QWORD PTR -4704[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -4696[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -4672[rbp], rax
	mov	rax, QWORD PTR -4704[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -4664[rbp], rax
	mov	QWORD PTR -4656[rbp], 0
	mov	QWORD PTR -4648[rbp], 0
	mov	rdx, QWORD PTR -4664[rbp]
	lea	rax, -4112[rbp]
	mov	rcx, rdx
	mov	edx, 4096
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	lea	rax, -4112[rbp]
	mov	QWORD PTR -4656[rbp], rax
	mov	DWORD PTR -4680[rbp], 1179403647
	lea	rax, -4112[rbp]
	mov	QWORD PTR -4640[rbp], rax
	mov	rax, QWORD PTR -4640[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -4680[rbp], eax
	je	.L12
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 71
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	__assert_fail@PLT
.L12:
	mov	DWORD PTR -4688[rbp], 0
	mov	rax, QWORD PTR -4656[rbp]
	mov	eax, DWORD PTR 28[rax]
	mov	edx, eax
	lea	rax, -4112[rbp]
	add	rax, rdx
	mov	QWORD PTR -4648[rbp], rax
	jmp	.L13
.L19:
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	eax, 1
	jne	.L14
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 8[rax]
	mov	edx, DWORD PTR base_addr[rip]
	sub	eax, edx
	mov	DWORD PTR -4676[rbp], eax
	lea	rax, -4624[rbp]
	mov	edx, 512
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR 20[rax]
	mov	eax, DWORD PTR -4676[rbp]
	add	edx, eax
	mov	eax, DWORD PTR num_sector[rip]
	sal	eax, 9
	cmp	edx, eax
	jbe	.L15
	mov	eax, DWORD PTR num_sector[rip]
	mov	DWORD PTR -4684[rbp], eax
	jmp	.L16
.L17:
	mov	rax, QWORD PTR -4672[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -4672[rbp]
	lea	rax, -4624[rbp]
	mov	rcx, rdx
	mov	edx, 512
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -4672[rbp]
	mov	rdi, rax
	call	fflush@PLT
	add	DWORD PTR -4684[rbp], 1
.L16:
	mov	eax, DWORD PTR -4684[rbp]
	sal	eax, 9
	mov	ecx, eax
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR 20[rax]
	mov	eax, DWORD PTR -4676[rbp]
	add	eax, edx
	cmp	ecx, eax
	jb	.L17
.L15:
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 16[rax]
	mov	eax, eax
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -4632[rbp], rax
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	mov	ecx, eax
	mov	rax, QWORD PTR -4664[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 16[rax]
	mov	esi, eax
	mov	rdx, QWORD PTR -4664[rbp]
	mov	rax, QWORD PTR -4632[rbp]
	mov	rcx, rdx
	mov	rdx, rsi
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	ecx, DWORD PTR -4676[rbp]
	mov	rax, QWORD PTR -4672[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 16[rax]
	mov	esi, eax
	mov	rdx, QWORD PTR -4672[rbp]
	mov	rax, QWORD PTR -4632[rbp]
	mov	rcx, rdx
	mov	rdx, rsi
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -4672[rbp]
	mov	rdi, rax
	call	fflush@PLT
	mov	rax, QWORD PTR -4632[rbp]
	mov	rdi, rax
	call	free@PLT
	movzx	eax, BYTE PTR extended_flag[rip]
	test	al, al
	je	.L18
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -4684[rbp]
	mov	edx, DWORD PTR num_sector[rip]
	sub	eax, edx
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 8[rax]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 16[rax]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 20[rax]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4688[rbp]
	cdqe
	sal	rax, 5
	mov	rdx, rax
	mov	rax, QWORD PTR -4648[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 20[rax]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4684[rbp]
	mov	edx, DWORD PTR num_sector[rip]
	sub	eax, edx
	sal	eax, 9
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
.L18:
	mov	eax, DWORD PTR -4684[rbp]
	mov	DWORD PTR num_sector[rip], eax
.L14:
	add	DWORD PTR -4688[rbp], 1
.L13:
	mov	rax, QWORD PTR -4656[rbp]
	movzx	eax, WORD PTR 44[rax]
	movzx	eax, ax
	cmp	DWORD PTR -4688[rbp], eax
	jl	.L19
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	write_kernel, .-write_kernel
	.section	.rodata
.LC12:
	.string	"--extended"
	.align 8
.LC13:
	.string	"ERROR: A boot file is required!"
.LC14:
	.string	"wb"
.LC15:
	.string	"./image"
	.align 8
.LC16:
	.string	"ERROR: Cannot create image file!"
.LC17:
	.string	"rb"
	.align 8
.LC18:
	.string	"ERROR: Cannot open boot file: %s!\n"
	.align 8
.LC19:
	.string	"ERROR: Cannot open kernel file: %s!\n"
	.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
	sub	rsp, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -52[rbp], 1
	jle	.L22
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L22
	mov	BYTE PTR extended_flag[rip], 1
.L22:
	movzx	eax, BYTE PTR extended_flag[rip]
	movzx	eax, al
	add	eax, 1
	cmp	DWORD PTR -52[rbp], eax
	jg	.L23
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	lea	rsi, .LC14[rip]
	lea	rdi, .LC15[rip]
	call	fopen@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	test	rax, rax
	jne	.L24
	lea	rdi, .LC16[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L24:
	movzx	eax, BYTE PTR extended_flag[rip]
	movzx	eax, al
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC17[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	test	rax, rax
	jne	.L25
	movzx	eax, BYTE PTR extended_flag[rip]
	movzx	eax, al
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L25:
	lea	rdx, -24[rbp]
	lea	rax, -32[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	write_bootblock
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	movzx	eax, BYTE PTR extended_flag[rip]
	movzx	eax, al
	add	eax, 2
	mov	DWORD PTR -36[rbp], eax
	jmp	.L26
.L28:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC17[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	test	rax, rax
	jne	.L27
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L27:
	lea	rdx, -16[rbp]
	lea	rax, -32[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	write_kernel
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	add	DWORD PTR -36[rbp], 1
.L26:
	mov	eax, DWORD PTR -36[rbp]
	cmp	eax, DWORD PTR -52[rbp]
	jl	.L28
	mov	eax, DWORD PTR num_sector[rip]
	sub	eax, 1
	mov	DWORD PTR num_sector[rip], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 4
	lea	rdi, num_sector[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fflush@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.section	.rodata
	.align 16
	.type	__PRETTY_FUNCTION__.1, @object
	.size	__PRETTY_FUNCTION__.1, 16
__PRETTY_FUNCTION__.1:
	.string	"write_bootblock"
	.align 8
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 13
__PRETTY_FUNCTION__.0:
	.string	"write_kernel"
	.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	"942119.c"
	.text
	.global	extended_flag
	.bss
	.type	extended_flag, %object
	.size	extended_flag, 1
extended_flag:
	.space	1
	.comm	base_addr,4,4
	.global	num_sector
	.align	2
	.type	num_sector, %object
	.size	num_sector, 4
num_sector:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"the_stack_data/942119.c\000"
	.align	2
.LC1:
	.ascii	"*p_magic == elf_magic\000"
	.align	2
.LC2:
	.ascii	"ERROR: Boot block is out of memory!\000"
	.align	2
.LC3:
	.ascii	"bootblock image info\000"
	.align	2
.LC4:
	.ascii	"sectors: %u\012\000"
	.align	2
.LC5:
	.ascii	"offset of segment in the file: 0x%x\012\000"
	.align	2
.LC6:
	.ascii	"the image's virtural address of segment in memory: "
	.ascii	"0x%x\012\000"
	.align	2
.LC7:
	.ascii	"the file image size of segment: 0x%x\012\000"
	.align	2
.LC8:
	.ascii	"the memory image size of segment: 0x%x\012\000"
	.align	2
.LC9:
	.ascii	"the size of write to the OS image: 0x%x\012\000"
	.align	2
.LC10:
	.ascii	"padding up to 0x%x\012\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	write_bootblock
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_bootblock, %function
write_bootblock:
	@ args = 0, pretend = 0, frame = 4648
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #4608
	sub	sp, sp, #40
	sub	r3, fp, #4096
	sub	r3, r3, #4
	str	r0, [r3, #-548]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	str	r1, [r3, #-552]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-548]
	ldr	r3, [r3]
	str	r3, [r2, #-540]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-552]
	ldr	r3, [r3]
	str	r3, [r2, #-536]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-532]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-528]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	sub	r0, fp, #4096
	sub	r0, r0, #4
	sub	r0, r0, #4
	ldr	r3, [r3, #-536]
	mov	r2, #4096
	mov	r1, #1
	bl	fread
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #4
	sub	r3, r3, #4
	str	r3, [r2, #-532]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	ldr	r3, .L11+4
	str	r3, [r2, #-524]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #4
	sub	r3, r3, #4
	str	r3, [r2, #-520]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-520]
	ldr	r3, [r3]
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-524]
	cmp	r2, r3
	beq	.L2
	ldr	r3, .L11+8
	mov	r2, #25
	ldr	r1, .L11+12
	ldr	r0, .L11+16
	bl	__assert_fail
.L2:
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-544]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-532]
	ldr	r2, [r3, #28]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r1, r3
	sub	r3, fp, #4096
	sub	r3, r3, #4
	sub	r3, r3, #4
	add	r3, r3, r2
	str	r3, [r1, #-528]
	b	.L3
.L8:
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-528]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L4
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-528]
	add	r3, r2, r3
	ldr	r3, [r3, #20]
	cmp	r3, #512
	bls	.L5
	ldr	r0, .L11+20
	bl	puts
	mov	r0, #1
	bl	exit
.L5:
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-528]
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	ldr	r2, .L11+24
	str	r3, [r2]
	ldr	r3, .L11+28
	mov	r2, #1
	str	r2, [r3]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-528]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r1, r3
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, #0
	ldr	r0, [r3, #-536]
	bl	fseek
	sub	r3, fp, #4608
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #512
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-528]
	add	r3, r2, r3
	ldr	r2, [r3, #16]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	sub	r0, fp, #4608
	sub	r0, r0, #4
	sub	r0, r0, #4
	ldr	r3, [r3, #-536]
	mov	r1, #1
	bl	fread
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, #85
	strb	r2, [r3, #-6]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mvn	r2, #85
	strb	r2, [r3, #-5]
	sub	r3, fp, #4096
	sub	r3, r3, #4
	sub	r0, fp, #4608
	sub	r0, r0, #4
	sub	r0, r0, #4
	ldr	r3, [r3, #-540]
	mov	r2, #512
	mov	r1, #1
	bl	fwrite
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r0, [r3, #-540]
	bl	fflush
	ldr	r3, .L11+32
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L10
	ldr	r0, .L11+36
	bl	puts
	ldr	r3, .L11+28
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L11+40
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-528]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r1, r3
	ldr	r0, .L11+44
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-528]
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	mov	r1, r3
	ldr	r0, .L11+48
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-528]
	add	r3, r2, r3
	ldr	r3, [r3, #16]
	mov	r1, r3
	ldr	r0, .L11+52
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-528]
	add	r3, r2, r3
	ldr	r3, [r3, #20]
	mov	r1, r3
	ldr	r0, .L11+56
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #4
	ldr	r2, [r2, #-528]
	add	r3, r2, r3
	ldr	r3, [r3, #20]
	mov	r1, r3
	ldr	r0, .L11+60
	bl	printf
	ldr	r3, .L11+28
	ldr	r3, [r3]
	lsl	r3, r3, #9
	mov	r1, r3
	ldr	r0, .L11+64
	bl	printf
	b	.L10
.L4:
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	add	r3, r3, #1
	str	r3, [r2, #-544]
.L3:
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-532]
	ldrh	r3, [r3, #44]
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-544]
	cmp	r3, r2
	blt	.L8
	b	.L7
.L10:
	nop
.L7:
	nop
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC11
	.word	1179403647
	.word	__PRETTY_FUNCTION__.5664
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	base_addr
	.word	num_sector
	.word	extended_flag
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	write_bootblock, .-write_bootblock
	.section	.rodata
	.align	2
.LC12:
	.ascii	"kernel image info\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	write_kernel
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_kernel, %function
write_kernel:
	@ args = 0, pretend = 0, frame = 4664
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #4608
	sub	sp, sp, #60
	sub	r3, fp, #4096
	sub	r3, r3, #12
	str	r0, [r3, #-564]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	str	r1, [r3, #-568]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-564]
	ldr	r3, [r3]
	str	r3, [r2, #-548]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-568]
	ldr	r3, [r3]
	str	r3, [r2, #-544]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-540]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-536]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r0, fp, #4096
	sub	r0, r0, #12
	sub	r0, r0, #4
	ldr	r3, [r3, #-544]
	mov	r2, #4096
	mov	r1, #1
	bl	fread
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	str	r3, [r2, #-540]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L23+4
	str	r3, [r2, #-532]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	str	r3, [r2, #-528]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-528]
	ldr	r3, [r3]
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-532]
	cmp	r2, r3
	beq	.L14
	ldr	r3, .L23+8
	mov	r2, #71
	ldr	r1, .L23+12
	ldr	r0, .L23+16
	bl	__assert_fail
.L14:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-556]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-540]
	ldr	r2, [r3, #28]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	add	r3, r3, r2
	str	r3, [r1, #-536]
	b	.L15
.L21:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L16
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r2, [r3, #8]
	ldr	r3, .L23+20
	ldr	r3, [r3]
	sub	r1, fp, #4096
	sub	r1, r1, #12
	sub	r3, r2, r3
	str	r3, [r1, #-524]
	sub	r3, fp, #4608
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #512
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r2, [r3, #20]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-524]
	add	r2, r2, r3
	ldr	r3, .L23+24
	ldr	r3, [r3]
	lsl	r3, r3, #9
	cmp	r2, r3
	bls	.L17
	ldr	r3, .L23+24
	ldr	r3, [r3]
	sub	r2, fp, #4096
	sub	r2, r2, #12
	str	r3, [r2, #-552]
	b	.L18
.L19:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [r3, #-548]
	bl	fseek
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r0, fp, #4608
	sub	r0, r0, #12
	sub	r0, r0, #4
	ldr	r3, [r3, #-548]
	mov	r2, #512
	mov	r1, #1
	bl	fwrite
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-548]
	bl	fflush
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-552]
	add	r3, r3, #1
	str	r3, [r2, #-552]
.L18:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-552]
	lsl	r3, r3, #9
	mov	r1, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r2, [r3, #20]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-524]
	add	r3, r2, r3
	cmp	r1, r3
	bcc	.L19
.L17:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r3, [r3, #16]
	sub	r2, fp, #4096
	sub	r2, r2, #12
	mov	r4, r2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [r4, #-520]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r1, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, #0
	ldr	r0, [r3, #-544]
	bl	fseek
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r2, [r3, #16]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r1, fp, #4096
	sub	r1, r1, #12
	mov	r0, r1
	ldr	r3, [r3, #-544]
	mov	r1, #1
	ldr	r0, [r0, #-520]
	bl	fread
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-524]
	sub	r2, fp, #4096
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [r0, #-548]
	bl	fseek
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r2, [r3, #16]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r1, fp, #4096
	sub	r1, r1, #12
	mov	r0, r1
	ldr	r3, [r3, #-548]
	mov	r1, #1
	ldr	r0, [r0, #-520]
	bl	fwrite
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-548]
	bl	fflush
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-520]
	bl	free
	ldr	r3, .L23+28
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L20
	ldr	r0, .L23+32
	bl	puts
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r3, #-552]
	ldr	r3, .L23+24
	ldr	r3, [r3]
	sub	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L23+36
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r1, r3
	ldr	r0, .L23+40
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	mov	r1, r3
	ldr	r0, .L23+44
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r3, [r3, #16]
	mov	r1, r3
	ldr	r0, .L23+48
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r3, [r3, #20]
	mov	r1, r3
	ldr	r0, .L23+52
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	lsl	r3, r3, #5
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-536]
	add	r3, r2, r3
	ldr	r3, [r3, #20]
	mov	r1, r3
	ldr	r0, .L23+56
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r3, #-552]
	ldr	r3, .L23+24
	ldr	r3, [r3]
	sub	r3, r2, r3
	lsl	r3, r3, #9
	mov	r1, r3
	ldr	r0, .L23+60
	bl	printf
.L20:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-552]
	ldr	r2, .L23+24
	str	r3, [r2]
.L16:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	add	r3, r3, #1
	str	r3, [r2, #-556]
.L15:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-540]
	ldrh	r3, [r3, #44]
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-556]
	cmp	r3, r2
	blt	.L21
	nop
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC13
	.word	1179403647
	.word	__PRETTY_FUNCTION__.5682
	.word	.LC0
	.word	.LC1
	.word	base_addr
	.word	num_sector
	.word	extended_flag
	.word	.LC12
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	write_kernel, .-write_kernel
	.section	.rodata
	.align	2
.LC14:
	.ascii	"--extended\000"
	.align	2
.LC15:
	.ascii	"ERROR: A boot file is required!\000"
	.align	2
.LC16:
	.ascii	"wb\000"
	.align	2
.LC17:
	.ascii	"./image\000"
	.align	2
.LC18:
	.ascii	"ERROR: Cannot create image file!\000"
	.align	2
.LC19:
	.ascii	"rb\000"
	.align	2
.LC20:
	.ascii	"ERROR: Cannot open boot file: %s!\012\000"
	.align	2
.LC21:
	.ascii	"ERROR: Cannot open kernel file: %s!\012\000"
	.align	2
.LC22:
	.word	__stack_chk_guard
	.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]
	ldr	r3, .L35
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-32]
	cmp	r3, #1
	ble	.L26
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L35+4
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L26
	ldr	r3, .L35+8
	mov	r2, #1
	strb	r2, [r3]
.L26:
	ldr	r3, .L35+8
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r3, r3, #1
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	bgt	.L27
	ldr	r0, .L35+12
	bl	puts
	mov	r0, #1
	bl	exit
.L27:
	ldr	r1, .L35+16
	ldr	r0, .L35+20
	bl	fopen
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L28
	ldr	r0, .L35+24
	bl	puts
	mov	r0, #1
	bl	exit
.L28:
	ldr	r3, .L35+8
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L35+28
	mov	r0, r3
	bl	fopen
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L29
	ldr	r3, .L35+8
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L35+32
	bl	printf
	mov	r0, #1
	bl	exit
.L29:
	sub	r2, fp, #20
	sub	r3, fp, #24
	mov	r1, r2
	mov	r0, r3
	bl	write_bootblock
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	fclose
	ldr	r3, .L35+8
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r3, r3, #2
	str	r3, [fp, #-12]
	b	.L30
.L32:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L35+28
	mov	r0, r3
	bl	fopen
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L31
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L35+36
	bl	printf
	mov	r0, #1
	bl	exit
.L31:
	sub	r2, fp, #16
	sub	r3, fp, #24
	mov	r1, r2
	mov	r0, r3
	bl	write_kernel
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	fclose
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L30:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	blt	.L32
	ldr	r3, .L35+40
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L35+40
	str	r3, [r2]
	ldr	r3, [fp, #-24]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	fseek
	ldr	r3, [fp, #-24]
	mov	r2, #1
	mov	r1, #4
	ldr	r0, .L35+40
	bl	fwrite
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	fflush
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	fclose
	mov	r3, #0
	ldr	r2, .L35
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L34
	bl	__stack_chk_fail
.L34:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L36:
	.align	2
.L35:
	.word	.LC22
	.word	.LC14
	.word	extended_flag
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	num_sector
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.5664, %object
	.size	__PRETTY_FUNCTION__.5664, 16
__PRETTY_FUNCTION__.5664:
	.ascii	"write_bootblock\000"
	.align	2
	.type	__PRETTY_FUNCTION__.5682, %object
	.size	__PRETTY_FUNCTION__.5682, 13
__PRETTY_FUNCTION__.5682:
	.ascii	"write_kernel\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
