	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib3000mc_tune
_dib3000mc_tune:                        ## @dib3000mc_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	8(%rdi), %rsi
	movq	(%rdi), %rbx
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_dib3000mc_set_channel_cfg
	cmpq	$0, (%rbx)
	je	LBB0_1
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_dprintk
	movl	$16384, %r15d                   ## imm = 0x4000
	movl	$4723, %edx                     ## imm = 0x1273
	jmp	LBB0_3
LBB0_1:
	movl	$4211, %edx                     ## imm = 0x1073
LBB0_3:
	movq	%rbx, %rdi
	movl	$29, %esi
	callq	_dib3000mc_write_word
	movq	%rbx, %rdi
	movl	$108, %esi
	movl	%r15d, %edx
	callq	_dib3000mc_write_word
	movl	24(%r14), %esi
	movq	%rbx, %rdi
	callq	_dib3000mc_set_adp_cfg
	movq	8(%r14), %rax
	movq	_TRANSMISSION_MODE_8K@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	leal	(%rdx,%rdx), %r15d
	addl	$6, %r15d
                                        ## kill: def $edx killed $edx killed $rdx
	shll	$13, %edx
	addl	$30336, %edx                    ## imm = 0x7680
	movq	%rbx, %rdi
	movl	$26, %esi
	callq	_dib3000mc_write_word
	movq	%rbx, %rdi
	movl	$33, %esi
	movl	%r15d, %edx
	callq	_dib3000mc_write_word
	movq	%rbx, %rdi
	movl	$509, %esi                      ## imm = 0x1FD
	callq	_dib3000mc_read_word
	testb	$-128, %al
	je	LBB0_5
## %bb.4:
	movq	8(%r14), %r15
	movl	16(%r14), %edi
	callq	_BANDWIDTH_TO_KHZ
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	movl	$1, %ecx
	callq	_dib3000mc_set_timing
LBB0_5:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SFN workaround is active\n"

	.comm	_TRANSMISSION_MODE_8K,8,3       ## @TRANSMISSION_MODE_8K
	.no_dead_strip	_dib3000mc_tune
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib3000mc_tune
_dib3000mc_tune:                        ; @dib3000mc_tune
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x0
	mov	x1, x0
	ldr	x19, [x1], #8
	mov	x0, x19
	mov	w2, #0
	bl	_dib3000mc_set_channel_cfg
	ldr	x8, [x19]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
	mov	w21, #16384
	mov	w2, #4723
	b	LBB0_3
LBB0_2:
	mov	w21, #0
	mov	w2, #4211
LBB0_3:
	mov	x0, x19
	mov	w1, #29
	bl	_dib3000mc_write_word
	mov	x0, x19
	mov	w1, #108
	mov	x2, x21
	bl	_dib3000mc_write_word
	ldr	w1, [x20, #24]
	mov	x0, x19
	bl	_dib3000mc_set_adp_cfg
	ldr	x8, [x20, #8]
Lloh2:
	adrp	x9, _TRANSMISSION_MODE_8K@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TRANSMISSION_MODE_8K@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #30336
	mov	w9, #38528
	csel	w2, w9, w8, eq
	mov	w8, #6
	mov	w9, #8
	csel	w21, w9, w8, eq
	mov	x0, x19
	mov	w1, #26
	bl	_dib3000mc_write_word
	mov	x0, x19
	mov	w1, #33
	mov	x2, x21
	bl	_dib3000mc_write_word
	mov	x0, x19
	mov	w1, #509
	bl	_dib3000mc_read_word
	tbz	w0, #7, LBB0_5
; %bb.4:
	ldr	x21, [x20, #8]
	ldr	w0, [x20, #16]
	bl	_BANDWIDTH_TO_KHZ
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	mov	w3, #1
	bl	_dib3000mc_set_timing
LBB0_5:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SFN workaround is active\n"

	.comm	_TRANSMISSION_MODE_8K,8,3       ; @TRANSMISSION_MODE_8K
	.no_dead_strip	_dib3000mc_tune
.subsections_via_symbols
