	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_mutex_unlock           ## -- Begin function pthread_mutex_unlock
	.p2align	4, 0x90
_pthread_mutex_unlock:                  ## @pthread_mutex_unlock
	.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	_PTHREAD_ERRORCHECK_MUTEX_INITIALIZER@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jae	LBB0_5
## %bb.1:
	movq	(%rbx), %rax
	movq	_PTHREAD_MUTEX_NORMAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.2:
	leaq	20(%rbx), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_PTE_ATOMIC_EXCHANGE
	testl	%eax, %eax
	je	LBB0_10
## %bb.3:
	jns	LBB0_12
	jmp	LBB0_4
LBB0_6:
	movq	24(%rbx), %r14
	xorl	%eax, %eax
	callq	_pthread_self
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_pthread_equal
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movq	(%rbx), %rax
	movq	_PTHREAD_MUTEX_RECURSIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	xorl	%r14d, %r14d
	decq	8(%rbx)
	jne	LBB0_12
LBB0_9:
	movq	$0, 24(%rbx)
	leaq	20(%rbx), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_PTE_ATOMIC_EXCHANGE
	testl	%eax, %eax
	jns	LBB0_12
LBB0_4:
	movl	16(%rbx), %edi
	movl	$1, %esi
	callq	_pte_osSemaphorePost
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	je	LBB0_12
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %r14d
LBB0_12:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PTHREAD_ERRORCHECK_MUTEX_INITIALIZER,8,3 ## @PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
	.comm	_PTHREAD_MUTEX_NORMAL,8,3       ## @PTHREAD_MUTEX_NORMAL
	.comm	_PTE_OS_OK,8,3                  ## @PTE_OS_OK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_PTHREAD_MUTEX_RECURSIVE,8,3    ## @PTHREAD_MUTEX_RECURSIVE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_mutex_unlock           ; -- Begin function pthread_mutex_unlock
	.p2align	2
_pthread_mutex_unlock:                  ; @pthread_mutex_unlock
	.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
	ldr	x20, [x0]
Lloh0:
	adrp	x8, _PTHREAD_ERRORCHECK_MUTEX_INITIALIZER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PTHREAD_ERRORCHECK_MUTEX_INITIALIZER@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x20, x8
	b.hs	LBB0_4
; %bb.1:
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _PTHREAD_MUTEX_NORMAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PTHREAD_MUTEX_NORMAL@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	add	x0, x20, #20
	mov	w1, #0
	bl	_PTE_ATOMIC_EXCHANGE
	cbz	w0, LBB0_9
; %bb.3:
	tbz	w0, #31, LBB0_8
	b	LBB0_13
LBB0_4:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_5:
	ldr	x19, [x20, #24]
	bl	_pthread_self
	mov	x1, x0
	mov	x0, x19
	bl	_pthread_equal
	cbz	x0, LBB0_9
; %bb.6:
	ldr	x8, [x20]
Lloh8:
	adrp	x9, _PTHREAD_MUTEX_RECURSIVE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PTHREAD_MUTEX_RECURSIVE@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.7:
	ldr	x8, [x20, #8]
	subs	x8, x8, #1
	str	x8, [x20, #8]
	b.eq	LBB0_12
LBB0_8:
	mov	w0, #0
	b	LBB0_11
LBB0_9:
Lloh11:
	adrp	x8, _EPERM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
LBB0_11:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_12:
	str	xzr, [x20, #24]
	add	x0, x20, #20
	mov	w1, #0
	bl	_PTE_ATOMIC_EXCHANGE
	mov	x8, x0
	mov	w0, #0
	tbz	w8, #31, LBB0_11
LBB0_13:
	ldr	w0, [x20, #16]
	mov	w1, #1
	bl	_pte_osSemaphorePost
Lloh13:
	adrp	x8, _PTE_OS_OK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PTE_OS_OK@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
Lloh16:
	adrp	x9, _EINVAL@GOTPAGE
Lloh17:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	x0, x8
	csel	w0, wzr, w9, eq
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PTHREAD_ERRORCHECK_MUTEX_INITIALIZER,8,3 ; @PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
	.comm	_PTHREAD_MUTEX_NORMAL,8,3       ; @PTHREAD_MUTEX_NORMAL
	.comm	_PTE_OS_OK,8,3                  ; @PTE_OS_OK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_PTHREAD_MUTEX_RECURSIVE,8,3    ; @PTHREAD_MUTEX_RECURSIVE
.subsections_via_symbols
