	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spi_intr
_spi_intr:                              ## @spi_intr
	.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
	movq	%rdi, %rbx
	leaq	32(%rdi), %r14
	movq	%r14, %rdi
	callq	_mtx_lock
	movl	(%rbx), %r15d
	movq	_ECSPI_STATREG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_RD4
	movl	%eax, %r12d
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_WR4
	movq	_SREG_RO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	%r12d, %edi
	callq	___predict_false
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	cmpl	$0, 4(%rbx)
	jne	LBB0_3
## %bb.2:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
LBB0_3:
	movl	8(%rbx), %ecx
	movl	36(%rbx), %edi
	movl	40(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_device_printf
LBB0_4:
	movl	$0, (%rbx)
	movq	%rbx, %rdi
	callq	_wakeup
	jmp	LBB0_19
LBB0_5:
	movq	_SREG_RR@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_spi_empty_rxfifo
LBB0_7:
	movq	_SREG_TDR@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	_spi_fill_txfifo
LBB0_9:
	movq	8(%rbx), %rax
	cmpq	16(%rbx), %rax
	jne	LBB0_15
## %bb.10:
	movq	_SREG_TC@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_13
## %bb.11:
	cmpq	$0, 24(%rbx)
	je	LBB0_12
LBB0_13:
	movq	_SREG_TE@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_15
## %bb.14:
	movq	_INTREG_TEEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rbx), %eax
	movl	%eax, (%rbx)
	movq	_INTREG_TCEN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_INTREG_RREN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_15
LBB0_12:
	movl	$0, (%rbx)
	movq	%rbx, %rdi
	callq	_wakeup
LBB0_15:
	movl	(%rbx), %edx
	cmpl	%r15d, %edx
	je	LBB0_17
## %bb.16:
	movq	_ECSPI_INTREG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_WR4
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_RD4
LBB0_17:
	cmpl	$3, 4(%rbx)
	jl	LBB0_19
## %bb.18:
	movl	(%rbx), %r8d
	movl	36(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_19:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtx_unlock                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ECSPI_STATREG,4,2              ## @ECSPI_STATREG
	.comm	_SREG_RO,4,2                    ## @SREG_RO
	.comm	_bootverbose,8,3                ## @bootverbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rxoverflow rxidx %u txidx %u\n"

	.comm	_SREG_RR,4,2                    ## @SREG_RR
	.comm	_SREG_TDR,4,2                   ## @SREG_TDR
	.comm	_SREG_TC,4,2                    ## @SREG_TC
	.comm	_SREG_TE,4,2                    ## @SREG_TE
	.comm	_INTREG_TEEN,4,2                ## @INTREG_TEEN
	.comm	_INTREG_TCEN,4,2                ## @INTREG_TCEN
	.comm	_INTREG_RREN,4,2                ## @INTREG_RREN
	.comm	_ECSPI_INTREG,4,2               ## @ECSPI_INTREG
L_.str.1:                               ## @.str.1
	.asciz	"spi_intr, sreg 0x%08x intreg was 0x%08x now 0x%08x\n"

	.no_dead_strip	_spi_intr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spi_intr
_spi_intr:                              ; @spi_intr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	add	x19, x0, #32
	mov	x0, x19
	bl	_mtx_lock
	ldr	w21, [x20]
Lloh0:
	adrp	x23, _ECSPI_STATREG@GOTPAGE
Lloh1:
	ldr	x23, [x23, _ECSPI_STATREG@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_RD4
	mov	x22, x0
	ldr	w1, [x23]
	mov	x0, x20
	mov	x2, x22
	bl	_WR4
Lloh2:
	adrp	x8, _SREG_RO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SREG_RO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	and	w0, w8, w22
	bl	___predict_false
	cbz	x0, LBB0_5
; %bb.1:
	ldr	w8, [x20, #4]
	cbnz	w8, LBB0_3
; %bb.2:
Lloh5:
	adrp	x8, _bootverbose@GOTPAGE
Lloh6:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
LBB0_3:
	ldp	w0, w2, [x20, #36]
	ldr	w3, [x20, #8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
LBB0_4:
	str	wzr, [x20]
	mov	x0, x20
	bl	_wakeup
	b	LBB0_19
LBB0_5:
Lloh10:
	adrp	x8, _SREG_RR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SREG_RR@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_spi_empty_rxfifo
LBB0_7:
Lloh13:
	adrp	x8, _SREG_TDR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SREG_TDR@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_spi_fill_txfifo
LBB0_9:
	ldp	x8, x9, [x20, #8]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.10:
Lloh16:
	adrp	x8, _SREG_TC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SREG_TC@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_12
; %bb.11:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_14
LBB0_12:
Lloh19:
	adrp	x8, _SREG_TE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SREG_TE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_15
; %bb.13:
	ldr	w8, [x20]
Lloh22:
	adrp	x9, _INTREG_TEEN@GOTPAGE
Lloh23:
	ldr	x9, [x9, _INTREG_TEEN@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	and	w8, w9, w8
	str	w8, [x20]
Lloh25:
	adrp	x9, _INTREG_TCEN@GOTPAGE
Lloh26:
	ldr	x9, [x9, _INTREG_TCEN@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
Lloh28:
	adrp	x10, _INTREG_RREN@GOTPAGE
Lloh29:
	ldr	x10, [x10, _INTREG_RREN@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	orr	w8, w9, w8
	orr	w8, w8, w10
	str	w8, [x20]
	b	LBB0_15
LBB0_14:
	str	wzr, [x20]
	mov	x0, x20
	bl	_wakeup
LBB0_15:
	ldr	w2, [x20]
	cmp	w2, w21
	b.eq	LBB0_17
; %bb.16:
Lloh31:
	adrp	x23, _ECSPI_INTREG@GOTPAGE
Lloh32:
	ldr	x23, [x23, _ECSPI_INTREG@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_WR4
	ldr	w1, [x23]
	mov	x0, x20
	bl	_RD4
LBB0_17:
	ldr	w8, [x20, #4]
	cmp	w8, #3
	b.lt	LBB0_19
; %bb.18:
	ldr	w0, [x20, #36]
	ldr	w8, [x20]
	str	x8, [sp]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	mov	x3, x21
	bl	_device_printf
LBB0_19:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_mtx_unlock
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_ECSPI_STATREG,4,2              ; @ECSPI_STATREG
	.comm	_SREG_RO,4,2                    ; @SREG_RO
	.comm	_bootverbose,8,3                ; @bootverbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rxoverflow rxidx %u txidx %u\n"

	.comm	_SREG_RR,4,2                    ; @SREG_RR
	.comm	_SREG_TDR,4,2                   ; @SREG_TDR
	.comm	_SREG_TC,4,2                    ; @SREG_TC
	.comm	_SREG_TE,4,2                    ; @SREG_TE
	.comm	_INTREG_TEEN,4,2                ; @INTREG_TEEN
	.comm	_INTREG_TCEN,4,2                ; @INTREG_TCEN
	.comm	_INTREG_RREN,4,2                ; @INTREG_RREN
	.comm	_ECSPI_INTREG,4,2               ; @ECSPI_INTREG
l_.str.1:                               ; @.str.1
	.asciz	"spi_intr, sreg 0x%08x intreg was 0x%08x now 0x%08x\n"

	.no_dead_strip	_spi_intr
.subsections_via_symbols
