	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pte_cond_wait_cleanup
_pte_cond_wait_cleanup:                 ## @pte_cond_wait_cleanup
	.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, %r14
	movq	(%rdi), %r13
	movq	16(%rdi), %rbx
	leaq	16(%rbx), %r15
	movq	%r15, %rdi
	callq	_pthread_mutex_lock
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	movl	(%rbx), %r12d
	testl	%r12d, %r12d
	je	LBB0_3
## %bb.2:
	leal	-1(%r12), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_8
LBB0_3:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	4(%rbx), %eax
	incl	%eax
	movl	%eax, 4(%rbx)
	cmpl	%eax, %ecx
	jne	LBB0_8
## %bb.4:
	leaq	12(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_sem_wait
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:
	movl	4(%rbx), %eax
	subl	%eax, 8(%rbx)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_sem_post
	testq	%rax, %rax
	jne	LBB0_5
## %bb.7:
	movl	$0, 4(%rbx)
LBB0_8:
	movq	%r15, %rdi
	callq	_pthread_mutex_unlock
	testl	%eax, %eax
	jne	LBB0_12
## %bb.9:
	cmpl	$1, %r12d
	jne	LBB0_11
## %bb.10:
	addq	$12, %rbx
	movq	%rbx, %rdi
	callq	_sem_post
	testq	%rax, %rax
	je	LBB0_11
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_12
LBB0_11:
	movq	8(%r14), %rdi
	callq	_pthread_mutex_lock
	testl	%eax, %eax
	je	LBB0_13
LBB0_12:
	movl	%eax, (%r13)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_errno,4,2                      ## @errno
	.no_dead_strip	_pte_cond_wait_cleanup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pte_cond_wait_cleanup
_pte_cond_wait_cleanup:                 ; @pte_cond_wait_cleanup
	.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
	ldr	x23, [x0, #16]
	ldr	x22, [x0]
	add	x20, x23, #16
	mov	x0, x20
	bl	_pthread_mutex_lock
	cbnz	w0, LBB0_12
; %bb.1:
	ldr	w24, [x23]
	cbz	w24, LBB0_3
; %bb.2:
	sub	w8, w24, #1
	str	w8, [x23]
	b	LBB0_7
LBB0_3:
Lloh0:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #0
	cinc	w8, w8, lt
	ldr	w9, [x23, #4]
	add	w9, w9, #1
	str	w9, [x23, #4]
	cmp	w9, w8, asr #1
	b.ne	LBB0_7
; %bb.4:
	add	x21, x23, #12
	mov	x0, x21
	bl	_sem_wait
	cbnz	x0, LBB0_10
; %bb.5:
	ldp	w8, w9, [x23, #4]
	sub	w8, w9, w8
	str	w8, [x23, #8]
	mov	x0, x21
	bl	_sem_post
	cbnz	x0, LBB0_10
; %bb.6:
	str	wzr, [x23, #4]
LBB0_7:
	mov	x0, x20
	bl	_pthread_mutex_unlock
	cbnz	w0, LBB0_12
; %bb.8:
	cmp	w24, #1
	b.ne	LBB0_11
; %bb.9:
	add	x0, x23, #12
	bl	_sem_post
	cbz	x0, LBB0_11
LBB0_10:
Lloh3:
	adrp	x8, _errno@GOTPAGE
Lloh4:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_12
LBB0_11:
	ldr	x0, [x19, #8]
	bl	_pthread_mutex_lock
	cbz	w0, LBB0_13
LBB0_12:
	str	w0, [x22]
LBB0_13:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_errno,4,2                      ; @errno
	.no_dead_strip	_pte_cond_wait_cleanup
.subsections_via_symbols
