	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_sdhci_pad_autocalib
_tegra_sdhci_pad_autocalib:             ## @tegra_sdhci_pad_autocalib
	.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, %r15
	callq	_sdhci_priv
	movq	%rax, %rdi
	callq	_sdhci_pltfm_priv
	movq	(%r15), %r12
	movl	(%r12), %ecx
	cmpl	$129, %ecx
	je	LBB0_3
## %bb.1:
	cmpl	$128, %ecx
	jne	LBB0_4
## %bb.2:
	movsd	(%rax), %xmm1                   ## xmm1 = mem[0],zero
	jmp	LBB0_5
LBB0_3:
	movsd	8(%rax), %xmm1                  ## xmm1 = mem[0],zero
	jmp	LBB0_5
LBB0_4:
	movsd	24(%rax), %xmm1                 ## xmm1 = mem[0],zero
	movsd	16(%rax), %xmm2                 ## xmm2 = mem[0],zero
	movl	4(%r12), %eax
	movq	_MMC_SIGNAL_VOLTAGE_180@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpl	(%rcx), %eax
	sete	%dl
	movd	%edx, %xmm0
	pshufd	$80, %xmm0, %xmm0               ## xmm0 = xmm0[0,0,1,1]
	pslld	$31, %xmm0
	blendvps	%xmm0, %xmm2, %xmm1
LBB0_5:
	movd	%xmm1, %eax
	shll	$8, %eax
	pextrd	$1, %xmm1, %esi
	orl	%eax, %esi
	movq	%r15, %rdi
	callq	_tegra_sdhci_set_pad_autocal_offset
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_tegra_sdhci_configure_card_clk
	movl	%eax, %r14d
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_tegra_sdhci_configure_cal_pad
	movq	_SDHCI_TEGRA_AUTO_CAL_CONFIG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_sdhci_readl
	movl	%eax, %ebx
	movq	_SDHCI_AUTO_CAL_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_SDHCI_AUTO_CAL_START@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	(%r13), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_sdhci_writel
	movl	$1, %edi
	movl	$2, %esi
	callq	_usleep_range
	movq	_SDHCI_TEGRA_AUTO_CAL_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	movq	_SDHCI_TEGRA_AUTO_CAL_ACTIVE@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	movl	(%rax), %eax
	andl	%ebx, %eax
	sete	%dl
	movl	%ebx, %esi
	movl	$1000, %ecx                     ## imm = 0x3E8
	movl	$10000, %r8d                    ## imm = 0x2710
	callq	_readl_poll_timeout
	movl	%eax, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_tegra_sdhci_configure_cal_pad
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_tegra_sdhci_configure_card_clk
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.6:
	movq	(%r15), %rdi
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_dev_err
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_sdhci_readl
	movq	_SDHCI_AUTO_CAL_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	movl	(%r13), %edx
	movq	%r15, %rdi
	callq	_sdhci_writel
	movl	4(%r12), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_tegra_sdhci_set_padctrl
	testl	%eax, %eax
	js	LBB0_8
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%eax, %ebx
	movq	(%r15), %rdi
	callq	_mmc_dev
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	movl	%ebx, %edx
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_SIGNAL_VOLTAGE_180,4,2     ## @MMC_SIGNAL_VOLTAGE_180
	.comm	_SDHCI_TEGRA_AUTO_CAL_CONFIG,4,2 ## @SDHCI_TEGRA_AUTO_CAL_CONFIG
	.comm	_SDHCI_AUTO_CAL_ENABLE,4,2      ## @SDHCI_AUTO_CAL_ENABLE
	.comm	_SDHCI_AUTO_CAL_START,4,2       ## @SDHCI_AUTO_CAL_START
	.comm	_SDHCI_TEGRA_AUTO_CAL_STATUS,8,3 ## @SDHCI_TEGRA_AUTO_CAL_STATUS
	.comm	_SDHCI_TEGRA_AUTO_CAL_ACTIVE,4,2 ## @SDHCI_TEGRA_AUTO_CAL_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Pad autocal timed out\n"

L_.str.1:                               ## @.str.1
	.asciz	"Setting drive strengths failed: %d\n"

	.no_dead_strip	_tegra_sdhci_pad_autocalib
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_sdhci_pad_autocalib
_tegra_sdhci_pad_autocalib:             ; @tegra_sdhci_pad_autocalib
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	bl	_sdhci_priv
	bl	_sdhci_pltfm_priv
	ldr	x22, [x19]
	ldr	w8, [x22]
	cmp	w8, #129
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #128
	b.ne	LBB0_4
; %bb.2:
	ldr	d0, [x0]
	b	LBB0_5
LBB0_3:
	ldr	d0, [x0, #8]
	b	LBB0_5
LBB0_4:
	ldp	d1, d0, [x0, #16]
	ldr	w8, [x22, #4]
Lloh0:
	adrp	x9, _MMC_SIGNAL_VOLTAGE_180@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_SIGNAL_VOLTAGE_180@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w8, eq
	dup.2s	v2, w8
	shl.2s	v2, v2, #31
	cmlt.2s	v2, v2, #0
	bit.8b	v0, v1, v2
LBB0_5:
	fmov	w8, s0
	mov.s	w9, v0[1]
	orr	w1, w9, w8, lsl #8
	mov	x0, x19
	bl	_tegra_sdhci_set_pad_autocal_offset
	mov	x0, x19
	mov	w1, #0
	bl	_tegra_sdhci_configure_card_clk
	mov	x20, x0
	mov	x0, x19
	mov	w1, #1
	bl	_tegra_sdhci_configure_cal_pad
Lloh3:
	adrp	x23, _SDHCI_TEGRA_AUTO_CAL_CONFIG@GOTPAGE
Lloh4:
	ldr	x23, [x23, _SDHCI_TEGRA_AUTO_CAL_CONFIG@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_sdhci_readl
Lloh5:
	adrp	x24, _SDHCI_AUTO_CAL_ENABLE@GOTPAGE
Lloh6:
	ldr	x24, [x24, _SDHCI_AUTO_CAL_ENABLE@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh7:
	adrp	x9, _SDHCI_AUTO_CAL_START@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SDHCI_AUTO_CAL_START@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w8, w8, w0
	orr	w21, w8, w9
	ldr	w2, [x23]
	mov	x0, x19
	mov	x1, x21
	bl	_sdhci_writel
	mov	w0, #1
	mov	w1, #2
	bl	_usleep_range
	ldr	x8, [x19, #8]
Lloh10:
	adrp	x9, _SDHCI_TEGRA_AUTO_CAL_STATUS@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SDHCI_TEGRA_AUTO_CAL_STATUS@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x0, x9, x8
Lloh13:
	adrp	x8, _SDHCI_TEGRA_AUTO_CAL_ACTIVE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SDHCI_TEGRA_AUTO_CAL_ACTIVE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w2, eq
	mov	x1, x21
	mov	w3, #1000
	mov	w4, #10000
	bl	_readl_poll_timeout
	mov	x21, x0
	mov	x0, x19
	mov	w1, #0
	bl	_tegra_sdhci_configure_cal_pad
	mov	x0, x19
	mov	x1, x20
	bl	_tegra_sdhci_configure_card_clk
	cbz	w21, LBB0_8
; %bb.6:
	ldr	x0, [x19]
	bl	_mmc_dev
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	w1, [x23]
	mov	x0, x19
	bl	_sdhci_readl
	ldr	w8, [x24]
	bic	w1, w0, w8
	ldr	w2, [x23]
	mov	x0, x19
	bl	_sdhci_writel
	ldr	w1, [x22, #4]
	mov	x0, x19
	mov	w2, #0
	bl	_tegra_sdhci_set_padctrl
	tbz	w0, #31, LBB0_8
; %bb.7:
	mov	x20, x0
	ldr	x0, [x19]
	bl	_mmc_dev
	str	x20, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_8:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_SIGNAL_VOLTAGE_180,4,2     ; @MMC_SIGNAL_VOLTAGE_180
	.comm	_SDHCI_TEGRA_AUTO_CAL_CONFIG,4,2 ; @SDHCI_TEGRA_AUTO_CAL_CONFIG
	.comm	_SDHCI_AUTO_CAL_ENABLE,4,2      ; @SDHCI_AUTO_CAL_ENABLE
	.comm	_SDHCI_AUTO_CAL_START,4,2       ; @SDHCI_AUTO_CAL_START
	.comm	_SDHCI_TEGRA_AUTO_CAL_STATUS,8,3 ; @SDHCI_TEGRA_AUTO_CAL_STATUS
	.comm	_SDHCI_TEGRA_AUTO_CAL_ACTIVE,4,2 ; @SDHCI_TEGRA_AUTO_CAL_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Pad autocal timed out\n"

l_.str.1:                               ; @.str.1
	.asciz	"Setting drive strengths failed: %d\n"

	.no_dead_strip	_tegra_sdhci_pad_autocalib
.subsections_via_symbols
