	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xwait
_xwait:                                 ## @xwait
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %r15d
	xorl	%eax, %eax
	callq	_pids_empty
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:
	movq	_ECHILD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %ebx
	jmp	LBB0_6
LBB0_1:
	movq	_WNOHANG@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%edx, %edx
	testl	%r15d, %r15d
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %edx
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$-1, %edi
	movq	%r14, %rsi
	callq	_waitpid
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	callq	_pids_remove
	testq	%rax, %rax
	je	LBB0_2
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ECHILD,4,2                     ## @ECHILD
	.comm	_errno,4,2                      ## @errno
	.comm	_WNOHANG,4,2                    ## @WNOHANG
	.no_dead_strip	_xwait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xwait
_xwait:                                 ; @xwait
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
	bl	_pids_empty
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ECHILD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ECHILD@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _errno@GOTPAGE
Lloh4:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh5:
	str	w8, [x9]
	mov	w21, #-1
	b	LBB0_5
LBB0_2:
Lloh6:
	adrp	x22, _WNOHANG@GOTPAGE
Lloh7:
	ldr	x22, [x22, _WNOHANG@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	cmp	w20, #0
	csel	w2, w8, wzr, eq
	mov	w0, #-1
	mov	x1, x19
	bl	_waitpid
	mov	x21, x0
	cmp	w0, #1
	b.lt	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_pids_remove
	cbz	x0, LBB0_3
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ECHILD,4,2                     ; @ECHILD
	.comm	_errno,4,2                      ; @errno
	.comm	_WNOHANG,4,2                    ; @WNOHANG
	.no_dead_strip	_xwait
.subsections_via_symbols
