	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tifm_sd_ios
_tifm_sd_ios:                           ## @tifm_sd_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	%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
	callq	_mmc_priv
	movq	%rax, %r14
	movq	16(%rax), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	leaq	16(%r15), %rdi
	movl	20(%r12), %ecx
	movl	(%r12), %edx
	movl	4(%r12), %r8d
	movl	16(%r12), %r9d
	movl	12(%r12), %eax
	movl	8(%r12), %ebx
	leaq	L_.str(%rip), %rsi
	pushq	%rbx
	pushq	%rax
	callq	_dev_dbg
	addq	$16, %rsp
	movl	8(%r12), %eax
	movq	_MMC_BUS_WIDTH_4@GOTPCREL(%rip), %rcx
	movq	_TIFM_MMCSD_4BBUS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	leaq	8(%r15), %r13
	movq	_SOCK_MMCSD_CONFIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	callq	_readl
	movl	%eax, %edi
	orl	%ebx, %edi
	jmp	LBB0_3
LBB0_2:
	notl	%ebx
	leaq	8(%r15), %r13
	movq	_SOCK_MMCSD_CONFIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	callq	_readl
	movl	%eax, %edi
	andl	%ebx, %edi
LBB0_3:
	movq	_SOCK_MMCSD_CONFIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r13), %rsi
	callq	_writel
	movl	(%r12), %edi
	testl	%edi, %edi
	je	LBB0_8
## %bb.4:
	movl	$20000000, %eax                 ## imm = 0x1312D00
	xorl	%edx, %edx
	idivl	%edi
	movl	%eax, %ecx
	testl	%eax, %eax
	movl	$1, %ebx
	cmovel	%ebx, %ecx
	movl	$24000000, %eax                 ## imm = 0x16E3600
	xorl	%edx, %edx
	idivl	%edi
	movl	%eax, %esi
	testl	%eax, %eax
	cmovel	%ebx, %esi
	movl	$20000000, %eax                 ## imm = 0x1312D00
	xorl	%edx, %edx
	divl	%ecx
	cmpl	%eax, %edi
	adcl	$0, %ecx
	movl	$24000000, %eax                 ## imm = 0x16E3600
	xorl	%edx, %edx
	divl	%esi
	cmpl	%eax, %edi
	adcl	$0, %esi
	movl	$20000000, %eax                 ## imm = 0x1312D00
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %edi
	movl	$24000000, %eax                 ## imm = 0x16E3600
	xorl	%edx, %edx
	divl	%esi
	cmpl	%eax, %edi
	jbe	LBB0_6
## %bb.5:
	movl	$20000000, (%r14)               ## imm = 0x1312D00
	movl	%ecx, 4(%r14)
	movq	_TIFM_CTRL_FAST_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	notl	%ebx
	movq	_SOCK_CONTROL@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	8(%r15), %rdi
	callq	_readl
	andl	%eax, %ebx
	jmp	LBB0_7
LBB0_8:
	movl	$0, 4(%r14)
	jmp	LBB0_9
LBB0_6:
	movl	$24000000, (%r14)               ## imm = 0x16E3600
	movl	%esi, 4(%r14)
	movq	_TIFM_CTRL_FAST_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_SOCK_CONTROL@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	8(%r15), %rdi
	callq	_readl
	orl	%eax, %ebx
LBB0_7:
	movq	(%r13), %rsi
	addq	8(%r15), %rsi
	movl	%ebx, %edi
	callq	_writel
LBB0_9:
	movq	_TIFM_MMCSD_CLKMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	4(%r14), %r13d
	andl	%ebx, %r13d
	movl	%r13d, 4(%r14)
	notl	%ebx
	movq	_SOCK_MMCSD_CONFIG@GOTPCREL(%rip), %rax
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %r14
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	callq	_readl
	andl	%eax, %ebx
	orl	%r13d, %ebx
	movq	(%r14), %rsi
	addq	8(%r15), %rsi
	movl	%ebx, %edi
	callq	_writel
	movl	4(%r12), %eax
	movq	_MMC_BUSMODE_OPENDRAIN@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpl	(%rcx), %eax
	sete	%dl
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%edx, 8(%rax)
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ios: clock = %u, vdd = %x, bus_mode = %x, chip_select = %x, power_mode = %x, bus_width = %x\n"

	.comm	_MMC_BUS_WIDTH_4,4,2            ## @MMC_BUS_WIDTH_4
	.comm	_TIFM_MMCSD_4BBUS,4,2           ## @TIFM_MMCSD_4BBUS
	.comm	_SOCK_MMCSD_CONFIG,8,3          ## @SOCK_MMCSD_CONFIG
	.comm	_TIFM_CTRL_FAST_CLK,4,2         ## @TIFM_CTRL_FAST_CLK
	.comm	_SOCK_CONTROL,8,3               ## @SOCK_CONTROL
	.comm	_TIFM_MMCSD_CLKMASK,4,2         ## @TIFM_MMCSD_CLKMASK
	.comm	_MMC_BUSMODE_OPENDRAIN,4,2      ## @MMC_BUSMODE_OPENDRAIN
	.no_dead_strip	_tifm_sd_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tifm_sd_ios
_tifm_sd_ios:                           ; @tifm_sd_ios
	.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
	bl	_mmc_priv
	mov	x20, x0
	ldr	x21, [x0, #16]
	mov	x0, x21
	bl	_spin_lock_irqsave
	add	x0, x21, #16
	ldp	w2, w4, [x19]
	ldp	w5, w3, [x19, #16]
	ldp	w7, w6, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x19, #8]
Lloh2:
	adrp	x9, _MMC_BUS_WIDTH_4@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MMC_BUS_WIDTH_4@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _TIFM_MMCSD_4BBUS@GOTPAGE
Lloh6:
	ldr	x10, [x10, _TIFM_MMCSD_4BBUS@GOTPAGEOFF]
Lloh7:
	ldr	w24, [x10]
Lloh8:
	adrp	x22, _SOCK_MMCSD_CONFIG@GOTPAGE
Lloh9:
	ldr	x22, [x22, _SOCK_MMCSD_CONFIG@GOTPAGEOFF]
	mov	x23, x21
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x23, #8]!
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	orr	w0, w0, w24
	b	LBB0_3
LBB0_2:
	ldr	x8, [x23, #8]!
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	bic	w0, w0, w24
LBB0_3:
	ldr	x8, [x23]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
	ldr	w10, [x19]
	cbz	w10, LBB0_6
; %bb.4:
	mov	w8, #13824
	movk	w8, #366, lsl #16
	mov	w9, #11520
	movk	w9, #305, lsl #16
	sdiv	w11, w9, w10
	cmp	w11, #0
	csinc	w11, w11, wzr, ne
	sdiv	w12, w8, w10
	cmp	w12, #0
	csinc	w12, w12, wzr, ne
	udiv	w13, w9, w11
	cmp	w13, w10
	cinc	w11, w11, hi
	udiv	w13, w8, w12
	cmp	w13, w10
	cinc	w10, w12, hi
	udiv	w12, w9, w11
	udiv	w13, w8, w10
	cmp	w12, w13
	b.ls	LBB0_7
; %bb.5:
	stp	w9, w11, [x20]
Lloh10:
	adrp	x8, _TIFM_CTRL_FAST_CLK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TIFM_CTRL_FAST_CLK@GOTPAGEOFF]
Lloh12:
	ldr	w23, [x8]
	ldr	x8, [x21, #8]
Lloh13:
	adrp	x24, _SOCK_CONTROL@GOTPAGE
Lloh14:
	ldr	x24, [x24, _SOCK_CONTROL@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	bic	w0, w0, w23
	b	LBB0_8
LBB0_6:
	str	wzr, [x20, #4]
	b	LBB0_9
LBB0_7:
	stp	w8, w10, [x20]
Lloh15:
	adrp	x8, _TIFM_CTRL_FAST_CLK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TIFM_CTRL_FAST_CLK@GOTPAGEOFF]
Lloh17:
	ldr	w23, [x8]
	ldr	x8, [x21, #8]
Lloh18:
	adrp	x24, _SOCK_CONTROL@GOTPAGE
Lloh19:
	ldr	x24, [x24, _SOCK_CONTROL@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	orr	w0, w0, w23
LBB0_8:
	ldr	x8, [x21, #8]
	ldr	x9, [x24]
	add	x1, x9, x8
	bl	_writel
LBB0_9:
Lloh20:
	adrp	x8, _TIFM_MMCSD_CLKMASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TIFM_MMCSD_CLKMASK@GOTPAGEOFF]
Lloh22:
	ldr	w23, [x8]
	ldr	w8, [x20, #4]
	and	w24, w8, w23
	str	w24, [x20, #4]
	ldr	x8, [x21, #8]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	bic	w8, w0, w23
	orr	w0, w8, w24
	ldr	x8, [x21, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
Lloh23:
	adrp	x8, _MMC_BUSMODE_OPENDRAIN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MMC_BUSMODE_OPENDRAIN@GOTPAGEOFF]
	ldr	w9, [x19, #4]
Lloh25:
	ldr	w8, [x8]
	cmp	w9, w8
	cset	w8, eq
	str	w8, [x20, #8]
	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	_spin_unlock_irqrestore
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ios: clock = %u, vdd = %x, bus_mode = %x, chip_select = %x, power_mode = %x, bus_width = %x\n"

	.comm	_MMC_BUS_WIDTH_4,4,2            ; @MMC_BUS_WIDTH_4
	.comm	_TIFM_MMCSD_4BBUS,4,2           ; @TIFM_MMCSD_4BBUS
	.comm	_SOCK_MMCSD_CONFIG,8,3          ; @SOCK_MMCSD_CONFIG
	.comm	_TIFM_CTRL_FAST_CLK,4,2         ; @TIFM_CTRL_FAST_CLK
	.comm	_SOCK_CONTROL,8,3               ; @SOCK_CONTROL
	.comm	_TIFM_MMCSD_CLKMASK,4,2         ; @TIFM_MMCSD_CLKMASK
	.comm	_MMC_BUSMODE_OPENDRAIN,4,2      ; @MMC_BUSMODE_OPENDRAIN
	.no_dead_strip	_tifm_sd_ios
.subsections_via_symbols
