	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___lwp_sema_surrender           ## -- Begin function __lwp_sema_surrender
	.p2align	4, 0x90
___lwp_sema_surrender:                  ## @__lwp_sema_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_LWP_SEMA_SUCCESSFUL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	addq	$16, %rdi
	callq	___lwp_threadqueue_dequeue
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	callq	__CPU_ISR_Disable
	movq	(%rbx), %rax
	cmpq	8(%rbx), %rax
	jle	LBB0_2
## %bb.3:
	movq	_LWP_SEMA_MAXCNT_EXCEEDED@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_4
LBB0_2:
	incq	%rax
	movq	%rax, (%rbx)
LBB0_4:
	callq	__CPU_ISR_Restore
LBB0_5:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LWP_SEMA_SUCCESSFUL,4,2        ## @LWP_SEMA_SUCCESSFUL
	.comm	_LWP_SEMA_MAXCNT_EXCEEDED,4,2   ## @LWP_SEMA_MAXCNT_EXCEEDED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___lwp_sema_surrender           ; -- Begin function __lwp_sema_surrender
	.p2align	2
___lwp_sema_surrender:                  ; @__lwp_sema_surrender
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
Lloh0:
	adrp	x8, _LWP_SEMA_SUCCESSFUL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LWP_SEMA_SUCCESSFUL@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	add	x0, x0, #16
	bl	___lwp_threadqueue_dequeue
	cbnz	x0, LBB0_5
; %bb.1:
	bl	__CPU_ISR_Disable
	ldp	x8, x9, [x20]
	cmp	x8, x9
	b.le	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _LWP_SEMA_MAXCNT_EXCEEDED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LWP_SEMA_MAXCNT_EXCEEDED@GOTPAGEOFF]
Lloh5:
	ldr	w19, [x8]
	b	LBB0_4
LBB0_3:
	add	x8, x8, #1
	str	x8, [x20]
LBB0_4:
	bl	__CPU_ISR_Restore
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_LWP_SEMA_SUCCESSFUL,4,2        ; @LWP_SEMA_SUCCESSFUL
	.comm	_LWP_SEMA_MAXCNT_EXCEEDED,4,2   ; @LWP_SEMA_MAXCNT_EXCEEDED
.subsections_via_symbols
