	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_spin_destroy           ## -- Begin function pthread_spin_destroy
	.p2align	4, 0x90
_pthread_spin_destroy:                  ## @pthread_spin_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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r15
	movq	(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_2
## %bb.3:
	movq	_PTHREAD_SPINLOCK_INITIALIZER@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %r14
	je	LBB0_10
## %bb.4:
	movq	(%r14), %rax
	movq	_PTE_SPIN_USE_MUTEX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	leaq	8(%r14), %rdi
	callq	_pthread_mutex_destroy
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_14
	jmp	LBB0_9
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_pte_spinlock_test_init_lock@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_pte_osMutexLock
	movq	(%r15), %rax
	cmpq	(%rbx), %rax
	je	LBB0_11
## %bb.12:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_13
LBB0_6:
	movq	_PTE_SPIN_UNLOCKED@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_PTE_OBJECT_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_PTE_ATOMIC_COMPARE_EXCHANGE
	cmpq	%rax, %rbx
	je	LBB0_9
## %bb.7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	jne	LBB0_14
LBB0_9:
	movq	$0, (%r15)
	movq	%r14, %rdi
	callq	_free
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_11:
	movq	$0, (%r15)
	xorl	%ebx, %ebx
LBB0_13:
	movl	(%r14), %edi
	callq	_pte_osMutexUnlock
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PTHREAD_SPINLOCK_INITIALIZER,8,3 ## @PTHREAD_SPINLOCK_INITIALIZER
	.comm	_PTE_SPIN_USE_MUTEX,8,3         ## @PTE_SPIN_USE_MUTEX
	.comm	_PTE_SPIN_UNLOCKED,8,3          ## @PTE_SPIN_UNLOCKED
	.comm	_PTE_OBJECT_INVALID,8,3         ## @PTE_OBJECT_INVALID
	.comm	_pte_spinlock_test_init_lock,4,2 ## @pte_spinlock_test_init_lock
	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_spin_destroy           ; -- Begin function pthread_spin_destroy
	.p2align	2
_pthread_spin_destroy:                  ; @pthread_spin_destroy
	.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
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	ldr	x20, [x0]
	cbz	x20, LBB0_5
; %bb.2:
Lloh0:
	adrp	x21, _PTHREAD_SPINLOCK_INITIALIZER@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PTHREAD_SPINLOCK_INITIALIZER@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x20, x8
	b.eq	LBB0_7
; %bb.3:
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _PTE_SPIN_USE_MUTEX@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PTE_SPIN_USE_MUTEX@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.4:
	add	x0, x20, #8
	bl	_pthread_mutex_destroy
	mov	x21, x0
	cbnz	w21, LBB0_6
	b	LBB0_11
LBB0_5:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w21, [x8]
LBB0_6:
	mov	x0, x21
	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
LBB0_7:
Lloh8:
	adrp	x20, _pte_spinlock_test_init_lock@GOTPAGE
Lloh9:
	ldr	x20, [x20, _pte_spinlock_test_init_lock@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_pte_osMutexLock
	ldr	x8, [x19]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.8:
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh12:
	ldr	w21, [x8]
	b	LBB0_13
LBB0_9:
Lloh13:
	adrp	x8, _PTE_SPIN_UNLOCKED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PTE_SPIN_UNLOCKED@GOTPAGEOFF]
Lloh15:
	ldr	x21, [x8]
Lloh16:
	adrp	x8, _PTE_OBJECT_INVALID@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PTE_OBJECT_INVALID@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_PTE_ATOMIC_COMPARE_EXCHANGE
	cmp	x21, x0
	b.eq	LBB0_11
; %bb.10:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w21, [x8]
	cbnz	w21, LBB0_6
LBB0_11:
	str	xzr, [x19]
	mov	x0, x20
	bl	_free
	mov	w21, #0
	b	LBB0_6
LBB0_12:
	mov	w21, #0
	str	xzr, [x19]
LBB0_13:
	ldr	w0, [x20]
	bl	_pte_osMutexUnlock
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PTHREAD_SPINLOCK_INITIALIZER,8,3 ; @PTHREAD_SPINLOCK_INITIALIZER
	.comm	_PTE_SPIN_USE_MUTEX,8,3         ; @PTE_SPIN_USE_MUTEX
	.comm	_PTE_SPIN_UNLOCKED,8,3          ; @PTE_SPIN_UNLOCKED
	.comm	_PTE_OBJECT_INVALID,8,3         ; @PTE_OBJECT_INVALID
	.comm	_pte_spinlock_test_init_lock,4,2 ; @pte_spinlock_test_init_lock
	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
