	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chv_find_best_dpll
_chv_find_best_dpll:                    ## @chv_find_best_dpll
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r13
	movl	%ecx, %r15d
	movl	%edx, %r14d
	movq	%rdi, %rbx
	movl	(%rsi), %edi
	callq	_to_intel_crtc
	movq	(%rax), %r12
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movabsq	$8589934593, %rax               ## imm = 0x200000001
	movq	%rax, -72(%rbp)
	movl	8(%rbx), %esi
	movl	%esi, -64(%rbp)
	movl	12(%rbx), %ecx
	cmpl	%ecx, %esi
	jge	LBB0_1
LBB0_10:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leal	(%r14,%r14,4), %r13d
	movl	4(%rbx), %eax
	movl	$1000000, -48(%rbp)             ## 4-byte Folded Spill
                                        ## imm = 0xF4240
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	leaq	-72(%rbp), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	12(%rbx), %ecx
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%rsi), %edx
	movl	%edx, -64(%rbp)
	cmpl	%ecx, %esi
	movl	%edx, %esi
	jle	LBB0_10
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	movl	(%rbx), %edx
	movl	%edx, -60(%rbp)
	cmpl	%eax, %edx
	jge	LBB0_3
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=2
	movl	-64(%rbp), %esi
	movl	-60(%rbp), %eax
	xorl	%edx, %edx
	cmpl	$11, %eax
	setge	%dl
	notl	%edx
	addl	%eax, %edx
	movl	%edx, -60(%rbp)
	movl	4(%rbx), %eax
	cmpl	%eax, %edx
	jl	LBB0_8
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	imull	%edx, %esi
	movl	%esi, -56(%rbp)
	imull	-72(%rbp), %esi
	movl	%r13d, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_mul_u32_u32
	shll	$22, %eax
	movl	-68(%rbp), %esi
	imull	%r15d, %esi
	movl	%eax, %edi
	callq	_DIV_ROUND_CLOSEST_ULL
	movl	%eax, %ecx
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	-68(%rbp)
	cmpl	%eax, %ecx
	jg	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	%ecx, -52(%rbp)
	movl	%r15d, %edi
	movq	%r14, %rsi
	callq	_chv_calc_dpll_params
	movq	%r12, %rdi
	callq	_to_i915
	movl	%eax, %edi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_intel_PLL_is_valid
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	%r12, %rdi
	movl	%r13d, %esi
	movq	%r14, %rdx
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	leaq	-76(%rbp), %r9
	callq	_vlv_PLL_is_optimal
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	-56(%rbp), %rax
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 16(%rcx)
	movups	-72(%rbp), %xmm0
	movups	%xmm0, (%rcx)
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	movl	-76(%rbp), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.no_dead_strip	_chv_find_best_dpll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function chv_find_best_dpll
lCPI0_0:
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_chv_find_best_dpll:                    ; @chv_find_best_dpll
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x5
	mov	x20, x3
	mov	x24, x2
	mov	x21, x0
	ldr	w0, [x1]
	bl	_to_intel_crtc
	ldr	x22, [x0]
	mov	x0, x19
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	mov	w23, #0
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #8]
	ldp	w8, w9, [x21, #8]
	str	w8, [sp, #16]
	cmp	w8, w9
	b.ge	LBB0_2
LBB0_1:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_2:
	mov	w23, #0
	ldr	w10, [x21, #4]
	mov	w25, #16960
	movk	w25, #15, lsl #16
Lloh2:
	adrp	x26, _INT_MAX@GOTPAGE
Lloh3:
	ldr	x26, [x26, _INT_MAX@GOTPAGEOFF]
	mov	w27, #-2
	add	w24, w24, w24, lsl #2
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x21, #12]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	w11, w8, #1
	str	w11, [sp, #16]
	cmp	w8, w9
	mov	x8, x11
	b.le	LBB0_1
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	ldr	w11, [x21]
	str	w11, [sp, #20]
	cmp	w11, w10
	b.ge	LBB0_7
	b	LBB0_4
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	ldp	w8, w9, [sp, #16]
	cmp	w9, #10
	cinc	w11, w27, le
	ldr	w10, [x21, #4]
	add	w11, w11, w9
	cmp	w11, w10
	str	w11, [sp, #20]
	b.lt	LBB0_3
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mul	w8, w8, w11
	str	w8, [sp, #24]
	ldr	w9, [sp, #8]
	mul	w1, w9, w8
	mov	x0, x24
	bl	_mul_u32_u32
	lsl	w0, w0, #22
	ldr	w8, [sp, #12]
	mul	w1, w8, w20
	bl	_DIV_ROUND_CLOSEST_ULL
	ldr	w8, [x26]
	ldr	w9, [sp, #12]
	sdiv	w8, w8, w9
	cmp	w0, w8
	b.gt	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	str	w0, [sp, #28]
	add	x1, sp, #8
	mov	x0, x20
	bl	_chv_calc_dpll_params
	mov	x0, x22
	bl	_to_i915
	add	x2, sp, #8
	mov	x1, x21
	bl	_intel_PLL_is_valid
	cbz	w0, LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	add	x2, sp, #8
	add	x5, sp, #4
	mov	x0, x22
	mov	x1, x24
	mov	x3, x19
	mov	x4, x25
	bl	_vlv_PLL_is_optimal
	cbz	w0, LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=2
	ldur	q0, [sp, #8]
	str	q0, [x19]
	ldr	x8, [sp, #24]
	str	x8, [x19, #16]
	mov	w23, #1
	ldr	w25, [sp, #4]
	b	LBB0_6
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.no_dead_strip	_chv_find_best_dpll
.subsections_via_symbols
