	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_for_child_exit
_wait_for_child_exit:                   ## @wait_for_child_exit
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	leaq	-28(%rbp), %r14
	leaq	L_.str(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_waitpid
	cmpl	$-1, %eax
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_test_fail
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	-28(%rbp), %edi
	callq	_WIFSIGNALED
	movl	-28(%rbp), %edi
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	callq	_WIFEXITED
	testq	%rax, %rax
	je	LBB0_1
## %bb.6:
	movl	-28(%rbp), %edi
	callq	_WEXITSTATUS
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movl	-28(%rbp), %edi
	callq	_WEXITSTATUS
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_8
LBB0_4:
	callq	_WTERMSIG
	leaq	L_.str.1(%rip), %rdi
LBB0_8:
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_test_fail
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unexpected waitpid() failure."

L_.str.1:                               ## @.str.1
	.asciz	"Unexpected child termination due to signal %d"

L_.str.2:                               ## @.str.2
	.asciz	"Unexpected child exit value %d"

	.no_dead_strip	_wait_for_child_exit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_for_child_exit
_wait_for_child_exit:                   ; @wait_for_child_exit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x20, l_.str@PAGE
Lloh1:
	add	x20, x20, l_.str@PAGEOFF
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #12
	mov	x0, x19
	mov	w2, #0
	bl	_waitpid
	cmn	w0, #1
	b.ne	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	bl	_test_fail
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [sp, #12]
	bl	_WIFSIGNALED
	mov	x8, x0
	ldr	w0, [sp, #12]
	cbnz	x8, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_WIFEXITED
	cbz	x0, LBB0_1
; %bb.5:
	ldr	w0, [sp, #12]
	bl	_WEXITSTATUS
	cbz	x0, LBB0_9
; %bb.6:
	ldr	w0, [sp, #12]
	bl	_WEXITSTATUS
	str	x0, [sp]
Lloh2:
	adrp	x0, l_.str.2@PAGE
Lloh3:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_7:
	bl	_WTERMSIG
	str	x0, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_8:
	bl	_test_fail
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unexpected waitpid() failure."

l_.str.1:                               ; @.str.1
	.asciz	"Unexpected child termination due to signal %d"

l_.str.2:                               ; @.str.2
	.asciz	"Unexpected child exit value %d"

	.no_dead_strip	_wait_for_child_exit
.subsections_via_symbols
