	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wait_child                     ## -- Begin function wait_child
	.p2align	4, 0x90
_wait_child:                            ## @wait_child
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %r14d
	leaq	-24(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_sigemptyset
	movq	_SIGCHLD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sigaddset
	movq	_SIG_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_sigprocmask
	movl	%r14d, %edi
	movl	$1, %esi
	callq	_findchild
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	cmpl	$0, 4(%rax)
	je	LBB0_4
## %bb.3:
	movl	(%rbx), %eax
	movq	_wait_status@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%r14d, %r14d
	jmp	LBB0_5
LBB0_1:
	movq	_wait_status@GOTPCREL(%rip), %rsi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_waitpid
	movl	%eax, %r14d
	jmp	LBB0_6
LBB0_4:
	movq	_wait_status@GOTPCREL(%rip), %rsi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_waitpid
	movl	%eax, %r14d
LBB0_5:
	movq	%rbx, %rdi
	callq	_delchild
LBB0_6:
	movq	_SIG_SETMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-20(%rbp), %rsi
	xorl	%edx, %edx
	callq	_sigprocmask
	movl	$-1, %ebx
	cmpl	$-1, %r14d
	je	LBB0_10
## %bb.7:
	movq	_wait_status@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_WIFEXITED
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	(%r14), %edi
	callq	_WEXITSTATUS
	testq	%rax, %rax
	jne	LBB0_10
LBB0_9:
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIGCHLD,4,2                    ## @SIGCHLD
	.comm	_SIG_BLOCK,4,2                  ## @SIG_BLOCK
	.comm	_wait_status,4,2                ## @wait_status
	.comm	_SIG_SETMASK,4,2                ## @SIG_SETMASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wait_child                     ; -- Begin function wait_child
	.p2align	2
_wait_child:                            ; @wait_child
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	add	x0, sp, #12
	bl	_sigemptyset
Lloh0:
	adrp	x8, _SIGCHLD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SIGCHLD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x0, sp, #12
	bl	_sigaddset
Lloh3:
	adrp	x8, _SIG_BLOCK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SIG_BLOCK@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, sp, #12
	add	x2, sp, #8
	bl	_sigprocmask
	mov	x0, x19
	mov	w1, #1
	bl	_findchild
Lloh6:
	adrp	x21, _wait_status@GOTPAGE
Lloh7:
	ldr	x21, [x21, _wait_status@GOTPAGEOFF]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_4
; %bb.2:
	mov	w19, #0
	ldr	w8, [x20]
	str	w8, [x21]
	b	LBB0_5
LBB0_3:
Lloh8:
	adrp	x1, _wait_status@GOTPAGE
Lloh9:
	ldr	x1, [x1, _wait_status@GOTPAGEOFF]
	mov	x0, x19
	mov	w2, #0
	bl	_waitpid
	mov	x19, x0
	b	LBB0_6
LBB0_4:
Lloh10:
	adrp	x1, _wait_status@GOTPAGE
Lloh11:
	ldr	x1, [x1, _wait_status@GOTPAGEOFF]
	mov	x0, x19
	mov	w2, #0
	bl	_waitpid
	mov	x19, x0
LBB0_5:
	mov	x0, x20
	bl	_delchild
LBB0_6:
Lloh12:
	adrp	x8, _SIG_SETMASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SIG_SETMASK@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	add	x1, sp, #8
	mov	x2, #0
	bl	_sigprocmask
	cmn	w19, #1
	b.eq	LBB0_9
; %bb.7:
	ldr	w0, [x21]
	bl	_WIFEXITED
	cbz	x0, LBB0_10
; %bb.8:
	ldr	w0, [x21]
	bl	_WEXITSTATUS
	cbz	x0, LBB0_10
LBB0_9:
	mov	w0, #-1
	b	LBB0_11
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_SIGCHLD,4,2                    ; @SIGCHLD
	.comm	_SIG_BLOCK,4,2                  ; @SIG_BLOCK
	.comm	_wait_status,4,2                ; @wait_status
	.comm	_SIG_SETMASK,4,2                ; @SIG_SETMASK
.subsections_via_symbols
