	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msdc_execute_tuning
_msdc_execute_tuning:                   ## @msdc_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
	movq	%rsi, %r12
	movq	%rdi, %r13
	callq	_mmc_priv
	movq	%rax, %rbx
	movq	72(%rax), %rax
	movq	24(%rax), %r15
	cmpq	$0, 16(%rax)
	je	LBB0_4
## %bb.1:
	cmpq	$0, 8(%rax)
	je	LBB0_4
## %bb.2:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_msdc_tune_together
	movl	%eax, %r14d
	cmpl	$0, (%rbx)
	je	LBB0_13
## %bb.3:
	movq	_MSDC_IOCON@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	56(%rbx), %rdi
	movq	_MSDC_IOCON_DSPL@GOTPCREL(%rip), %rax
	movq	_MSDC_IOCON_W_DSPL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_sdr_clr_bits
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_msdc_set_data_delay
	jmp	LBB0_13
LBB0_4:
	cmpl	$0, (%rbx)
	je	LBB0_7
## %bb.5:
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_hs400_tune_response
	jmp	LBB0_8
LBB0_7:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_msdc_tune_response
LBB0_8:
	movl	%eax, %r14d
	movq	_EIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	addl	%r14d, %eax
	jne	LBB0_10
## %bb.9:
	movl	64(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_15
LBB0_10:
	cmpl	$0, (%rbx)
	jne	LBB0_13
## %bb.11:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%rcx, %r12
	callq	_msdc_tune_data
	movl	%eax, %r14d
	addl	(%r12), %eax
	jne	LBB0_13
## %bb.12:
	movl	64(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_13:
	movq	_MSDC_IOCON@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	56(%rbx), %rdi
	callq	_readl
	movq	%rax, 48(%rbx)
	addq	56(%rbx), %r15
	movq	%r15, %rdi
	callq	_readl
	movq	%rax, 40(%rbx)
	movq	_PAD_CMD_TUNE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	56(%rbx), %rdi
	callq	_readl
	movq	%rax, 32(%rbx)
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	movq	_EMMC_TOP_CONTROL@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	callq	_readl
	movq	%rax, 24(%rbx)
	movq	_EMMC_TOP_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	%rax, 16(%rbx)
LBB0_15:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSDC_IOCON,8,3                 ## @MSDC_IOCON
	.comm	_MSDC_IOCON_DSPL,4,2            ## @MSDC_IOCON_DSPL
	.comm	_MSDC_IOCON_W_DSPL,4,2          ## @MSDC_IOCON_W_DSPL
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Tune response fail!\n"

L_.str.1:                               ## @.str.1
	.asciz	"Tune data fail!\n"

	.comm	_PAD_CMD_TUNE,8,3               ## @PAD_CMD_TUNE
	.comm	_EMMC_TOP_CONTROL,8,3           ## @EMMC_TOP_CONTROL
	.comm	_EMMC_TOP_CMD,8,3               ## @EMMC_TOP_CMD
	.no_dead_strip	_msdc_execute_tuning
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msdc_execute_tuning
_msdc_execute_tuning:                   ; @msdc_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	x21, x1
	mov	x22, x0
	bl	_mmc_priv
	mov	x19, x0
	ldr	x8, [x0, #72]
	ldp	x9, x23, [x8, #16]
	cbz	x9, LBB0_4
; %bb.1:
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_4
; %bb.2:
	mov	x0, x22
	mov	x1, x21
	bl	_msdc_tune_together
	mov	x20, x0
	ldr	w8, [x19]
	cbz	w8, LBB0_13
; %bb.3:
	ldr	x8, [x19, #56]
Lloh0:
	adrp	x9, _MSDC_IOCON@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MSDC_IOCON@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _MSDC_IOCON_DSPL@GOTPAGE
Lloh4:
	ldr	x10, [x10, _MSDC_IOCON_DSPL@GOTPAGEOFF]
	add	x0, x9, x8
Lloh5:
	ldr	w8, [x10]
Lloh6:
	adrp	x9, _MSDC_IOCON_W_DSPL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MSDC_IOCON_W_DSPL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_sdr_clr_bits
	mov	x0, x19
	mov	w1, #0
	bl	_msdc_set_data_delay
	b	LBB0_13
LBB0_4:
	ldr	w9, [x19]
	cbz	w9, LBB0_7
; %bb.5:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
	mov	x0, x22
	mov	x1, x21
	bl	_hs400_tune_response
	b	LBB0_8
LBB0_7:
	mov	x0, x22
	mov	x1, x21
	bl	_msdc_tune_response
LBB0_8:
	mov	x20, x0
Lloh9:
	adrp	x24, _EIO@GOTPAGE
Lloh10:
	ldr	x24, [x24, _EIO@GOTPAGEOFF]
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_10
; %bb.9:
	ldr	w0, [x19, #64]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_15
LBB0_10:
	ldr	w8, [x19]
	cbnz	w8, LBB0_13
; %bb.11:
	mov	x0, x22
	mov	x1, x21
	bl	_msdc_tune_data
	mov	x20, x0
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_13
; %bb.12:
	ldr	w0, [x19, #64]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_13:
	ldr	x8, [x19, #56]
Lloh15:
	adrp	x9, _MSDC_IOCON@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MSDC_IOCON@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	str	x0, [x19, #48]
	ldr	x8, [x19, #56]
	add	x0, x8, x23
	bl	_readl
	str	x0, [x19, #40]
	ldr	x8, [x19, #56]
Lloh18:
	adrp	x9, _PAD_CMD_TUNE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PAD_CMD_TUNE@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	str	x0, [x19, #32]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_15
; %bb.14:
Lloh21:
	adrp	x9, _EMMC_TOP_CONTROL@GOTPAGE
Lloh22:
	ldr	x9, [x9, _EMMC_TOP_CONTROL@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	str	x0, [x19, #24]
	ldr	x8, [x19, #8]
Lloh24:
	adrp	x9, _EMMC_TOP_CMD@GOTPAGE
Lloh25:
	ldr	x9, [x9, _EMMC_TOP_CMD@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	str	x0, [x19, #16]
LBB0_15:
	mov	x0, x20
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MSDC_IOCON,8,3                 ; @MSDC_IOCON
	.comm	_MSDC_IOCON_DSPL,4,2            ; @MSDC_IOCON_DSPL
	.comm	_MSDC_IOCON_W_DSPL,4,2          ; @MSDC_IOCON_W_DSPL
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Tune response fail!\n"

l_.str.1:                               ; @.str.1
	.asciz	"Tune data fail!\n"

	.comm	_PAD_CMD_TUNE,8,3               ; @PAD_CMD_TUNE
	.comm	_EMMC_TOP_CONTROL,8,3           ; @EMMC_TOP_CONTROL
	.comm	_EMMC_TOP_CMD,8,3               ; @EMMC_TOP_CMD
	.no_dead_strip	_msdc_execute_tuning
.subsections_via_symbols
