	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_mutex_destroy          ## -- Begin function pthread_mutex_destroy
	.p2align	4, 0x90
_pthread_mutex_destroy:                 ## @pthread_mutex_destroy
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	_PTHREAD_ERRORCHECK_MUTEX_INITIALIZER@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jae	LBB0_8
## %bb.1:
	movq	%rax, -32(%rbp)
	leaq	-32(%rbp), %rdi
	callq	_pthread_mutex_trylock
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.2:
	movq	-32(%rbp), %rax
	movq	(%rax), %rcx
	movq	_PTHREAD_MUTEX_RECURSIVE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_4
## %bb.3:
	movl	8(%rax), %ecx
	cmpl	$1, %ecx
	jne	LBB0_7
LBB0_4:
	movq	$0, (%r14)
	leaq	-32(%rbp), %rdi
	callq	_pthread_mutex_unlock
	movl	%eax, %ebx
	movq	-32(%rbp), %rax
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.6:
	movq	%rax, (%r14)
	jmp	LBB0_12
LBB0_8:
	movq	_pte_mutex_test_init_lock@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_pte_osMutexLock
	movq	(%r14), %rax
	cmpq	(%rbx), %rax
	jae	LBB0_9
## %bb.10:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_9:
	movq	$0, (%r14)
	xorl	%ebx, %ebx
LBB0_11:
	movl	(%r15), %edi
	callq	_pte_osMutexUnlock
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	12(%rax), %edi
	callq	_pte_osSemaphoreDelete
	movq	-32(%rbp), %rdi
	callq	_free
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_7:
	decl	%ecx
	movl	%ecx, 8(%rax)
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_PTHREAD_ERRORCHECK_MUTEX_INITIALIZER,8,3 ## @PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
	.comm	_PTHREAD_MUTEX_RECURSIVE,8,3    ## @PTHREAD_MUTEX_RECURSIVE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_pte_mutex_test_init_lock,4,2   ## @pte_mutex_test_init_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_mutex_destroy          ; -- Begin function pthread_mutex_destroy
	.p2align	2
_pthread_mutex_destroy:                 ; @pthread_mutex_destroy
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x20, _PTHREAD_ERRORCHECK_MUTEX_INITIALIZER@GOTPAGE
Lloh1:
	ldr	x20, [x20, _PTHREAD_ERRORCHECK_MUTEX_INITIALIZER@GOTPAGEOFF]
	ldr	x9, [x20]
	cmp	x8, x9
	b.hs	LBB0_6
; %bb.1:
	str	x8, [sp, #8]
	add	x0, sp, #8
	bl	_pthread_mutex_trylock
	mov	x20, x0
	cbnz	w0, LBB0_10
; %bb.2:
	ldr	x8, [sp, #8]
	ldr	x9, [x8]
Lloh2:
	adrp	x10, _PTHREAD_MUTEX_RECURSIVE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _PTHREAD_MUTEX_RECURSIVE@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_4
; %bb.3:
	ldr	w9, [x8, #8]
	subs	w9, w9, #1
	b.ne	LBB0_12
LBB0_4:
	str	xzr, [x19]
	add	x0, sp, #8
	bl	_pthread_mutex_unlock
	mov	x20, x0
	ldr	x8, [sp, #8]
	cbz	w0, LBB0_11
; %bb.5:
	str	x8, [x19]
	b	LBB0_10
LBB0_6:
Lloh5:
	adrp	x21, _pte_mutex_test_init_lock@GOTPAGE
Lloh6:
	ldr	x21, [x21, _pte_mutex_test_init_lock@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_pte_osMutexLock
	ldr	x8, [x19]
	ldr	x9, [x20]
	cmp	x8, x9
	b.hs	LBB0_8
; %bb.7:
Lloh7:
	adrp	x8, _EBUSY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh9:
	ldr	w20, [x8]
	b	LBB0_9
LBB0_8:
	mov	w20, #0
	str	xzr, [x19]
LBB0_9:
	ldr	w0, [x21]
	bl	_pte_osMutexUnlock
LBB0_10:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
LBB0_11:
	ldr	w0, [x8, #12]
	bl	_pte_osSemaphoreDelete
	ldr	x0, [sp, #8]
	bl	_free
	b	LBB0_10
LBB0_12:
	str	w9, [x8, #8]
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh12:
	ldr	w20, [x8]
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_PTHREAD_ERRORCHECK_MUTEX_INITIALIZER,8,3 ; @PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
	.comm	_PTHREAD_MUTEX_RECURSIVE,8,3    ; @PTHREAD_MUTEX_RECURSIVE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_pte_mutex_test_init_lock,4,2   ; @pte_mutex_test_init_lock
.subsections_via_symbols
