	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function toshsd_cmd_irq
_toshsd_cmd_irq:                        ## @toshsd_cmd_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_8
## %bb.1:
	movq	16(%r14), %r15
	movq	$0, 24(%rbx)
	movl	(%r14), %eax
	movq	_MMC_RSP_PRESENT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.2:
	movq	_MMC_RSP_136@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movl	$255, 48(%r15)
	movq	_SD_RESPONSE0@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread16
	movzbl	%al, %ecx
	movl	%ecx, 52(%r15)
	sarl	$8, %eax
	movl	%eax, 56(%r15)
	movq	_SD_RESPONSE1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread16
	movzbl	%al, %ecx
	movl	%ecx, 60(%r15)
	sarl	$8, %eax
	movl	%eax, 32(%r15)
	movq	_SD_RESPONSE2@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread16
	movzbl	%al, %ecx
	movl	%ecx, 36(%r15)
	sarl	$8, %eax
	movl	%eax, 40(%r15)
	movq	_SD_RESPONSE3@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread16
	movzbl	%al, %ecx
	movl	%ecx, 44(%r15)
	sarl	$8, %eax
	movl	%eax, 16(%r15)
	movq	_SD_RESPONSE4@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread16
	movzbl	%al, %ecx
	movl	%ecx, 20(%r15)
	sarl	$8, %eax
	movl	%eax, 24(%r15)
	movq	_SD_RESPONSE5@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread16
	movzbl	%al, %ecx
	movl	%ecx, 28(%r15)
	sarl	$8, %eax
	movl	%eax, (%r15)
	movq	_SD_RESPONSE6@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread16
	movzbl	%al, %ecx
	movl	%ecx, 4(%r15)
	sarl	$8, %eax
	movl	%eax, 8(%r15)
	movq	_SD_RESPONSE7@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread16
	movzbl	%al, %eax
	jmp	LBB0_5
LBB0_8:
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
LBB0_4:
	movq	_SD_RESPONSE0@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread16
	movzbl	%al, %ecx
	movl	%ecx, (%r15)
	sarl	$8, %eax
	movl	%eax, 4(%r15)
	movq	_SD_RESPONSE1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread16
	movzbl	%al, %ecx
	movl	%ecx, 8(%r15)
	sarl	$8, %eax
LBB0_5:
	movl	%eax, 12(%r15)
LBB0_6:
	movq	8(%rbx), %rdi
	movl	8(%r14), %edx
	movl	(%r14), %r8d
	movl	4(%r14), %ecx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	cmpq	$0, (%rbx)
	je	LBB0_9
## %bb.7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_toshsd_finish_request          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Spurious CMD irq\n"

	.comm	_MMC_RSP_PRESENT,4,2            ## @MMC_RSP_PRESENT
	.comm	_MMC_RSP_136,4,2                ## @MMC_RSP_136
	.comm	_SD_RESPONSE0,8,3               ## @SD_RESPONSE0
	.comm	_SD_RESPONSE1,8,3               ## @SD_RESPONSE1
	.comm	_SD_RESPONSE2,8,3               ## @SD_RESPONSE2
	.comm	_SD_RESPONSE3,8,3               ## @SD_RESPONSE3
	.comm	_SD_RESPONSE4,8,3               ## @SD_RESPONSE4
	.comm	_SD_RESPONSE5,8,3               ## @SD_RESPONSE5
	.comm	_SD_RESPONSE6,8,3               ## @SD_RESPONSE6
	.comm	_SD_RESPONSE7,8,3               ## @SD_RESPONSE7
L_.str.1:                               ## @.str.1
	.asciz	"Command IRQ complete %d %d %x\n"

	.no_dead_strip	_toshsd_cmd_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function toshsd_cmd_irq
_toshsd_cmd_irq:                        ; @toshsd_cmd_irq
	.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
	ldr	x20, [x0, #24]
	cbz	x20, LBB0_4
; %bb.1:
	ldr	x21, [x20, #16]
	str	xzr, [x19, #24]
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _MMC_RSP_PRESENT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_RSP_PRESENT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.2:
Lloh3:
	adrp	x9, _MMC_RSP_136@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MMC_RSP_136@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:
	mov	w8, #255
	str	w8, [x21, #48]
	ldr	x8, [x19, #16]
Lloh6:
	adrp	x9, _SD_RESPONSE0@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SD_RESPONSE0@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread16
	and	w8, w0, #0xff
	asr	w9, w0, #8
	stp	w8, w9, [x21, #52]
	ldr	x8, [x19, #16]
Lloh9:
	adrp	x9, _SD_RESPONSE1@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SD_RESPONSE1@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread16
	and	w8, w0, #0xff
	str	w8, [x21, #60]
	asr	w8, w0, #8
	str	w8, [x21, #32]
	ldr	x8, [x19, #16]
Lloh12:
	adrp	x9, _SD_RESPONSE2@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SD_RESPONSE2@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread16
	and	w8, w0, #0xff
	asr	w9, w0, #8
	stp	w8, w9, [x21, #36]
	ldr	x8, [x19, #16]
Lloh15:
	adrp	x9, _SD_RESPONSE3@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SD_RESPONSE3@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread16
	and	w8, w0, #0xff
	str	w8, [x21, #44]
	asr	w8, w0, #8
	str	w8, [x21, #16]
	ldr	x8, [x19, #16]
Lloh18:
	adrp	x9, _SD_RESPONSE4@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SD_RESPONSE4@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread16
	and	w8, w0, #0xff
	asr	w9, w0, #8
	stp	w8, w9, [x21, #20]
	ldr	x8, [x19, #16]
Lloh21:
	adrp	x9, _SD_RESPONSE5@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SD_RESPONSE5@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread16
	and	w8, w0, #0xff
	str	w8, [x21, #28]
	asr	w8, w0, #8
	str	w8, [x21]
	ldr	x8, [x19, #16]
Lloh24:
	adrp	x9, _SD_RESPONSE6@GOTPAGE
Lloh25:
	ldr	x9, [x9, _SD_RESPONSE6@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread16
	and	w8, w0, #0xff
	asr	w9, w0, #8
	stp	w8, w9, [x21, #4]
	ldr	x8, [x19, #16]
Lloh27:
	adrp	x9, _SD_RESPONSE7@GOTPAGE
Lloh28:
	ldr	x9, [x9, _SD_RESPONSE7@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread16
	and	w8, w0, #0xff
	b	LBB0_6
LBB0_4:
	ldr	x0, [x19, #8]
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, 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	_dev_warn
LBB0_5:
	ldr	x8, [x19, #16]
Lloh32:
	adrp	x9, _SD_RESPONSE0@GOTPAGE
Lloh33:
	ldr	x9, [x9, _SD_RESPONSE0@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread16
	and	w8, w0, #0xff
	asr	w9, w0, #8
	stp	w8, w9, [x21]
	ldr	x8, [x19, #16]
Lloh35:
	adrp	x9, _SD_RESPONSE1@GOTPAGE
Lloh36:
	ldr	x9, [x9, _SD_RESPONSE1@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread16
	and	w8, w0, #0xff
	str	w8, [x21, #8]
	asr	w8, w0, #8
LBB0_6:
	str	w8, [x21, #12]
LBB0_7:
	ldr	x0, [x19, #8]
	ldp	w3, w2, [x20, #4]
	ldr	w4, [x20]
Lloh38:
	adrp	x1, l_.str.1@PAGE
Lloh39:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	ldr	x8, [x19]
	cbz	x8, LBB0_9
; %bb.8:
	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_9:
	mov	x0, x19
	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	_toshsd_finish_request
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Spurious CMD irq\n"

	.comm	_MMC_RSP_PRESENT,4,2            ; @MMC_RSP_PRESENT
	.comm	_MMC_RSP_136,4,2                ; @MMC_RSP_136
	.comm	_SD_RESPONSE0,8,3               ; @SD_RESPONSE0
	.comm	_SD_RESPONSE1,8,3               ; @SD_RESPONSE1
	.comm	_SD_RESPONSE2,8,3               ; @SD_RESPONSE2
	.comm	_SD_RESPONSE3,8,3               ; @SD_RESPONSE3
	.comm	_SD_RESPONSE4,8,3               ; @SD_RESPONSE4
	.comm	_SD_RESPONSE5,8,3               ; @SD_RESPONSE5
	.comm	_SD_RESPONSE6,8,3               ; @SD_RESPONSE6
	.comm	_SD_RESPONSE7,8,3               ; @SD_RESPONSE7
l_.str.1:                               ; @.str.1
	.asciz	"Command IRQ complete %d %d %x\n"

	.no_dead_strip	_toshsd_cmd_irq
.subsections_via_symbols
