	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uniphier_sd_clk_enable
_uniphier_sd_clk_enable:                ## @uniphier_sd_clk_enable
	.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
	movq	%rdi, %rbx
	callq	_uniphier_sd_priv
	movq	%rax, %r14
	movq	(%rbx), %r15
	movl	8(%rax), %edi
	callq	_clk_prepare_enable
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movl	8(%r14), %edi
	movq	_ULONG_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_clk_set_rate
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.2:
	movl	8(%r14), %edi
	callq	_clk_get_rate
	movl	%eax, (%r14)
	cmpl	$0, (%r15)
	jne	LBB0_4
## %bb.3:
	movl	%eax, (%r15)
LBB0_4:
	movq	_UNIPHIER_SD_CAP_EXTENDED_IP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%esi, %esi
	andl	4(%r14), %ecx
	setne	%sil
	shll	$9, %esi
	addl	$512, %esi                      ## imm = 0x200
	cltd
	idivl	%esi
	movl	%eax, 4(%r15)
	movl	12(%r14), %edi
	callq	_reset_control_deassert
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movl	16(%r14), %edi
	callq	_reset_control_deassert
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	%eax, %ebx
	movl	12(%r14), %edi
	callq	_reset_control_assert
LBB0_8:
	movl	8(%r14), %edi
	callq	_clk_disable_unprepare
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_ULONG_MAX,4,2                  ## @ULONG_MAX
	.comm	_UNIPHIER_SD_CAP_EXTENDED_IP,4,2 ## @UNIPHIER_SD_CAP_EXTENDED_IP
	.no_dead_strip	_uniphier_sd_clk_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uniphier_sd_clk_enable
_uniphier_sd_clk_enable:                ; @uniphier_sd_clk_enable
	.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, x0
	bl	_uniphier_sd_priv
	mov	x19, x0
	ldr	x21, [x20]
	ldr	w0, [x0, #8]
	bl	_clk_prepare_enable
	mov	x20, x0
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x8, _ULONG_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ULONG_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_clk_set_rate
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.2:
	ldr	w0, [x19, #8]
	bl	_clk_get_rate
	str	w0, [x19]
	ldr	w8, [x21]
	cbnz	w8, LBB0_4
; %bb.3:
	str	w0, [x21]
LBB0_4:
	ldr	w8, [x19, #4]
Lloh3:
	adrp	x9, _UNIPHIER_SD_CAP_EXTENDED_IP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _UNIPHIER_SD_CAP_EXTENDED_IP@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #1024
	mov	w9, #512
	csel	w8, w9, w8, eq
	sdiv	w8, w0, w8
	str	w8, [x21, #4]
	ldr	w0, [x19, #12]
	bl	_reset_control_deassert
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.5:
	ldr	w0, [x19, #16]
	bl	_reset_control_deassert
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.6:
	ldr	w0, [x19, #12]
	bl	_reset_control_assert
LBB0_7:
	ldr	w0, [x19, #8]
	bl	_clk_disable_unprepare
LBB0_8:
	mov	x0, x20
	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	_ULONG_MAX,4,2                  ; @ULONG_MAX
	.comm	_UNIPHIER_SD_CAP_EXTENDED_IP,4,2 ; @UNIPHIER_SD_CAP_EXTENDED_IP
	.no_dead_strip	_uniphier_sd_clk_enable
.subsections_via_symbols
