	.file	"extr_eeprom_9287.c_ar9287_eeprom_get_tx_gain_index.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ar9287_eeprom_get_tx_gain_index, @function
ar9287_eeprom_get_tx_gain_index:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rsi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, r9
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdx
	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
	mov	rbx, r8
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	lea	rdx, 4[rsp]
	mov	QWORD PTR 8[rsp], 0
	mov	QWORD PTR 16[rsp], 0
	call	ath9k_hw_get_channel_centers@PLT
	test	rbx, rbx
	je	.L7
	mov	rax, QWORD PTR AR5416_BCHAN_UNUSED[rip]
	xor	r12d, r12d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L11:
	add	r12, 1
	cmp	rbx, r12
	je	.L2
.L3:
	cmp	QWORD PTR 0[rbp+r12*8], rax
	jne	.L11
.L2:
	mov	rdi, r15
	call	IS_CHAN_2GHZ@PLT
	mov	edi, DWORD PTR 4[rsp]
	mov	esi, eax
	call	FREQ2FBIN@PLT
	lea	rcx, 8[rsp]
	mov	rdx, r12
	mov	rsi, rbp
	mov	rdi, rax
	lea	r8, 16[rsp]
	call	ath9k_hw_get_lower_upper_index@PLT
	test	eax, eax
	mov	rax, QWORD PTR 8[rsp]
	mov	rax, QWORD PTR 0[r13+rax*8]
	je	.L4
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR [rax]
.L5:
	mov	DWORD PTR [r14], eax
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L12
	add	rsp, 40
	.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	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR 16[rsp]
	mov	rax, QWORD PTR 0[r13+rax*8]
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR [rax]
	add	eax, DWORD PTR [rdx]
	mov	edx, eax
	shr	eax, 31
	add	eax, edx
	sar	eax
	jmp	.L5
.L7:
	xor	r12d, r12d
	jmp	.L2
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ar9287_eeprom_get_tx_gain_index, .-ar9287_eeprom_get_tx_gain_index
	.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_9287.c_ar9287_eeprom_get_tx_gain_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	ar9287_eeprom_get_tx_gain_index, %function
ar9287_eeprom_get_tx_gain_index:
	@ args = 8, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r4, #0
	sub	sp, sp, #28
	ldr	r5, [sp, #56]
	mov	r7, r3
	ldr	r3, .L13
	mov	r8, r2
	add	r2, sp, #16
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	mov	r9, r1
	ldr	r6, [sp, #60]
	str	r4, [sp, #8]
	str	r4, [sp, #12]
	bl	ath9k_hw_get_channel_centers
	cmp	r5, r4
	beq	.L7
	ldr	r3, .L13+4
	sub	r0, r7, #4
	ldr	lr, [r3]
	b	.L3
.L11:
	add	r4, r4, #1
	cmp	r5, r4
	beq	.L2
.L3:
	ldr	ip, [r0, #4]!
	cmp	ip, lr
	bne	.L11
.L2:
	mov	r0, r9
	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
	add	r3, sp, #8
	mov	r1, r7
	bl	ath9k_hw_get_lower_upper_index
	cmp	r0, #0
	ldr	r3, [sp, #8]
	beq	.L4
	ldr	r3, [r8, r3, lsl #2]
	ldr	r3, [r3]
	ldr	r3, [r3]
.L5:
	str	r3, [r6]
	ldr	r3, .L13
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L4:
	ldr	r2, [sp, #12]
	ldr	r3, [r8, r3, lsl #2]
	ldr	r2, [r8, r2, lsl #2]
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r2, [r2]
	add	r3, r3, r2
	add	r3, r3, r3, lsr #31
	asr	r3, r3, #1
	b	.L5
.L7:
	mov	r4, r5
	b	.L2
.L12:
	bl	__stack_chk_fail
.L14:
	.align	2
.L13:
	.word	.LC0
	.word	AR5416_BCHAN_UNUSED
	.size	ar9287_eeprom_get_tx_gain_index, .-ar9287_eeprom_get_tx_gain_index
	.comm	AR5416_BCHAN_UNUSED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
