	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___lwp_mutex_surrender          ## -- Begin function __lwp_mutex_surrender
	.p2align	4, 0x90
___lwp_mutex_surrender:                 ## @__lwp_mutex_surrender
	.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	%rdi, %rbx
	movq	24(%rdi), %r15
	cmpq	$0, 16(%rdi)
	je	LBB0_3
## %bb.1:
	movq	%r15, %rdi
	callq	___lwp_thread_isexec
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movl	(%rbx), %eax
	movq	_LWP_MUTEX_SUCCESSFUL@GOTPCREL(%rip), %r12
	testl	%eax, %eax
	je	LBB0_21
## %bb.4:
	leaq	8(%rbx), %r14
	decl	%eax
	movl	%eax, (%rbx)
	je	LBB0_8
## %bb.5:
	movl	(%r14), %eax
	cmpl	$130, %eax
	je	LBB0_21
## %bb.6:
	cmpl	$128, %eax
	jne	LBB0_8
## %bb.7:
	movq	_LWP_MUTEX_NEST_NOTALLOWED@GOTPCREL(%rip), %r12
	jmp	LBB0_21
LBB0_8:
	movq	%r14, %rdi
	callq	___lwp_mutex_isinheritprio
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	___lwp_mutex_isprioceiling
	testq	%rax, %rax
	je	LBB0_11
LBB0_10:
	decq	(%r15)
LBB0_11:
	movq	$0, 24(%rbx)
	movq	%r14, %rdi
	callq	___lwp_mutex_isinheritprio
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	callq	___lwp_mutex_isprioceiling
	testq	%rax, %rax
	je	LBB0_16
LBB0_13:
	cmpq	$0, (%r15)
	jne	LBB0_16
## %bb.14:
	movq	8(%r15), %rsi
	cmpq	16(%r15), %rsi
	je	LBB0_16
## %bb.15:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	___lwp_thread_changepriority
LBB0_16:
	leaq	32(%rbx), %rdi
	callq	___lwp_threadqueue_dequeue
	testq	%rax, %rax
	je	LBB0_20
## %bb.17:
	movq	%rax, %r15
	movl	$1, (%rbx)
	movq	%rax, 24(%rbx)
	movq	%r14, %rdi
	callq	___lwp_mutex_isinheritprio
	testq	%rax, %rax
	jne	LBB0_19
## %bb.18:
	movq	%r14, %rdi
	callq	___lwp_mutex_isprioceiling
	testq	%rax, %rax
	je	LBB0_21
LBB0_19:
	incq	(%r15)
	jmp	LBB0_21
LBB0_2:
	movq	_LWP_MUTEX_NOTOWNER@GOTPCREL(%rip), %r12
	jmp	LBB0_21
LBB0_20:
	movq	_LWP_MUTEX_UNLOCKED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
LBB0_21:
	movl	(%r12), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LWP_MUTEX_NOTOWNER,4,2         ## @LWP_MUTEX_NOTOWNER
	.comm	_LWP_MUTEX_SUCCESSFUL,4,2       ## @LWP_MUTEX_SUCCESSFUL
	.comm	_LWP_MUTEX_NEST_NOTALLOWED,4,2  ## @LWP_MUTEX_NEST_NOTALLOWED
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_LWP_MUTEX_UNLOCKED,4,2         ## @LWP_MUTEX_UNLOCKED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___lwp_mutex_surrender          ; -- Begin function __lwp_mutex_surrender
	.p2align	2
___lwp_mutex_surrender:                 ; @__lwp_mutex_surrender
	.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, x0
	ldp	x8, x21, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	___lwp_thread_isexec
	cbz	w0, LBB0_19
LBB0_2:
	ldr	w8, [x19]
	cbz	w8, LBB0_21
; %bb.3:
	add	x20, x19, #8
	subs	w8, w8, #1
	str	w8, [x19]
	b.eq	LBB0_7
; %bb.4:
	ldr	w8, [x20]
	cmp	w8, #130
	b.eq	LBB0_21
; %bb.5:
	cmp	w8, #128
	b.ne	LBB0_7
; %bb.6:
Lloh0:
	adrp	x8, _LWP_MUTEX_NEST_NOTALLOWED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LWP_MUTEX_NEST_NOTALLOWED@GOTPAGEOFF]
	b	LBB0_22
LBB0_7:
	mov	x0, x20
	bl	___lwp_mutex_isinheritprio
	cbnz	x0, LBB0_9
; %bb.8:
	mov	x0, x20
	bl	___lwp_mutex_isprioceiling
	cbz	x0, LBB0_10
LBB0_9:
	ldr	x8, [x21]
	sub	x8, x8, #1
	str	x8, [x21]
LBB0_10:
	str	xzr, [x19, #24]
	mov	x0, x20
	bl	___lwp_mutex_isinheritprio
	cbnz	x0, LBB0_12
; %bb.11:
	mov	x0, x20
	bl	___lwp_mutex_isprioceiling
	cbz	x0, LBB0_15
LBB0_12:
	ldr	x8, [x21]
	cbnz	x8, LBB0_15
; %bb.13:
	ldp	x1, x8, [x21, #8]
	cmp	x1, x8
	b.eq	LBB0_15
; %bb.14:
Lloh2:
	adrp	x8, _TRUE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x21
	bl	___lwp_thread_changepriority
LBB0_15:
	add	x0, x19, #32
	bl	___lwp_threadqueue_dequeue
	cbz	x0, LBB0_20
; %bb.16:
	mov	x21, x0
	mov	w8, #1
	str	w8, [x19]
	str	x0, [x19, #24]
	mov	x0, x20
	bl	___lwp_mutex_isinheritprio
	cbnz	x0, LBB0_18
; %bb.17:
	mov	x0, x20
	bl	___lwp_mutex_isprioceiling
	cbz	x0, LBB0_21
LBB0_18:
	ldr	x8, [x21]
	add	x8, x8, #1
	str	x8, [x21]
	b	LBB0_21
LBB0_19:
Lloh5:
	adrp	x8, _LWP_MUTEX_NOTOWNER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LWP_MUTEX_NOTOWNER@GOTPAGEOFF]
	b	LBB0_22
LBB0_20:
Lloh7:
	adrp	x8, _LWP_MUTEX_UNLOCKED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _LWP_MUTEX_UNLOCKED@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x19, #4]
LBB0_21:
Lloh10:
	adrp	x8, _LWP_MUTEX_SUCCESSFUL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _LWP_MUTEX_SUCCESSFUL@GOTPAGEOFF]
LBB0_22:
	ldr	w0, [x8]
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_LWP_MUTEX_NOTOWNER,4,2         ; @LWP_MUTEX_NOTOWNER
	.comm	_LWP_MUTEX_SUCCESSFUL,4,2       ; @LWP_MUTEX_SUCCESSFUL
	.comm	_LWP_MUTEX_NEST_NOTALLOWED,4,2  ; @LWP_MUTEX_NEST_NOTALLOWED
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_LWP_MUTEX_UNLOCKED,4,2         ; @LWP_MUTEX_UNLOCKED
.subsections_via_symbols
