	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_sdhci_post_tuning
_tegra_sdhci_post_tuning:               ## @tegra_sdhci_post_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_sdhci_priv
	movq	%rax, %rdi
	callq	_sdhci_pltfm_priv
	movq	%rax, %r14
	movq	8(%rax), %rbx
	movq	_SDHCI_TEGRA_VENDOR_CLOCK_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_sdhci_readl
	movq	_SDHCI_CLOCK_CTRL_TAP_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_SDHCI_CLOCK_CTRL_TAP_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	%eax, (%r14)
	movl	(%rbx), %r13d
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.1:
	movl	4(%rbx), %ebx
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.2:
	movl	4(%r14), %eax
	movq	_USEC_PER_SEC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cltd
	idivl	%ecx
	movl	%eax, %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, %esi
	cltd
	idivl	%r13d
	movl	%eax, %ecx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %eax
	cltd
	idivl	%ebx
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leal	(%rcx,%rax,2), %eax
	movl	%eax, %r15d
	shrl	$31, %r15d
	addl	%eax, %r15d
	sarl	%r15d
	movq	_SDHCI_TEGRA_VNDR_TUN_STATUS1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_sdhci_readl
	movq	_SDHCI_TEGRA_VNDR_TUN_STATUS1_TAP_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%esi, %edx
	andl	%eax, %edx
	movq	_SDHCI_TEGRA_VNDR_TUN_STATUS1_END_TAP_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	testl	%edx, %edx
	je	LBB0_6
## %bb.3:
	andl	%esi, %eax
	movl	(%r12), %ecx
	leal	-1(%rcx), %esi
	cmpl	%esi, %eax
	je	LBB0_6
## %bb.4:
	addl	$-2, %ecx
	cmpl	%ecx, %eax
	je	LBB0_6
## %bb.5:
	subl	%edx, %eax
	cmpl	%r15d, %eax
	jl	LBB0_7
LBB0_6:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	%eax, %eax
	addl	%r13d, %ebx
	cltd
	idivl	%ebx
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	3(%rax), %r13d
	testl	%eax, %eax
	cmovnsl	%eax, %r13d
	sarl	$2, %r13d
	movl	4(%r12), %edi
	callq	_mmc_hostname
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_debug
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	callq	_tegra_sdhci_tap_correction
LBB0_7:
	movl	(%r14), %esi
	movq	%r12, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tegra_sdhci_set_tap            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SDHCI_TEGRA_VENDOR_CLOCK_CTRL,4,2 ## @SDHCI_TEGRA_VENDOR_CLOCK_CTRL
	.comm	_SDHCI_CLOCK_CTRL_TAP_MASK,4,2  ## @SDHCI_CLOCK_CTRL_TAP_MASK
	.comm	_SDHCI_CLOCK_CTRL_TAP_SHIFT,4,2 ## @SDHCI_CLOCK_CTRL_TAP_SHIFT
	.comm	_USEC_PER_SEC,4,2               ## @USEC_PER_SEC
	.comm	_SDHCI_TEGRA_VNDR_TUN_STATUS1,4,2 ## @SDHCI_TEGRA_VNDR_TUN_STATUS1
	.comm	_SDHCI_TEGRA_VNDR_TUN_STATUS1_TAP_MASK,4,2 ## @SDHCI_TEGRA_VNDR_TUN_STATUS1_TAP_MASK
	.comm	_SDHCI_TEGRA_VNDR_TUN_STATUS1_END_TAP_SHIFT,4,2 ## @SDHCI_TEGRA_VNDR_TUN_STATUS1_END_TAP_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Apply tuning correction\n"

	.no_dead_strip	_tegra_sdhci_post_tuning
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_sdhci_post_tuning
_tegra_sdhci_post_tuning:               ; @tegra_sdhci_post_tuning
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_sdhci_priv
	bl	_sdhci_pltfm_priv
	mov	x20, x0
	ldr	x21, [x0, #8]
Lloh0:
	adrp	x8, _SDHCI_TEGRA_VENDOR_CLOCK_CTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDHCI_TEGRA_VENDOR_CLOCK_CTRL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sdhci_readl
Lloh3:
	adrp	x8, _SDHCI_CLOCK_CTRL_TAP_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SDHCI_CLOCK_CTRL_TAP_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh6:
	adrp	x9, _SDHCI_CLOCK_CTRL_TAP_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SDHCI_CLOCK_CTRL_TAP_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	asr	w8, w8, w9
	str	w8, [x20]
	ldr	w22, [x21]
	cbz	w22, LBB0_7
; %bb.1:
	ldr	w23, [x21, #4]
	cbz	w23, LBB0_7
; %bb.2:
	ldr	w8, [x20, #4]
Lloh9:
	adrp	x9, _USEC_PER_SEC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _USEC_PER_SEC@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
	sdiv	w25, w9, w8
	sdiv	w8, w25, w22
	sdiv	w24, w25, w23
	add	w8, w8, w24, lsl #1
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w21, w8, #1
Lloh12:
	adrp	x8, _SDHCI_TEGRA_VNDR_TUN_STATUS1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SDHCI_TEGRA_VNDR_TUN_STATUS1@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sdhci_readl
Lloh15:
	adrp	x8, _SDHCI_TEGRA_VNDR_TUN_STATUS1_TAP_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SDHCI_TEGRA_VNDR_TUN_STATUS1_TAP_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x8]
	and	w8, w9, w0
	cbz	w8, LBB0_6
; %bb.3:
Lloh18:
	adrp	x10, _SDHCI_TEGRA_VNDR_TUN_STATUS1_END_TAP_SHIFT@GOTPAGE
Lloh19:
	ldr	x10, [x10, _SDHCI_TEGRA_VNDR_TUN_STATUS1_END_TAP_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	asr	w10, w0, w10
	and	w9, w10, w9
	ldr	w10, [x19]
	sub	w11, w10, #1
	cmp	w9, w11
	b.eq	LBB0_6
; %bb.4:
	sub	w10, w10, #2
	cmp	w9, w10
	b.eq	LBB0_6
; %bb.5:
	sub	w8, w9, w8
	cmp	w8, w21
	b.lt	LBB0_7
LBB0_6:
	lsl	w8, w25, #1
	add	w9, w23, w22
	sdiv	w8, w8, w9
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w22, w8, #1
	add	w8, w24, #3
	cmp	w24, #0
	csel	w8, w8, w24, lt
	asr	w23, w8, #2
	ldr	w0, [x19, #4]
	bl	_mmc_hostname
	mov	x1, x0
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	mov	x3, x22
	bl	_tegra_sdhci_tap_correction
LBB0_7:
	ldr	w1, [x20]
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_tegra_sdhci_set_tap
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_SDHCI_TEGRA_VENDOR_CLOCK_CTRL,4,2 ; @SDHCI_TEGRA_VENDOR_CLOCK_CTRL
	.comm	_SDHCI_CLOCK_CTRL_TAP_MASK,4,2  ; @SDHCI_CLOCK_CTRL_TAP_MASK
	.comm	_SDHCI_CLOCK_CTRL_TAP_SHIFT,4,2 ; @SDHCI_CLOCK_CTRL_TAP_SHIFT
	.comm	_USEC_PER_SEC,4,2               ; @USEC_PER_SEC
	.comm	_SDHCI_TEGRA_VNDR_TUN_STATUS1,4,2 ; @SDHCI_TEGRA_VNDR_TUN_STATUS1
	.comm	_SDHCI_TEGRA_VNDR_TUN_STATUS1_TAP_MASK,4,2 ; @SDHCI_TEGRA_VNDR_TUN_STATUS1_TAP_MASK
	.comm	_SDHCI_TEGRA_VNDR_TUN_STATUS1_END_TAP_SHIFT,4,2 ; @SDHCI_TEGRA_VNDR_TUN_STATUS1_END_TAP_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Apply tuning correction\n"

	.no_dead_strip	_tegra_sdhci_post_tuning
.subsections_via_symbols
