	.file	"599940.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Incorrect number of arguments\n"
.LC1:
	.string	"r"
.LC2:
	.string	"Failed to open infile\n"
.LC3:
	.string	"Failed to fseek infile\n"
.LC4:
	.string	"Failed to ftell infile\n"
.LC5:
	.string	"w"
.LC6:
	.string	"Failed to open outfile\n"
.LC7:
	.string	"Failed to fseek outfile\n"
.LC8:
	.string	"Failed to ftell outfile\n"
.LC9:
	.string	"File sizes don't match\n"
.LC10:
	.string	"Failed to close outfile\n"
.LC11:
	.string	"Failed to close infile\n"
.LC12:
	.string	"Failed to remove infile\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
	sub	rsp, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	cmp	DWORD PTR -52[rbp], 3
	je	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], 0
	jne	.L4
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	eax, 2
	jmp	.L3
.L4:
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	test	eax, eax
	je	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	eax, 3
	jmp	.L3
.L5:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], -1
	jne	.L6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	eax, 4
	jmp	.L3
.L6:
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	test	eax, eax
	je	.L7
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	eax, 5
	jmp	.L3
.L7:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	eax, 6
	jmp	.L3
.L10:
	mov	rdx, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
.L9:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], -1
	jne	.L10
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	test	eax, eax
	je	.L11
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	eax, 7
	jmp	.L3
.L11:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L12
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	mov	eax, 8
	jmp	.L3
.L12:
	mov	rax, QWORD PTR -24[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	je	.L13
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	mov	eax, 9
	jmp	.L3
.L13:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	test	eax, eax
	je	.L14
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	eax, 10
	jmp	.L3
.L14:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fclose@PLT
	test	eax, eax
	je	.L15
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
	mov	eax, 11
	jmp	.L3
.L15:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	remove@PLT
	test	eax, eax
	je	.L16
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC12[rip]
	call	fwrite@PLT
	mov	eax, 12
	jmp	.L3
.L16:
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"599940.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Incorrect number of arguments\012\000"
	.align	2
.LC1:
	.ascii	"r\000"
	.align	2
.LC2:
	.ascii	"Failed to open infile\012\000"
	.align	2
.LC3:
	.ascii	"Failed to fseek infile\012\000"
	.align	2
.LC4:
	.ascii	"Failed to ftell infile\012\000"
	.align	2
.LC5:
	.ascii	"w\000"
	.align	2
.LC6:
	.ascii	"Failed to open outfile\012\000"
	.align	2
.LC7:
	.ascii	"Failed to fseek outfile\012\000"
	.align	2
.LC8:
	.ascii	"Failed to ftell outfile\012\000"
	.align	2
.LC9:
	.ascii	"File sizes don't match\012\000"
	.align	2
.LC10:
	.ascii	"Failed to close outfile\012\000"
	.align	2
.LC11:
	.ascii	"Failed to close infile\012\000"
	.align	2
.LC12:
	.ascii	"Failed to remove infile\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r3, #3
	beq	.L2
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L17+4
	bl	fwrite
	mov	r3, #1
	b	.L3
.L2:
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L17+8
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L17+12
	bl	fwrite
	mov	r3, #2
	b	.L3
.L4:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-24]
	bl	fseek
	mov	r3, r0
	cmp	r3, #0
	beq	.L5
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L17+16
	bl	fwrite
	mov	r3, #3
	b	.L3
.L5:
	ldr	r0, [fp, #-24]
	bl	ftell
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L6
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L17+20
	bl	fwrite
	mov	r3, #4
	b	.L3
.L6:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-24]
	bl	fseek
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L17+16
	bl	fwrite
	mov	r3, #5
	b	.L3
.L7:
	ldr	r3, [fp, #-36]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L17+24
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L9
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L17+28
	bl	fwrite
	mov	r3, #6
	b	.L3
.L10:
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-12]
	bl	fputc
.L9:
	ldr	r0, [fp, #-24]
	bl	fgetc
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L10
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	fseek
	mov	r3, r0
	cmp	r3, #0
	beq	.L11
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L17+32
	bl	fwrite
	mov	r3, #7
	b	.L3
.L11:
	ldr	r0, [fp, #-16]
	bl	ftell
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L12
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L17+36
	bl	fwrite
	mov	r3, #8
	b	.L3
.L12:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	beq	.L13
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L17+40
	bl	fwrite
	mov	r3, #9
	b	.L3
.L13:
	ldr	r0, [fp, #-16]
	bl	fclose
	mov	r3, r0
	cmp	r3, #0
	beq	.L14
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L17+44
	bl	fwrite
	mov	r3, #10
	b	.L3
.L14:
	ldr	r0, [fp, #-24]
	bl	fclose
	mov	r3, r0
	cmp	r3, #0
	beq	.L15
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L17+48
	bl	fwrite
	mov	r3, #11
	b	.L3
.L15:
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	remove
	mov	r3, r0
	cmp	r3, #0
	beq	.L16
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L17+52
	bl	fwrite
	mov	r3, #12
	b	.L3
.L16:
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
