	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wlc_phy_est_tonepwr_nphy       ## -- Begin function wlc_phy_est_tonepwr_nphy
	.p2align	4, 0x90
_wlc_phy_est_tonepwr_nphy:              ## @wlc_phy_est_tonepwr_nphy
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$489, %esi                      ## imm = 0x1E9
	callq	_read_phy_reg
	movl	%eax, %ecx
	andl	$63, %ecx
	xorl	%ebx, %ebx
	cmpl	$32, %ecx
	setb	%bl
	shll	$6, %ebx
	orl	%ecx, %ebx
	shrl	$8, %eax
	andl	$63, %eax
	xorl	%r12d, %r12d
	cmpl	$32, %eax
	setb	%r12b
	shll	$6, %r12d
	orl	%eax, %r12d
	movl	(%r15), %edi
	callq	_CHSPEC_IS5G
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	_NPHY_RSSI_SEL_TSSI_2G@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_NPHY_RSSI_SEL_TSSI_5G@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rax), %rsi
	leaq	-64(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r13, %rcx
	callq	_wlc_phy_poll_rssi_nphy
	movl	-64(%rbp), %eax
	movl	-56(%rbp), %ecx
	cltd
	idivl	%r13d
	movl	%eax, %esi
	movl	%ecx, %eax
	cltd
	idivl	%r13d
	subl	%esi, %ebx
	leal	-64(%rbx), %ecx
	subl	%eax, %r12d
	leal	-64(%r12), %eax
	testl	%ecx, %ecx
	movl	$63, %edx
	cmovnsl	%edx, %ebx
	xorl	%esi, %esi
	cmpl	$-64, %ecx
	cmovll	%esi, %ebx
	testl	%eax, %eax
	cmovnsl	%edx, %r12d
	cmpl	$-64, %eax
	cmovll	%esi, %r12d
	movq	_NPHY_TBL_ID_CORE1TXPWRCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	movl	%ebx, %ecx
	movl	$32, %r8d
	movq	%r14, %r9
	callq	_wlc_phy_table_read_nphy
	movq	_NPHY_TBL_ID_CORE2TXPWRCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addq	$4, %r14
	movq	%r15, %rdi
	movl	$1, %edx
	movl	%r12d, %ecx
	movl	$32, %r8d
	movq	%r14, %r9
	callq	_wlc_phy_table_read_nphy
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NPHY_RSSI_SEL_TSSI_5G,8,3      ## @NPHY_RSSI_SEL_TSSI_5G
	.comm	_NPHY_RSSI_SEL_TSSI_2G,8,3      ## @NPHY_RSSI_SEL_TSSI_2G
	.comm	_NPHY_TBL_ID_CORE1TXPWRCTL,4,2  ## @NPHY_TBL_ID_CORE1TXPWRCTL
	.comm	_NPHY_TBL_ID_CORE2TXPWRCTL,4,2  ## @NPHY_TBL_ID_CORE2TXPWRCTL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wlc_phy_est_tonepwr_nphy       ; -- Begin function wlc_phy_est_tonepwr_nphy
	.p2align	2
_wlc_phy_est_tonepwr_nphy:              ; @wlc_phy_est_tonepwr_nphy
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	mov	w1, #489
	bl	_read_phy_reg
	and	w8, w0, #0x3f
	mov	w9, #-64
	cmp	w8, #32
	csel	w22, wzr, w9, lo
	bfxil	w22, w0, #0, #6
	ubfx	w8, w0, #8, #6
	cmp	w8, #32
	csel	w23, wzr, w9, lo
	bfxil	w23, w0, #8, #6
	ldr	w0, [x19]
	bl	_CHSPEC_IS5G
Lloh3:
	adrp	x8, _NPHY_RSSI_SEL_TSSI_5G@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NPHY_RSSI_SEL_TSSI_5G@GOTPAGEOFF]
Lloh5:
	adrp	x9, _NPHY_RSSI_SEL_TSSI_2G@GOTPAGE
Lloh6:
	ldr	x9, [x9, _NPHY_RSSI_SEL_TSSI_2G@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	x1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	mov	x3, x21
	bl	_wlc_phy_poll_rssi_nphy
	ldr	w8, [sp, #8]
	ldr	w9, [sp, #16]
	sdiv	w8, w8, w21
	sub	w8, w22, w8
	sdiv	w9, w9, w21
	sub	w9, w23, w9
	add	w10, w9, #64
	add	w11, w8, #64
	mov	w12, #63
	cmp	w8, #0
	csel	w11, w12, w11, ge
	cmn	w8, #64
	csel	w3, wzr, w11, lt
	cmp	w9, #0
	csel	w8, w12, w10, ge
	cmn	w9, #64
	csel	w21, wzr, w8, lt
Lloh7:
	adrp	x8, _NPHY_TBL_ID_CORE1TXPWRCTL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NPHY_TBL_ID_CORE1TXPWRCTL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	mov	w4, #32
	mov	x5, x20
	bl	_wlc_phy_table_read_nphy
Lloh10:
	adrp	x8, _NPHY_TBL_ID_CORE2TXPWRCTL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NPHY_TBL_ID_CORE2TXPWRCTL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x5, x20, #4
	mov	x0, x19
	mov	w2, #1
	mov	x3, x21
	mov	w4, #32
	bl	_wlc_phy_table_read_nphy
	ldr	x8, [sp, #24]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NPHY_RSSI_SEL_TSSI_5G,8,3      ; @NPHY_RSSI_SEL_TSSI_5G
	.comm	_NPHY_RSSI_SEL_TSSI_2G,8,3      ; @NPHY_RSSI_SEL_TSSI_2G
	.comm	_NPHY_TBL_ID_CORE1TXPWRCTL,4,2  ; @NPHY_TBL_ID_CORE1TXPWRCTL
	.comm	_NPHY_TBL_ID_CORE2TXPWRCTL,4,2  ; @NPHY_TBL_ID_CORE2TXPWRCTL
.subsections_via_symbols
