	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath9k_hw_update_nfcal_hist_buffer
_ath9k_hw_update_nfcal_hist_buffer:     ## @ath9k_hw_update_nfcal_hist_buffer
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_ath9k_hw_common
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	(%r15), %r14d
	movl	4(%r15), %esi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rbx
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_ath9k_hw_get_nf_limits
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_NUM_NF_READINGS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_16
## %bb.1:
	leal	(,%r14,8), %eax
	orl	%r14d, %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_2
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r12
	movq	_NUM_NF_READINGS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$32, %rbx
	cmpq	%rax, %r12
	jge	LBB0_14
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	btl	%r12d, %eax
	jae	LBB0_13
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_AR5416_MAX_CHAINS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r12
	jl	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %edi
	callq	_IS_CHAN_HT40
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	testl	%eax, %eax
	je	LBB0_13
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rsi,%r12,8), %rax
	movq	(%rbx), %rcx
	movq	24(%rbx), %rdx
	movq	%rax, (%rdx,%rcx,8)
	incq	%rcx
	movq	%rcx, (%rbx)
	movq	_ATH9K_NF_CAL_HIST_MAX@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	movl	$0, %eax
	cmovaeq	%rax, %rcx
	movq	%rcx, (%rbx)
	movq	8(%rbx), %rax
	testq	%rax, %rax
	jle	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	decq	%rax
	movq	%rax, 8(%rbx)
	movq	(%rsi,%r12,8), %r14
	jmp	LBB0_8
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	24(%rbx), %rdi
	callq	_ath9k_hw_get_nf_hist_mid
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, %r14
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, 16(%rbx)
	testq	%r14, %r14
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r13
	cmpq	%r13, %r14
	jle	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_NFCAL_INTF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rcx
	cmoveq	%rcx, %rax
	movq	%rax, (%rsp)
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	leaq	L_.str(%rip), %rdx
	movl	%r12d, %ecx
	movq	%r14, %r8
	movq	%r13, %r9
	callq	_ath_dbg
	movq	_NFCAL_INTF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	movl	$1, %r15d
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	jmp	LBB0_12
LBB0_14:
	testl	%r15d, %r15d
	je	LBB0_16
## %bb.15:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_NFCAL_INTF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_clear_bit                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NUM_NF_READINGS,4,2            ## @NUM_NF_READINGS
	.comm	_AR5416_MAX_CHAINS,4,2          ## @AR5416_MAX_CHAINS
	.comm	_ATH9K_NF_CAL_HIST_MAX,8,3      ## @ATH9K_NF_CAL_HIST_MAX
	.comm	_CALIBRATE,4,2                  ## @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"NFmid[%d] (%d) > MAX (%d), %s\n"

	.comm	_NFCAL_INTF,4,2                 ## @NFCAL_INTF
L_.str.1:                               ## @.str.1
	.asciz	"not corrected (due to interference)"

L_.str.2:                               ## @.str.2
	.asciz	"correcting to MAX"

	.no_dead_strip	_ath9k_hw_update_nfcal_hist_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath9k_hw_update_nfcal_hist_buffer
_ath9k_hw_update_nfcal_hist_buffer:     ; @ath9k_hw_update_nfcal_hist_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	bl	_ath9k_hw_common
	stp	x0, x19, [sp, #16]              ; 16-byte Folded Spill
	ldr	x19, [x19, #8]
	ldp	w22, w1, [x21]
	mov	x0, x21
	bl	_ath9k_hw_get_nf_limits
Lloh0:
	adrp	x25, _NUM_NF_READINGS@GOTPAGE
Lloh1:
	ldr	x25, [x25, _NUM_NF_READINGS@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.1:
	mov	x23, x0
	mov	x24, #0
	mov	w28, #0
	orr	w22, w22, w22, lsl #3
	add	x19, x19, #16
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x20
	ldr	x8, [x20]
	str	x8, [x19]
	mov	w28, #1
	mov	x21, x25
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
Lloh2:
	adrp	x25, _NUM_NF_READINGS@GOTPAGE
Lloh3:
	ldr	x25, [x25, _NUM_NF_READINGS@GOTPAGEOFF]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x25]
	add	x19, x19, #32
	cmp	x24, x8
	b.ge	LBB0_14
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w8, w22, w24
	tbz	w8, #0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh4:
	adrp	x8, _AR5416_MAX_CHAINS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AR5416_MAX_CHAINS@GOTPAGEOFF]
Lloh6:
	ldrsw	x8, [x8]
	cmp	x24, x8
	b.lt	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x21, #4]
	bl	_IS_CHAN_HT40
	cbz	w0, LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20, x24, lsl #3]
	ldr	x9, [x19, #8]
	ldp	x10, x11, [x19, #-16]
	str	x8, [x9, x10, lsl #3]
	add	x8, x10, #1
	stur	x8, [x19, #-16]
Lloh7:
	adrp	x9, _ATH9K_NF_CAL_HIST_MAX@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ATH9K_NF_CAL_HIST_MAX@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	csinc	x8, xzr, x10, hs
	stur	x8, [x19, #-16]
	subs	x8, x11, #1
	b.lt	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	stur	x8, [x19, #-8]
	ldr	x26, [x20, x24, lsl #3]
	str	x26, [x19]
	cbnz	x26, LBB0_11
	b	LBB0_4
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x19, #8]
	bl	_ath9k_hw_get_nf_hist_mid
	mov	x26, x0
	str	x26, [x19]
	cbz	x26, LBB0_4
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x27, [x23]
	cmp	x26, x27
	b.le	LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x20, x23
	mov	x25, x21
Lloh10:
	adrp	x8, _CALIBRATE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CALIBRATE@GOTPAGEOFF]
Lloh12:
	ldr	w28, [x8]
Lloh13:
	adrp	x21, _NFCAL_INTF@GOTPAGE
Lloh14:
	ldr	x21, [x21, _NFCAL_INTF@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	x23, [sp, #24]                  ; 8-byte Folded Reload
	mov	x1, x23
	bl	_test_bit
	cmp	x0, #0
Lloh15:
	adrp	x8, l_.str.1@PAGE
Lloh16:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh17:
	adrp	x9, l_.str.2@PAGE
Lloh18:
	add	x9, x9, l_.str.2@PAGEOFF
	csel	x6, x9, x8, eq
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	mov	x1, x28
Lloh19:
	adrp	x2, l_.str@PAGE
Lloh20:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x24
	mov	x4, x26
	mov	x5, x27
	bl	_ath_dbg
	ldr	w0, [x21]
	mov	x1, x23
	bl	_test_bit
	cbz	x0, LBB0_2
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	w28, #1
	mov	x21, x25
	mov	x23, x20
	b	LBB0_3
LBB0_14:
	cbz	w28, LBB0_16
; %bb.15:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_16:
Lloh21:
	adrp	x8, _NFCAL_INTF@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NFCAL_INTF@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_clear_bit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_NUM_NF_READINGS,4,2            ; @NUM_NF_READINGS
	.comm	_AR5416_MAX_CHAINS,4,2          ; @AR5416_MAX_CHAINS
	.comm	_ATH9K_NF_CAL_HIST_MAX,8,3      ; @ATH9K_NF_CAL_HIST_MAX
	.comm	_CALIBRATE,4,2                  ; @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"NFmid[%d] (%d) > MAX (%d), %s\n"

	.comm	_NFCAL_INTF,4,2                 ; @NFCAL_INTF
l_.str.1:                               ; @.str.1
	.asciz	"not corrected (due to interference)"

l_.str.2:                               ; @.str.2
	.asciz	"correcting to MAX"

	.no_dead_strip	_ath9k_hw_update_nfcal_hist_buffer
.subsections_via_symbols
