	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function esdhc_execute_tuning
_esdhc_execute_tuning:                  ## @esdhc_execute_tuning
	.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
	movl	%esi, %r13d
	movq	%rdi, %r15
	callq	_mmc_priv
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_sdhci_priv
	movq	%rax, %rdi
	callq	_sdhci_pltfm_priv
	movq	%rax, %r12
	movslq	(%rax), %rax
	imulq	$1431655766, %rax, %rsi         ## imm = 0x55555556
	movq	%rsi, %rax
	shrq	$63, %rax
	shrq	$32, %rsi
	addl	%eax, %esi
	cmpl	%esi, (%rbx)
	jbe	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_esdhc_of_set_clock
LBB0_2:
	cmpq	$0, 16(%r12)
	je	LBB0_5
## %bb.3:
	movq	_SDHCI_HS400_TUNING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rbx)
	je	LBB0_5
## %bb.4:
	movl	(%rbx), %esi
	movq	%rbx, %rdi
	callq	_esdhc_of_set_clock
LBB0_5:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_esdhc_tuning_block_enable
	movq	_SDHCI_HS400_TUNING@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	andl	4(%rbx), %r14d
	movq	%r15, %rdi
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	%r13d, %esi
	callq	_sdhci_execute_tuning
	movl	%eax, %r13d
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.6:
	movq	_ESDHC_SDTIMNGCTL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_sdhci_readl
	movq	_ESDHC_FLW_CTL_BG@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_sdhci_writel
LBB0_7:
	movl	8(%rbx), %eax
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_10
## %bb.8:
	cmpq	$0, 8(%r12)
	je	LBB0_10
## %bb.9:
	movq	_ESDHC_TBPTR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_sdhci_readl
	andl	$-32640, %eax                   ## imm = 0x8080
	movl	4(%r12), %ecx
	leal	(%rcx,%rcx,2), %edx
	shll	$8, %ecx
	leal	(%rcx,%rcx,4), %esi
	orl	%edx, %esi
	orl	%eax, %esi
	movl	(%r14), %edx
	movq	%rbx, %rdi
	callq	_sdhci_writel
	movq	_ESDHC_TBCTL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_sdhci_readl
	orl	$3, %eax
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_sdhci_writel
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_sdhci_execute_tuning
LBB0_10:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDHCI_HS400_TUNING,4,2         ## @SDHCI_HS400_TUNING
	.comm	_ESDHC_SDTIMNGCTL,4,2           ## @ESDHC_SDTIMNGCTL
	.comm	_ESDHC_FLW_CTL_BG,4,2           ## @ESDHC_FLW_CTL_BG
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_ESDHC_TBPTR,4,2                ## @ESDHC_TBPTR
	.comm	_ESDHC_TBCTL,4,2                ## @ESDHC_TBCTL
	.no_dead_strip	_esdhc_execute_tuning
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function esdhc_execute_tuning
_esdhc_execute_tuning:                  ; @esdhc_execute_tuning
	.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
	mov	x20, x0
	bl	_mmc_priv
	mov	x21, x0
	bl	_sdhci_priv
	bl	_sdhci_pltfm_priv
	mov	x22, x0
	ldrsw	x8, [x0]
	mov	w9, #21846
	movk	w9, #21845, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	ldr	w10, [x21]
	add	w1, w8, w9
	cmp	w10, w1
	b.ls	LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_esdhc_of_set_clock
LBB0_2:
	ldr	x8, [x22, #16]
Lloh0:
	adrp	x23, _SDHCI_HS400_TUNING@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SDHCI_HS400_TUNING@GOTPAGEOFF]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	w8, [x21, #4]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	ldr	w1, [x21]
	mov	x0, x21
	bl	_esdhc_of_set_clock
LBB0_5:
	mov	x0, x21
	mov	w1, #1
	bl	_esdhc_tuning_block_enable
	ldr	w8, [x21, #4]
	ldr	w9, [x23]
	and	w24, w9, w8
	mov	x0, x20
	mov	x1, x19
	bl	_sdhci_execute_tuning
	mov	x23, x0
	cbz	w24, LBB0_7
; %bb.6:
Lloh2:
	adrp	x24, _ESDHC_SDTIMNGCTL@GOTPAGE
Lloh3:
	ldr	x24, [x24, _ESDHC_SDTIMNGCTL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x21
	bl	_sdhci_readl
Lloh4:
	adrp	x8, _ESDHC_FLW_CTL_BG@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ESDHC_FLW_CTL_BG@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	orr	w1, w8, w0
	ldr	w2, [x24]
	mov	x0, x21
	bl	_sdhci_writel
LBB0_7:
	ldr	w8, [x21, #8]
Lloh7:
	adrp	x9, _EAGAIN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _EAGAIN@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmn	w8, w9
	b.ne	LBB0_10
; %bb.8:
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_10
; %bb.9:
Lloh10:
	adrp	x24, _ESDHC_TBPTR@GOTPAGE
Lloh11:
	ldr	x24, [x24, _ESDHC_TBPTR@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x21
	bl	_sdhci_readl
	mov	w8, #-32640
	and	w8, w0, w8
	ldr	w9, [x22, #4]
	add	w10, w9, w9, lsl #1
	orr	w8, w10, w8
	add	w9, w9, w9, lsl #2
	orr	w1, w8, w9, lsl #8
	ldr	w2, [x24]
	mov	x0, x21
	bl	_sdhci_writel
Lloh12:
	adrp	x22, _ESDHC_TBCTL@GOTPAGE
Lloh13:
	ldr	x22, [x22, _ESDHC_TBCTL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_sdhci_readl
	orr	w1, w0, #0x3
	ldr	w2, [x22]
	mov	x0, x21
	bl	_sdhci_writel
	mov	x0, x20
	mov	x1, x19
	bl	_sdhci_execute_tuning
LBB0_10:
	mov	x0, x23
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_SDHCI_HS400_TUNING,4,2         ; @SDHCI_HS400_TUNING
	.comm	_ESDHC_SDTIMNGCTL,4,2           ; @ESDHC_SDTIMNGCTL
	.comm	_ESDHC_FLW_CTL_BG,4,2           ; @ESDHC_FLW_CTL_BG
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_ESDHC_TBPTR,4,2                ; @ESDHC_TBPTR
	.comm	_ESDHC_TBCTL,4,2                ; @ESDHC_TBCTL
	.no_dead_strip	_esdhc_execute_tuning
.subsections_via_symbols
