	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xc4000_get_signal
_xc4000_get_signal:                     ## @xc4000_get_signal
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	(%rdi), %rbx
	movl	$0, -36(%rbp)
	leaq	8(%rbx), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	_XREG_SIGNAL_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_xc4000_readreg
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	-36(%rbp), %edx
	testl	%r15d, %r15d
	js	LBB0_10
## %bb.1:
	movl	%edx, %esi
	sarl	$8, %esi
	leaq	L_.str(%rip), %rdi
	callq	_tuner_dbg
	movq	(%rbx), %rax
	movq	_XC4000_DTV6@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.2:
	movq	_XC4000_DTV7@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.3:
	movq	_XC4000_DTV7_8@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.4:
	movq	_XC4000_DTV8@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.5:
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	_XREG_NOISE_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_xc4000_readreg
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	-36(%rbp), %edx
	movl	%edx, %esi
	sarl	$8, %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_tuner_dbg
	movl	-36(%rbp), %eax
	xorl	%edx, %edx
	cmpl	$8191, %eax                     ## imm = 0x1FFF
	jg	LBB0_10
## %bb.6:
	notl	%eax
	shll	$3, %eax
	movzwl	%ax, %edx
	jmp	LBB0_10
LBB0_7:
	movl	-36(%rbp), %eax
	movl	$65535, %edx                    ## imm = 0xFFFF
	cmpl	$12801, %eax                    ## imm = 0x3201
	jl	LBB0_10
## %bb.8:
	xorl	%edx, %edx
	cmpl	$28985, %eax                    ## imm = 0x7139
	ja	LBB0_10
## %bb.9:
	shll	$2, %eax
	movl	$51196, %edx                    ## imm = 0xC7FC
	subl	%eax, %edx
LBB0_10:
	movl	%edx, (%r14)
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XREG_SIGNAL_LEVEL,4,2          ## @XREG_SIGNAL_LEVEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Signal strength: -%ddB (%05d)\n"

	.comm	_XC4000_DTV6,8,3                ## @XC4000_DTV6
	.comm	_XC4000_DTV7,8,3                ## @XC4000_DTV7
	.comm	_XC4000_DTV7_8,8,3              ## @XC4000_DTV7_8
	.comm	_XC4000_DTV8,8,3                ## @XC4000_DTV8
	.comm	_XREG_NOISE_LEVEL,4,2           ## @XREG_NOISE_LEVEL
L_.str.1:                               ## @.str.1
	.asciz	"Noise level: %ddB (%05d)\n"

	.no_dead_strip	_xc4000_get_signal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xc4000_get_signal
_xc4000_get_signal:                     ; @xc4000_get_signal
	.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, x1
	ldr	x22, [x0]
	str	wzr, [sp, #12]
	add	x21, x22, #8
	mov	x0, x21
	bl	_mutex_lock
Lloh0:
	adrp	x8, _XREG_SIGNAL_LEVEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XREG_SIGNAL_LEVEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x22
	bl	_xc4000_readreg
	mov	x20, x0
	mov	x0, x21
	bl	_mutex_unlock
	ldr	w2, [sp, #12]
	tbnz	w20, #31, LBB0_4
; %bb.1:
	asr	w1, w2, #8
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_tuner_dbg
	ldr	x8, [x22]
Lloh5:
	adrp	x9, _XC4000_DTV6@GOTPAGE
Lloh6:
	ldr	x9, [x9, _XC4000_DTV6@GOTPAGEOFF]
Lloh7:
	adrp	x10, _XC4000_DTV7@GOTPAGE
Lloh8:
	ldr	x10, [x10, _XC4000_DTV7@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
Lloh10:
	ldr	x10, [x10]
Lloh11:
	adrp	x11, _XC4000_DTV7_8@GOTPAGE
Lloh12:
	ldr	x11, [x11, _XC4000_DTV7_8@GOTPAGEOFF]
Lloh13:
	adrp	x12, _XC4000_DTV8@GOTPAGE
Lloh14:
	ldr	x12, [x12, _XC4000_DTV8@GOTPAGEOFF]
Lloh15:
	ldr	x11, [x11]
Lloh16:
	ldr	x12, [x12]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	ccmp	x8, x12, #4, ne
	b.ne	LBB0_3
; %bb.2:
	ldr	w8, [sp, #12]
	mov	w9, #65535
	mov	w10, #12801
	mov	w11, #28985
	mov	w12, #51196
	sub	w12, w12, w8, lsl #2
	cmp	w8, w11
	csel	w11, wzr, w12, hi
	cmp	w8, w10
	csel	w2, w9, w11, lt
	b	LBB0_4
LBB0_3:
	mov	x0, x21
	bl	_mutex_lock
Lloh17:
	adrp	x8, _XREG_NOISE_LEVEL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _XREG_NOISE_LEVEL@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x22
	bl	_xc4000_readreg
	mov	x20, x0
	mov	x0, x21
	bl	_mutex_unlock
	ldr	w2, [sp, #12]
	asr	w1, w2, #8
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_tuner_dbg
	ldr	w8, [sp, #12]
	mvn	w9, w8
	ubfiz	w9, w9, #3, #13
	cmp	w8, #2, lsl #12                 ; =8192
	csel	w2, wzr, w9, ge
LBB0_4:
	str	w2, [x19]
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_XREG_SIGNAL_LEVEL,4,2          ; @XREG_SIGNAL_LEVEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Signal strength: -%ddB (%05d)\n"

	.comm	_XC4000_DTV6,8,3                ; @XC4000_DTV6
	.comm	_XC4000_DTV7,8,3                ; @XC4000_DTV7
	.comm	_XC4000_DTV7_8,8,3              ; @XC4000_DTV7_8
	.comm	_XC4000_DTV8,8,3                ; @XC4000_DTV8
	.comm	_XREG_NOISE_LEVEL,4,2           ; @XREG_NOISE_LEVEL
l_.str.1:                               ; @.str.1
	.asciz	"Noise level: %ddB (%05d)\n"

	.no_dead_strip	_xc4000_get_signal
.subsections_via_symbols
