	.file	"extr_4965-rs.c_il4965_rs_initialize_lq.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	il4965_rs_initialize_lq, @function
il4965_rs_initialize_lq:
.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
	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
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	test	rdx, rdx
	je	.L1
	mov	rbx, rcx
	test	rcx, rcx
	je	.L1
	mov	rsi, rdx
	mov	rbp, rdi
	call	il4965_rs_use_green@PLT
	mov	r15d, DWORD PTR [rbx]
	mov	r13, QWORD PTR 16[rbp]
	mov	r12, rax
	mov	eax, DWORD PTR 32[rbx]
	test	eax, eax
	jne	.L5
	mov	rax, QWORD PTR 8[rbx]
.L6:
	mov	rdx, QWORD PTR 24[rbx]
	lea	r14, [rdx+rax*8]
	test	r15d, r15d
	js	.L12
	cmp	DWORD PTR RATE_COUNT[rip], r15d
	jg	.L15
.L12:
	xor	eax, eax
	xor	r15d, r15d
.L7:
	mov	rdx, QWORD PTR il_rates[rip]
	mov	rdi, r13
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR 4[rsp], eax
	call	il4965_first_antenna@PLT
	mov	ecx, DWORD PTR RATE_MCS_ANT_POS[rip]
	mov	edi, eax
	mov	DWORD PTR [r14], eax
	sal	edi, cl
	or	edi, DWORD PTR 4[rsp]
	cmp	DWORD PTR IL_FIRST_CCK_RATE[rip], r15d
	mov	DWORD PTR 4[rsp], edi
	jg	.L8
	cmp	DWORD PTR IL_LAST_CCK_RATE[rip], r15d
	jge	.L16
.L8:
	mov	esi, DWORD PTR 8[rbp]
	mov	rcx, rsp
	mov	rdx, r14
	call	il4965_rs_get_tbl_info_from_mcs@PLT
	mov	esi, DWORD PTR [r14]
	mov	rdi, r13
	call	il4965_rs_is_valid_ant@PLT
	test	eax, eax
	je	.L17
.L9:
	mov	edx, DWORD PTR [rsp]
	mov	rcx, r12
	mov	rsi, r14
	mov	rdi, rbp
	call	il4965_rate_n_flags_from_tbl@PLT
	mov	rsi, r14
	mov	rdi, rbx
	mov	DWORD PTR 4[r14], eax
	mov	DWORD PTR 4[rsp], eax
	call	il4965_rs_set_expected_tpt_table@PLT
	mov	edx, DWORD PTR 4[rsp]
	mov	rsi, rbx
	xor	edi, edi
	call	il4965_rs_fill_link_cmd@PLT
	mov	rdx, QWORD PTR 16[rbx]
	mov	rax, QWORD PTR 0[rbp]
	mov	rdi, rbp
	lea	rsi, 16[rbx]
	mov	ecx, 1
	mov	QWORD PTR [rax+rdx*8], rsi
	mov	edx, DWORD PTR CMD_SYNC[rip]
	call	il_send_lq_cmd@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	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
.L5:
	.cfi_restore_state
	mov	eax, 1
	sub	rax, QWORD PTR 8[rbx]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	movsx	rax, r15d
	sal	rax, 2
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	or	edi, DWORD PTR RATE_MCS_CCK_MSK[rip]
	mov	DWORD PTR 4[rsp], edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L17:
	lea	rsi, 4[rsp]
	mov	rdx, r14
	mov	rdi, r13
	call	il4965_rs_toggle_antenna@PLT
	jmp	.L9
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	il4965_rs_initialize_lq, .-il4965_rs_initialize_lq
	.comm	il_rates,8,8
	.comm	RATE_MCS_CCK_MSK,4,4
	.comm	RATE_MCS_ANT_POS,4,4
	.comm	RATE_COUNT,4,4
	.comm	IL_LAST_CCK_RATE,4,4
	.comm	IL_FIRST_CCK_RATE,4,4
	.comm	CMD_SYNC,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_4965-rs.c_il4965_rs_initialize_lq.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	il4965_rs_initialize_lq, %function
il4965_rs_initialize_lq:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	cmp	r3, #0
	cmpne	r2, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r3
	ldr	r3, .L17
	sub	sp, sp, #20
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bne	.L14
.L1:
	ldr	r3, .L17
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L15
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	mov	r1, r2
	mov	r6, r0
	bl	il4965_rs_use_green
	ldr	r3, [r4, #16]
	ldr	r5, [r4, #4]
	ldr	r7, [r4]
	cmp	r3, #0
	ldr	r10, [r4, #12]
	rsbne	r5, r5, #1
	cmp	r7, #0
	add	r8, r10, r5, lsl #3
	mov	r9, r0
	ldr	fp, [r6, #8]
	lsl	r5, r5, #3
	blt	.L11
	ldr	r3, .L17+4
	ldr	r3, [r3]
	cmp	r3, r7
	lslgt	r3, r7, #2
	ble	.L11
.L6:
	ldr	r2, .L17+8
	mov	r0, fp
	ldr	r2, [r2]
	ldr	r3, [r2, r3]
	str	r3, [sp, #8]
	bl	il4965_first_antenna
	mov	r1, r0
	ldr	r2, .L17+12
	ldr	r3, .L17+16
	ldr	r0, [r2]
	ldr	r3, [r3]
	ldr	r2, [sp, #8]
	cmp	r3, r7
	orr	r0, r2, r1, lsl r0
	str	r1, [r10, r5]
	str	r0, [sp, #8]
	bgt	.L7
	ldr	r3, .L17+20
	ldr	r3, [r3]
	cmp	r3, r7
	ldrge	r3, .L17+24
	ldrge	r3, [r3]
	orrge	r0, r0, r3
	strge	r0, [sp, #8]
.L7:
	mov	r2, r8
	ldr	r1, [r6, #4]
	add	r3, sp, #4
	bl	il4965_rs_get_tbl_info_from_mcs
	mov	r0, fp
	ldr	r1, [r10, r5]
	bl	il4965_rs_is_valid_ant
	cmp	r0, #0
	beq	.L16
.L8:
	ldr	r2, [sp, #4]
	mov	r3, r9
	mov	r1, r8
	mov	r0, r6
	bl	il4965_rate_n_flags_from_tbl
	mov	r3, r0
	mov	r1, r8
	str	r0, [r8, #4]
	mov	r0, r4
	str	r3, [sp, #8]
	bl	il4965_rs_set_expected_tpt_table
	mov	r1, r4
	ldr	r2, [sp, #8]
	mov	r0, #0
	bl	il4965_rs_fill_link_cmd
	ldr	r0, [r4, #8]
	ldr	r2, [r6]
	ldr	r3, .L17+28
	add	r1, r4, #8
	str	r1, [r2, r0, lsl #2]
	ldr	r2, [r3]
	mov	r0, r6
	mov	r3, #1
	bl	il_send_lq_cmd
	b	.L1
.L11:
	mov	r7, #0
	mov	r3, r7
	b	.L6
.L16:
	mov	r0, fp
	mov	r2, r8
	add	r1, sp, #8
	bl	il4965_rs_toggle_antenna
	b	.L8
.L15:
	bl	__stack_chk_fail
.L18:
	.align	2
.L17:
	.word	.LC0
	.word	RATE_COUNT
	.word	il_rates
	.word	RATE_MCS_ANT_POS
	.word	IL_FIRST_CCK_RATE
	.word	IL_LAST_CCK_RATE
	.word	RATE_MCS_CCK_MSK
	.word	CMD_SYNC
	.size	il4965_rs_initialize_lq, .-il4965_rs_initialize_lq
	.comm	il_rates,4,4
	.comm	RATE_MCS_CCK_MSK,4,4
	.comm	RATE_MCS_ANT_POS,4,4
	.comm	RATE_COUNT,4,4
	.comm	IL_LAST_CCK_RATE,4,4
	.comm	IL_FIRST_CCK_RATE,4,4
	.comm	CMD_SYNC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
