	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpphy_set_tx_power_by_index
_lpphy_set_tx_power_by_index:           ## @lpphy_set_tx_power_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	8(%rdi), %rbx
	movq	%rsi, 8(%rbx)
	callq	_lpphy_read_tx_pctl_mode_from_hardware
	movq	(%rbx), %rax
	movq	_B43_LPPHY_TXPCTL_OFF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	_B43_LPPHY_TXPCTL_SW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_lpphy_set_tx_power_control
LBB0_2:
	leaq	320(%r14), %rsi
	cmpl	$2, (%r12)
	jl	LBB0_4
## %bb.3:
	movl	$7, %edi
	callq	_B43_LPTAB32
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_b43_lptab_read
	movl	%eax, %r15d
	leaq	192(%r14), %rsi
	movl	$7, %edi
	callq	_B43_LPTAB32
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_b43_lptab_read
	movzbl	%al, %ecx
	movzbl	%ah, %edx
	shrl	$16, %eax
	movzbl	%al, %esi
	movl	%r15d, %eax
	sarl	$28, %eax
	movzbl	%al, %eax
	shlq	$32, %rax
	orq	%rax, %rdx
	shlq	$32, %rcx
	orq	%rcx, %rsi
	movq	%r12, %rdi
	callq	_lpphy_set_tx_gains
	jmp	LBB0_5
LBB0_4:
	movl	$10, %edi
	callq	_B43_LPTAB32
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_b43_lptab_read
	movl	%eax, %r15d
	leaq	192(%r14), %rsi
	movl	$10, %edi
	callq	_B43_LPTAB32
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_b43_lptab_read
	movl	%eax, %ebx
	movq	_B43_LPPHY_TX_GAIN_CTL_OVERRIDE_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %ecx
	shrl	$4, %ecx
	andl	$32767, %ecx                    ## imm = 0x7FFF
	movq	%r12, %rdi
	movl	$63488, %edx                    ## imm = 0xF800
	callq	_b43_phy_maskset
	movl	%ebx, %esi
	andl	$7, %esi
	movq	%r12, %rdi
	callq	_lpphy_set_dac_gain
	shrl	$24, %ebx
	andl	$127, %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_lpphy_set_pa_gain
LBB0_5:
	movl	%r15d, %eax
	shrl	$20, %eax
	movzbl	%al, %esi
	movq	%r12, %rdi
	callq	_lpphy_set_bb_mult
	movl	%r15d, %esi
	shrl	$10, %esi
	andl	$1023, %esi                     ## imm = 0x3FF
	andl	$1023, %r15d                    ## imm = 0x3FF
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_lpphy_set_tx_iqcc
	xorl	%eax, %eax
	cmpl	$2, (%r12)
	setl	%al
	leaq	448(%r14), %rsi
	leal	(%rax,%rax,2), %edi
	addl	$7, %edi
	callq	_B43_LPTAB32
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_b43_lptab_read
	movl	%eax, %ebx
	xorl	%edi, %edi
	movl	$85, %esi
	callq	_B43_LPTAB16
	movzwl	%bx, %edx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_b43_lptab_write
	cmpl	$2, (%r12)
	jl	LBB0_7
## %bb.6:
	addq	$576, %r14                      ## imm = 0x240
	movl	$7, %edi
	movq	%r14, %rsi
	callq	_B43_LPTAB32
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_b43_lptab_read
	movq	_B43_LPPHY_RF_PWR_OVERRIDE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movzwl	%ax, %ecx
	movq	%r12, %rdi
	movl	$65280, %edx                    ## imm = 0xFF00
	callq	_b43_phy_maskset
LBB0_7:
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_lpphy_enable_tx_gain_override  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_B43_LPPHY_TXPCTL_OFF,8,3       ## @B43_LPPHY_TXPCTL_OFF
	.comm	_B43_LPPHY_TXPCTL_SW,4,2        ## @B43_LPPHY_TXPCTL_SW
	.comm	_B43_LPPHY_TX_GAIN_CTL_OVERRIDE_VAL,4,2 ## @B43_LPPHY_TX_GAIN_CTL_OVERRIDE_VAL
	.comm	_B43_LPPHY_RF_PWR_OVERRIDE,4,2  ## @B43_LPPHY_RF_PWR_OVERRIDE
	.no_dead_strip	_lpphy_set_tx_power_by_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lpphy_set_tx_power_by_index
_lpphy_set_tx_power_by_index:           ; @lpphy_set_tx_power_by_index
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x21, [x0, #8]
	str	x1, [x21, #8]
	bl	_lpphy_read_tx_pctl_mode_from_hardware
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _B43_LPPHY_TXPCTL_OFF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _B43_LPPHY_TXPCTL_OFF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _B43_LPPHY_TXPCTL_SW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _B43_LPPHY_TXPCTL_SW@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_lpphy_set_tx_power_control
LBB0_2:
	ldr	w8, [x19]
	add	x1, x20, #320
	cmp	w8, #2
	b.lt	LBB0_4
; %bb.3:
	mov	w0, #7
	bl	_B43_LPTAB32
	mov	x1, x0
	mov	x0, x19
	bl	_b43_lptab_read
	mov	x21, x0
	add	x1, x20, #192
	mov	w0, #7
	bl	_B43_LPTAB32
	mov	x1, x0
	mov	x0, x19
	bl	_b43_lptab_read
	ubfx	w1, w0, #16, #8
	and	w8, w0, #0xff
	asr	w9, w21, #28
	ubfx	w2, w0, #8, #8
	and	w9, w9, #0xff
	bfi	x2, x9, #32, #8
	bfi	x1, x8, #32, #8
	mov	x0, x19
	bl	_lpphy_set_tx_gains
	b	LBB0_5
LBB0_4:
	mov	w0, #10
	bl	_B43_LPTAB32
	mov	x1, x0
	mov	x0, x19
	bl	_b43_lptab_read
	mov	x21, x0
	add	x1, x20, #192
	mov	w0, #10
	bl	_B43_LPTAB32
	mov	x1, x0
	mov	x0, x19
	bl	_b43_lptab_read
	mov	x22, x0
Lloh6:
	adrp	x8, _B43_LPPHY_TX_GAIN_CTL_OVERRIDE_VAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _B43_LPPHY_TX_GAIN_CTL_OVERRIDE_VAL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ubfx	w3, w0, #4, #15
	mov	x0, x19
	mov	w2, #63488
	bl	_b43_phy_maskset
	and	w1, w22, #0x7
	mov	x0, x19
	bl	_lpphy_set_dac_gain
	ubfx	w1, w22, #24, #7
	mov	x0, x19
	bl	_lpphy_set_pa_gain
LBB0_5:
	ubfx	w1, w21, #20, #8
	mov	x0, x19
	bl	_lpphy_set_bb_mult
	ubfx	w1, w21, #10, #10
	and	w2, w21, #0x3ff
	mov	x0, x19
	bl	_lpphy_set_tx_iqcc
	ldr	w8, [x19]
	add	x1, x20, #448
	mov	w9, #10
	mov	w10, #7
	cmp	w8, #1
	csel	w0, w10, w9, gt
	bl	_B43_LPTAB32
	mov	x1, x0
	mov	x0, x19
	bl	_b43_lptab_read
	mov	x21, x0
	mov	w0, #0
	mov	w1, #85
	bl	_B43_LPTAB16
	mov	x1, x0
	and	w2, w21, #0xffff
	mov	x0, x19
	bl	_b43_lptab_write
	ldr	w8, [x19]
	cmp	w8, #2
	b.lt	LBB0_7
; %bb.6:
	add	x1, x20, #576
	mov	w0, #7
	bl	_B43_LPTAB32
	mov	x1, x0
	mov	x0, x19
	bl	_b43_lptab_read
Lloh9:
	adrp	x8, _B43_LPPHY_RF_PWR_OVERRIDE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _B43_LPPHY_RF_PWR_OVERRIDE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	and	w3, w0, #0xffff
	mov	x0, x19
	mov	w2, #65280
	bl	_b43_phy_maskset
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_lpphy_enable_tx_gain_override
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_B43_LPPHY_TXPCTL_OFF,8,3       ; @B43_LPPHY_TXPCTL_OFF
	.comm	_B43_LPPHY_TXPCTL_SW,4,2        ; @B43_LPPHY_TXPCTL_SW
	.comm	_B43_LPPHY_TX_GAIN_CTL_OVERRIDE_VAL,4,2 ; @B43_LPPHY_TX_GAIN_CTL_OVERRIDE_VAL
	.comm	_B43_LPPHY_RF_PWR_OVERRIDE,4,2  ; @B43_LPPHY_RF_PWR_OVERRIDE
	.no_dead_strip	_lpphy_set_tx_power_by_index
.subsections_via_symbols
