	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wlc_lcnphy_set_tx_pwr_ctrl     ## -- Begin function wlc_lcnphy_set_tx_pwr_ctrl
	.p2align	4, 0x90
_wlc_lcnphy_set_tx_pwr_ctrl:            ## @wlc_lcnphy_set_tx_pwr_ctrl
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_wlc_lcnphy_get_tx_pwr_ctrl
	movq	%rax, %r15
	movq	(%rbx), %r12
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_wlc_lcnphy_set_tx_pwr_ctrl_mode
	movq	%rax, %r14
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_wlc_lcnphy_set_tx_pwr_ctrl_mode
	movq	%rax, %r15
	movq	_LCNPHY_TX_PWR_CTRL_HW@GOTPCREL(%rip), %r13
	xorl	%ecx, %ecx
	cmpq	%r14, (%r13)
	sete	%cl
	shlq	$6, %rcx
	movq	%rbx, %rdi
	movl	$1754, %esi                     ## imm = 0x6DA
	movl	$64, %edx
	callq	_mod_phy_reg
	xorl	%ecx, %ecx
	cmpq	%r14, (%r13)
	setne	%cl
	shlq	$4, %rcx
	movq	%rbx, %rdi
	movl	$1699, %esi                     ## imm = 0x6A3
	movl	$16, %edx
	callq	_mod_phy_reg
	cmpq	%r14, %r15
	je	LBB0_8
## %bb.1:
	movq	(%r13), %rax
	cmpq	%r15, %rax
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_tx_pwr_update_npt
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_clear_tx_power_offsets
	movq	(%r13), %rax
LBB0_3:
	movq	%rbx, %rdi
	cmpq	%r14, %rax
	jne	LBB0_5
## %bb.4:
	callq	_wlc_lcnphy_txpower_recalc_target
	movl	24(%r12), %esi
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_set_start_tx_pwr_idx
	movl	20(%r12), %esi
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_set_tx_pwr_npt
	movq	_RADIO_2064_REG11F@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$4, %edx
	xorl	%ecx, %ecx
	callq	_mod_radio_reg
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_total_tx_frames
	movl	%eax, 16(%r12)
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_disable_tx_gain_override
	movl	$-1, (%r12)
	jmp	LBB0_6
LBB0_5:
	callq	_wlc_lcnphy_enable_tx_gain_override
LBB0_6:
	movq	%rbx, %rdi
	movl	$1188, %esi                     ## imm = 0x4A4
	movl	$57344, %edx                    ## imm = 0xE000
	movq	%r14, %rcx
	callq	_mod_phy_reg
	movq	_LCNPHY_TX_PWR_CTRL_TEMPBASED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_wlc_lcnphy_tempcompensated_txpwrctrl
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_wlc_lcnphy_set_tx_pwr_soft_ctrl
	movq	%rbx, %rdi
	movl	$1193, %esi                     ## imm = 0x4A9
	callq	_read_phy_reg
                                        ## kill: def $eax killed $eax def $rax
	shrl	%eax
	andl	$127, %eax
	movq	%rax, 8(%r12)
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LCNPHY_TX_PWR_CTRL_HW,8,3      ## @LCNPHY_TX_PWR_CTRL_HW
	.comm	_RADIO_2064_REG11F,4,2          ## @RADIO_2064_REG11F
	.comm	_LCNPHY_TX_PWR_CTRL_TEMPBASED,8,3 ## @LCNPHY_TX_PWR_CTRL_TEMPBASED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wlc_lcnphy_set_tx_pwr_ctrl     ; -- Begin function wlc_lcnphy_set_tx_pwr_ctrl
	.p2align	2
_wlc_lcnphy_set_tx_pwr_ctrl:            ; @wlc_lcnphy_set_tx_pwr_ctrl
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_wlc_lcnphy_get_tx_pwr_ctrl
	mov	x21, x0
	ldr	x22, [x19]
	mov	x0, x19
	mov	x1, x20
	bl	_wlc_lcnphy_set_tx_pwr_ctrl_mode
	mov	x20, x0
	mov	x0, x19
	mov	x1, x21
	bl	_wlc_lcnphy_set_tx_pwr_ctrl_mode
	mov	x21, x0
Lloh0:
	adrp	x23, _LCNPHY_TX_PWR_CTRL_HW@GOTPAGE
Lloh1:
	ldr	x23, [x23, _LCNPHY_TX_PWR_CTRL_HW@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x8, x20
	cset	w8, eq
	lsl	x3, x8, #6
	mov	x0, x19
	mov	w1, #1754
	mov	w2, #64
	bl	_mod_phy_reg
	ldr	x8, [x23]
	cmp	x8, x20
	cset	w8, ne
	lsl	x3, x8, #4
	mov	x0, x19
	mov	w1, #1699
	mov	w2, #16
	bl	_mod_phy_reg
	cmp	x21, x20
	b.eq	LBB0_8
; %bb.1:
	ldr	x8, [x23]
	cmp	x8, x21
	b.ne	LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_wlc_lcnphy_tx_pwr_update_npt
	mov	x0, x19
	bl	_wlc_lcnphy_clear_tx_power_offsets
	ldr	x8, [x23]
LBB0_3:
	mov	x0, x19
	cmp	x8, x20
	b.ne	LBB0_5
; %bb.4:
	bl	_wlc_lcnphy_txpower_recalc_target
	ldr	w1, [x22, #24]
	mov	x0, x19
	bl	_wlc_lcnphy_set_start_tx_pwr_idx
	ldr	w1, [x22, #20]
	mov	x0, x19
	bl	_wlc_lcnphy_set_tx_pwr_npt
Lloh2:
	adrp	x8, _RADIO_2064_REG11F@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RADIO_2064_REG11F@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #4
	mov	w3, #0
	bl	_mod_radio_reg
	mov	x0, x19
	bl	_wlc_lcnphy_total_tx_frames
	str	w0, [x22, #16]
	mov	x0, x19
	bl	_wlc_lcnphy_disable_tx_gain_override
	mov	w8, #-1
	str	w8, [x22]
	b	LBB0_6
LBB0_5:
	bl	_wlc_lcnphy_enable_tx_gain_override
LBB0_6:
	mov	x0, x19
	mov	w1, #1188
	mov	w2, #57344
	mov	x3, x20
	bl	_mod_phy_reg
Lloh5:
	adrp	x8, _LCNPHY_TX_PWR_CTRL_TEMPBASED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LCNPHY_TX_PWR_CTRL_TEMPBASED@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x20, x8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_wlc_lcnphy_tempcompensated_txpwrctrl
	mov	x1, x0
	mov	x0, x19
	bl	_wlc_lcnphy_set_tx_pwr_soft_ctrl
	mov	x0, x19
	mov	w1, #1193
	bl	_read_phy_reg
	ubfx	w8, w0, #1, #7
	str	x8, [x22, #8]
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_LCNPHY_TX_PWR_CTRL_HW,8,3      ; @LCNPHY_TX_PWR_CTRL_HW
	.comm	_RADIO_2064_REG11F,4,2          ; @RADIO_2064_REG11F
	.comm	_LCNPHY_TX_PWR_CTRL_TEMPBASED,8,3 ; @LCNPHY_TX_PWR_CTRL_TEMPBASED
.subsections_via_symbols
