	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cond_wait_user
_cond_wait_user:                        ## @cond_wait_user
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r15
	xorl	%eax, %eax
	callq	__get_curthread
	movq	%rax, %rbx
	cmpq	$0, 16(%rax)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_PANIC
LBB0_2:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	__thr_testcancel
LBB0_4:
	movq	%r15, %rdi
	callq	__sleepq_lock
	movl	$1, (%r15)
	movl	$0, -44(%rbp)
	leaq	-52(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	__mutex_cv_unlock
	movq	%r14, 8(%rbx)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	__sleepq_add
	xorl	%r12d, %r12d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%r15), %esi
	movq	%rbx, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	__thr_sleep
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	__sleepq_lock
	cmpq	$0, 16(%rbx)
	je	LBB0_12
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	je	LBB0_18
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	__thr_clear_wake
	movq	%r15, %rdi
	callq	__sleepq_unlock
	cmpl	$0, -44(%rbp)
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$0, -44(%rbp)
	movq	_UMUTEX_CONTESTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_UMTX_OP_MUTEX_WAKE2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r14), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	__umtx_op_err
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	(%rbx), %rsi
	testq	%rsi, %rsi
	jle	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	24(%rbx), %edi
	callq	__thr_wake_all
	movq	$0, (%rbx)
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_11
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	__thr_cancel_enter2
	movl	4(%r15), %esi
	movq	%rbx, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	__thr_sleep
	movl	%eax, %r13d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	__thr_cancel_leave
	movq	%r15, %rdi
	callq	__sleepq_lock
	cmpq	$0, 16(%rbx)
	je	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_SHOULD_CANCEL
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rdi
	callq	__sleepq_lookup
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	__sleepq_remove
	movl	%eax, (%r15)
	movq	%r15, %rdi
	callq	__sleepq_unlock
	movq	$0, 8(%rbx)
	movl	-52(%rbp), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	__mutex_cv_lock
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_THR_IN_CRITICAL
	testl	%eax, %eax
	jne	LBB0_20
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_PTHREAD_CANCELED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	__pthread_exit
	jmp	LBB0_5
LBB0_18:
	movq	%r15, %rdi
	callq	__sleepq_lookup
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	__sleepq_remove
	movl	%eax, (%r15)
	movl	%r13d, %r12d
	jmp	LBB0_19
LBB0_12:
	xorl	%r12d, %r12d
LBB0_19:
	movq	%r15, %rdi
	callq	__sleepq_unlock
	movq	$0, 8(%rbx)
	movl	-52(%rbp), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	__mutex_cv_lock
	movl	%eax, %r13d
	testl	%r12d, %r12d
	cmovnel	%r12d, %r13d
LBB0_20:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"thread %p was already on queue."

	.comm	_UMUTEX_CONTESTED,4,2           ## @UMUTEX_CONTESTED
	.comm	_UMTX_OP_MUTEX_WAKE2,4,2        ## @UMTX_OP_MUTEX_WAKE2
	.comm	_PTHREAD_CANCELED,4,2           ## @PTHREAD_CANCELED
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_cond_wait_user
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cond_wait_user
_cond_wait_user:                        ; @cond_wait_user
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x3
	mov	x23, x2
	mov	x19, x1
	mov	x21, x0
	bl	__get_curthread
	mov	x20, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_PANIC
LBB0_2:
	cbz	w22, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	__thr_testcancel
LBB0_4:
	mov	x0, x21
	bl	__sleepq_lock
	mov	w8, #1
	str	w8, [x21]
	str	wzr, [sp, #12]
	add	x1, sp, #8
	add	x2, sp, #12
	mov	x0, x19
	bl	__mutex_cv_unlock
	str	x19, [x20, #8]
	mov	x0, x21
	mov	x1, x20
	bl	__sleepq_add
Lloh2:
	adrp	x25, _ETIMEDOUT@GOTPAGE
Lloh3:
	ldr	x25, [x25, _ETIMEDOUT@GOTPAGEOFF]
Lloh4:
	adrp	x26, _PTHREAD_CANCELED@GOTPAGE
Lloh5:
	ldr	x26, [x26, _PTHREAD_CANCELED@GOTPAGEOFF]
Lloh6:
	adrp	x27, _UMUTEX_CONTESTED@GOTPAGE
Lloh7:
	ldr	x27, [x27, _UMUTEX_CONTESTED@GOTPAGEOFF]
Lloh8:
	adrp	x28, _UMTX_OP_MUTEX_WAKE2@GOTPAGE
Lloh9:
	ldr	x28, [x28, _UMTX_OP_MUTEX_WAKE2@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x21, #4]
	mov	x0, x20
	mov	x2, x23
	bl	__thr_sleep
	mov	x24, x0
	mov	x0, x21
	bl	__sleepq_lock
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_17
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x25]
	cmp	w24, w8
	b.eq	LBB0_18
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	__thr_clear_wake
	mov	x0, x21
	bl	__sleepq_unlock
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	str	wzr, [sp, #12]
	ldr	w8, [x19]
	ldr	w9, [x27]
	tst	w9, w8
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x28]
	ldr	w2, [x19, #4]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #0
	bl	__umtx_op_err
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x1, [x20]
	cmp	x1, #1
	b.lt	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x20, #24]
	bl	__thr_wake_all
	str	xzr, [x20]
LBB0_12:                                ;   in Loop: Header=BB0_7 Depth=1
	cbz	w22, LBB0_5
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	mov	w1, #0
	bl	__thr_cancel_enter2
	ldr	w1, [x21, #4]
	mov	x0, x20
	mov	x2, x23
	bl	__thr_sleep
	mov	x24, x0
	mov	x0, x20
	mov	w1, #0
	bl	__thr_cancel_leave
	mov	x0, x21
	bl	__sleepq_lock
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	bl	_SHOULD_CANCEL
	cbz	x0, LBB0_6
; %bb.15:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	bl	__sleepq_lookup
	mov	x1, x20
	bl	__sleepq_remove
	str	w0, [x21]
	mov	x0, x21
	bl	__sleepq_unlock
	str	xzr, [x20, #8]
	ldr	w1, [sp, #8]
	mov	x0, x19
	mov	w2, #0
	bl	__mutex_cv_lock
	mov	x24, x0
	mov	x0, x20
	bl	_THR_IN_CRITICAL
	cbnz	w0, LBB0_20
; %bb.16:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x26]
	bl	__pthread_exit
	b	LBB0_7
LBB0_17:
	mov	w24, #0
	b	LBB0_19
LBB0_18:
	mov	x0, x21
	bl	__sleepq_lookup
	mov	x1, x20
	bl	__sleepq_remove
	str	w0, [x21]
LBB0_19:
	mov	x0, x21
	bl	__sleepq_unlock
	str	xzr, [x20, #8]
	ldr	w1, [sp, #8]
	mov	x0, x19
	mov	w2, #0
	bl	__mutex_cv_lock
	cmp	w24, #0
	csel	w24, w0, w24, eq
LBB0_20:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"thread %p was already on queue."

	.comm	_UMUTEX_CONTESTED,4,2           ; @UMUTEX_CONTESTED
	.comm	_UMTX_OP_MUTEX_WAKE2,4,2        ; @UMTX_OP_MUTEX_WAKE2
	.comm	_PTHREAD_CANCELED,4,2           ; @PTHREAD_CANCELED
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_cond_wait_user
.subsections_via_symbols
