	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mwl8k_update_survey
_mwl8k_update_survey:                   ## @mwl8k_update_survey
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	$0, -40(%rbp)
	movq	32(%rdi), %rax
	movl	(%rax), %esi
	callq	_freq_to_idx
	movq	%rax, %r15
	movq	_MWL8K_NUM_CHANS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jae	LBB0_2
## %bb.1:
	movq	24(%rbx), %r12
	movq	_NOK_CCA_CNT_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread32
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	sarl	$6, %eax
	addl	%ecx, %eax
	cltq
	leaq	(%r15,%r15,2), %r15
	shlq	$4, %r15
	movq	%rax, 40(%r12,%r15)
	movq	_BBU_RXRDY_CNT_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_ioread32
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	sarl	$6, %eax
	addl	%ecx, %eax
	cltq
	movq	%rax, 32(%r12,%r15)
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	subq	8(%rbx), %rdi
	movq	%rdi, 8(%rbx)
	callq	_jiffies_to_msecs
	movl	%eax, 24(%r12,%r15)
	movq	%r14, 16(%r12,%r15)
	movq	(%rbx), %rdi
	movq	_BBU_AVG_NOISE_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	leaq	-40(%rbp), %rcx
	xorl	%esi, %esi
	callq	_mwl8k_cmd_bbp_reg_access
	subq	-40(%rbp), %rbx
	movq	%rbx, (%r12,%r15)
	movq	_SURVEY_INFO_NOISE_DBM@GOTPCREL(%rip), %rax
	movq	_SURVEY_INFO_TIME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_SURVEY_INFO_TIME_BUSY@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_SURVEY_INFO_TIME_RX@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 8(%r12,%r15)
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wiphy_err                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MWL8K_NUM_CHANS,8,3            ## @MWL8K_NUM_CHANS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to update survey\n"

	.comm	_NOK_CCA_CNT_REG,8,3            ## @NOK_CCA_CNT_REG
	.comm	_BBU_RXRDY_CNT_REG,8,3          ## @BBU_RXRDY_CNT_REG
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_BBU_AVG_NOISE_VAL,4,2          ## @BBU_AVG_NOISE_VAL
	.comm	_SURVEY_INFO_NOISE_DBM,4,2      ## @SURVEY_INFO_NOISE_DBM
	.comm	_SURVEY_INFO_TIME,4,2           ## @SURVEY_INFO_TIME
	.comm	_SURVEY_INFO_TIME_BUSY,4,2      ## @SURVEY_INFO_TIME_BUSY
	.comm	_SURVEY_INFO_TIME_RX,4,2        ## @SURVEY_INFO_TIME_RX
	.no_dead_strip	_mwl8k_update_survey
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mwl8k_update_survey
_mwl8k_update_survey:                   ; @mwl8k_update_survey
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x19, x0
	str	xzr, [sp, #8]
	ldr	x8, [x0, #32]
	ldr	w1, [x8]
	bl	_freq_to_idx
Lloh0:
	adrp	x8, _MWL8K_NUM_CHANS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MWL8K_NUM_CHANS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.hs	LBB0_2
; %bb.1:
	mov	x21, x0
	ldp	x8, x22, [x19, #16]
Lloh3:
	adrp	x9, _NOK_CCA_CNT_REG@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NOK_CCA_CNT_REG@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread32
	mov	w23, #19923
	movk	w23, #4194, lsl #16
	smull	x8, w0, w23
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w8, w8, w9, asr #6
	sxtw	x8, w8
	mov	w9, #48
	madd	x21, x21, x9, x22
	str	x8, [x21, #40]
	ldr	x8, [x19, #16]
Lloh6:
	adrp	x9, _BBU_RXRDY_CNT_REG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BBU_RXRDY_CNT_REG@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread32
	smull	x8, w0, w23
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w8, w8, w9, asr #6
	sxtw	x8, w8
	str	x8, [x21, #32]
Lloh9:
	adrp	x8, _jiffies@GOTPAGE
Lloh10:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldr	x9, [x19, #8]
	sub	x0, x8, x9
	str	x0, [x19, #8]
	bl	_jiffies_to_msecs
	str	w0, [x21, #24]
	str	x20, [x21, #16]
	ldr	x0, [x19]
Lloh12:
	adrp	x8, _BBU_AVG_NOISE_VAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BBU_AVG_NOISE_VAL@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	w1, #0
	bl	_mwl8k_cmd_bbp_reg_access
	ldr	x8, [sp, #8]
	neg	x8, x8
	str	x8, [x21]
Lloh15:
	adrp	x8, _SURVEY_INFO_NOISE_DBM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SURVEY_INFO_NOISE_DBM@GOTPAGEOFF]
Lloh17:
	adrp	x9, _SURVEY_INFO_TIME@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SURVEY_INFO_TIME@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh21:
	adrp	x9, _SURVEY_INFO_TIME_BUSY@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SURVEY_INFO_TIME_BUSY@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh24:
	adrp	x9, _SURVEY_INFO_TIME_RX@GOTPAGE
Lloh25:
	ldr	x9, [x9, _SURVEY_INFO_TIME_RX@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x21, #8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_2:
	ldr	x8, [x19]
	ldr	w0, [x8]
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_wiphy_err
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_MWL8K_NUM_CHANS,8,3            ; @MWL8K_NUM_CHANS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to update survey\n"

	.comm	_NOK_CCA_CNT_REG,8,3            ; @NOK_CCA_CNT_REG
	.comm	_BBU_RXRDY_CNT_REG,8,3          ; @BBU_RXRDY_CNT_REG
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_BBU_AVG_NOISE_VAL,4,2          ; @BBU_AVG_NOISE_VAL
	.comm	_SURVEY_INFO_NOISE_DBM,4,2      ; @SURVEY_INFO_NOISE_DBM
	.comm	_SURVEY_INFO_TIME,4,2           ; @SURVEY_INFO_TIME
	.comm	_SURVEY_INFO_TIME_BUSY,4,2      ; @SURVEY_INFO_TIME_BUSY
	.comm	_SURVEY_INFO_TIME_RX,4,2        ; @SURVEY_INFO_TIME_RX
	.no_dead_strip	_mwl8k_update_survey
.subsections_via_symbols
