	.file	"92324036.c"
	.intel_syntax noprefix
	.text
	.globl	buffer
	.bss
	.align 32
	.type	buffer, @object
	.size	buffer, 32768
buffer:
	.zero	32768
	.section	.rodata
.LC0:
	.string	"From"
.LC1:
	.string	"To"
	.align 8
.LC2:
	.string	"Record %d: read error, errno=%d\n"
.LC3:
	.string	"%d Kbyte records\n"
	.align 8
.LC4:
	.string	"Record %d: read short; expected %d, got %d\n"
	.align 8
.LC5:
	.string	"Record %d: write error: errno=%d\n"
	.align 8
.LC6:
	.string	"Record %d: write short; expected %d, got %d\n"
.LC7:
	.string	"%d records copied\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 160
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -164[rbp], 1
	mov	r12d, 32768
	lea	rax, -144[rbp]
	mov	edx, 0
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	getdev
	mov	DWORD PTR -160[rbp], eax
	lea	rax, -80[rbp]
	mov	edx, 1
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	getdev
	mov	DWORD PTR -156[rbp], eax
	mov	ebx, 0
.L10:
	mov	eax, DWORD PTR -160[rbp]
	mov	edx, r12d
	lea	rsi, buffer[rip]
	mov	edi, eax
	mov	eax, 0
	call	read@PLT
	mov	DWORD PTR -152[rbp], eax
	cmp	DWORD PTR -152[rbp], 0
	je	.L13
	cmp	DWORD PTR -152[rbp], 0
	jns	.L4
	mov	eax, DWORD PTR errno[rip]
	mov	edx, eax
	mov	esi, ebx
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L3
.L4:
	cmp	DWORD PTR -164[rbp], 0
	je	.L5
	cmp	DWORD PTR -152[rbp], r12d
	je	.L6
	mov	r12d, DWORD PTR -152[rbp]
.L6:
	cmp	DWORD PTR -164[rbp], 0
	sete	al
	movzx	eax, al
	mov	DWORD PTR -164[rbp], eax
	mov	eax, r12d
	lea	edx, 1023[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 10
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L5:
	cmp	DWORD PTR -152[rbp], r12d
	jge	.L7
	mov	eax, DWORD PTR -152[rbp]
	mov	ecx, eax
	mov	edx, 32768
	mov	esi, ebx
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
.L7:
	mov	edx, DWORD PTR -152[rbp]
	mov	eax, DWORD PTR -156[rbp]
	lea	rsi, buffer[rip]
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	mov	DWORD PTR -148[rbp], eax
	cmp	DWORD PTR -148[rbp], 0
	jns	.L8
	mov	eax, DWORD PTR errno[rip]
	mov	edx, eax
	mov	esi, ebx
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L3
.L8:
	mov	eax, DWORD PTR -148[rbp]
	cmp	eax, DWORD PTR -152[rbp]
	jge	.L9
	mov	edx, DWORD PTR -148[rbp]
	mov	eax, DWORD PTR -152[rbp]
	mov	ecx, edx
	mov	edx, eax
	mov	esi, ebx
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L3
.L9:
	add	ebx, 1
	jmp	.L10
.L13:
	nop
.L3:
	mov	esi, ebx
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	add	rsp, 160
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC8:
	.string	"%s: "
	.text
	.globl	getdev
	.type	getdev, @function
getdev:
.LFB1:
	.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, 40
	.cfi_offset 3, -24
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
.L15:
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	gets@PLT
	mov	edx, DWORD PTR -36[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, edx
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	ebx, eax
	test	ebx, ebx
	jle	.L15
	mov	eax, ebx
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	getdev, .-getdev
	.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	"92324036.c"
	.text
	.comm	buffer,32768,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"From\000"
	.align	2
.LC1:
	.ascii	"To\000"
	.align	2
.LC2:
	.ascii	"Record %d: read error, errno=%d\012\000"
	.align	2
.LC3:
	.ascii	"%d Kbyte records\012\000"
	.align	2
.LC4:
	.ascii	"Record %d: read short; expected %d, got %d\012\000"
	.align	2
.LC5:
	.ascii	"Record %d: write error: errno=%d\012\000"
	.align	2
.LC6:
	.ascii	"Record %d: write short; expected %d, got %d\012\000"
	.align	2
.LC7:
	.ascii	"%d records copied\012\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #128
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-140]
	mov	r5, #32768
	sub	r3, fp, #120
	mov	r2, #0
	mov	r1, r3
	ldr	r0, .L14+4
	bl	getdev
	str	r0, [fp, #-136]
	sub	r3, fp, #68
	mov	r2, #1
	mov	r1, r3
	ldr	r0, .L14+8
	bl	getdev
	str	r0, [fp, #-132]
	mov	r4, #0
.L10:
	mov	r2, r5
	ldr	r1, .L14+12
	ldr	r0, [fp, #-136]
	bl	read
	str	r0, [fp, #-128]
	ldr	r3, [fp, #-128]
	cmp	r3, #0
	beq	.L13
	ldr	r3, [fp, #-128]
	cmp	r3, #0
	bge	.L4
	ldr	r3, .L14+16
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L14+20
	bl	printf
	b	.L3
.L4:
	ldr	r3, [fp, #-140]
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-128]
	cmp	r3, r5
	beq	.L6
	ldr	r5, [fp, #-128]
.L6:
	ldr	r3, [fp, #-140]
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-140]
	mov	r3, r5
	add	r2, r3, #1020
	add	r2, r2, #3
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #10
	mov	r1, r3
	ldr	r0, .L14+24
	bl	printf
.L5:
	ldr	r3, [fp, #-128]
	cmp	r3, r5
	bge	.L7
	ldr	r3, [fp, #-128]
	mov	r2, #32768
	mov	r1, r4
	ldr	r0, .L14+28
	bl	printf
.L7:
	ldr	r2, [fp, #-128]
	ldr	r1, .L14+12
	ldr	r0, [fp, #-132]
	bl	write
	str	r0, [fp, #-124]
	ldr	r3, [fp, #-124]
	cmp	r3, #0
	bge	.L8
	ldr	r3, .L14+16
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L14+32
	bl	printf
	b	.L3
.L8:
	ldr	r2, [fp, #-124]
	ldr	r3, [fp, #-128]
	cmp	r2, r3
	bge	.L9
	ldr	r3, [fp, #-124]
	ldr	r2, [fp, #-128]
	mov	r1, r4
	ldr	r0, .L14+36
	bl	printf
	b	.L3
.L9:
	add	r4, r4, #1
	b	.L10
.L13:
	nop
.L3:
	mov	r1, r4
	ldr	r0, .L14+40
	bl	printf
	mov	r3, #0
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC8
	.word	.LC0
	.word	.LC1
	.word	buffer
	.word	errno
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.section	.rodata
	.align	2
.LC9:
	.ascii	"%s: \000"
	.text
	.align	2
	.global	getdev
	.syntax unified
	.arm
	.fpu softvfp
	.type	getdev, %function
getdev:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
.L17:
	ldr	r1, [fp, #-16]
	ldr	r0, .L19
	bl	printf
	ldr	r0, [fp, #-20]
	bl	gets
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-20]
	bl	open
	mov	r4, r0
	cmp	r4, #0
	ble	.L17
	mov	r3, r4
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC9
	.size	getdev, .-getdev
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
