	.file	"extr_bwirf.c_bwi_rf_calc_rssi_bcm2050.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"lna_gain %d, phyinfo 0x%04x\n"
.LC1:
	.string	"impossible lna gain %d"
	.text
	.p2align 4
	.type	bwi_rf_calc_rssi_bcm2050, @function
bwi_rf_calc_rssi_bcm2050:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	edi, DWORD PTR 12[rsi]
	mov	ebx, DWORD PTR [rsi]
	call	le16toh@PLT
	mov	edi, DWORD PTR 8[rbp]
	mov	r12d, eax
	call	le16toh@PLT
	test	DWORD PTR BWI_RXH_F1_OFDM[rip], r12d
	jne	.L20
	mov	rdx, QWORD PTR 0[r13]
	mov	edx, DWORD PTR [rdx]
	test	DWORD PTR BWI_CARD_F_SW_NRSSI[rip], edx
	jne	.L21
	mov	edx, 31
	sub	edx, ebx
	imul	edx, edx, -149
	lea	r12d, 127[rdx]
	test	edx, edx
	cmovs	edx, r12d
	sar	edx, 7
	lea	r12d, -68[rdx]
.L8:
	mov	rcx, QWORD PTR IEEE80211_MODE_11G[rip]
	cmp	QWORD PTR 8[r13], rcx
	jne	.L1
	mov	edi, DWORD PTR 4[rbp]
	test	DWORD PTR BWI_RXH_F3_BCM2050_RSSI[rip], eax
	lea	edx, 20[r12]
	mov	r14d, DWORD PTR BWI_RXH_PHYINFO_LNAGAIN[rip]
	cmovne	r12d, edx
	call	le16toh@PLT
	mov	edi, eax
	mov	esi, r14d
	call	__SHIFTOUT@PLT
	mov	edi, DWORD PTR 4[rbp]
	mov	r14d, eax
	call	le16toh@PLT
	mov	rdi, QWORD PTR 0[r13]
	mov	ecx, r14d
	mov	esi, DWORD PTR BWI_DBG_RF[rip]
	mov	r8d, eax
	or	esi, DWORD PTR BWI_DBG_RX[rip]
	lea	rdx, .LC0[rip]
	call	DPRINTF@PLT
	cmp	r14d, 2
	je	.L10
	jg	.L11
	test	r14d, r14d
	je	.L12
	cmp	r14d, 1
	jne	.L14
	add	r12d, 6
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	edx, DWORD PTR BWI_NRSSI_TBLSZ[rip]
	cmp	edx, ebx
	lea	ecx, -1[rdx]
	mov	edx, 31
	cmovle	ebx, ecx
	mov	rcx, QWORD PTR 16[r13]
	movsx	rbx, ebx
	sub	edx, DWORD PTR [rcx+rbx*8]
	imul	edx, edx, -131
	lea	r12d, 127[rdx]
	test	edx, edx
	cmovs	edx, r12d
	sar	edx, 7
	lea	r12d, -67[rdx]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	cmp	ebx, 127
	lea	edx, -256[rbx]
	cmovg	ebx, edx
	lea	edx, 17[rbx]
	sub	ebx, 4
	test	DWORD PTR BWI_RXH_F3_BCM2050_RSSI[rip], eax
	cmove	edx, ebx
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	mov	r12d, edx
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	cmp	r14d, 3
	jne	.L14
	add	r12d, 5
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	add	r12d, 27
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	add	r12d, 12
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	esi, r14d
	lea	rdi, .LC1[rip]
	call	panic@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	bwi_rf_calc_rssi_bcm2050, .-bwi_rf_calc_rssi_bcm2050
	.comm	IEEE80211_MODE_11G,8,8
	.comm	BWI_RXH_PHYINFO_LNAGAIN,4,4
	.comm	BWI_RXH_F3_BCM2050_RSSI,4,4
	.comm	BWI_RXH_F1_OFDM,4,4
	.comm	BWI_NRSSI_TBLSZ,4,4
	.comm	BWI_DBG_RX,4,4
	.comm	BWI_DBG_RF,4,4
	.comm	BWI_CARD_F_SW_NRSSI,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_bwirf.c_bwi_rf_calc_rssi_bcm2050.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"lna_gain %d, phyinfo 0x%04x\012\000"
	.align	2
.LC1:
	.ascii	"impossible lna gain %d\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bwi_rf_calc_rssi_bcm2050, %function
bwi_rf_calc_rssi_bcm2050:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r6, r0
	sub	sp, sp, #12
	ldr	r0, [r1, #12]
	mov	r5, r1
	ldr	r4, [r1]
	bl	le16toh
	mov	r7, r0
	ldr	r0, [r5, #8]
	bl	le16toh
	ldr	r3, .L23
	ldr	r3, [r3]
	tst	r7, r3
	bne	.L21
	ldr	r2, [r6]
	ldr	r3, .L23+4
	ldr	r2, [r2]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L22
	mvn	r3, #148
	rsb	r4, r4, #31
	mul	r4, r3, r4
	add	r3, r4, #127
	cmp	r4, #0
	movlt	r4, r3
	asr	r4, r4, #7
	sub	r4, r4, #68
.L8:
	ldr	r3, .L23+8
	ldr	r2, [r6, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L1
	ldr	r3, .L23+12
	ldr	r3, [r3]
	tst	r0, r3
	ldr	r0, [r5, #4]
	addne	r4, r4, #20
	bl	le16toh
	ldr	r3, .L23+16
	ldr	r1, [r3]
	bl	__SHIFTOUT
	mov	r3, r0
	ldr	r1, .L23+20
	ldr	r2, .L23+24
	ldr	r1, [r1]
	ldr	r2, [r2]
	ldr	r0, [r5, #4]
	ldr	r7, [r6]
	mov	r5, r3
	orr	r6, r1, r2
	bl	le16toh
	mov	r1, r6
	str	r0, [sp]
	mov	r3, r5
	mov	r0, r7
	ldr	r2, .L23+28
	bl	DPRINTF
	cmp	r5, #3
	ldrls	pc, [pc, r5, asl #2]
	b	.L10
.L12:
	.word	.L15
	.word	.L14
	.word	.L13
	.word	.L11
.L22:
	ldr	r3, .L23+32
	ldr	r3, [r3]
	cmp	r3, r4
	suble	r4, r3, #1
	ldr	r3, [r6, #8]
	ldr	r4, [r3, r4, lsl #2]
	rsb	r4, r4, #31
	rsb	r3, r4, r4, lsl #25
	rsb	r3, r4, r3, lsl #5
	add	r4, r4, r3, lsl #2
	add	r3, r4, #127
	cmp	r4, #0
	movlt	r4, r3
	asr	r4, r4, #7
	sub	r4, r4, #67
	b	.L8
.L10:
	mov	r1, r5
	ldr	r0, .L23+36
	bl	panic
.L1:
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L21:
	ldr	r3, .L23+12
	cmp	r4, #127
	ldr	r3, [r3]
	subgt	r4, r4, #256
	tst	r0, r3
	addne	r4, r4, #17
	subeq	r4, r4, #4
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L11:
	add	r4, r4, #5
	b	.L1
.L13:
	add	r4, r4, #12
	b	.L1
.L14:
	add	r4, r4, #6
	b	.L1
.L15:
	add	r4, r4, #27
	b	.L1
.L24:
	.align	2
.L23:
	.word	BWI_RXH_F1_OFDM
	.word	BWI_CARD_F_SW_NRSSI
	.word	IEEE80211_MODE_11G
	.word	BWI_RXH_F3_BCM2050_RSSI
	.word	BWI_RXH_PHYINFO_LNAGAIN
	.word	BWI_DBG_RF
	.word	BWI_DBG_RX
	.word	.LC0
	.word	BWI_NRSSI_TBLSZ
	.word	.LC1
	.size	bwi_rf_calc_rssi_bcm2050, .-bwi_rf_calc_rssi_bcm2050
	.comm	IEEE80211_MODE_11G,4,4
	.comm	BWI_RXH_PHYINFO_LNAGAIN,4,4
	.comm	BWI_RXH_F3_BCM2050_RSSI,4,4
	.comm	BWI_RXH_F1_OFDM,4,4
	.comm	BWI_NRSSI_TBLSZ,4,4
	.comm	BWI_DBG_RX,4,4
	.comm	BWI_DBG_RF,4,4
	.comm	BWI_CARD_F_SW_NRSSI,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
