	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function renesas_sdhi_clk_update
_renesas_sdhi_clk_update:               ## @renesas_sdhi_clk_update
	.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
	movl	%esi, %r12d
	movq	%rdi, %rbx
	callq	_host_to_priv
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	_TMIO_MMC_MIN_RCAR2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_8
## %bb.1:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_UINT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %edi
	callq	_ilog2
	movl	$9, %edi
	movl	%eax, %esi
	callq	_min
	testl	%eax, %eax
	js	LBB0_7
## %bb.2:
	movl	%eax, %r13d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$-1, %r14d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %edx
	movl	%r13d, %ecx
	shrl	%cl, %edx
	movl	%r12d, %ecx
	subl	%edx, %ecx
	cmpl	%r14d, %ecx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	cmovbel	%eax, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	cmovbl	%ecx, %r14d
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	leal	-1(%r13), %eax
	testl	%r13d, %r13d
	movl	%eax, %r13d
	jle	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movl	%r12d, %ebx
	movl	%r13d, %ecx
	shll	%cl, %ebx
	movl	%ebx, %esi
	callq	_clk_round_rate
	cmpl	%ebx, %eax
	jbe	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %edi
	movl	%ebx, %eax
	shrl	$2, %eax
	leal	(%rax,%rax,2), %esi
	callq	_clk_round_rate
	cmpl	%ebx, %eax
	jbe	LBB0_5
	jmp	LBB0_6
LBB0_7:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_clk_set_rate
LBB0_8:
	movl	(%r14), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_clk_get_rate                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TMIO_MMC_MIN_RCAR2,4,2         ## @TMIO_MMC_MIN_RCAR2
	.comm	_UINT_MAX,4,2                   ## @UINT_MAX
	.no_dead_strip	_renesas_sdhi_clk_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function renesas_sdhi_clk_update
_renesas_sdhi_clk_update:               ; @renesas_sdhi_clk_update
	.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	x20, x1
	mov	x21, x0
	bl	_host_to_priv
	mov	x19, x0
	ldr	x8, [x21]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _TMIO_MMC_MIN_RCAR2@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TMIO_MMC_MIN_RCAR2@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.1:
Lloh3:
	adrp	x8, _UINT_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UINT_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	udiv	w0, w8, w20
	bl	_ilog2
	mov	x1, x0
	mov	w0, #9
	bl	_min
	tbnz	w0, #31, LBB0_7
; %bb.2:
	mov	x22, x0
	mov	w21, #0
	mov	w24, #-1
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	lsr	w8, w0, w22
	sub	w8, w20, w8
	cmp	w8, w24
	csel	w21, w21, w0, hi
	csel	w24, w8, w24, lo
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	w8, w22, #1
	cmp	w22, #0
	mov	x22, x8
	b.le	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	lsl	w23, w20, w22
	mov	x1, x23
	bl	_clk_round_rate
	cmp	w0, w23
	b.ls	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19]
	lsr	w8, w23, #2
	add	w1, w8, w8, lsl #1
	bl	_clk_round_rate
	cmp	w0, w23
	b.ls	LBB0_3
	b	LBB0_4
LBB0_7:
	mov	w21, #0
LBB0_8:
	ldr	w0, [x19]
	mov	x1, x21
	bl	_clk_set_rate
LBB0_9:
	ldr	w0, [x19]
	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	_clk_get_rate
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_TMIO_MMC_MIN_RCAR2,4,2         ; @TMIO_MMC_MIN_RCAR2
	.comm	_UINT_MAX,4,2                   ; @UINT_MAX
	.no_dead_strip	_renesas_sdhi_clk_update
.subsections_via_symbols
