	.file	"132.c"
	.intel_syntax noprefix
	.text
	.globl	nchild
	.bss
	.align 4
	.type	nchild, @object
	.size	nchild, 4
nchild:
	.zero	4
	.globl	pids
	.align 8
	.type	pids, @object
	.size	pids, 8
pids:
	.zero	8
	.section	.rodata
.LC0:
	.string	"Usage: %s <slave-num>\n"
.LC1:
	.string	"The slave num is not enough.\n"
.LC2:
	.string	"signal SIGCHLD error"
.LC3:
	.string	"signal SIGINT error"
	.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, 40
	.cfi_offset 3, -24
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	cmp	DWORD PTR -36[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR nchild[rip], eax
	mov	eax, DWORD PTR nchild[rip]
	test	eax, eax
	jg	.L3
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 29
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	lea	rsi, sig_child[rip]
	mov	edi, 17
	call	signal@PLT
	cmp	rax, -1
	jne	.L4
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	lea	rsi, sig_int[rip]
	mov	edi, 2
	call	signal@PLT
	cmp	rax, -1
	jne	.L5
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR nchild[rip]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR pids[rip], rax
	mov	DWORD PTR -20[rbp], 0
	jmp	.L6
.L7:
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	lea	rbx, [rdx+rax]
	mov	eax, 0
	call	make_child
	mov	DWORD PTR [rbx], eax
	add	DWORD PTR -20[rbp], 1
.L6:
	mov	eax, DWORD PTR nchild[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L7
.L8:
	call	pause@PLT
	jmp	.L8
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC4:
	.string	"child %ld started!\n"
.LC5:
	.string	"child"
.LC6:
	.string	"./child"
	.text
	.globl	child_main
	.type	child_main, @function
child_main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	call	getpid@PLT
	cdqe
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, 0
	lea	rsi, .LC5[rip]
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	execlp@PLT
	test	eax, eax
	jns	.L11
	mov	edi, 1
	call	exit@PLT
.L11:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	child_main, .-child_main
	.section	.rodata
.LC7:
	.string	"fork error"
	.text
	.globl	make_child
	.type	make_child, @function
make_child:
.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, 16
	call	fork@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L13
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	cmp	DWORD PTR -4[rbp], 0
	jle	.L14
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L12
.L14:
	mov	eax, 0
	call	child_main
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	make_child, .-make_child
	.section	.rodata
	.align 8
.LC8:
	.string	"process %ld is finished, status %d.\n"
	.text
	.globl	sig_child
	.type	sig_child, @function
sig_child:
.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, 56
	.cfi_offset 3, -24
	mov	DWORD PTR -52[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	jmp	.L17
.L21:
	mov	edx, DWORD PTR -36[rbp]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -32[rbp], 0
	jmp	.L18
.L20:
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -28[rbp], eax
	jne	.L19
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 2
	lea	rbx, [rdx+rax]
	mov	eax, 0
	call	make_child
	mov	DWORD PTR [rbx], eax
	jmp	.L17
.L19:
	add	DWORD PTR -32[rbp], 1
.L18:
	mov	eax, DWORD PTR nchild[rip]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L20
.L17:
	lea	rax, -36[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, -1
	call	waitpid@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jg	.L21
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sig_child, .-sig_child
	.section	.rodata
	.align 8
.LC9:
	.string	"signal SIGCHLD [default] error"
.LC10:
	.string	"child terminated: %ld\n"
.LC11:
	.string	"process terminated@ %s"
	.text
	.globl	sig_int
	.type	sig_int, @function
sig_int:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	mov	edi, 17
	call	signal@PLT
	cmp	rax, -1
	jne	.L24
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L24:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L25
.L26:
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, 15
	mov	edi, eax
	call	kill@PLT
	mov	rdx, QWORD PTR pids[rip]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cdqe
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -20[rbp], 1
.L25:
	mov	eax, DWORD PTR nchild[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L26
	lea	rax, -16[rbp]
	mov	rdi, rax
	call	time@PLT
	lea	rax, -16[rbp]
	mov	rdi, rax
	call	ctime@PLT
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE10:
	.size	sig_int, .-sig_int
	.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	"132.c"
	.text
	.comm	nchild,4,4
	.comm	pids,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s <slave-num>\012\000"
	.align	2
.LC1:
	.ascii	"The slave num is not enough.\012\000"
	.align	2
.LC2:
	.ascii	"signal SIGCHLD error\000"
	.align	2
.LC3:
	.ascii	"signal SIGINT error\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-24]
	cmp	r3, #2
	beq	.L2
	ldr	r3, .L9
	ldr	r0, [r3]
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L9+4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L9+8
	str	r3, [r2]
	ldr	r3, .L9+8
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L3
	ldr	r3, .L9
	ldr	r3, [r3]
	mov	r2, #29
	mov	r1, #1
	ldr	r0, .L9+12
	bl	fwrite
	mov	r0, #1
	bl	exit
.L3:
	ldr	r1, .L9+16
	mov	r0, #17
	bl	signal
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L9+20
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	ldr	r1, .L9+24
	mov	r0, #2
	bl	signal
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L9+28
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	ldr	r3, .L9+8
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L9+32
	str	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L6
.L7:
	ldr	r3, .L9+32
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r4, r2, r3
	bl	make_child
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L6:
	ldr	r3, .L9+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L7
.L8:
	bl	pause
	b	.L8
.L10:
	.align	2
.L9:
	.word	stderr
	.word	.LC0
	.word	nchild
	.word	.LC1
	.word	sig_child
	.word	.LC2
	.word	sig_int
	.word	.LC3
	.word	pids
	.size	main, .-main
	.section	.rodata
	.align	2
.LC4:
	.ascii	"child %ld started!\012\000"
	.align	2
.LC5:
	.ascii	"child\000"
	.align	2
.LC6:
	.ascii	"./child\000"
	.text
	.align	2
	.global	child_main
	.syntax unified
	.arm
	.fpu softvfp
	.type	child_main, %function
child_main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L14
	bl	printf
	mov	r2, #0
	ldr	r1, .L14+4
	ldr	r0, .L14+8
	bl	execlp
	mov	r3, r0
	cmp	r3, #0
	bge	.L13
	mov	r0, #1
	bl	exit
.L13:
	nop
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	child_main, .-child_main
	.section	.rodata
	.align	2
.LC7:
	.ascii	"fork error\000"
	.text
	.align	2
	.global	make_child
	.syntax unified
	.arm
	.fpu softvfp
	.type	make_child, %function
make_child:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L17
	ldr	r0, .L20
	bl	perror
	mov	r0, #1
	bl	exit
.L17:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	ble	.L18
	ldr	r3, [fp, #-8]
	b	.L16
.L18:
	bl	child_main
.L16:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC7
	.size	make_child, .-make_child
	.section	.rodata
	.align	2
.LC8:
	.ascii	"process %ld is finished, status %d.\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	sig_child
	.syntax unified
	.arm
	.fpu softvfp
	.type	sig_child, %function
sig_child:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-32]
	ldr	r3, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	b	.L23
.L27:
	ldr	r3, [fp, #-28]
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, .L29+4
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L24
.L26:
	ldr	r3, .L29+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bne	.L25
	ldr	r3, .L29+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r4, r2, r3
	bl	make_child
	mov	r3, r0
	str	r3, [r4]
	b	.L23
.L25:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L24:
	ldr	r3, .L29+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L26
.L23:
	sub	r3, fp, #28
	mov	r2, #1
	mov	r1, r3
	mvn	r0, #0
	bl	waitpid
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bgt	.L27
	nop
	ldr	r3, .L29
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC9
	.word	.LC8
	.word	pids
	.word	nchild
	.size	sig_child, .-sig_child
	.section	.rodata
	.align	2
.LC10:
	.ascii	"signal SIGCHLD [default] error\000"
	.align	2
.LC11:
	.ascii	"child terminated: %ld\012\000"
	.align	2
.LC12:
	.ascii	"process terminated@ %s\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	sig_int
	.syntax unified
	.arm
	.fpu softvfp
	.type	sig_int, %function
sig_int:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L36
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #0
	mov	r0, #17
	bl	signal
	mov	r3, r0
	cmn	r3, #1
	bne	.L32
	ldr	r0, .L36+4
	bl	perror
	mov	r0, #1
	bl	exit
.L32:
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L33
.L34:
	ldr	r3, .L36+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, #15
	mov	r0, r3
	bl	kill
	ldr	r3, .L36+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L36+12
	bl	printf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L33:
	ldr	r3, .L36+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L34
	sub	r3, fp, #16
	mov	r0, r3
	bl	time
	sub	r3, fp, #16
	mov	r0, r3
	bl	ctime
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L36+20
	bl	printf
	mov	r0, #0
	bl	exit
.L37:
	.align	2
.L36:
	.word	.LC13
	.word	.LC10
	.word	pids
	.word	.LC11
	.word	nchild
	.word	.LC12
	.size	sig_int, .-sig_int
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
