	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdhci_sirf_execute_tuning
_sdhci_sirf_execute_tuning:             ## @sdhci_sirf_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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	movq	(%rdi), %rbx
	movq	_SDHCI_CLK_DELAY_SETTING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_sdhci_readw
	andl	$-16384, %eax                   ## imm = 0xC000
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	$3, %eax
	movl	$-1, %edx
	movq	_SIRF_TUNING_COUNT@GOTPCREL(%rip), %r12
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	xorl	%ecx, %ecx
	movl	$-1, -44(%rbp)                  ## 4-byte Folded Spill
	xorl	%r13d, %r13d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	decl	%eax
	je	LBB0_15
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=2
	movl	$-1, %edx
	xorl	%ecx, %ecx
	xorl	%r13d, %r13d
	movq	%r12, %rbx
	movq	%r15, %r12
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=2
	incl	%r14d
	cmpl	(%r12), %r14d
	jge	LBB0_11
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movl	%r14d, %esi
	orl	-52(%rbp), %esi                 ## 4-byte Folded Reload
	movq	_SDHCI_CLK_DELAY_SETTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_sdhci_writel
	movq	%rbx, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	callq	_mmc_send_tuning
	testl	%eax, %eax
	je	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	%r12, %r15
	movq	%rbx, %rdi
	callq	_mmc_dev
	movq	%rbx, %rdi
	movl	%eax, %ebx
	movq	%rdi, %r12
	callq	_mmc_hostname
	movl	%ebx, %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	cmpl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	jle	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=2
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	addl	-88(%rbp), %ecx                 ## 4-byte Folded Reload
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r13d, %eax
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=2
	incq	-72(%rbp)                       ## 8-byte Folded Spill
	movq	%rbx, %rdi
	callq	_mmc_dev
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_mmc_hostname
	movl	%r15d, %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	cmpl	$-1, %edx
	cmovel	%r14d, %edx
	leal	1(%r13), %eax
	movl	(%r12), %ecx
	decl	%ecx
	cmpl	%ecx, %r14d
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=2
	cmpl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	jl	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=2
	leal	(%rdx,%r14), %ecx
	movl	%ecx, %esi
	shrl	$31, %esi
	addl	%ecx, %esi
	sarl	%esi
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=2
	movl	%r14d, %ecx
	movl	%eax, %r13d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_14
## %bb.13:
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	orl	%r15d, %esi
	movq	_SDHCI_CLK_DELAY_SETTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_sdhci_writel
	movq	%rbx, %rdi
	callq	_mmc_dev
	movq	%rbx, %rdi
	movl	%eax, %ebx
	callq	_mmc_hostname
	leaq	L_.str.2(%rip), %rsi
	xorl	%r14d, %r14d
	movl	%ebx, %edi
	movl	%eax, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_16
LBB0_15:
	movq	%rbx, %rdi
	callq	_mmc_dev
	movq	%rbx, %rdi
	movl	%eax, %ebx
	callq	_mmc_hostname
	leaq	L_.str.3(%rip), %rsi
	xorl	%r14d, %r14d
	movl	%ebx, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_16:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDHCI_CLK_DELAY_SETTING,4,2    ## @SDHCI_CLK_DELAY_SETTING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Found good phase = %d\n"

	.comm	_SIRF_TUNING_COUNT,4,2          ## @SIRF_TUNING_COUNT
L_.str.1:                               ## @.str.1
	.asciz	"%s: Found bad phase = %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"%s: Setting the tuning phase to %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s: No tuning point found\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_sdhci_sirf_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_sirf_execute_tuning
_sdhci_sirf_execute_tuning:             ; @sdhci_sirf_execute_tuning
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	str	w1, [sp, #16]                   ; 4-byte Folded Spill
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _SDHCI_CLK_DELAY_SETTING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDHCI_CLK_DELAY_SETTING@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	bl	_sdhci_readw
	mov	w27, #0
	mov	w21, #0
	mov	w23, #0
	and	w8, w0, #0xffffc000
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	mov	w8, #3
Lloh3:
	adrp	x28, _SIRF_TUNING_COUNT@GOTPAGE
Lloh4:
	ldr	x28, [x28, _SIRF_TUNING_COUNT@GOTPAGEOFF]
	mov	w25, #-1
	mov	w26, #-1
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	subs	w8, w8, #1
	b.eq	LBB0_10
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	w20, #0
	mov	x22, #0
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x19
	bl	_mmc_dev
	mov	x24, x0
	mov	x0, x19
	bl	_mmc_hostname
	mov	x2, x0
	mov	x8, x20
	str	x8, [sp]
	mov	x0, x24
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	add	w8, w21, w25
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	cmp	w23, w27
	csel	w27, w27, w23, le
	mov	w9, #-1
	csel	w25, w9, w9, le
	csel	w21, wzr, wzr, le
	csel	w26, w26, w8, le
	csel	w23, wzr, wzr, le
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	w20, w20, #1
	ldr	w8, [x28]
	cmp	w20, w8
	b.ge	LBB0_7
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	orr	w1, w20, w8
Lloh7:
	adrp	x8, _SDHCI_CLK_DELAY_SETTING@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SDHCI_CLK_DELAY_SETTING@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_sdhci_writel
	mov	x0, x19
	ldr	w1, [sp, #16]                   ; 4-byte Folded Reload
	mov	x2, #0
	bl	_mmc_send_tuning
	cbnz	w0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	add	x22, x22, #1
	mov	x0, x19
	bl	_mmc_dev
	mov	x24, x0
	mov	x0, x19
	bl	_mmc_hostname
	mov	x2, x0
	str	x20, [sp]
	mov	x0, x24
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	cmn	w25, #1
	csel	w25, w20, w25, eq
	ldr	w8, [x28]
	sub	w8, w8, #1
	add	w9, w25, w20
	cmp	w9, #0
	cinc	w9, w9, lt
	cmp	w20, w8
	ccmp	w23, w27, #8, eq
	add	w23, w23, #1
	asr	w8, w9, #1
	csel	w26, w26, w8, lt
	mov	x21, x20
	b	LBB0_4
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	cbz	x22, LBB0_1
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w26, #1
	b.lt	LBB0_1
; %bb.9:
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	orr	w1, w26, w8
Lloh12:
	adrp	x8, _SDHCI_CLK_DELAY_SETTING@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SDHCI_CLK_DELAY_SETTING@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_sdhci_writel
	mov	x0, x19
	bl	_mmc_dev
	mov	x20, x0
	mov	x0, x19
	bl	_mmc_hostname
	mov	x2, x0
	str	x26, [sp]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	mov	w0, #0
	b	LBB0_11
LBB0_10:
	mov	x0, x19
	bl	_mmc_dev
	mov	x20, x0
	mov	x0, x19
	bl	_mmc_hostname
	mov	x2, x0
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
Lloh19:
	adrp	x8, _EIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_SDHCI_CLK_DELAY_SETTING,4,2    ; @SDHCI_CLK_DELAY_SETTING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Found good phase = %d\n"

	.comm	_SIRF_TUNING_COUNT,4,2          ; @SIRF_TUNING_COUNT
l_.str.1:                               ; @.str.1
	.asciz	"%s: Found bad phase = %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"%s: Setting the tuning phase to %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s: No tuning point found\n"

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