	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_g_frequency
_pvr2_g_frequency:                      ## @pvr2_g_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	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %r14
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rbx
	movl	$0, -20(%rbp)
	leaq	-24(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_pvr2_hdw_get_tuner_status
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movq	_PVR2_CID_FREQUENCY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pvr2_hdw_get_ctrl_by_id
	leaq	-20(%rbp), %rsi
	movl	%eax, %edi
	callq	_pvr2_ctrl_get_value
	testl	%eax, %eax
	jne	LBB0_9
## %bb.2:
	movq	_PVR2_CID_INPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pvr2_hdw_get_ctrl_by_id
	leaq	-28(%rbp), %rsi
	movl	%eax, %edi
	callq	_pvr2_ctrl_get_value
	movl	-28(%rbp), %eax
	movq	_PVR2_CVAL_INPUT_RADIO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
## %bb.4:
	movq	_V4L2_TUNER_RADIO@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_V4L2_TUNER_ANALOG_TV@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	movq	_V4L2_TUNER_CAP_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-20(%rbp), %eax
	testl	%ecx, -24(%rbp)
	je	LBB0_7
## %bb.6:
	addl	%eax, %eax
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$35, %rax
	jmp	LBB0_8
LBB0_7:
	cltq
	imulq	$1125899907, %rax, %rax         ## imm = 0x431BDE83
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$46, %rax
LBB0_8:
	addl	%ecx, %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_CID_FREQUENCY,4,2         ## @PVR2_CID_FREQUENCY
	.comm	_PVR2_CID_INPUT,4,2             ## @PVR2_CID_INPUT
	.comm	_PVR2_CVAL_INPUT_RADIO,4,2      ## @PVR2_CVAL_INPUT_RADIO
	.comm	_V4L2_TUNER_RADIO,4,2           ## @V4L2_TUNER_RADIO
	.comm	_V4L2_TUNER_ANALOG_TV,4,2       ## @V4L2_TUNER_ANALOG_TV
	.comm	_V4L2_TUNER_CAP_LOW,4,2         ## @V4L2_TUNER_CAP_LOW
	.no_dead_strip	_pvr2_g_frequency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_g_frequency
_pvr2_g_frequency:                      ; @pvr2_g_frequency
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x2
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x20, [x8]
	str	wzr, [sp, #12]
	mov	x1, sp
	mov	x0, x20
	bl	_pvr2_hdw_get_tuner_status
	cbnz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _PVR2_CID_FREQUENCY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVR2_CID_FREQUENCY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_pvr2_hdw_get_ctrl_by_id
	add	x1, sp, #12
	bl	_pvr2_ctrl_get_value
	cbnz	w0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _PVR2_CID_INPUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PVR2_CID_INPUT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_pvr2_hdw_get_ctrl_by_id
	add	x1, sp, #8
	bl	_pvr2_ctrl_get_value
	mov	w0, #0
	ldr	w8, [sp, #8]
Lloh6:
	adrp	x9, _PVR2_CVAL_INPUT_RADIO@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PVR2_CVAL_INPUT_RADIO@GOTPAGEOFF]
Lloh8:
	adrp	x10, _V4L2_TUNER_RADIO@GOTPAGE
Lloh9:
	ldr	x10, [x10, _V4L2_TUNER_RADIO@GOTPAGEOFF]
Lloh10:
	adrp	x11, _V4L2_TUNER_ANALOG_TV@GOTPAGE
Lloh11:
	ldr	x11, [x11, _V4L2_TUNER_ANALOG_TV@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	x8, x10, x11, eq
	ldr	w9, [sp]
Lloh13:
	adrp	x10, _V4L2_TUNER_CAP_LOW@GOTPAGE
Lloh14:
	ldr	x10, [x10, _V4L2_TUNER_CAP_LOW@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	tst	w10, w9
	ldr	w9, [sp, #12]
	mov	w10, #56963
	movk	w10, #17179, lsl #16
	smull	x10, w9, w10
	lsr	x11, x10, #63
	asr	x10, x10, #46
	add	w10, w10, w11
	lsl	w9, w9, #1
	mov	w11, #19923
	movk	w11, #4194, lsl #16
	smull	x9, w9, w11
	lsr	x11, x9, #63
	asr	x9, x9, #35
	add	w9, w9, w11
	ldr	w8, [x8]
	csel	w9, w10, w9, eq
	stp	w9, w8, [x19]
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh12
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_CID_FREQUENCY,4,2         ; @PVR2_CID_FREQUENCY
	.comm	_PVR2_CID_INPUT,4,2             ; @PVR2_CID_INPUT
	.comm	_PVR2_CVAL_INPUT_RADIO,4,2      ; @PVR2_CVAL_INPUT_RADIO
	.comm	_V4L2_TUNER_RADIO,4,2           ; @V4L2_TUNER_RADIO
	.comm	_V4L2_TUNER_ANALOG_TV,4,2       ; @V4L2_TUNER_ANALOG_TV
	.comm	_V4L2_TUNER_CAP_LOW,4,2         ; @V4L2_TUNER_CAP_LOW
	.no_dead_strip	_pvr2_g_frequency
.subsections_via_symbols
