	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function advbt771_samsung_tdtc9251dh0_tuner_calc_regs
_advbt771_samsung_tdtc9251dh0_tuner_calc_regs: ## @advbt771_samsung_tdtc9251dh0_tuner_calc_regs
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	cmpl	$4, %edx
	jg	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbp
	retq
LBB0_2:
	movl	(%rdi), %edi
	leal	(%rdi,%rdi,2), %eax
	addl	$249999, %eax                   ## imm = 0x3D08F
	cltq
	imulq	$1125899907, %rax, %rax         ## imm = 0x431BDE83
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$49, %rax
	addl	%ecx, %eax
	movq	_IF_FREQUENCYx6@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movl	$1, %ecx
	movl	$180, %edx
	cmpl	$150000000, %edi                ## imm = 0x8F0D180
	jl	LBB0_13
## %bb.3:
	cmpl	$173000000, %edi                ## imm = 0xA4FC540
	jb	LBB0_4
## %bb.5:
	movl	$2, %ecx
	cmpl	$250000000, %edi                ## imm = 0xEE6B280
	jb	LBB0_13
## %bb.6:
	cmpl	$400000000, %edi                ## imm = 0x17D78400
	jae	LBB0_8
LBB0_4:
	movl	$188, %edx
LBB0_13:
	movl	$97, (%rsi)
	movl	%eax, %edi
	sarl	$8, %edi
	movl	%edi, 4(%rsi)
	movzbl	%al, %eax
	movl	%eax, 8(%rsi)
	movl	%edx, 12(%rsi)
	movl	%ecx, 16(%rsi)
	movl	$5, %eax
	popq	%rbp
	retq
LBB0_8:
	movl	$244, %edx
	cmpl	$420000000, %edi                ## imm = 0x1908B100
	jb	LBB0_13
## %bb.9:
	movl	$252, %edx
	cmpl	$470000000, %edi                ## imm = 0x1C03A180
	jb	LBB0_13
## %bb.10:
	movl	$8, %ecx
	cmpl	$600000000, %edi                ## imm = 0x23C34600
	jb	LBB0_4
## %bb.12:
	xorl	%edx, %edx
	cmpl	$730000000, %edi                ## imm = 0x2B82EA80
	setae	%dl
	leal	244(,%rdx,8), %edx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IF_FREQUENCYx6,4,2             ## @IF_FREQUENCYx6
	.no_dead_strip	_advbt771_samsung_tdtc9251dh0_tuner_calc_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function advbt771_samsung_tdtc9251dh0_tuner_calc_regs
lCPI0_0:
	.long	180                             ; 0xb4
	.long	1                               ; 0x1
lCPI0_1:
	.long	188                             ; 0xbc
	.long	1                               ; 0x1
lCPI0_2:
	.long	180                             ; 0xb4
	.long	2                               ; 0x2
lCPI0_3:
	.long	188                             ; 0xbc
	.long	2                               ; 0x2
lCPI0_4:
	.long	244                             ; 0xf4
	.long	2                               ; 0x2
lCPI0_5:
	.long	252                             ; 0xfc
	.long	2                               ; 0x2
lCPI0_6:
	.long	188                             ; 0xbc
	.long	8                               ; 0x8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_advbt771_samsung_tdtc9251dh0_tuner_calc_regs: ; @advbt771_samsung_tdtc9251dh0_tuner_calc_regs
	.cfi_startproc
; %bb.0:
	cmp	w2, #4
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_2:
	ldr	w9, [x0]
	add	w8, w9, w9, lsl #1
	add	w8, w8, #61, lsl #12            ; =249856
	add	w8, w8, #143
	mov	w10, #56963
	movk	w10, #17179, lsl #16
	smull	x8, w8, w10
	lsr	x10, x8, #63
Lloh3:
	adrp	x11, _IF_FREQUENCYx6@GOTPAGE
Lloh4:
	ldr	x11, [x11, _IF_FREQUENCYx6@GOTPAGEOFF]
	asr	x8, x8, #49
Lloh5:
	ldr	w11, [x11]
	add	w8, w8, w10
	add	w8, w8, w11
	mov	w10, #53632
	movk	w10, #2288, lsl #16
	cmp	w9, w10
	b.ge	LBB0_4
; %bb.3:
Lloh6:
	adrp	x9, lCPI0_0@PAGE
Lloh7:
	ldr	d0, [x9, lCPI0_0@PAGEOFF]
	b	LBB0_15
LBB0_4:
	mov	w10, #50496
	movk	w10, #2639, lsl #16
	cmp	w9, w10
	b.hs	LBB0_6
; %bb.5:
Lloh8:
	adrp	x9, lCPI0_1@PAGE
Lloh9:
	ldr	d0, [x9, lCPI0_1@PAGEOFF]
	b	LBB0_15
LBB0_6:
	mov	w10, #45696
	movk	w10, #3814, lsl #16
	cmp	w9, w10
	b.hs	LBB0_8
; %bb.7:
Lloh10:
	adrp	x9, lCPI0_2@PAGE
Lloh11:
	ldr	d0, [x9, lCPI0_2@PAGEOFF]
	b	LBB0_15
LBB0_8:
	mov	w10, #33792
	movk	w10, #6103, lsl #16
	cmp	w9, w10
	b.hs	LBB0_10
; %bb.9:
Lloh12:
	adrp	x9, lCPI0_3@PAGE
Lloh13:
	ldr	d0, [x9, lCPI0_3@PAGEOFF]
	b	LBB0_15
LBB0_10:
	mov	w10, #45312
	movk	w10, #6408, lsl #16
	cmp	w9, w10
	b.hs	LBB0_12
; %bb.11:
Lloh14:
	adrp	x9, lCPI0_4@PAGE
Lloh15:
	ldr	d0, [x9, lCPI0_4@PAGEOFF]
	b	LBB0_15
LBB0_12:
	mov	w10, #41344
	movk	w10, #7171, lsl #16
	cmp	w9, w10
	b.hs	LBB0_14
; %bb.13:
Lloh16:
	adrp	x9, lCPI0_5@PAGE
Lloh17:
	ldr	d0, [x9, lCPI0_5@PAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh18:
	adrp	x10, lCPI0_6@PAGE
Lloh19:
	ldr	d0, [x10, lCPI0_6@PAGEOFF]
	mov	w10, #17920
	movk	w10, #9155, lsl #16
	mov	w11, #60032
	movk	w11, #11138, lsl #16
	mov	w12, #252
	mov	w13, #244
	cmp	w9, w11
	csel	w11, w13, w12, lo
	movi.2s	v1, #8
	mov.s	v1[0], w11
	cmp	w9, w10
	fcsel	d0, d0, d1, lo
LBB0_15:
	mov	w9, #97
	asr	w10, w8, #8
	stp	w9, w10, [x1]
	and	w8, w8, #0xff
	str	w8, [x1, #8]
	stur	d0, [x1, #12]
	mov	w0, #5
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpLdr	Lloh8, Lloh9
	.loh AdrpLdr	Lloh10, Lloh11
	.loh AdrpLdr	Lloh12, Lloh13
	.loh AdrpLdr	Lloh14, Lloh15
	.loh AdrpLdr	Lloh16, Lloh17
	.loh AdrpLdr	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IF_FREQUENCYx6,4,2             ; @IF_FREQUENCYx6
	.no_dead_strip	_advbt771_samsung_tdtc9251dh0_tuner_calc_regs
.subsections_via_symbols
