	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ConditionVariablePrepareToSleep ## -- Begin function ConditionVariablePrepareToSleep
	.p2align	4, 0x90
_ConditionVariablePrepareToSleep:       ## @ConditionVariablePrepareToSleep
	.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	%rdi, %rbx
	movq	_MyProc@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %r14d
	movq	_cv_wait_event_set@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	jne	LBB0_2
## %bb.1:
	movq	_TopMemoryContext@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$2, %esi
	callq	_CreateWaitEventSet
	movq	%rax, %r15
	movq	_WL_LATCH_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PGINVALID_SOCKET@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	_MyLatch@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r15, %rdi
	xorl	%r8d, %r8d
	callq	_AddWaitEventToSet
	movq	_WL_EXIT_ON_PM_DEATH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_AddWaitEventToSet
	movq	%r15, (%r12)
LBB0_2:
	movq	_cv_sleep_target@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_ConditionVariableCancelSleep
LBB0_4:
	movq	%rbx, (%r15)
	movq	_MyLatch@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ResetLatch
	movq	%rbx, %rdi
	callq	_SpinLockAcquire
	leaq	4(%rbx), %rdi
	movq	_cvWaitLink@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %esi
	callq	_proclist_push_tail
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_SpinLockRelease                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MyProc,8,3                     ## @MyProc
	.comm	_cv_wait_event_set,8,3          ## @cv_wait_event_set
	.comm	_TopMemoryContext,4,2           ## @TopMemoryContext
	.comm	_WL_LATCH_SET,4,2               ## @WL_LATCH_SET
	.comm	_PGINVALID_SOCKET,4,2           ## @PGINVALID_SOCKET
	.comm	_MyLatch,8,3                    ## @MyLatch
	.comm	_WL_EXIT_ON_PM_DEATH,4,2        ## @WL_EXIT_ON_PM_DEATH
	.comm	_cv_sleep_target,8,3            ## @cv_sleep_target
	.comm	_cvWaitLink,4,2                 ## @cvWaitLink
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ConditionVariablePrepareToSleep ; -- Begin function ConditionVariablePrepareToSleep
	.p2align	2
_ConditionVariablePrepareToSleep:       ; @ConditionVariablePrepareToSleep
	.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	x19, x0
Lloh0:
	adrp	x8, _MyProc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MyProc@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w20, [x8]
Lloh3:
	adrp	x23, _cv_wait_event_set@GOTPAGE
Lloh4:
	ldr	x23, [x23, _cv_wait_event_set@GOTPAGEOFF]
	ldr	x8, [x23]
Lloh5:
	adrp	x22, _MyLatch@GOTPAGE
Lloh6:
	ldr	x22, [x22, _MyLatch@GOTPAGEOFF]
	cbnz	x8, LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _TopMemoryContext@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TopMemoryContext@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	mov	w1, #2
	bl	_CreateWaitEventSet
	mov	x21, x0
Lloh10:
	adrp	x8, _WL_LATCH_SET@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WL_LATCH_SET@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x24, _PGINVALID_SOCKET@GOTPAGE
Lloh14:
	ldr	x24, [x24, _PGINVALID_SOCKET@GOTPAGEOFF]
	ldr	w2, [x24]
	ldr	x3, [x22]
	mov	x4, #0
	bl	_AddWaitEventToSet
Lloh15:
	adrp	x8, _WL_EXIT_ON_PM_DEATH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _WL_EXIT_ON_PM_DEATH@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	ldr	w2, [x24]
	mov	x0, x21
	mov	x3, #0
	mov	x4, #0
	bl	_AddWaitEventToSet
	str	x21, [x23]
LBB0_2:
Lloh18:
	adrp	x21, _cv_sleep_target@GOTPAGE
Lloh19:
	ldr	x21, [x21, _cv_sleep_target@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_4
; %bb.3:
	bl	_ConditionVariableCancelSleep
LBB0_4:
	str	x19, [x21]
	ldr	x0, [x22]
	bl	_ResetLatch
	mov	x0, x19
	bl	_SpinLockAcquire
	add	x0, x19, #4
Lloh20:
	adrp	x8, _cvWaitLink@GOTPAGE
Lloh21:
	ldr	x8, [x8, _cvWaitLink@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x1, x20
	bl	_proclist_push_tail
	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
	b	_SpinLockRelease
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MyProc,8,3                     ; @MyProc
	.comm	_cv_wait_event_set,8,3          ; @cv_wait_event_set
	.comm	_TopMemoryContext,4,2           ; @TopMemoryContext
	.comm	_WL_LATCH_SET,4,2               ; @WL_LATCH_SET
	.comm	_PGINVALID_SOCKET,4,2           ; @PGINVALID_SOCKET
	.comm	_MyLatch,8,3                    ; @MyLatch
	.comm	_WL_EXIT_ON_PM_DEATH,4,2        ; @WL_EXIT_ON_PM_DEATH
	.comm	_cv_sleep_target,8,3            ; @cv_sleep_target
	.comm	_cvWaitLink,4,2                 ; @cvWaitLink
.subsections_via_symbols
