	.file	"860837.c"
	.intel_syntax noprefix
	.text
	.globl	fd1
	.bss
	.align 4
	.type	fd1, @object
	.size	fd1, 4
fd1:
	.zero	4
	.globl	fd2
	.align 4
	.type	fd2, @object
	.size	fd2, 4
fd2:
	.zero	4
	.globl	fd3
	.align 4
	.type	fd3, @object
	.size	fd3, 4
fd3:
	.zero	4
	.section	.rodata
.LC0:
	.string	"/etc/passwd"
.LC1:
	.string	"saida.txt"
.LC2:
	.string	"erros.txt"
	.align 8
.LC3:
	.string	"Houve a abertura dos ficheiros.\nAgora vai haver copia dos descritores de input output e erro"
.LC4:
	.string	"aaaa"
.LC5:
	.string	"cat"
.LC6:
	.string	"descritores fechados"
	.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 384
	mov	esi, 514
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR fd1[rip], eax
	mov	edx, 384
	mov	esi, 578
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR fd2[rip], eax
	mov	edx, 384
	mov	esi, 578
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR fd3[rip], eax
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, DWORD PTR fd1[rip]
	mov	esi, 0
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR fd1[rip]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR fd2[rip]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR fd2[rip]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR fd3[rip]
	mov	esi, 2
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR fd3[rip]
	mov	edi, eax
	call	close@PLT
	call	fork@PLT
	test	eax, eax
	jne	.L2
	lea	rax, -18[rbp]
	mov	edx, 10
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	lea	rax, -18[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	lea	rax, -18[rbp]
	mov	rsi, rax
	mov	edi, 2
	call	write@PLT
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -18[rbp]
	mov	edx, 0
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	execlp@PLT
	mov	edi, -1
	call	_exit@PLT
.L2:
	lea	rax, -36[rbp]
	mov	rdi, rax
	call	wait@PLT
	mov	DWORD PTR -32[rbp], eax
	call	getpid@PLT
	mov	DWORD PTR -28[rbp], eax
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"860837.c"
	.text
	.comm	fd1,4,4
	.comm	fd2,4,4
	.comm	fd3,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/etc/passwd\000"
	.align	2
.LC1:
	.ascii	"saida.txt\000"
	.align	2
.LC2:
	.ascii	"erros.txt\000"
	.align	2
.LC3:
	.ascii	"Houve a abertura dos ficheiros.\012Agora vai haver "
	.ascii	"copia dos descritores de input output e erro\000"
	.align	2
.LC4:
	.ascii	"aaaa\000"
	.align	2
.LC5:
	.ascii	"cat\000"
	.align	2
.LC6:
	.ascii	"descritores fechados\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.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, .L5
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #384
	ldr	r1, .L5+4
	ldr	r0, .L5+8
	bl	open
	mov	r3, r0
	ldr	r2, .L5+12
	str	r3, [r2]
	mov	r2, #384
	ldr	r1, .L5+16
	ldr	r0, .L5+20
	bl	open
	mov	r3, r0
	ldr	r2, .L5+24
	str	r3, [r2]
	mov	r2, #384
	ldr	r1, .L5+16
	ldr	r0, .L5+28
	bl	open
	mov	r3, r0
	ldr	r2, .L5+32
	str	r3, [r2]
	ldr	r0, .L5+36
	bl	puts
	ldr	r3, .L5+12
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	dup2
	ldr	r3, .L5+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L5+24
	ldr	r3, [r3]
	mov	r1, #1
	mov	r0, r3
	bl	dup2
	ldr	r3, .L5+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L5+32
	ldr	r3, [r3]
	mov	r1, #2
	mov	r0, r3
	bl	dup2
	ldr	r3, .L5+32
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	sub	r3, fp, #20
	mov	r2, #10
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-24]
	ldr	r2, [fp, #-24]
	sub	r3, fp, #20
	mov	r1, r3
	mov	r0, #1
	bl	write
	ldr	r2, [fp, #-24]
	sub	r3, fp, #20
	mov	r1, r3
	mov	r0, #2
	bl	write
	ldr	r0, .L5+40
	bl	printf
	sub	r3, fp, #20
	mov	r2, #0
	mov	r1, r3
	ldr	r0, .L5+44
	bl	execlp
	mvn	r0, #0
	bl	_exit
.L2:
	sub	r3, fp, #36
	mov	r0, r3
	bl	wait
	str	r0, [fp, #-32]
	bl	getpid
	str	r0, [fp, #-28]
	ldr	r0, .L5+48
	bl	puts
	mov	r3, #0
	ldr	r2, .L5
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L4
	bl	__stack_chk_fail
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC7
	.word	514
	.word	.LC0
	.word	fd1
	.word	578
	.word	.LC1
	.word	fd2
	.word	.LC2
	.word	fd3
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
