	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib7000p_tune
_dib7000p_tune:                         ## @dib7000p_tune
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	8(%rdi), %r15
	movq	(%rdi), %r13
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_dib7000p_set_channel
	movq	%r13, %rdi
	movl	$770, %esi                      ## imm = 0x302
	movl	$16384, %edx                    ## imm = 0x4000
	callq	_dib7000p_write_word
	movq	%r13, %rdi
	movl	$770, %esi                      ## imm = 0x302
	xorl	%edx, %edx
	callq	_dib7000p_write_word
	movl	$45, %edi
	callq	_msleep
	cmpq	$0, 16(%r13)
	je	LBB0_1
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_dprintk
	movl	$4723, %ebx                     ## imm = 0x1273
	movl	$16384, %r12d                   ## imm = 0x4000
	jmp	LBB0_3
LBB0_1:
	movl	$4211, %ebx                     ## imm = 0x1073
LBB0_3:
	movq	%r13, %rdi
	movl	$166, %esi
	movl	%r12d, %edx
	callq	_dib7000p_write_word
	movq	%r13, %rdi
	movl	$29, %esi
	movl	%ebx, %edx
	callq	_dib7000p_write_word
	cmpq	$0, (%r13)
	jne	LBB0_5
## %bb.4:
	movl	$200, %edi
	callq	_msleep
LBB0_5:
	movl	(%r15), %eax
	xorl	%ecx, %ecx
	cmpl	$129, %eax
	setne	%cl
	shll	$12, %ecx
	addl	$13952, %ecx                    ## imm = 0x3680
	cmpl	$130, %eax
	movl	$9856, %edx                     ## imm = 0x2680
	cmovnel	%ecx, %edx
	movq	%r13, %rdi
	movl	$26, %esi
	callq	_dib7000p_write_word
	movl	(%r15), %eax
	xorl	%ecx, %ecx
	cmpl	$129, %eax
	sete	%cl
	movl	$8, %ebx
	movl	$8, %edx
	subl	%ecx, %edx
	cmpl	$130, %eax
	movl	$6, %r12d
	cmovel	%r12d, %edx
	movq	%r13, %rdi
	movl	$32, %esi
	callq	_dib7000p_write_word
	movl	(%r15), %eax
	xorl	%ecx, %ecx
	cmpl	$129, %eax
	sete	%cl
	subl	%ecx, %ebx
	cmpl	$130, %eax
	cmovel	%r12d, %ebx
	movq	%r13, %rdi
	movl	$33, %esi
	movl	%ebx, %edx
	callq	_dib7000p_write_word
	movq	%r13, %rdi
	movl	$509, %esi                      ## imm = 0x1FD
	callq	_dib7000p_read_word
	testb	$64, %al
	jne	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	movl	$771, %esi                      ## imm = 0x303
	callq	_dib7000p_read_word
	movl	%eax, %ebx
	movl	%eax, %edx
	orl	$2, %edx
	movq	%r13, %rdi
	movl	$771, %esi                      ## imm = 0x303
	callq	_dib7000p_write_word
	movq	%r13, %rdi
	movl	$771, %esi                      ## imm = 0x303
	movl	%ebx, %edx
	callq	_dib7000p_write_word
	movl	$40, %edi
	callq	_msleep
	movq	%r13, %rdi
	movl	$509, %esi                      ## imm = 0x1FD
	callq	_dib7000p_read_word
	testb	$64, %al
	je	LBB0_8
LBB0_7:
	movq	%r13, %rdi
	callq	_dib7000p_update_timf
	movq	%r13, %rdi
	movl	$26, %esi
	callq	_dib7000p_read_word
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, %ecx
	andl	$-61441, %ecx                   ## imm = 0xFFFF0FFF
	andl	$61440, %eax                    ## imm = 0xF000
	leal	20480(%rax), %edx
	orl	%ecx, %edx
	movq	%r13, %rdi
	movl	$26, %esi
	callq	_dib7000p_write_word
LBB0_8:
	cmpq	$0, 8(%r13)
	je	LBB0_10
## %bb.9:
	movslq	12(%r14), %rax
	imulq	$274877907, %rax, %rbx          ## imm = 0x10624DD3
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$38, %rbx
	addl	%eax, %ebx
	movl	16(%r14), %edi
	callq	_BANDWIDTH_TO_KHZ
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_dib7000p_spur_protect
LBB0_10:
	movl	16(%r14), %edi
	callq	_BANDWIDTH_TO_KHZ
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_dib7000p_set_bandwidth
	movq	%r14, %rdi
	callq	_dib7000p_reset_stats
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SFN workaround is active\n"

	.no_dead_strip	_dib7000p_tune
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib7000p_tune
_dib7000p_tune:                         ; @dib7000p_tune
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	mov	x21, x0
	ldr	x20, [x21], #8
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	bl	_dib7000p_set_channel
	mov	x0, x20
	mov	w1, #770
	mov	w2, #16384
	bl	_dib7000p_write_word
	mov	x0, x20
	mov	w1, #770
	mov	w2, #0
	bl	_dib7000p_write_word
	mov	w0, #45
	bl	_msleep
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
	mov	w22, #4723
	mov	w2, #16384
	b	LBB0_3
LBB0_2:
	mov	w2, #0
	mov	w22, #4211
LBB0_3:
	mov	x0, x20
	mov	w1, #166
	bl	_dib7000p_write_word
	mov	x0, x20
	mov	w1, #29
	mov	x2, x22
	bl	_dib7000p_write_word
	ldr	x8, [x20]
	cbnz	x8, LBB0_5
; %bb.4:
	mov	w0, #200
	bl	_msleep
LBB0_5:
	ldr	w8, [x21]
	mov	w9, #18048
	mov	w10, #13952
	cmp	w8, #129
	csel	w9, w10, w9, eq
	mov	w10, #9856
	cmp	w8, #130
	csel	w2, w10, w9, eq
	mov	x0, x20
	mov	w1, #26
	bl	_dib7000p_write_word
	ldr	w8, [x21]
	cmp	w8, #129
	mov	w22, #7
	cinc	w9, w22, ne
	mov	w23, #6
	cmp	w8, #130
	csel	w2, w23, w9, eq
	mov	x0, x20
	mov	w1, #32
	bl	_dib7000p_write_word
	ldr	w8, [x21]
	cmp	w8, #129
	cinc	w9, w22, ne
	cmp	w8, #130
	csel	w2, w23, w9, eq
	mov	x0, x20
	mov	w1, #33
	bl	_dib7000p_write_word
	mov	x0, x20
	mov	w1, #509
	bl	_dib7000p_read_word
	tbnz	w0, #6, LBB0_7
; %bb.6:
	mov	x0, x20
	mov	w1, #771
	bl	_dib7000p_read_word
	mov	x21, x0
	orr	w2, w0, #0x2
	mov	x0, x20
	mov	w1, #771
	bl	_dib7000p_write_word
	mov	x0, x20
	mov	w1, #771
	mov	x2, x21
	bl	_dib7000p_write_word
	mov	w0, #40
	bl	_msleep
	mov	x0, x20
	mov	w1, #509
	bl	_dib7000p_read_word
	tbz	w0, #6, LBB0_8
LBB0_7:
	mov	x0, x20
	bl	_dib7000p_update_timf
	mov	x0, x20
	mov	w1, #26
	bl	_dib7000p_read_word
	and	w8, w0, #0xffff0fff
	and	w9, w0, #0xf000
	add	w9, w9, #5, lsl #12             ; =20480
	orr	w2, w9, w8
	mov	x0, x20
	mov	w1, #26
	bl	_dib7000p_write_word
LBB0_8:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_10
; %bb.9:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	ldp	w9, w0, [x19, #12]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	mul	x8, x9, x8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w21, w8, w9
	bl	_BANDWIDTH_TO_KHZ
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_dib7000p_spur_protect
LBB0_10:
	ldr	w0, [x19, #16]
	bl	_BANDWIDTH_TO_KHZ
	mov	x1, x0
	mov	x0, x20
	bl	_dib7000p_set_bandwidth
	mov	x0, x19
	bl	_dib7000p_reset_stats
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SFN workaround is active\n"

	.no_dead_strip	_dib7000p_tune
.subsections_via_symbols
