	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx24108_tuner_set_params
_cx24108_tuner_set_params:              ## @cx24108_tuner_set_params
	.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
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movl	(%rdi), %ebx
	movups	l___const.cx24108_tuner_set_params.osci+28(%rip), %xmm0
	movups	%xmm0, -68(%rbp)
	movaps	l___const.cx24108_tuner_set_params.osci+16(%rip), %xmm0
	movaps	%xmm0, -80(%rbp)
	movaps	l___const.cx24108_tuner_set_params.osci(%rip), %xmm0
	movaps	%xmm0, -96(%rbp)
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_dprintk
	cmpl	$2150000, %ebx                  ## imm = 0x20CE70
	movl	$2150000, %eax                  ## imm = 0x20CE70
	cmovll	%ebx, %eax
	cmpl	$950001, %eax                   ## imm = 0xE7EF1
	movl	$950000, %r15d                  ## imm = 0xE7EF0
	cmovgel	%eax, %r15d
	leaq	-96(%rbp), %rdi
	callq	_ARRAY_SIZE
	movl	$1, %ebx
	cmpl	$3, %eax
	jl	LBB0_4
## %bb.1:
	movl	$1, %ebx
	leaq	-96(%rbp), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r15d, -96(%rbp,%rbx,4)
	jge	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movq	%r12, %rdi
	callq	_ARRAY_SIZE
	decl	%eax
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dprintk
	movl	%ebx, %esi
	leaq	l___const.cx24108_tuner_set_params.bandsel(%rip), %rax
	movl	(%rax,%rsi,4), %r12d
	cmpl	$3, %ebx
	movl	$0, %eax
	adcl	$1, %eax
	imull	%r15d, %eax
	addq	%rax, %rax
	leaq	(%rax,%rax,4), %rax
	movabsq	$7472837872209902425, %rcx      ## imm = 0x67B4DA73B5283B59
	mulq	%rcx
	shrq	$12, %rdx
	movl	%edx, %ecx
	andl	$31, %ecx
	shrl	$5, %edx
	cmpl	$1, %ecx
	sbbl	$0, %edx
	movslq	%ebx, %rax
	movl	-96(%rbp,%rsi,4), %esi
	addl	-100(%rbp,%rax,4), %esi
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	xorl	%edi, %edi
	xorl	%esi, %esi
	cmpl	%eax, %r15d
	setge	%dil
	setl	%sil
	shll	$25, %edi
	movl	%edx, %eax
	shll	$16, %eax
	andl	$33488896, %eax                 ## imm = 0x1FF0000
	orl	%edi, %eax
	movl	%ecx, %edi
	shll	$11, %edi
	leal	(%rdi,%rax), %ebx
	addl	$-100663296, %ebx               ## imm = 0xFA000000
	leaq	L_.str.2(%rip), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_dprintk
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_cx24110_pll_write
	movq	%r14, %rdi
	movl	$1342963712, %esi               ## imm = 0x500C0000
	callq	_cx24110_pll_write
	movq	%r14, %rdi
	movl	$-2081294336, %esi              ## imm = 0x83F1F800
	callq	_cx24110_pll_write
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_cx24110_pll_write
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @__const.cx24108_tuner_set_params.osci
l___const.cx24108_tuner_set_params.osci:
	.long	950000                          ## 0xe7ef0
	.long	1019000                         ## 0xf8c78
	.long	1075000                         ## 0x106738
	.long	1178000                         ## 0x11f990
	.long	1296000                         ## 0x13c680
	.long	1432000                         ## 0x15d9c0
	.long	1576000                         ## 0x180c40
	.long	1718000                         ## 0x1a36f0
	.long	1856000                         ## 0x1c5200
	.long	2036000                         ## 0x1f1120
	.long	2150000                         ## 0x20ce70

	.p2align	4                               ## @__const.cx24108_tuner_set_params.bandsel
l___const.cx24108_tuner_set_params.bandsel:
	.long	0                               ## 0x0
	.long	131072                          ## 0x20000
	.long	262144                          ## 0x40000
	.long	1050624                         ## 0x100800
	.long	1052672                         ## 0x101000
	.long	1056768                         ## 0x102000
	.long	1064960                         ## 0x104000
	.long	1081344                         ## 0x108000
	.long	1114112                         ## 0x110000
	.long	1179648                         ## 0x120000
	.long	1310720                         ## 0x140000

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cx24108 debug: entering SetTunerFreq, freq=%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"cx24108 debug: select vco #%d (f=%d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"cx24108 debug: pump=%d, n=%d, a=%d\n"

	.comm	_XTAL,4,2                       ## @XTAL
	.no_dead_strip	_cx24108_tuner_set_params
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx24108_tuner_set_params
_cx24108_tuner_set_params:              ; @cx24108_tuner_set_params
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	w20, [x0]
Lloh3:
	adrp	x8, l___const.cx24108_tuner_set_params.osci@PAGE
Lloh4:
	add	x8, x8, l___const.cx24108_tuner_set_params.osci@PAGEOFF
	ldp	q0, q1, [x8]
	stp	q0, q1, [sp, #16]
	ldur	q0, [x8, #28]
	stur	q0, [sp, #44]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_dprintk
	mov	w8, #52848
	movk	w8, #32, lsl #16
	cmp	w20, w8
	csel	w8, w20, w8, lt
	mov	w9, #32496
	movk	w9, #14, lsl #16
	cmp	w8, w9
	csel	w22, w8, w9, gt
	add	x23, sp, #16
	add	x0, sp, #16
	bl	_ARRAY_SIZE
	mov	w24, #1
	mov	w20, #1
	cmp	w0, #3
	b.lt	LBB0_4
; %bb.1:
	mov	w20, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23, x20, lsl #2]
	cmp	w8, w22
	b.ge	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x20, x20, #1
	add	x0, sp, #16
	bl	_ARRAY_SIZE
	sub	w8, w0, #1
	cmp	x20, w8, sxtw
	b.lt	LBB0_2
LBB0_4:
	str	x22, [sp]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_dprintk
	mov	w8, w20
	lsl	x8, x8, #2
Lloh9:
	adrp	x9, l___const.cx24108_tuner_set_params.bandsel@PAGE
Lloh10:
	add	x9, x9, l___const.cx24108_tuner_set_params.bandsel@PAGEOFF
	ldr	w21, [x9, x8]
	cmp	w20, #2
	cinc	w9, w24, ls
	mul	w9, w9, w22
	mov	w10, #10
	umull	x9, w9, w10
	mov	x10, #15193
	movk	x10, #46376, lsl #16
	movk	x10, #55923, lsl #32
	movk	x10, #26548, lsl #48
	umulh	x9, x9, x10
	lsr	x9, x9, #12
	ubfx	x10, x9, #5, #27
	ands	w9, w9, #0x1f
	cset	w11, eq
	sub	w10, w10, w11
	add	x11, x23, w20, sxtw #2
	ldur	w11, [x11, #-4]
	ldr	w8, [x23, x8]
	add	w8, w8, w11
	cmp	w8, #0
	cinc	w8, w8, lt
	cmp	w22, w8, asr #1
	cset	w1, lt
	mov	w8, #-67108864
	mov	w11, #-100663296
	csel	w8, w11, w8, lt
	bfi	w8, w10, #16, #9
	orr	w20, w8, w9, lsl #11
	stp	x10, x9, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dprintk
	mov	x0, x19
	mov	x1, x21
	bl	_cx24110_pll_write
	mov	x0, x19
	mov	w1, #1342963712
	bl	_cx24110_pll_write
	mov	x0, x19
	mov	w1, #63488
	movk	w1, #33777, lsl #16
	bl	_cx24110_pll_write
	mov	x0, x19
	mov	x1, x20
	bl	_cx24110_pll_write
	ldur	x8, [x29, #-56]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	mov	w0, #0
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @__const.cx24108_tuner_set_params.osci
l___const.cx24108_tuner_set_params.osci:
	.long	950000                          ; 0xe7ef0
	.long	1019000                         ; 0xf8c78
	.long	1075000                         ; 0x106738
	.long	1178000                         ; 0x11f990
	.long	1296000                         ; 0x13c680
	.long	1432000                         ; 0x15d9c0
	.long	1576000                         ; 0x180c40
	.long	1718000                         ; 0x1a36f0
	.long	1856000                         ; 0x1c5200
	.long	2036000                         ; 0x1f1120
	.long	2150000                         ; 0x20ce70

	.p2align	2                               ; @__const.cx24108_tuner_set_params.bandsel
l___const.cx24108_tuner_set_params.bandsel:
	.long	0                               ; 0x0
	.long	131072                          ; 0x20000
	.long	262144                          ; 0x40000
	.long	1050624                         ; 0x100800
	.long	1052672                         ; 0x101000
	.long	1056768                         ; 0x102000
	.long	1064960                         ; 0x104000
	.long	1081344                         ; 0x108000
	.long	1114112                         ; 0x110000
	.long	1179648                         ; 0x120000
	.long	1310720                         ; 0x140000

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cx24108 debug: entering SetTunerFreq, freq=%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"cx24108 debug: select vco #%d (f=%d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"cx24108 debug: pump=%d, n=%d, a=%d\n"

	.comm	_XTAL,4,2                       ; @XTAL
	.no_dead_strip	_cx24108_tuner_set_params
.subsections_via_symbols
