	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_plldsi_rate
_set_plldsi_rate:                       ## @set_plldsi_rate
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_PRCMU_HDMICLK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_clock_rate
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.1:
	leal	(,%rbx,8), %r13d
	subl	%ebx, %r13d
	movl	$7, %r12d
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	movq	%r15, %rsi
	callq	_do_div
	cmpl	$255, %r13d
	movl	$255, %r14d
	cmovll	%r13d, %r14d
	cmpl	$7, %r14d
	movl	$6, %eax
	cmovll	%eax, %r14d
	movl	%r14d, %ebx
	imull	%r15d, %ebx
	leal	(%rbx,%rbx), %eax
	cltq
	movq	_MIN_PLL_VCO_RATE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	imulq	%r12, %rcx
	cmpq	%rax, %rcx
	ja	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_MAX_PLL_VCO_RATE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	imulq	%r12, %rcx
	cmpq	%rax, %rcx
	jae	LBB0_6
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	-1(%r12), %rax
	subl	%ebx, %r13d
	cmpq	$1, %r12
	movq	%rax, %r12
	jne	LBB0_2
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	movq	%r12, %rsi
	callq	_do_div
	movslq	%ebx, %rcx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	cmpq	%rbx, %rcx
	ja	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rax
	subq	%rcx, %rax
	cmpq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	jae	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_PRCM_PLL_FREQ_D_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shlq	%cl, %r14
	movq	_PRCM_PLL_FREQ_R_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	movq	%r12, %rdx
	shlq	%cl, %rdx
	orq	%r14, %rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_9
LBB0_15:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	jne	LBB0_12
## %bb.16:
	movq	_PRCM_PLL_FREQ_D_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %r14
	movq	_PRCM_PLL_FREQ_R_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %r12
	orq	%r14, %r12
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
LBB0_11:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_13
LBB0_12:
	movq	_PRCM_PLL_FREQ_N_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %eax
	shll	%cl, %eax
	movslq	%eax, %rdi
	orq	%rdx, %rdi
	movq	_PRCM_PLLDSI_FREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_writel
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PRCMU_HDMICLK,4,2              ## @PRCMU_HDMICLK
	.comm	_MIN_PLL_VCO_RATE,8,3           ## @MIN_PLL_VCO_RATE
	.comm	_MAX_PLL_VCO_RATE,8,3           ## @MAX_PLL_VCO_RATE
	.comm	_PRCM_PLL_FREQ_D_SHIFT,8,3      ## @PRCM_PLL_FREQ_D_SHIFT
	.comm	_PRCM_PLL_FREQ_R_SHIFT,8,3      ## @PRCM_PLL_FREQ_R_SHIFT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PRCM_PLL_FREQ_N_SHIFT,4,2      ## @PRCM_PLL_FREQ_N_SHIFT
	.comm	_PRCM_PLLDSI_FREQ,4,2           ## @PRCM_PLLDSI_FREQ
	.no_dead_strip	_set_plldsi_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_plldsi_rate
_set_plldsi_rate:                       ; @set_plldsi_rate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x0
Lloh0:
	adrp	x8, _PRCMU_HDMICLK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PRCMU_HDMICLK@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_clock_rate
	cbz	x24, LBB0_13
; %bb.1:
	mov	x20, x0
	str	xzr, [sp, #8]                   ; 8-byte Folded Spill
	lsl	w8, w24, #3
	sub	w22, w8, w24
	mov	w21, #7
	mov	w27, #255
Lloh3:
	adrp	x28, _MIN_PLL_VCO_RATE@GOTPAGE
Lloh4:
	ldr	x28, [x28, _MIN_PLL_VCO_RATE@GOTPAGEOFF]
	mov	w26, #6
	mov	x19, x24
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x20
	bl	_do_div
	cmp	w22, #255
	csel	w8, w22, w27, lt
	cmp	w8, #6
	csel	w25, w8, w26, gt
	mul	w23, w25, w20
	lsl	w8, w23, #1
	sxtw	x8, w8
	ldr	x9, [x28]
	mul	x9, x9, x21
	cmp	x9, x8
	b.hi	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh5:
	adrp	x9, _MAX_PLL_VCO_RATE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MAX_PLL_VCO_RATE@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	mul	x9, x9, x21
	cmp	x9, x8
	b.lo	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x23
	mov	x1, x21
	bl	_do_div
	sxtw	x8, w23
	cmp	x8, x24
	b.hi	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	x8, x24, x8
	cmp	x8, x19
	b.hs	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh8:
	adrp	x9, _PRCM_PLL_FREQ_D_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PRCM_PLL_FREQ_D_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	lsl	x9, x25, x9
Lloh11:
	adrp	x10, _PRCM_PLL_FREQ_R_SHIFT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _PRCM_PLL_FREQ_R_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
	lsl	x10, x21, x10
	orr	x9, x10, x9
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	mov	x19, x8
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	cbz	x19, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	x8, x21, #1
	sub	w22, w22, w24
	cmp	x21, #1
	mov	x21, x8
	b.ne	LBB0_2
LBB0_9:
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	cbz	x10, LBB0_13
LBB0_10:
Lloh14:
	adrp	x8, _PRCM_PLL_FREQ_N_SHIFT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PRCM_PLL_FREQ_N_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w8, w9, w8
	sxtw	x8, w8
	orr	x0, x10, x8
Lloh17:
	adrp	x8, _PRCM_PLLDSI_FREQ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PRCM_PLLDSI_FREQ@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_writel
	mov	w0, #0
	b	LBB0_14
LBB0_11:
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	cbnz	x10, LBB0_10
; %bb.12:
Lloh20:
	adrp	x8, _PRCM_PLL_FREQ_D_SHIFT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PRCM_PLL_FREQ_D_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	lsl	x8, x25, x8
Lloh23:
	adrp	x9, _PRCM_PLL_FREQ_R_SHIFT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _PRCM_PLL_FREQ_R_SHIFT@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	lsl	x9, x21, x9
	orr	x8, x9, x8
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	cbnz	x10, LBB0_10
LBB0_13:
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_PRCMU_HDMICLK,4,2              ; @PRCMU_HDMICLK
	.comm	_MIN_PLL_VCO_RATE,8,3           ; @MIN_PLL_VCO_RATE
	.comm	_MAX_PLL_VCO_RATE,8,3           ; @MAX_PLL_VCO_RATE
	.comm	_PRCM_PLL_FREQ_D_SHIFT,8,3      ; @PRCM_PLL_FREQ_D_SHIFT
	.comm	_PRCM_PLL_FREQ_R_SHIFT,8,3      ; @PRCM_PLL_FREQ_R_SHIFT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PRCM_PLL_FREQ_N_SHIFT,4,2      ; @PRCM_PLL_FREQ_N_SHIFT
	.comm	_PRCM_PLLDSI_FREQ,4,2           ; @PRCM_PLLDSI_FREQ
	.no_dead_strip	_set_plldsi_rate
.subsections_via_symbols
