	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function wlc_lcnphy_set_tx_pwr_by_index
LCPI0_0:
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	7                               ## 0x7
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_wlc_lcnphy_set_tx_pwr_by_index
	.p2align	4, 0x90
_wlc_lcnphy_set_tx_pwr_by_index:        ## @wlc_lcnphy_set_tx_pwr_by_index
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movslq	%esi, %r15
	movq	%r15, 8(%rax)
	movq	%r15, (%rax)
	movq	_LCNPHY_TBL_ID_TXPWRCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movabsq	$4294967328, %rax               ## imm = 0x100000020
	movq	%rax, -72(%rbp)
	movq	_LCNPHY_TX_PWR_CTRL_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_wlc_lcnphy_set_tx_pwr_ctrl
	movq	_LCNPHY_TX_PWR_CTRL_IQ_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%r15, %rax
	movq	%rax, -56(%rbp)
	leaq	-28(%rbp), %rax
	movq	%rax, -64(%rbp)
	leaq	-72(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_wlc_lcnphy_read_table
	movq	_LCNPHY_TX_PWR_CTRL_GAIN_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%r15, %rax
	movq	%rax, -56(%rbp)
	movl	$32, -72(%rbp)
	leaq	-32(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_wlc_lcnphy_read_table
	movl	-32(%rbp), %eax
	movl	%eax, %ecx
	shrl	$8, %ecx
	movl	-28(%rbp), %edx
	shrl	$28, %edx
	movd	%eax, %xmm0
	shrl	$16, %eax
	pinsrd	$1, %ecx, %xmm0
	pinsrd	$2, %eax, %xmm0
	pinsrd	$3, %edx, %xmm0
	pand	LCPI0_0(%rip), %xmm0
	movdqa	%xmm0, -96(%rbp)
	leaq	-96(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_set_tx_gain
	movzbl	-29(%rbp), %esi
	andl	$127, %esi
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_set_pa_gain
	movl	-28(%rbp), %eax
	shrl	$20, %eax
	movzbl	%al, %esi
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_set_bbmult
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_enable_tx_gain_override
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_tempsense_based_pwr_ctrl_enabled
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	-28(%rbp), %edx
	movl	%edx, %esi
	shrl	$10, %esi
	andl	$1023, %esi                     ## imm = 0x3FF
	andl	$1023, %edx                     ## imm = 0x3FF
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_set_tx_iqcc
	movq	_LCNPHY_TX_PWR_CTRL_LO_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%r15, %rax
	movq	%rax, -56(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, -64(%rbp)
	leaq	-72(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_wlc_lcnphy_read_table
	movl	-40(%rbp), %esi
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_set_tx_locc
	movq	_LCNPHY_TX_PWR_CTRL_PWR_OFFSET@GOTPCREL(%rip), %rax
	addq	(%rax), %r15
	movq	%r15, -56(%rbp)
	leaq	-36(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_wlc_lcnphy_read_table
	movl	-36(%rbp), %ecx
	shll	$3, %ecx
	movq	%rbx, %rdi
	movl	$1702, %esi                     ## imm = 0x6A6
	movl	$8191, %edx                     ## imm = 0x1FFF
	callq	_mod_phy_reg
LBB0_2:
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LCNPHY_TBL_ID_TXPWRCTL,4,2     ## @LCNPHY_TBL_ID_TXPWRCTL
	.comm	_LCNPHY_TX_PWR_CTRL_OFF,4,2     ## @LCNPHY_TX_PWR_CTRL_OFF
	.comm	_LCNPHY_TX_PWR_CTRL_IQ_OFFSET,8,3 ## @LCNPHY_TX_PWR_CTRL_IQ_OFFSET
	.comm	_LCNPHY_TX_PWR_CTRL_GAIN_OFFSET,8,3 ## @LCNPHY_TX_PWR_CTRL_GAIN_OFFSET
	.comm	_LCNPHY_TX_PWR_CTRL_LO_OFFSET,8,3 ## @LCNPHY_TX_PWR_CTRL_LO_OFFSET
	.comm	_LCNPHY_TX_PWR_CTRL_PWR_OFFSET,8,3 ## @LCNPHY_TX_PWR_CTRL_PWR_OFFSET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function wlc_lcnphy_set_tx_pwr_by_index
lCPI0_0:
	.long	32                              ; 0x20
	.long	1                               ; 0x1
lCPI0_1:
	.long	4294967288                      ; 0xfffffff8
	.long	4294967280                      ; 0xfffffff0
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_wlc_lcnphy_set_tx_pwr_by_index
	.p2align	2
_wlc_lcnphy_set_tx_pwr_by_index:        ; @wlc_lcnphy_set_tx_pwr_by_index
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x19, x0
	ldr	x8, [x0]
	sxtw	x20, w1
	stp	x20, x20, [x8]
Lloh0:
	adrp	x8, _LCNPHY_TBL_ID_TXPWRCTL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LCNPHY_TBL_ID_TXPWRCTL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #56]
Lloh3:
	adrp	x8, lCPI0_0@PAGE
Lloh4:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #32]
Lloh5:
	adrp	x8, _LCNPHY_TX_PWR_CTRL_OFF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LCNPHY_TX_PWR_CTRL_OFF@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_wlc_lcnphy_set_tx_pwr_ctrl
Lloh8:
	adrp	x8, _LCNPHY_TX_PWR_CTRL_IQ_OFFSET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LCNPHY_TX_PWR_CTRL_IQ_OFFSET@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	add	x8, x8, x20
	add	x9, sp, #28
	stp	x9, x8, [sp, #40]
	add	x1, sp, #32
	mov	x0, x19
	bl	_wlc_lcnphy_read_table
Lloh11:
	adrp	x8, _LCNPHY_TX_PWR_CTRL_GAIN_OFFSET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LCNPHY_TX_PWR_CTRL_GAIN_OFFSET@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	add	x8, x8, x20
	mov	w9, #32
	str	w9, [sp, #32]
	add	x9, sp, #24
	stp	x9, x8, [sp, #40]
	add	x1, sp, #32
	mov	x0, x19
	bl	_wlc_lcnphy_read_table
	ldr	w8, [sp, #24]
	and	w9, w8, #0xff
	str	w9, [sp]
	dup.2s	v0, w8
Lloh14:
	adrp	x8, lCPI0_1@PAGE
Lloh15:
	ldr	d1, [x8, lCPI0_1@PAGEOFF]
	ushl.2s	v0, v0, v1
	movi	d1, #0x0000ff000000ff
	and.8b	v0, v0, v1
	stur	d0, [sp, #4]
	ldr	w8, [sp, #28]
	ubfx	w8, w8, #28, #3
	str	w8, [sp, #12]
	mov	x1, sp
	mov	x0, x19
	bl	_wlc_lcnphy_set_tx_gain
	ldrb	w8, [sp, #27]
	and	w1, w8, #0x7f
	mov	x0, x19
	bl	_wlc_lcnphy_set_pa_gain
	ldr	w8, [sp, #28]
	ubfx	x1, x8, #20, #8
	mov	x0, x19
	bl	_wlc_lcnphy_set_bbmult
	mov	x0, x19
	bl	_wlc_lcnphy_enable_tx_gain_override
	mov	x0, x19
	bl	_wlc_lcnphy_tempsense_based_pwr_ctrl_enabled
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w8, [sp, #28]
	ubfx	w1, w8, #10, #10
	and	w2, w8, #0x3ff
	mov	x0, x19
	bl	_wlc_lcnphy_set_tx_iqcc
Lloh16:
	adrp	x8, _LCNPHY_TX_PWR_CTRL_LO_OFFSET@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LCNPHY_TX_PWR_CTRL_LO_OFFSET@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	add	x8, x8, x20
	add	x9, sp, #20
	stp	x9, x8, [sp, #40]
	add	x1, sp, #32
	mov	x0, x19
	bl	_wlc_lcnphy_read_table
	ldr	w1, [sp, #20]
	mov	x0, x19
	bl	_wlc_lcnphy_set_tx_locc
Lloh19:
	adrp	x8, _LCNPHY_TX_PWR_CTRL_PWR_OFFSET@GOTPAGE
Lloh20:
	ldr	x8, [x8, _LCNPHY_TX_PWR_CTRL_PWR_OFFSET@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	add	x8, x8, x20
	add	x9, sp, #16
	stp	x9, x8, [sp, #40]
	add	x1, sp, #32
	mov	x0, x19
	bl	_wlc_lcnphy_read_table
	ldr	w8, [sp, #16]
	lsl	w3, w8, #3
	mov	x0, x19
	mov	w1, #1702
	mov	w2, #8191
	bl	_mod_phy_reg
LBB0_2:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdr	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdrp	Lloh3, Lloh5
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_LCNPHY_TBL_ID_TXPWRCTL,4,2     ; @LCNPHY_TBL_ID_TXPWRCTL
	.comm	_LCNPHY_TX_PWR_CTRL_OFF,4,2     ; @LCNPHY_TX_PWR_CTRL_OFF
	.comm	_LCNPHY_TX_PWR_CTRL_IQ_OFFSET,8,3 ; @LCNPHY_TX_PWR_CTRL_IQ_OFFSET
	.comm	_LCNPHY_TX_PWR_CTRL_GAIN_OFFSET,8,3 ; @LCNPHY_TX_PWR_CTRL_GAIN_OFFSET
	.comm	_LCNPHY_TX_PWR_CTRL_LO_OFFSET,8,3 ; @LCNPHY_TX_PWR_CTRL_LO_OFFSET
	.comm	_LCNPHY_TX_PWR_CTRL_PWR_OFFSET,8,3 ; @LCNPHY_TX_PWR_CTRL_PWR_OFFSET
.subsections_via_symbols
