	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv0367ter_snr_readreg
_stv0367ter_snr_readreg:                ## @stv0367ter_snr_readreg
	.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), %r14
	movq	_F367TER_IDENTIFICATIONREG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_stv0367_readbits
	movl	%eax, %r15d
	xorl	%r12d, %r12d
	movl	$10, %ebx
	movq	_F367TER_CHCSNR@GOTPCREL(%rip), %r13
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	imull	$125, %eax, %ecx
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	addl	%ecx, %r12d
	decl	%ebx
	je	LBB0_5
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$2000, %edi                     ## imm = 0x7D0
	movl	$3000, %esi                     ## imm = 0xBB8
	callq	_usleep_range
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_stv0367_readbits
                                        ## kill: def $eax killed $eax def $rax
	cmpl	$80, %r15d
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	jmp	LBB0_4
LBB0_5:
	movslq	%r12d, %rax
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$34, %rax
	addl	%ecx, %eax
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_F367TER_IDENTIFICATIONREG,4,2  ## @F367TER_IDENTIFICATIONREG
	.comm	_F367TER_CHCSNR,4,2             ## @F367TER_CHCSNR
	.no_dead_strip	_stv0367ter_snr_readreg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv0367ter_snr_readreg
_stv0367ter_snr_readreg:                ; @stv0367ter_snr_readreg
	.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
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _F367TER_IDENTIFICATIONREG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _F367TER_IDENTIFICATIONREG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_stv0367_readbits
	mov	x20, x0
	mov	w21, #0
	mov	w22, #10
Lloh3:
	adrp	x23, _F367TER_CHCSNR@GOTPAGE
Lloh4:
	ldr	x23, [x23, _F367TER_CHCSNR@GOTPAGEOFF]
	mov	w24, #125
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #2000
	mov	w1, #3000
	bl	_usleep_range
	ldr	w1, [x23]
	mov	x0, x19
	bl	_stv0367_readbits
	mul	w8, w0, w24
	add	w9, w0, #3
	cmp	w0, #0
	csel	w9, w9, w0, lt
	asr	w9, w9, #2
	cmp	w20, #80
	csel	w8, w8, w9, ne
	add	w21, w8, w21
	subs	w22, w22, #1
	b.ne	LBB0_1
; %bb.2:
	mov	w8, #26215
	movk	w8, #26214, lsl #16
	smull	x8, w21, w8
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w0, w8, w9
	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
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_F367TER_IDENTIFICATIONREG,4,2  ; @F367TER_IDENTIFICATIONREG
	.comm	_F367TER_CHCSNR,4,2             ; @F367TER_CHCSNR
	.no_dead_strip	_stv0367ter_snr_readreg
.subsections_via_symbols
