	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function dsi_pll_calc_ssc
LCPI0_0:
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	255                             ## 0xff
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_dsi_pll_calc_ssc:                      ## @dsi_pll_calc_ssc
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, 80(%rdi)
	je	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	movl	72(%rdi), %esi
	movl	76(%rdi), %edi
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	movl	48(%rbx), %edi
	incl	%edi
	movl	%esi, %eax
	cltd
	idivl	%edi
	movl	%edx, %r14d
	notl	%r14d
	addl	%esi, %r14d
	movl	4(%rbx), %eax
	movl	8(%rbx), %r15d
	shll	$8, %eax
	orl	(%rbx), %eax
	shll	$16, %r15d
	orl	%eax, %r15d
	movl	12(%rbx), %eax
	movb	52(%rbx), %cl
	shll	%cl, %eax
	addl	%r15d, %eax
	imull	56(%rbx), %edi
	imull	%eax, %edi
	subl	%edx, %esi
	callq	_div_u64
	movl	%eax, %edi
	movl	$1000000, %esi                  ## imm = 0xF4240
	callq	_DIV_ROUND_CLOSEST_ULL
	movl	%eax, %r12d
	movl	%r14d, %eax
	shrl	$8, %eax
	movl	%r12d, %ecx
	shrl	$8, %ecx
	movd	%r14d, %xmm0
	pinsrd	$1, %eax, %xmm0
	pinsrd	$2, %r12d, %xmm0
	pinsrd	$3, %ecx, %xmm0
	pand	LCPI0_0(%rip), %xmm0
	movdqu	%xmm0, 16(%rbx)
	movl	12(%rbx), %esi
	movl	48(%rbx), %eax
	movzbl	%al, %ecx
	movl	%ecx, 32(%rbx)
	movzbl	%ah, %eax
	movl	%eax, 36(%rbx)
	xorl	%eax, %eax
	cmpq	$0, 64(%rbx)
	je	LBB0_3
## %bb.2:
	movq	_SSC_CENTER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_3:
	movl	%eax, 40(%rbx)
	movl	52(%rbx), %ecx
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %edx
	callq	_pr_debug
	movl	48(%rbx), %ecx
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	movl	%r12d, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_debug                       ## TAILCALL
LBB0_4:
	leaq	L_.str(%rip), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DBG                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SSC not enabled\n"

	.comm	_SSC_CENTER,4,2                 ## @SSC_CENTER
L_.str.1:                               ## @.str.1
	.asciz	"SCC: Dec:%d, frac:%llu, frac_bits:%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"SSC: div_per:0x%X, stepsize:0x%X, adjper:0x%X\n"

	.no_dead_strip	_dsi_pll_calc_ssc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dsi_pll_calc_ssc
_dsi_pll_calc_ssc:                      ; @dsi_pll_calc_ssc
	.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
	ldr	w8, [x0, #80]
	cbz	w8, LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0, #76]
	ldr	w1, [x19, #72]
	bl	_DIV_ROUND_CLOSEST
	cmp	w0, #0
	cinc	w8, w0, lt
	asr	w8, w8, #1
	ldp	w9, w10, [x19, #48]
	add	w9, w9, #1
	sdiv	w11, w8, w9
	mul	w1, w11, w9
	sub	w11, w8, w1
	mvn	w11, w11
	add	w20, w8, w11
	ldp	w8, w11, [x19]
	orr	w8, w8, w11, lsl #8
	ldp	w11, w12, [x19, #8]
	orr	w21, w8, w11, lsl #16
	lsl	w8, w12, w10
	add	w8, w8, w21
	ldr	w10, [x19, #56]
	mul	w9, w10, w9
	mul	w0, w9, w8
	bl	_div_u64
	mov	w1, #16960
	movk	w1, #15, lsl #16
	bl	_DIV_ROUND_CLOSEST_ULL
	mov	x22, x0
	and	w8, w20, #0xff
	ubfx	w9, w20, #8, #8
	stp	w8, w9, [x19, #16]
	and	w8, w0, #0xff
	ubfx	w9, w0, #8, #8
	stp	w8, w9, [x19, #24]
	ldp	w8, w3, [x19, #48]
	and	w9, w8, #0xff
	ubfx	w8, w8, #8, #8
	stp	w9, w8, [x19, #32]
	ldr	x8, [x19, #64]
	cmp	x8, #0
Lloh0:
	adrp	x8, _SSC_CENTER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SSC_CENTER@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	csel	w8, wzr, w8, eq
	str	w8, [x19, #40]
	ldr	w1, [x19, #12]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_pr_debug
	ldr	w3, [x19, #48]
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	mov	x2, x22
	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
	b	_pr_debug
LBB0_2:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	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
	b	_DBG
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SSC not enabled\n"

	.comm	_SSC_CENTER,4,2                 ; @SSC_CENTER
l_.str.1:                               ; @.str.1
	.asciz	"SCC: Dec:%d, frac:%llu, frac_bits:%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"SSC: div_per:0x%X, stepsize:0x%X, adjper:0x%X\n"

	.no_dead_strip	_dsi_pll_calc_ssc
.subsections_via_symbols
