	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _sdhci_sprd_set_clock
__sdhci_sprd_set_clock:                 ## @_sdhci_sprd_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, %r14d
	movq	%rdi, %rbx
	callq	_TO_SPRD_HOST
	movq	%rax, %r15
	movq	_SDHCI_CLOCK_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_sdhci_writew
	movl	(%r15), %edi
	movl	%r14d, %esi
	callq	_sdhci_sprd_calc_div
	movl	%eax, %ecx
	shrl	$2, %ecx
	andl	$192, %ecx
	shll	$8, %eax
	movzwl	%ax, %esi
	orl	%ecx, %esi
	movq	%rbx, %rdi
	callq	_sdhci_enable_clk
	movq	_SDHCI_SPRD_REG_32_BUSY_POSI@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_sdhci_readl
	movq	_SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN@GOTPCREL(%rip), %rcx
	movq	_SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movl	%eax, %ecx
	notl	%ecx
	testl	%ecx, %esi
	jne	LBB0_2
## %bb.1:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	orl	%eax, %esi
	movl	(%r14), %edx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sdhci_writel                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SDHCI_CLOCK_CONTROL,4,2        ## @SDHCI_CLOCK_CONTROL
	.comm	_SDHCI_SPRD_REG_32_BUSY_POSI,4,2 ## @SDHCI_SPRD_REG_32_BUSY_POSI
	.comm	_SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN,4,2 ## @SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN
	.comm	_SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN,4,2 ## @SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN
	.no_dead_strip	__sdhci_sprd_set_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _sdhci_sprd_set_clock
__sdhci_sprd_set_clock:                 ; @_sdhci_sprd_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	x20, x1
	mov	x19, x0
	bl	_TO_SPRD_HOST
	mov	x21, 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
	ldr	w0, [x21]
	mov	x1, x20
	bl	_sdhci_sprd_calc_div
	lsr	w8, w0, #2
	and	w1, w8, #0xc0
	bfi	w1, w0, #8, #8
	mov	x0, x19
	bl	_sdhci_enable_clk
Lloh3:
	adrp	x20, _SDHCI_SPRD_REG_32_BUSY_POSI@GOTPAGE
Lloh4:
	ldr	x20, [x20, _SDHCI_SPRD_REG_32_BUSY_POSI@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_sdhci_readl
Lloh5:
	adrp	x8, _SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bics	wzr, w8, w0
	b.ne	LBB0_2
; %bb.1:
	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
LBB0_2:
	orr	w1, w8, w0
	ldr	w2, [x20]
	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_writel
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SDHCI_CLOCK_CONTROL,4,2        ; @SDHCI_CLOCK_CONTROL
	.comm	_SDHCI_SPRD_REG_32_BUSY_POSI,4,2 ; @SDHCI_SPRD_REG_32_BUSY_POSI
	.comm	_SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN,4,2 ; @SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN
	.comm	_SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN,4,2 ; @SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN
	.no_dead_strip	__sdhci_sprd_set_clock
.subsections_via_symbols
