	.file	"725236.c"
	.intel_syntax noprefix
	.text
	.local	childPreSleep
	.comm	childPreSleep,4,4
	.local	childPostSleep
	.comm	childPostSleep,4,4
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: %s child-pre-sleep child-post-sleep [ancestor-arg...]\n"
	.align 8
.LC1:
	.ascii	"Create a series of processes with the parental relationship:"
	.ascii	"\n\n        ancestor1 -> ancestor2 -> ... ancestorN -> child"
	.ascii	"\n\nin order to explore the behavior of the prctl() PR_SET_P"
	.ascii	"DEATHSIG setting\n\n'child-pre-sleep' is the number of secon"
	.ascii	"ds that the child should sleep\n        before employing PR_"
	.ascii	"SET_PDEATHSIG.\n'child-post-sleep' is the number of seconds "
	.ascii	"that the child should sleep\n        after employing PR_SET_"
	.ascii	"PDEATHSIG; in this time, we can observe what\n        happen"
	.ascii	"s when ancestors of this process terminate.\n'ancestor-arg.."
	.ascii	".' defines attributes for an ancestor process.\n        One "
	.ascii	"ancestor process is created for each of these arguments, wit"
	.ascii	"h\n        the first of these being the most distant ancesto"
	.ascii	"r and the last\n        being the immediate ancestor of the "
	.ascii	"'child' process.\n        Each of these arguments consists a"
	.ascii	" list of one or more\n        colon-separated integers. One "
	.ascii	"thread is created for each integer\n        (except for the "
	.ascii	"first integer, which is represented by the initial\n        "
	.ascii	"thread), with each thread sleeping for the corresponding num"
	.ascii	"ber of\n        seconds before terminating. At most one of t"
	.ascii	"he integers may be\n        preceded by a plus ('+') charact"
	.ascii	"er; that thread will call fork()\n        to create the next"
	.ascii	" ancestor process; if no integer "
	.string	"is preceded with\n        a '+', then the initial thread will create the next ancestor.\n        If 'ancestor-arg' begins with an at sign ('@'), then the initial\n        thread marks the process as a subreaper before creating any\n        additional threads.\n"
	.text
	.type	usageError, @function
usageError:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 1528
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	usageError, .-usageError
	.section	.rodata
	.align 8
.LC2:
	.string	"*********** Child (%ld) got signal [%d]; si_pid = %d; si_uid = %d\n"
	.align 8
.LC3:
	.string	"            Parent PID is now %ld\n"
	.text
	.type	handler, @function
handler:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	sub	rsp, 40
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -56[rbp], rdx
	mov	eax, DWORD PTR cnt.0[rip]
	test	eax, eax
	jne	.L3
	mov	edi, 10
	call	putchar@PLT
.L3:
	mov	eax, DWORD PTR cnt.0[rip]
	add	eax, 1
	mov	DWORD PTR cnt.0[rip], eax
	mov	rax, QWORD PTR -48[rbp]
	mov	r13d, DWORD PTR 20[rax]
	mov	rax, QWORD PTR -48[rbp]
	mov	r12d, DWORD PTR 16[rax]
	mov	ebx, DWORD PTR cnt.0[rip]
	call	getpid@PLT
	cdqe
	mov	r8d, r13d
	mov	ecx, r12d
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	call	getppid@PLT
	cdqe
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	add	rsp, 40
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	handler, .-handler
	.section	.rodata
	.align 8
.LC4:
	.string	"TID %ld (PID %ld) about to call fork()\n"
.LC5:
	.string	"fork"
	.align 8
.LC6:
	.string	"Final child %ld created; parent %ld\n"
.LC7:
	.string	"sigaction"
	.align 8
.LC8:
	.string	"\tChild (PID %ld) about to sleep %d sec before setting PR_SET_PDEATHSIG\n"
	.align 8
.LC9:
	.string	"\tChild about to set PR_SET_PDEATHSIG"
.LC10:
	.string	"prctl"
	.align 8
.LC11:
	.string	"\tChild (PID %ld) about to sleep %d seconds\n"
.LC12:
	.string	"Child about to exit"
	.text
	.type	createChild, @function
createChild:
.LFB8:
	.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, 184
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	call	getpid@PLT
	movsx	rbx, eax
	mov	edi, 186
	mov	eax, 0
	call	syscall@PLT
	mov	rdx, rbx
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	call	fork@PLT
	cmp	eax, -1
	je	.L5
	test	eax, eax
	je	.L6
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L14
	jmp	.L15
.L5:
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	call	getppid@PLT
	movsx	rbx, eax
	call	getpid@PLT
	cdqe
	mov	rdx, rbx
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -40[rbp], 4
	lea	rax, -176[rbp]
	add	rax, 8
	mov	rdi, rax
	call	sigemptyset@PLT
	lea	rax, handler[rip]
	mov	QWORD PTR -176[rbp], rax
	lea	rax, -176[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 10
	call	sigaction@PLT
	cmp	eax, -1
	jne	.L8
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	eax, DWORD PTR childPreSleep[rip]
	test	eax, eax
	jle	.L9
	mov	ebx, DWORD PTR childPreSleep[rip]
	call	getpid@PLT
	cdqe
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR childPreSleep[rip]
	mov	edi, eax
	call	sleep@PLT
.L9:
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	esi, 10
	mov	edi, 1
	mov	eax, 0
	call	prctl@PLT
	cmp	eax, -1
	jne	.L10
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	ebx, DWORD PTR childPostSleep[rip]
	call	getpid@PLT
	cdqe
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -180[rbp], 0
	jmp	.L11
.L12:
	mov	edi, 1
	call	sleep@PLT
	add	DWORD PTR -180[rbp], 1
.L11:
	mov	eax, DWORD PTR childPostSleep[rip]
	cmp	DWORD PTR -180[rbp], eax
	jl	.L12
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L15:
	call	__stack_chk_fail@PLT
.L14:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	createChild, .-createChild
	.section	.rodata
	.align 8
.LC13:
	.string	"\tTID %ld (PID: %ld) about to sleep %d sec\n"
	.align 8
.LC14:
	.string	"TID %ld (PID: %ld) terminating (after %d sec sleep)\n"
	.text
	.type	performPerThreadSteps, @function
performPerThreadSteps:
.LFB9:
	.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, 40
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	mov	edi, 186
	mov	eax, 0
	call	syscall@PLT
	mov	DWORD PTR -20[rbp], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 16[rax]
	imul	eax, eax, 1000
	mov	edi, eax
	call	usleep@PLT
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, BYTE PTR 20[rax]
	test	al, al
	je	.L17
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L18
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdi, rax
	call	createAncestor
	jmp	.L17
.L18:
	call	createChild
.L17:
	mov	rax, QWORD PTR -40[rbp]
	mov	ebx, DWORD PTR [rax]
	call	getpid@PLT
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	mov	ecx, ebx
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	sleep@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	ebx, DWORD PTR [rax]
	call	getpid@PLT
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	mov	ecx, ebx
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	performPerThreadSteps, .-performPerThreadSteps
	.type	threadStartFunc, @function
threadStartFunc:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	performPerThreadSteps
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE10:
	.size	threadStartFunc, .-threadStartFunc
	.section	.rodata
.LC15:
	.string	":"
.LC16:
	.string	"malloc"
	.align 8
.LC17:
	.string	"Found '+' twice in one argument!\n"
.LC18:
	.string	"pthread_create() failed\n"
	.text
	.type	createThreads, @function
createThreads:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 96
	mov	QWORD PTR -88[rbp], rdi
	mov	QWORD PTR -96[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -65[rbp], 0
	mov	DWORD PTR -64[rbp], 0
.L31:
	cmp	DWORD PTR -64[rbp], 0
	jne	.L21
	mov	rax, QWORD PTR -88[rbp]
	jmp	.L22
.L21:
	mov	eax, 0
.L22:
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	call	strtok@PLT
	mov	QWORD PTR -48[rbp], rax
	cmp	QWORD PTR -48[rbp], 0
	je	.L35
	mov	edi, 24
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L25
	lea	rdi, .LC16[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L25:
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 43
	sete	dl
	mov	rax, QWORD PTR -40[rbp]
	mov	BYTE PTR 20[rax], dl
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, BYTE PTR 20[rax]
	test	al, al
	je	.L26
	cmp	BYTE PTR -65[rbp], 0
	je	.L27
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 33
	mov	esi, 1
	lea	rdi, .LC17[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L27:
	add	QWORD PTR -48[rbp], 1
	mov	BYTE PTR -65[rbp], 1
.L26:
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	atoi@PLT
	mov	rdx, QWORD PTR -40[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -96[rbp]
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR -64[rbp]
	mov	DWORD PTR 16[rax], edx
	cmp	DWORD PTR -64[rbp], 0
	jne	.L28
	mov	rcx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR [rcx]
	mov	rdx, QWORD PTR 8[rcx]
	mov	QWORD PTR -32[rbp], rax
	mov	QWORD PTR -24[rbp], rdx
	mov	rax, QWORD PTR 16[rcx]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L29
.L28:
	mov	rdx, QWORD PTR -40[rbp]
	lea	rax, -56[rbp]
	mov	rcx, rdx
	lea	rdx, threadStartFunc[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -60[rbp], eax
	cmp	DWORD PTR -60[rbp], 0
	je	.L29
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC18[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L29:
	add	DWORD PTR -64[rbp], 1
	jmp	.L31
.L35:
	nop
	movzx	eax, BYTE PTR -65[rbp]
	xor	eax, 1
	test	al, al
	je	.L32
	mov	BYTE PTR -12[rbp], 1
.L32:
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	performPerThreadSteps
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE11:
	.size	createThreads, .-createThreads
	.section	.rodata
	.align 8
.LC19:
	.string	"Child %ld created; parent %ld\n"
	.align 8
.LC20:
	.string	"\t*** PID %ld (child of %ld) became a subreaper\n"
	.text
	.type	createAncestor, @function
createAncestor:
.LFB12:
	.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, 40
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	mov	edi, 10000
	call	usleep@PLT
	call	getpid@PLT
	movsx	rbx, eax
	mov	edi, 186
	mov	eax, 0
	call	syscall@PLT
	mov	rdx, rbx
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	call	fork@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], -1
	jne	.L37
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L37:
	cmp	DWORD PTR -28[rbp], 0
	jne	.L42
	call	getppid@PLT
	movsx	rbx, eax
	call	getpid@PLT
	cdqe
	mov	rdx, rbx
	mov	rsi, rax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 64
	jne	.L40
	mov	esi, 1
	mov	edi, 36
	mov	eax, 0
	call	prctl@PLT
	cmp	eax, -1
	jne	.L41
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L41:
	call	getppid@PLT
	movsx	rbx, eax
	call	getpid@PLT
	cdqe
	mov	rdx, rbx
	mov	rsi, rax
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	add	QWORD PTR -24[rbp], 1
.L40:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	createThreads
	jmp	.L36
.L42:
	nop
.L36:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	createAncestor, .-createAncestor
	.globl	main
	.type	main, @function
main:
.LFB13:
	.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	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR stdout[rip]
	mov	esi, 0
	mov	rdi, rax
	call	setbuf@PLT
	cmp	DWORD PTR -4[rbp], 2
	jg	.L44
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	usageError
.L44:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR childPreSleep[rip], eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR childPostSleep[rip], eax
	cmp	DWORD PTR -4[rbp], 3
	jle	.L45
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 24
	mov	rdi, rax
	call	createAncestor
	jmp	.L46
.L45:
	call	createChild
.L46:
	mov	edi, 0
	call	wait@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	cnt.0
	.comm	cnt.0,4,4
	.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	"725236.c"
	.text
	.local	childPreSleep
	.comm	childPreSleep,4,4
	.local	childPostSleep
	.comm	childPostSleep,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s child-pre-sleep child-post-sleep [ancesto"
	.ascii	"r-arg...]\012\000"
	.align	2
.LC1:
	.ascii	"Create a series of processes with the parental rela"
	.ascii	"tionship:\012\012        ancestor1 -> ancestor2 -> "
	.ascii	"... ancestorN -> child\012\012in order to explore t"
	.ascii	"he behavior of the prctl() PR_SET_PDEATHSIG setting"
	.ascii	"\012\012'child-pre-sleep' is the number of seconds "
	.ascii	"that the child should sleep\012        before emplo"
	.ascii	"ying PR_SET_PDEATHSIG.\012'child-post-sleep' is the"
	.ascii	" number of seconds that the child should sleep\012 "
	.ascii	"       after employing PR_SET_PDEATHSIG; in this ti"
	.ascii	"me, we can observe what\012        happens when anc"
	.ascii	"estors of this process terminate.\012'ancestor-arg."
	.ascii	"..' defines attributes for an ancestor process.\012"
	.ascii	"        One ancestor process is created for each of"
	.ascii	" these arguments, with\012        the first of thes"
	.ascii	"e being the most distant ancestor and the last\012 "
	.ascii	"       being the immediate ancestor of the 'child' "
	.ascii	"process.\012        Each of these arguments consist"
	.ascii	"s a list of one or more\012        colon-separated "
	.ascii	"integers. One thread is created for each integer\012"
	.ascii	"        (except for the first integer, which is rep"
	.ascii	"resented by the initial\012        thread), with ea"
	.ascii	"ch thread sleeping for the corresponding number of\012"
	.ascii	"        seconds before terminating. At most one of "
	.ascii	"the integers may be\012        preceded by a plus ("
	.ascii	"'+') character; that thread will call fork()\012   "
	.ascii	"     to create the next ancestor process; if no int"
	.ascii	"eger is preceded with\012        a '+', then the in"
	.ascii	"itial thread will create the next ancestor.\012    "
	.ascii	"    If 'ancestor-arg' begins with an at sign ('@'),"
	.ascii	" then the initial\012        thread marks the proce"
	.ascii	"ss as a subreaper before creating any\012        ad"
	.ascii	"ditional threads.\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	usageError, %function
usageError:
	@ 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, .L2
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L2+4
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L2
	ldr	r3, [r3]
	ldr	r2, .L2+8
	mov	r1, #1
	ldr	r0, .L2+12
	bl	fwrite
	mov	r0, #1
	bl	exit
.L3:
	.align	2
.L2:
	.word	stderr
	.word	.LC0
	.word	1528
	.word	.LC1
	.size	usageError, .-usageError
	.section	.rodata
	.align	2
.LC2:
	.ascii	"*********** Child (%ld) got signal [%d]; si_pid = %"
	.ascii	"d; si_uid = %d\012\000"
	.align	2
.LC3:
	.ascii	"            Parent PID is now %ld\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	handler, %function
handler:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, .L6
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L5
	mov	r0, #10
	bl	putchar
.L5:
	ldr	r3, .L6
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L6
	str	r3, [r2]
	bl	getpid
	ldr	r3, .L6
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r1, [r3, #12]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	str	r3, [sp]
	mov	r3, r1
	mov	r1, r0
	ldr	r0, .L6+4
	bl	printf
	bl	getppid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L6+8
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	cnt.7375
	.word	.LC2
	.word	.LC3
	.size	handler, .-handler
	.section	.rodata
	.align	2
.LC4:
	.ascii	"TID %ld (PID %ld) about to call fork()\012\000"
	.align	2
.LC5:
	.ascii	"fork\000"
	.align	2
.LC6:
	.ascii	"Final child %ld created; parent %ld\012\000"
	.align	2
.LC7:
	.ascii	"sigaction\000"
	.align	2
.LC8:
	.ascii	"\011Child (PID %ld) about to sleep %d sec before se"
	.ascii	"tting PR_SET_PDEATHSIG\012\000"
	.align	2
.LC9:
	.ascii	"\011Child about to set PR_SET_PDEATHSIG\000"
	.align	2
.LC10:
	.ascii	"prctl\000"
	.align	2
.LC11:
	.ascii	"\011Child (PID %ld) about to sleep %d seconds\012\000"
	.align	2
.LC12:
	.ascii	"Child about to exit\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	createChild, %function
createChild:
	@ args = 0, pretend = 0, frame = 152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #156
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r0, #224
	bl	syscall
	mov	r4, r0
	bl	getpid
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L20+4
	bl	printf
	bl	fork
	mov	r3, r0
	cmn	r3, #1
	beq	.L9
	cmp	r3, #0
	beq	.L10
	nop
	ldr	r3, .L20
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L18
	b	.L19
.L9:
	ldr	r0, .L20+8
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	bl	getpid
	mov	r4, r0
	bl	getppid
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L20+12
	bl	printf
	mov	r3, #4
	str	r3, [fp, #-24]
	sub	r3, fp, #156
	add	r3, r3, #4
	mov	r0, r3
	bl	sigemptyset
	ldr	r3, .L20+16
	str	r3, [fp, #-156]
	sub	r3, fp, #156
	mov	r2, #0
	mov	r1, r3
	mov	r0, #10
	bl	sigaction
	mov	r3, r0
	cmn	r3, #1
	bne	.L12
	ldr	r0, .L20+20
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, .L20+24
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L13
	bl	getpid
	mov	r1, r0
	ldr	r3, .L20+24
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r0, .L20+28
	bl	printf
	ldr	r3, .L20+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	sleep
.L13:
	ldr	r0, .L20+32
	bl	puts
	mov	r1, #10
	mov	r0, #1
	bl	prctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L14
	ldr	r0, .L20+36
	bl	perror
	mov	r0, #1
	bl	exit
.L14:
	bl	getpid
	mov	r1, r0
	ldr	r3, .L20+40
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r0, .L20+44
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-160]
	b	.L15
.L16:
	mov	r0, #1
	bl	sleep
	ldr	r3, [fp, #-160]
	add	r3, r3, #1
	str	r3, [fp, #-160]
.L15:
	ldr	r3, .L20+40
	ldr	r3, [r3]
	ldr	r2, [fp, #-160]
	cmp	r2, r3
	blt	.L16
	ldr	r0, .L20+48
	bl	puts
	mov	r0, #0
	bl	exit
.L19:
	bl	__stack_chk_fail
.L18:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC13
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	handler
	.word	.LC7
	.word	childPreSleep
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	childPostSleep
	.word	.LC11
	.word	.LC12
	.size	createChild, .-createChild
	.section	.rodata
	.align	2
.LC14:
	.ascii	"\011TID %ld (PID: %ld) about to sleep %d sec\012\000"
	.align	2
.LC15:
	.ascii	"TID %ld (PID: %ld) terminating (after %d sec sleep)"
	.ascii	"\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	performPerThreadSteps, %function
performPerThreadSteps:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r0, #224
	bl	syscall
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #8]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r0, r3
	bl	usleep
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3, #12]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L23
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L24
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	createAncestor
	b	.L23
.L24:
	bl	createChild
.L23:
	bl	getpid
	mov	r2, r0
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r1, [fp, #-8]
	ldr	r0, .L25
	bl	printf
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	mov	r0, r3
	bl	sleep
	bl	getpid
	mov	r2, r0
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	ldr	r1, [fp, #-8]
	ldr	r0, .L25+4
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC14
	.word	.LC15
	.size	performPerThreadSteps, .-performPerThreadSteps
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadStartFunc, %function
threadStartFunc:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	performPerThreadSteps
	ldr	r0, [fp, #-8]
	bl	free
	mov	r0, #0
	bl	pthread_exit
	.size	threadStartFunc, .-threadStartFunc
	.section	.rodata
	.align	2
.LC16:
	.ascii	":\000"
	.align	2
.LC17:
	.ascii	"malloc\000"
	.align	2
.LC18:
	.ascii	"Found '+' twice in one argument!\012\000"
	.align	2
.LC19:
	.ascii	"pthread_create() failed\012\000"
	.align	2
.LC20:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	createThreads, %function
createThreads:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-56]
	str	r1, [fp, #-60]
	ldr	r3, .L44
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strb	r3, [fp, #-45]
	mov	r3, #0
	str	r3, [fp, #-40]
.L39:
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L29
	ldr	r3, [fp, #-56]
	b	.L30
.L29:
	mov	r3, #0
.L30:
	ldr	r1, .L44+4
	mov	r0, r3
	bl	strtok
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	beq	.L43
	mov	r0, #16
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L33
	ldr	r0, .L44+8
	bl	perror
	mov	r0, #1
	bl	exit
.L33:
	ldr	r3, [fp, #-36]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #43
	moveq	r3, #1
	movne	r3, #0
	and	r2, r3, #255
	ldr	r3, [fp, #-32]
	strb	r2, [r3, #12]
	ldr	r3, [fp, #-32]
	ldrb	r3, [r3, #12]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L34
	ldrb	r3, [fp, #-45]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L35
	ldr	r3, .L44+12
	ldr	r3, [r3]
	mov	r2, #33
	mov	r1, #1
	ldr	r0, .L44+16
	bl	fwrite
	mov	r0, #1
	bl	exit
.L35:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
	mov	r3, #1
	strb	r3, [fp, #-45]
.L34:
	ldr	r0, [fp, #-36]
	bl	atoi
	mov	r2, r0
	ldr	r3, [fp, #-32]
	str	r2, [r3]
	ldr	r3, [fp, #-60]
	add	r2, r3, #4
	ldr	r3, [fp, #-32]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-40]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L36
	ldr	r3, [fp, #-32]
	sub	ip, fp, #24
	ldm	r3, {r0, r1, r2, r3}
	stm	ip, {r0, r1, r2, r3}
	ldr	r0, [fp, #-32]
	bl	free
	b	.L37
.L36:
	sub	r0, fp, #44
	ldr	r3, [fp, #-32]
	ldr	r2, .L44+20
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L37
	ldr	r3, .L44+12
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L44+24
	bl	fwrite
	mov	r0, #1
	bl	exit
.L37:
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
	b	.L39
.L43:
	nop
	ldrb	r3, [fp, #-45]
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	beq	.L40
	mov	r3, #1
	strb	r3, [fp, #-12]
.L40:
	sub	r3, fp, #24
	mov	r0, r3
	bl	performPerThreadSteps
	mov	r0, #0
	bl	pthread_exit
.L45:
	.align	2
.L44:
	.word	.LC20
	.word	.LC16
	.word	.LC17
	.word	stderr
	.word	.LC18
	.word	threadStartFunc
	.word	.LC19
	.size	createThreads, .-createThreads
	.section	.rodata
	.align	2
.LC21:
	.ascii	"Child %ld created; parent %ld\012\000"
	.align	2
.LC22:
	.ascii	"\011*** PID %ld (child of %ld) became a subreaper\012"
	.ascii	"\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	createAncestor, %function
createAncestor:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-24]
	ldr	r0, .L53
	bl	usleep
	mov	r0, #224
	bl	syscall
	mov	r4, r0
	bl	getpid
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L53+4
	bl	printf
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L47
	ldr	r0, .L53+8
	bl	perror
	mov	r0, #1
	bl	exit
.L47:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L52
	bl	getpid
	mov	r4, r0
	bl	getppid
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L53+12
	bl	printf
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #64
	bne	.L50
	mov	r1, #1
	mov	r0, #36
	bl	prctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L51
	ldr	r0, .L53+16
	bl	perror
	mov	r0, #1
	bl	exit
.L51:
	bl	getpid
	mov	r4, r0
	bl	getppid
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L53+20
	bl	printf
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L50:
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-20]
	bl	createThreads
	b	.L46
.L52:
	nop
.L46:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L54:
	.align	2
.L53:
	.word	10000
	.word	.LC4
	.word	.LC5
	.word	.LC21
	.word	.LC10
	.word	.LC22
	.size	createAncestor, .-createAncestor
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r3, .L60
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	setbuf
	ldr	r3, [fp, #-8]
	cmp	r3, #2
	bgt	.L56
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	mov	r0, r3
	bl	usageError
.L56:
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L60+4
	str	r3, [r2]
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L60+8
	str	r3, [r2]
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	ble	.L57
	ldr	r3, [fp, #-12]
	add	r3, r3, #12
	mov	r0, r3
	bl	createAncestor
	b	.L58
.L57:
	bl	createChild
.L58:
	mov	r0, #0
	bl	wait
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L61:
	.align	2
.L60:
	.word	stdout
	.word	childPreSleep
	.word	childPostSleep
	.size	main, .-main
	.local	cnt.7375
	.comm	cnt.7375,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
