	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv0297_set_tv_freq
_stv0297_set_tv_freq:                   ## @stv0297_set_tv_freq
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -24
                                        ## kill: def $esi killed $esi def $rsi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	(%rdi), %rax
	leal	38931250(%rsi), %ecx
	movslq	%ecx, %rcx
	imulq	$1125899907, %rcx, %rcx         ## imm = 0x431BDE83
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$46, %rcx
	addl	%edx, %ecx
	movzbl	%cl, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	shrl	$8, %ecx
	andl	$127, %ecx
	movl	%ecx, -32(%rbp)
	movl	%edx, -28(%rbp)
	movl	$206, -24(%rbp)
	cmpl	$44999999, %esi                 ## imm = 0x2AEA53F
	jg	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_2:
	movq	%rdi, %rbx
	movl	$1, %ecx
	cmpl	$137000000, %esi                ## imm = 0x82A7440
	jb	LBB0_5
## %bb.3:
	movl	$2, %ecx
	cmpl	$403000000, %esi                ## imm = 0x18054AC0
	jb	LBB0_5
## %bb.4:
	movl	$4, %ecx
	cmpl	$860000000, %esi                ## imm = 0x33428F00
	jae	LBB0_1
LBB0_5:
	movl	%ecx, -20(%rbp)
	movq	(%rax), %rdi
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	$1, %esi
	callq	*%rax
LBB0_7:
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$99, %esi
	callq	_tuner_write
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-16(%rbp), %rcx
	jne	LBB0_10
## %bb.9:
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_stv0297_set_tv_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv0297_set_tv_freq
_stv0297_set_tv_freq:                   ; @stv0297_set_tv_freq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x8, [x0]
	mov	w9, #2866
	movk	w9, #594, lsl #16
	add	w9, w1, w9
	mov	w10, #56963
	movk	w10, #17179, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #46
	add	w9, w9, w10
	ubfx	w10, w9, #8, #7
	and	w9, w9, #0xff
	stp	w10, w9, [sp, #8]
	mov	w9, #206
	str	w9, [sp, #16]
	mov	w9, #42303
	movk	w9, #686, lsl #16
	cmp	w1, w9
	b.gt	LBB0_2
LBB0_1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_2:
	mov	x19, x0
	mov	w9, #29760
	movk	w9, #2090, lsl #16
	cmp	w1, w9
	b.hs	LBB0_4
; %bb.3:
	mov	w9, #1
	b	LBB0_8
LBB0_4:
	mov	w9, #19136
	movk	w9, #6149, lsl #16
	cmp	w1, w9
	b.hs	LBB0_6
; %bb.5:
	mov	w9, #2
	b	LBB0_8
LBB0_6:
	mov	w9, #36608
	movk	w9, #13122, lsl #16
	cmp	w1, w9
	b.hs	LBB0_1
; %bb.7:
	mov	w9, #4
LBB0_8:
	str	w9, [sp, #20]
	ldr	x0, [x8]
	ldr	x8, [x0]
	cbz	x8, LBB0_10
; %bb.9:
	mov	w1, #1
	blr	x8
LBB0_10:
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #99
	bl	_tuner_write
LBB0_11:
	ldr	x8, [sp, #24]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_stv0297_set_tv_freq
.subsections_via_symbols
