	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath5k_ani_init                 ## -- Begin function ath5k_ani_init
	.p2align	4, 0x90
_ath5k_ani_init:                        ## @ath5k_ani_init
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	_AR5K_AR5212@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_22
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_ATH5K_ANI_MODE_OFF@GOTPCREL(%rip), %r12
	cmpl	%esi, (%r12)
	ja	LBB0_23
## %bb.2:
	movq	_ATH5K_ANI_MODE_AUTO@GOTPCREL(%rip), %r15
	cmpl	%r14d, (%r15)
	jb	LBB0_23
## %bb.3:
	leaq	16(%rbx), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	8(%rbx), %rax
	movq	_AR5K_SREV_AR2414@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	setl	%dl
	leal	(%rdx,%rdx,4), %eax
	addl	$2, %eax
	movl	%eax, 16(%rbx)
	cmpl	%r14d, (%r12)
	jne	LBB0_5
## %bb.4:
	movq	_ATH5K_DEBUG_ANI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	callq	_ATH5K_DBG_UNLIMIT
	jmp	LBB0_13
LBB0_23:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ATH5K_ERR                      ## TAILCALL
LBB0_5:
	movq	_ATH5K_ANI_MODE_MANUAL_LOW@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_7
## %bb.6:
	movq	_ATH5K_DEBUG_ANI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%rbx, %rdi
	callq	_ATH5K_DBG_UNLIMIT
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ath5k_ani_set_noise_immunity_level
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ath5k_ani_set_spur_immunity_level
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ath5k_ani_set_firstep_level
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_ath5k_ani_set_ofdm_weak_signal_detection
	movq	%rbx, %rdi
	movl	$1, %esi
	jmp	LBB0_12
LBB0_7:
	movq	_ATH5K_ANI_MODE_MANUAL_HIGH@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_9
## %bb.8:
	movq	_ATH5K_DEBUG_ANI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%rbx, %rdi
	callq	_ATH5K_DBG_UNLIMIT
	movq	_ATH5K_ANI_MAX_NOISE_IMM_LVL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ath5k_ani_set_noise_immunity_level
	movl	16(%rbx), %esi
	movq	%rbx, %rdi
	callq	_ath5k_ani_set_spur_immunity_level
	movq	_ATH5K_ANI_MAX_FIRSTEP_LVL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ath5k_ani_set_firstep_level
	movq	%rbx, %rdi
	xorl	%esi, %esi
	jmp	LBB0_11
LBB0_9:
	cmpl	%r14d, (%r15)
	jne	LBB0_13
## %bb.10:
	movq	_ATH5K_DEBUG_ANI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	movq	%rbx, %rdi
	callq	_ATH5K_DBG_UNLIMIT
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ath5k_ani_set_noise_immunity_level
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ath5k_ani_set_spur_immunity_level
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ath5k_ani_set_firstep_level
	movq	%rbx, %rdi
	movl	$1, %esi
LBB0_11:
	callq	_ath5k_ani_set_ofdm_weak_signal_detection
	movq	%rbx, %rdi
	xorl	%esi, %esi
LBB0_12:
	callq	_ath5k_ani_set_cck_weak_signal_detection
LBB0_13:
	movq	24(%rbx), %rax
	cmpl	%r14d, (%r15)
	jne	LBB0_17
## %bb.14:
	movq	%rbx, %rdi
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	callq	_ath5k_enable_phy_err_counters
	jmp	LBB0_21
LBB0_17:
	movq	%rbx, %rdi
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	callq	_ath5k_disable_phy_err_counters
	jmp	LBB0_21
LBB0_16:
	callq	_ath5k_hw_get_rx_filter
	movq	_AR5K_RX_FILTER_PHYERR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%rbx, %rdi
	movl	%eax, %esi
	jmp	LBB0_20
LBB0_19:
	callq	_ath5k_hw_get_rx_filter
	movq	_AR5K_RX_FILTER_PHYERR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	movq	%rbx, %rdi
LBB0_20:
	callq	_ath5k_hw_set_rx_filter
LBB0_21:
	movl	%r14d, 20(%rbx)
LBB0_22:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR5K_AR5212,8,3                ## @AR5K_AR5212
	.comm	_ATH5K_ANI_MODE_OFF,4,2         ## @ATH5K_ANI_MODE_OFF
	.comm	_ATH5K_ANI_MODE_AUTO,4,2        ## @ATH5K_ANI_MODE_AUTO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ANI mode %d out of range"

	.comm	_AR5K_SREV_AR2414,8,3           ## @AR5K_SREV_AR2414
	.comm	_ATH5K_DEBUG_ANI,4,2            ## @ATH5K_DEBUG_ANI
L_.str.1:                               ## @.str.1
	.asciz	"ANI off\n"

	.comm	_ATH5K_ANI_MODE_MANUAL_LOW,4,2  ## @ATH5K_ANI_MODE_MANUAL_LOW
L_.str.2:                               ## @.str.2
	.asciz	"ANI manual low -> high sensitivity\n"

	.comm	_ATH5K_ANI_MODE_MANUAL_HIGH,4,2 ## @ATH5K_ANI_MODE_MANUAL_HIGH
L_.str.3:                               ## @.str.3
	.asciz	"ANI manual high -> low sensitivity\n"

	.comm	_ATH5K_ANI_MAX_NOISE_IMM_LVL,4,2 ## @ATH5K_ANI_MAX_NOISE_IMM_LVL
	.comm	_ATH5K_ANI_MAX_FIRSTEP_LVL,4,2  ## @ATH5K_ANI_MAX_FIRSTEP_LVL
L_.str.4:                               ## @.str.4
	.asciz	"ANI auto\n"

	.comm	_AR5K_RX_FILTER_PHYERR,4,2      ## @AR5K_RX_FILTER_PHYERR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath5k_ani_init                 ; -- Begin function ath5k_ani_init
	.p2align	2
_ath5k_ani_init:                        ; @ath5k_ani_init
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _AR5K_AR5212@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AR5K_AR5212@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_22
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh3:
	adrp	x22, _ATH5K_ANI_MODE_OFF@GOTPAGE
Lloh4:
	ldr	x22, [x22, _ATH5K_ANI_MODE_OFF@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh5:
	adrp	x21, _ATH5K_ANI_MODE_AUTO@GOTPAGE
Lloh6:
	ldr	x21, [x21, _ATH5K_ANI_MODE_AUTO@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w8, w1
	ccmp	w9, w1, #0, ls
	b.hs	LBB0_3
; %bb.2:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	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
	b	_ATH5K_ERR
LBB0_3:
	add	x0, x20, #16
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x8, [x20, #8]
Lloh9:
	adrp	x9, _AR5K_SREV_AR2414@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AR5K_SREV_AR2414@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #2
	mov	w9, #7
	csel	w8, w9, w8, lt
	str	w8, [x20, #16]
	ldr	w8, [x22]
	cmp	w8, w19
	b.ne	LBB0_5
; %bb.4:
Lloh12:
	adrp	x8, _ATH5K_DEBUG_ANI@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ATH5K_DEBUG_ANI@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x2, l_.str.1@PAGE
Lloh16:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_ATH5K_DBG_UNLIMIT
	b	LBB0_13
LBB0_5:
Lloh17:
	adrp	x8, _ATH5K_ANI_MODE_MANUAL_LOW@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ATH5K_ANI_MODE_MANUAL_LOW@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_7
; %bb.6:
Lloh20:
	adrp	x8, _ATH5K_DEBUG_ANI@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ATH5K_DEBUG_ANI@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x2, l_.str.2@PAGE
Lloh24:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_ATH5K_DBG_UNLIMIT
	mov	x0, x20
	mov	w1, #0
	bl	_ath5k_ani_set_noise_immunity_level
	mov	x0, x20
	mov	w1, #0
	bl	_ath5k_ani_set_spur_immunity_level
	mov	x0, x20
	mov	w1, #0
	bl	_ath5k_ani_set_firstep_level
	mov	x0, x20
	mov	w1, #1
	bl	_ath5k_ani_set_ofdm_weak_signal_detection
	mov	x0, x20
	mov	w1, #1
	b	LBB0_12
LBB0_7:
Lloh25:
	adrp	x8, _ATH5K_ANI_MODE_MANUAL_HIGH@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ATH5K_ANI_MODE_MANUAL_HIGH@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_9
; %bb.8:
Lloh28:
	adrp	x8, _ATH5K_DEBUG_ANI@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ATH5K_DEBUG_ANI@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
Lloh31:
	adrp	x2, l_.str.3@PAGE
Lloh32:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_ATH5K_DBG_UNLIMIT
Lloh33:
	adrp	x8, _ATH5K_ANI_MAX_NOISE_IMM_LVL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ATH5K_ANI_MAX_NOISE_IMM_LVL@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ath5k_ani_set_noise_immunity_level
	ldr	w1, [x20, #16]
	mov	x0, x20
	bl	_ath5k_ani_set_spur_immunity_level
Lloh36:
	adrp	x8, _ATH5K_ANI_MAX_FIRSTEP_LVL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ATH5K_ANI_MAX_FIRSTEP_LVL@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ath5k_ani_set_firstep_level
	mov	x0, x20
	mov	w1, #0
	b	LBB0_11
LBB0_9:
	ldr	w8, [x21]
	cmp	w8, w19
	b.ne	LBB0_13
; %bb.10:
Lloh39:
	adrp	x8, _ATH5K_DEBUG_ANI@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ATH5K_DEBUG_ANI@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
Lloh42:
	adrp	x2, l_.str.4@PAGE
Lloh43:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_ATH5K_DBG_UNLIMIT
	mov	x0, x20
	mov	w1, #0
	bl	_ath5k_ani_set_noise_immunity_level
	mov	x0, x20
	mov	w1, #0
	bl	_ath5k_ani_set_spur_immunity_level
	mov	x0, x20
	mov	w1, #0
	bl	_ath5k_ani_set_firstep_level
	mov	x0, x20
	mov	w1, #1
LBB0_11:
	bl	_ath5k_ani_set_ofdm_weak_signal_detection
	mov	x0, x20
	mov	w1, #0
LBB0_12:
	bl	_ath5k_ani_set_cck_weak_signal_detection
LBB0_13:
	ldr	w9, [x21]
	ldr	x8, [x20, #24]
	mov	x0, x20
	cmp	w9, w19
	b.ne	LBB0_16
; %bb.14:
	cbz	x8, LBB0_18
; %bb.15:
	bl	_ath5k_enable_phy_err_counters
	b	LBB0_21
LBB0_16:
	cbz	x8, LBB0_19
; %bb.17:
	bl	_ath5k_disable_phy_err_counters
	b	LBB0_21
LBB0_18:
	bl	_ath5k_hw_get_rx_filter
Lloh44:
	adrp	x8, _AR5K_RX_FILTER_PHYERR@GOTPAGE
Lloh45:
	ldr	x8, [x8, _AR5K_RX_FILTER_PHYERR@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	orr	w1, w8, w0
	b	LBB0_20
LBB0_19:
	bl	_ath5k_hw_get_rx_filter
Lloh47:
	adrp	x8, _AR5K_RX_FILTER_PHYERR@GOTPAGE
Lloh48:
	ldr	x8, [x8, _AR5K_RX_FILTER_PHYERR@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
	bic	w1, w0, w8
LBB0_20:
	mov	x0, x20
	bl	_ath5k_hw_set_rx_filter
LBB0_21:
	str	w19, [x20, #20]
LBB0_22:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_AR5K_AR5212,8,3                ; @AR5K_AR5212
	.comm	_ATH5K_ANI_MODE_OFF,4,2         ; @ATH5K_ANI_MODE_OFF
	.comm	_ATH5K_ANI_MODE_AUTO,4,2        ; @ATH5K_ANI_MODE_AUTO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ANI mode %d out of range"

	.comm	_AR5K_SREV_AR2414,8,3           ; @AR5K_SREV_AR2414
	.comm	_ATH5K_DEBUG_ANI,4,2            ; @ATH5K_DEBUG_ANI
l_.str.1:                               ; @.str.1
	.asciz	"ANI off\n"

	.comm	_ATH5K_ANI_MODE_MANUAL_LOW,4,2  ; @ATH5K_ANI_MODE_MANUAL_LOW
l_.str.2:                               ; @.str.2
	.asciz	"ANI manual low -> high sensitivity\n"

	.comm	_ATH5K_ANI_MODE_MANUAL_HIGH,4,2 ; @ATH5K_ANI_MODE_MANUAL_HIGH
l_.str.3:                               ; @.str.3
	.asciz	"ANI manual high -> low sensitivity\n"

	.comm	_ATH5K_ANI_MAX_NOISE_IMM_LVL,4,2 ; @ATH5K_ANI_MAX_NOISE_IMM_LVL
	.comm	_ATH5K_ANI_MAX_FIRSTEP_LVL,4,2  ; @ATH5K_ANI_MAX_FIRSTEP_LVL
l_.str.4:                               ; @.str.4
	.asciz	"ANI auto\n"

	.comm	_AR5K_RX_FILTER_PHYERR,4,2      ; @AR5K_RX_FILTER_PHYERR
.subsections_via_symbols
