	.file	"906058.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Error: \tCould not read source file\n\tFile or read Permissions missing"
	.align 8
.LC1:
	.string	"Error: \tCould not write to target file\n\tCheck File Permissions"
	.text
	.globl	sig_usr
	.type	sig_usr, @function
sig_usr:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	cmp	DWORD PTR -4[rbp], 10
	jne	.L2
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L2:
	cmp	DWORD PTR -4[rbp], 11
	jne	.L5
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	nop
.L5:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	sig_usr, .-sig_usr
	.section	.rodata
	.align 8
.LC2:
	.string	"Usage: duplicate \"source file\" \"target file\""
.LC3:
	.string	"duplicate: still duplicating"
.LC4:
	.string	"r"
.LC5:
	.string	"w"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	cmp	DWORD PTR -68[rbp], 2
	jg	.L7
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 2
	jmp	.L8
.L7:
	mov	eax, 0
	call	getpid@PLT
	mov	DWORD PTR -48[rbp], eax
	call	fork@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	je	.L9
	lea	rsi, sig_usr[rip]
	mov	edi, 10
	call	signal@PLT
	lea	rsi, sig_usr[rip]
	mov	edi, 11
	call	signal@PLT
	mov	edi, 1
	mov	eax, 0
	call	sleep@PLT
	jmp	.L10
.L11:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	edi, 1
	mov	eax, 0
	call	sleep@PLT
.L10:
	mov	rcx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
	test	eax, eax
	je	.L11
	jmp	.L17
.L9:
	mov	rax, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	edi, 1000
	mov	eax, 0
	call	usleep@PLT
	cmp	QWORD PTR -24[rbp], 0
	jne	.L13
	mov	eax, DWORD PTR -48[rbp]
	mov	esi, 10
	mov	edi, eax
	call	kill@PLT
	mov	eax, 1
	jmp	.L8
.L13:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L14
	mov	eax, DWORD PTR -48[rbp]
	mov	esi, 11
	mov	edi, eax
	call	kill@PLT
	mov	eax, 1
	jmp	.L8
.L14:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -49[rbp], al
	jmp	.L15
.L16:
	movsx	eax, BYTE PTR -49[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -49[rbp], al
.L15:
	cmp	BYTE PTR -49[rbp], -1
	jne	.L16
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	edi, 2
	mov	eax, 0
	call	sleep@PLT
	mov	eax, 0
	jmp	.L8
.L17:
	mov	eax, 0
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"906058.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Error: \011Could not read source file\012\011File o"
	.ascii	"r read Permissions missing\000"
	.align	2
.LC1:
	.ascii	"Error: \011Could not write to target file\012\011Ch"
	.ascii	"eck File Permissions\000"
	.text
	.align	2
	.global	sig_usr
	.syntax unified
	.arm
	.fpu softvfp
	.type	sig_usr, %function
sig_usr:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	bne	.L2
	ldr	r0, .L6
	bl	printf
.L2:
	ldr	r3, [fp, #-8]
	cmp	r3, #11
	bne	.L5
	ldr	r0, .L6+4
	bl	printf
	nop
.L5:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.word	.LC1
	.size	sig_usr, .-sig_usr
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Usage: duplicate \"source file\" \"target file\"\000"
	.align	2
.LC3:
	.ascii	"duplicate: still duplicating\000"
	.align	2
.LC4:
	.ascii	"r\000"
	.align	2
.LC5:
	.ascii	"w\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, [fp, #-40]
	cmp	r3, #2
	bgt	.L9
	ldr	r0, .L19
	bl	printf
	mov	r3, #2
	b	.L10
.L9:
	bl	getpid
	str	r0, [fp, #-32]
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L11
	ldr	r1, .L19+4
	mov	r0, #10
	bl	signal
	ldr	r1, .L19+4
	mov	r0, #11
	bl	signal
	mov	r0, #1
	bl	sleep
	b	.L12
.L13:
	ldr	r0, .L19+8
	bl	puts
	mov	r0, #1
	bl	sleep
.L12:
	mov	r2, #1
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-28]
	bl	waitpid
	mov	r3, r0
	cmp	r3, #0
	beq	.L13
	b	.L18
.L11:
	ldr	r3, [fp, #-44]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-44]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-20]
	ldr	r1, .L19+12
	ldr	r0, [fp, #-24]
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r1, .L19+16
	ldr	r0, [fp, #-20]
	bl	fopen
	str	r0, [fp, #-12]
	mov	r0, #1000
	bl	usleep
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L15
	mov	r1, #10
	ldr	r0, [fp, #-32]
	bl	kill
	mov	r3, #1
	b	.L10
.L15:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L16
	mov	r1, #11
	ldr	r0, [fp, #-32]
	bl	kill
	mov	r3, #1
	b	.L10
.L16:
	ldr	r0, [fp, #-16]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-33]
.L17:
	ldrb	r3, [fp, #-33]	@ zero_extendqisi2
	ldr	r1, [fp, #-12]
	mov	r0, r3
	bl	fputc
	ldr	r0, [fp, #-16]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-33]
	b	.L17
.L18:
	mov	r3, #0
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC2
	.word	sig_usr
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
