	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.3:
	movq	(%rdi), %r13
	movq	_THR_PSHARED_PTR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	je	LBB0_4
## %bb.5:
	testq	%r13, %r13
	je	LBB0_1
LBB0_6:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	__get_curthread
	movq	%rax, %r14
	movq	_SPIN_COUNT@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_THR_UMUTEX_TRYLOCK
	testq	%rax, %rax
	je	LBB0_2
## %bb.7:
	movq	__thr_is_smp@GOTPCREL(%rip), %r15
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	(%r12), %ebx
LBB0_15:                                ##   in Loop: Header=BB0_8 Depth=1
	xorl	%eax, %eax
	callq	__pthread_yield
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%r13)
	je	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$0, (%r15)
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$1, %ebx
	jle	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	decl	%ebx
	jmp	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_THR_UMUTEX_TRYLOCK
	testq	%rax, %rax
	jne	LBB0_8
## %bb.10:
	xorl	%r15d, %r15d
	jmp	LBB0_2
LBB0_4:
	xorl	%esi, %esi
	callq	___thr_pshared_offpage
	movq	%rax, %r13
	testq	%r13, %r13
	jne	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_2:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_THR_PSHARED_PTR,8,3            ## @THR_PSHARED_PTR
	.comm	_SPIN_COUNT,4,2                 ## @SPIN_COUNT
	.comm	__thr_is_smp,4,2                ## @_thr_is_smp
	.comm	_CPU_SPINWAIT,4,2               ## @CPU_SPINWAIT
.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	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cbz	x0, LBB0_13
; %bb.1:
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _THR_PSHARED_PTR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _THR_PSHARED_PTR@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x19, x8
	b.eq	LBB0_12
; %bb.2:
	cbz	x19, LBB0_13
LBB0_3:
	bl	__get_curthread
	mov	x20, x0
Lloh3:
	adrp	x21, _SPIN_COUNT@GOTPAGE
Lloh4:
	ldr	x21, [x21, _SPIN_COUNT@GOTPAGEOFF]
	ldr	w22, [x21]
	mov	x1, x19
	bl	_THR_UMUTEX_TRYLOCK
	cbz	x0, LBB0_14
; %bb.4:
Lloh5:
	adrp	x23, __thr_is_smp@GOTPAGE
Lloh6:
	ldr	x23, [x23, __thr_is_smp@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_THR_UMUTEX_TRYLOCK
	cbz	x0, LBB0_14
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	x8, [x19]
	cbnz	x8, LBB0_9
	b	LBB0_5
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=2
	bl	__pthread_yield
	ldr	x8, [x19]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	cbz	x8, LBB0_5
LBB0_9:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w9, [x23]
	cbz	w9, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	subs	w22, w22, #1
	b.gt	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	w22, [x21]
	b	LBB0_7
LBB0_12:
	mov	w1, #0
	bl	___thr_pshared_offpage
	mov	x19, x0
	cbnz	x19, LBB0_3
LBB0_13:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
LBB0_14:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_THR_PSHARED_PTR,8,3            ; @THR_PSHARED_PTR
	.comm	_SPIN_COUNT,4,2                 ; @SPIN_COUNT
	.comm	__thr_is_smp,4,2                ; @_thr_is_smp
	.comm	_CPU_SPINWAIT,4,2               ; @CPU_SPINWAIT
.subsections_via_symbols
