	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hs400_tune_response
_hs400_tune_response:                   ## @hs400_tune_response
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r15
	callq	_mmc_priv
	movq	%rax, %rbx
	movq	_PAD_CMD_TUNE@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	addq	8(%rbx), %r14
	xorl	%edi, %edi
	callq	_BIT
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_sdr_set_bits
	movq	(%r15), %rax
	movq	_MMC_TIMING_MMC_HS200@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	_MMC_TIMING_UHS_SDR104@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
LBB0_2:
	movq	_MSDC_PAD_TUNE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	movq	_MSDC_PAD_TUNE_CMDRRDLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	callq	_sdr_set_field
LBB0_3:
	movq	_MSDC_IOCON@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_MSDC_IOCON_RSPL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addq	8(%rbx), %rdi
	cmpq	$0, 16(%rbx)
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_5
## %bb.4:
	callq	_sdr_clr_bits
	jmp	LBB0_6
LBB0_5:
	callq	_sdr_set_bits
LBB0_6:
	movq	_PAD_DELAY_MAX@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movl	$0, %esi
	jle	LBB0_15
## %bb.7:
	xorl	%esi, %esi
	xorl	%r14d, %r14d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	_PAD_CMD_TUNE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	movq	_PAD_CMD_TUNE_RX_DLY3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_sdr_set_field
	movl	$1, %r13d
	movl	%r14d, %ecx
	shll	%cl, %r13d
	movq	%r12, %rdi
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	leaq	-48(%rbp), %r15
	movq	%r15, %rdx
	callq	_mmc_send_tuning
	cmpl	$0, -48(%rbp)
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	orl	%r13d, -44(%rbp)                ## 4-byte Folded Spill
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	_mmc_send_tuning
	cmpl	$0, -48(%rbp)
	je	LBB0_12
LBB0_9:                                 ##   in Loop: Header=BB0_8 Depth=1
	movl	-44(%rbp), %esi                 ## 4-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	notl	%r13d
	andl	%r13d, %esi
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	incl	%r14d
	movq	_PAD_DELAY_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jl	LBB0_8
	jmp	LBB0_15
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	_mmc_send_tuning
	cmpl	$0, -48(%rbp)
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	jne	LBB0_13
	jmp	LBB0_14
LBB0_15:
	movq	%rbx, %rdi
	callq	_get_best_delay
	movq	%rax, %r14
	movq	_PAD_CMD_TUNE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	movq	_PAD_CMD_TUNE_RX_DLY3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_sdr_set_field
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_dbg
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	cmpl	$255, %r14d
	movl	$0, %ecx
	cmovnel	%ecx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAD_CMD_TUNE,8,3               ## @PAD_CMD_TUNE
	.comm	_MMC_TIMING_MMC_HS200,8,3       ## @MMC_TIMING_MMC_HS200
	.comm	_MMC_TIMING_UHS_SDR104,8,3      ## @MMC_TIMING_UHS_SDR104
	.comm	_MSDC_PAD_TUNE,8,3              ## @MSDC_PAD_TUNE
	.comm	_MSDC_PAD_TUNE_CMDRRDLY,4,2     ## @MSDC_PAD_TUNE_CMDRRDLY
	.comm	_MSDC_IOCON,8,3                 ## @MSDC_IOCON
	.comm	_MSDC_IOCON_RSPL,4,2            ## @MSDC_IOCON_RSPL
	.comm	_PAD_DELAY_MAX,4,2              ## @PAD_DELAY_MAX
	.comm	_PAD_CMD_TUNE_RX_DLY3,4,2       ## @PAD_CMD_TUNE_RX_DLY3
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Final cmd pad delay: %x\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_hs400_tune_response
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hs400_tune_response
_hs400_tune_response:                   ; @hs400_tune_response
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x21, x0
	bl	_mmc_priv
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x24, _PAD_CMD_TUNE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PAD_CMD_TUNE@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x22, x9, x8
	mov	w0, #0
	bl	_BIT
	mov	x1, x0
	mov	x0, x22
	bl	_sdr_set_bits
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _MMC_TIMING_MMC_HS200@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MMC_TIMING_MMC_HS200@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x10, _MMC_TIMING_UHS_SDR104@GOTPAGE
Lloh6:
	ldr	x10, [x10, _MMC_TIMING_UHS_SDR104@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x19, #8]
Lloh8:
	adrp	x9, _MSDC_PAD_TUNE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MSDC_PAD_TUNE@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x0, x9, x8
Lloh11:
	adrp	x8, _MSDC_PAD_TUNE_CMDRRDLY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MSDC_PAD_TUNE_CMDRRDLY@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w2, [x19]
	bl	_sdr_set_field
LBB0_2:
Lloh14:
	adrp	x8, _MSDC_IOCON@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MSDC_IOCON@GOTPAGEOFF]
	ldp	x10, x9, [x19, #8]
Lloh16:
	ldr	x8, [x8]
	add	x0, x8, x10
Lloh17:
	adrp	x8, _MSDC_IOCON_RSPL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MSDC_IOCON_RSPL@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	cbz	x9, LBB0_4
; %bb.3:
	bl	_sdr_clr_bits
	b	LBB0_5
LBB0_4:
	bl	_sdr_set_bits
LBB0_5:
Lloh20:
	adrp	x26, _PAD_DELAY_MAX@GOTPAGE
Lloh21:
	ldr	x26, [x26, _PAD_DELAY_MAX@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh22:
	adrp	x25, _PAD_CMD_TUNE_RX_DLY3@GOTPAGE
Lloh23:
	ldr	x25, [x25, _PAD_CMD_TUNE_RX_DLY3@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.6:
	mov	w22, #0
	mov	w23, #0
	mov	w27, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x0, x9, x8
	ldr	w1, [x25]
	mov	x2, x23
	bl	_sdr_set_field
	lsl	w28, w27, w23
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x20
	bl	_mmc_send_tuning
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	orr	w22, w22, w28
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x20
	bl	_mmc_send_tuning
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x20
	bl	_mmc_send_tuning
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	bic	w22, w22, w28
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w23, w23, #1
	ldr	w8, [x26]
	cmp	w23, w8
	b.lt	LBB0_7
	b	LBB0_13
LBB0_12:
	mov	w22, #0
LBB0_13:
	mov	x0, x19
	mov	x1, x22
	bl	_get_best_delay
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x0, x9, x8
	ldr	w1, [x25]
	mov	x2, x20
	bl	_sdr_set_field
	ldr	w0, [x19, #4]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
Lloh26:
	adrp	x8, _EIO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	cmp	w20, #255
	csneg	w0, wzr, w8, ne
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_PAD_CMD_TUNE,8,3               ; @PAD_CMD_TUNE
	.comm	_MMC_TIMING_MMC_HS200,8,3       ; @MMC_TIMING_MMC_HS200
	.comm	_MMC_TIMING_UHS_SDR104,8,3      ; @MMC_TIMING_UHS_SDR104
	.comm	_MSDC_PAD_TUNE,8,3              ; @MSDC_PAD_TUNE
	.comm	_MSDC_PAD_TUNE_CMDRRDLY,4,2     ; @MSDC_PAD_TUNE_CMDRRDLY
	.comm	_MSDC_IOCON,8,3                 ; @MSDC_IOCON
	.comm	_MSDC_IOCON_RSPL,4,2            ; @MSDC_IOCON_RSPL
	.comm	_PAD_DELAY_MAX,4,2              ; @PAD_DELAY_MAX
	.comm	_PAD_CMD_TUNE_RX_DLY3,4,2       ; @PAD_CMD_TUNE_RX_DLY3
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Final cmd pad delay: %x\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_hs400_tune_response
.subsections_via_symbols
