	.file	"extr_phy_lp.c_lpphy_rev0_1_rc_calib.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"RC calib: Failed to switch to channel 7, error = %d\n"
	.text
	.p2align 4
	.type	lpphy_rev0_1_rc_calib, @function
lpphy_rev0_1_rc_calib:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	esi, esi
	mov	edx, 8
	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
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 104
	.cfi_def_cfa_offset 160
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 88[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 8[rdi]
	lea	rdi, 80[rsp]
	mov	QWORD PTR 16[rsp], rdi
	mov	QWORD PTR 24[rsp], rax
	call	memset@PLT
	mov	esi, 7
	mov	rdi, rbp
	call	b43_lpphy_op_switch_channel@PLT
	test	eax, eax
	jne	.L37
.L2:
	mov	esi, DWORD PTR B43_LPPHY_AFE_CTL_OVR[rip]
	mov	rdi, rbp
	call	b43_phy_read@PLT
	mov	rdi, rbp
	and	eax, 64
	mov	DWORD PTR 36[rsp], eax
	mov	ebx, eax
	call	lpphy_get_bb_mult@PLT
	mov	DWORD PTR 44[rsp], eax
	test	ebx, ebx
	jne	.L38
.L3:
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_0[rip]
	mov	rdi, rbp
	call	b43_phy_read@PLT
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_VAL_0[rip]
	mov	rdi, rbp
	mov	DWORD PTR 48[rsp], eax
	call	b43_phy_read@PLT
	mov	esi, DWORD PTR B43_LPPHY_AFE_CTL_OVR[rip]
	mov	rdi, rbp
	mov	DWORD PTR 52[rsp], eax
	call	b43_phy_read@PLT
	mov	esi, DWORD PTR B43_LPPHY_AFE_CTL_OVRVAL[rip]
	mov	rdi, rbp
	mov	DWORD PTR 56[rsp], eax
	call	b43_phy_read@PLT
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_2[rip]
	mov	rdi, rbp
	mov	DWORD PTR 60[rsp], eax
	call	b43_phy_read@PLT
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_2_VAL[rip]
	mov	rdi, rbp
	mov	DWORD PTR 64[rsp], eax
	call	b43_phy_read@PLT
	mov	esi, DWORD PTR B43_LPPHY_LP_PHY_CTL[rip]
	mov	rdi, rbp
	mov	DWORD PTR 68[rsp], eax
	call	b43_phy_read@PLT
	mov	rdi, rbp
	mov	DWORD PTR 72[rsp], eax
	call	lpphy_read_tx_pctl_mode_from_hardware@PLT
	mov	rax, QWORD PTR 24[rsp]
	mov	esi, DWORD PTR B43_LPPHY_TXPCTL_OFF[rip]
	mov	rdi, rbp
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR 40[rsp], eax
	call	lpphy_set_tx_power_control@PLT
	mov	esi, 1
	mov	rdi, rbp
	call	lpphy_disable_crs@PLT
	mov	rdi, rbp
	call	lpphy_loopback@PLT
	mov	esi, eax
	cmp	eax, -1
	je	.L5
	mov	rdi, rbp
	xor	r13d, r13d
	lea	r15, ideal_pwr_table.2024[rip-20]
	call	lpphy_set_rx_gain_by_index@PLT
	mov	esi, DWORD PTR B43_LPPHY_LP_PHY_CTL[rip]
	mov	ecx, 64
	mov	rdi, rbp
	mov	edx, 65471
	call	b43_phy_maskset@PLT
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_2_VAL[rip]
	mov	ecx, 1
	mov	rdi, rbp
	mov	edx, 65528
	call	b43_phy_maskset@PLT
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_2_VAL[rip]
	mov	ecx, 8
	mov	rdi, rbp
	mov	edx, 65479
	call	b43_phy_maskset@PLT
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_2_VAL[rip]
	mov	ecx, 192
	mov	rdi, rbp
	mov	edx, 65343
	call	b43_phy_maskset@PLT
	mov	DWORD PTR 12[rsp], 128
	mov	DWORD PTR 32[rsp], 0
.L11:
	mov	edx, DWORD PTR 12[rsp]
	mov	esi, DWORD PTR B2062_N_RXBB_CALIB2[rip]
	mov	rdi, rbp
	xor	r12d, r12d
	mov	r14d, 5
	call	b43_radio_write@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	add	r14, 1
	cmp	r14, 26
	je	.L39
.L10:
	xor	r9d, r9d
	mov	ecx, r14d
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rbp
	mov	r8d, r14d
	call	lpphy_run_ddfs@PLT
	mov	rcx, QWORD PTR 16[rsp]
	mov	edx, 32
	mov	rdi, rbp
	mov	esi, 1000
	call	lpphy_rx_iq_est@PLT
	test	eax, eax
	je	.L5
	mov	edi, DWORD PTR 84[rsp]
	mov	ebx, DWORD PTR [r15+r14*4]
	mov	edx, 12
	add	edi, DWORD PTR 80[rsp]
	cmp	r14, 5
	cmove	r13d, edi
	sar	ebx, 3
	add	ebx, 1
	mov	esi, r13d
	sar	ebx
	call	lpphy_qdiv_roundup@PLT
	sub	ebx, eax
	imul	ebx, ebx
	add	r12d, ebx
	cmp	DWORD PTR 12[rsp], 128
	je	.L16
	cmp	r12d, DWORD PTR 32[rsp]
	jge	.L8
.L16:
	mov	rax, QWORD PTR 24[rsp]
	mov	ecx, DWORD PTR 12[rsp]
	add	r14, 1
	mov	DWORD PTR 32[rsp], r12d
	mov	DWORD PTR 4[rax], ecx
	cmp	r14, 26
	jne	.L10
.L39:
	add	DWORD PTR 12[rsp], 1
	mov	eax, DWORD PTR 12[rsp]
	cmp	eax, 160
	jne	.L11
	mov	rdi, rbp
	call	lpphy_stop_ddfs@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	mov	esi, 1
	mov	rdi, rbp
	call	lpphy_restore_crs@PLT
	mov	edx, DWORD PTR 52[rsp]
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_VAL_0[rip]
	mov	rdi, rbp
	call	b43_phy_write@PLT
	mov	edx, DWORD PTR 48[rsp]
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_0[rip]
	mov	rdi, rbp
	call	b43_phy_write@PLT
	mov	edx, DWORD PTR 60[rsp]
	mov	esi, DWORD PTR B43_LPPHY_AFE_CTL_OVRVAL[rip]
	mov	rdi, rbp
	call	b43_phy_write@PLT
	mov	edx, DWORD PTR 56[rsp]
	mov	esi, DWORD PTR B43_LPPHY_AFE_CTL_OVR[rip]
	mov	rdi, rbp
	call	b43_phy_write@PLT
	mov	edx, DWORD PTR 68[rsp]
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_2_VAL[rip]
	mov	rdi, rbp
	call	b43_phy_write@PLT
	mov	edx, DWORD PTR 64[rsp]
	mov	esi, DWORD PTR B43_LPPHY_RF_OVERRIDE_2[rip]
	mov	rdi, rbp
	call	b43_phy_write@PLT
	mov	edx, DWORD PTR 72[rsp]
	mov	esi, DWORD PTR B43_LPPHY_LP_PHY_CTL[rip]
	mov	rdi, rbp
	call	b43_phy_write@PLT
	mov	esi, DWORD PTR 44[rsp]
	mov	rdi, rbp
	call	lpphy_set_bb_mult@PLT
	mov	edx, DWORD PTR 36[rsp]
	test	edx, edx
	jne	.L40
.L12:
	mov	esi, DWORD PTR 40[rsp]
	mov	rdi, rbp
	call	lpphy_set_tx_power_control@PLT
	mov	rax, QWORD PTR 24[rsp]
	mov	eax, DWORD PTR 4[rax]
	test	eax, eax
	jne	.L41
.L1:
	mov	rax, QWORD PTR 88[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L42
	add	rsp, 104
	.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
.L41:
	.cfi_restore_state
	mov	rdi, rbp
	call	lpphy_set_rc_cap@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L40:
	mov	esi, DWORD PTR 76[rsp]
	mov	rdi, rbp
	call	lpphy_set_tx_gains@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L38:
	mov	rdi, rbp
	call	lpphy_get_tx_gains@PLT
	mov	DWORD PTR 76[rsp], eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L37:
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, eax
	lea	rsi, .LC0[rip]
	call	b43dbg@PLT
	jmp	.L2
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	lpphy_rev0_1_rc_calib, .-lpphy_rev0_1_rc_calib
	.section	.rodata
	.align 32
	.type	ideal_pwr_table.2024, @object
	.size	ideal_pwr_table.2024, 84
ideal_pwr_table.2024:
	.long	65536
	.long	66903
	.long	69165
	.long	70624
	.long	69410
	.long	65380
	.long	60834
	.long	58836
	.long	61393
	.long	64488
	.long	47032
	.long	19253
	.long	6750
	.long	2571
	.long	1092
	.long	509
	.long	255
	.long	136
	.long	76
	.long	44
	.long	26
	.comm	B43_LPPHY_TXPCTL_OFF,4,4
	.comm	B43_LPPHY_RF_OVERRIDE_VAL_0,4,4
	.comm	B43_LPPHY_RF_OVERRIDE_2_VAL,4,4
	.comm	B43_LPPHY_RF_OVERRIDE_2,4,4
	.comm	B43_LPPHY_RF_OVERRIDE_0,4,4
	.comm	B43_LPPHY_LP_PHY_CTL,4,4
	.comm	B43_LPPHY_AFE_CTL_OVRVAL,4,4
	.comm	B43_LPPHY_AFE_CTL_OVR,4,4
	.comm	B2062_N_RXBB_CALIB2,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_phy_lp.c_lpphy_rev0_1_rc_calib.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"RC calib: Failed to switch to channel 7, error = %d"
	.ascii	"\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	lpphy_rev0_1_rc_calib, %function
lpphy_rev0_1_rc_calib:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r2, .L44
	sub	sp, sp, #76
	ldr	r2, [r2]
	str	r2, [sp, #68]
	mov	r2,#0
	ldr	r2, [r0, #4]
	mov	r1, #7
	str	r2, [sp, #8]
	mov	r5, r0
	str	r3, [sp, #60]
	str	r3, [sp, #64]
	bl	b43_lpphy_op_switch_channel
	subs	r2, r0, #0
	bne	.L37
.L2:
	ldr	r3, .L44+4
	mov	r0, r5
	ldr	r1, [r3]
	bl	b43_phy_read
	mov	r3, r0
	and	r3, r3, #64
	mov	r4, r3
	mov	r0, r5
	str	r3, [sp, #12]
	bl	lpphy_get_bb_mult
	cmp	r4, #0
	str	r0, [sp, #20]
	bne	.L38
.L3:
	ldr	r3, .L44+8
	mov	r0, r5
	ldr	r1, [r3]
	bl	b43_phy_read
	mov	r3, r0
	ldr	r2, .L44+12
	mov	r0, r5
	ldr	r1, [r2]
	str	r3, [sp, #24]
	bl	b43_phy_read
	mov	r3, r0
	ldr	r2, .L44+4
	mov	r0, r5
	ldr	r1, [r2]
	str	r3, [sp, #28]
	bl	b43_phy_read
	mov	r3, r0
	ldr	r2, .L44+16
	mov	r0, r5
	ldr	r1, [r2]
	str	r3, [sp, #32]
	bl	b43_phy_read
	mov	r3, r0
	ldr	r2, .L44+20
	mov	r0, r5
	ldr	r1, [r2]
	str	r3, [sp, #36]
	bl	b43_phy_read
	mov	r3, r0
	ldr	r4, .L44+24
	mov	r0, r5
	ldr	r1, [r4]
	str	r3, [sp, #40]
	bl	b43_phy_read
	mov	r3, r0
	ldr	r6, .L44+28
	mov	r0, r5
	ldr	r1, [r6]
	str	r3, [sp, #44]
	bl	b43_phy_read
	mov	r3, r0
	mov	r0, r5
	str	r3, [sp, #48]
	bl	lpphy_read_tx_pctl_mode_from_hardware
	ldr	r3, .L44+32
	mov	r0, r5
	ldr	r1, [r3]
	ldr	r3, [sp, #8]
	ldr	r3, [r3]
	str	r3, [sp, #16]
	bl	lpphy_set_tx_power_control
	mov	r1, #1
	mov	r0, r5
	bl	lpphy_disable_crs
	mov	r0, r5
	bl	lpphy_loopback
	cmn	r0, #1
	mov	r1, r0
	beq	.L5
	mov	r10, #0
	mov	r0, r5
	bl	lpphy_set_rx_gain_by_index
	mov	r3, #64
	ldr	r2, .L44+36
	ldr	r1, [r6]
	mov	r0, r5
	bl	b43_phy_maskset
	mov	r3, #1
	ldr	r2, .L44+40
	ldr	r1, [r4]
	mov	r0, r5
	bl	b43_phy_maskset
	mov	r3, #8
	ldr	r2, .L44+44
	ldr	r1, [r4]
	mov	r0, r5
	bl	b43_phy_maskset
	mov	r3, #192
	mov	r0, r5
	ldr	r2, .L44+48
	ldr	r1, [r4]
	mov	r7, r10
	bl	b43_phy_maskset
	mov	r9, #128
.L10:
	ldr	r3, .L44+52
	mov	r2, r9
	mov	r0, r5
	ldr	r1, [r3]
	bl	b43_radio_write
	mov	r6, #0
	mov	r4, #5
	ldr	r8, .L44+56
	b	.L9
.L40:
	ldr	r2, [sp, #64]
	ldr	r0, [sp, #60]
	ldr	r3, [r8, #4]!
	cmp	r4, #5
	addeq	r7, r0, r2
	asr	r3, r3, #3
	add	r3, r3, #1
	add	r0, r0, r2
	mov	r1, r7
	mov	r2, #12
	asr	fp, r3, #1
	bl	lpphy_qdiv_roundup
	sub	r0, fp, r0
	mla	r6, r0, r0, r6
	cmp	r6, r10
	movge	r3, #0
	movlt	r3, #1
	cmp	r9, #128
	orreq	r3, r3, #1
	cmp	r3, #0
	ldrne	r3, [sp, #8]
	add	r4, r4, #1
	movne	r10, r6
	strne	r9, [r3, #4]
	cmp	r4, #26
	beq	.L39
.L9:
	mov	r2, #1
	mov	r3, #0
	mov	r1, r2
	str	r3, [sp, #4]
	mov	r0, r5
	mov	r3, r4
	str	r4, [sp]
	bl	lpphy_run_ddfs
	mov	r2, #32
	mov	r1, #1000
	mov	r0, r5
	add	r3, sp, #60
	bl	lpphy_rx_iq_est
	cmp	r0, #0
	bne	.L40
.L5:
	mov	r1, #1
	mov	r0, r5
	bl	lpphy_restore_crs
	ldr	r3, .L44+12
	ldr	r2, [sp, #28]
	ldr	r1, [r3]
	mov	r0, r5
	bl	b43_phy_write
	ldr	r3, .L44+8
	ldr	r2, [sp, #24]
	ldr	r1, [r3]
	mov	r0, r5
	bl	b43_phy_write
	ldr	r3, .L44+16
	ldr	r2, [sp, #36]
	ldr	r1, [r3]
	mov	r0, r5
	bl	b43_phy_write
	ldr	r3, .L44+4
	ldr	r2, [sp, #32]
	ldr	r1, [r3]
	mov	r0, r5
	bl	b43_phy_write
	ldr	r3, .L44+24
	ldr	r2, [sp, #44]
	ldr	r1, [r3]
	mov	r0, r5
	bl	b43_phy_write
	ldr	r3, .L44+20
	ldr	r2, [sp, #40]
	ldr	r1, [r3]
	mov	r0, r5
	bl	b43_phy_write
	ldr	r3, .L44+28
	ldr	r2, [sp, #48]
	ldr	r1, [r3]
	mov	r0, r5
	bl	b43_phy_write
	mov	r0, r5
	ldr	r1, [sp, #20]
	bl	lpphy_set_bb_mult
	ldr	r3, [sp, #12]
	cmp	r3, #0
	bne	.L41
.L11:
	mov	r0, r5
	ldr	r1, [sp, #16]
	bl	lpphy_set_tx_power_control
	ldr	r3, [sp, #8]
	ldr	r3, [r3, #4]
	cmp	r3, #0
	bne	.L42
.L1:
	ldr	r3, .L44
	ldr	r2, [r3]
	ldr	r3, [sp, #68]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L43
	add	sp, sp, #76
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L39:
	add	r9, r9, #1
	cmp	r9, #160
	bne	.L10
	mov	r0, r5
	bl	lpphy_stop_ddfs
	b	.L5
.L42:
	mov	r0, r5
	bl	lpphy_set_rc_cap
	b	.L1
.L41:
	mov	r0, r5
	ldr	r1, [sp, #52]
	bl	lpphy_set_tx_gains
	b	.L11
.L38:
	mov	r0, r5
	bl	lpphy_get_tx_gains
	str	r0, [sp, #52]
	b	.L3
.L37:
	ldr	r1, .L44+60
	ldr	r0, [r5]
	bl	b43dbg
	b	.L2
.L43:
	bl	__stack_chk_fail
.L45:
	.align	2
.L44:
	.word	.LC1
	.word	B43_LPPHY_AFE_CTL_OVR
	.word	B43_LPPHY_RF_OVERRIDE_0
	.word	B43_LPPHY_RF_OVERRIDE_VAL_0
	.word	B43_LPPHY_AFE_CTL_OVRVAL
	.word	B43_LPPHY_RF_OVERRIDE_2
	.word	B43_LPPHY_RF_OVERRIDE_2_VAL
	.word	B43_LPPHY_LP_PHY_CTL
	.word	B43_LPPHY_TXPCTL_OFF
	.word	65471
	.word	65528
	.word	65479
	.word	65343
	.word	B2062_N_RXBB_CALIB2
	.word	.LANCHOR0-4
	.word	.LC0
	.size	lpphy_rev0_1_rc_calib, .-lpphy_rev0_1_rc_calib
	.comm	B43_LPPHY_TXPCTL_OFF,4,4
	.comm	B43_LPPHY_RF_OVERRIDE_VAL_0,4,4
	.comm	B43_LPPHY_RF_OVERRIDE_2_VAL,4,4
	.comm	B43_LPPHY_RF_OVERRIDE_2,4,4
	.comm	B43_LPPHY_RF_OVERRIDE_0,4,4
	.comm	B43_LPPHY_LP_PHY_CTL,4,4
	.comm	B43_LPPHY_AFE_CTL_OVRVAL,4,4
	.comm	B43_LPPHY_AFE_CTL_OVR,4,4
	.comm	B2062_N_RXBB_CALIB2,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	ideal_pwr_table.4308, %object
	.size	ideal_pwr_table.4308, 84
ideal_pwr_table.4308:
	.word	65536
	.word	66903
	.word	69165
	.word	70624
	.word	69410
	.word	65380
	.word	60834
	.word	58836
	.word	61393
	.word	64488
	.word	47032
	.word	19253
	.word	6750
	.word	2571
	.word	1092
	.word	509
	.word	255
	.word	136
	.word	76
	.word	44
	.word	26
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
