	.file	"133260.c"
	.intel_syntax noprefix
	.text
	.globl	stbuf1
	.bss
	.align 32
	.type	stbuf1, @object
	.size	stbuf1, 144
stbuf1:
	.zero	144
	.globl	stbuf2
	.align 32
	.type	stbuf2, @object
	.size	stbuf2, 144
stbuf2:
	.zero	144
	.globl	iobuf
	.align 32
	.type	iobuf, @object
	.size	iobuf, 512
iobuf:
	.zero	512
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: cp: f1 f2; or cp f1 ... fn d2\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
	cmp	DWORD PTR -20[rbp], 2
	jle	.L8
	cmp	DWORD PTR -20[rbp], 3
	jle	.L4
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 3
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, stbuf2[rip]
	mov	rdi, rax
	call	stat@PLT
	test	eax, eax
	js	.L9
	mov	eax, DWORD PTR stbuf2[rip+24]
	and	eax, 61440
	cmp	eax, 16384
	jne	.L10
.L4:
	mov	DWORD PTR -4[rbp], 0
	mov	DWORD PTR -8[rbp], 1
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 3
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rdx
	mov	rdi, rax
	call	copy
	or	DWORD PTR -4[rbp], eax
	add	DWORD PTR -8[rbp], 1
.L6:
	mov	eax, DWORD PTR -20[rbp]
	sub	eax, 1
	cmp	DWORD PTR -8[rbp], eax
	jl	.L7
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	exit@PLT
.L8:
	nop
	jmp	.L3
.L9:
	nop
	jmp	.L3
.L10:
	nop
.L3:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 37
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC1:
	.string	"cp: cannot open %s\n"
	.align 8
.LC2:
	.string	"cp: cannot copy file to itself.\n"
.LC3:
	.string	"cp: cannot create %s\n"
.LC4:
	.string	"cp: read error\n"
.LC5:
	.string	"cp: write error.\n"
	.text
	.globl	copy
	.type	copy, @function
copy:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	sub	rsp, 40
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR -56[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	jns	.L12
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L13
.L12:
	mov	eax, DWORD PTR -48[rbp]
	lea	rsi, stbuf1[rip]
	mov	edi, eax
	call	fstat@PLT
	mov	eax, DWORD PTR stbuf1[rip+24]
	mov	DWORD PTR -44[rbp], eax
	mov	rax, QWORD PTR -64[rbp]
	lea	rsi, stbuf2[rip]
	mov	rdi, rax
	call	stat@PLT
	test	eax, eax
	js	.L14
	mov	eax, DWORD PTR stbuf2[rip+24]
	and	eax, 61440
	cmp	eax, 16384
	jne	.L14
	mov	r13, QWORD PTR -56[rbp]
	mov	r12, QWORD PTR -64[rbp]
	lea	rbx, iobuf[rip]
	nop
.L15:
	mov	rdx, r12
	lea	r12, 1[rdx]
	mov	rax, rbx
	lea	rbx, 1[rax]
	movzx	edx, BYTE PTR [rdx]
	mov	BYTE PTR [rax], dl
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L15
	lea	rax, -1[rbx]
	mov	BYTE PTR [rax], 47
	mov	r12, rbx
	jmp	.L16
.L17:
	mov	rax, rbx
	lea	rbx, 1[rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	jne	.L16
	mov	rbx, r12
.L16:
	mov	rax, r13
	lea	r13, 1[rax]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rbx], al
	movzx	eax, BYTE PTR [rbx]
	test	al, al
	jne	.L17
	lea	rax, iobuf[rip]
	mov	QWORD PTR -64[rbp], rax
.L14:
	mov	rax, QWORD PTR -64[rbp]
	lea	rsi, stbuf2[rip]
	mov	rdi, rax
	call	stat@PLT
	test	eax, eax
	js	.L18
	mov	rdx, QWORD PTR stbuf1[rip]
	mov	rax, QWORD PTR stbuf2[rip]
	cmp	rdx, rax
	jne	.L18
	mov	rdx, QWORD PTR stbuf1[rip+8]
	mov	rax, QWORD PTR stbuf2[rip+8]
	cmp	rdx, rax
	jne	.L18
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 32
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L13
.L18:
	mov	edx, DWORD PTR -44[rbp]
	mov	rax, QWORD PTR -64[rbp]
	mov	esi, 577
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -40[rbp], eax
	cmp	DWORD PTR -40[rbp], 0
	jns	.L20
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -64[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR -48[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 1
	jmp	.L13
.L22:
	cmp	DWORD PTR -36[rbp], 0
	jns	.L21
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 15
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR -48[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 1
	jmp	.L13
.L21:
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -40[rbp]
	lea	rsi, iobuf[rip]
	mov	edi, eax
	call	write@PLT
	mov	edx, DWORD PTR -36[rbp]
	movsx	rdx, edx
	cmp	rax, rdx
	je	.L20
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 17
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR -48[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 1
	jmp	.L13
.L20:
	mov	eax, DWORD PTR -48[rbp]
	mov	edx, 512
	lea	rsi, iobuf[rip]
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jne	.L22
	mov	eax, DWORD PTR -48[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -40[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L13:
	add	rsp, 40
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	copy, .-copy
	.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	"133260.c"
	.text
	.comm	stbuf1,88,8
	.comm	stbuf2,88,8
	.comm	iobuf,512,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: cp: f1 f2; or cp f1 ... fn d2\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, #-16]
	cmp	r3, #2
	ble	.L8
	ldr	r3, [fp, #-16]
	cmp	r3, #3
	ble	.L4
	ldr	r3, [fp, #-16]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L11
	mov	r0, r3
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	blt	.L9
	ldr	r3, .L11
	ldr	r3, [r3, #16]
	and	r3, r3, #61440
	cmp	r3, #16384
	bne	.L10
.L4:
	mov	r3, #0
	str	r3, [fp, #-8]
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L6
.L7:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	bl	copy
	mov	r2, r0
	ldr	r3, [fp, #-8]
	orr	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L6:
	ldr	r3, [fp, #-16]
	sub	r3, r3, #1
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L7
	ldr	r0, [fp, #-8]
	bl	exit
.L8:
	nop
	b	.L3
.L9:
	nop
	b	.L3
.L10:
	nop
.L3:
	ldr	r3, .L11+4
	ldr	r3, [r3]
	mov	r2, #37
	mov	r1, #1
	ldr	r0, .L11+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L12:
	.align	2
.L11:
	.word	stbuf2
	.word	stderr
	.word	.LC0
	.size	main, .-main
	.section	.rodata
	.align	2
.LC1:
	.ascii	"cp: cannot open %s\012\000"
	.align	2
.LC2:
	.ascii	"cp: cannot copy file to itself.\012\000"
	.align	2
.LC3:
	.ascii	"cp: cannot create %s\012\000"
	.align	2
.LC4:
	.ascii	"cp: read error\012\000"
	.align	2
.LC5:
	.ascii	"cp: write error.\012\000"
	.text
	.align	2
	.global	copy
	.syntax unified
	.arm
	.fpu softvfp
	.type	copy, %function
copy:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, fp, lr}
	add	fp, sp, #16
	sub	sp, sp, #28
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	mov	r1, #0
	ldr	r0, [fp, #-40]
	bl	open
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bge	.L14
	ldr	r3, .L25
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	ldr	r1, .L25+4
	mov	r0, r3
	bl	fprintf
	mov	r3, #1
	b	.L15
.L14:
	ldr	r1, .L25+8
	ldr	r0, [fp, #-36]
	bl	fstat
	ldr	r3, .L25+8
	ldr	r3, [r3, #16]
	str	r3, [fp, #-32]
	ldr	r1, .L25+12
	ldr	r0, [fp, #-44]
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	blt	.L16
	ldr	r3, .L25+12
	ldr	r3, [r3, #16]
	and	r3, r3, #61440
	cmp	r3, #16384
	bne	.L16
	ldr	r6, [fp, #-40]
	ldr	r5, [fp, #-44]
	ldr	r4, .L25+16
	nop
.L17:
	mov	r2, r5
	add	r5, r2, #1
	mov	r3, r4
	add	r4, r3, #1
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L17
	sub	r3, r4, #1
	mov	r2, #47
	strb	r2, [r3]
	mov	r5, r4
	b	.L18
.L19:
	mov	r3, r4
	add	r4, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	bne	.L18
	mov	r4, r5
.L18:
	mov	r3, r6
	add	r6, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	strb	r3, [r4]
	ldrb	r3, [r4]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L19
	ldr	r3, .L25+16
	str	r3, [fp, #-44]
.L16:
	ldr	r1, .L25+12
	ldr	r0, [fp, #-44]
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	blt	.L20
	ldr	r3, .L25+8
	ldmia	r3, {r0-r1}
	ldr	r3, .L25+12
	ldmia	r3, {r2-r3}
	cmp	r1, r3
	cmpeq	r0, r2
	bne	.L20
	ldr	r3, .L25+8
	ldr	r2, [r3, #12]
	ldr	r3, .L25+12
	ldr	r3, [r3, #12]
	cmp	r2, r3
	bne	.L20
	ldr	r3, .L25
	ldr	r3, [r3]
	mov	r2, #32
	mov	r1, #1
	ldr	r0, .L25+20
	bl	fwrite
	mov	r3, #1
	b	.L15
.L20:
	ldr	r2, [fp, #-32]
	ldr	r1, .L25+24
	ldr	r0, [fp, #-44]
	bl	open
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L22
	ldr	r3, .L25
	ldr	r3, [r3]
	ldr	r2, [fp, #-44]
	ldr	r1, .L25+28
	mov	r0, r3
	bl	fprintf
	ldr	r0, [fp, #-36]
	bl	close
	mov	r3, #1
	b	.L15
.L24:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L23
	ldr	r3, .L25
	ldr	r3, [r3]
	mov	r2, #15
	mov	r1, #1
	ldr	r0, .L25+32
	bl	fwrite
	ldr	r0, [fp, #-36]
	bl	close
	ldr	r0, [fp, #-28]
	bl	close
	mov	r3, #1
	b	.L15
.L23:
	ldr	r3, [fp, #-24]
	mov	r2, r3
	ldr	r1, .L25+16
	ldr	r0, [fp, #-28]
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-24]
	cmp	r3, r2
	beq	.L22
	ldr	r3, .L25
	ldr	r3, [r3]
	mov	r2, #17
	mov	r1, #1
	ldr	r0, .L25+36
	bl	fwrite
	ldr	r0, [fp, #-36]
	bl	close
	ldr	r0, [fp, #-28]
	bl	close
	mov	r3, #1
	b	.L15
.L22:
	mov	r2, #512
	ldr	r1, .L25+16
	ldr	r0, [fp, #-36]
	bl	read
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L24
	ldr	r0, [fp, #-36]
	bl	close
	ldr	r0, [fp, #-28]
	bl	close
	mov	r3, #0
.L15:
	mov	r0, r3
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r5, r6, fp, pc}
.L26:
	.align	2
.L25:
	.word	stderr
	.word	.LC1
	.word	stbuf1
	.word	stbuf2
	.word	iobuf
	.word	.LC2
	.word	577
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	copy, .-copy
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
