	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function digitv_alps_tded4_tuner_calc_regs
_digitv_alps_tded4_tuner_calc_regs:     ## @digitv_alps_tded4_tuner_calc_regs
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpl	$4, %edx
	jg	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_2:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rdi), %eax
	leal	(%rax,%rax,2), %eax
	addl	$249999, %eax                   ## imm = 0x3D08F
	cltq
	imulq	$1125899907, %rax, %rdx         ## imm = 0x431BDE83
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$49, %rdx
	addl	%eax, %edx
	movq	_IF_FREQUENCYx6@GOTPCREL(%rip), %rax
	addl	(%rax), %edx
	movl	$97, (%rsi)
	movl	%edx, %eax
	shrl	$8, %eax
	andl	$127, %eax
	movl	%eax, 4(%rsi)
	movzbl	%dl, %eax
	movl	%eax, 8(%rsi)
	movl	$133, 12(%rsi)
	movl	(%rdi), %esi
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dprintk
	movl	(%r14), %eax
	cmpl	$469999999, %eax                ## imm = 0x1C03A17F
	jg	LBB0_4
## %bb.3:
	movl	$2, 16(%rbx)
	movl	$6, %ecx
	jmp	LBB0_7
LBB0_4:
	cmpl	$823000001, %eax                ## imm = 0x310DFBC1
	jb	LBB0_6
## %bb.5:
	movl	$136, 16(%rbx)
	movl	$140, %ecx
	jmp	LBB0_7
LBB0_6:
	movl	$8, 16(%rbx)
	movl	$12, %ecx
LBB0_7:
	movl	$5, %eax
	cmpl	$8000000, 4(%r14)               ## imm = 0x7A1200
	jne	LBB0_9
## %bb.8:
	movl	%ecx, 16(%rbx)
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IF_FREQUENCYx6,4,2             ## @IF_FREQUENCYx6
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"frequency %u, div %u\n"

	.no_dead_strip	_digitv_alps_tded4_tuner_calc_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function digitv_alps_tded4_tuner_calc_regs
_digitv_alps_tded4_tuner_calc_regs:     ; @digitv_alps_tded4_tuner_calc_regs
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cmp	w2, #4
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_2:
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x0]
	add	w8, w8, w8, lsl #1
	add	w8, w8, #61, lsl #12            ; =249856
	add	w8, w8, #143
	mov	w9, #56963
	movk	w9, #17179, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #49
Lloh3:
	adrp	x10, _IF_FREQUENCYx6@GOTPAGE
Lloh4:
	ldr	x10, [x10, _IF_FREQUENCYx6@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	add	w8, w8, w9
	add	w2, w8, w10
	mov	w8, #97
	ubfx	w9, w2, #8, #7
	stp	w8, w9, [x1]
	and	w8, w2, #0xff
	mov	w9, #133
	stp	w8, w9, [x1, #8]
	ldr	w1, [x0]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
	ldr	w8, [x20]
	mov	w9, #41343
	movk	w9, #7171, lsl #16
	cmp	w8, w9
	b.gt	LBB0_4
; %bb.3:
	mov	w8, #2
	str	w8, [x19, #16]
	mov	w8, #6
	b	LBB0_7
LBB0_4:
	mov	w9, #64449
	movk	w9, #12557, lsl #16
	cmp	w8, w9
	b.lo	LBB0_6
; %bb.5:
	mov	w8, #136
	str	w8, [x19, #16]
	mov	w8, #140
	b	LBB0_7
LBB0_6:
	mov	w8, #8
	str	w8, [x19, #16]
	mov	w8, #12
LBB0_7:
	ldr	w9, [x20, #4]
	sub	w9, w9, #1953, lsl #12          ; =7999488
	cmp	w9, #512
	b.ne	LBB0_9
; %bb.8:
	str	w8, [x19, #16]
LBB0_9:
	mov	w0, #5
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IF_FREQUENCYx6,4,2             ; @IF_FREQUENCYx6
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"frequency %u, div %u\n"

	.no_dead_strip	_digitv_alps_tded4_tuner_calc_regs
.subsections_via_symbols
