	.file	"434540.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: cp oldfile newfile\n"
.LC1:
	.string	"Cannot open old file.\n"
.LC2:
	.string	"Copying file to itself.\n"
.LC3:
	.string	"Can't create new file.\n"
.LC4:
	.string	"Read error\n"
.LC5:
	.string	"Write error.\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	r13
	push	r12
	push	rbx
	sub	rsp, 40
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	cmp	DWORD PTR -52[rbp], 3
	je	.L2
	mov	edx, 26
	lea	rsi, .LC0[rip]
	mov	edi, 1
	mov	eax, 0
	call	write@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	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	.L3
	mov	edx, 22
	lea	rsi, .LC1[rip]
	mov	edi, 1
	mov	eax, 0
	call	write@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	eax, DWORD PTR -48[rbp]
	lea	rsi, buf.0[rip]
	mov	edi, eax
	mov	eax, 0
	call	fstat@PLT
	mov	eax, DWORD PTR buf.0[rip+8]
	mov	DWORD PTR -44[rbp], eax
	lea	rdx, buf.0[rip+200]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rsi, rdx
	mov	rdi, rax
	mov	eax, 0
	call	stat@PLT
	test	eax, eax
	js	.L4
	mov	eax, DWORD PTR buf.0[rip+208]
	and	eax, 24576
	cmp	eax, 16384
	jne	.L4
	mov	rax, QWORD PTR -64[rbp]
	mov	r13, QWORD PTR 8[rax]
	mov	rax, QWORD PTR -64[rbp]
	mov	r12, QWORD PTR 16[rax]
	lea	rbx, buf.0[rip+400]
	nop
.L5:
	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	.L5
	lea	rax, -1[rbx]
	mov	BYTE PTR [rax], 47
	mov	r12, rbx
	jmp	.L6
.L7:
	mov	rax, rbx
	lea	rbx, 1[rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	jne	.L6
	mov	rbx, r12
.L6:
	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	.L7
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	lea	rdx, buf.0[rip+400]
	mov	QWORD PTR [rax], rdx
.L4:
	lea	rdx, buf.0[rip+200]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rsi, rdx
	mov	rdi, rax
	mov	eax, 0
	call	stat@PLT
	test	eax, eax
	js	.L8
	mov	edx, DWORD PTR buf.0[rip]
	mov	eax, DWORD PTR buf.0[rip+200]
	cmp	edx, eax
	jne	.L8
	mov	edx, DWORD PTR buf.0[rip+4]
	mov	eax, DWORD PTR buf.0[rip+204]
	cmp	edx, eax
	jne	.L8
	mov	edx, 24
	lea	rsi, .LC2[rip]
	mov	edi, 1
	mov	eax, 0
	call	write@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	edx, DWORD PTR -44[rbp]
	mov	esi, edx
	mov	rdi, rax
	mov	eax, 0
	call	creat@PLT
	mov	DWORD PTR -40[rbp], eax
	cmp	DWORD PTR -40[rbp], 0
	jns	.L10
	mov	edx, 23
	lea	rsi, .LC3[rip]
	mov	edi, 1
	mov	eax, 0
	call	write@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	cmp	DWORD PTR -36[rbp], 0
	jns	.L11
	mov	edx, 11
	lea	rsi, .LC4[rip]
	mov	edi, 1
	mov	eax, 0
	call	write@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	edx, DWORD PTR -36[rbp]
	mov	eax, DWORD PTR -40[rbp]
	lea	rsi, buf.0[rip]
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	cmp	DWORD PTR -36[rbp], eax
	je	.L10
	mov	edx, 13
	lea	rsi, .LC5[rip]
	mov	edi, 1
	mov	eax, 0
	call	write@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	eax, DWORD PTR -48[rbp]
	mov	edx, 512
	lea	rsi, buf.0[rip]
	mov	edi, eax
	mov	eax, 0
	call	read@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jne	.L12
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.local	buf.0
	.comm	buf.0,1024,32
	.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	"434540.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: cp oldfile newfile\012\000"
	.align	2
.LC1:
	.ascii	"Cannot open old file.\012\000"
	.align	2
.LC2:
	.ascii	"Copying file to itself.\012\000"
	.align	2
.LC3:
	.ascii	"Can't create new file.\012\000"
	.align	2
.LC4:
	.ascii	"Read error\012\000"
	.align	2
.LC5:
	.ascii	"Write error.\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	ldr	r3, [fp, #-40]
	cmp	r3, #3
	beq	.L2
	mov	r2, #26
	ldr	r1, .L13
	mov	r0, #1
	bl	write
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bge	.L3
	mov	r2, #22
	ldr	r1, .L13+4
	mov	r0, #1
	bl	write
	mov	r0, #1
	bl	exit
.L3:
	ldr	r1, .L13+8
	ldr	r0, [fp, #-36]
	bl	fstat
	ldr	r3, .L13+8
	ldr	r3, [r3, #8]
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r2, .L13+12
	mov	r1, r2
	mov	r0, r3
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	blt	.L4
	ldr	r3, .L13+8
	ldr	r3, [r3, #208]
	and	r3, r3, #24576
	cmp	r3, #16384
	bne	.L4
	ldr	r3, [fp, #-44]
	ldr	r6, [r3, #4]
	ldr	r3, [fp, #-44]
	ldr	r5, [r3, #8]
	ldr	r4, .L13+16
	nop
.L5:
	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	.L5
	sub	r3, r4, #1
	mov	r2, #47
	strb	r2, [r3]
	mov	r5, r4
	b	.L6
.L7:
	mov	r3, r4
	add	r4, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	bne	.L6
	mov	r4, r5
.L6:
	mov	r3, r6
	add	r6, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	strb	r3, [r4]
	ldrb	r3, [r4]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L7
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r2, .L13+16
	str	r2, [r3]
.L4:
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r2, .L13+12
	mov	r1, r2
	mov	r0, r3
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	blt	.L8
	ldr	r3, .L13+8
	ldr	r2, [r3]
	ldr	r3, .L13+8
	ldr	r3, [r3, #200]
	cmp	r2, r3
	bne	.L8
	ldr	r3, .L13+8
	ldr	r2, [r3, #4]
	ldr	r3, .L13+8
	ldr	r3, [r3, #204]
	cmp	r2, r3
	bne	.L8
	mov	r2, #24
	ldr	r1, .L13+20
	mov	r0, #1
	bl	write
	mov	r0, #1
	bl	exit
.L8:
	ldr	r3, [fp, #-44]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, [fp, #-32]
	mov	r0, r3
	bl	creat
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L10
	mov	r2, #23
	ldr	r1, .L13+24
	mov	r0, #1
	bl	write
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L11
	mov	r2, #11
	ldr	r1, .L13+28
	mov	r0, #1
	bl	write
	mov	r0, #1
	bl	exit
.L11:
	ldr	r2, [fp, #-24]
	ldr	r1, .L13+8
	ldr	r0, [fp, #-28]
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-24]
	cmp	r3, r2
	beq	.L10
	mov	r2, #13
	ldr	r1, .L13+32
	mov	r0, #1
	bl	write
	mov	r0, #1
	bl	exit
.L10:
	mov	r2, #512
	ldr	r1, .L13+8
	ldr	r0, [fp, #-36]
	bl	read
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L12
	mov	r0, #0
	bl	exit
.L14:
	.align	2
.L13:
	.word	.LC0
	.word	.LC1
	.word	buf.4198
	.word	buf.4198+200
	.word	buf.4198+400
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.local	buf.4198
	.comm	buf.4198,1024,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
