	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uniphier_sd_set_clock
_uniphier_sd_set_clock:                 ## @uniphier_sd_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
	pushq	%rax
	.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, %r14
	callq	_uniphier_sd_priv
	movq	%rax, %r15
	movq	_CTL_SD_CARD_CLK_CTL@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	addl	%eax, %eax
	movslq	%eax, %rdi
	addq	(%r14), %rdi
	callq	_readl
	movq	_CLK_CTL_SCLKEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movl	(%r13), %eax
	addl	%eax, %eax
	movslq	%eax, %rsi
	addq	(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.1:
	movq	_UNIPHIER_SD_CLK_CTL_DIV1024@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_UNIPHIER_SD_CLK_CTL_DIV1@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%r13d, %eax
	orl	%ecx, %eax
	movq	_CLK_CTL_DIV_MASK@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	notl	%eax
	andl	%eax, %ebx
	movl	(%r15), %eax
	xorl	%edx, %edx
	divl	%r12d
                                        ## kill: def $eax killed $eax def $rax
	cmpl	$2, %eax
	jb	LBB0_5
## %bb.2:
	movq	_UNIPHIER_SD_CAP_EXTENDED_IP@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 4(%r15)
	je	LBB0_4
## %bb.3:
	movl	%ecx, %r13d
	cmpl	$512, %eax                      ## imm = 0x200
	ja	LBB0_5
LBB0_4:
	movq	%rax, %rdi
	callq	_roundup_pow_of_two
	movl	%eax, %r13d
	sarl	$2, %r13d
LBB0_5:
	orl	%ebx, %r13d
	movq	_CTL_SD_CARD_CLK_CTL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	addl	%eax, %eax
	movslq	%eax, %rsi
	addq	(%r14), %rsi
	movl	%r13d, %edi
	callq	_writel
	movq	_CLK_CTL_SCLKEN@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
	movl	(%rbx), %eax
	addl	%eax, %eax
	movslq	%eax, %rsi
	addq	(%r14), %rsi
	movl	%r13d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CTL_SD_CARD_CLK_CTL,4,2        ## @CTL_SD_CARD_CLK_CTL
	.comm	_CLK_CTL_SCLKEN,4,2             ## @CLK_CTL_SCLKEN
	.comm	_UNIPHIER_SD_CLK_CTL_DIV1024,4,2 ## @UNIPHIER_SD_CLK_CTL_DIV1024
	.comm	_UNIPHIER_SD_CLK_CTL_DIV1,4,2   ## @UNIPHIER_SD_CLK_CTL_DIV1
	.comm	_CLK_CTL_DIV_MASK,4,2           ## @CLK_CTL_DIV_MASK
	.comm	_UNIPHIER_SD_CAP_EXTENDED_IP,4,2 ## @UNIPHIER_SD_CAP_EXTENDED_IP
	.no_dead_strip	_uniphier_sd_set_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uniphier_sd_set_clock
_uniphier_sd_set_clock:                 ; @uniphier_sd_set_clock
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_uniphier_sd_priv
	mov	x20, x0
	ldr	x8, [x19]
Lloh0:
	adrp	x23, _CTL_SD_CARD_CLK_CTL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CTL_SD_CARD_CLK_CTL@GOTPAGEOFF]
	ldr	w9, [x23]
	lsl	w9, w9, #1
	add	x0, x8, w9, sxtw
	bl	_readl
Lloh2:
	adrp	x24, _CLK_CTL_SCLKEN@GOTPAGE
Lloh3:
	ldr	x24, [x24, _CLK_CTL_SCLKEN@GOTPAGEOFF]
	ldr	w8, [x24]
	bic	w22, w0, w8
	ldr	x8, [x19]
	ldr	w9, [x23]
	lsl	w9, w9, #1
	add	x1, x8, w9, sxtw
	mov	x0, x22
	bl	_writel
	cbz	w21, LBB0_6
; %bb.1:
Lloh4:
	adrp	x8, _UNIPHIER_SD_CLK_CTL_DIV1024@GOTPAGE
Lloh5:
	ldr	x8, [x8, _UNIPHIER_SD_CLK_CTL_DIV1024@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _UNIPHIER_SD_CLK_CTL_DIV1@GOTPAGE
Lloh8:
	ldr	x9, [x9, _UNIPHIER_SD_CLK_CTL_DIV1@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w10, w9, w8
Lloh10:
	adrp	x11, _CLK_CTL_DIV_MASK@GOTPAGE
Lloh11:
	ldr	x11, [x11, _CLK_CTL_DIV_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w11, [x11]
	orr	w10, w10, w11
	bic	w22, w22, w10
	ldr	w10, [x20]
	udiv	w0, w10, w21
	cmp	w0, #2
	b.lo	LBB0_5
; %bb.2:
	ldr	w9, [x20, #4]
Lloh13:
	adrp	x10, _UNIPHIER_SD_CAP_EXTENDED_IP@GOTPAGE
Lloh14:
	ldr	x10, [x10, _UNIPHIER_SD_CAP_EXTENDED_IP@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_4
; %bb.3:
	mov	x9, x8
	cmp	w0, #512
	b.hi	LBB0_5
LBB0_4:
	bl	_roundup_pow_of_two
	asr	w9, w0, #2
LBB0_5:
	orr	w20, w9, w22
	ldr	x8, [x19]
	ldr	w9, [x23]
	lsl	w9, w9, #1
	add	x1, x8, w9, sxtw
	mov	x0, x20
	bl	_writel
	ldr	w8, [x24]
	orr	w0, w8, w20
	ldr	x8, [x19]
	ldr	w9, [x23]
	lsl	w9, w9, #1
	add	x1, x8, w9, sxtw
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_writel
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_CTL_SD_CARD_CLK_CTL,4,2        ; @CTL_SD_CARD_CLK_CTL
	.comm	_CLK_CTL_SCLKEN,4,2             ; @CLK_CTL_SCLKEN
	.comm	_UNIPHIER_SD_CLK_CTL_DIV1024,4,2 ; @UNIPHIER_SD_CLK_CTL_DIV1024
	.comm	_UNIPHIER_SD_CLK_CTL_DIV1,4,2   ; @UNIPHIER_SD_CLK_CTL_DIV1
	.comm	_CLK_CTL_DIV_MASK,4,2           ; @CLK_CTL_DIV_MASK
	.comm	_UNIPHIER_SD_CAP_EXTENDED_IP,4,2 ; @UNIPHIER_SD_CAP_EXTENDED_IP
	.no_dead_strip	_uniphier_sd_set_clock
.subsections_via_symbols
