	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wlc_lcnphy_txpower_recalc_target ## -- Begin function wlc_lcnphy_txpower_recalc_target
	.p2align	4, 0x90
_wlc_lcnphy_txpower_recalc_target:      ## @wlc_lcnphy_txpower_recalc_target
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	%rsp, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_BRCMS_NUM_RATES_CCK@GOTPCREL(%rip), %rcx
	movq	_BRCMS_NUM_RATES_OFDM@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	addl	(%rcx), %eax
	movq	_BRCMS_NUM_RATES_MCS_1_STREAM@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	%r14, %rdi
	callq	_wlc_lcnphy_tempsense_based_pwr_ctrl_enabled
	testq	%rax, %rax
	jne	LBB0_8
## %bb.1:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_6
## %bb.2:
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rax
	movslq	%r12d, %r12
	movq	(%rax,%r12,8), %rax
	xorl	%ecx, %ecx
	subq	%rax, %rcx
	movq	%rcx, (%rbx,%r15,8)
	incq	%r15
	incl	%r12d
	movq	%rbx, %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r15
	jge	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %eax
	movq	_BRCMS_NUM_RATES_CCK@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	cmpq	%rax, %r15
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_TXP_FIRST_MCS_20_SISO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_5
LBB0_6:
	movq	_LCNPHY_TBL_ID_TXPWRCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	$32, -88(%rbp)
	movq	%rbx, %rdi
	callq	_ARRAY_SIZE
	movl	%eax, -84(%rbp)
	movq	%rbx, -72(%rbp)
	movq	_LCNPHY_TX_PWR_CTRL_RATE_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	leaq	-88(%rbp), %rsi
	movq	%r14, %rdi
	callq	_wlc_lcnphy_write_table
	movq	%r14, %rdi
	callq	_wlc_lcnphy_get_target_tx_pwr
	movq	(%r14), %rsi
	cmpq	%rsi, %rax
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	callq	_wlc_lcnphy_set_target_tx_pwr
	movq	%r14, %rdi
	callq	_wlc_lcnphy_txpower_reset_npt
LBB0_8:
	movq	%r15, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BRCMS_NUM_RATES_CCK,4,2        ## @BRCMS_NUM_RATES_CCK
	.comm	_BRCMS_NUM_RATES_OFDM,4,2       ## @BRCMS_NUM_RATES_OFDM
	.comm	_BRCMS_NUM_RATES_MCS_1_STREAM,4,2 ## @BRCMS_NUM_RATES_MCS_1_STREAM
	.comm	_TXP_FIRST_MCS_20_SISO,4,2      ## @TXP_FIRST_MCS_20_SISO
	.comm	_LCNPHY_TBL_ID_TXPWRCTL,4,2     ## @LCNPHY_TBL_ID_TXPWRCTL
	.comm	_LCNPHY_TX_PWR_CTRL_RATE_OFFSET,4,2 ## @LCNPHY_TX_PWR_CTRL_RATE_OFFSET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wlc_lcnphy_txpower_recalc_target ; -- Begin function wlc_lcnphy_txpower_recalc_target
	.p2align	2
_wlc_lcnphy_txpower_recalc_target:      ; @wlc_lcnphy_txpower_recalc_target
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #48
	mov	x19, x0
	mov	x21, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x22, _BRCMS_NUM_RATES_CCK@GOTPAGE
Lloh4:
	ldr	x22, [x22, _BRCMS_NUM_RATES_CCK@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh5:
	adrp	x23, _BRCMS_NUM_RATES_OFDM@GOTPAGE
Lloh6:
	ldr	x23, [x23, _BRCMS_NUM_RATES_OFDM@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh7:
	adrp	x10, _BRCMS_NUM_RATES_MCS_1_STREAM@GOTPAGE
Lloh8:
	ldr	x10, [x10, _BRCMS_NUM_RATES_MCS_1_STREAM@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	add	w8, w9, w8
	add	w8, w8, w10
	lsl	x9, x8, #3
	add	x8, x9, #15
	and	x8, x8, #0xffffffff0
Lloh10:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh11:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x20, x9, x8
	mov	sp, x20
	bl	_wlc_lcnphy_tempsense_based_pwr_ctrl_enabled
	cbnz	x0, LBB0_6
; %bb.1:
	mov	x0, x20
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x24, #0
	mov	w26, #0
Lloh12:
	adrp	x25, _TXP_FIRST_MCS_20_SISO@GOTPAGE
Lloh13:
	ldr	x25, [x25, _TXP_FIRST_MCS_20_SISO@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	ldr	w9, [x23]
	ldr	w10, [x25]
	add	w8, w9, w8
	cmp	x24, x8
	csel	w8, w10, w26, eq
	ldr	x9, [x19, #8]
	ldr	x9, [x9, w8, sxtw #3]
	neg	x9, x9
	str	x9, [x20, x24, lsl #3]
	add	x24, x24, #1
	add	w26, w8, #1
	mov	x0, x20
	bl	_ARRAY_SIZE
	cmp	x24, w0, sxtw
	b.lt	LBB0_3
LBB0_4:
Lloh14:
	adrp	x8, _LCNPHY_TBL_ID_TXPWRCTL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LCNPHY_TBL_ID_TXPWRCTL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	mov	w9, #32
	stur	w8, [x29, #-80]
	stur	w9, [x29, #-104]
	mov	x0, x20
	bl	_ARRAY_SIZE
	stur	x20, [x29, #-88]
Lloh17:
	adrp	x8, _LCNPHY_TX_PWR_CTRL_RATE_OFFSET@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LCNPHY_TX_PWR_CTRL_RATE_OFFSET@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	stp	w0, w8, [x29, #-100]
	sub	x1, x29, #104
	mov	x0, x19
	bl	_wlc_lcnphy_write_table
	mov	x0, x19
	bl	_wlc_lcnphy_get_target_tx_pwr
	ldr	x1, [x19]
	cmp	x0, x1
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_wlc_lcnphy_set_target_tx_pwr
	mov	x0, x19
	bl	_wlc_lcnphy_txpower_reset_npt
LBB0_6:
	mov	sp, x21
	ldur	x8, [x29, #-72]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_BRCMS_NUM_RATES_CCK,4,2        ; @BRCMS_NUM_RATES_CCK
	.comm	_BRCMS_NUM_RATES_OFDM,4,2       ; @BRCMS_NUM_RATES_OFDM
	.comm	_BRCMS_NUM_RATES_MCS_1_STREAM,4,2 ; @BRCMS_NUM_RATES_MCS_1_STREAM
	.comm	_TXP_FIRST_MCS_20_SISO,4,2      ; @TXP_FIRST_MCS_20_SISO
	.comm	_LCNPHY_TBL_ID_TXPWRCTL,4,2     ; @LCNPHY_TBL_ID_TXPWRCTL
	.comm	_LCNPHY_TX_PWR_CTRL_RATE_OFFSET,4,2 ; @LCNPHY_TX_PWR_CTRL_RATE_OFFSET
.subsections_via_symbols
