	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stb0899_init_calc
_stb0899_init_calc:                     ## @stb0899_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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_STB0899_AGC1REF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movl	$2, %ecx
	callq	_stb0899_read_regs
	movq	%rbx, %rdi
	callq	_stb0899_get_mclk
                                        ## kill: def $eax killed $eax def $rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rbx)
	movl	%eax, (%rbx)
	leal	65535(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$16, %ecx
	movl	%ecx, 4(%rbx)
	movq	%rbx, %rdi
	callq	_stb0899_get_alpha
	movl	%eax, 36(%rbx)
	movl	$8154, 8(%rbx)                  ## imm = 0x1FDA
	movq	_STB0899_S2DEMOD@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_IF_AGC_CNTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_STB0899_READ_S2REG
	movl	%eax, %r14d
	movq	_IF_GAIN_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%rbx), %edx
	movl	%r14d, %esi
	callq	_STB0899_SETFIELD_VAL
	movl	(%r15), %esi
	movq	_STB0899_BASE_IF_AGC_CNTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_STB0899_OFF0_IF_AGC_CNTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	%r14d, %r8d
	callq	_stb0899_write_s2reg
	movl	(%r15), %edi
	movq	_RRC_ALPHA@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	callq	_STB0899_READ_S2REG
	movl	(%r14), %edi
	movl	%eax, %esi
	callq	_STB0899_GETFIELD
	movl	%eax, 32(%rbx)
	movq	$0, 24(%rbx)
	movabsq	$85899345930, %rax              ## imm = 0x140000000A
	movq	%rax, 12(%rbx)
	movl	$2, 20(%rbx)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_2
## %bb.1:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_STB0899_AGC1REF,4,2            ## @STB0899_AGC1REF
	.comm	_STB0899_S2DEMOD,4,2            ## @STB0899_S2DEMOD
	.comm	_IF_AGC_CNTRL,4,2               ## @IF_AGC_CNTRL
	.comm	_IF_GAIN_INIT,4,2               ## @IF_GAIN_INIT
	.comm	_STB0899_BASE_IF_AGC_CNTRL,4,2  ## @STB0899_BASE_IF_AGC_CNTRL
	.comm	_STB0899_OFF0_IF_AGC_CNTRL,4,2  ## @STB0899_OFF0_IF_AGC_CNTRL
	.comm	_RRC_ALPHA,4,2                  ## @RRC_ALPHA
	.no_dead_strip	_stb0899_init_calc
.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 stb0899_init_calc
lCPI0_0:
	.long	10                              ; 0xa
	.long	20                              ; 0x14
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_stb0899_init_calc:                     ; @stb0899_init_calc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
Lloh3:
	adrp	x8, _STB0899_AGC1REF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STB0899_AGC1REF@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w21, #2
	mov	x2, sp
	mov	w3, #2
	bl	_stb0899_read_regs
	mov	x0, x19
	bl	_stb0899_get_mclk
	stp	xzr, xzr, [x19, #40]
	mov	w8, #65535
	add	w8, w0, w8
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w8, w8, #16
	stp	w0, w8, [x19]
	mov	x0, x19
	bl	_stb0899_get_alpha
	str	w0, [x19, #36]
	mov	w8, #8154
	str	w8, [x19, #8]
Lloh6:
	adrp	x22, _STB0899_S2DEMOD@GOTPAGE
Lloh7:
	ldr	x22, [x22, _STB0899_S2DEMOD@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh8:
	adrp	x8, _IF_AGC_CNTRL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IF_AGC_CNTRL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_STB0899_READ_S2REG
	mov	x20, x0
Lloh11:
	adrp	x8, _IF_GAIN_INIT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IF_GAIN_INIT@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldr	w2, [x19, #8]
	mov	x1, x20
	bl	_STB0899_SETFIELD_VAL
	ldr	w1, [x22]
Lloh14:
	adrp	x8, _STB0899_BASE_IF_AGC_CNTRL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _STB0899_BASE_IF_AGC_CNTRL@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x8, _STB0899_OFF0_IF_AGC_CNTRL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _STB0899_OFF0_IF_AGC_CNTRL@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x4, x20
	bl	_stb0899_write_s2reg
	ldr	w0, [x22]
Lloh20:
	adrp	x20, _RRC_ALPHA@GOTPAGE
Lloh21:
	ldr	x20, [x20, _RRC_ALPHA@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_STB0899_READ_S2REG
	mov	x1, x0
	ldr	w0, [x20]
	bl	_STB0899_GETFIELD
	str	w0, [x19, #32]
	str	xzr, [x19, #24]
Lloh22:
	adrp	x8, lCPI0_0@PAGE
Lloh23:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x19, #12]
	str	w21, [x19, #20]
	ldr	x8, [sp, #8]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	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
	add	sp, sp, #64
	ret
LBB0_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdr	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_STB0899_AGC1REF,4,2            ; @STB0899_AGC1REF
	.comm	_STB0899_S2DEMOD,4,2            ; @STB0899_S2DEMOD
	.comm	_IF_AGC_CNTRL,4,2               ; @IF_AGC_CNTRL
	.comm	_IF_GAIN_INIT,4,2               ; @IF_GAIN_INIT
	.comm	_STB0899_BASE_IF_AGC_CNTRL,4,2  ; @STB0899_BASE_IF_AGC_CNTRL
	.comm	_STB0899_OFF0_IF_AGC_CNTRL,4,2  ; @STB0899_OFF0_IF_AGC_CNTRL
	.comm	_RRC_ALPHA,4,2                  ; @RRC_ALPHA
	.no_dead_strip	_stb0899_init_calc
.subsections_via_symbols
