	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx24113_calc_pll_nf
_cx24113_calc_pll_nf:                   ## @cx24113_calc_pll_nf
	.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	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movl	(%rdi), %r13d
	imull	$1000, %r13d, %esi              ## imm = 0x3E8
	movq	32(%rdi), %rax
	xorl	%ecx, %ecx
	cmpl	$20000, (%rax)                  ## imm = 0x4E20
	setl	%cl
	movl	$2, %r15d
	subl	%ecx, %r15d
	movq	8(%rdi), %rax
	movq	_REV_CX24113@GOTPCREL(%rip), %rcx
	cmpl	$1100000, %r13d                 ## imm = 0x10C8E0
	movq	_VCODIV2@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	_VCODIV4@GOTPCREL(%rip), %rdi
	movl	(%rdi), %r14d
	movl	%r14d, %edi
	cmovgel	%edx, %edi
	cmpl	$1165000, %r13d                 ## imm = 0x11C6C8
	cmovgel	%edx, %r14d
	cmpq	(%rcx), %rax
	cmovel	%edi, %r14d
	movl	%r14d, 16(%r12)
	movslq	%r14d, %rdx
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_dprintk
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	addl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_cx24113_set_ref_div
	movl	%eax, %ebx
	movl	%eax, %ecx
	imull	%r14d, %ecx
	movl	%ecx, %eax
	imull	%r13d, %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %eax
	movq	32(%r12), %rdx
	movl	(%rdx), %esi
	imull	%r15d, %esi
	cltd
	idivl	%esi
	cmpl	$374, %eax                      ## imm = 0x176
	jg	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$3, %ebx
	jl	LBB0_1
LBB0_3:
	cmpl	$374, %eax                      ## imm = 0x176
	jg	LBB0_4
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cx_err                         ## TAILCALL
LBB0_4:
	addl	$5, %eax
	cltq
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$34, %rax
	leal	(%rax,%rdx), %r13d
	leal	(%rax,%rdx), %r15d
	addl	$-32, %r15d
	imull	-48(%rbp), %ecx                 ## 4-byte Folded Reload
	shll	$18, %ecx
	movslq	%ecx, %r14
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dprintk
	movq	32(%r12), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	imull	(%rax), %ecx
	imull	$2000, %ecx, %esi               ## imm = 0x7D0
	movl	%r14d, %edi
	callq	_do_div
	leaq	L_.str.3(%rip), %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dprintk
	shll	$18, %r13d
	subl	%r13d, %r14d
	movslq	%r14d, %rdx
	leaq	L_.str.4(%rip), %rdi
	movl	%r15d, %esi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dprintk
	cmpq	$0, 24(%r12)
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	je	LBB0_5
## %bb.6:
	cmpl	$129434, %r14d                  ## imm = 0x1F99A
	movl	$129434, %eax                   ## imm = 0x1F99A
	cmovll	%r14d, %eax
	cmpl	$-129433, %eax                  ## imm = 0xFFFE0667
	movl	$-129434, %r14d                 ## imm = 0xFFFE0666
	cmovgel	%eax, %r14d
	cmpl	$-3277, %r14d                   ## imm = 0xF333
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	ja	LBB0_8
## %bb.7:
	leal	-1(%r14), %eax
	cmpl	$3275, %eax                     ## imm = 0xCCB
	ja	LBB0_9
LBB0_8:
	movq	%r12, %rdi
	movl	$16, %esi
	callq	_cx24113_readreg
	orl	$64, %eax
	movq	%r12, %rdi
	movl	$16, %esi
	movl	%eax, %edx
	callq	_cx24113_writereg
	xorl	%r14d, %r14d
	jmp	LBB0_9
LBB0_5:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_9:
	movslq	%r14d, %r14
	leaq	L_.str.5(%rip), %rdi
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dprintk
	movslq	%r12d, %rax
	movq	%rax, (%r13)
	movl	%r14d, (%r15)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REV_CX24113,8,3                ## @REV_CX24113
	.comm	_VCODIV2,4,2                    ## @VCODIV2
	.comm	_VCODIV4,4,2                    ## @VCODIV4
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"calculating N/F for %dHz with vcodiv %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"strange frequency: N < 6\n"

L_.str.2:                               ## @.str.2
	.asciz	"1 N: %d, F: %lld, R: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"2 N: %d, F: %lld, R: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"3 N: %d, F: %lld, R: %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"4 N: %d, F: %lld, R: %d\n"

	.no_dead_strip	_cx24113_calc_pll_nf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx24113_calc_pll_nf
_cx24113_calc_pll_nf:                   ; @cx24113_calc_pll_nf
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w23, [x0]
	mov	w8, #1000
	mul	w24, w23, w8
	ldr	x8, [x0, #32]
	ldr	w8, [x8]
	mov	w9, #20000
	cmp	w8, w9
	mov	w8, #1
	cinc	w26, w8, ge
Lloh0:
	adrp	x8, _REV_CX24113@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REV_CX24113@GOTPAGEOFF]
	ldr	x9, [x0, #8]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x10, _VCODIV2@GOTPAGE
Lloh4:
	ldr	x10, [x10, _VCODIV2@GOTPAGEOFF]
Lloh5:
	adrp	x11, _VCODIV4@GOTPAGE
Lloh6:
	ldr	x11, [x11, _VCODIV4@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
Lloh8:
	ldr	w11, [x11]
	mov	w12, #51423
	movk	w12, #16, lsl #16
	cmp	w23, w12
	csel	w12, w10, w11, gt
	mov	w13, #50887
	movk	w13, #17, lsl #16
	cmp	w23, w13
	csel	w10, w10, w11, gt
	cmp	x9, x8
	csel	w25, w12, w10, eq
	str	w25, [x0, #16]
	sxtw	x2, w25
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x24
	bl	_dprintk
	mov	w22, #0
	lsl	w27, w26, #1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	w1, w22, #1
	mov	x0, x21
	bl	_cx24113_set_ref_div
	mov	x22, x0
	mul	w8, w0, w25
	mul	w9, w8, w23
	add	w9, w9, w9, lsl #2
	lsl	w9, w9, #1
	ldr	x10, [x21, #32]
	ldr	w10, [x10]
	mul	w10, w27, w10
	sdiv	w9, w9, w10
	cmp	w9, #374
	ccmp	w0, #3, #0, le
	b.lt	LBB0_1
; %bb.2:
	cmp	w9, #374
	b.gt	LBB0_4
; %bb.3:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	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
	b	_cx_err
LBB0_4:
	add	w9, w9, #5
	mov	w10, #26215
	movk	w10, #26214, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #34
	add	w27, w9, w10
	sub	w23, w27, #32
	mul	w8, w8, w24
	lsl	w24, w8, #18
	sxtw	x25, w24
	str	x22, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x23
	mov	x2, x25
	bl	_dprintk
	ldr	x8, [x21, #32]
	ldr	w8, [x8]
	mul	w8, w26, w8
	mov	w9, #2000
	mul	w1, w8, w9
	mov	x0, x24
	bl	_do_div
	str	x22, [sp]
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x23
	mov	x2, x25
	bl	_dprintk
	sub	w24, w24, w27, lsl #18
	sxtw	x2, w24
	str	x22, [sp]
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x23
	bl	_dprintk
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_8
; %bb.5:
	mov	w8, #63898
	movk	w8, #1, lsl #16
	cmp	w24, w8
	csel	w8, w24, w8, lt
	mov	w9, #1638
	movk	w9, #65534, lsl #16
	cmp	w8, w9
	csel	w24, w8, w9, gt
	cmn	w24, #3277
	b.hi	LBB0_7
; %bb.6:
	sub	w8, w24, #1
	cmp	w8, #3275
	b.hi	LBB0_9
LBB0_7:
	mov	x0, x21
	mov	w1, #16
	bl	_cx24113_readreg
	orr	w2, w0, #0x40
	mov	x0, x21
	mov	w1, #16
	bl	_cx24113_writereg
	mov	w24, #0
	b	LBB0_9
LBB0_8:
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
LBB0_9:
	sxtw	x2, w24
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	str	x22, [sp]
Lloh19:
	adrp	x0, l_.str.5@PAGE
Lloh20:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x23
	bl	_dprintk
	sxtw	x8, w23
	str	x8, [x20]
	str	w24, [x19]
	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 AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_REV_CX24113,8,3                ; @REV_CX24113
	.comm	_VCODIV2,4,2                    ; @VCODIV2
	.comm	_VCODIV4,4,2                    ; @VCODIV4
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"calculating N/F for %dHz with vcodiv %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"strange frequency: N < 6\n"

l_.str.2:                               ; @.str.2
	.asciz	"1 N: %d, F: %lld, R: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"2 N: %d, F: %lld, R: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"3 N: %d, F: %lld, R: %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"4 N: %d, F: %lld, R: %d\n"

	.no_dead_strip	_cx24113_calc_pll_nf
.subsections_via_symbols
