	.file	"130936.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"dup2(STDIN_FILENO)"
.LC1:
	.string	"dup2(STDOUT_FILENO)"
.LC2:
	.string	"dup2(STDERR_FILENO)"
	.text
	.globl	pipedfork
	.type	pipedfork, @function
pipedfork:
.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, 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L2
	mov	eax, 0
	jmp	.L27
.L2:
	lea	rax, -32[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L4
	mov	DWORD PTR -44[rbp], 0
	jmp	.L5
.L6:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	mov	eax, DWORD PTR -32[rbp+rax*4]
	mov	edi, eax
	call	close@PLT
	add	DWORD PTR -44[rbp], 1
.L5:
	cmp	DWORD PTR -44[rbp], 1
	jle	.L6
	mov	eax, 0
	jmp	.L27
.L4:
	lea	rax, -32[rbp]
	add	rax, 16
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L7
	mov	DWORD PTR -44[rbp], 0
	jmp	.L8
.L9:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	mov	eax, DWORD PTR -32[rbp+rax*4]
	mov	edi, eax
	call	close@PLT
	add	DWORD PTR -44[rbp], 1
.L8:
	cmp	DWORD PTR -44[rbp], 3
	jle	.L9
	mov	eax, 0
	jmp	.L27
.L7:
	mov	esi, 1
	mov	edi, 16
	call	calloc@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L10
	mov	DWORD PTR -44[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	mov	eax, DWORD PTR -32[rbp+rax*4]
	mov	edi, eax
	call	close@PLT
	add	DWORD PTR -44[rbp], 1
.L11:
	cmp	DWORD PTR -44[rbp], 5
	jle	.L12
	mov	eax, 0
	jmp	.L27
.L10:
	call	fork@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR 12[rax], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 12[rax]
	cmp	eax, -1
	je	.L13
	test	eax, eax
	je	.L14
	jmp	.L29
.L13:
	mov	DWORD PTR -44[rbp], 0
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	mov	eax, DWORD PTR -32[rbp+rax*4]
	mov	edi, eax
	call	close@PLT
	add	DWORD PTR -44[rbp], 1
.L16:
	cmp	DWORD PTR -44[rbp], 5
	jle	.L17
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	jmp	.L27
.L14:
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, 0
	mov	edi, eax
	call	dup2@PLT
	mov	rdx, QWORD PTR -40[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L18
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	DWORD PTR -44[rbp], 0
	jmp	.L19
.L20:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	mov	eax, DWORD PTR -32[rbp+rax*4]
	mov	edi, eax
	call	close@PLT
	add	DWORD PTR -44[rbp], 1
.L19:
	cmp	DWORD PTR -44[rbp], 5
	jle	.L20
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	jmp	.L27
.L18:
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	rdx, QWORD PTR -40[rbp]
	mov	DWORD PTR 4[rdx], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	eax, -1
	jne	.L21
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	DWORD PTR -44[rbp], 0
	jmp	.L22
.L23:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	mov	eax, DWORD PTR -32[rbp+rax*4]
	mov	edi, eax
	call	close@PLT
	add	DWORD PTR -44[rbp], 1
.L22:
	cmp	DWORD PTR -44[rbp], 5
	jle	.L23
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	jmp	.L27
.L21:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 2
	mov	edi, eax
	call	dup2@PLT
	mov	rdx, QWORD PTR -40[rbp]
	mov	DWORD PTR 8[rdx], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 8[rax]
	cmp	eax, -1
	jne	.L24
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	DWORD PTR -44[rbp], 0
	jmp	.L25
.L26:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	mov	eax, DWORD PTR -32[rbp+rax*4]
	mov	edi, eax
	call	close@PLT
	add	DWORD PTR -44[rbp], 1
.L25:
	cmp	DWORD PTR -44[rbp], 5
	jle	.L26
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	jmp	.L27
.L24:
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -40[rbp]
	jmp	.L27
.L29:
	mov	edx, 2048
	mov	esi, 4
	mov	edi, 0
	mov	eax, 0
	call	fcntl@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	edx, 2048
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	edx, 2048
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	edx, DWORD PTR -28[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], edx
	mov	edx, DWORD PTR -24[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	edx, DWORD PTR -16[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -40[rbp]
.L27:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	pipedfork, .-pipedfork
	.globl	pipedclose
	.type	pipedclose, @function
pipedclose:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	cmp	QWORD PTR -8[rbp], 0
	je	.L34
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L35
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR 4[rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR 8[rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], 0
	jmp	.L30
.L34:
	nop
	jmp	.L30
.L35:
	nop
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	pipedclose, .-pipedclose
	.section	.rodata
.LC3:
	.string	"Usage: %s program args ...\n"
.LC4:
	.string	"pipedfork()"
.LC5:
	.string	"execvp()"
.LC6:
	.string	"waitid()"
.LC7:
	.string	"poll()"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 2112
	mov	DWORD PTR -2100[rbp], edi
	mov	QWORD PTR -2112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -2100[rbp], 1
	jg	.L37
	mov	rax, QWORD PTR -2112[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L58
.L37:
	call	pipedfork
	mov	QWORD PTR -2080[rbp], rax
	mov	rax, QWORD PTR -2080[rbp]
	test	rax, rax
	jne	.L39
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L58
.L39:
	mov	rax, QWORD PTR -2080[rbp]
	mov	eax, DWORD PTR 12[rax]
	test	eax, eax
	jne	.L40
	mov	rax, QWORD PTR -2112[rbp]
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -2112[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	test	eax, eax
	je	.L41
	lea	rdi, .LC5[rip]
	call	perror@PLT
.L41:
	lea	rax, -2080[rbp]
	mov	rdi, rax
	call	pipedclose
	mov	eax, 1
	jmp	.L58
.L40:
	mov	DWORD PTR -2064[rbp], 0
	mov	rax, QWORD PTR -2080[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR -2056[rbp], eax
	mov	rax, QWORD PTR -2080[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	DWORD PTR -2048[rbp], eax
	mov	DWORD PTR -2084[rbp], 0
	jmp	.L42
.L43:
	mov	eax, DWORD PTR -2084[rbp]
	cdqe
	mov	WORD PTR -2060[rbp+rax*8], 155
	add	DWORD PTR -2084[rbp], 1
.L42:
	cmp	DWORD PTR -2084[rbp], 2
	jle	.L43
	jmp	.L44
.L57:
	movzx	eax, WORD PTR -2058[rbp]
	cwde
	and	eax, 3
	test	eax, eax
	je	.L45
	jmp	.L46
.L47:
	mov	rdx, QWORD PTR -2072[rbp]
	mov	rax, QWORD PTR -2080[rbp]
	mov	eax, DWORD PTR [rax]
	lea	rcx, -2032[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
.L46:
	lea	rax, -2032[rbp]
	mov	edx, 2024
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	QWORD PTR -2072[rbp], rax
	cmp	QWORD PTR -2072[rbp], 0
	jg	.L47
.L45:
	movzx	eax, WORD PTR -2050[rbp]
	cwde
	and	eax, 3
	test	eax, eax
	je	.L48
	jmp	.L49
.L50:
	mov	rdx, QWORD PTR -2072[rbp]
	lea	rax, -2032[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
.L49:
	mov	eax, DWORD PTR -2056[rbp]
	lea	rcx, -2032[rbp]
	mov	edx, 2024
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -2072[rbp], rax
	cmp	QWORD PTR -2072[rbp], 0
	jg	.L50
.L48:
	movzx	eax, WORD PTR -2042[rbp]
	cwde
	and	eax, 3
	test	eax, eax
	je	.L51
	jmp	.L52
.L53:
	mov	rdx, QWORD PTR -2072[rbp]
	lea	rax, -2032[rbp]
	mov	rsi, rax
	mov	edi, 2
	call	write@PLT
.L52:
	mov	eax, DWORD PTR -2048[rbp]
	lea	rcx, -2032[rbp]
	mov	edx, 2024
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -2072[rbp], rax
	cmp	QWORD PTR -2072[rbp], 0
	jg	.L53
.L51:
	movzx	eax, WORD PTR -2058[rbp]
	cwde
	and	eax, 16
	test	eax, eax
	je	.L54
	mov	rax, QWORD PTR -2080[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -2080[rbp]
	mov	DWORD PTR [rax], -1
.L54:
	movzx	eax, WORD PTR -2050[rbp]
	cwde
	and	eax, 16
	test	eax, eax
	jne	.L55
	movzx	eax, WORD PTR -2042[rbp]
	cwde
	and	eax, 16
	test	eax, eax
	je	.L44
.L55:
	mov	rax, QWORD PTR -2080[rbp]
	mov	eax, DWORD PTR 12[rax]
	lea	rcx, -2088[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
	cmp	eax, -1
	jne	.L56
	lea	rdi, .LC6[rip]
	call	perror@PLT
.L56:
	lea	rax, -2080[rbp]
	mov	rdi, rax
	call	pipedclose
	mov	eax, DWORD PTR -2088[rbp]
	sar	eax, 8
	movzx	eax, al
	jmp	.L58
.L44:
	lea	rax, -2064[rbp]
	mov	edx, -1
	mov	esi, 3
	mov	rdi, rax
	call	poll@PLT
	mov	DWORD PTR -2088[rbp], eax
	mov	eax, DWORD PTR -2088[rbp]
	test	eax, eax
	jg	.L57
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	rax, QWORD PTR -2080[rbp]
	mov	eax, DWORD PTR 12[rax]
	mov	esi, 9
	mov	edi, eax
	call	kill@PLT
	lea	rax, -2080[rbp]
	mov	rdi, rax
	call	pipedclose
	mov	eax, 1
.L58:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L59
	call	__stack_chk_fail@PLT
.L59:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"130936.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"dup2(STDIN_FILENO)\000"
	.align	2
.LC1:
	.ascii	"dup2(STDOUT_FILENO)\000"
	.align	2
.LC2:
	.ascii	"dup2(STDERR_FILENO)\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	pipedfork
	.syntax unified
	.arm
	.fpu softvfp
	.type	pipedfork, %function
pipedfork:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r3, .L30
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #32
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L2
	mov	r3, #0
	b	.L27
.L2:
	sub	r3, fp, #32
	add	r3, r3, #8
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L5
.L6:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-28]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L5:
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	ble	.L6
	mov	r3, #0
	b	.L27
.L4:
	sub	r3, fp, #32
	add	r3, r3, #16
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L7
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L8
.L9:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-28]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L8:
	ldr	r3, [fp, #-40]
	cmp	r3, #3
	ble	.L9
	mov	r3, #0
	b	.L27
.L7:
	mov	r1, #1
	mov	r0, #16
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L10
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L11
.L12:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-28]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L11:
	ldr	r3, [fp, #-40]
	cmp	r3, #5
	ble	.L12
	mov	r3, #0
	b	.L27
.L10:
	bl	fork
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-36]
	str	r2, [r3, #12]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #12]
	cmn	r3, #1
	beq	.L13
	cmp	r3, #0
	beq	.L14
	b	.L29
.L13:
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L16
.L17:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-28]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L16:
	ldr	r3, [fp, #-40]
	cmp	r3, #5
	ble	.L17
	ldr	r0, [fp, #-36]
	bl	free
	mov	r3, #0
	b	.L27
.L14:
	ldr	r3, [fp, #-32]
	mov	r1, #0
	mov	r0, r3
	bl	dup2
	mov	r2, r0
	ldr	r3, [fp, #-36]
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L18
	ldr	r0, .L30+4
	bl	perror
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L19
.L20:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-28]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L19:
	ldr	r3, [fp, #-40]
	cmp	r3, #5
	ble	.L20
	ldr	r0, [fp, #-36]
	bl	free
	mov	r3, #0
	b	.L27
.L18:
	ldr	r3, [fp, #-20]
	mov	r1, #1
	mov	r0, r3
	bl	dup2
	mov	r2, r0
	ldr	r3, [fp, #-36]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #4]
	cmn	r3, #1
	bne	.L21
	ldr	r0, .L30+8
	bl	perror
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L22
.L23:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-28]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L22:
	ldr	r3, [fp, #-40]
	cmp	r3, #5
	ble	.L23
	ldr	r0, [fp, #-36]
	bl	free
	mov	r3, #0
	b	.L27
.L21:
	ldr	r3, [fp, #-12]
	mov	r1, #2
	mov	r0, r3
	bl	dup2
	mov	r2, r0
	ldr	r3, [fp, #-36]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #8]
	cmn	r3, #1
	bne	.L24
	ldr	r0, .L30+12
	bl	perror
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L25
.L26:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-28]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L25:
	ldr	r3, [fp, #-40]
	cmp	r3, #5
	ble	.L26
	ldr	r0, [fp, #-36]
	bl	free
	mov	r3, #0
	b	.L27
.L24:
	ldr	r3, [fp, #-28]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-36]
	b	.L27
.L29:
	mov	r2, #2048
	mov	r1, #4
	mov	r0, #0
	bl	fcntl
	ldr	r3, [fp, #-24]
	mov	r2, #2048
	mov	r1, #4
	mov	r0, r3
	bl	fcntl
	ldr	r3, [fp, #-16]
	mov	r2, #2048
	mov	r1, #4
	mov	r0, r3
	bl	fcntl
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-36]
	str	r2, [r3]
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-36]
	str	r2, [r3, #4]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-36]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-32]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-36]
.L27:
	ldr	r2, .L30
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L31:
	.align	2
.L30:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	pipedfork, .-pipedfork
	.align	2
	.global	pipedclose
	.syntax unified
	.arm
	.fpu softvfp
	.type	pipedclose, %function
pipedclose:
	@ 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, #0
	beq	.L36
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L37
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3]
	b	.L32
.L36:
	nop
	b	.L32
.L37:
	nop
.L32:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	pipedclose, .-pipedclose
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Usage: %s program args ...\012\000"
	.align	2
.LC5:
	.ascii	"pipedfork()\000"
	.align	2
.LC6:
	.ascii	"execvp()\000"
	.align	2
.LC7:
	.ascii	"waitid()\000"
	.align	2
.LC8:
	.ascii	"poll()\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 2080
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #2080
	str	r0, [fp, #-2080]
	str	r1, [fp, #-2084]
	ldr	r3, .L62
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-2080]
	cmp	r3, #1
	bgt	.L39
	ldr	r3, .L62+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-2084]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L62+8
	bl	fprintf
	mov	r3, #1
	b	.L60
.L39:
	bl	pipedfork
	mov	r3, r0
	str	r3, [fp, #-2072]
	ldr	r3, [fp, #-2072]
	cmp	r3, #0
	bne	.L41
	ldr	r0, .L62+12
	bl	perror
	mov	r3, #1
	b	.L60
.L41:
	ldr	r3, [fp, #-2072]
	ldr	r3, [r3, #12]
	cmp	r3, #0
	bne	.L42
	ldr	r3, [fp, #-2084]
	add	r3, r3, #4
	ldr	r2, [r3]
	ldr	r3, [fp, #-2084]
	add	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	execvp
	mov	r3, r0
	cmp	r3, #0
	beq	.L43
	ldr	r0, .L62+16
	bl	perror
.L43:
	sub	r3, fp, #2064
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	pipedclose
	mov	r3, #1
	b	.L60
.L42:
	mov	r3, #0
	str	r3, [fp, #-2056]
	ldr	r3, [fp, #-2072]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-2048]
	ldr	r3, [fp, #-2072]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-2040]
	mov	r3, #0
	str	r3, [fp, #-2064]
	b	.L44
.L45:
	sub	r3, fp, #4
	sub	r3, r3, #2048
	sub	r3, r3, #4
	ldr	r2, [fp, #-2064]
	lsl	r2, r2, #3
	add	r3, r3, r2
	add	r3, r3, #4
	mov	r2, #155
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-2064]
	add	r3, r3, #1
	str	r3, [fp, #-2064]
.L44:
	ldr	r3, [fp, #-2064]
	cmp	r3, #2
	ble	.L45
	b	.L46
.L59:
	sub	r3, fp, #4
	sub	r3, r3, #2048
	sub	r3, r3, #4
	ldrsh	r3, [r3, #6]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #3
	cmp	r3, #0
	beq	.L47
	b	.L48
.L49:
	ldr	r3, [fp, #-2072]
	ldr	r0, [r3]
	ldr	r2, [fp, #-2060]
	sub	r3, fp, #2016
	sub	r3, r3, #4
	sub	r3, r3, #12
	mov	r1, r3
	bl	write
.L48:
	sub	r3, fp, #2016
	sub	r3, r3, #4
	sub	r3, r3, #12
	ldr	r2, .L62+20
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-2060]
	ldr	r3, [fp, #-2060]
	cmp	r3, #0
	bgt	.L49
.L47:
	sub	r3, fp, #4
	sub	r3, r3, #2048
	sub	r3, r3, #4
	ldrsh	r3, [r3, #14]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #3
	cmp	r3, #0
	beq	.L50
	b	.L51
.L52:
	ldr	r2, [fp, #-2060]
	sub	r3, fp, #2016
	sub	r3, r3, #4
	sub	r3, r3, #12
	mov	r1, r3
	mov	r0, #1
	bl	write
.L51:
	ldr	r0, [fp, #-2048]
	sub	r3, fp, #2016
	sub	r3, r3, #4
	sub	r3, r3, #12
	ldr	r2, .L62+20
	mov	r1, r3
	bl	read
	str	r0, [fp, #-2060]
	ldr	r3, [fp, #-2060]
	cmp	r3, #0
	bgt	.L52
.L50:
	sub	r3, fp, #4
	sub	r3, r3, #2048
	sub	r3, r3, #4
	ldrsh	r3, [r3, #22]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #3
	cmp	r3, #0
	beq	.L53
	b	.L54
.L55:
	ldr	r2, [fp, #-2060]
	sub	r3, fp, #2016
	sub	r3, r3, #4
	sub	r3, r3, #12
	mov	r1, r3
	mov	r0, #2
	bl	write
.L54:
	ldr	r0, [fp, #-2040]
	sub	r3, fp, #2016
	sub	r3, r3, #4
	sub	r3, r3, #12
	ldr	r2, .L62+20
	mov	r1, r3
	bl	read
	str	r0, [fp, #-2060]
	ldr	r3, [fp, #-2060]
	cmp	r3, #0
	bgt	.L55
.L53:
	sub	r3, fp, #4
	sub	r3, r3, #2048
	sub	r3, r3, #4
	ldrsh	r3, [r3, #6]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #16
	cmp	r3, #0
	beq	.L56
	ldr	r3, [fp, #-2072]
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-2072]
	mvn	r2, #0
	str	r2, [r3]
.L56:
	sub	r3, fp, #4
	sub	r3, r3, #2048
	sub	r3, r3, #4
	ldrsh	r3, [r3, #14]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #16
	cmp	r3, #0
	bne	.L57
	sub	r3, fp, #4
	sub	r3, r3, #2048
	sub	r3, r3, #4
	ldrsh	r3, [r3, #22]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #16
	cmp	r3, #0
	beq	.L46
.L57:
	ldr	r3, [fp, #-2072]
	ldr	r3, [r3, #12]
	sub	r1, fp, #2064
	sub	r1, r1, #4
	mov	r2, #0
	mov	r0, r3
	bl	waitpid
	mov	r3, r0
	cmn	r3, #1
	bne	.L58
	ldr	r0, .L62+24
	bl	perror
.L58:
	sub	r3, fp, #2064
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	pipedclose
	ldr	r3, [fp, #-2068]
	asr	r3, r3, #8
	and	r3, r3, #255
	b	.L60
.L46:
	sub	r3, fp, #2048
	sub	r3, r3, #4
	sub	r3, r3, #4
	mvn	r2, #0
	mov	r1, #3
	mov	r0, r3
	bl	poll
	mov	r3, r0
	str	r3, [fp, #-2068]
	ldr	r3, [fp, #-2068]
	cmp	r3, #0
	bgt	.L59
	ldr	r0, .L62+28
	bl	perror
	ldr	r3, [fp, #-2072]
	ldr	r3, [r3, #12]
	mov	r1, #9
	mov	r0, r3
	bl	kill
	sub	r3, fp, #2064
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	pipedclose
	mov	r3, #1
.L60:
	ldr	r2, .L62
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L61
	bl	__stack_chk_fail
.L61:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L63:
	.align	2
.L62:
	.word	.LC9
	.word	stderr
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	2024
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
