	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stb0899_dvbs2_init_calc
_stb0899_dvbs2_init_calc:               ## @stb0899_dvbs2_init_calc
	.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, %r12
	callq	_stb0899_dvbs2_config_uwp
	movq	%r12, %rdi
	callq	_stb0899_dvbs2_config_csm_auto
	movq	%r12, %rdi
	callq	_stb0899_dvbs2_set_srate
	movq	%r12, %rdi
	callq	_stb0899_dvbs2_set_btr_loopbw
	movl	(%r12), %ecx
	movl	$26214, %r14d                   ## imm = 0x6666
	cmpl	$14999999, %ecx                 ## imm = 0xE4E1BF
	jg	LBB0_3
## %bb.1:
	movl	$18724, %r14d                   ## imm = 0x4924
	cmpl	$9999999, %ecx                  ## imm = 0x98967F
	jg	LBB0_3
## %bb.2:
	cmpl	$5000000, %ecx                  ## imm = 0x4C4B40
	movl	$13107, %eax                    ## imm = 0x3333
	movl	$32768, %r14d                   ## imm = 0x8000
	cmovgel	%eax, %r14d
LBB0_3:
	movslq	4(%r12), %rax
	imulq	$1125899907, %rax, %rax         ## imm = 0x431BDE83
	movq	%rax, %rdx
	shrq	$63, %rdx
	shrq	$50, %rax
	addl	%edx, %eax
	shll	$18, %eax
	leal	(%rax,%rax,4), %eax
	movslq	%ecx, %rcx
	imulq	$1125899907, %rcx, %rsi         ## imm = 0x431BDE83
	movq	%rsi, %rdx
	shrq	$63, %rdx
	sarq	$50, %rsi
	addl	%edx, %esi
	imull	%r14d, %esi
	cltd
	idivl	%esi
                                        ## kill: def $eax killed $eax def $rax
	leal	15(%rax), %edx
	movl	$1, %r15d
	cmpl	$19, %edx
	jb	LBB0_5
## %bb.4:
	addl	$6, %eax
	cltq
	imulq	$1717986919, %rax, %r15         ## imm = 0x66666667
	movq	%r15, %rax
	shrq	$63, %rax
	sarq	$34, %r15
	addl	%eax, %r15d
LBB0_5:
	movq	16(%r12), %rsi
	testb	$1, %r15b
	jne	LBB0_7
## %bb.6:
	movslq	8(%r12), %rax
	imulq	$1801439851, %rcx, %rcx         ## imm = 0x6B5FCA6B
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$55, %rcx
	addl	%edx, %ecx
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	subq	%rcx, %rsi
LBB0_7:
	movslq	12(%r12), %rax
	imulq	$1125899907, %rax, %rdx         ## imm = 0x431BDE83
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$50, %rdx
	addl	%eax, %edx
	movq	%r12, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_stb0899_dvbs2_set_carr_freq
	movq	_STB0899_S2DEMOD@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_ACQ_CNTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_STB0899_READ_S2REG
	movl	%eax, %ebx
	movq	_ZIGZAG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_STB0899_SETFIELD_VAL
	movq	_NUM_STEPS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_STB0899_SETFIELD_VAL
	movq	_FREQ_STEPSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_STB0899_SETFIELD_VAL
	movl	(%r13), %esi
	movq	_STB0899_BASE_ACQ_CNTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_STB0899_OFF0_ACQ_CNTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movl	%ebx, %r8d
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_stb0899_write_s2reg            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_STB0899_S2DEMOD,4,2            ## @STB0899_S2DEMOD
	.comm	_ACQ_CNTRL2,4,2                 ## @ACQ_CNTRL2
	.comm	_ZIGZAG,4,2                     ## @ZIGZAG
	.comm	_NUM_STEPS,4,2                  ## @NUM_STEPS
	.comm	_FREQ_STEPSIZE,4,2              ## @FREQ_STEPSIZE
	.comm	_STB0899_BASE_ACQ_CNTRL2,4,2    ## @STB0899_BASE_ACQ_CNTRL2
	.comm	_STB0899_OFF0_ACQ_CNTRL2,4,2    ## @STB0899_OFF0_ACQ_CNTRL2
	.no_dead_strip	_stb0899_dvbs2_init_calc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stb0899_dvbs2_init_calc
_stb0899_dvbs2_init_calc:               ; @stb0899_dvbs2_init_calc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	bl	_stb0899_dvbs2_config_uwp
	mov	x0, x19
	bl	_stb0899_dvbs2_config_csm_auto
	mov	x0, x19
	bl	_stb0899_dvbs2_set_srate
	mov	x0, x19
	bl	_stb0899_dvbs2_set_btr_loopbw
	ldr	w8, [x19]
	mov	w9, #57791
	movk	w9, #228, lsl #16
	cmp	w8, w9
	b.le	LBB0_2
; %bb.1:
	mov	w20, #26214
	b	LBB0_3
LBB0_2:
	mov	w9, #18724
	mov	w10, #38527
	movk	w10, #152, lsl #16
	mov	w11, #19263
	movk	w11, #76, lsl #16
	mov	w12, #32768
	mov	w13, #13107
	cmp	w8, w11
	csel	w11, w13, w12, gt
	cmp	w8, w10
	csel	w20, w9, w11, gt
LBB0_3:
	mov	w9, #16960
	movk	w9, #15, lsl #16
	ldrsw	x10, [x19, #4]
	mov	w11, #56963
	movk	w11, #17179, lsl #16
	mul	x10, x10, x11
	lsr	x12, x10, #63
	asr	x10, x10, #50
	add	w10, w10, w12
	add	w10, w10, w10, lsl #2
	lsl	w10, w10, #18
	smull	x11, w8, w11
	lsr	x12, x11, #63
	asr	x11, x11, #50
	add	w11, w11, w12
	mul	w11, w20, w11
	sdiv	w10, w10, w11
	add	w11, w10, #6
	mov	w12, #26215
	movk	w12, #26214, lsl #16
	smull	x11, w11, w12
	lsr	x12, x11, #63
	asr	x11, x11, #34
	add	w11, w11, w12
	add	w10, w10, #15
	cmp	w10, #19
	csinc	w21, w11, wzr, hs
	ldr	x1, [x19, #16]
	tbnz	w21, #0, LBB0_5
; %bb.4:
	ldrsw	x10, [x19, #8]
	mov	w11, #51819
	movk	w11, #27487, lsl #16
	smull	x8, w8, w11
	lsr	x11, x8, #63
	asr	x8, x8, #55
	add	w8, w8, w11
	sxtw	x8, w8
	msub	x1, x10, x8, x1
LBB0_5:
	ldr	w8, [x19, #12]
	sdiv	w2, w8, w9
	mov	x0, x19
	bl	_stb0899_dvbs2_set_carr_freq
Lloh0:
	adrp	x23, _STB0899_S2DEMOD@GOTPAGE
Lloh1:
	ldr	x23, [x23, _STB0899_S2DEMOD@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh2:
	adrp	x8, _ACQ_CNTRL2@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ACQ_CNTRL2@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_STB0899_READ_S2REG
	mov	x22, x0
Lloh5:
	adrp	x8, _ZIGZAG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ZIGZAG@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x22
	mov	w2, #1
	bl	_STB0899_SETFIELD_VAL
Lloh8:
	adrp	x8, _NUM_STEPS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NUM_STEPS@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x22
	mov	x2, x21
	bl	_STB0899_SETFIELD_VAL
Lloh11:
	adrp	x8, _FREQ_STEPSIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _FREQ_STEPSIZE@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, x22
	mov	x2, x20
	bl	_STB0899_SETFIELD_VAL
	ldr	w1, [x23]
Lloh14:
	adrp	x8, _STB0899_BASE_ACQ_CNTRL2@GOTPAGE
Lloh15:
	ldr	x8, [x8, _STB0899_BASE_ACQ_CNTRL2@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x8, _STB0899_OFF0_ACQ_CNTRL2@GOTPAGE
Lloh18:
	ldr	x8, [x8, _STB0899_OFF0_ACQ_CNTRL2@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x4, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_stb0899_write_s2reg
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_STB0899_S2DEMOD,4,2            ; @STB0899_S2DEMOD
	.comm	_ACQ_CNTRL2,4,2                 ; @ACQ_CNTRL2
	.comm	_ZIGZAG,4,2                     ; @ZIGZAG
	.comm	_NUM_STEPS,4,2                  ; @NUM_STEPS
	.comm	_FREQ_STEPSIZE,4,2              ; @FREQ_STEPSIZE
	.comm	_STB0899_BASE_ACQ_CNTRL2,4,2    ; @STB0899_BASE_ACQ_CNTRL2
	.comm	_STB0899_OFF0_ACQ_CNTRL2,4,2    ; @STB0899_OFF0_ACQ_CNTRL2
	.no_dead_strip	_stb0899_dvbs2_init_calc
.subsections_via_symbols
