	.file	"190767811.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"ps"
.LC1:
	.string	"ls"
.LC2:
	.string	"date"
.LC3:
	.string	"goof"
.LC4:
	.string	"fork"
	.align 8
.LC5:
	.string	"Parent with pid = %d\nJust sapwned Child with pid = %d\n"
	.align 8
.LC6:
	.string	"child exited with status = 0x%08x\n"
	.align 8
.LC7:
	.string	"Child exited with status = %d\n"
	.align 8
.LC8:
	.string	"Child exited due to signal = %d\n"
.LC9:
	.string	"Core Dump flag = %d\n"
.LC10:
	.string	"Running child with pid = %d\n"
.LC11:
	.string	"1. ps\t2. ls\t3. date\t4. goof"
.LC12:
	.string	"%d"
.LC13:
	.string	"scanf"
.LC14:
	.string	"Found command %s\n"
.LC15:
	.string	"Unknown command option %d\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, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, .LC0[rip]
	mov	QWORD PTR -48[rbp], rax
	lea	rax, .LC1[rip]
	mov	QWORD PTR -40[rbp], rax
	lea	rax, .LC2[rip]
	mov	QWORD PTR -32[rbp], rax
	lea	rax, .LC3[rip]
	mov	QWORD PTR -24[rbp], rax
	call	getpid@PLT
	mov	DWORD PTR -56[rbp], eax
	call	fork@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	jne	.L2
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	cmp	DWORD PTR -52[rbp], 0
	je	.L3
	mov	edx, DWORD PTR -52[rbp]
	mov	eax, DWORD PTR -56[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rcx, -64[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
	mov	eax, DWORD PTR -64[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -64[rbp]
	and	eax, 127
	test	eax, eax
	jne	.L4
	mov	eax, DWORD PTR -64[rbp]
	sar	eax, 8
	movzx	eax, al
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
.L4:
	mov	eax, DWORD PTR -64[rbp]
	and	eax, 127
	add	eax, 1
	sar	al
	test	al, al
	jle	.L5
	mov	eax, DWORD PTR -64[rbp]
	and	eax, 127
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -64[rbp]
	and	eax, 128
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L5
.L3:
	call	getpid@PLT
	mov	DWORD PTR -52[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC11[rip]
	call	puts@PLT
	lea	rax, -60[rbp]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	eax, DWORD PTR -60[rbp]
	test	eax, eax
	jle	.L7
	mov	eax, DWORD PTR -60[rbp]
	cmp	eax, 4
	jg	.L7
	mov	eax, DWORD PTR -60[rbp]
	sub	eax, 1
	cdqe
	mov	rax, QWORD PTR -48[rbp+rax*8]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -60[rbp]
	sub	eax, 1
	cdqe
	mov	rcx, QWORD PTR -48[rbp+rax*8]
	mov	eax, DWORD PTR -60[rbp]
	sub	eax, 1
	cdqe
	mov	rax, QWORD PTR -48[rbp+rax*8]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	mov	eax, 0
	call	execlp@PLT
	jmp	.L5
.L7:
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, eax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	"190767811.c"
	.section	.rodata
	.align	2
.LC0:
	.ascii	"ps\000"
	.align	2
.LC1:
	.ascii	"ls\000"
	.align	2
.LC2:
	.ascii	"date\000"
	.align	2
.LC3:
	.ascii	"goof\000"
	.text
	.section	.rodata
	.align	2
.LC6:
	.ascii	"fork\000"
	.align	2
.LC7:
	.ascii	"Parent with pid = %d\012Just sapwned Child with pid"
	.ascii	" = %d\012\000"
	.align	2
.LC8:
	.ascii	"child exited with status = 0x%08x\012\000"
	.align	2
.LC9:
	.ascii	"Child exited with status = %d\012\000"
	.align	2
.LC10:
	.ascii	"Child exited due to signal = %d\012\000"
	.align	2
.LC11:
	.ascii	"Core Dump flag = %d\012\000"
	.align	2
.LC12:
	.ascii	"Running child with pid = %d\012\000"
	.align	2
.LC13:
	.ascii	"1. ps\0112. ls\0113. date\0114. goof\000"
	.align	2
.LC14:
	.ascii	"%d\000"
	.align	2
.LC15:
	.ascii	"scanf\000"
	.align	2
.LC16:
	.ascii	"Found command %s\012\000"
	.align	2
.LC17:
	.ascii	"Unknown command option %d\012\000"
	.align	2
.LC5:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.align	2
.LC18:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L10+4
	sub	ip, fp, #24
	ldm	r3, {r0, r1, r2, r3}
	stm	ip, {r0, r1, r2, r3}
	bl	getpid
	str	r0, [fp, #-32]
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L10+8
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L3
	ldr	r2, [fp, #-28]
	ldr	r1, [fp, #-32]
	ldr	r0, .L10+12
	bl	printf
	sub	r3, fp, #40
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-28]
	bl	waitpid
	ldr	r3, [fp, #-40]
	mov	r1, r3
	ldr	r0, .L10+16
	bl	printf
	ldr	r3, [fp, #-40]
	and	r3, r3, #127
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-40]
	asr	r3, r3, #8
	and	r3, r3, #255
	mov	r1, r3
	ldr	r0, .L10+20
	bl	printf
.L4:
	ldr	r3, [fp, #-40]
	and	r3, r3, #255
	and	r3, r3, #127
	and	r3, r3, #255
	add	r3, r3, #1
	and	r3, r3, #255
	lsl	r3, r3, #24
	asr	r3, r3, #24
	asr	r3, r3, #1
	lsl	r3, r3, #24
	asr	r3, r3, #24
	cmp	r3, #0
	ble	.L5
	ldr	r3, [fp, #-40]
	and	r3, r3, #127
	mov	r1, r3
	ldr	r0, .L10+24
	bl	printf
	ldr	r3, [fp, #-40]
	and	r3, r3, #128
	mov	r1, r3
	ldr	r0, .L10+28
	bl	printf
	b	.L5
.L3:
	bl	getpid
	str	r0, [fp, #-28]
	ldr	r1, [fp, #-28]
	ldr	r0, .L10+32
	bl	printf
	ldr	r0, .L10+36
	bl	puts
	sub	r3, fp, #36
	mov	r1, r3
	ldr	r0, .L10+40
	bl	__isoc99_scanf
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L10+44
	bl	perror
	mov	r0, #1
	bl	exit
.L6:
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	ble	.L7
	ldr	r3, [fp, #-36]
	cmp	r3, #4
	bgt	.L7
	ldr	r3, [fp, #-36]
	sub	r3, r3, #1
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-20]
	mov	r1, r3
	ldr	r0, .L10+48
	bl	printf
	ldr	r3, [fp, #-36]
	sub	r3, r3, #1
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r0, [r3, #-20]
	ldr	r3, [fp, #-36]
	sub	r3, r3, #1
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-20]
	mov	r2, #0
	mov	r1, r3
	bl	execlp
	b	.L5
.L7:
	ldr	r3, [fp, #-36]
	mov	r1, r3
	ldr	r0, .L10+52
	bl	printf
	mov	r0, #1
	bl	exit
.L5:
	mov	r3, #0
	ldr	r2, .L10
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC18
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
