	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv6110_get_frequency
_stv6110_get_frequency:                 ## @stv6110_get_frequency
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	(%rdi), %rbx
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	movaps	%xmm0, -64(%rbp)
	leaq	-64(%rbp), %rsi
	xorl	%edx, %edx
	movl	$8, %ecx
	callq	_stv6110_read_regs
	movq	(%rbx), %rax
	movq	_RSTV6110_TUNING2@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edx
	movl	%edx, %esi
	andl	$15, %esi
	shll	$8, %esi
	movq	_RSTV6110_TUNING1@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addl	(%rax,%rcx,4), %esi
	movl	%edx, %ecx
	shrl	$6, %ecx
	andl	$3, %ecx
	movslq	8(%rbx), %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rdi
	shrq	$63, %rdi
	sarq	$38, %rax
	addl	%edi, %eax
	imull	%esi, %eax
	btl	$4, %edx
	adcl	$0, %ecx
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%esi
                                        ## kill: def $eax killed $eax def $rax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	movl	%ecx, (%r14)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RSTV6110_TUNING2,8,3           ## @RSTV6110_TUNING2
	.comm	_RSTV6110_TUNING1,8,3           ## @RSTV6110_TUNING1
	.no_dead_strip	_stv6110_get_frequency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv6110_get_frequency
_stv6110_get_frequency:                 ; @stv6110_get_frequency
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	ldr	x20, [x0]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	mov	x1, sp
	mov	w2, #0
	mov	w3, #8
	bl	_stv6110_read_regs
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _RSTV6110_TUNING2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RSTV6110_TUNING2@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	w9, [x8, x9, lsl #2]
	ubfiz	w10, w9, #8, #4
Lloh6:
	adrp	x11, _RSTV6110_TUNING1@GOTPAGE
Lloh7:
	ldr	x11, [x11, _RSTV6110_TUNING1@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
	ldr	w8, [x8, x11, lsl #2]
	add	w8, w10, w8
	ubfx	w10, w9, #6, #2
	ubfx	w9, w9, #4, #1
	ldrsw	x11, [x20, #8]
	mov	w12, #19923
	movk	w12, #4194, lsl #16
	mul	x11, x11, x12
	lsr	x12, x11, #63
	asr	x11, x11, #38
	add	w11, w11, w12
	mul	w8, w11, w8
	add	w9, w10, w9
	mov	w10, #1
	lsl	w9, w10, w9
	sdiv	w8, w8, w9
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #2
	str	w8, [x19]
	ldur	x8, [x29, #-24]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RSTV6110_TUNING2,8,3           ; @RSTV6110_TUNING2
	.comm	_RSTV6110_TUNING1,8,3           ; @RSTV6110_TUNING1
	.no_dead_strip	_stv6110_get_frequency
.subsections_via_symbols
