	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vivid_radio_calc_sig_qual
_vivid_radio_calc_sig_qual:             ## @vivid_radio_calc_sig_qual
	.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, %r15
	movl	(%rdi), %ecx
	movq	_AM_FREQ_RANGE_HIGH@GOTPCREL(%rip), %r13
	cmpl	(%r13), %ecx
	movl	$16000, %r14d                   ## imm = 0x3E80
	movl	$1600, %esi                     ## imm = 0x640
	cmovgl	%r14d, %esi
	movl	$800, %eax                      ## imm = 0x320
	movl	$80, %edi
	cmovgl	%eax, %edi
	leal	(%rdi,%rcx), %eax
	cltd
	idivl	%esi
	movl	%edx, %ebx
	subl	%edi, %ebx
	cmpq	$0, 24(%r15)
	je	LBB0_2
## %bb.1:
	subl	4(%r15), %ecx
	movl	%ecx, %r14d
LBB0_2:
	movl	%r14d, %edi
	callq	_abs
	movq	%rax, %r12
	movl	%ebx, %edi
	callq	_abs
	cmpq	%rax, %r12
	jle	LBB0_3
## %bb.7:
	movl	$0, 8(%r15)
	movl	(%r15), %eax
	movl	%ebx, %r14d
	jmp	LBB0_8
LBB0_3:
	cmpl	$0, 8(%r15)
	jne	LBB0_6
## %bb.4:
	cmpl	$0, 20(%r15)
	jne	LBB0_6
## %bb.5:
	movl	16(%r15), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
LBB0_6:
	movl	(%r15), %eax
	movq	_FM_FREQ_RANGE_LOW@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpl	(%rcx), %eax
	setge	%dl
	movl	%edx, 8(%r15)
LBB0_8:
	leal	(%r14,%r14), %ecx
	cmpl	(%r13), %eax
	leal	(%rcx,%rcx,4), %eax
	cmovgl	%r14d, %eax
	movl	%eax, 12(%r15)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AM_FREQ_RANGE_HIGH,4,2         ## @AM_FREQ_RANGE_HIGH
	.comm	_FM_FREQ_RANGE_LOW,4,2          ## @FM_FREQ_RANGE_LOW
	.no_dead_strip	_vivid_radio_calc_sig_qual
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vivid_radio_calc_sig_qual
_vivid_radio_calc_sig_qual:             ; @vivid_radio_calc_sig_qual
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x23, _AM_FREQ_RANGE_HIGH@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AM_FREQ_RANGE_HIGH@GOTPAGEOFF]
	ldr	w9, [x23]
	mov	w10, #1600
	mov	w20, #16000
	cmp	w8, w9
	csel	w9, w20, w10, gt
	mov	w10, #80
	mov	w11, #800
	csel	w10, w11, w10, gt
	add	w11, w10, w8
	sdiv	w12, w11, w9
	msub	w9, w12, w9, w11
	sub	w21, w9, w10
	ldr	x9, [x0, #24]
	cbz	x9, LBB0_2
; %bb.1:
	ldr	w9, [x19, #4]
	sub	w20, w8, w9
LBB0_2:
	mov	x0, x20
	bl	_abs
	mov	x22, x0
	mov	x0, x21
	bl	_abs
	cmp	x22, x0
	b.le	LBB0_4
; %bb.3:
	str	wzr, [x19, #8]
	ldr	w8, [x19]
	mov	x20, x21
	b	LBB0_8
LBB0_4:
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_7
; %bb.5:
	ldr	w8, [x19, #20]
	cbnz	w8, LBB0_7
; %bb.6:
	ldr	w0, [x19, #16]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
LBB0_7:
	ldr	w8, [x19]
Lloh2:
	adrp	x9, _FM_FREQ_RANGE_LOW@GOTPAGE
Lloh3:
	ldr	x9, [x9, _FM_FREQ_RANGE_LOW@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w9, ge
	str	w9, [x19, #8]
LBB0_8:
	ldr	w9, [x23]
	add	w10, w20, w20, lsl #2
	lsl	w10, w10, #1
	cmp	w8, w9
	csel	w8, w20, w10, gt
	str	w8, [x19, #12]
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AM_FREQ_RANGE_HIGH,4,2         ; @AM_FREQ_RANGE_HIGH
	.comm	_FM_FREQ_RANGE_LOW,4,2          ; @FM_FREQ_RANGE_LOW
	.no_dead_strip	_vivid_radio_calc_sig_qual
.subsections_via_symbols
