	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_s_frequency
_pvr2_s_frequency:                      ## @pvr2_s_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	%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	%rdx, %r14
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %r12
	leaq	-40(%rbp), %rsi
	movq	%r12, %rdi
	callq	_pvr2_hdw_get_tuner_status
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movq	_PVR2_CID_INPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_pvr2_hdw_get_ctrl_by_id
	movq	%rax, %r15
	leaq	-44(%rbp), %rsi
	movq	%rax, %rdi
	callq	_pvr2_ctrl_get_value
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.2:
	movq	(%r14), %rcx
	movq	_V4L2_TUNER_RADIO@GOTPCREL(%rip), %rdx
	movl	-44(%rbp), %eax
	movq	_PVR2_CVAL_INPUT_RADIO@GOTPCREL(%rip), %rsi
	movslq	(%rsi), %rsi
	cmpq	(%rdx), %rcx
	jne	LBB0_4
## %bb.3:
	cmpl	%esi, %eax
	jne	LBB0_6
	jmp	LBB0_7
LBB0_4:
	cmpl	%esi, %eax
	jne	LBB0_7
## %bb.5:
	movq	_PVR2_CVAL_INPUT_TV@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
LBB0_6:
	movq	%r15, %rdi
	callq	_pvr2_ctrl_set_value
LBB0_7:
	movq	8(%r14), %rax
	movq	_V4L2_TUNER_CAP_LOW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	-40(%rbp), %ecx
	imulq	$125, %rax, %rdx
	shrq	%rdx
	imulq	$62500, %rax, %rbx              ## imm = 0xF424
	testl	%ecx, %ecx
	cmovneq	%rdx, %rbx
	movq	_PVR2_CID_FREQUENCY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_pvr2_hdw_get_ctrl_by_id
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_pvr2_ctrl_set_value
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_pvr2_hdw_commit_ctl
LBB0_8:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_CID_INPUT,4,2             ## @PVR2_CID_INPUT
	.comm	_V4L2_TUNER_RADIO,8,3           ## @V4L2_TUNER_RADIO
	.comm	_PVR2_CVAL_INPUT_RADIO,4,2      ## @PVR2_CVAL_INPUT_RADIO
	.comm	_PVR2_CVAL_INPUT_TV,8,3         ## @PVR2_CVAL_INPUT_TV
	.comm	_V4L2_TUNER_CAP_LOW,4,2         ## @V4L2_TUNER_CAP_LOW
	.comm	_PVR2_CID_FREQUENCY,4,2         ## @PVR2_CID_FREQUENCY
	.no_dead_strip	_pvr2_s_frequency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_s_frequency
_pvr2_s_frequency:                      ; @pvr2_s_frequency
	.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	x20, x2
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x19, [x8]
	add	x1, sp, #8
	mov	x0, x19
	bl	_pvr2_hdw_get_tuner_status
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.1:
Lloh0:
	adrp	x8, _PVR2_CID_INPUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVR2_CID_INPUT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pvr2_hdw_get_ctrl_by_id
	mov	x21, x0
	add	x1, sp, #4
	bl	_pvr2_ctrl_get_value
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.2:
	ldr	x9, [x20]
Lloh3:
	adrp	x8, _V4L2_TUNER_RADIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_TUNER_RADIO@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x8]
	ldr	w8, [sp, #4]
Lloh6:
	adrp	x11, _PVR2_CVAL_INPUT_RADIO@GOTPAGE
Lloh7:
	ldr	x11, [x11, _PVR2_CVAL_INPUT_RADIO@GOTPAGEOFF]
Lloh8:
	ldrsw	x1, [x11]
	cmp	x9, x10
	b.ne	LBB0_4
; %bb.3:
	cmp	w8, w1
	b.ne	LBB0_6
	b	LBB0_7
LBB0_4:
	cmp	w8, w1
	b.ne	LBB0_7
; %bb.5:
Lloh9:
	adrp	x8, _PVR2_CVAL_INPUT_TV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PVR2_CVAL_INPUT_TV@GOTPAGEOFF]
Lloh11:
	ldr	x1, [x8]
LBB0_6:
	mov	x0, x21
	bl	_pvr2_ctrl_set_value
LBB0_7:
	ldr	x8, [x20, #8]
Lloh12:
	adrp	x9, _V4L2_TUNER_CAP_LOW@GOTPAGE
Lloh13:
	ldr	x9, [x9, _V4L2_TUNER_CAP_LOW@GOTPAGEOFF]
	ldr	w10, [sp, #8]
Lloh14:
	ldr	w9, [x9]
	mov	w11, #125
	mul	x11, x8, x11
	lsr	x11, x11, #1
	mov	w12, #62500
	mul	x8, x8, x12
	tst	w9, w10
	csel	x20, x8, x11, eq
Lloh15:
	adrp	x8, _PVR2_CID_FREQUENCY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PVR2_CID_FREQUENCY@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pvr2_hdw_get_ctrl_by_id
	mov	x1, x20
	bl	_pvr2_ctrl_set_value
	mov	x22, x0
	mov	x0, x19
	bl	_pvr2_hdw_commit_ctl
LBB0_8:
	mov	x0, x22
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_CID_INPUT,4,2             ; @PVR2_CID_INPUT
	.comm	_V4L2_TUNER_RADIO,8,3           ; @V4L2_TUNER_RADIO
	.comm	_PVR2_CVAL_INPUT_RADIO,4,2      ; @PVR2_CVAL_INPUT_RADIO
	.comm	_PVR2_CVAL_INPUT_TV,8,3         ; @PVR2_CVAL_INPUT_TV
	.comm	_V4L2_TUNER_CAP_LOW,4,2         ; @V4L2_TUNER_CAP_LOW
	.comm	_PVR2_CID_FREQUENCY,4,2         ; @PVR2_CID_FREQUENCY
	.no_dead_strip	_pvr2_s_frequency
.subsections_via_symbols
