	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_check_children_status          ## -- Begin function check_children_status
	.p2align	4, 0x90
_check_children_status:                 ## @check_children_status
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_workers@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	je	LBB0_12
## %bb.1:
	jle	LBB0_17
## %bb.2:
	xorl	%ebx, %ebx
	movq	_pids@GOTPCREL(%rip), %r15
	movq	_WNOHANG@GOTPCREL(%rip), %r13
	leaq	-44(%rbp), %r14
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jge	LBB0_17
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, -44(%rbp)
	movq	(%r15), %rax
	movl	(%rax,%rbx,4), %edi
	movl	(%r13), %edx
	movq	%r14, %rsi
	callq	_waitpid
	movq	(%r15), %rcx
	movl	(%rcx,%rbx,4), %esi
	cmpl	%esi, %eax
	jne	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %edi
	callq	_WIFEXITED
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %edi
	callq	_WIFSIGNALED
	testq	%rax, %rax
	je	LBB0_16
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	testl	%eax, %eax
	je	LBB0_16
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$-1, %eax
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_EINTR@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_16
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_kprintf
	jmp	LBB0_11
LBB0_12:
	movq	_slave_mode@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_17
## %bb.13:
	xorl	%eax, %eax
	callq	_getppid
	movq	_parent_pid@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	cmpl	%ebx, %eax
	jne	LBB0_14
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	(%r15), %rax
	movl	(%rax,%rbx,4), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_kprintf
LBB0_11:
	movq	(%r15), %rax
	movl	$0, (%rax,%rbx,4)
	movq	_SIGTERM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_kill_children
	xorl	%eax, %eax
	callq	_check_children_dead
LBB0_15:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
LBB0_14:
	xorl	%eax, %eax
	callq	_getppid
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_kprintf
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_workers,4,2                    ## @workers
	.comm	_pids,8,3                       ## @pids
	.comm	_WNOHANG,4,2                    ## @WNOHANG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Child %d terminated, aborting\n"

	.comm	_SIGTERM,4,2                    ## @SIGTERM
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
L_.str.1:                               ## @.str.1
	.asciz	"Child %d: unknown result during wait (%d, %m), aborting\n"

	.comm	_slave_mode,8,3                 ## @slave_mode
	.comm	_parent_pid,4,2                 ## @parent_pid
L_.str.2:                               ## @.str.2
	.asciz	"Parent %d is changed to %d, aborting\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_check_children_status          ; -- Begin function check_children_status
	.p2align	2
_check_children_status:                 ; @check_children_status
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x21, _workers@GOTPAGE
Lloh1:
	ldr	x21, [x21, _workers@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_11
; %bb.1:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.2:
	mov	x20, #0
Lloh2:
	adrp	x19, _pids@GOTPAGE
Lloh3:
	ldr	x19, [x19, _pids@GOTPAGEOFF]
Lloh4:
	adrp	x22, _WNOHANG@GOTPAGE
Lloh5:
	ldr	x22, [x22, _WNOHANG@GOTPAGEOFF]
Lloh6:
	adrp	x23, _errno@GOTPAGE
Lloh7:
	ldr	x23, [x23, _errno@GOTPAGEOFF]
Lloh8:
	adrp	x24, _EINTR@GOTPAGE
Lloh9:
	ldr	x24, [x24, _EINTR@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x21]
	cmp	x20, x8
	b.ge	LBB0_13
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [sp, #12]
	ldr	x8, [x19]
	lsl	x25, x20, #2
	ldr	w0, [x8, x25]
	ldr	w2, [x22]
	add	x1, sp, #12
	bl	_waitpid
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x8, [x19]
	ldr	w1, [x8, x25]
	cmp	w0, w1
	b.ne	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [sp, #12]
	bl	_WIFEXITED
	cbnz	x0, LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [sp, #12]
	bl	_WIFSIGNALED
	cbz	x0, LBB0_3
	b	LBB0_14
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	w0, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	cmn	w0, #1
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x23]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_3
LBB0_10:
	str	x0, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_kprintf
	ldr	x8, [x19]
	str	wzr, [x8, x20, lsl #2]
	b	LBB0_15
LBB0_11:
Lloh12:
	adrp	x8, _slave_mode@GOTPAGE
Lloh13:
	ldr	x8, [x8, _slave_mode@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cbz	x8, LBB0_13
; %bb.12:
	bl	_getppid
Lloh15:
	adrp	x8, _parent_pid@GOTPAGE
Lloh16:
	ldr	x8, [x8, _parent_pid@GOTPAGEOFF]
Lloh17:
	ldr	w19, [x8]
	cmp	w0, w19
	b.ne	LBB0_17
LBB0_13:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_14:
	ldr	x8, [x19]
	ldr	w1, [x8, x25]
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_kprintf
	ldr	x8, [x19]
	str	wzr, [x8, x25]
LBB0_15:
Lloh20:
	adrp	x8, _SIGTERM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SIGTERM@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_kill_children
	bl	_check_children_dead
LBB0_16:
Lloh23:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_exit
LBB0_17:
	bl	_getppid
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_kprintf
	b	LBB0_16
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_workers,4,2                    ; @workers
	.comm	_pids,8,3                       ; @pids
	.comm	_WNOHANG,4,2                    ; @WNOHANG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Child %d terminated, aborting\n"

	.comm	_SIGTERM,4,2                    ; @SIGTERM
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
l_.str.1:                               ; @.str.1
	.asciz	"Child %d: unknown result during wait (%d, %m), aborting\n"

	.comm	_slave_mode,8,3                 ; @slave_mode
	.comm	_parent_pid,4,2                 ; @parent_pid
l_.str.2:                               ; @.str.2
	.asciz	"Parent %d is changed to %d, aborting\n"

.subsections_via_symbols
