	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function esdhc_pltfm_set_clock
_esdhc_pltfm_set_clock:                 ## @esdhc_pltfm_set_clock
	.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, %r12d
	movq	%rdi, %r15
	callq	_sdhci_priv
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_sdhci_pltfm_priv
	movq	%rax, %r14
	cmpq	$1, (%rax)
	movl	(%rbx), %r13d
	movl	$2, %eax
	sbbl	$0, %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_esdhc_is_usdhc
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ESDHC_VENDOR_SPEC@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	(%r15), %rdi
	callq	_readl
	movq	_ESDHC_VENDOR_SPEC_FRC_SDCLK_ON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%edi
	andl	%eax, %edi
	movq	(%rbx), %rsi
	addq	(%r15), %rsi
	callq	_writel
LBB0_2:
	testl	%r12d, %r12d
	je	LBB0_17
## %bb.3:
	movq	%r14, %rdi
	callq	_is_imx53_esdhc
	testq	%rax, %rax
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.5:
	movq	_ESDHC_DLL_CTRL@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	(%r15), %rdi
	callq	_readl
	movl	%eax, %ebx
	movl	$10, %edi
	callq	_BIT
	orl	%ebx, %eax
	movq	(%r14), %rsi
	addq	(%r15), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	(%r14), %rdi
	addq	(%r15), %rdi
	callq	_readl
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	(%r14), %rsi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	addq	(%r15), %rsi
	movl	%ebx, %edi
	callq	_writel
	movl	$10, %edi
	callq	_BIT
	andl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	cmpl	$1, %eax
	movq	%r15, %rbx
	movl	$2, %r15d
	sbbl	$0, %r15d
	jmp	LBB0_6
LBB0_17:
	movq	8(%r15), %rax
	movl	$0, (%rax)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r15, %rbx
	movl	$1, %r15d
LBB0_6:
	movq	_ESDHC_SYSTEM_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sdhci_readl
	movq	_ESDHC_CLOCK_IPGEN@GOTPCREL(%rip), %rdx
	movq	_ESDHC_CLOCK_HCKEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rdx), %esi
	movq	_ESDHC_CLOCK_PEREN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %esi
	movq	_ESDHC_CLOCK_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	movq	_ESDHC_SYSTEM_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_sdhci_writel
	movq	8(%r14), %rax
	movq	_ESDHC_FLAG_ERR010450@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_8
## %bb.7:
	cmpq	$0, (%r14)
	movl	$150000000, %eax                ## imm = 0x8F0D180
	movl	$45000000, %esi                 ## imm = 0x2AEA540
	cmovel	%eax, %esi
	movl	%r12d, %edi
	callq	_min
	movl	%eax, %r12d
LBB0_8:
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, %ecx
	shll	$4, %ecx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %r14d
	movl	%ecx, %esi
	imull	%r15d, %esi
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%esi
	cmpl	%r12d, %eax
	jbe	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	leal	(%r14,%r14), %r15d
	cmpl	$256, %r14d                     ## imm = 0x100
	jb	LBB0_9
LBB0_11:
	imull	%r14d, %edi
	movl	$-1, %esi
	movl	%edi, %ecx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%ecx
	leal	1(%rsi), %ebx
	cmpl	%r12d, %eax
	jbe	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	addl	$2, %esi
	addl	%edi, %ecx
	cmpl	$16, %esi
	movl	%ebx, %esi
	jb	LBB0_12
LBB0_14:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rdi
	movl	%eax, (%rdi)
	callq	_mmc_dev
	movq	8(%r15), %rcx
	movl	(%rcx), %ecx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r12d, %edx
	callq	_dev_dbg
	shrl	%r14d
	movq	_ESDHC_SYSTEM_CONTROL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_sdhci_readl
	movq	_ESDHC_DIVIDER_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	movq	_ESDHC_PREDIV_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r14d
	orl	%ebx, %r14d
	movq	_ESDHC_CLOCK_IPGEN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_ESDHC_CLOCK_HCKEN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_ESDHC_CLOCK_PEREN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	%eax, %r14d
	movl	(%r12), %edx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_sdhci_writel
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_esdhc_is_usdhc
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	_ESDHC_VENDOR_SPEC@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	(%r15), %rdi
	callq	_readl
	movq	_ESDHC_VENDOR_SPEC_FRC_SDCLK_ON@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%rbx), %rsi
	addq	(%r15), %rsi
	movl	%eax, %edi
	callq	_writel
LBB0_16:
	movl	$1, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mdelay                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ESDHC_VENDOR_SPEC,8,3          ## @ESDHC_VENDOR_SPEC
	.comm	_ESDHC_VENDOR_SPEC_FRC_SDCLK_ON,4,2 ## @ESDHC_VENDOR_SPEC_FRC_SDCLK_ON
	.comm	_ESDHC_DLL_CTRL,8,3             ## @ESDHC_DLL_CTRL
	.comm	_ESDHC_SYSTEM_CONTROL,4,2       ## @ESDHC_SYSTEM_CONTROL
	.comm	_ESDHC_CLOCK_IPGEN,4,2          ## @ESDHC_CLOCK_IPGEN
	.comm	_ESDHC_CLOCK_HCKEN,4,2          ## @ESDHC_CLOCK_HCKEN
	.comm	_ESDHC_CLOCK_PEREN,4,2          ## @ESDHC_CLOCK_PEREN
	.comm	_ESDHC_CLOCK_MASK,4,2           ## @ESDHC_CLOCK_MASK
	.comm	_ESDHC_FLAG_ERR010450,4,2       ## @ESDHC_FLAG_ERR010450
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"desired SD clock: %d, actual: %d\n"

	.comm	_ESDHC_DIVIDER_SHIFT,4,2        ## @ESDHC_DIVIDER_SHIFT
	.comm	_ESDHC_PREDIV_SHIFT,4,2         ## @ESDHC_PREDIV_SHIFT
	.no_dead_strip	_esdhc_pltfm_set_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function esdhc_pltfm_set_clock
_esdhc_pltfm_set_clock:                 ; @esdhc_pltfm_set_clock
	.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	x21, x1
	mov	x19, x0
	bl	_sdhci_priv
	mov	x22, x0
	bl	_sdhci_pltfm_priv
	mov	x20, x0
	ldr	w26, [x22]
	ldr	x8, [x0]
	cmp	x8, #0
	mov	w8, #1
	cinc	w27, w8, ne
	bl	_esdhc_is_usdhc
Lloh0:
	adrp	x22, _ESDHC_VENDOR_SPEC@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ESDHC_VENDOR_SPEC@GOTPAGEOFF]
Lloh2:
	adrp	x23, _ESDHC_VENDOR_SPEC_FRC_SDCLK_ON@GOTPAGE
Lloh3:
	ldr	x23, [x23, _ESDHC_VENDOR_SPEC_FRC_SDCLK_ON@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x19]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x23]
	bic	w0, w0, w8
	ldr	x8, [x19]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
LBB0_2:
	cbz	w21, LBB0_15
; %bb.3:
	mov	x0, x20
	bl	_is_imx53_esdhc
	mov	w25, #1
	cbz	x0, LBB0_5
; %bb.4:
	ldr	x8, [x19]
Lloh4:
	adrp	x24, _ESDHC_DLL_CTRL@GOTPAGE
Lloh5:
	ldr	x24, [x24, _ESDHC_DLL_CTRL@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	mov	x22, x0
	mov	w0, #10
	bl	_BIT
	orr	w0, w0, w22
	ldr	x8, [x19]
	ldr	x9, [x24]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	mov	x23, x0
	ldr	x8, [x19]
	ldr	x9, [x24]
	add	x1, x9, x8
	mov	x0, x22
	bl	_writel
	mov	w0, #10
	bl	_BIT
	tst	w0, w23
	cinc	w25, w25, ne
LBB0_5:
Lloh6:
	adrp	x22, _ESDHC_SYSTEM_CONTROL@GOTPAGE
Lloh7:
	ldr	x22, [x22, _ESDHC_SYSTEM_CONTROL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_sdhci_readl
Lloh8:
	adrp	x8, _ESDHC_CLOCK_IPGEN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ESDHC_CLOCK_IPGEN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x23, _ESDHC_CLOCK_HCKEN@GOTPAGE
Lloh12:
	ldr	x23, [x23, _ESDHC_CLOCK_HCKEN@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w8, w9, w8
Lloh13:
	adrp	x24, _ESDHC_CLOCK_PEREN@GOTPAGE
Lloh14:
	ldr	x24, [x24, _ESDHC_CLOCK_PEREN@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _ESDHC_CLOCK_MASK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ESDHC_CLOCK_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
	bic	w1, w0, w8
	ldr	w2, [x22]
	mov	x0, x19
	bl	_sdhci_writel
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _ESDHC_FLAG_ERR010450@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ESDHC_FLAG_ERR010450@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	ldr	x8, [x20]
	cmp	x8, #0
	mov	w8, #42304
	movk	w8, #686, lsl #16
	mov	w9, #53632
	movk	w9, #2288, lsl #16
	csel	w1, w9, w8, eq
	mov	x0, x21
	bl	_min
	mov	x21, x0
LBB0_7:
	lsl	w8, w27, #4
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x28, x25
	mul	w9, w8, w25
	udiv	w9, w26, w9
	cmp	w9, w21
	b.ls	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	lsl	w25, w28, #1
	cmp	w28, #256
	b.lo	LBB0_8
LBB0_10:
	mul	w8, w27, w28
	mov	w25, #-1
	mov	x9, x8
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	w11, w25, #2
	udiv	w10, w26, w9
	add	w25, w25, #1
	add	w9, w9, w8
	cmp	w10, w21
	ccmp	w11, #16, #2, hi
	b.lo	LBB0_11
; %bb.12:
	ldr	x0, [x19, #8]
	str	w10, [x0]
	bl	_mmc_dev
	ldr	x8, [x19, #8]
	ldr	w3, [x8]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	lsr	w21, w28, #1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_sdhci_readl
Lloh23:
	adrp	x8, _ESDHC_CLOCK_IPGEN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ESDHC_CLOCK_IPGEN@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	ldr	w9, [x23]
	ldr	w10, [x24]
Lloh26:
	adrp	x11, _ESDHC_DIVIDER_SHIFT@GOTPAGE
Lloh27:
	ldr	x11, [x11, _ESDHC_DIVIDER_SHIFT@GOTPAGEOFF]
Lloh28:
	ldr	w11, [x11]
	lsl	w11, w25, w11
Lloh29:
	adrp	x12, _ESDHC_PREDIV_SHIFT@GOTPAGE
Lloh30:
	ldr	x12, [x12, _ESDHC_PREDIV_SHIFT@GOTPAGEOFF]
Lloh31:
	ldr	w12, [x12]
	lsl	w12, w21, w12
	orr	w8, w8, w0
	orr	w8, w8, w9
	orr	w8, w8, w10
	orr	w8, w8, w11
	orr	w1, w8, w12
	ldr	w2, [x22]
	mov	x0, x19
	bl	_sdhci_writel
	mov	x0, x20
	bl	_esdhc_is_usdhc
	cbz	x0, LBB0_14
; %bb.13:
	ldr	x8, [x19]
Lloh32:
	adrp	x20, _ESDHC_VENDOR_SPEC@GOTPAGE
Lloh33:
	ldr	x20, [x20, _ESDHC_VENDOR_SPEC@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh34:
	adrp	x8, _ESDHC_VENDOR_SPEC_FRC_SDCLK_ON@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ESDHC_VENDOR_SPEC_FRC_SDCLK_ON@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
LBB0_14:
	mov	w0, #1
	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
	b	_mdelay
LBB0_15:
	ldr	x8, [x19, #8]
	str	wzr, [x8]
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_ESDHC_VENDOR_SPEC,8,3          ; @ESDHC_VENDOR_SPEC
	.comm	_ESDHC_VENDOR_SPEC_FRC_SDCLK_ON,4,2 ; @ESDHC_VENDOR_SPEC_FRC_SDCLK_ON
	.comm	_ESDHC_DLL_CTRL,8,3             ; @ESDHC_DLL_CTRL
	.comm	_ESDHC_SYSTEM_CONTROL,4,2       ; @ESDHC_SYSTEM_CONTROL
	.comm	_ESDHC_CLOCK_IPGEN,4,2          ; @ESDHC_CLOCK_IPGEN
	.comm	_ESDHC_CLOCK_HCKEN,4,2          ; @ESDHC_CLOCK_HCKEN
	.comm	_ESDHC_CLOCK_PEREN,4,2          ; @ESDHC_CLOCK_PEREN
	.comm	_ESDHC_CLOCK_MASK,4,2           ; @ESDHC_CLOCK_MASK
	.comm	_ESDHC_FLAG_ERR010450,4,2       ; @ESDHC_FLAG_ERR010450
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"desired SD clock: %d, actual: %d\n"

	.comm	_ESDHC_DIVIDER_SHIFT,4,2        ; @ESDHC_DIVIDER_SHIFT
	.comm	_ESDHC_PREDIV_SHIFT,4,2         ; @ESDHC_PREDIV_SHIFT
	.no_dead_strip	_esdhc_pltfm_set_clock
.subsections_via_symbols
