	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function toshsd_start_cmd
_toshsd_start_cmd:                      ## @toshsd_start_cmd
	.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, %r12
	movq	%rdi, %r14
	movq	16(%rdi), %rdi
	movq	24(%r14), %r13
	movl	(%rsi), %r15d
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_dbg
	movl	(%r12), %eax
	movq	_MMC_STOP_TRANSMISSION@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	movq	_SD_STOPINT_ISSUE_CMD12@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SD_STOPINTERNAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	callq	_iowrite16
	movl	(%r12), %eax
	movq	8(%r12), %rcx
	movl	%eax, (%rcx)
	movq	$0, 4(%rcx)
	movl	$0, 12(%rcx)
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_toshsd_finish_request          ## TAILCALL
LBB0_2:
	movq	%r12, %rdi
	callq	_mmc_resp_type
                                        ## kill: def $eax killed $eax def $rax
	addl	$-128, %eax
	cmpl	$4, %eax
	ja	LBB0_5
## %bb.3:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_4:
	movq	_SD_CMD_RESP_TYPE_EXT_R3@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_5:
	movq	16(%r14), %rbx
	movq	%r12, %rdi
	callq	_mmc_resp_type
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_11
LBB0_6:
	movq	_SD_CMD_RESP_TYPE_EXT_R2@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_7:
	movq	_SD_CMD_RESP_TYPE_EXT_R1B@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	_SD_CMD_RESP_TYPE_EXT_R1@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_9:
	movq	_SD_CMD_RESP_TYPE_NONE@GOTPCREL(%rip), %rax
LBB0_10:
	orl	(%rax), %r15d
LBB0_11:
	movq	%r12, 8(%r14)
	movl	(%r12), %eax
	movq	_MMC_APP_CMD@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	cmpl	(%rdx), %eax
	jne	LBB0_13
## %bb.12:
	movq	_SD_CMD_TYPE_ACMD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_13:
	orl	%r15d, %ecx
	movq	_MMC_GO_IDLE_STATE@GOTPCREL(%rip), %rdx
	movl	%ecx, %ebx
	orl	$768, %ebx                      ## imm = 0x300
	cmpl	(%rdx), %eax
	cmovnel	%ecx, %ebx
	testq	%r13, %r13
	je	LBB0_18
## %bb.14:
	movq	_SD_CMD_DATA_PRESENT@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	cmpl	$2, (%r13)
	jl	LBB0_16
## %bb.15:
	movq	_SD_STOPINT_AUTO_ISSUE_CMD12@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SD_STOPINTERNAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	callq	_iowrite16
	movq	_SD_CMD_MULTI_BLOCK@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
LBB0_16:
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r13)
	je	LBB0_18
## %bb.17:
	movq	_SD_CMD_TRANSFER_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
LBB0_18:
	movl	16(%r12), %edi
	movq	_SD_ARG0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	callq	_iowrite32
	movq	_SD_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_iowrite16                      ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
LJTI0_0:
	.long	L0_0_set_4
	.long	L0_0_set_6
	.long	L0_0_set_7
	.long	L0_0_set_8
	.long	L0_0_set_9
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Command opcode: %d\n"

	.comm	_MMC_STOP_TRANSMISSION,4,2      ## @MMC_STOP_TRANSMISSION
	.comm	_SD_STOPINT_ISSUE_CMD12,4,2     ## @SD_STOPINT_ISSUE_CMD12
	.comm	_SD_STOPINTERNAL,8,3            ## @SD_STOPINTERNAL
	.comm	_SD_CMD_RESP_TYPE_NONE,4,2      ## @SD_CMD_RESP_TYPE_NONE
	.comm	_SD_CMD_RESP_TYPE_EXT_R1,4,2    ## @SD_CMD_RESP_TYPE_EXT_R1
	.comm	_SD_CMD_RESP_TYPE_EXT_R1B,4,2   ## @SD_CMD_RESP_TYPE_EXT_R1B
	.comm	_SD_CMD_RESP_TYPE_EXT_R2,4,2    ## @SD_CMD_RESP_TYPE_EXT_R2
	.comm	_SD_CMD_RESP_TYPE_EXT_R3,4,2    ## @SD_CMD_RESP_TYPE_EXT_R3
L_.str.1:                               ## @.str.1
	.asciz	"Unknown response type %d\n"

	.comm	_MMC_APP_CMD,4,2                ## @MMC_APP_CMD
	.comm	_SD_CMD_TYPE_ACMD,4,2           ## @SD_CMD_TYPE_ACMD
	.comm	_MMC_GO_IDLE_STATE,4,2          ## @MMC_GO_IDLE_STATE
	.comm	_SD_CMD_DATA_PRESENT,4,2        ## @SD_CMD_DATA_PRESENT
	.comm	_SD_STOPINT_AUTO_ISSUE_CMD12,4,2 ## @SD_STOPINT_AUTO_ISSUE_CMD12
	.comm	_SD_CMD_MULTI_BLOCK,4,2         ## @SD_CMD_MULTI_BLOCK
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_SD_CMD_TRANSFER_READ,4,2       ## @SD_CMD_TRANSFER_READ
	.comm	_SD_ARG0,8,3                    ## @SD_ARG0
	.comm	_SD_CMD,8,3                     ## @SD_CMD
	.no_dead_strip	_toshsd_start_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function toshsd_start_cmd
_toshsd_start_cmd:                      ; @toshsd_start_cmd
	.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	x20, x1
	mov	x19, x0
	ldr	w21, [x1]
	ldp	x0, x23, [x0, #16]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	ldr	w8, [x20]
Lloh2:
	adrp	x9, _MMC_STOP_TRANSMISSION@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MMC_STOP_TRANSMISSION@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _SD_STOPINT_ISSUE_CMD12@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SD_STOPINT_ISSUE_CMD12@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldr	x8, [x19]
Lloh8:
	adrp	x9, _SD_STOPINTERNAL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SD_STOPINTERNAL@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite16
	ldr	w8, [x20]
	ldr	x9, [x20, #8]
	stp	w8, wzr, [x9]
	str	xzr, [x9, #8]
	mov	x0, x19
	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
	b	_toshsd_finish_request
LBB0_2:
	mov	x0, x20
	bl	_mmc_resp_type
	sub	w8, w0, #128
	cmp	w8, #4
	b.hi	LBB0_5
; %bb.3:
Lloh11:
	adrp	x9, lJTI0_0@PAGE
Lloh12:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_4
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_4:
Lloh13:
	adrp	x8, _SD_CMD_RESP_TYPE_EXT_R3@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SD_CMD_RESP_TYPE_EXT_R3@GOTPAGEOFF]
	b	LBB0_10
LBB0_5:
	ldr	x22, [x19, #16]
	mov	x0, x20
	bl	_mmc_resp_type
	mov	x2, x0
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	b	LBB0_11
LBB0_6:
Lloh17:
	adrp	x8, _SD_CMD_RESP_TYPE_EXT_R2@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SD_CMD_RESP_TYPE_EXT_R2@GOTPAGEOFF]
	b	LBB0_10
LBB0_7:
Lloh19:
	adrp	x8, _SD_CMD_RESP_TYPE_EXT_R1B@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SD_CMD_RESP_TYPE_EXT_R1B@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
Lloh21:
	adrp	x8, _SD_CMD_RESP_TYPE_EXT_R1@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SD_CMD_RESP_TYPE_EXT_R1@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh23:
	adrp	x8, _SD_CMD_RESP_TYPE_NONE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SD_CMD_RESP_TYPE_NONE@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	orr	w21, w8, w21
LBB0_11:
	str	x20, [x19, #8]
	ldr	w8, [x20]
Lloh25:
	adrp	x9, _MMC_APP_CMD@GOTPAGE
Lloh26:
	ldr	x9, [x9, _MMC_APP_CMD@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
Lloh28:
	adrp	x10, _SD_CMD_TYPE_ACMD@GOTPAGE
Lloh29:
	ldr	x10, [x10, _SD_CMD_TYPE_ACMD@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	cmp	w8, w9
	csel	w9, w10, wzr, eq
	orr	w9, w9, w21
Lloh31:
	adrp	x10, _MMC_GO_IDLE_STATE@GOTPAGE
Lloh32:
	ldr	x10, [x10, _MMC_GO_IDLE_STATE@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
	orr	w11, w9, #0x300
	cmp	w8, w10
	csel	w21, w11, w9, eq
	cbz	x23, LBB0_16
; %bb.12:
Lloh34:
	adrp	x8, _SD_CMD_DATA_PRESENT@GOTPAGE
Lloh35:
	ldr	x8, [x8, _SD_CMD_DATA_PRESENT@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	orr	w21, w8, w21
	ldr	w8, [x23]
	cmp	w8, #2
	b.lt	LBB0_14
; %bb.13:
Lloh37:
	adrp	x8, _SD_STOPINT_AUTO_ISSUE_CMD12@GOTPAGE
Lloh38:
	ldr	x8, [x8, _SD_STOPINT_AUTO_ISSUE_CMD12@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	ldr	x8, [x19]
Lloh40:
	adrp	x9, _SD_STOPINTERNAL@GOTPAGE
Lloh41:
	ldr	x9, [x9, _SD_STOPINTERNAL@GOTPAGEOFF]
Lloh42:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite16
Lloh43:
	adrp	x8, _SD_CMD_MULTI_BLOCK@GOTPAGE
Lloh44:
	ldr	x8, [x8, _SD_CMD_MULTI_BLOCK@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	orr	w21, w8, w21
LBB0_14:
	ldr	w8, [x23, #4]
Lloh46:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh47:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.15:
Lloh49:
	adrp	x8, _SD_CMD_TRANSFER_READ@GOTPAGE
Lloh50:
	ldr	x8, [x8, _SD_CMD_TRANSFER_READ@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	orr	w21, w8, w21
LBB0_16:
	ldr	w0, [x20, #16]
	ldr	x8, [x19]
Lloh52:
	adrp	x9, _SD_ARG0@GOTPAGE
Lloh53:
	ldr	x9, [x9, _SD_ARG0@GOTPAGEOFF]
Lloh54:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x8, [x19]
Lloh55:
	adrp	x9, _SD_CMD@GOTPAGE
Lloh56:
	ldr	x9, [x9, _SD_CMD@GOTPAGEOFF]
Lloh57:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x21
	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
	b	_iowrite16
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_6-LBB0_4)>>2
	.byte	(LBB0_7-LBB0_4)>>2
	.byte	(LBB0_8-LBB0_4)>>2
	.byte	(LBB0_9-LBB0_4)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Command opcode: %d\n"

	.comm	_MMC_STOP_TRANSMISSION,4,2      ; @MMC_STOP_TRANSMISSION
	.comm	_SD_STOPINT_ISSUE_CMD12,4,2     ; @SD_STOPINT_ISSUE_CMD12
	.comm	_SD_STOPINTERNAL,8,3            ; @SD_STOPINTERNAL
	.comm	_SD_CMD_RESP_TYPE_NONE,4,2      ; @SD_CMD_RESP_TYPE_NONE
	.comm	_SD_CMD_RESP_TYPE_EXT_R1,4,2    ; @SD_CMD_RESP_TYPE_EXT_R1
	.comm	_SD_CMD_RESP_TYPE_EXT_R1B,4,2   ; @SD_CMD_RESP_TYPE_EXT_R1B
	.comm	_SD_CMD_RESP_TYPE_EXT_R2,4,2    ; @SD_CMD_RESP_TYPE_EXT_R2
	.comm	_SD_CMD_RESP_TYPE_EXT_R3,4,2    ; @SD_CMD_RESP_TYPE_EXT_R3
l_.str.1:                               ; @.str.1
	.asciz	"Unknown response type %d\n"

	.comm	_MMC_APP_CMD,4,2                ; @MMC_APP_CMD
	.comm	_SD_CMD_TYPE_ACMD,4,2           ; @SD_CMD_TYPE_ACMD
	.comm	_MMC_GO_IDLE_STATE,4,2          ; @MMC_GO_IDLE_STATE
	.comm	_SD_CMD_DATA_PRESENT,4,2        ; @SD_CMD_DATA_PRESENT
	.comm	_SD_STOPINT_AUTO_ISSUE_CMD12,4,2 ; @SD_STOPINT_AUTO_ISSUE_CMD12
	.comm	_SD_CMD_MULTI_BLOCK,4,2         ; @SD_CMD_MULTI_BLOCK
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_SD_CMD_TRANSFER_READ,4,2       ; @SD_CMD_TRANSFER_READ
	.comm	_SD_ARG0,8,3                    ; @SD_ARG0
	.comm	_SD_CMD,8,3                     ; @SD_CMD
	.no_dead_strip	_toshsd_start_cmd
.subsections_via_symbols
