	.file	"extr_phy_lcn.c_wlc_lcnphy_set_tx_pwr_by_index.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	wlc_lcnphy_set_tx_pwr_by_index
	.type	wlc_lcnphy_set_tx_pwr_by_index, @function
wlc_lcnphy_set_tx_pwr_by_index:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movsx	rbx, esi
	sub	rsp, 80
	.cfi_def_cfa_offset 112
	mov	esi, DWORD PTR LCNPHY_TX_PWR_CTRL_OFF[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR [rdi]
	lea	r12, 32[rsp]
	mov	QWORD PTR [rax], rbx
	mov	QWORD PTR 8[rax], rbx
	mov	eax, DWORD PTR LCNPHY_TBL_ID_TXPWRCTL[rip]
	mov	DWORD PTR 56[rsp], eax
	movabs	rax, 4294967328
	mov	QWORD PTR 32[rsp], rax
	call	wlc_lcnphy_set_tx_pwr_ctrl@PLT
	mov	rax, QWORD PTR LCNPHY_TX_PWR_CTRL_IQ_OFFSET[rip]
	mov	rsi, r12
	mov	rdi, rbp
	add	rax, rbx
	mov	QWORD PTR 48[rsp], rax
	mov	rax, rsp
	mov	QWORD PTR 40[rsp], rax
	call	wlc_lcnphy_read_table@PLT
	mov	rax, QWORD PTR LCNPHY_TX_PWR_CTRL_GAIN_OFFSET[rip]
	mov	rsi, r12
	mov	rdi, rbp
	mov	DWORD PTR 32[rsp], 32
	add	rax, rbx
	mov	QWORD PTR 48[rsp], rax
	lea	rax, 4[rsp]
	mov	QWORD PTR 40[rsp], rax
	call	wlc_lcnphy_read_table@PLT
	mov	eax, DWORD PTR 4[rsp]
	lea	rsi, 16[rsp]
	mov	rdi, rbp
	movzx	edx, al
	mov	DWORD PTR 16[rsp], edx
	movzx	edx, ah
	sar	eax, 16
	and	eax, 255
	mov	DWORD PTR 20[rsp], edx
	mov	DWORD PTR 24[rsp], eax
	mov	eax, DWORD PTR [rsp]
	sar	eax, 28
	and	eax, 7
	mov	DWORD PTR 28[rsp], eax
	call	wlc_lcnphy_set_tx_gain@PLT
	movsx	esi, BYTE PTR 7[rsp]
	mov	rdi, rbp
	and	esi, 127
	call	wlc_lcnphy_set_pa_gain@PLT
	mov	esi, DWORD PTR [rsp]
	mov	rdi, rbp
	sar	esi, 20
	movzx	esi, sil
	call	wlc_lcnphy_set_bbmult@PLT
	mov	rdi, rbp
	call	wlc_lcnphy_enable_tx_gain_override@PLT
	mov	rdi, rbp
	call	wlc_lcnphy_tempsense_based_pwr_ctrl_enabled@PLT
	test	eax, eax
	je	.L6
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L7
	add	rsp, 80
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	esi, DWORD PTR [rsp]
	mov	rdi, rbp
	mov	edx, esi
	sar	esi, 10
	and	edx, 1023
	and	esi, 1023
	call	wlc_lcnphy_set_tx_iqcc@PLT
	mov	rax, QWORD PTR LCNPHY_TX_PWR_CTRL_LO_OFFSET[rip]
	mov	rsi, r12
	mov	rdi, rbp
	add	rax, rbx
	mov	QWORD PTR 48[rsp], rax
	lea	rax, 8[rsp]
	mov	QWORD PTR 40[rsp], rax
	call	wlc_lcnphy_read_table@PLT
	mov	esi, DWORD PTR 8[rsp]
	mov	rdi, rbp
	call	wlc_lcnphy_set_tx_locc@PLT
	lea	rax, 12[rsp]
	mov	rsi, r12
	mov	rdi, rbp
	add	rbx, QWORD PTR LCNPHY_TX_PWR_CTRL_PWR_OFFSET[rip]
	mov	QWORD PTR 40[rsp], rax
	mov	QWORD PTR 48[rsp], rbx
	call	wlc_lcnphy_read_table@PLT
	mov	eax, DWORD PTR 12[rsp]
	mov	edx, 8191
	mov	rdi, rbp
	mov	esi, 1702
	lea	ecx, 0[0+rax*8]
	call	mod_phy_reg@PLT
	jmp	.L1
.L7:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	wlc_lcnphy_set_tx_pwr_by_index, .-wlc_lcnphy_set_tx_pwr_by_index
	.comm	LCNPHY_TX_PWR_CTRL_PWR_OFFSET,8,8
	.comm	LCNPHY_TX_PWR_CTRL_OFF,4,4
	.comm	LCNPHY_TX_PWR_CTRL_LO_OFFSET,8,8
	.comm	LCNPHY_TX_PWR_CTRL_IQ_OFFSET,8,8
	.comm	LCNPHY_TX_PWR_CTRL_GAIN_OFFSET,8,8
	.comm	LCNPHY_TBL_ID_TXPWRCTL,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_lcn.c_wlc_lcnphy_set_tx_pwr_by_index.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	wlc_lcnphy_set_tx_pwr_by_index
	.syntax unified
	.arm
	.fpu softvfp
	.type	wlc_lcnphy_set_tx_pwr_by_index, %function
wlc_lcnphy_set_tx_pwr_by_index:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r5, r1
	mov	r6, #32
	mov	r2, #1
	mov	r4, r0
	ldr	ip, .L8
	ldr	lr, .L8+4
	ldr	r3, [r0]
	ldr	r1, .L8+8
	sub	sp, sp, #60
	ldr	ip, [ip]
	ldr	lr, [lr]
	str	lr, [sp, #52]
	mov	lr,#0
	ldr	r1, [r1]
	str	r5, [r3]
	str	r5, [r3, #4]
	str	r6, [sp, #32]
	str	ip, [sp, #48]
	str	r2, [sp, #36]
	bl	wlc_lcnphy_set_tx_pwr_ctrl
	ldr	r3, .L8+12
	add	r1, sp, r6
	ldr	r3, [r3]
	mov	r0, r4
	add	r3, r3, r5
	str	r3, [sp, #44]
	str	sp, [sp, #40]
	bl	wlc_lcnphy_read_table
	ldr	r3, .L8+16
	add	r2, sp, #4
	ldr	r3, [r3]
	add	r1, sp, r6
	add	r3, r3, r5
	mov	r0, r4
	str	r3, [sp, #44]
	str	r2, [sp, #40]
	str	r6, [sp, #32]
	bl	wlc_lcnphy_read_table
	ldr	r2, [sp, #4]
	ldr	r3, [sp]
	asr	r1, r2, #8
	asr	ip, r2, #16
	and	r1, r1, #255
	asr	r3, r3, #28
	and	ip, ip, #255
	and	r2, r2, #255
	and	r3, r3, #7
	str	r1, [sp, #20]
	mov	r0, r4
	add	r1, sp, #16
	str	ip, [sp, #24]
	str	r2, [sp, #16]
	str	r3, [sp, #28]
	bl	wlc_lcnphy_set_tx_gain
	ldrsb	r1, [sp, #7]
	mov	r0, r4
	and	r1, r1, #127
	bl	wlc_lcnphy_set_pa_gain
	ldr	r1, [sp]
	mov	r0, r4
	asr	r1, r1, #20
	and	r1, r1, #255
	bl	wlc_lcnphy_set_bbmult
	mov	r0, r4
	bl	wlc_lcnphy_enable_tx_gain_override
	mov	r0, r4
	bl	wlc_lcnphy_tempsense_based_pwr_ctrl_enabled
	cmp	r0, #0
	beq	.L6
.L1:
	ldr	r3, .L8+4
	ldr	r2, [r3]
	ldr	r3, [sp, #52]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L7
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L6:
	ldr	r1, [sp]
	ldr	r3, .L8+20
	mov	r0, r4
	and	r2, r1, r3
	and	r1, r3, r1, asr #10
	bl	wlc_lcnphy_set_tx_iqcc
	ldr	r3, .L8+24
	add	r2, sp, #8
	ldr	r3, [r3]
	add	r1, sp, r6
	add	r3, r3, r5
	mov	r0, r4
	str	r3, [sp, #44]
	str	r2, [sp, #40]
	bl	wlc_lcnphy_read_table
	ldr	r1, [sp, #8]
	mov	r0, r4
	bl	wlc_lcnphy_set_tx_locc
	ldr	r3, .L8+28
	add	r2, sp, #12
	ldr	r3, [r3]
	add	r1, sp, r6
	add	r5, r3, r5
	mov	r0, r4
	str	r2, [sp, #40]
	str	r5, [sp, #44]
	bl	wlc_lcnphy_read_table
	ldr	r3, [sp, #12]
	mov	r0, r4
	ldr	r2, .L8+32
	ldr	r1, .L8+36
	lsl	r3, r3, #3
	bl	mod_phy_reg
	b	.L1
.L7:
	bl	__stack_chk_fail
.L9:
	.align	2
.L8:
	.word	LCNPHY_TBL_ID_TXPWRCTL
	.word	.LC0
	.word	LCNPHY_TX_PWR_CTRL_OFF
	.word	LCNPHY_TX_PWR_CTRL_IQ_OFFSET
	.word	LCNPHY_TX_PWR_CTRL_GAIN_OFFSET
	.word	1023
	.word	LCNPHY_TX_PWR_CTRL_LO_OFFSET
	.word	LCNPHY_TX_PWR_CTRL_PWR_OFFSET
	.word	8191
	.word	1702
	.size	wlc_lcnphy_set_tx_pwr_by_index, .-wlc_lcnphy_set_tx_pwr_by_index
	.comm	LCNPHY_TX_PWR_CTRL_PWR_OFFSET,4,4
	.comm	LCNPHY_TX_PWR_CTRL_OFF,4,4
	.comm	LCNPHY_TX_PWR_CTRL_LO_OFFSET,4,4
	.comm	LCNPHY_TX_PWR_CTRL_IQ_OFFSET,4,4
	.comm	LCNPHY_TX_PWR_CTRL_GAIN_OFFSET,4,4
	.comm	LCNPHY_TBL_ID_TXPWRCTL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
