	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function toshsd_thread_irq
_toshsd_thread_irq:                     ## @toshsd_thread_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	48(%rsi), %r13
	testq	%r13, %r13
	je	LBB0_1
## %bb.3:
	leaq	32(%rbx), %r14
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	callq	_sg_miter_next
	testl	%eax, %eax
	je	LBB0_8
## %bb.4:
	movq	16(%rbx), %rdi
	movq	32(%rbx), %r12
	movl	40(%rbx), %eax
	movl	(%r13), %r15d
	movl	4(%r13), %ecx
	cmpl	%r15d, %eax
	cmovll	%eax, %r15d
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_dbg
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movq	_SD_DATAPORT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	addq	8(%rbx), %rdi
	movl	(%rax), %eax
	movl	%r15d, %edx
	sarl	$2, %edx
	testl	%eax, 4(%r13)
	je	LBB0_6
## %bb.5:
	movq	%r12, %rsi
	callq	_ioread32_rep
	jmp	LBB0_7
LBB0_1:
	movq	16(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movq	24(%rbx), %rax
	movq	_IRQ_NONE@GOTPCREL(%rip), %r14
	testq	%rax, %rax
	je	LBB0_9
## %bb.2:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	subl	(%rcx), %edx
	movl	%edx, (%rax)
	movq	%rbx, %rdi
	callq	_toshsd_finish_request
	jmp	LBB0_9
LBB0_6:
	movq	%r12, %rsi
	callq	_iowrite32_rep
LBB0_7:
	movl	%r15d, 44(%rbx)
	movq	%r14, %rdi
	callq	_sg_miter_stop
LBB0_8:
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %r14
LBB0_9:
	movl	(%r14), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Spurious Data IRQ\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_IRQ_NONE,4,2                   ## @IRQ_NONE
L_.str.1:                               ## @.str.1
	.asciz	"count: %08x, flags %08x\n"

	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_SD_DATAPORT,8,3                ## @SD_DATAPORT
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_toshsd_thread_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function toshsd_thread_irq
_toshsd_thread_irq:                     ; @toshsd_thread_irq
	.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
	mov	x19, x1
	ldr	x23, [x1, #48]
	cbz	x23, LBB0_4
; %bb.1:
	add	x20, x19, #32
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	_sg_miter_next
	cbz	w0, LBB0_9
; %bb.2:
	ldr	x22, [x19, #32]
	ldr	w8, [x19, #40]
	ldp	w9, w3, [x23]
	cmp	w8, w9
	csel	w21, w8, w9, lt
	ldr	x0, [x19, #16]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	ldr	w8, [x23, #4]
Lloh2:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	ldr	x10, [x19, #8]
Lloh5:
	adrp	x11, _SD_DATAPORT@GOTPAGE
Lloh6:
	ldr	x11, [x11, _SD_DATAPORT@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x11]
	add	x0, x11, x10
	asr	w2, w21, #2
	mov	x1, x22
	tst	w9, w8
	b.eq	LBB0_7
; %bb.3:
	bl	_ioread32_rep
	b	LBB0_8
LBB0_4:
	ldr	x0, [x19, #16]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_6
; %bb.5:
Lloh10:
	adrp	x9, _EIO@GOTPAGE
Lloh11:
	ldr	x9, [x9, _EIO@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	neg	w9, w9
	str	w9, [x8]
	mov	x0, x19
	bl	_toshsd_finish_request
LBB0_6:
Lloh13:
	adrp	x8, _IRQ_NONE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IRQ_NONE@GOTPAGEOFF]
	b	LBB0_10
LBB0_7:
	bl	_iowrite32_rep
LBB0_8:
	str	w21, [x19, #44]
	mov	x0, x20
	bl	_sg_miter_stop
LBB0_9:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
Lloh15:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Spurious Data IRQ\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
l_.str.1:                               ; @.str.1
	.asciz	"count: %08x, flags %08x\n"

	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_SD_DATAPORT,8,3                ; @SD_DATAPORT
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_toshsd_thread_irq
.subsections_via_symbols
