	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdhci_at91_set_clks_presets
_sdhci_at91_set_clks_presets:           ## @sdhci_at91_set_clks_presets
	.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
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_sdhci_priv
	movq	%rax, %rdi
	callq	_sdhci_pltfm_priv
	movq	%rax, %r15
	movl	8(%rax), %edi
	callq	_clk_prepare_enable
	movq	_SDHCI_CAPABILITIES@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movl	%eax, %ebx
	movq	_SDHCI_CAPABILITIES_1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movq	_SDHCI_CLOCK_V3_BASE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	movq	_SDHCI_CLOCK_BASE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %ebx
	movq	_SDHCI_CLOCK_MUL_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	andl	%eax, %r12d
	movq	_SDHCI_CLOCK_MUL_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrl	%cl, %r12d
	imull	$1000000, %ebx, %r13d           ## imm = 0xF4240
	incl	%r12d
	imull	%r13d, %r12d
	movl	(%r15), %edi
	movl	%r12d, %esi
	callq	_clk_set_rate
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	(%r15), %edi
	callq	_clk_get_rate
	movl	%eax, %r15d
	cmpl	%r12d, %eax
	je	LBB0_4
## %bb.3:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%r13d
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %r13d
	movq	_SDHCI_CLOCK_MUL_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r13d, %ebx
	shll	%cl, %ebx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	xorl	%eax, %ebx
	movq	_SDHCI_CLOCK_MUL_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	xorl	%eax, %ebx
	movq	_SDMMC_CACR_KEY@GOTPCREL(%rip), %rax
	movq	_SDMMC_CACR_CAPWREN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_SDMMC_CACR@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	addq	(%r14), %rsi
	callq	_writel
	movq	_SDHCI_CAPABILITIES_1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	(%r12), %rsi
	addq	(%r14), %rsi
	xorl	%edi, %edi
	callq	_writel
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %edx
	movl	%r15d, %ecx
	callq	_dev_info
LBB0_4:
	movl	%r15d, %edi
	movl	$24000000, %esi                 ## imm = 0x16E3600
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %edi
	movq	_SDHCI_AT91_PRESET_COMMON_CONF@GOTPCREL(%rip), %rbx
	orl	(%rbx), %edi
	movq	_SDHCI_PRESET_FOR_SDR12@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	callq	_writew
	movl	%r15d, %edi
	movl	$50000000, %esi                 ## imm = 0x2FAF080
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %edi
	orl	(%rbx), %edi
	movq	_SDHCI_PRESET_FOR_SDR25@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	callq	_writew
	movl	%r15d, %edi
	movl	$100000000, %esi                ## imm = 0x5F5E100
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %edi
	orl	(%rbx), %edi
	movq	_SDHCI_PRESET_FOR_SDR50@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	callq	_writew
	movl	%r15d, %edi
	movl	$120000000, %esi                ## imm = 0x7270E00
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %edi
	orl	(%rbx), %edi
	movq	_SDHCI_PRESET_FOR_SDR104@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	callq	_writew
	movl	%r15d, %edi
	movl	$50000000, %esi                 ## imm = 0x2FAF080
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %edi
	orl	(%rbx), %edi
	movq	_SDHCI_PRESET_FOR_DDR50@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	callq	_writew
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	4(%rbx), %edi
	callq	_clk_prepare_enable
	movl	(%rbx), %edi
	callq	_clk_prepare_enable
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movl	8(%r15), %edi
	callq	_clk_disable_unprepare
LBB0_5:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDHCI_CAPABILITIES,8,3         ## @SDHCI_CAPABILITIES
	.comm	_SDHCI_CAPABILITIES_1,8,3       ## @SDHCI_CAPABILITIES_1
	.comm	_SDHCI_CLOCK_V3_BASE_MASK,4,2   ## @SDHCI_CLOCK_V3_BASE_MASK
	.comm	_SDHCI_CLOCK_BASE_SHIFT,4,2     ## @SDHCI_CLOCK_BASE_SHIFT
	.comm	_SDHCI_CLOCK_MUL_MASK,4,2       ## @SDHCI_CLOCK_MUL_MASK
	.comm	_SDHCI_CLOCK_MUL_SHIFT,4,2      ## @SDHCI_CLOCK_MUL_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to set gck"

	.comm	_SDMMC_CACR_KEY,4,2             ## @SDMMC_CACR_KEY
	.comm	_SDMMC_CACR_CAPWREN,4,2         ## @SDMMC_CACR_CAPWREN
	.comm	_SDMMC_CACR,8,3                 ## @SDMMC_CACR
L_.str.1:                               ## @.str.1
	.asciz	"update clk mul to %u as gck rate is %u Hz\n"

	.comm	_SDHCI_AT91_PRESET_COMMON_CONF,4,2 ## @SDHCI_AT91_PRESET_COMMON_CONF
	.comm	_SDHCI_PRESET_FOR_SDR12,8,3     ## @SDHCI_PRESET_FOR_SDR12
	.comm	_SDHCI_PRESET_FOR_SDR25,8,3     ## @SDHCI_PRESET_FOR_SDR25
	.comm	_SDHCI_PRESET_FOR_SDR50,8,3     ## @SDHCI_PRESET_FOR_SDR50
	.comm	_SDHCI_PRESET_FOR_SDR104,8,3    ## @SDHCI_PRESET_FOR_SDR104
	.comm	_SDHCI_PRESET_FOR_DDR50,8,3     ## @SDHCI_PRESET_FOR_DDR50
	.no_dead_strip	_sdhci_at91_set_clks_presets
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdhci_at91_set_clks_presets
_sdhci_at91_set_clks_presets:           ; @sdhci_at91_set_clks_presets
	.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	x22, x0
	bl	_dev_get_drvdata
	mov	x20, x0
	bl	_sdhci_priv
	bl	_sdhci_pltfm_priv
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_clk_prepare_enable
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _SDHCI_CAPABILITIES@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SDHCI_CAPABILITIES@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	mov	x21, x0
	ldr	x8, [x20]
Lloh3:
	adrp	x25, _SDHCI_CAPABILITIES_1@GOTPAGE
Lloh4:
	ldr	x25, [x25, _SDHCI_CAPABILITIES_1@GOTPAGEOFF]
	ldr	x9, [x25]
	add	x0, x9, x8
	bl	_readl
	mov	x23, x0
Lloh5:
	adrp	x8, _SDHCI_CLOCK_V3_BASE_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SDHCI_CLOCK_V3_BASE_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	and	w8, w8, w21
Lloh8:
	adrp	x9, _SDHCI_CLOCK_BASE_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SDHCI_CLOCK_BASE_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	lsr	w8, w8, w9
Lloh11:
	adrp	x26, _SDHCI_CLOCK_MUL_MASK@GOTPAGE
Lloh12:
	ldr	x26, [x26, _SDHCI_CLOCK_MUL_MASK@GOTPAGEOFF]
	ldr	w9, [x26]
	and	w9, w9, w0
Lloh13:
	adrp	x27, _SDHCI_CLOCK_MUL_SHIFT@GOTPAGE
Lloh14:
	ldr	x27, [x27, _SDHCI_CLOCK_MUL_SHIFT@GOTPAGEOFF]
	ldr	w10, [x27]
	lsr	w9, w9, w10
	mov	w10, #16960
	movk	w10, #15, lsl #16
	mul	w28, w8, w10
	madd	w24, w28, w9, w28
	ldr	w0, [x19]
	mov	x1, x24
	bl	_clk_set_rate
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldr	w0, [x19]
	bl	_clk_get_rate
	mov	x21, x0
	cmp	w0, w24
	b.eq	LBB0_3
; %bb.2:
	udiv	w8, w21, w28
	sub	w24, w8, #1
	ldr	w8, [x26]
	bic	w9, w23, w8
	ldr	w10, [x27]
	lsl	w10, w24, w10
	and	w8, w10, w8
	orr	w23, w8, w9
Lloh15:
	adrp	x8, _SDMMC_CACR_KEY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SDMMC_CACR_KEY@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _SDMMC_CACR_CAPWREN@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SDMMC_CACR_CAPWREN@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [x20]
Lloh21:
	adrp	x26, _SDMMC_CACR@GOTPAGE
Lloh22:
	ldr	x26, [x26, _SDMMC_CACR@GOTPAGEOFF]
	ldr	x9, [x26]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x20]
	ldr	x9, [x25]
	add	x1, x9, x8
	mov	x0, x23
	bl	_writel
	ldr	x8, [x20]
	ldr	x9, [x26]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x24
	mov	x3, x21
	bl	_dev_info
LBB0_3:
	mov	x0, x21
	mov	w1, #13824
	movk	w1, #366, lsl #16
	bl	_DIV_ROUND_UP
	sub	w8, w0, #1
Lloh25:
	adrp	x22, _SDHCI_AT91_PRESET_COMMON_CONF@GOTPAGE
Lloh26:
	ldr	x22, [x22, _SDHCI_AT91_PRESET_COMMON_CONF@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w0, w9, w8
	ldr	x8, [x20]
Lloh27:
	adrp	x9, _SDHCI_PRESET_FOR_SDR12@GOTPAGE
Lloh28:
	ldr	x9, [x9, _SDHCI_PRESET_FOR_SDR12@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
	mov	x0, x21
	mov	w1, #61568
	movk	w1, #762, lsl #16
	bl	_DIV_ROUND_UP
	sub	w8, w0, #1
	ldr	w9, [x22]
	orr	w0, w9, w8
	ldr	x8, [x20]
Lloh30:
	adrp	x9, _SDHCI_PRESET_FOR_SDR25@GOTPAGE
Lloh31:
	ldr	x9, [x9, _SDHCI_PRESET_FOR_SDR25@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
	mov	x0, x21
	mov	w1, #57600
	movk	w1, #1525, lsl #16
	bl	_DIV_ROUND_UP
	sub	w8, w0, #1
	ldr	w9, [x22]
	orr	w0, w9, w8
	ldr	x8, [x20]
Lloh33:
	adrp	x9, _SDHCI_PRESET_FOR_SDR50@GOTPAGE
Lloh34:
	ldr	x9, [x9, _SDHCI_PRESET_FOR_SDR50@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
	mov	x0, x21
	mov	w1, #3584
	movk	w1, #1831, lsl #16
	bl	_DIV_ROUND_UP
	sub	w8, w0, #1
	ldr	w9, [x22]
	orr	w0, w9, w8
	ldr	x8, [x20]
Lloh36:
	adrp	x9, _SDHCI_PRESET_FOR_SDR104@GOTPAGE
Lloh37:
	ldr	x9, [x9, _SDHCI_PRESET_FOR_SDR104@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
	mov	x0, x21
	mov	w1, #61568
	movk	w1, #762, lsl #16
	bl	_DIV_ROUND_UP
	sub	w8, w0, #1
	ldr	w9, [x22]
	orr	w0, w9, w8
	ldr	x8, [x20]
Lloh39:
	adrp	x9, _SDHCI_PRESET_FOR_DDR50@GOTPAGE
Lloh40:
	ldr	x9, [x9, _SDHCI_PRESET_FOR_DDR50@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
	ldr	w0, [x19, #4]
	bl	_clk_prepare_enable
	ldr	w0, [x19]
	bl	_clk_prepare_enable
	mov	w21, #0
	b	LBB0_5
LBB0_4:
	mov	x21, x0
Lloh42:
	adrp	x1, l_.str@PAGE
Lloh43:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	ldr	w0, [x19, #8]
	bl	_clk_disable_unprepare
LBB0_5:
	mov	x0, x21
	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	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_SDHCI_CAPABILITIES,8,3         ; @SDHCI_CAPABILITIES
	.comm	_SDHCI_CAPABILITIES_1,8,3       ; @SDHCI_CAPABILITIES_1
	.comm	_SDHCI_CLOCK_V3_BASE_MASK,4,2   ; @SDHCI_CLOCK_V3_BASE_MASK
	.comm	_SDHCI_CLOCK_BASE_SHIFT,4,2     ; @SDHCI_CLOCK_BASE_SHIFT
	.comm	_SDHCI_CLOCK_MUL_MASK,4,2       ; @SDHCI_CLOCK_MUL_MASK
	.comm	_SDHCI_CLOCK_MUL_SHIFT,4,2      ; @SDHCI_CLOCK_MUL_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to set gck"

	.comm	_SDMMC_CACR_KEY,4,2             ; @SDMMC_CACR_KEY
	.comm	_SDMMC_CACR_CAPWREN,4,2         ; @SDMMC_CACR_CAPWREN
	.comm	_SDMMC_CACR,8,3                 ; @SDMMC_CACR
l_.str.1:                               ; @.str.1
	.asciz	"update clk mul to %u as gck rate is %u Hz\n"

	.comm	_SDHCI_AT91_PRESET_COMMON_CONF,4,2 ; @SDHCI_AT91_PRESET_COMMON_CONF
	.comm	_SDHCI_PRESET_FOR_SDR12,8,3     ; @SDHCI_PRESET_FOR_SDR12
	.comm	_SDHCI_PRESET_FOR_SDR25,8,3     ; @SDHCI_PRESET_FOR_SDR25
	.comm	_SDHCI_PRESET_FOR_SDR50,8,3     ; @SDHCI_PRESET_FOR_SDR50
	.comm	_SDHCI_PRESET_FOR_SDR104,8,3    ; @SDHCI_PRESET_FOR_SDR104
	.comm	_SDHCI_PRESET_FOR_DDR50,8,3     ; @SDHCI_PRESET_FOR_DDR50
	.no_dead_strip	_sdhci_at91_set_clks_presets
.subsections_via_symbols
