	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xenon_emmc_phy_config_tuning
_xenon_emmc_phy_config_tuning:          ## @xenon_emmc_phy_config_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
	movq	%rdi, %rbx
	callq	_sdhci_priv
	movq	%rax, %rdi
	callq	_sdhci_pltfm_priv
	movq	(%rbx), %rcx
	movq	_MMC_HIGH_52_MAX_DTR@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jle	LBB0_1
## %bb.2:
	movq	(%rax), %r15
	movq	%rbx, %rdi
	callq	_xenon_emmc_phy_enable_dll
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movq	_XENON_SLOT_DLL_CUR_DLY_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sdhci_readl
	cltd
	idivl	(%r15)
	movl	%eax, %r14d
	movq	_XENON_TUNING_STEP_MASK@GOTPCREL(%rip), %r12
	xorl	%edi, %edi
	cmpl	(%r12), %eax
	setg	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	8(%rbx), %edi
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r14d, %edx
	callq	_dev_warn
	movl	(%r12), %r14d
LBB0_5:
	movq	_XENON_SLOT_OP_STATUS_CTRL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_sdhci_readl
	movq	_XENON_TUN_CONSECUTIVE_TIMES_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_XENON_TUN_CONSECUTIVE_TIMES_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movl	4(%r15), %esi
	shll	%cl, %esi
	notl	%edx
	andl	%eax, %edx
	movl	(%r12), %eax
	movq	_XENON_TUNING_STEP_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%edx, %esi
	shll	%cl, %r14d
	notl	%eax
	andl	%esi, %eax
	orl	%eax, %r14d
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_sdhci_writel
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_HIGH_52_MAX_DTR,8,3        ## @MMC_HIGH_52_MAX_DTR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_XENON_SLOT_DLL_CUR_DLY_VAL,4,2 ## @XENON_SLOT_DLL_CUR_DLY_VAL
	.comm	_XENON_TUNING_STEP_MASK,4,2     ## @XENON_TUNING_STEP_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HS200 TUNING_STEP %d is larger than MAX value\n"

	.comm	_XENON_SLOT_OP_STATUS_CTRL,4,2  ## @XENON_SLOT_OP_STATUS_CTRL
	.comm	_XENON_TUN_CONSECUTIVE_TIMES_MASK,4,2 ## @XENON_TUN_CONSECUTIVE_TIMES_MASK
	.comm	_XENON_TUN_CONSECUTIVE_TIMES_SHIFT,4,2 ## @XENON_TUN_CONSECUTIVE_TIMES_SHIFT
	.comm	_XENON_TUNING_STEP_SHIFT,4,2    ## @XENON_TUNING_STEP_SHIFT
	.no_dead_strip	_xenon_emmc_phy_config_tuning
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xenon_emmc_phy_config_tuning
_xenon_emmc_phy_config_tuning:          ; @xenon_emmc_phy_config_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, x0
	bl	_sdhci_priv
	bl	_sdhci_pltfm_priv
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _MMC_HIGH_52_MAX_DTR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_HIGH_52_MAX_DTR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_5
; %bb.1:
	ldr	x21, [x0]
	mov	x0, x19
	bl	_xenon_emmc_phy_enable_dll
	cbnz	w0, LBB0_6
; %bb.2:
Lloh3:
	adrp	x8, _XENON_SLOT_DLL_CUR_DLY_VAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XENON_SLOT_DLL_CUR_DLY_VAL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sdhci_readl
	ldr	w8, [x21]
	sdiv	w20, w0, w8
Lloh6:
	adrp	x22, _XENON_TUNING_STEP_MASK@GOTPAGE
Lloh7:
	ldr	x22, [x22, _XENON_TUNING_STEP_MASK@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w20, w8
	cset	w0, gt
	bl	_unlikely
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w0, [x19, #8]
	bl	_mmc_dev
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_warn
	ldr	w20, [x22]
LBB0_4:
Lloh10:
	adrp	x23, _XENON_SLOT_OP_STATUS_CTRL@GOTPAGE
Lloh11:
	ldr	x23, [x23, _XENON_SLOT_OP_STATUS_CTRL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_sdhci_readl
Lloh12:
	adrp	x8, _XENON_TUN_CONSECUTIVE_TIMES_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _XENON_TUN_CONSECUTIVE_TIMES_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _XENON_TUN_CONSECUTIVE_TIMES_SHIFT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _XENON_TUN_CONSECUTIVE_TIMES_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	bic	w8, w0, w8
	ldr	w10, [x21, #4]
	lsl	w9, w10, w9
	orr	w8, w8, w9
	ldr	w9, [x22]
Lloh18:
	adrp	x10, _XENON_TUNING_STEP_SHIFT@GOTPAGE
Lloh19:
	ldr	x10, [x10, _XENON_TUNING_STEP_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	bic	w8, w8, w9
	lsl	w9, w20, w10
	orr	w1, w8, w9
	ldr	w2, [x23]
	mov	x0, x19
	bl	_sdhci_writel
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_HIGH_52_MAX_DTR,8,3        ; @MMC_HIGH_52_MAX_DTR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_XENON_SLOT_DLL_CUR_DLY_VAL,4,2 ; @XENON_SLOT_DLL_CUR_DLY_VAL
	.comm	_XENON_TUNING_STEP_MASK,4,2     ; @XENON_TUNING_STEP_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HS200 TUNING_STEP %d is larger than MAX value\n"

	.comm	_XENON_SLOT_OP_STATUS_CTRL,4,2  ; @XENON_SLOT_OP_STATUS_CTRL
	.comm	_XENON_TUN_CONSECUTIVE_TIMES_MASK,4,2 ; @XENON_TUN_CONSECUTIVE_TIMES_MASK
	.comm	_XENON_TUN_CONSECUTIVE_TIMES_SHIFT,4,2 ; @XENON_TUN_CONSECUTIVE_TIMES_SHIFT
	.comm	_XENON_TUNING_STEP_SHIFT,4,2    ; @XENON_TUNING_STEP_SHIFT
	.no_dead_strip	_xenon_emmc_phy_config_tuning
.subsections_via_symbols
