	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx24123_pll_calculate
_cx24123_pll_calculate:                 ## @cx24123_pll_calculate
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	(%rdi), %r15
	movq	_cx24123_bandselect_vals@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_cx24123_AGC_vals@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	movl	44(%rdi), %eax
	movl	%eax, 16(%r15)
	movl	40(%rdi), %eax
	movl	%eax, 12(%r15)
	movq	(%r14), %rax
	movl	32(%rax), %eax
	movl	%eax, 4(%r15)
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_6
## %bb.1:
	movl	$44, %r12d
	xorl	%r14d, %r14d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	callq	_ARRAY_SIZE
	cltq
	addq	$48, %r12
	cmpq	%rax, %r14
	jge	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	movq	8(%r13), %rax
	cmpq	%rax, -36(%rdi,%r12)
	jg	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%rax, -28(%rdi,%r12)
	jl	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rdi,%r12), %eax
	movl	%eax, 16(%r15)
	movl	-4(%rdi,%r12), %eax
	movl	%eax, 12(%r15)
	movl	-8(%rdi,%r12), %eax
	movl	%eax, 8(%r15)
	jmp	LBB0_5
LBB0_6:
	movq	_force_band@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	jle	LBB0_8
## %bb.7:
	cmpl	%ecx, %eax
	jg	LBB0_8
## %bb.22:
	decl	%eax
	movq	_cx24123_bandselect_vals@GOTPCREL(%rip), %r10
	jmp	LBB0_21
LBB0_8:
	testl	%ecx, %ecx
	movq	_cx24123_bandselect_vals@GOTPCREL(%rip), %r10
	jle	LBB0_9
## %bb.10:
	movq	(%r10), %r8
	movl	16(%r13), %edx
	movl	%ecx, %r9d
	cmpl	$1, %ecx
	jne	LBB0_12
## %bb.11:
	xorl	%esi, %esi
	xorl	%eax, %eax
LBB0_18:
	testb	$1, %r9b
	je	LBB0_21
## %bb.19:
	leaq	(%rsi,%rsi,2), %rcx
	shlq	$4, %rcx
	cmpl	%edx, 24(%r8,%rcx)
	jg	LBB0_21
## %bb.20:
	cmpl	%edx, 28(%r8,%rcx)
	cmovll	%eax, %esi
	movl	%esi, %eax
	jmp	LBB0_21
LBB0_9:
	xorl	%eax, %eax
LBB0_21:
	movq	(%r10), %rdx
	cltq
	leaq	(%rax,%rax,2), %rax
	shlq	$4, %rax
	movl	32(%rdx,%rax), %ecx
	movl	%ecx, 4(%r15)
	movl	16(%r13), %esi
	movl	28(%rdx,%rax), %ecx
	addl	24(%rdx,%rax), %ecx
	movl	%ecx, %edi
	shrl	$31, %edi
	addl	%ecx, %edi
	sarl	%edi
	xorl	%ecx, %ecx
	cmpl	%edi, %esi
	setge	%cl
	shll	$14, %ecx
	imull	(%rdx,%rax), %esi
	addl	%esi, %esi
	leal	(%rsi,%rsi,4), %eax
	movq	_XTAL@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	imulq	$274877907, %rdx, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rdx
	shrq	$63, %rdx
	sarq	$37, %rsi
	addl	%edx, %esi
	cltd
	idivl	%esi
                                        ## kill: def $eax killed $eax def $rax
	leal	31(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	shrl	$5, %edx
	andl	$511, %edx                      ## imm = 0x1FF
	andl	$31, %eax
	sete	%sil
	testl	%edx, %edx
	setne	%bl
	andb	%sil, %bl
	movzbl	%bl, %esi
	subl	%esi, %edx
	shll	$5, %edx
	addl	%ecx, %eax
	addl	$2048000, %eax                  ## imm = 0x1F4000
	orl	%edx, %eax
	movl	%eax, (%r15)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%r9d, %edi
	andl	$-2, %edi
	leaq	76(%r8), %rcx
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	addq	$2, %rsi
	addq	$96, %rcx
	cmpq	%rsi, %rdi
	je	LBB0_18
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%edx, -52(%rcx)
	jg	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpl	%edx, -48(%rcx)
	cmovgel	%esi, %eax
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	cmpl	%edx, -4(%rcx)
	jg	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	leal	1(%rsi), %ebx
	cmpl	%edx, (%rcx)
	cmovgel	%ebx, %eax
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_cx24123_bandselect_vals,8,3    ## @cx24123_bandselect_vals
	.comm	_cx24123_AGC_vals,8,3           ## @cx24123_AGC_vals
	.comm	_force_band,4,2                 ## @force_band
	.comm	_XTAL,4,2                       ## @XTAL
	.no_dead_strip	_cx24123_pll_calculate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx24123_pll_calculate
_cx24123_pll_calculate:                 ; @cx24123_pll_calculate
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	x21, [x0]
Lloh0:
	adrp	x22, _cx24123_bandselect_vals@GOTPAGE
Lloh1:
	ldr	x22, [x22, _cx24123_bandselect_vals@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	mov	x20, x0
Lloh2:
	adrp	x23, _cx24123_AGC_vals@GOTPAGE
Lloh3:
	ldr	x23, [x23, _cx24123_AGC_vals@GOTPAGEOFF]
	ldr	x0, [x23]
	ldr	d0, [x0, #40]
	stur	d0, [x21, #12]
	ldr	x8, [x22]
	ldr	w8, [x8, #32]
	str	w8, [x21, #4]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x24, #0
	mov	x25, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x25, x25, #1
	bl	_ARRAY_SIZE
	add	x24, x24, #48
	cmp	x25, w0, sxtw
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x23]
	add	x8, x0, x24
	ldr	x10, [x8, #8]
	ldr	x9, [x19, #8]
	cmp	x10, x9
	b.gt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x8, #16]
	cmp	x8, x9
	b.lt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x0, x24
	ldr	w9, [x8, #44]
	str	w9, [x21, #16]
	ldur	d0, [x8, #36]
	str	d0, [x21, #8]
	b	LBB0_2
LBB0_6:
Lloh4:
	adrp	x8, _force_band@GOTPAGE
Lloh5:
	ldr	x8, [x8, _force_band@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x8]
	subs	w8, w9, #1
	ccmp	w9, w20, #0, ge
	b.le	LBB0_13
; %bb.7:
	cmp	w20, #1
	b.lt	LBB0_12
; %bb.8:
	mov	x9, #0
	mov	w8, #0
	ldr	x12, [x22]
	ldr	w10, [x19, #16]
	mov	w11, w20
	add	x12, x12, #28
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x9, x9, #1
	add	x12, x12, #48
	cmp	x11, x9
	b.eq	LBB0_13
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldur	w13, [x12, #-4]
	cmp	w13, w10
	b.gt	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w13, [x12]
	cmp	w13, w10
	csel	w8, w8, w9, lt
	b	LBB0_9
LBB0_12:
	mov	w8, #0
LBB0_13:
	ldr	x9, [x22]
	mov	w10, #48
	smaddl	x8, w8, w10, x9
	ldr	w9, [x8]
	ldr	w10, [x19, #16]
	ldp	w11, w12, [x8, #24]
	add	w11, w12, w11
	cmp	w11, #0
	cinc	w11, w11, lt
	cmp	w10, w11, asr #1
	mov	w11, #2064384
	mov	w12, #16384
	movk	w12, #31, lsl #16
	csel	w11, w12, w11, lt
	mul	w9, w9, w10
	add	w9, w9, w9, lsl #2
Lloh7:
	adrp	x10, _XTAL@GOTPAGE
Lloh8:
	ldr	x10, [x10, _XTAL@GOTPAGEOFF]
	lsl	w9, w9, #1
Lloh9:
	ldrsw	x10, [x10]
	mov	w12, #19923
	movk	w12, #4194, lsl #16
	mul	x10, x10, x12
	lsr	x12, x10, #32
	lsr	x10, x10, #63
	add	w10, w10, w12, asr #5
	sdiv	w9, w9, w10
	add	w10, w9, #31
	cmp	w9, #0
	csel	w10, w10, w9, lt
	ands	w9, w9, #0x1f
	cset	w12, eq
	mov	w13, #511
	ands	w10, w13, w10, lsr #5
	cset	w13, ne
	and	w12, w12, w13
	ldr	w8, [x8, #32]
	sub	w10, w10, w12
	orr	w9, w11, w9
	orr	w9, w9, w10, lsl #5
	stp	w9, w8, [x21]
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_cx24123_bandselect_vals,8,3    ; @cx24123_bandselect_vals
	.comm	_cx24123_AGC_vals,8,3           ; @cx24123_AGC_vals
	.comm	_force_band,4,2                 ; @force_band
	.comm	_XTAL,4,2                       ; @XTAL
	.no_dead_strip	_cx24123_pll_calculate
.subsections_via_symbols
