	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_if_freq
_set_if_freq:                           ## @set_if_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	(%r14), %rax
	movq	(%rax), %rax
	subl	%eax, %esi
	imull	$1543503872, %esi, %ebx         ## imm = 0x5C000000
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_do_div
	movl	%ebx, %edi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_do_div
	movq	_REG_TUNER_BASEBAND@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_atbm8830_write_reg
	movq	_REG_IF_FREQ@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_atbm8830_write_reg
	movq	(%r15), %rsi
	incq	%rsi
	movl	%ebx, %edx
	sarl	$8, %edx
	movq	%r14, %rdi
	callq	_atbm8830_write_reg
	movq	(%r15), %rsi
	addq	$2, %rsi
	sarl	$16, %ebx
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_atbm8830_write_reg
	movq	_REG_ADC_CONFIG@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_atbm8830_read_reg
	movl	$252, %edx
	andl	-28(%rbp), %edx
	movl	%edx, -28(%rbp)
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	jmp	LBB0_5
LBB0_2:
	movq	_REG_TUNER_BASEBAND@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_atbm8830_write_reg
	movq	_REG_ADC_CONFIG@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_atbm8830_read_reg
	movl	$252, %edx
	andl	-28(%rbp), %edx
	orl	$2, %edx
	movl	%edx, -28(%rbp)
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_atbm8830_write_reg
	movq	(%r14), %rax
	cmpq	$0, 8(%rax)
	movq	_REG_SWAP_I_Q@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	je	LBB0_4
## %bb.3:
	movl	$3, %edx
	jmp	LBB0_5
LBB0_4:
	movl	$1, %edx
LBB0_5:
	callq	_atbm8830_write_reg
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_TUNER_BASEBAND,8,3         ## @REG_TUNER_BASEBAND
	.comm	_REG_IF_FREQ,8,3                ## @REG_IF_FREQ
	.comm	_REG_ADC_CONFIG,8,3             ## @REG_ADC_CONFIG
	.comm	_REG_SWAP_I_Q,8,3               ## @REG_SWAP_I_Q
	.no_dead_strip	_set_if_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_if_freq
_set_if_freq:                           ; @set_if_freq
	.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, x0
	cbz	x1, LBB0_2
; %bb.1:
	ldr	x8, [x19]
	ldr	x8, [x8]
	sub	w9, w1, w8
	mov	w10, #1543503872
	mul	w20, w9, w10
	mov	x0, x20
	mov	x1, x8
	bl	_do_div
	mov	x0, x20
	mov	w1, #1000
	bl	_do_div
Lloh0:
	adrp	x8, _REG_TUNER_BASEBAND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_TUNER_BASEBAND@GOTPAGEOFF]
Lloh2:
	ldr	x1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_atbm8830_write_reg
Lloh3:
	adrp	x21, _REG_IF_FREQ@GOTPAGE
Lloh4:
	ldr	x21, [x21, _REG_IF_FREQ@GOTPAGEOFF]
	ldr	x1, [x21]
	mov	x0, x19
	mov	x2, x20
	bl	_atbm8830_write_reg
	ldr	x8, [x21]
	add	x1, x8, #1
	asr	w2, w20, #8
	mov	x0, x19
	bl	_atbm8830_write_reg
	ldr	x8, [x21]
	add	x1, x8, #2
	asr	w2, w20, #16
	mov	x0, x19
	bl	_atbm8830_write_reg
Lloh5:
	adrp	x20, _REG_ADC_CONFIG@GOTPAGE
Lloh6:
	ldr	x20, [x20, _REG_ADC_CONFIG@GOTPAGEOFF]
	ldr	x1, [x20]
	add	x2, sp, #12
	mov	x0, x19
	bl	_atbm8830_read_reg
	ldr	w8, [sp, #12]
	and	w2, w8, #0xfc
	str	w2, [sp, #12]
	ldr	x1, [x20]
	mov	x0, x19
	b	LBB0_5
LBB0_2:
Lloh7:
	adrp	x8, _REG_TUNER_BASEBAND@GOTPAGE
Lloh8:
	ldr	x8, [x8, _REG_TUNER_BASEBAND@GOTPAGEOFF]
Lloh9:
	ldr	x1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_atbm8830_write_reg
Lloh10:
	adrp	x20, _REG_ADC_CONFIG@GOTPAGE
Lloh11:
	ldr	x20, [x20, _REG_ADC_CONFIG@GOTPAGEOFF]
	ldr	x1, [x20]
	add	x2, sp, #12
	mov	x0, x19
	bl	_atbm8830_read_reg
	ldr	w8, [sp, #12]
	and	w8, w8, #0xfc
	orr	w2, w8, #0x2
	str	w2, [sp, #12]
	ldr	x1, [x20]
	mov	x0, x19
	bl	_atbm8830_write_reg
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
Lloh12:
	adrp	x9, _REG_SWAP_I_Q@GOTPAGE
Lloh13:
	ldr	x9, [x9, _REG_SWAP_I_Q@GOTPAGEOFF]
Lloh14:
	ldr	x1, [x9]
	mov	x0, x19
	cbz	x8, LBB0_4
; %bb.3:
	mov	w2, #3
	b	LBB0_5
LBB0_4:
	mov	w2, #1
LBB0_5:
	bl	_atbm8830_write_reg
	mov	w0, #0
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_TUNER_BASEBAND,8,3         ; @REG_TUNER_BASEBAND
	.comm	_REG_IF_FREQ,8,3                ; @REG_IF_FREQ
	.comm	_REG_ADC_CONFIG,8,3             ; @REG_ADC_CONFIG
	.comm	_REG_SWAP_I_Q,8,3               ; @REG_SWAP_I_Q
	.no_dead_strip	_set_if_freq
.subsections_via_symbols
