	.file	"135784.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Root PID\t%d\n"
.LC1:
	.string	"Error in fork"
.LC2:
	.string	"Child PID\t%d\t\tPPID\t\t%d\n"
.LC3:
	.string	"Parent PID\t%d\t\tChild PID\t%d\n"
.LC4:
	.string	"Error in waitpid"
	.align 8
.LC5:
	.string	"\nParent PID\t%d\t\tChild PID\t%d finished with code %d == EXIT_SUCCESS\n"
	.align 8
.LC6:
	.string	"\nParent PID\t%d\t\tChild PID\t%d finished with code %d == EXIT_FAILURE\n"
	.align 8
.LC7:
	.string	"\nParent PID\t%d\t\tChild PID\t%d finished with code %d\n"
	.align 8
.LC8:
	.string	"\nParent PID\t%d\t\tChild PID\t%d abnormally finished\n"
.LC9:
	.string	"\nPID\t\t%d 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
	push	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	call	getpid@PLT
	mov	edx, eax
	mov	rax, QWORD PTR stdout[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	fork@PLT
	mov	DWORD PTR -32[rbp], eax
	cmp	DWORD PTR -32[rbp], -1
	jne	.L2
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	cmp	DWORD PTR -32[rbp], 0
	jne	.L3
	call	getppid@PLT
	mov	ebx, eax
	call	getpid@PLT
	mov	edx, eax
	mov	rax, QWORD PTR stdout[rip]
	mov	ecx, ebx
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L4
.L3:
	call	getpid@PLT
	mov	esi, eax
	mov	rax, QWORD PTR stdout[rip]
	mov	edx, DWORD PTR -32[rbp]
	mov	ecx, edx
	mov	edx, esi
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L4:
	cmp	DWORD PTR -32[rbp], 0
	jle	.L5
	lea	rax, -36[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, -1
	call	waitpid@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], -1
	jne	.L6
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	eax, DWORD PTR -36[rbp]
	and	eax, 127
	test	eax, eax
	jne	.L7
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 8
	movzx	eax, al
	test	eax, eax
	jne	.L8
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 8
	movzx	ebx, al
	call	getpid@PLT
	mov	esi, eax
	mov	rax, QWORD PTR stdout[rip]
	mov	edx, DWORD PTR -28[rbp]
	mov	r8d, ebx
	mov	ecx, edx
	mov	edx, esi
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L5
.L8:
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 8
	movzx	eax, al
	cmp	eax, 1
	jne	.L9
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 8
	movzx	ebx, al
	call	getpid@PLT
	mov	esi, eax
	mov	rax, QWORD PTR stdout[rip]
	mov	edx, DWORD PTR -28[rbp]
	mov	r8d, ebx
	mov	ecx, edx
	mov	edx, esi
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L5
.L9:
	mov	eax, DWORD PTR -36[rbp]
	sar	eax, 8
	movzx	ebx, al
	call	getpid@PLT
	mov	esi, eax
	mov	rax, QWORD PTR stdout[rip]
	mov	edx, DWORD PTR -28[rbp]
	mov	r8d, ebx
	mov	ecx, edx
	mov	edx, esi
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L5
.L7:
	call	getpid@PLT
	mov	esi, eax
	mov	rax, QWORD PTR stdout[rip]
	mov	edx, DWORD PTR -28[rbp]
	mov	ecx, edx
	mov	edx, esi
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	call	getpid@PLT
	mov	edx, eax
	mov	rax, QWORD PTR stdout[rip]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 0
	call	exit@PLT
	.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	"135784.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Root PID\011%d\012\000"
	.align	2
.LC1:
	.ascii	"Error in fork\000"
	.align	2
.LC2:
	.ascii	"Child PID\011%d\011\011PPID\011\011%d\012\000"
	.align	2
.LC3:
	.ascii	"Parent PID\011%d\011\011Child PID\011%d\012\000"
	.align	2
.LC4:
	.ascii	"Error in waitpid\000"
	.align	2
.LC5:
	.ascii	"\012Parent PID\011%d\011\011Child PID\011%d finishe"
	.ascii	"d with code %d == EXIT_SUCCESS\012\000"
	.align	2
.LC6:
	.ascii	"\012Parent PID\011%d\011\011Child PID\011%d finishe"
	.ascii	"d with code %d == EXIT_FAILURE\012\000"
	.align	2
.LC7:
	.ascii	"\012Parent PID\011%d\011\011Child PID\011%d finishe"
	.ascii	"d with code %d\012\000"
	.align	2
.LC8:
	.ascii	"\012Parent PID\011%d\011\011Child PID\011%d abnorma"
	.ascii	"lly finished\012\000"
	.align	2
.LC9:
	.ascii	"\012PID\011\011%d finished\012\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	getpid
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L11+8
	mov	r0, r4
	bl	fprintf
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L11+12
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L3
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	getpid
	mov	r5, r0
	bl	getppid
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L11+16
	mov	r0, r4
	bl	fprintf
	b	.L4
.L3:
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	getpid
	mov	r2, r0
	ldr	r3, [fp, #-24]
	ldr	r1, .L11+20
	mov	r0, r4
	bl	fprintf
.L4:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	ble	.L5
	sub	r3, fp, #28
	mov	r2, #0
	mov	r1, r3
	mvn	r0, #0
	bl	waitpid
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L11+24
	bl	perror
	mov	r0, #1
	bl	exit
.L6:
	ldr	r3, [fp, #-28]
	and	r3, r3, #127
	cmp	r3, #0
	bne	.L7
	ldr	r3, [fp, #-28]
	asr	r3, r3, #8
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L8
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	getpid
	mov	r2, r0
	ldr	r3, [fp, #-28]
	asr	r3, r3, #8
	and	r3, r3, #255
	str	r3, [sp]
	ldr	r3, [fp, #-20]
	ldr	r1, .L11+28
	mov	r0, r4
	bl	fprintf
	b	.L5
.L8:
	ldr	r3, [fp, #-28]
	asr	r3, r3, #8
	and	r3, r3, #255
	cmp	r3, #1
	bne	.L9
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	getpid
	mov	r2, r0
	ldr	r3, [fp, #-28]
	asr	r3, r3, #8
	and	r3, r3, #255
	str	r3, [sp]
	ldr	r3, [fp, #-20]
	ldr	r1, .L11+32
	mov	r0, r4
	bl	fprintf
	b	.L5
.L9:
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	getpid
	mov	r2, r0
	ldr	r3, [fp, #-28]
	asr	r3, r3, #8
	and	r3, r3, #255
	str	r3, [sp]
	ldr	r3, [fp, #-20]
	ldr	r1, .L11+36
	mov	r0, r4
	bl	fprintf
	b	.L5
.L7:
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	getpid
	mov	r2, r0
	ldr	r3, [fp, #-20]
	ldr	r1, .L11+40
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L5:
	ldr	r3, .L11+4
	ldr	r4, [r3]
	bl	getpid
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L11+44
	mov	r0, r4
	bl	fprintf
	mov	r0, #0
	bl	exit
.L12:
	.align	2
.L11:
	.word	.LC10
	.word	stdout
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
