	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_spinlock
_init_spinlock:                         ## @init_spinlock
	.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
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	__get_curthread
	movq	%rax, %rbx
	movq	_spinlock_static_lock@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	callq	_THR_UMUTEX_LOCK
	cmpq	$0, (%r14)
	jne	LBB0_3
## %bb.1:
	movq	_spinlock_count@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	_MAX_SPINLOCKS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jae	LBB0_3
## %bb.2:
	movq	_extra@GOTPCREL(%rip), %r12
	shlq	$4, %rax
	movq	(%r12), %rcx
	addq	%rax, %rcx
	movq	%rcx, (%r14)
	movq	(%r12), %rcx
	leaq	(%rcx,%rax), %rdi
	addq	$8, %rdi
	callq	__thr_umutex_init
	movq	(%r12), %rax
	movq	(%r15), %rcx
	movq	%rcx, %rdx
	shlq	$4, %rdx
	movq	%r14, (%rax,%rdx)
	incq	%rcx
	movq	%rcx, (%r15)
LBB0_3:
	movq	_spinlock_static_lock@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_THR_UMUTEX_UNLOCK
	cmpq	$0, (%r14)
	je	LBB0_5
## %bb.4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str(%rip), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PANIC                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_spinlock_static_lock,4,2       ## @spinlock_static_lock
	.comm	_spinlock_count,8,3             ## @spinlock_count
	.comm	_MAX_SPINLOCKS,8,3              ## @MAX_SPINLOCKS
	.comm	_extra,8,3                      ## @extra
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning: exceeded max spinlocks"

	.no_dead_strip	_init_spinlock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_spinlock
_init_spinlock:                         ; @init_spinlock
	.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
	mov	x19, x0
	bl	__get_curthread
	mov	x20, x0
Lloh0:
	adrp	x1, _spinlock_static_lock@GOTPAGE
Lloh1:
	ldr	x1, [x1, _spinlock_static_lock@GOTPAGEOFF]
	bl	_THR_UMUTEX_LOCK
	ldr	x8, [x19]
	cbnz	x8, LBB0_3
; %bb.1:
Lloh2:
	adrp	x21, _spinlock_count@GOTPAGE
Lloh3:
	ldr	x21, [x21, _spinlock_count@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh4:
	adrp	x9, _MAX_SPINLOCKS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MAX_SPINLOCKS@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.hs	LBB0_3
; %bb.2:
Lloh7:
	adrp	x22, _extra@GOTPAGE
Lloh8:
	ldr	x22, [x22, _extra@GOTPAGEOFF]
	ldr	x9, [x22]
	lsl	x8, x8, #4
	add	x9, x9, x8
	str	x9, [x19]
	ldr	x9, [x22]
	add	x8, x9, x8
	add	x0, x8, #8
	bl	__thr_umutex_init
	ldr	x8, [x22]
	ldr	x9, [x21]
	lsl	x10, x9, #4
	str	x19, [x8, x10]
	add	x8, x9, #1
	str	x8, [x21]
LBB0_3:
Lloh9:
	adrp	x1, _spinlock_static_lock@GOTPAGE
Lloh10:
	ldr	x1, [x1, _spinlock_static_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_THR_UMUTEX_UNLOCK
	ldr	x8, [x19]
	cbz	x8, LBB0_5
; %bb.4:
	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_5:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	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	_PANIC
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_spinlock_static_lock,4,2       ; @spinlock_static_lock
	.comm	_spinlock_count,8,3             ; @spinlock_count
	.comm	_MAX_SPINLOCKS,8,3              ; @MAX_SPINLOCKS
	.comm	_extra,8,3                      ; @extra
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning: exceeded max spinlocks"

	.no_dead_strip	_init_spinlock
.subsections_via_symbols
