	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv0367cab_get_rf_lvl
_stv0367cab_get_rf_lvl:                 ## @stv0367cab_get_rf_lvl
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_F367CAB_STDBY_ADCGP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	callq	_stv0367_writebits
	movq	_F367CAB_RF_AGC1_LEVEL_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_stv0367_readbits
	movl	%eax, %ebx
	andl	$3, %ebx
	movq	_F367CAB_RF_AGC1_LEVEL_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_stv0367_readbits
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rbx,%rax,4), %eax
	imull	$100, %eax, %r12d
	movq	_F367CAB_AGC_IF_PWMCMD_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_stv0367_readbits
	movl	%eax, %ebx
	movq	_F367CAB_AGC_IF_PWMCMD_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_stv0367_readbits
	shll	$8, %eax
	addl	%ebx, %eax
	xorl	%ecx, %ecx
	cmpl	$2048, %eax                     ## imm = 0x800
	setl	%cl
	shll	$12, %ecx
	addl	%eax, %ecx
	imull	$100, %ecx, %ecx
	leal	-204800(%rcx), %edx
	cmpl	$92069, %r12d                   ## imm = 0x167A5
	jg	LBB0_2
## %bb.1:
	cmpl	$114660, %edx                   ## imm = 0x1BFE4
	jge	LBB0_2
## %bb.4:
	movq	_RF_LOOKUP_TABLE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movslq	%r12d, %rcx
	imulq	$-2145384445, %rcx, %rdx        ## imm = 0x80200803
	shrq	$32, %rdx
	addl	%r12d, %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	sarl	$9, %edx
	addl	%ecx, %edx
	movq	_stv0367cab_RF_LookUp1@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	(%rsi), %rdi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	(%rdi,%rcx,4), %edx
	jle	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rcx
	cmpq	%rcx, %rax
	jne	LBB0_7
## %bb.10:
	xorl	%edx, %edx
	movq	%rax, %rcx
	jmp	LBB0_11
LBB0_2:
	movq	_RF_LOOKUP_TABLE2_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.12:
	movslq	%edx, %rdx
	imulq	$-2146959231, %rdx, %rdx        ## imm = 0x80080081
	shrq	$32, %rdx
	addl	%ecx, %edx
	addl	$-204800, %edx                  ## imm = 0xFFFCE000
	movl	%edx, %ecx
	shrl	$31, %ecx
	sarl	$11, %edx
	addl	%ecx, %edx
	movq	_stv0367cab_RF_LookUp2@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	(%rsi), %rdi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpl	(%rdi,%rcx,4), %edx
	jle	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	incq	%rcx
	cmpq	%rcx, %rax
	jne	LBB0_13
## %bb.16:
	xorl	%r15d, %r15d
	movq	%rax, %rcx
	jmp	LBB0_17
LBB0_5:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	LBB0_11
LBB0_3:
	xorl	%ecx, %ecx
	jmp	LBB0_17
LBB0_8:
	movq	8(%rsi), %rsi
	xorl	%edx, %edx
	subl	(%rsi,%rcx,4), %edx
LBB0_11:
	cmpq	%rax, %rcx
	movl	$-56, %eax
	cmovnel	%edx, %eax
	jmp	LBB0_18
LBB0_14:
	movq	8(%rsi), %rdx
	xorl	%r15d, %r15d
	subl	(%rdx,%rcx,4), %r15d
LBB0_17:
	cmpq	%rax, %rcx
	movl	$-72, %eax
	cmovnel	%r15d, %eax
LBB0_18:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_F367CAB_STDBY_ADCGP,4,2        ## @F367CAB_STDBY_ADCGP
	.comm	_F367CAB_RF_AGC1_LEVEL_LO,4,2   ## @F367CAB_RF_AGC1_LEVEL_LO
	.comm	_F367CAB_RF_AGC1_LEVEL_HI,4,2   ## @F367CAB_RF_AGC1_LEVEL_HI
	.comm	_F367CAB_AGC_IF_PWMCMD_LO,4,2   ## @F367CAB_AGC_IF_PWMCMD_LO
	.comm	_F367CAB_AGC_IF_PWMCMD_HI,4,2   ## @F367CAB_AGC_IF_PWMCMD_HI
	.comm	_RF_LOOKUP_TABLE_SIZE,8,3       ## @RF_LOOKUP_TABLE_SIZE
	.comm	_stv0367cab_RF_LookUp1,8,3      ## @stv0367cab_RF_LookUp1
	.comm	_RF_LOOKUP_TABLE2_SIZE,8,3      ## @RF_LOOKUP_TABLE2_SIZE
	.comm	_stv0367cab_RF_LookUp2,8,3      ## @stv0367cab_RF_LookUp2
	.no_dead_strip	_stv0367cab_get_rf_lvl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv0367cab_get_rf_lvl
_stv0367cab_get_rf_lvl:                 ; @stv0367cab_get_rf_lvl
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, _F367CAB_STDBY_ADCGP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _F367CAB_STDBY_ADCGP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_stv0367_writebits
Lloh3:
	adrp	x8, _F367CAB_RF_AGC1_LEVEL_LO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _F367CAB_RF_AGC1_LEVEL_LO@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_stv0367_readbits
	mov	x20, x0
Lloh6:
	adrp	x8, _F367CAB_RF_AGC1_LEVEL_HI@GOTPAGE
Lloh7:
	ldr	x8, [x8, _F367CAB_RF_AGC1_LEVEL_HI@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_stv0367_readbits
	bfi	w20, w0, #2, #30
	mov	w22, #100
	mul	w21, w20, w22
Lloh9:
	adrp	x8, _F367CAB_AGC_IF_PWMCMD_LO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _F367CAB_AGC_IF_PWMCMD_LO@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_stv0367_readbits
	mov	x20, x0
Lloh12:
	adrp	x8, _F367CAB_AGC_IF_PWMCMD_HI@GOTPAGE
Lloh13:
	ldr	x8, [x8, _F367CAB_AGC_IF_PWMCMD_HI@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_stv0367_readbits
	add	w8, w20, w0, lsl #8
	cmp	w8, #2048
	mov	w9, #2048
	cneg	w9, w9, ge
	add	w8, w9, w8
	mul	w10, w8, w22
	mov	w8, #26533
	movk	w8, #1, lsl #16
	cmp	w21, w8
	mov	w8, #49124
	movk	w8, #1, lsl #16
	ccmp	w10, w8, #0, le
	b.lt	LBB0_6
; %bb.1:
Lloh15:
	adrp	x8, _RF_LOOKUP_TABLE2_SIZE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RF_LOOKUP_TABLE2_SIZE@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.2:
	mov	x9, #0
	mov	w11, #129
	movk	w11, #32776, lsl #16
	smull	x11, w10, w11
	lsr	x11, x11, #32
	add	w10, w11, w10
	asr	w11, w10, #11
	add	w10, w11, w10, lsr #31
Lloh18:
	adrp	x11, _stv0367cab_RF_LookUp2@GOTPAGE
Lloh19:
	ldr	x11, [x11, _stv0367cab_RF_LookUp2@GOTPAGEOFF]
Lloh20:
	ldr	x11, [x11]
	ldr	x12, [x11]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x12, x9, lsl #2]
	cmp	w10, w13
	b.le	LBB0_13
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.5:
	mov	w10, #0
	mov	x9, x8
	b	LBB0_14
LBB0_6:
Lloh21:
	adrp	x8, _RF_LOOKUP_TABLE_SIZE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RF_LOOKUP_TABLE_SIZE@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cbz	x8, LBB0_12
; %bb.7:
	mov	x9, #0
	mov	w10, #2051
	movk	w10, #32800, lsl #16
	smull	x10, w21, w10
	lsr	x10, x10, #32
	add	w10, w10, w21
	asr	w11, w10, #9
	add	w10, w11, w10, lsr #31
Lloh24:
	adrp	x11, _stv0367cab_RF_LookUp1@GOTPAGE
Lloh25:
	ldr	x11, [x11, _stv0367cab_RF_LookUp1@GOTPAGEOFF]
Lloh26:
	ldr	x11, [x11]
	ldr	x12, [x11]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x12, x9, lsl #2]
	cmp	w10, w13
	b.le	LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.10:
	mov	w10, #0
	mov	x9, x8
	b	LBB0_16
LBB0_11:
	mov	x9, #0
	mov	w10, #0
	b	LBB0_14
LBB0_12:
	mov	x9, #0
	mov	w10, #0
	b	LBB0_16
LBB0_13:
	ldr	x10, [x11, #8]
	ldr	w10, [x10, x9, lsl #2]
	neg	w10, w10
LBB0_14:
	cmp	x9, x8
	mov	w8, #-72
	b	LBB0_17
LBB0_15:
	ldr	x10, [x11, #8]
	ldr	w10, [x10, x9, lsl #2]
	neg	w10, w10
LBB0_16:
	cmp	x9, x8
	mov	w8, #-56
LBB0_17:
	csel	w0, w8, w10, eq
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_F367CAB_STDBY_ADCGP,4,2        ; @F367CAB_STDBY_ADCGP
	.comm	_F367CAB_RF_AGC1_LEVEL_LO,4,2   ; @F367CAB_RF_AGC1_LEVEL_LO
	.comm	_F367CAB_RF_AGC1_LEVEL_HI,4,2   ; @F367CAB_RF_AGC1_LEVEL_HI
	.comm	_F367CAB_AGC_IF_PWMCMD_LO,4,2   ; @F367CAB_AGC_IF_PWMCMD_LO
	.comm	_F367CAB_AGC_IF_PWMCMD_HI,4,2   ; @F367CAB_AGC_IF_PWMCMD_HI
	.comm	_RF_LOOKUP_TABLE_SIZE,8,3       ; @RF_LOOKUP_TABLE_SIZE
	.comm	_stv0367cab_RF_LookUp1,8,3      ; @stv0367cab_RF_LookUp1
	.comm	_RF_LOOKUP_TABLE2_SIZE,8,3      ; @RF_LOOKUP_TABLE2_SIZE
	.comm	_stv0367cab_RF_LookUp2,8,3      ; @stv0367cab_RF_LookUp2
	.no_dead_strip	_stv0367cab_get_rf_lvl
.subsections_via_symbols
