	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __toshsd_set_ios
___toshsd_set_ios:                      ## @__toshsd_set_ios
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	callq	_mmc_priv
	movq	%rax, %r14
	movl	(%r15), %esi
	testl	%esi, %esi
	je	LBB0_7
## %bb.1:
	movq	_HCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %edx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edx, %ebx
	movl	%ecx, %eax
	cltd
	idivl	%ebx
	leal	(%rbx,%rbx), %edx
	cmpl	%eax, %esi
	jl	LBB0_2
## %bb.3:
	movl	%ebx, %r12d
	shrl	$2, %r12d
	movl	8(%r14), %edi
	movq	_SD_PCICFG_CLKMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	$1, %ebx
	jne	LBB0_5
## %bb.4:
	movq	_SD_PCICFG_CLKMODE_DIV_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_pci_write_config_byte
	movq	_SD_CARDCLK_DIV_DISABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	jmp	LBB0_6
LBB0_7:
	movq	_SD_CARDCLOCKCTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	xorl	%edi, %edi
	callq	_iowrite16
	jmp	LBB0_8
LBB0_5:
	xorl	%edx, %edx
	callq	_pci_write_config_byte
LBB0_6:
	movq	_SD_CARDCLK_ENABLE_CLOCK@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movq	_SD_CARDCLOCKCTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movl	%r12d, %edi
	callq	_iowrite16
	movl	$10, %edi
	callq	_mdelay
LBB0_8:
	movl	4(%r15), %eax
	cmpl	$129, %eax
	je	LBB0_11
## %bb.9:
	cmpl	$130, %eax
	jne	LBB0_13
## %bb.10:
	movq	%r14, %rbx
	addq	$8, %rbx
	movl	$1, %r12d
	movq	_SD_PCICFG_PWR1_OFF@GOTPCREL(%rip), %rax
	movq	_SD_PCICFG_POWER1@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_11:
	movq	%r14, %rbx
	addq	$8, %rbx
	movl	8(%r14), %edi
	movq	_SD_PCICFG_POWER1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SD_PCICFG_PWR1_33V@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_pci_write_config_byte
	movl	$20, %r12d
	movq	_SD_PCICFG_PWR2_AUTO@GOTPCREL(%rip), %rax
	movq	_SD_PCICFG_POWER2@GOTPCREL(%rip), %rcx
LBB0_12:
	movl	(%rbx), %edi
	movl	(%rcx), %esi
	movl	(%rax), %edx
	callq	_pci_write_config_byte
	movl	%r12d, %edi
	callq	_mdelay
LBB0_13:
	movl	8(%r15), %eax
	cmpl	$132, %eax
	je	LBB0_14
## %bb.15:
	cmpl	$131, %eax
	jne	LBB0_18
## %bb.16:
	movq	_SD_CARDOPT_DATA_XFR_WIDTH_4@GOTPCREL(%rip), %r15
	jmp	LBB0_17
LBB0_14:
	movq	_SD_CARDOPT_DATA_XFR_WIDTH_1@GOTPCREL(%rip), %r15
LBB0_17:
	movq	_SD_CARDOPT_REQUIRED@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	$14, %edi
	callq	_SD_CARDOPT_DATA_RESP_TIMEOUT
	orl	%eax, %ebx
	movq	_SD_CARDOPT_C2_MODULE_ABSENT@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	orl	(%r15), %ebx
	movq	_SD_CARDOPTIONSETUP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movl	%ebx, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_iowrite16                      ## TAILCALL
LBB0_18:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HCLK,4,2                       ## @HCLK
	.comm	_SD_PCICFG_CLKMODE,4,2          ## @SD_PCICFG_CLKMODE
	.comm	_SD_PCICFG_CLKMODE_DIV_DISABLE,4,2 ## @SD_PCICFG_CLKMODE_DIV_DISABLE
	.comm	_SD_CARDCLK_DIV_DISABLE,4,2     ## @SD_CARDCLK_DIV_DISABLE
	.comm	_SD_CARDCLK_ENABLE_CLOCK,4,2    ## @SD_CARDCLK_ENABLE_CLOCK
	.comm	_SD_CARDCLOCKCTRL,8,3           ## @SD_CARDCLOCKCTRL
	.comm	_SD_PCICFG_POWER1,4,2           ## @SD_PCICFG_POWER1
	.comm	_SD_PCICFG_PWR1_OFF,4,2         ## @SD_PCICFG_PWR1_OFF
	.comm	_SD_PCICFG_PWR1_33V,4,2         ## @SD_PCICFG_PWR1_33V
	.comm	_SD_PCICFG_POWER2,4,2           ## @SD_PCICFG_POWER2
	.comm	_SD_PCICFG_PWR2_AUTO,4,2        ## @SD_PCICFG_PWR2_AUTO
	.comm	_SD_CARDOPT_REQUIRED,4,2        ## @SD_CARDOPT_REQUIRED
	.comm	_SD_CARDOPT_C2_MODULE_ABSENT,4,2 ## @SD_CARDOPT_C2_MODULE_ABSENT
	.comm	_SD_CARDOPT_DATA_XFR_WIDTH_1,4,2 ## @SD_CARDOPT_DATA_XFR_WIDTH_1
	.comm	_SD_CARDOPTIONSETUP,8,3         ## @SD_CARDOPTIONSETUP
	.comm	_SD_CARDOPT_DATA_XFR_WIDTH_4,4,2 ## @SD_CARDOPT_DATA_XFR_WIDTH_4
	.no_dead_strip	___toshsd_set_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __toshsd_set_ios
___toshsd_set_ios:                      ; @__toshsd_set_ios
	.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	x20, x1
	bl	_mmc_priv
	mov	x19, x0
	ldr	w8, [x20]
	cbz	w8, LBB0_5
; %bb.1:
Lloh0:
	adrp	x9, _HCLK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HCLK@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x9]
	mov	w11, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x9, x11
	sdiv	w12, w10, w11
	lsl	w11, w11, #1
	cmp	w8, w12
	b.lt	LBB0_2
; %bb.3:
	lsr	w21, w9, #2
	ldr	w0, [x19, #8]
Lloh3:
	adrp	x8, _SD_PCICFG_CLKMODE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SD_PCICFG_CLKMODE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	cmp	w9, #1
	b.ne	LBB0_6
; %bb.4:
Lloh6:
	adrp	x8, _SD_PCICFG_CLKMODE_DIV_DISABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SD_PCICFG_CLKMODE_DIV_DISABLE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_pci_write_config_byte
Lloh9:
	adrp	x8, _SD_CARDCLK_DIV_DISABLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SD_CARDCLK_DIV_DISABLE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	orr	w21, w8, w21
	b	LBB0_7
LBB0_5:
	ldr	x8, [x19]
Lloh12:
	adrp	x9, _SD_CARDCLOCKCTRL@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SD_CARDCLOCKCTRL@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_iowrite16
	b	LBB0_8
LBB0_6:
	mov	w2, #0
	bl	_pci_write_config_byte
LBB0_7:
Lloh15:
	adrp	x8, _SD_CARDCLK_ENABLE_CLOCK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SD_CARDCLK_ENABLE_CLOCK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w0, w8, w21
	ldr	x8, [x19]
Lloh18:
	adrp	x9, _SD_CARDCLOCKCTRL@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SD_CARDCLOCKCTRL@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite16
	mov	w0, #10
	bl	_mdelay
LBB0_8:
	ldr	w8, [x20, #4]
	cmp	w8, #129
	b.eq	LBB0_11
; %bb.9:
	cmp	w8, #130
	b.ne	LBB0_13
; %bb.10:
	add	x22, x19, #8
	mov	w21, #1
Lloh21:
	adrp	x8, _SD_PCICFG_PWR1_OFF@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SD_PCICFG_PWR1_OFF@GOTPAGEOFF]
Lloh23:
	adrp	x9, _SD_PCICFG_POWER1@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SD_PCICFG_POWER1@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
	mov	x22, x19
	ldr	w0, [x22, #8]!
Lloh25:
	adrp	x8, _SD_PCICFG_POWER1@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SD_PCICFG_POWER1@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _SD_PCICFG_PWR1_33V@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SD_PCICFG_PWR1_33V@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	bl	_pci_write_config_byte
	mov	w21, #20
Lloh31:
	adrp	x8, _SD_PCICFG_PWR2_AUTO@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SD_PCICFG_PWR2_AUTO@GOTPAGEOFF]
Lloh33:
	adrp	x9, _SD_PCICFG_POWER2@GOTPAGE
Lloh34:
	ldr	x9, [x9, _SD_PCICFG_POWER2@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x22]
	ldr	w1, [x9]
	ldr	w2, [x8]
	bl	_pci_write_config_byte
	mov	x0, x21
	bl	_mdelay
LBB0_13:
	ldr	w8, [x20, #8]
	cmp	w8, #132
	b.eq	LBB0_16
; %bb.14:
	cmp	w8, #131
	b.ne	LBB0_18
; %bb.15:
Lloh35:
	adrp	x20, _SD_CARDOPT_DATA_XFR_WIDTH_4@GOTPAGE
Lloh36:
	ldr	x20, [x20, _SD_CARDOPT_DATA_XFR_WIDTH_4@GOTPAGEOFF]
	b	LBB0_17
LBB0_16:
Lloh37:
	adrp	x20, _SD_CARDOPT_DATA_XFR_WIDTH_1@GOTPAGE
Lloh38:
	ldr	x20, [x20, _SD_CARDOPT_DATA_XFR_WIDTH_1@GOTPAGEOFF]
LBB0_17:
Lloh39:
	adrp	x8, _SD_CARDOPT_REQUIRED@GOTPAGE
Lloh40:
	ldr	x8, [x8, _SD_CARDOPT_REQUIRED@GOTPAGEOFF]
Lloh41:
	ldr	w21, [x8]
	mov	w0, #14
	bl	_SD_CARDOPT_DATA_RESP_TIMEOUT
Lloh42:
	adrp	x8, _SD_CARDOPT_C2_MODULE_ABSENT@GOTPAGE
Lloh43:
	ldr	x8, [x8, _SD_CARDOPT_C2_MODULE_ABSENT@GOTPAGEOFF]
	orr	w9, w0, w21
Lloh44:
	ldr	w8, [x8]
	orr	w8, w9, w8
	ldr	w9, [x20]
	orr	w0, w8, w9
	ldr	x8, [x19]
Lloh45:
	adrp	x9, _SD_CARDOPTIONSETUP@GOTPAGE
Lloh46:
	ldr	x9, [x9, _SD_CARDOPTIONSETUP@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	add	x1, x9, x8
	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	_iowrite16
LBB0_18:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_HCLK,4,2                       ; @HCLK
	.comm	_SD_PCICFG_CLKMODE,4,2          ; @SD_PCICFG_CLKMODE
	.comm	_SD_PCICFG_CLKMODE_DIV_DISABLE,4,2 ; @SD_PCICFG_CLKMODE_DIV_DISABLE
	.comm	_SD_CARDCLK_DIV_DISABLE,4,2     ; @SD_CARDCLK_DIV_DISABLE
	.comm	_SD_CARDCLK_ENABLE_CLOCK,4,2    ; @SD_CARDCLK_ENABLE_CLOCK
	.comm	_SD_CARDCLOCKCTRL,8,3           ; @SD_CARDCLOCKCTRL
	.comm	_SD_PCICFG_POWER1,4,2           ; @SD_PCICFG_POWER1
	.comm	_SD_PCICFG_PWR1_OFF,4,2         ; @SD_PCICFG_PWR1_OFF
	.comm	_SD_PCICFG_PWR1_33V,4,2         ; @SD_PCICFG_PWR1_33V
	.comm	_SD_PCICFG_POWER2,4,2           ; @SD_PCICFG_POWER2
	.comm	_SD_PCICFG_PWR2_AUTO,4,2        ; @SD_PCICFG_PWR2_AUTO
	.comm	_SD_CARDOPT_REQUIRED,4,2        ; @SD_CARDOPT_REQUIRED
	.comm	_SD_CARDOPT_C2_MODULE_ABSENT,4,2 ; @SD_CARDOPT_C2_MODULE_ABSENT
	.comm	_SD_CARDOPT_DATA_XFR_WIDTH_1,4,2 ; @SD_CARDOPT_DATA_XFR_WIDTH_1
	.comm	_SD_CARDOPTIONSETUP,8,3         ; @SD_CARDOPTIONSETUP
	.comm	_SD_CARDOPT_DATA_XFR_WIDTH_4,4,2 ; @SD_CARDOPT_DATA_XFR_WIDTH_4
	.no_dead_strip	___toshsd_set_ios
.subsections_via_symbols
