	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cnl_ddi_calculate_wrpll
_cnl_ddi_calculate_wrpll:               ## @cnl_ddi_calculate_wrpll
	.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	%rsi, %r15
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_i915
	movq	%rax, %r12
	movl	(%rbx), %ebx
	movq	_U32_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	$0, -60(%rbp)
	movl	$0, -56(%rbp)
	movl	$0, -52(%rbp)
	leaq	_cnl_ddi_calculate_wrpll.dividers(%rip), %r13
	movq	%r13, %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_9
## %bb.1:
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	leal	(%rbx,%rbx,4), %r15d
	xorl	%r12d, %r12d
	movq	%r13, %rbx
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	movq	%r13, %rdi
	callq	_ARRAY_SIZE
	cltq
	addq	$4, %rbx
	cmpq	%rax, %r12
	jge	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	movl	%r15d, %ecx
	imull	%eax, %ecx
	leal	-7998000(%rcx), %edx
	cmpl	$2002000, %edx                  ## imm = 0x1E8C50
	ja	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leal	-8999000(%rcx), %esi
	negl	%esi
	movl	%ecx, %edx
	subl	$8999000, %edx                  ## imm = 0x895058
	cmovbl	%esi, %edx
	cmpl	%r14d, %edx
	jge	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r14d
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_2
LBB0_6:
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	testl	%edi, %edi
	je	LBB0_9
## %bb.7:
	leaq	-60(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	leaq	-52(%rbp), %rcx
	callq	_cnl_wrpll_get_multipliers
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_cnl_hdmi_pll_ref_clock
	movl	-60(%rbp), %ecx
	movl	-56(%rbp), %r8d
	movl	-52(%rbp), %r9d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_cnl_wrpll_params_populate
	movl	$1, %eax
	jmp	LBB0_10
LBB0_9:
	xorl	%eax, %eax
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @cnl_ddi_calculate_wrpll.dividers
_cnl_ddi_calculate_wrpll.dividers:
	.long	2                               ## 0x2
	.long	4                               ## 0x4
	.long	6                               ## 0x6
	.long	8                               ## 0x8
	.long	10                              ## 0xa
	.long	12                              ## 0xc
	.long	14                              ## 0xe
	.long	16                              ## 0x10
	.long	18                              ## 0x12
	.long	20                              ## 0x14
	.long	24                              ## 0x18
	.long	28                              ## 0x1c
	.long	30                              ## 0x1e
	.long	32                              ## 0x20
	.long	36                              ## 0x24
	.long	40                              ## 0x28
	.long	42                              ## 0x2a
	.long	44                              ## 0x2c
	.long	48                              ## 0x30
	.long	50                              ## 0x32
	.long	52                              ## 0x34
	.long	54                              ## 0x36
	.long	56                              ## 0x38
	.long	60                              ## 0x3c
	.long	64                              ## 0x40
	.long	66                              ## 0x42
	.long	68                              ## 0x44
	.long	70                              ## 0x46
	.long	72                              ## 0x48
	.long	76                              ## 0x4c
	.long	78                              ## 0x4e
	.long	80                              ## 0x50
	.long	84                              ## 0x54
	.long	88                              ## 0x58
	.long	90                              ## 0x5a
	.long	92                              ## 0x5c
	.long	96                              ## 0x60
	.long	98                              ## 0x62
	.long	100                             ## 0x64
	.long	102                             ## 0x66
	.long	3                               ## 0x3
	.long	5                               ## 0x5
	.long	7                               ## 0x7
	.long	9                               ## 0x9
	.long	15                              ## 0xf
	.long	21                              ## 0x15

	.comm	_U32_MAX,4,2                    ## @U32_MAX
	.no_dead_strip	_cnl_ddi_calculate_wrpll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cnl_ddi_calculate_wrpll
_cnl_ddi_calculate_wrpll:               ; @cnl_ddi_calculate_wrpll
	.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, x1
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_i915
	mov	x23, x0
	ldr	w20, [x21]
Lloh0:
	adrp	x8, _U32_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _U32_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	str	xzr, [sp, #24]
	str	wzr, [sp, #20]
Lloh3:
	adrp	x22, _cnl_ddi_calculate_wrpll.dividers@PAGE
Lloh4:
	add	x22, x22, _cnl_ddi_calculate_wrpll.dividers@PAGEOFF
	mov	x0, x22
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.1:
	stp	x23, x19, [sp]                  ; 16-byte Folded Spill
	mov	x25, #0
	mov	w23, #0
	mov	w21, #0
	mov	w26, #20568
	movk	w26, #137, lsl #16
	mov	w27, #62928
	movk	w27, #65413, lsl #16
	mov	w28, #35920
	movk	w28, #30, lsl #16
	mov	w19, #44968
	movk	w19, #65398, lsl #16
	add	w20, w20, w20, lsl #2
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x25, x25, #1
	mov	x0, x22
	bl	_ARRAY_SIZE
	cmp	x25, w0, sxtw
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22, x25, lsl #2]
	mul	w9, w20, w8
	add	w10, w9, w27
	cmp	w10, w28
	b.hi	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w10, w9, w19
	subs	w11, w26, w9
	csel	w10, w11, w10, hi
	cmp	w10, w24
	b.ge	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x21, x9
	mov	x24, x10
	mov	x23, x8
	b	LBB0_2
LBB0_6:
	cbz	w23, LBB0_8
; %bb.7:
	add	x1, sp, #28
	add	x2, sp, #24
	add	x3, sp, #20
	mov	x0, x23
	bl	_cnl_wrpll_get_multipliers
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_cnl_hdmi_pll_ref_clock
	mov	x2, x0
	ldp	w4, w3, [sp, #24]
	ldr	w5, [sp, #20]
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x1, x21
	bl	_cnl_wrpll_params_populate
	mov	w0, #1
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	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
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @cnl_ddi_calculate_wrpll.dividers
_cnl_ddi_calculate_wrpll.dividers:
	.long	2                               ; 0x2
	.long	4                               ; 0x4
	.long	6                               ; 0x6
	.long	8                               ; 0x8
	.long	10                              ; 0xa
	.long	12                              ; 0xc
	.long	14                              ; 0xe
	.long	16                              ; 0x10
	.long	18                              ; 0x12
	.long	20                              ; 0x14
	.long	24                              ; 0x18
	.long	28                              ; 0x1c
	.long	30                              ; 0x1e
	.long	32                              ; 0x20
	.long	36                              ; 0x24
	.long	40                              ; 0x28
	.long	42                              ; 0x2a
	.long	44                              ; 0x2c
	.long	48                              ; 0x30
	.long	50                              ; 0x32
	.long	52                              ; 0x34
	.long	54                              ; 0x36
	.long	56                              ; 0x38
	.long	60                              ; 0x3c
	.long	64                              ; 0x40
	.long	66                              ; 0x42
	.long	68                              ; 0x44
	.long	70                              ; 0x46
	.long	72                              ; 0x48
	.long	76                              ; 0x4c
	.long	78                              ; 0x4e
	.long	80                              ; 0x50
	.long	84                              ; 0x54
	.long	88                              ; 0x58
	.long	90                              ; 0x5a
	.long	92                              ; 0x5c
	.long	96                              ; 0x60
	.long	98                              ; 0x62
	.long	100                             ; 0x64
	.long	102                             ; 0x66
	.long	3                               ; 0x3
	.long	5                               ; 0x5
	.long	7                               ; 0x7
	.long	9                               ; 0x9
	.long	15                              ; 0xf
	.long	21                              ; 0x15

	.comm	_U32_MAX,4,2                    ; @U32_MAX
	.no_dead_strip	_cnl_ddi_calculate_wrpll
.subsections_via_symbols
