	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_spin_lock              ## -- Begin function pthread_spin_lock
	.p2align	4, 0x90
_pthread_spin_lock:                     ## @pthread_spin_lock
	.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
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.1:
	movq	%rdi, %r14
	movq	(%rdi), %r15
	testq	%r15, %r15
	je	LBB0_9
## %bb.2:
	movq	_PTHREAD_SPINLOCK_INITIALIZER@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	je	LBB0_3
LBB0_5:
	movq	_PTE_SPIN_LOCKED@GOTPCREL(%rip), %r14
	movq	_PTE_SPIN_UNLOCKED@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rbx
	movl	(%r12), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_PTE_ATOMIC_COMPARE_EXCHANGE
	cmpq	%rax, %rbx
	je	LBB0_6
## %bb.7:
	movq	(%r15), %rcx
	xorl	%eax, %eax
	cmpq	(%r14), %rcx
	je	LBB0_10
## %bb.8:
	movq	_PTE_SPIN_USE_MUTEX@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_9
## %bb.11:
	addq	$8, %r15
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pthread_mutex_lock             ## TAILCALL
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r14, %rdi
	callq	_pte_spinlock_check_need_init
	testl	%eax, %eax
	jne	LBB0_10
## %bb.4:
	movq	(%r14), %r15
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PTHREAD_SPINLOCK_INITIALIZER,8,3 ## @PTHREAD_SPINLOCK_INITIALIZER
	.comm	_PTE_SPIN_LOCKED,8,3            ## @PTE_SPIN_LOCKED
	.comm	_PTE_SPIN_UNLOCKED,4,2          ## @PTE_SPIN_UNLOCKED
	.comm	_PTE_SPIN_USE_MUTEX,8,3         ## @PTE_SPIN_USE_MUTEX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_spin_lock              ; -- Begin function pthread_spin_lock
	.p2align	2
_pthread_spin_lock:                     ; @pthread_spin_lock
	.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_11
; %bb.1:
	mov	x20, x0
	ldr	x19, [x0]
	cbz	x19, LBB0_11
; %bb.2:
Lloh0:
	adrp	x8, _PTHREAD_SPINLOCK_INITIALIZER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PTHREAD_SPINLOCK_INITIALIZER@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x19, x8
	b.eq	LBB0_7
LBB0_3:
Lloh3:
	adrp	x21, _PTE_SPIN_LOCKED@GOTPAGE
Lloh4:
	ldr	x21, [x21, _PTE_SPIN_LOCKED@GOTPAGEOFF]
Lloh5:
	adrp	x22, _PTE_SPIN_UNLOCKED@GOTPAGE
Lloh6:
	ldr	x22, [x22, _PTE_SPIN_UNLOCKED@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x20, [x21]
	ldr	w2, [x22]
	mov	x0, x19
	mov	x1, x20
	bl	_PTE_ATOMIC_COMPARE_EXCHANGE
	cmp	x20, x0
	b.eq	LBB0_4
; %bb.5:
	ldr	x8, [x19]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.6:
	mov	w0, #0
	b	LBB0_12
LBB0_7:
	mov	x0, x20
	bl	_pte_spinlock_check_need_init
	cbnz	w0, LBB0_12
; %bb.8:
	ldr	x19, [x20]
	b	LBB0_3
LBB0_9:
Lloh7:
	adrp	x9, _PTE_SPIN_USE_MUTEX@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PTE_SPIN_USE_MUTEX@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
	add	x0, x19, #8
	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
	b	_pthread_mutex_lock
LBB0_11:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
LBB0_12:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PTHREAD_SPINLOCK_INITIALIZER,8,3 ; @PTHREAD_SPINLOCK_INITIALIZER
	.comm	_PTE_SPIN_LOCKED,8,3            ; @PTE_SPIN_LOCKED
	.comm	_PTE_SPIN_UNLOCKED,4,2          ; @PTE_SPIN_UNLOCKED
	.comm	_PTE_SPIN_USE_MUTEX,8,3         ; @PTE_SPIN_USE_MUTEX
.subsections_via_symbols
