	.file	"119274.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: %s device lxboot\n"
.LC1:
	.string	"lxboot read"
.LC2:
	.string	"expected %zd, got %d\n"
.LC3:
	.string	"bootblock read"
.LC4:
	.string	"bootblock write"
	.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, 1072
	mov	DWORD PTR -1060[rbp], edi
	mov	QWORD PTR -1072[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -1060[rbp], 3
	je	.L2
	mov	rax, QWORD PTR -1072[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 0
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -1072[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1052[rbp], eax
	cmp	DWORD PTR -1052[rbp], 0
	jns	.L3
	mov	rax, QWORD PTR -1072[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 0
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -1072[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1048[rbp], eax
	cmp	DWORD PTR -1048[rbp], 0
	jns	.L4
	mov	rax, QWORD PTR -1072[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	perror@PLT
	mov	eax, DWORD PTR -1052[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
.L4:
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -1048[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -1044[rbp], eax
	cmp	DWORD PTR -1044[rbp], 512
	je	.L5
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -1044[rbp]
	mov	ecx, edx
	mov	edx, 512
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 0
	call	exit@PLT
.L5:
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1052[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -1044[rbp], eax
	cmp	DWORD PTR -1044[rbp], 512
	je	.L6
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -1044[rbp]
	mov	ecx, edx
	mov	edx, 512
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 0
	call	exit@PLT
.L6:
	lea	rdx, -464[rbp]
	lea	rax, -976[rbp]
	mov	ecx, 34
	mov	rdi, rdx
	mov	rsi, rax
	rep movsq
	mov	rax, rsi
	mov	rdx, rdi
	mov	ecx, DWORD PTR [rax]
	mov	DWORD PTR [rdx], ecx
	mov	QWORD PTR -24[rbp], 0
	mov	DWORD PTR -1056[rbp], 0
	jmp	.L7
.L8:
	mov	rdx, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR -1056[rbp]
	cdqe
	mov	rax, QWORD PTR -528[rbp+rax*8]
	add	rax, rdx
	mov	QWORD PTR -24[rbp], rax
	add	DWORD PTR -1056[rbp], 1
.L7:
	cmp	DWORD PTR -1056[rbp], 62
	jle	.L8
	mov	eax, DWORD PTR -1052[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	lea	rcx, -528[rbp]
	mov	eax, DWORD PTR -1052[rbp]
	mov	edx, 512
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	cmp	rax, 512
	je	.L9
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 0
	call	exit@PLT
.L9:
	mov	eax, DWORD PTR -1048[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -1052[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.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	"119274.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s device lxboot\012\000"
	.align	2
.LC1:
	.ascii	"lxboot read\000"
	.align	2
.LC2:
	.ascii	"expected %zd, got %d\012\000"
	.align	2
.LC3:
	.ascii	"bootblock read\000"
	.align	2
.LC4:
	.ascii	"bootblock write\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1056
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1056
	str	r0, [fp, #-1056]
	str	r1, [fp, #-1060]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-1056]
	cmp	r3, #3
	beq	.L2
	ldr	r3, .L11+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-1060]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L11+8
	bl	fprintf
	mov	r0, #0
	bl	exit
.L2:
	ldr	r3, [fp, #-1060]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, #2
	mov	r0, r3
	bl	open
	str	r0, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	bge	.L3
	ldr	r3, [fp, #-1060]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	perror
	mov	r0, #0
	bl	exit
.L3:
	ldr	r3, [fp, #-1060]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-1040]
	ldr	r3, [fp, #-1040]
	cmp	r3, #0
	bge	.L4
	ldr	r3, [fp, #-1060]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	perror
	ldr	r0, [fp, #-1044]
	bl	close
	mov	r0, #0
	bl	exit
.L4:
	sub	r3, fp, #520
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [fp, #-1040]
	bl	read
	str	r0, [fp, #-1036]
	ldr	r3, [fp, #-1036]
	cmp	r3, #512
	beq	.L5
	ldr	r0, .L11+12
	bl	perror
	ldr	r3, .L11+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-1036]
	mov	r2, #512
	ldr	r1, .L11+16
	bl	fprintf
	mov	r0, #0
	bl	exit
.L5:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [fp, #-1044]
	bl	read
	str	r0, [fp, #-1036]
	ldr	r3, [fp, #-1036]
	cmp	r3, #512
	beq	.L6
	ldr	r0, .L11+20
	bl	perror
	ldr	r3, .L11+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-1036]
	mov	r2, #512
	ldr	r1, .L11+16
	bl	fprintf
	mov	r0, #0
	bl	exit
.L6:
	sub	r3, fp, #456
	sub	r1, fp, #968
	mov	r2, #276
	mov	r0, r3
	bl	memcpy
	mov	r3, #0
	str	r3, [fp, #-268]
	mov	r3, #0
	str	r3, [fp, #-1048]
	b	.L7
.L8:
	ldr	r2, [fp, #-268]
	ldr	r3, [fp, #-1048]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-516]
	add	r3, r2, r3
	str	r3, [fp, #-268]
	ldr	r3, [fp, #-1048]
	add	r3, r3, #1
	str	r3, [fp, #-1048]
.L7:
	ldr	r3, [fp, #-1048]
	cmp	r3, #62
	ble	.L8
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-1044]
	bl	lseek
	sub	r3, fp, #520
	mov	r2, #512
	mov	r1, r3
	ldr	r0, [fp, #-1044]
	bl	write
	mov	r3, r0
	cmp	r3, #512
	beq	.L9
	ldr	r0, .L11+24
	bl	perror
	mov	r0, #0
	bl	exit
.L9:
	ldr	r0, [fp, #-1040]
	bl	close
	ldr	r0, [fp, #-1044]
	bl	close
	mov	r0, #0
	bl	exit
.L12:
	.align	2
.L11:
	.word	.LC5
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
