	.file	"extr_ar9003_phy.c_ar9003_hw_spur_mitigate_ofdm.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ar9003_hw_spur_mitigate_ofdm, @function
ar9003_hw_spur_mitigate_ofdm:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	QWORD PTR 8[rsp], rdi
	mov	rdi, rsi
	call	IS_CHAN_5GHZ@PLT
	test	rax, rax
	je	.L2
	mov	rbx, QWORD PTR 8[rbx]
	xor	ebp, ebp
	cmp	QWORD PTR [rbx], 0
	jne	.L23
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[rsp]
	mov	ebp, 1
	mov	rbx, QWORD PTR [rax]
	cmp	QWORD PTR [rbx], 0
	je	.L1
.L23:
	mov	rdi, r13
	call	IS_CHAN_HT40@PLT
	test	rax, rax
	jne	.L24
	mov	r12d, DWORD PTR 0[r13]
	mov	r15d, 10
.L8:
	mov	rdi, QWORD PTR 8[rsp]
	xor	r14d, r14d
	call	ar9003_hw_spur_ofdm_clear@PLT
	mov	eax, DWORD PTR AR_EEPROM_MODAL_SPURS[rip]
	test	eax, eax
	jne	.L9
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	add	r14d, 1
	cmp	DWORD PTR AR_EEPROM_MODAL_SPURS[rip], r14d
	jbe	.L1
.L9:
	mov	eax, r14d
	mov	rdi, QWORD PTR [rbx+rax*8]
	test	rdi, rdi
	je	.L1
	mov	esi, ebp
	call	ath9k_hw_fbin2freq@PLT
	sub	eax, r12d
	mov	ecx, eax
	sar	ecx, 31
	mov	edx, ecx
	xor	edx, eax
	sub	edx, ecx
	cmp	edx, r15d
	jge	.L11
	mov	rsi, r13
	mov	r13, QWORD PTR 8[rsp]
	mov	r8d, r12d
	mov	ecx, r15d
	mov	edx, eax
	mov	rdi, r13
	call	ar9003_hw_spur_ofdm_work@PLT
	mov	rdi, r13
	call	AR_SREV_9565@PLT
	cmp	r14d, 3
	ja	.L1
	test	rax, rax
	je	.L1
	lea	eax, 1[r14]
	mov	esi, ebp
	mov	rdi, QWORD PTR [rbx+rax*8]
	call	ath9k_hw_fbin2freq@PLT
	sub	eax, r12d
	mov	edx, eax
	mov	esi, eax
	sar	edx, 31
	mov	eax, edx
	xor	eax, esi
	sub	eax, edx
	cmp	eax, r15d
	jge	.L1
	mov	rdi, QWORD PTR 8[rsp]
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	ar9003_hw_spur_ofdm_9565@PLT
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	mov	edx, DWORD PTR AR_PHY_GC_DYN2040_PRI_CH[rip]
	mov	esi, DWORD PTR AR_PHY_GEN_CTRL[rip]
	mov	rdi, QWORD PTR 8[rsp]
	call	REG_READ_FIELD@PLT
	test	eax, eax
	mov	eax, DWORD PTR 0[r13]
	jne	.L7
	lea	r12d, -10[rax]
	mov	r15d, 19
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	lea	r12d, 10[rax]
	mov	r15d, 19
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	ar9003_hw_spur_mitigate_ofdm, .-ar9003_hw_spur_mitigate_ofdm
	.comm	AR_PHY_GEN_CTRL,4,4
	.comm	AR_PHY_GC_DYN2040_PRI_CH,4,4
	.comm	AR_EEPROM_MODAL_SPURS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ar9003_phy.c_ar9003_hw_spur_mitigate_ofdm.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar9003_hw_spur_mitigate_ofdm, %function
ar9003_hw_spur_mitigate_ofdm:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r0
	sub	sp, sp, #20
	mov	r0, r1
	mov	r7, r1
	bl	IS_CHAN_5GHZ
	cmp	r0, #0
	ldrne	r3, [r8, #4]
	ldreq	r3, [r8]
	strne	r3, [sp, #12]
	streq	r3, [sp, #12]
	ldr	r3, [sp, #12]
	movne	r5, #0
	ldr	r3, [r3]
	moveq	r5, #1
	cmp	r3, #0
	bne	.L21
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	mov	r0, r7
	bl	IS_CHAN_HT40
	cmp	r0, #0
	bne	.L22
	mov	r9, #10
	ldr	r6, [r7]
.L8:
	ldr	r10, .L23
	mov	r0, r8
	bl	ar9003_hw_spur_ofdm_clear
	ldr	r2, [r10]
	cmp	r2, #0
	beq	.L1
	ldr	r3, [sp, #12]
	mov	r4, #0
	sub	fp, r3, #4
	b	.L10
.L11:
	ldr	r2, [r10]
	add	r4, r4, #1
	cmp	r2, r4
	bls	.L1
.L10:
	ldr	r0, [fp, #4]!
	cmp	r0, #0
	beq	.L1
	mov	r1, r5
	bl	ath9k_hw_fbin2freq
	sub	r0, r0, r6
	eor	r1, r0, r0, asr #31
	sub	r1, r1, r0, asr #31
	cmp	r1, r9
	bge	.L11
	mov	r3, r9
	mov	r2, r0
	mov	r1, r7
	mov	r0, r8
	str	r6, [sp]
	bl	ar9003_hw_spur_ofdm_work
	mov	r0, r8
	bl	AR_SREV_9565
	cmp	r4, #3
	movhi	r3, #0
	movls	r3, #1
	cmp	r0, #0
	moveq	r3, #0
	cmp	r3, #0
	beq	.L1
	ldr	r3, [sp, #12]
	add	r4, r4, #1
	mov	r1, r5
	ldr	r0, [r3, r4, lsl #2]
	bl	ath9k_hw_fbin2freq
	sub	r1, r0, r6
	eor	r3, r1, r1, asr #31
	sub	r3, r3, r1, asr #31
	cmp	r3, r9
	bge	.L1
	mov	r0, r8
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	ar9003_hw_spur_ofdm_9565
.L22:
	ldr	r3, .L23+4
	ldr	r2, .L23+8
	mov	r0, r8
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	REG_READ_FIELD
	ldr	r6, [r7]
	cmp	r0, #0
	mov	r9, #19
	subeq	r6, r6, #10
	addne	r6, r6, #10
	b	.L8
.L24:
	.align	2
.L23:
	.word	AR_EEPROM_MODAL_SPURS
	.word	AR_PHY_GEN_CTRL
	.word	AR_PHY_GC_DYN2040_PRI_CH
	.size	ar9003_hw_spur_mitigate_ofdm, .-ar9003_hw_spur_mitigate_ofdm
	.comm	AR_PHY_GEN_CTRL,4,4
	.comm	AR_PHY_GC_DYN2040_PRI_CH,4,4
	.comm	AR_EEPROM_MODAL_SPURS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
