	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sunxi_mmc_irq
_sunxi_mmc_irq:                         ## @sunxi_mmc_irq
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	16(%rsi), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	movq	_REG_IDST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mmc_readl
	movl	%eax, %r14d
	movq	_REG_MISTA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mmc_readl
	movl	%eax, %r12d
	movl	12(%rbx), %edi
	callq	_mmc_dev
	movq	24(%rbx), %rdx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r12d, %ecx
	movl	%r14d, %r8d
	callq	_dev_dbg
	movq	24(%rbx), %rsi
	movb	$1, %r13b
	testq	%rsi, %rsi
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_10
## %bb.1:
	movq	_SDXC_IDMAC_RECEIVE_INTERRUPT@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_3
## %bb.2:
	movl	$0, (%rbx)
LBB0_3:
	movl	4(%rbx), %eax
	orl	%r12d, %eax
	movl	%eax, 4(%rbx)
	movq	_SDXC_RESP_TIMEOUT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.4:
	movq	_SDXC_COMMAND_DONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_5
LBB0_6:
	movq	_SDXC_INTERRUPT_ERROR_BIT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	xorl	%r13d, %r13d
	jmp	LBB0_10
LBB0_8:
	movq	_SDXC_INTERRUPT_DONE_BIT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.9:
	cmpl	$0, (%rbx)
	setne	%r13b
	jmp	LBB0_10
LBB0_5:
	movq	_REG_IMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	8(%rbx), %edx
	movq	%rbx, %rdi
	callq	_mmc_writel
LBB0_10:
	movq	_SDXC_SDIO_INTERRUPT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_REG_RINTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_mmc_writel
	movq	_REG_IDST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_mmc_writel
	testb	%r13b, %r13b
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_12
## %bb.11:
	movq	%rbx, %rdi
	callq	_sunxi_mmc_finalize_request
	movq	%rax, %r14
LBB0_12:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	testb	%r13b, %r13b
	jne	LBB0_15
## %bb.13:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_15
## %bb.14:
	movl	12(%rbx), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_mmc_request_done
LBB0_15:
	testl	%r12d, %r15d
	je	LBB0_17
## %bb.16:
	movl	12(%rbx), %edi
	callq	_mmc_signal_sdio_irq
LBB0_17:
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IRQ_HANDLED,8,3                ## @IRQ_HANDLED
	.comm	_REG_IDST,4,2                   ## @REG_IDST
	.comm	_REG_MISTA,4,2                  ## @REG_MISTA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"irq: rq %p mi %08x idi %08x\n"

	.comm	_SDXC_IDMAC_RECEIVE_INTERRUPT,4,2 ## @SDXC_IDMAC_RECEIVE_INTERRUPT
	.comm	_SDXC_RESP_TIMEOUT,4,2          ## @SDXC_RESP_TIMEOUT
	.comm	_SDXC_COMMAND_DONE,4,2          ## @SDXC_COMMAND_DONE
	.comm	_REG_IMASK,4,2                  ## @REG_IMASK
	.comm	_SDXC_INTERRUPT_ERROR_BIT,4,2   ## @SDXC_INTERRUPT_ERROR_BIT
	.comm	_SDXC_INTERRUPT_DONE_BIT,4,2    ## @SDXC_INTERRUPT_DONE_BIT
	.comm	_SDXC_SDIO_INTERRUPT,4,2        ## @SDXC_SDIO_INTERRUPT
	.comm	_REG_RINTR,4,2                  ## @REG_RINTR
	.no_dead_strip	_sunxi_mmc_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sunxi_mmc_irq
_sunxi_mmc_irq:                         ; @sunxi_mmc_irq
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
Lloh0:
	adrp	x25, _IRQ_HANDLED@GOTPAGE
Lloh1:
	ldr	x25, [x25, _IRQ_HANDLED@GOTPAGEOFF]
	ldr	x20, [x25]
	add	x21, x1, #16
	mov	x0, x21
	bl	_spin_lock
Lloh2:
	adrp	x26, _REG_IDST@GOTPAGE
Lloh3:
	ldr	x26, [x26, _REG_IDST@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x19
	bl	_mmc_readl
	mov	x24, x0
Lloh4:
	adrp	x8, _REG_MISTA@GOTPAGE
Lloh5:
	ldr	x8, [x8, _REG_MISTA@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mmc_readl
	mov	x22, x0
	ldr	w0, [x19, #12]
	bl	_mmc_dev
	ldr	x2, [x19, #24]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x22
	mov	x4, x24
	bl	_dev_dbg
	ldr	x23, [x19, #24]
	cbz	x23, LBB0_10
; %bb.1:
Lloh9:
	adrp	x8, _SDXC_IDMAC_RECEIVE_INTERRUPT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SDXC_IDMAC_RECEIVE_INTERRUPT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_3
; %bb.2:
	str	wzr, [x19]
LBB0_3:
	ldr	w8, [x19, #4]
	orr	w8, w8, w22
	str	w8, [x19, #4]
Lloh12:
	adrp	x9, _SDXC_RESP_TIMEOUT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SDXC_RESP_TIMEOUT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh15:
	adrp	x9, _SDXC_COMMAND_DONE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SDXC_COMMAND_DONE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
LBB0_5:
Lloh18:
	adrp	x9, _SDXC_INTERRUPT_ERROR_BIT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SDXC_INTERRUPT_ERROR_BIT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	mov	w27, #0
	b	LBB0_11
LBB0_7:
Lloh21:
	adrp	x9, _SDXC_INTERRUPT_DONE_BIT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SDXC_INTERRUPT_DONE_BIT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.8:
	ldr	w8, [x19]
	cmp	w8, #0
	cset	w27, ne
	b	LBB0_11
LBB0_9:
Lloh24:
	adrp	x8, _REG_IMASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _REG_IMASK@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	ldr	w8, [x19, #8]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_mmc_writel
LBB0_10:
	mov	w27, #1
LBB0_11:
Lloh27:
	adrp	x8, _SDXC_SDIO_INTERRUPT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SDXC_SDIO_INTERRUPT@GOTPAGEOFF]
Lloh29:
	ldr	w28, [x8]
Lloh30:
	adrp	x8, _REG_RINTR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _REG_RINTR@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_mmc_writel
	ldr	w1, [x26]
	mov	x0, x19
	mov	x2, x24
	bl	_mmc_writel
	tbnz	w27, #0, LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_sunxi_mmc_finalize_request
	mov	x20, x0
LBB0_13:
	and	w22, w28, w22
	mov	x0, x21
	bl	_spin_unlock
	tbnz	w27, #0, LBB0_16
; %bb.14:
	ldr	x8, [x25]
	cmp	x20, x8
	b.ne	LBB0_16
; %bb.15:
	ldr	w0, [x19, #12]
	mov	x1, x23
	bl	_mmc_request_done
LBB0_16:
	cbz	w22, LBB0_18
; %bb.17:
	ldr	w0, [x19, #12]
	bl	_mmc_signal_sdio_irq
LBB0_18:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_IRQ_HANDLED,8,3                ; @IRQ_HANDLED
	.comm	_REG_IDST,4,2                   ; @REG_IDST
	.comm	_REG_MISTA,4,2                  ; @REG_MISTA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"irq: rq %p mi %08x idi %08x\n"

	.comm	_SDXC_IDMAC_RECEIVE_INTERRUPT,4,2 ; @SDXC_IDMAC_RECEIVE_INTERRUPT
	.comm	_SDXC_RESP_TIMEOUT,4,2          ; @SDXC_RESP_TIMEOUT
	.comm	_SDXC_COMMAND_DONE,4,2          ; @SDXC_COMMAND_DONE
	.comm	_REG_IMASK,4,2                  ; @REG_IMASK
	.comm	_SDXC_INTERRUPT_ERROR_BIT,4,2   ; @SDXC_INTERRUPT_ERROR_BIT
	.comm	_SDXC_INTERRUPT_DONE_BIT,4,2    ; @SDXC_INTERRUPT_DONE_BIT
	.comm	_SDXC_SDIO_INTERRUPT,4,2        ; @SDXC_SDIO_INTERRUPT
	.comm	_REG_RINTR,4,2                  ; @REG_RINTR
	.no_dead_strip	_sunxi_mmc_irq
.subsections_via_symbols
