	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_waitpid                        ## -- Begin function waitpid
	.p2align	4, 0x90
_waitpid:                               ## @waitpid
	.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
	movl	%edx, %r12d
	movq	%rsi, %r15
	movl	%edi, %r13d
	movq	_SYNCHRONIZE@GOTPCREL(%rip), %rax
	movq	_PROCESS_QUERY_INFORMATION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edx
	callq	_OpenProcess
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %r14d
	testl	%r13d, %r13d
	jle	LBB0_7
## %bb.3:
	movq	_WNOHANG@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_7
## %bb.4:
	movq	_WAIT_OBJECT_0@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_WaitForSingleObject
	cmpq	%rax, %rbx
	jne	LBB0_5
## %bb.6:
	movq	_WNOHANG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %r12d
LBB0_7:
	testl	%r12d, %r12d
	je	LBB0_8
## %bb.18:
	movl	%r14d, %edi
	callq	_CloseHandle
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_1:
	movq	_ECHILD@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %r13d
	jmp	LBB0_20
LBB0_8:
	movq	_INFINITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_WaitForSingleObject
	movq	_WAIT_OBJECT_0@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.9:
	testq	%r15, %r15
	je	LBB0_11
## %bb.10:
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_GetExitCodeProcess
LBB0_11:
	movq	_pinfo_cs@GOTPCREL(%rip), %rdi
	callq	_EnterCriticalSection
	movq	_pinfo@GOTPCREL(%rip), %r15
	movq	(%r15), %rbx
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.12:
	cmpl	%r13d, (%rbx)
	je	LBB0_16
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %r15
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpl	%r13d, (%rbx)
	jne	LBB0_13
## %bb.15:
	addq	$8, %r15
LBB0_16:
	movl	16(%rbx), %edi
	callq	_CloseHandle
	movq	8(%rbx), %rax
	movq	%rax, (%r15)
	movq	%rbx, %rdi
	callq	_free
LBB0_17:
	movq	_pinfo_cs@GOTPCREL(%rip), %rdi
	callq	_LeaveCriticalSection
	movl	%r14d, %edi
	callq	_CloseHandle
	jmp	LBB0_20
LBB0_5:
	movl	%r14d, %edi
	callq	_CloseHandle
	xorl	%r13d, %r13d
LBB0_20:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYNCHRONIZE,4,2                ## @SYNCHRONIZE
	.comm	_PROCESS_QUERY_INFORMATION,4,2  ## @PROCESS_QUERY_INFORMATION
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_ECHILD,4,2                     ## @ECHILD
	.comm	_errno,4,2                      ## @errno
	.comm	_WNOHANG,4,2                    ## @WNOHANG
	.comm	_WAIT_OBJECT_0,8,3              ## @WAIT_OBJECT_0
	.comm	_INFINITE,4,2                   ## @INFINITE
	.comm	_pinfo_cs,4,2                   ## @pinfo_cs
	.comm	_pinfo,8,3                      ## @pinfo
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_waitpid                        ; -- Begin function waitpid
	.p2align	2
_waitpid:                               ; @waitpid
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _SYNCHRONIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYNCHRONIZE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _PROCESS_QUERY_INFORMATION@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PROCESS_QUERY_INFORMATION@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh6:
	adrp	x8, _FALSE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_OpenProcess
	cbz	w0, LBB0_7
; %bb.1:
	mov	x20, x0
	cmp	w19, #1
	b.lt	LBB0_5
; %bb.2:
Lloh9:
	adrp	x23, _WNOHANG@GOTPAGE
Lloh10:
	ldr	x23, [x23, _WNOHANG@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w22
	b.eq	LBB0_5
; %bb.3:
Lloh11:
	adrp	x8, _WAIT_OBJECT_0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _WAIT_OBJECT_0@GOTPAGEOFF]
Lloh13:
	ldr	x24, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_WaitForSingleObject
	cmp	x24, x0
	b.ne	LBB0_20
; %bb.4:
	ldr	w8, [x23]
	bic	w22, w22, w8
LBB0_5:
	cbz	w22, LBB0_9
; %bb.6:
	mov	x0, x20
	bl	_CloseHandle
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh16:
	adrp	x8, _ECHILD@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ECHILD@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _errno@GOTPAGE
Lloh19:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh20:
	str	w8, [x9]
	mov	w19, #-1
	b	LBB0_21
LBB0_9:
Lloh21:
	adrp	x8, _INFINITE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _INFINITE@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_WaitForSingleObject
Lloh24:
	adrp	x8, _WAIT_OBJECT_0@GOTPAGE
Lloh25:
	ldr	x8, [x8, _WAIT_OBJECT_0@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_20
; %bb.10:
	cbz	x21, LBB0_12
; %bb.11:
	mov	x0, x20
	mov	x1, x21
	bl	_GetExitCodeProcess
LBB0_12:
Lloh27:
	adrp	x0, _pinfo_cs@GOTPAGE
Lloh28:
	ldr	x0, [x0, _pinfo_cs@GOTPAGEOFF]
	bl	_EnterCriticalSection
Lloh29:
	adrp	x8, _pinfo@GOTPAGE
Lloh30:
	ldr	x8, [x8, _pinfo@GOTPAGEOFF]
Lloh31:
	ldr	x21, [x8]
	cbz	x21, LBB0_19
; %bb.13:
	ldr	w8, [x21]
	cmp	w8, w19
	b.ne	LBB0_15
; %bb.14:
Lloh32:
	adrp	x22, _pinfo@GOTPAGE
Lloh33:
	ldr	x22, [x22, _pinfo@GOTPAGEOFF]
	b	LBB0_18
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x8, x21
	ldr	x21, [x21, #8]
	cbz	x21, LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w9, [x21]
	cmp	w9, w19
	b.ne	LBB0_15
; %bb.17:
	add	x22, x8, #8
LBB0_18:
	ldr	w0, [x21, #16]
	bl	_CloseHandle
	ldr	x8, [x21, #8]
	str	x8, [x22]
	mov	x0, x21
	bl	_free
LBB0_19:
Lloh34:
	adrp	x0, _pinfo_cs@GOTPAGE
Lloh35:
	ldr	x0, [x0, _pinfo_cs@GOTPAGEOFF]
	bl	_LeaveCriticalSection
	mov	x0, x20
	bl	_CloseHandle
	b	LBB0_21
LBB0_20:
	mov	x0, x20
	bl	_CloseHandle
	mov	w19, #0
LBB0_21:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_SYNCHRONIZE,4,2                ; @SYNCHRONIZE
	.comm	_PROCESS_QUERY_INFORMATION,4,2  ; @PROCESS_QUERY_INFORMATION
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_ECHILD,4,2                     ; @ECHILD
	.comm	_errno,4,2                      ; @errno
	.comm	_WNOHANG,4,2                    ; @WNOHANG
	.comm	_WAIT_OBJECT_0,8,3              ; @WAIT_OBJECT_0
	.comm	_INFINITE,4,2                   ; @INFINITE
	.comm	_pinfo_cs,4,2                   ; @pinfo_cs
	.comm	_pinfo,8,3                      ; @pinfo
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
