	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __sdhci_o2_execute_tuning
___sdhci_o2_execute_tuning:             ## @__sdhci_o2_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_MMC_SEND_TUNING_BLOCK_HS200@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_sdhci_send_tuning
	movl	$150, %ebx
	movq	_SDHCI_HOST_CONTROL2@GOTPCREL(%rip), %r15
	movq	_SDHCI_CTRL_EXEC_TUNING@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_sdhci_readw
	testl	%eax, (%r12)
	je	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$1, %edi
	callq	_mdelay
	decl	%ebx
	jne	LBB0_1
	jmp	LBB0_5
LBB0_2:
	movq	_SDHCI_CTRL_TUNED_CLK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.6:
	movl	$1, (%r14)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	4(%r14), %edi
	callq	_mmc_hostname
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_warn
LBB0_5:
	movl	4(%r14), %edi
	callq	_mmc_hostname
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_info
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sdhci_reset_tuning             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_SEND_TUNING_BLOCK_HS200,4,2 ## @MMC_SEND_TUNING_BLOCK_HS200
	.comm	_SDHCI_HOST_CONTROL2,4,2        ## @SDHCI_HOST_CONTROL2
	.comm	_SDHCI_CTRL_EXEC_TUNING,4,2     ## @SDHCI_CTRL_EXEC_TUNING
	.comm	_SDHCI_CTRL_TUNED_CLK,4,2       ## @SDHCI_CTRL_TUNED_CLK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: HW tuning failed !\n"

L_.str.1:                               ## @.str.1
	.asciz	"%s: Tuning failed, falling back to fixed sampling clock\n"

	.no_dead_strip	___sdhci_o2_execute_tuning
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __sdhci_o2_execute_tuning
___sdhci_o2_execute_tuning:             ; @__sdhci_o2_execute_tuning
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _MMC_SEND_TUNING_BLOCK_HS200@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MMC_SEND_TUNING_BLOCK_HS200@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_sdhci_send_tuning
	mov	w20, #150
Lloh3:
	adrp	x21, _SDHCI_HOST_CONTROL2@GOTPAGE
Lloh4:
	ldr	x21, [x21, _SDHCI_HOST_CONTROL2@GOTPAGEOFF]
Lloh5:
	adrp	x22, _SDHCI_CTRL_EXEC_TUNING@GOTPAGE
Lloh6:
	ldr	x22, [x22, _SDHCI_CTRL_EXEC_TUNING@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sdhci_readw
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #1
	bl	_mdelay
	subs	w20, w20, #1
	b.ne	LBB0_1
	b	LBB0_6
LBB0_3:
Lloh7:
	adrp	x8, _SDHCI_CTRL_TUNED_CLK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SDHCI_CTRL_TUNED_CLK@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.4:
	mov	w8, #1
	str	w8, [x19]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	w0, [x19, #4]
	bl	_mmc_hostname
	mov	x1, x0
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
LBB0_6:
	ldr	w0, [x19, #4]
	bl	_mmc_hostname
	mov	x1, x0
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_sdhci_reset_tuning
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_SEND_TUNING_BLOCK_HS200,4,2 ; @MMC_SEND_TUNING_BLOCK_HS200
	.comm	_SDHCI_HOST_CONTROL2,4,2        ; @SDHCI_HOST_CONTROL2
	.comm	_SDHCI_CTRL_EXEC_TUNING,4,2     ; @SDHCI_CTRL_EXEC_TUNING
	.comm	_SDHCI_CTRL_TUNED_CLK,4,2       ; @SDHCI_CTRL_TUNED_CLK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: HW tuning failed !\n"

l_.str.1:                               ; @.str.1
	.asciz	"%s: Tuning failed, falling back to fixed sampling clock\n"

	.no_dead_strip	___sdhci_o2_execute_tuning
.subsections_via_symbols
