	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib8000_set_frequency_offset
_dib8000_set_frequency_offset:          ## @dib8000_set_frequency_offset
	.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	%rdi, %r14
	movq	16(%rdi), %rax
	movq	(%rax), %r15
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	-36(%rbp), %rsi
	movq	%r15, %rdi
	callq	*%rax
	movl	-36(%rbp), %ecx
	movl	8(%r15), %eax
	jmp	LBB0_3
LBB0_2:
	movl	8(%r15), %eax
	movl	%eax, %ecx
LBB0_3:
	movslq	%ecx, %rcx
	imulq	$274877907, %rcx, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	movl	%ecx, -36(%rbp)
	cltq
	imulq	$-274877907, %rax, %rbx         ## imm = 0xEF9DB22D
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$38, %rbx
	addl	%eax, %ebx
	addl	%ecx, %ebx
	cmpq	$0, 24(%r15)
	je	LBB0_8
## %bb.4:
	movl	16(%r15), %eax
	movl	%eax, 8(%r14)
	movq	%r14, %rdi
	movl	$26, %esi
	callq	_dib8000_read_word
	movl	%eax, %r12d
	andl	$1, %r12d
	movl	12(%r15), %edx
	xorl	%r12d, %edx
	movq	%r14, %rdi
	movl	$26, %esi
	callq	_dib8000_write_word
	movq	(%r14), %rax
	cmpq	$0, (%rax)
	movl	12(%r15), %eax
	je	LBB0_5
## %bb.7:
	movl	%ebx, %ecx
	negl	%ecx
	cmpl	%r12d, %eax
	cmovnel	%ebx, %ecx
	movl	%ecx, %ebx
	jmp	LBB0_8
LBB0_5:
	cmpl	%r12d, %eax
	jne	LBB0_8
## %bb.6:
	movq	%r14, %rdi
	movl	$26, %esi
	callq	_dib8000_read_word
	orl	$1, %eax
	movq	%r14, %rdi
	movl	$26, %esi
	movl	%eax, %edx
	callq	_dib8000_write_word
LBB0_8:
	movl	8(%r15), %edx
	movl	-36(%rbp), %ecx
	movl	%edx, %esi
	subl	%ecx, %esi
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %r8d
	callq	_dprintk
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_dib8000_set_dds
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%dkhz tuner offset (frequency = %dHz & current_rf = %dHz) total_dds_offset_hz = %d\n"

	.no_dead_strip	_dib8000_set_frequency_offset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib8000_set_frequency_offset
_dib8000_set_frequency_offset:          ; @dib8000_set_frequency_offset
	.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
	ldr	x8, [x0, #16]
	ldr	x20, [x8]
	ldr	x8, [x20]
	cbz	x8, LBB0_2
; %bb.1:
	add	x1, sp, #12
	mov	x0, x20
	blr	x8
	ldr	w9, [sp, #12]
	ldr	w8, [x20, #8]
	b	LBB0_3
LBB0_2:
	ldr	w8, [x20, #8]
	mov	x9, x8
LBB0_3:
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	str	w9, [sp, #12]
	mov	w10, #45613
	movk	w10, #61341, lsl #16
	smull	x8, w8, w10
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w10
	add	w21, w8, w9
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_8
; %bb.4:
	ldr	w8, [x20, #16]
	str	w8, [x19, #8]
	mov	x0, x19
	mov	w1, #26
	bl	_dib8000_read_word
	and	w22, w0, #0x1
	ldr	w8, [x20, #12]
	eor	w2, w8, w22
	mov	x0, x19
	mov	w1, #26
	bl	_dib8000_write_word
	ldr	x8, [x19]
	ldr	x9, [x8]
	ldr	w8, [x20, #12]
	cmp	w8, w22
	cbz	x9, LBB0_6
; %bb.5:
	cneg	w21, w21, eq
	b	LBB0_8
LBB0_6:
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x19
	mov	w1, #26
	bl	_dib8000_read_word
	orr	w2, w0, #0x1
	mov	x0, x19
	mov	w1, #26
	bl	_dib8000_write_word
LBB0_8:
	ldr	w2, [x20, #8]
	ldr	w3, [sp, #12]
	sub	w1, w2, w3
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x4, x21
	bl	_dprintk
	mov	x0, x19
	mov	x1, x21
	bl	_dib8000_set_dds
	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 AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%dkhz tuner offset (frequency = %dHz & current_rf = %dHz) total_dds_offset_hz = %d\n"

	.no_dead_strip	_dib8000_set_frequency_offset
.subsections_via_symbols
