	.file	"369934.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Incorrect number of arguments"
.LC1:
	.string	"%s"
.LC2:
	.string	"pipe"
	.align 8
.LC3:
	.string	"parent: pipe created, channels: READ=%d and WRITE=%d\n"
.LC4:
	.string	"fork"
.LC5:
	.string	"1st child process created"
.LC6:
	.string	"close"
.LC7:
	.string	"dup"
.LC8:
	.string	"aux"
.LC9:
	.string	"ps"
.LC10:
	.string	"execlp"
	.align 8
.LC11:
	.string	"parent: ps(%d) process launched\n"
.LC12:
	.string	"2nd child process created"
.LC13:
	.string	"grep"
	.align 8
.LC14:
	.string	"parent: grep(%d) process launched\n"
.LC15:
	.string	"parent: %d process finished\n"
	.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, 144
	mov	DWORD PTR -132[rbp], edi
	mov	QWORD PTR -144[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -132[rbp], 2
	je	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	lea	rax, -112[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -120[rbp]
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L3
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	edx, DWORD PTR -116[rbp]
	mov	eax, DWORD PTR -120[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	call	fork@PLT
	mov	DWORD PTR -124[rbp], eax
	cmp	DWORD PTR -124[rbp], -1
	je	.L4
	cmp	DWORD PTR -124[rbp], 0
	je	.L5
	jmp	.L18
.L4:
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	edi, 1
	call	close@PLT
	cmp	eax, -1
	jne	.L7
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	eax, DWORD PTR -116[rbp]
	mov	edi, eax
	call	dup@PLT
	cmp	eax, 1
	je	.L8
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	eax, DWORD PTR -120[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -116[rbp]
	mov	edi, eax
	call	close@PLT
	mov	ecx, 0
	lea	rdx, .LC8[rip]
	lea	rsi, .LC9[rip]
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	execlp@PLT
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L18:
	mov	eax, DWORD PTR -124[rbp]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	call	fork@PLT
	mov	DWORD PTR -124[rbp], eax
	cmp	DWORD PTR -124[rbp], -1
	je	.L9
	cmp	DWORD PTR -124[rbp], 0
	je	.L10
	jmp	.L19
.L9:
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	edi, 0
	call	close@PLT
	cmp	eax, -1
	jne	.L12
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	eax, DWORD PTR -120[rbp]
	mov	edi, eax
	call	dup@PLT
	test	eax, eax
	je	.L13
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	eax, DWORD PTR -120[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -116[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rax, -112[rbp]
	mov	ecx, 0
	mov	rdx, rax
	lea	rsi, .LC13[rip]
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	execlp@PLT
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L19:
	mov	eax, DWORD PTR -124[rbp]
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -120[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -116[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -124[rbp]
	mov	esi, eax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
.L14:
	mov	edi, 0
	call	wait@PLT
	mov	DWORD PTR -124[rbp], eax
	cmp	DWORD PTR -124[rbp], -1
	jne	.L15
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"369934.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Incorrect number of arguments\000"
	.align	2
.LC1:
	.ascii	"%s\000"
	.align	2
.LC2:
	.ascii	"pipe\000"
	.align	2
.LC3:
	.ascii	"parent: pipe created, channels: READ=%d and WRITE=%"
	.ascii	"d\012\000"
	.align	2
.LC4:
	.ascii	"fork\000"
	.align	2
.LC5:
	.ascii	"1st child process created\000"
	.align	2
.LC6:
	.ascii	"close\000"
	.align	2
.LC7:
	.ascii	"dup\000"
	.align	2
.LC8:
	.ascii	"aux\000"
	.align	2
.LC9:
	.ascii	"ps\000"
	.align	2
.LC10:
	.ascii	"execlp\000"
	.align	2
.LC11:
	.ascii	"parent: ps(%d) process launched\012\000"
	.align	2
.LC12:
	.ascii	"2nd child process created\000"
	.align	2
.LC13:
	.ascii	"grep\000"
	.align	2
.LC14:
	.ascii	"parent: grep(%d) process launched\012\000"
	.align	2
.LC15:
	.ascii	"parent: %d process finished\012\000"
	.align	2
.LC16:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #128
	str	r0, [fp, #-128]
	str	r1, [fp, #-132]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-128]
	cmp	r3, #2
	beq	.L2
	ldr	r0, .L20+4
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-132]
	add	r3, r3, #4
	ldr	r2, [r3]
	sub	r3, fp, #108
	ldr	r1, .L20+8
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #116
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L20+12
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-116]
	ldr	r2, [fp, #-112]
	mov	r1, r3
	ldr	r0, .L20+16
	bl	printf
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-120]
	ldr	r3, [fp, #-120]
	cmn	r3, #1
	beq	.L4
	ldr	r3, [fp, #-120]
	cmp	r3, #0
	beq	.L5
	b	.L18
.L4:
	ldr	r0, .L20+20
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	ldr	r0, .L20+24
	bl	puts
	mov	r0, #1
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L20+28
	bl	perror
	mov	r0, #1
	bl	exit
.L7:
	ldr	r3, [fp, #-112]
	mov	r0, r3
	bl	dup
	mov	r3, r0
	cmp	r3, #1
	beq	.L8
	ldr	r0, .L20+32
	bl	perror
	mov	r0, #1
	bl	exit
.L8:
	ldr	r3, [fp, #-116]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-112]
	mov	r0, r3
	bl	close
	mov	r3, #0
	ldr	r2, .L20+36
	ldr	r1, .L20+40
	ldr	r0, .L20+40
	bl	execlp
	ldr	r0, .L20+44
	bl	perror
	mov	r0, #1
	bl	exit
.L18:
	ldr	r1, [fp, #-120]
	ldr	r0, .L20+48
	bl	printf
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-120]
	ldr	r3, [fp, #-120]
	cmn	r3, #1
	beq	.L9
	ldr	r3, [fp, #-120]
	cmp	r3, #0
	beq	.L10
	b	.L19
.L9:
	ldr	r0, .L20+20
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	ldr	r0, .L20+52
	bl	puts
	mov	r0, #0
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L12
	ldr	r0, .L20+28
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, [fp, #-116]
	mov	r0, r3
	bl	dup
	mov	r3, r0
	cmp	r3, #0
	beq	.L13
	ldr	r0, .L20+56
	bl	perror
	mov	r0, #1
	bl	exit
.L13:
	ldr	r3, [fp, #-116]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-112]
	mov	r0, r3
	bl	close
	sub	r2, fp, #108
	mov	r3, #0
	ldr	r1, .L20+56
	ldr	r0, .L20+56
	bl	execlp
	ldr	r0, .L20+44
	bl	perror
	mov	r0, #1
	bl	exit
.L19:
	ldr	r1, [fp, #-120]
	ldr	r0, .L20+60
	bl	printf
	ldr	r3, [fp, #-116]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-112]
	mov	r0, r3
	bl	close
	b	.L14
.L15:
	ldr	r1, [fp, #-120]
	ldr	r0, .L20+64
	bl	printf
.L14:
	mov	r0, #0
	bl	wait
	str	r0, [fp, #-120]
	ldr	r3, [fp, #-120]
	cmn	r3, #1
	bne	.L15
	mov	r3, #0
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC16
	.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
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
