	.file	"724241.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"../disks/drivea.dsk"
.LC1:
	.string	"file ../disks/drivea.dsk"
.LC2:
	.string	"boot.bin"
.LC3:
	.string	"file boot.bin"
	.align 8
.LC4:
	.string	"start address of boot.bin <> 0"
.LC5:
	.string	"cpm.bin"
.LC6:
	.string	"file cpm.bin"
.LC7:
	.string	"bios.bin"
.LC8:
	.string	"file bios.bin"
.LC9:
	.string	"unknown format of bios.bin"
	.align 8
.LC10:
	.string	"6 sectors written, can't write any more!"
	.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
	push	rbx
	sub	rsp, 168
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	esi, 1
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -176[rbp], eax
	cmp	DWORD PTR -176[rbp], -1
	jne	.L2
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	esi, 0
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], -1
	jne	.L3
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	lea	rcx, -163[rbp]
	mov	eax, DWORD PTR -172[rbp]
	mov	edx, 3
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -168[rbp], eax
	cmp	DWORD PTR -168[rbp], 3
	je	.L4
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	movzx	eax, BYTE PTR -163[rbp]
	cmp	al, -1
	jne	.L5
	movzx	eax, BYTE PTR -162[rbp]
	test	al, al
	jne	.L5
	movzx	eax, BYTE PTR -161[rbp]
	test	al, al
	je	.L6
.L5:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L6:
	lea	rax, -160[rbp]
	mov	edx, 128
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rcx, -160[rbp]
	mov	eax, DWORD PTR -172[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	eax, DWORD PTR -172[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rcx, -160[rbp]
	mov	eax, DWORD PTR -176[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	esi, 0
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], -1
	jne	.L7
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	eax, DWORD PTR -172[rbp]
	mov	edx, 0
	mov	esi, 2176
	mov	edi, eax
	call	lseek@PLT
	mov	ebx, 0
	jmp	.L8
.L10:
	lea	rcx, -160[rbp]
	mov	eax, DWORD PTR -172[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -168[rbp], eax
	cmp	DWORD PTR -168[rbp], 128
	je	.L9
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	lea	rcx, -160[rbp]
	mov	eax, DWORD PTR -176[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	add	ebx, 1
.L8:
	cmp	ebx, 43
	jle	.L10
	mov	eax, DWORD PTR -172[rbp]
	mov	edi, eax
	call	close@PLT
	mov	esi, 0
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], -1
	jne	.L11
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	lea	rcx, -163[rbp]
	mov	eax, DWORD PTR -172[rbp]
	mov	edx, 3
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -168[rbp], eax
	cmp	DWORD PTR -168[rbp], 3
	je	.L12
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	movzx	eax, BYTE PTR -163[rbp]
	cmp	al, -1
	je	.L13
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L13:
	mov	ebx, 0
	jmp	.L14
.L16:
	lea	rcx, -160[rbp]
	mov	eax, DWORD PTR -176[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	add	ebx, 1
	cmp	ebx, 6
	jne	.L14
	lea	rdi, .LC10[rip]
	call	puts@PLT
	jmp	.L15
.L14:
	lea	rcx, -160[rbp]
	mov	eax, DWORD PTR -172[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -168[rbp], eax
	cmp	DWORD PTR -168[rbp], 128
	je	.L16
	cmp	DWORD PTR -168[rbp], 0
	jle	.L19
	lea	rcx, -160[rbp]
	mov	eax, DWORD PTR -176[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	jmp	.L15
.L19:
	nop
.L15:
	mov	eax, DWORD PTR -172[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -176[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.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	"724241.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"../disks/drivea.dsk\000"
	.align	2
.LC1:
	.ascii	"file ../disks/drivea.dsk\000"
	.align	2
.LC2:
	.ascii	"boot.bin\000"
	.align	2
.LC3:
	.ascii	"file boot.bin\000"
	.align	2
.LC4:
	.ascii	"start address of boot.bin <> 0\000"
	.align	2
.LC5:
	.ascii	"cpm.bin\000"
	.align	2
.LC6:
	.ascii	"file cpm.bin\000"
	.align	2
.LC7:
	.ascii	"bios.bin\000"
	.align	2
.LC8:
	.ascii	"file bios.bin\000"
	.align	2
.LC9:
	.ascii	"unknown format of bios.bin\000"
	.align	2
.LC10:
	.ascii	"6 sectors written, can't write any more!\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #156
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r1, #1
	ldr	r0, .L20+4
	bl	open
	str	r0, [fp, #-160]
	ldr	r3, [fp, #-160]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L20+8
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	mov	r1, #0
	ldr	r0, .L20+12
	bl	open
	str	r0, [fp, #-156]
	ldr	r3, [fp, #-156]
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L20+16
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	sub	r3, fp, #148
	mov	r2, #3
	mov	r1, r3
	ldr	r0, [fp, #-156]
	bl	read
	str	r0, [fp, #-152]
	ldr	r3, [fp, #-152]
	cmp	r3, #3
	beq	.L4
	ldr	r0, .L20+16
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	ldrb	r3, [fp, #-148]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L5
	ldrb	r3, [fp, #-147]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L5
	ldrb	r3, [fp, #-146]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L6
.L5:
	ldr	r0, .L20+20
	bl	puts
	mov	r0, #0
	bl	exit
.L6:
	sub	r3, fp, #144
	mov	r2, #128
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #144
	mov	r2, #128
	mov	r1, r3
	ldr	r0, [fp, #-156]
	bl	read
	ldr	r0, [fp, #-156]
	bl	close
	sub	r3, fp, #144
	mov	r2, #128
	mov	r1, r3
	ldr	r0, [fp, #-160]
	bl	write
	mov	r1, #0
	ldr	r0, .L20+24
	bl	open
	str	r0, [fp, #-156]
	ldr	r3, [fp, #-156]
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L20+28
	bl	perror
	mov	r0, #1
	bl	exit
.L7:
	mov	r2, #0
	mov	r1, #2176
	ldr	r0, [fp, #-156]
	bl	lseek
	mov	r4, #0
	b	.L8
.L10:
	sub	r3, fp, #144
	mov	r2, #128
	mov	r1, r3
	ldr	r0, [fp, #-156]
	bl	read
	str	r0, [fp, #-152]
	ldr	r3, [fp, #-152]
	cmp	r3, #128
	beq	.L9
	ldr	r0, .L20+28
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	sub	r3, fp, #144
	mov	r2, #128
	mov	r1, r3
	ldr	r0, [fp, #-160]
	bl	write
	add	r4, r4, #1
.L8:
	cmp	r4, #43
	ble	.L10
	ldr	r0, [fp, #-156]
	bl	close
	mov	r1, #0
	ldr	r0, .L20+32
	bl	open
	str	r0, [fp, #-156]
	ldr	r3, [fp, #-156]
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L20+36
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	sub	r3, fp, #148
	mov	r2, #3
	mov	r1, r3
	ldr	r0, [fp, #-156]
	bl	read
	str	r0, [fp, #-152]
	ldr	r3, [fp, #-152]
	cmp	r3, #3
	beq	.L12
	ldr	r0, .L20+36
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	ldrb	r3, [fp, #-148]	@ zero_extendqisi2
	cmp	r3, #255
	beq	.L13
	ldr	r0, .L20+40
	bl	puts
	mov	r0, #0
	bl	exit
.L13:
	mov	r4, #0
	b	.L14
.L16:
	sub	r3, fp, #144
	mov	r2, #128
	mov	r1, r3
	ldr	r0, [fp, #-160]
	bl	write
	add	r4, r4, #1
	cmp	r4, #6
	bne	.L14
	ldr	r0, .L20+44
	bl	puts
	b	.L15
.L14:
	sub	r3, fp, #144
	mov	r2, #128
	mov	r1, r3
	ldr	r0, [fp, #-156]
	bl	read
	str	r0, [fp, #-152]
	ldr	r3, [fp, #-152]
	cmp	r3, #128
	beq	.L16
	ldr	r3, [fp, #-152]
	cmp	r3, #0
	ble	.L19
	sub	r3, fp, #144
	mov	r2, #128
	mov	r1, r3
	ldr	r0, [fp, #-160]
	bl	write
	b	.L15
.L19:
	nop
.L15:
	ldr	r0, [fp, #-156]
	bl	close
	ldr	r0, [fp, #-160]
	bl	close
	mov	r3, #0
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC11
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.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
