	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aspeed_sdhci_set_clock
_aspeed_sdhci_set_clock:                ## @aspeed_sdhci_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_sdhci_priv
	movl	(%rax), %edi
	callq	_clk_get_rate
	movq	%rax, %r14
	movq	_SDHCI_CLOCK_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_sdhci_writew
	testl	%ebx, %ebx
	je	LBB0_12
## %bb.1:
	xorl	%edi, %edi
	cmpl	%ebx, (%r15)
	setb	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	(%r15), %ebx
LBB0_3:
	movl	%ebx, %eax
	xorl	%esi, %esi
	cmpq	%rax, %r14
	jbe	LBB0_11
## %bb.4:
	movq	%r14, %rcx
	shrq	%rcx
	movl	$1, %esi
	cmpq	%rax, %rcx
	jbe	LBB0_11
## %bb.5:
	movq	%r14, %rcx
	shrq	$2, %rcx
	movl	$2, %esi
	cmpq	%rax, %rcx
	jbe	LBB0_11
## %bb.6:
	movq	%r14, %rcx
	shrq	$3, %rcx
	movl	$4, %esi
	cmpq	%rax, %rcx
	jbe	LBB0_11
## %bb.7:
	movq	%r14, %rcx
	shrq	$4, %rcx
	movl	$8, %esi
	cmpq	%rax, %rcx
	jbe	LBB0_11
## %bb.8:
	movq	%r14, %rcx
	shrq	$5, %rcx
	movl	$16, %esi
	cmpq	%rax, %rcx
	jbe	LBB0_11
## %bb.9:
	movq	%r14, %rcx
	shrq	$6, %rcx
	movl	$32, %esi
	cmpq	%rax, %rcx
	jbe	LBB0_11
## %bb.10:
	shrq	$7, %r14
	xorl	%esi, %esi
	cmpq	%rax, %r14
	seta	%sil
	shll	$6, %esi
	addl	$64, %esi
LBB0_11:
	movq	_SDHCI_DIVIDER_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sdhci_enable_clk               ## TAILCALL
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDHCI_CLOCK_CONTROL,4,2        ## @SDHCI_CLOCK_CONTROL
	.comm	_SDHCI_DIVIDER_SHIFT,4,2        ## @SDHCI_DIVIDER_SHIFT
	.no_dead_strip	_aspeed_sdhci_set_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aspeed_sdhci_set_clock
_aspeed_sdhci_set_clock:                ; @aspeed_sdhci_set_clock
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_sdhci_priv
	ldr	w0, [x0]
	bl	_clk_get_rate
	mov	x20, x0
Lloh0:
	adrp	x8, _SDHCI_CLOCK_CONTROL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDHCI_CLOCK_CONTROL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_sdhci_writew
	cbz	w21, LBB0_4
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, w21
	cset	w0, lo
	bl	_WARN_ON
	cbz	x0, LBB0_3
; %bb.2:
	ldr	w21, [x19]
LBB0_3:
	mov	w8, w21
	mov	w9, #1
	mov	w10, #2
	mov	w11, #4
	mov	w12, #8
	mov	w13, #16
	mov	w14, #32
	cmp	x8, x20, lsr #7
	mov	w15, #64
	mov	w16, #128
	csel	w15, w16, w15, lo
	cmp	x8, x20, lsr #6
	csel	w14, w14, w15, hs
	cmp	x8, x20, lsr #5
	csel	w13, w13, w14, hs
	cmp	x8, x20, lsr #4
	csel	w12, w12, w13, hs
	cmp	x8, x20, lsr #3
	csel	w11, w11, w12, hs
	cmp	x8, x20, lsr #2
	csel	w10, w10, w11, hs
	cmp	x8, x20, lsr #1
	csel	w9, w9, w10, hs
	cmp	x20, x8
	csel	w8, wzr, w9, ls
Lloh3:
	adrp	x9, _SDHCI_DIVIDER_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SDHCI_DIVIDER_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsl	w1, w8, w9
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_sdhci_enable_clk
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SDHCI_CLOCK_CONTROL,4,2        ; @SDHCI_CLOCK_CONTROL
	.comm	_SDHCI_DIVIDER_SHIFT,4,2        ; @SDHCI_DIVIDER_SHIFT
	.no_dead_strip	_aspeed_sdhci_set_clock
.subsections_via_symbols
