	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_mmc_resampling_tuning
_meson_mmc_resampling_tuning:           ## @meson_mmc_resampling_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	callq	_mmc_priv
	movq	%rax, %r15
	movl	20(%rax), %edi
	callq	_clk_get_rate
	movl	%eax, %ebx
	movl	16(%r15), %edi
	callq	_clk_get_rate
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	(%r15), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	callq	_readl
	movl	%eax, %ebx
	movq	_ADJUST_ADJ_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	(%r15), %rax
	movq	(%rax), %rsi
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	addq	8(%r15), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%r14)
	je	LBB0_1
## %bb.2:
	movq	_ADJUST_ADJ_DELAY_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_FIELD_GET
	movl	%eax, %r14d
	incl	%r14d
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_4
	jmp	LBB0_8
LBB0_1:
	xorl	%r14d, %r14d
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
LBB0_4:
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_ADJUST_ADJ_DELAY_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, %r13d
	notl	%r13d
	andl	%ebx, %r13d
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	-44(%rbp)                       ## 4-byte Folded Reload
	movl	%edx, %r15d
	movl	%edx, %esi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	orl	%r13d, %ebx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rax
	movq	(%rax), %rsi
	addq	8(%rcx), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	callq	_mmc_send_tuning
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	incl	%r14d
	decl	%r12d
	jne	LBB0_6
LBB0_8:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_meson_mmc_reset_resampling
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_7:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r15d, %edx
	callq	_dev_dbg
	xorl	%eax, %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADJUST_ADJ_EN,4,2              ## @ADJUST_ADJ_EN
	.comm	_ADJUST_ADJ_DELAY_MASK,4,2      ## @ADJUST_ADJ_DELAY_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"resampling delay: %u\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meson_mmc_resampling_tuning
_meson_mmc_resampling_tuning:           ; @meson_mmc_resampling_tuning
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	bl	_mmc_priv
	mov	x21, x0
	ldr	w0, [x0, #20]
	bl	_clk_get_rate
	mov	x22, x0
	ldr	w0, [x21, #16]
	bl	_clk_get_rate
	mov	x1, x0
	mov	x0, x22
	bl	_DIV_ROUND_UP
	mov	x22, x0
	ldp	x9, x8, [x21]
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh0:
	adrp	x8, _ADJUST_ADJ_EN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ADJUST_ADJ_EN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	orr	w23, w8, w0
	ldp	x9, x8, [x21]
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x23
	bl	_writel
	ldr	x8, [x19]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ADJUST_ADJ_DELAY_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ADJUST_ADJ_DELAY_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_FIELD_GET
	add	w25, w0, #1
	cbnz	w22, LBB0_3
	b	LBB0_6
LBB0_2:
	mov	w25, #0
	cbz	w22, LBB0_6
LBB0_3:
Lloh6:
	adrp	x26, _ADJUST_ADJ_DELAY_MASK@GOTPAGE
Lloh7:
	ldr	x26, [x26, _ADJUST_ADJ_DELAY_MASK@GOTPAGEOFF]
	mov	x27, x22
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x26]
	bic	w23, w23, w0
	udiv	w8, w25, w22
	msub	w24, w8, w22, w25
	mov	x1, x24
	bl	_FIELD_PREP
	orr	w23, w0, w23
	ldp	x9, x8, [x21]
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x23
	bl	_writel
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_mmc_send_tuning
	cbz	w0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w25, w25, #1
	subs	w27, w27, #1
	b.ne	LBB0_4
LBB0_6:
	mov	x0, x21
	bl	_meson_mmc_reset_resampling
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	bl	_mmc_dev
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x24
	bl	_dev_dbg
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ADJUST_ADJ_EN,4,2              ; @ADJUST_ADJ_EN
	.comm	_ADJUST_ADJ_DELAY_MASK,4,2      ; @ADJUST_ADJ_DELAY_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"resampling delay: %u\n"

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