	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cw1200_spi_lock
_cw1200_spi_lock:                       ## @cw1200_spi_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
	movq	%rdi, %r15
	movq	_wait@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DECLARE_WAITQUEUE
	xorl	%eax, %eax
	callq	_might_sleep
	leaq	4(%r15), %r14
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_add_wait_queue
	leaq	8(%r15), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	_TASK_UNINTERRUPTIBLE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_set_current_state
	cmpl	$0, (%r15)
	je	LBB0_3
## %bb.1:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	callq	_schedule
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	jmp	LBB0_2
LBB0_3:
	movq	_TASK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_current_state
	movl	$1, (%r15)
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	_wait@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_remove_wait_queue              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_wait,4,2                       ## @wait
	.comm	_current,4,2                    ## @current
	.comm	_TASK_UNINTERRUPTIBLE,4,2       ## @TASK_UNINTERRUPTIBLE
	.comm	_TASK_RUNNING,4,2               ## @TASK_RUNNING
	.no_dead_strip	_cw1200_spi_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cw1200_spi_lock
_cw1200_spi_lock:                       ; @cw1200_spi_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
	mov	x19, x0
Lloh0:
	adrp	x21, _wait@GOTPAGE
Lloh1:
	ldr	x21, [x21, _wait@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _current@GOTPAGE
Lloh3:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_DECLARE_WAITQUEUE
	bl	_might_sleep
	add	x20, x19, #4
	mov	x0, x20
	mov	x1, x21
	bl	_add_wait_queue
	add	x21, x19, #8
	mov	x0, x21
	bl	_spin_lock_irqsave
Lloh5:
	adrp	x22, _TASK_UNINTERRUPTIBLE@GOTPAGE
Lloh6:
	ldr	x22, [x22, _TASK_UNINTERRUPTIBLE@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	bl	_set_current_state
	ldr	w8, [x19]
	cbz	w8, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	bl	_schedule
	mov	x0, x21
	bl	_spin_lock_irqsave
	b	LBB0_1
LBB0_3:
Lloh7:
	adrp	x8, _TASK_RUNNING@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TASK_RUNNING@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_set_current_state
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
Lloh10:
	adrp	x1, _wait@GOTPAGE
Lloh11:
	ldr	x1, [x1, _wait@GOTPAGEOFF]
	mov	x0, x20
	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	_remove_wait_queue
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_wait,4,2                       ; @wait
	.comm	_current,4,2                    ; @current
	.comm	_TASK_UNINTERRUPTIBLE,4,2       ; @TASK_UNINTERRUPTIBLE
	.comm	_TASK_RUNNING,4,2               ; @TASK_RUNNING
	.no_dead_strip	_cw1200_spi_lock
.subsections_via_symbols
