	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath5k_ani_calibration          ## -- Begin function ath5k_ani_calibration
	.p2align	4, 0x90
_ath5k_ani_calibration:                 ## @ath5k_ani_calibration
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	%rdi, %rsi
	callq	_ath5k_hw_ani_get_listen_time
	movl	%eax, %r15d
	addl	%eax, (%rbx)
	movq	8(%rbx), %rax
	movq	_ATH5K_ANI_MODE_AUTO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.1:
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_ath5k_ani_save_and_clear_phy_errors
	movl	(%rbx), %ecx
	movq	_ATH5K_ANI_OFDM_TRIG_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%ecx, %eax
	cltq
	imulq	$274877907, %rax, %r14          ## imm = 0x10624DD3
	movq	%r14, %rax
	shrq	$63, %rax
	sarq	$38, %r14
	addl	%eax, %r14d
	movq	_ATH5K_ANI_CCK_TRIG_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%ecx, %eax
	cltq
	imulq	$274877907, %rax, %r13          ## imm = 0x10624DD3
	movq	%r13, %rax
	shrq	$63, %rax
	sarq	$38, %r13
	addl	%eax, %r13d
	movq	_ATH5K_ANI_OFDM_TRIG_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%ecx, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_ATH5K_ANI_CCK_TRIG_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%ecx, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_ATH5K_DEBUG_ANI@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_ATH5K_DBG_UNLIMIT
	movl	(%r12), %esi
	movl	16(%rbx), %ecx
	movl	20(%rbx), %r9d
	movl	%r13d, (%rsp)
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_ATH5K_DBG_UNLIMIT
	movl	16(%rbx), %ecx
	cmpl	%r14d, %ecx
	jg	LBB0_3
## %bb.2:
	movl	20(%rbx), %r9d
	cmpl	%r13d, %r9d
	jle	LBB0_4
LBB0_3:
	xorl	%edx, %edx
	cmpl	%r14d, %ecx
	setg	%dl
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_ath5k_ani_raise_immunity
LBB0_8:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ath5k_ani_period_restart       ## TAILCALL
LBB0_4:
	movq	_ATH5K_ANI_LISTEN_PERIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%rax,4), %eax
	cmpl	%eax, (%rbx)
	jle	LBB0_9
## %bb.5:
	movslq	-44(%rbp), %rax                 ## 4-byte Folded Reload
	imulq	$274877907, %rax, %r14          ## imm = 0x10624DD3
	movq	%r14, %rax
	shrq	$63, %rax
	sarq	$38, %r14
	addl	%eax, %r14d
	movslq	-48(%rbp), %rax                 ## 4-byte Folded Reload
	imulq	$274877907, %rax, %r15          ## imm = 0x10624DD3
	movq	%r15, %rax
	shrq	$63, %rax
	sarq	$38, %r15
	addl	%eax, %r15d
	movq	_ATH5K_DEBUG_ANI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, (%rsp)
	leaq	L_.str.2(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_ATH5K_DBG_UNLIMIT
	cmpl	%r14d, 16(%rbx)
	jg	LBB0_8
## %bb.6:
	cmpl	%r15d, 20(%rbx)
	jg	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_ath5k_ani_lower_immunity
	jmp	LBB0_8
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH5K_ANI_MODE_AUTO,8,3        ## @ATH5K_ANI_MODE_AUTO
	.comm	_ATH5K_ANI_OFDM_TRIG_HIGH,4,2   ## @ATH5K_ANI_OFDM_TRIG_HIGH
	.comm	_ATH5K_ANI_CCK_TRIG_HIGH,4,2    ## @ATH5K_ANI_CCK_TRIG_HIGH
	.comm	_ATH5K_ANI_OFDM_TRIG_LOW,4,2    ## @ATH5K_ANI_OFDM_TRIG_LOW
	.comm	_ATH5K_ANI_CCK_TRIG_LOW,4,2     ## @ATH5K_ANI_CCK_TRIG_LOW
	.comm	_ATH5K_DEBUG_ANI,4,2            ## @ATH5K_DEBUG_ANI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"listen %d (now %d)"

L_.str.1:                               ## @.str.1
	.asciz	"check high ofdm %d/%d cck %d/%d"

	.comm	_ATH5K_ANI_LISTEN_PERIOD,4,2    ## @ATH5K_ANI_LISTEN_PERIOD
L_.str.2:                               ## @.str.2
	.asciz	"check low ofdm %d/%d cck %d/%d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath5k_ani_calibration          ; -- Begin function ath5k_ani_calibration
	.p2align	2
_ath5k_ani_calibration:                 ; @ath5k_ani_calibration
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
	mov	x1, x0
	bl	_ath5k_hw_ani_get_listen_time
	ldr	w8, [x19]
	add	w8, w8, w0
	str	w8, [x19]
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _ATH5K_ANI_MODE_AUTO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATH5K_ANI_MODE_AUTO@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.1:
	mov	x22, x0
	mov	x0, x19
	mov	x1, x19
	bl	_ath5k_ani_save_and_clear_phy_errors
	ldr	w20, [x19]
Lloh3:
	adrp	x8, _ATH5K_ANI_OFDM_TRIG_HIGH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATH5K_ANI_OFDM_TRIG_HIGH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mul	w8, w8, w20
	mov	w23, #19923
	movk	w23, #4194, lsl #16
	smull	x8, w8, w23
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w21, w8, w9
Lloh6:
	adrp	x8, _ATH5K_ANI_CCK_TRIG_HIGH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATH5K_ANI_CCK_TRIG_HIGH@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mul	w8, w8, w20
	smull	x8, w8, w23
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w27, w8, w9
Lloh9:
	adrp	x8, _ATH5K_ANI_OFDM_TRIG_LOW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATH5K_ANI_OFDM_TRIG_LOW@GOTPAGEOFF]
Lloh11:
	ldr	w26, [x8]
Lloh12:
	adrp	x8, _ATH5K_ANI_CCK_TRIG_LOW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ATH5K_ANI_CCK_TRIG_LOW@GOTPAGEOFF]
Lloh14:
	ldr	w25, [x8]
Lloh15:
	adrp	x24, _ATH5K_DEBUG_ANI@GOTPAGE
Lloh16:
	ldr	x24, [x24, _ATH5K_DEBUG_ANI@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh17:
	adrp	x2, l_.str@PAGE
Lloh18:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	mov	x4, x22
	bl	_ATH5K_DBG_UNLIMIT
	ldr	w1, [x24]
	ldp	w3, w8, [x19, #16]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
	stp	x8, x27, [sp]
	mov	x0, x19
	mov	x4, x21
	bl	_ATH5K_DBG_UNLIMIT
	ldr	w3, [x19, #16]
	cmp	w3, w21
	b.gt	LBB0_3
; %bb.2:
	ldr	w8, [x19, #20]
	cmp	w8, w27
	b.le	LBB0_5
LBB0_3:
	cmp	w3, w21
	cset	w2, gt
	mov	x0, x19
	mov	x1, x19
	bl	_ath5k_ani_raise_immunity
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_ath5k_ani_period_restart
LBB0_5:
	ldr	w9, [x19]
Lloh21:
	adrp	x10, _ATH5K_ANI_LISTEN_PERIOD@GOTPAGE
Lloh22:
	ldr	x10, [x10, _ATH5K_ANI_LISTEN_PERIOD@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	add	w10, w10, w10, lsl #2
	cmp	w9, w10
	b.le	LBB0_9
; %bb.6:
	mul	w9, w26, w20
	smull	x9, w9, w23
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w21, w9, w10
	mul	w9, w25, w20
	smull	x9, w9, w23
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w20, w9, w10
	ldr	w1, [x24]
Lloh24:
	adrp	x2, l_.str.2@PAGE
Lloh25:
	add	x2, x2, l_.str.2@PAGEOFF
	stp	x8, x20, [sp]
	mov	x0, x19
	mov	x4, x21
	bl	_ATH5K_DBG_UNLIMIT
	ldr	w8, [x19, #16]
	cmp	w8, w21
	b.gt	LBB0_4
; %bb.7:
	ldr	w8, [x19, #20]
	cmp	w8, w20
	b.gt	LBB0_4
; %bb.8:
	mov	x0, x19
	mov	x1, x19
	bl	_ath5k_ani_lower_immunity
	b	LBB0_4
LBB0_9:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH5K_ANI_MODE_AUTO,8,3        ; @ATH5K_ANI_MODE_AUTO
	.comm	_ATH5K_ANI_OFDM_TRIG_HIGH,4,2   ; @ATH5K_ANI_OFDM_TRIG_HIGH
	.comm	_ATH5K_ANI_CCK_TRIG_HIGH,4,2    ; @ATH5K_ANI_CCK_TRIG_HIGH
	.comm	_ATH5K_ANI_OFDM_TRIG_LOW,4,2    ; @ATH5K_ANI_OFDM_TRIG_LOW
	.comm	_ATH5K_ANI_CCK_TRIG_LOW,4,2     ; @ATH5K_ANI_CCK_TRIG_LOW
	.comm	_ATH5K_DEBUG_ANI,4,2            ; @ATH5K_DEBUG_ANI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"listen %d (now %d)"

l_.str.1:                               ; @.str.1
	.asciz	"check high ofdm %d/%d cck %d/%d"

	.comm	_ATH5K_ANI_LISTEN_PERIOD,4,2    ; @ATH5K_ANI_LISTEN_PERIOD
l_.str.2:                               ; @.str.2
	.asciz	"check low ofdm %d/%d cck %d/%d"

.subsections_via_symbols
