	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dsi_calc_mnp
_dsi_calc_mnp:                          ## @dsi_calc_mnp
	.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
	movl	%edx, %r15d
	leal	-1150001(%r15), %eax
	cmpl	$-850002, %eax                  ## imm = 0xFFF307AE
	ja	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_ECHRNG@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_14
LBB0_2:
	movq	%rsi, %r14
	callq	_IS_CHERRYVIEW
	xorl	%edx, %edx
	testq	%rax, %rax
	setne	%dl
	movl	$25000, %ecx                    ## imm = 0x61A8
	movl	$100000, %r12d                  ## imm = 0x186A0
	cmovel	%ecx, %r12d
	movl	$1550000, %ecx                  ## imm = 0x17A6B0
	movl	$7000000, %esi                  ## imm = 0x6ACFC0
	cmovel	%ecx, %esi
	movl	%edx, %ecx
	addb	%dl, %cl
	orb	$1, %cl
	shrl	%cl, %esi
	leal	(%rdx,%rdx,2), %r8d
	incl	%r8d
	leal	62(,%rdx,8), %ebx
	xorl	%edi, %edi
	cmpl	%r15d, %esi
	jne	LBB0_4
## %bb.3:
	xorl	%esi, %esi
	jmp	LBB0_13
LBB0_4:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	leal	92(,%rdx,4), %r13d
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	movl	%r15d, %eax
	subl	%esi, %eax
	movl	%eax, %r14d
	negl	%r14d
	cmovsl	%eax, %r14d
	leal	(%rcx,%rcx), %r10d
	incl	%r10d
	leal	(%r8,%r8,2), %r11d
	leal	2(%rcx,%rcx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	leal	(%r8,%r8,4), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	leal	(%r8,%r8), %eax
	leal	(%rax,%rax,2), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	imull	%r12d, %edi
	movl	$2, %r8d
	movl	$2, %esi
	movl	%ebx, %r9d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %eax
	movl	%edi, %edx
	movl	%r10d, %ecx
	shrl	%cl, %edx
	movl	%r15d, %ecx
	subl	%edx, %ecx
	movl	%ecx, %r14d
	negl	%r14d
	cmovsl	%ecx, %r14d
	cmpl	%eax, %r14d
	cmovll	%r9d, %ebx
	cmovll	%r8d, %esi
	cmovgel	%eax, %r14d
	testl	%r14d, %r14d
	setne	%al
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%r11d
	movl	%r15d, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovsl	%ecx, %eax
	cmpl	%r14d, %eax
	cmovll	%r9d, %ebx
	movl	$3, %ecx
	cmovll	%ecx, %esi
	cmovll	%eax, %r14d
	testl	%r14d, %r14d
	setne	%al
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%edi, %eax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %eax
	movl	%r15d, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovsl	%ecx, %eax
	cmpl	%r14d, %eax
	cmovll	%r9d, %ebx
	movl	$4, %ecx
	cmovll	%ecx, %esi
	cmovll	%eax, %r14d
	testl	%r14d, %r14d
	setne	%al
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	-48(%rbp)                       ## 4-byte Folded Reload
	movl	%r15d, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovsl	%ecx, %eax
	cmpl	%r14d, %eax
	cmovll	%r9d, %ebx
	movl	$5, %ecx
	cmovll	%ecx, %esi
	cmovll	%eax, %r14d
	testl	%r14d, %r14d
	setne	%al
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	-44(%rbp)                       ## 4-byte Folded Reload
	movl	%r15d, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovsl	%ecx, %eax
	cmpl	%r14d, %eax
	cmovll	%r9d, %ebx
	movl	$6, %ecx
	cmovll	%ecx, %esi
	cmovll	%eax, %r14d
	testl	%r14d, %r14d
	setne	%al
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%r13d, %r9d
	jae	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	incl	%r9d
	addl	%r12d, %edi
	testb	%al, %al
	jne	LBB0_5
LBB0_12:
	addl	$-2, %esi
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	xorl	%edi, %edi
	movq	-64(%rbp), %r8                  ## 8-byte Reload
LBB0_13:
	movq	_DSI_PLL_P1_POST_DIV_SHIFT@GOTPCREL(%rip), %rax
	addl	(%rax), %esi
	movl	$1, %eax
	movl	%esi, %ecx
	shll	%cl, %eax
	movl	%eax, (%r14)
	bsfl	%r8d, %eax
	movq	_DSI_PLL_N1_DIV_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movq	_lfsr_converts@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addl	$-62, %ebx
	movl	(%rcx,%rbx,8), %edx
	movq	_DSI_PLL_M1_DIV_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, 4(%r14)
LBB0_14:
	movl	%edi, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DSI CLK Out of Range\n"

	.comm	_ECHRNG,4,2                     ## @ECHRNG
	.comm	_DSI_PLL_P1_POST_DIV_SHIFT,4,2  ## @DSI_PLL_P1_POST_DIV_SHIFT
	.comm	_DSI_PLL_N1_DIV_SHIFT,4,2       ## @DSI_PLL_N1_DIV_SHIFT
	.comm	_lfsr_converts,8,3              ## @lfsr_converts
	.comm	_DSI_PLL_M1_DIV_SHIFT,4,2       ## @DSI_PLL_M1_DIV_SHIFT
	.no_dead_strip	_dsi_calc_mnp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dsi_calc_mnp
_dsi_calc_mnp:                          ; @dsi_calc_mnp
	.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
	sub	w8, w2, #280, lsl #12           ; =1146880
	sub	w8, w8, #3121
	mov	w9, #1966
	movk	w9, #65523, lsl #16
	cmp	w8, w9
	b.hi	LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh2:
	adrp	x8, _ECHRNG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ECHRNG@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_2:
	mov	x20, x2
	mov	x19, x1
	bl	_IS_CHERRYVIEW
	cmp	x0, #0
	mov	w8, #96
	mov	w9, #92
	csel	w10, w9, w8, eq
	mov	w11, #4
	csinc	w9, w11, wzr, ne
	mov	w8, #34464
	movk	w8, #1, lsl #16
	mov	w12, #25000
	csel	w12, w12, w8, eq
	mov	w8, #70
	mov	w13, #62
	csel	w8, w13, w8, eq
	mov	w13, #53184
	movk	w13, #106, lsl #16
	mov	w14, #42672
	movk	w14, #23, lsl #16
	csel	w14, w14, w13, eq
	mov	w13, #3
	csinc	w15, w13, wzr, ne
	lsr	w14, w14, w15
	cmp	w14, w20
	b.ne	LBB0_4
; %bb.3:
	mov	w10, #0
	b	LBB0_13
LBB0_4:
	subs	w14, w20, w14
	cneg	w14, w14, mi
	cmp	x0, #0
	csinc	w15, w13, wzr, ne
	add	w16, w9, w9, lsl #1
	mov	w17, #2
	csel	w0, w17, w11, eq
	lsl	w1, w16, #1
	mul	w2, w8, w12
	mov	w3, #5
	mov	w4, #6
	mov	w5, #2
	mov	x6, x8
	add	w7, w9, w9, lsl #2
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w21, w2, w15
	subs	w21, w20, w21
	cneg	w21, w21, mi
	cmp	w21, w14
	csel	w8, w6, w8, lt
	csel	w5, w17, w5, lt
	csel	w14, w21, w14, lt
	cmp	w14, #0
	cset	w21, ne
	cbz	w14, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	udiv	w21, w2, w16
	subs	w21, w20, w21
	cneg	w21, w21, mi
	cmp	w21, w14
	csel	w8, w6, w8, lt
	csel	w5, w13, w5, lt
	csel	w14, w21, w14, lt
	cmp	w14, #0
	cset	w21, ne
	cbz	w14, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	lsr	w21, w2, w0
	subs	w21, w20, w21
	cneg	w21, w21, mi
	cmp	w21, w14
	csel	w8, w6, w8, lt
	csel	w5, w11, w5, lt
	csel	w14, w21, w14, lt
	cmp	w14, #0
	cset	w21, ne
	cbz	w14, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	udiv	w21, w2, w7
	subs	w21, w20, w21
	cneg	w21, w21, mi
	cmp	w21, w14
	csel	w8, w6, w8, lt
	csel	w5, w3, w5, lt
	csel	w14, w21, w14, lt
	cmp	w14, #0
	cset	w21, ne
	cbz	w14, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	udiv	w21, w2, w1
	subs	w21, w20, w21
	cneg	w21, w21, mi
	cmp	w21, w14
	csel	w8, w6, w8, lt
	csel	w5, w4, w5, lt
	csel	w14, w21, w14, lt
	cmp	w14, #0
	cset	w21, ne
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w6, w10
	b.hs	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	add	w6, w6, #1
	add	w2, w2, w12
	tbnz	w21, #0, LBB0_5
LBB0_12:
	sub	w10, w5, #2
LBB0_13:
	mov	w0, #0
Lloh5:
	adrp	x11, _DSI_PLL_P1_POST_DIV_SHIFT@GOTPAGE
Lloh6:
	ldr	x11, [x11, _DSI_PLL_P1_POST_DIV_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w11, [x11]
	add	w10, w10, w11
	mov	w11, #1
	lsl	w10, w11, w10
	str	w10, [x19]
	rbit	w9, w9
	clz	w9, w9
Lloh8:
	adrp	x10, _DSI_PLL_N1_DIV_SHIFT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _DSI_PLL_N1_DIV_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	lsl	w9, w9, w10
Lloh11:
	adrp	x10, _lfsr_converts@GOTPAGE
Lloh12:
	ldr	x10, [x10, _lfsr_converts@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
	sub	w8, w8, #62
	ldr	x8, [x10, w8, uxtw #3]
Lloh14:
	adrp	x10, _DSI_PLL_M1_DIV_SHIFT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _DSI_PLL_M1_DIV_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	lsl	w8, w8, w10
	orr	w8, w8, w9
	str	w8, [x19, #4]
LBB0_14:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DSI CLK Out of Range\n"

	.comm	_ECHRNG,4,2                     ; @ECHRNG
	.comm	_DSI_PLL_P1_POST_DIV_SHIFT,4,2  ; @DSI_PLL_P1_POST_DIV_SHIFT
	.comm	_DSI_PLL_N1_DIV_SHIFT,4,2       ; @DSI_PLL_N1_DIV_SHIFT
	.comm	_lfsr_converts,8,3              ; @lfsr_converts
	.comm	_DSI_PLL_M1_DIV_SHIFT,4,2       ; @DSI_PLL_M1_DIV_SHIFT
	.no_dead_strip	_dsi_calc_mnp
.subsections_via_symbols
