	.file	"extr_eeprom_def.c_ath9k_get_txgain_index.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ath9k_get_txgain_index, @function
ath9k_get_txgain_index:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, r9
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rcx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	QWORD PTR 8[rsp], r8
	lea	rdx, 20[rsp]
	mov	rbx, QWORD PTR 112[rsp]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	QWORD PTR [rsp], rsi
	mov	QWORD PTR 24[rsp], 0
	mov	QWORD PTR 32[rsp], 0
	call	ath9k_hw_get_channel_centers@PLT
	mov	r8, QWORD PTR 8[rsp]
	mov	r10, QWORD PTR [rsp]
	test	r8, r8
	je	.L10
	mov	rax, QWORD PTR AR5416_BCHAN_UNUSED[rip]
	xor	r12d, r12d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L16:
	add	r12, 1
	cmp	r8, r12
	je	.L2
.L3:
	cmp	QWORD PTR 0[rbp+r12*8], rax
	jne	.L16
.L2:
	mov	rdi, r10
	call	IS_CHAN_2GHZ@PLT
	mov	edi, DWORD PTR 20[rsp]
	mov	esi, eax
	call	FREQ2FBIN@PLT
	lea	rcx, 24[rsp]
	mov	rdx, r12
	mov	rsi, rbp
	mov	rdi, rax
	lea	r8, 32[rsp]
	call	ath9k_hw_get_lower_upper_index@PLT
	test	eax, eax
	je	.L4
	mov	rax, QWORD PTR 24[rsp]
	sal	rax, 4
	add	r14, rax
	mov	rax, QWORD PTR [r14]
	mov	rax, QWORD PTR [rax]
	mov	rsi, QWORD PTR [rax]
	mov	rax, QWORD PTR 8[r14]
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR [rax]
.L5:
	mov	rcx, QWORD PTR 0[r13]
	mov	QWORD PTR [r15], rax
	cmp	rsi, QWORD PTR [rcx]
	jle	.L11
	mov	eax, DWORD PTR AR9280_TX_GAIN_TABLE_SIZE[rip]
	lea	edx, -1[rax]
	xor	eax, eax
	movsx	rdx, edx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	add	rax, 1
	cmp	QWORD PTR [rcx+rax*8], rsi
	jge	.L7
.L6:
	cmp	rdx, rax
	jg	.L8
.L7:
	mov	QWORD PTR [rbx], rax
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L17
	add	rsp, 56
	.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
.L4:
	.cfi_restore_state
	mov	rax, QWORD PTR 32[rsp]
	sal	rax, 4
	add	rax, r14
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR 8[rax]
	mov	rdx, QWORD PTR [rdx]
	mov	rax, QWORD PTR [rax]
	mov	rsi, QWORD PTR [rdx]
	mov	rdx, QWORD PTR 24[rsp]
	mov	rax, QWORD PTR [rax]
	sal	rdx, 4
	mov	rdx, QWORD PTR 8[r14+rdx]
	mov	rdx, QWORD PTR [rdx]
	add	rax, QWORD PTR [rdx]
	mov	rdx, rax
	shr	rax, 63
	add	rax, rdx
	sar	rax
	jmp	.L5
.L10:
	xor	r12d, r12d
	jmp	.L2
.L11:
	xor	eax, eax
	jmp	.L7
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ath9k_get_txgain_index, .-ath9k_get_txgain_index
	.comm	AR9280_TX_GAIN_TABLE_SIZE,4,4
	.comm	AR5416_BCHAN_UNUSED,8,8
	.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_eeprom_def.c_ath9k_get_txgain_index.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ath9k_get_txgain_index, %function
ath9k_get_txgain_index:
	@ args = 12, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, #0
	sub	sp, sp, #28
	ldr	r5, [sp, #64]
	mov	r8, r3
	ldr	r3, .L18
	mov	r6, r2
	add	r2, sp, #16
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	mov	r10, r0
	mov	fp, r1
	ldr	r9, [sp, #68]
	ldr	r7, [sp, #72]
	str	r4, [sp, #8]
	str	r4, [sp, #12]
	bl	ath9k_hw_get_channel_centers
	cmp	r5, r4
	beq	.L10
	ldr	r3, .L18+4
	sub	ip, r8, #4
	ldr	r2, [r3]
	b	.L3
.L16:
	add	r4, r4, #1
	cmp	r5, r4
	beq	.L2
.L3:
	ldr	r3, [ip, #4]!
	cmp	r3, r2
	bne	.L16
.L2:
	mov	r0, fp
	ldr	r5, [sp, #16]
	bl	IS_CHAN_2GHZ
	mov	r1, r0
	mov	r0, r5
	bl	FREQ2FBIN
	add	r3, sp, #12
	str	r3, [sp]
	mov	r2, r4
	mov	r1, r8
	add	r3, sp, #8
	bl	ath9k_hw_get_lower_upper_index
	cmp	r0, #0
	beq	.L4
	ldr	r3, [sp, #8]
	add	r2, r6, r3, lsl #3
	ldr	r1, [r2, #4]
	ldr	r2, [r6, r3, lsl #3]
	ldr	r3, [r1]
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	ip, [r2]
.L5:
	ldr	r2, [r10]
	str	r3, [r9]
	ldr	r3, [r2]
	cmp	ip, r3
	mov	r3, #0
	ble	.L7
	ldr	r1, .L18+8
	ldr	r0, [r1]
	sub	r0, r0, #1
	b	.L6
.L8:
	ldr	r1, [r2, #4]!
	add	r3, r3, #1
	cmp	r1, ip
	bge	.L7
.L6:
	cmp	r0, r3
	bgt	.L8
.L7:
	str	r3, [r7]
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L17
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r2, [sp, #12]
	ldr	r3, [sp, #8]
	add	r1, r6, r2, lsl #3
	add	r3, r6, r3, lsl #3
	ldr	r1, [r1, #4]
	ldr	r3, [r3, #4]
	ldr	r1, [r1]
	ldr	r3, [r3]
	ldr	r1, [r1]
	ldr	r2, [r6, r2, lsl #3]
	ldr	r3, [r3]
	ldr	r2, [r2]
	add	r3, r3, r1
	add	r3, r3, r3, lsr #31
	ldr	ip, [r2]
	asr	r3, r3, #1
	b	.L5
.L10:
	mov	r4, r5
	b	.L2
.L17:
	bl	__stack_chk_fail
.L19:
	.align	2
.L18:
	.word	.LC0
	.word	AR5416_BCHAN_UNUSED
	.word	AR9280_TX_GAIN_TABLE_SIZE
	.size	ath9k_get_txgain_index, .-ath9k_get_txgain_index
	.comm	AR9280_TX_GAIN_TABLE_SIZE,4,4
	.comm	AR5416_BCHAN_UNUSED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
