	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wlc_lcnphy_periodic_cal
_wlc_lcnphy_periodic_cal:               ## @wlc_lcnphy_periodic_cal
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_wlc_lcnphy_get_tx_pwr_ctrl
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	40(%rbx), %r14
	movq	16(%rbx), %rax
	movl	4(%rax), %eax
	movl	%eax, 36(%rbx)
	movl	$0, (%rbx)
	movl	32(%rbx), %edi
	callq	_CHSPEC_CHANNEL
	movl	32(%rbx), %edi
	callq	_CHSPEC_CHANNEL
	movq	%rax, (%r14)
	movl	8(%r14), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	28(%rbx), %ebx
	movq	_maccontrol@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_D11REGOFFS
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_bcma_read32
	movq	_MCTL_EN_MAC@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	je	LBB0_2
## %bb.1:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rbx), %rax
	movl	(%rax), %edi
	movq	_M_CTS_DURATION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$10000, %edx                    ## imm = 0x2710
	callq	_wlapi_bmac_write_shm
	movq	16(%rbx), %rax
	movl	(%rax), %edi
	callq	_wlapi_suspend_mac_and_wait
LBB0_2:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_wlc_lcnphy_deaf_mode
	movq	%r14, %rdi
	callq	_wlc_lcnphy_txpwrtbl_iqlo_cal
	movq	_lcnphy_rx_iqcomp_table_rev0@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	movl	24(%r14), %edi
	movl	$1, %esi
	callq	_LCNREV_IS
	testq	%rax, %rax
	movl	$127, %eax
	movl	$40, %ecx
	cmovel	%eax, %ecx
	movl	%ecx, (%rsp)
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	movl	$1, %r9d
	callq	_wlc_lcnphy_rx_iq_cal
	movq	%r14, %rdi
	callq	_wlc_lcnphy_tssi_based_pwr_ctrl_enabled
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_wlc_lcnphy_idle_tssi_est
	movq	8(%r14), %rax
	movl	(%rax), %r14d
	movl	4(%rax), %r15d
	movl	8(%rax), %r12d
	movl	$125, %edi
	movl	%r12d, %esi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	_wlc_lcnphy_tssi2dbm
	movl	%eax, %r13d
	movq	_LCNPHY_TBL_ID_TXPWRCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movl	$32, -104(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, -96(%rbp)
	movl	$1, -88(%rbp)
	movq	$0, -80(%rbp)
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	movl	%r12d, %esi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	_wlc_lcnphy_tssi2dbm
	cmpl	%r13d, %eax
	cmovlel	%r13d, %eax
	movl	%eax, -64(%rbp)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	-104(%rbp), %rsi
	callq	_wlc_lcnphy_write_table
	incq	-80(%rbp)
	incl	%ebx
	cmpl	$128, %ebx
	jne	LBB0_4
LBB0_5:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_wlc_lcnphy_set_tx_pwr_by_index
	movq	%rbx, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_wlc_lcnphy_set_tx_pwr_ctrl
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_wlc_lcnphy_deaf_mode
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_7
## %bb.6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rax
	movl	(%rax), %edi
	callq	_wlapi_enable_mac
LBB0_7:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_maccontrol,4,2                 ## @maccontrol
	.comm	_MCTL_EN_MAC,4,2                ## @MCTL_EN_MAC
	.comm	_M_CTS_DURATION,4,2             ## @M_CTS_DURATION
	.comm	_lcnphy_rx_iqcomp_table_rev0,8,3 ## @lcnphy_rx_iqcomp_table_rev0
	.comm	_LCNPHY_TBL_ID_TXPWRCTL,4,2     ## @LCNPHY_TBL_ID_TXPWRCTL
	.no_dead_strip	_wlc_lcnphy_periodic_cal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wlc_lcnphy_periodic_cal
_wlc_lcnphy_periodic_cal:               ; @wlc_lcnphy_periodic_cal
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_wlc_lcnphy_get_tx_pwr_ctrl
	mov	x20, x0
	ldr	x21, [x19, #40]
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #4]
	str	w8, [x19, #36]
	str	wzr, [x19]
	ldr	w0, [x19, #32]
	bl	_CHSPEC_CHANNEL
	ldr	w0, [x19, #32]
	bl	_CHSPEC_CHANNEL
	str	x0, [x21]
	ldr	w21, [x21, #8]
	ldr	w22, [x19, #28]
Lloh0:
	adrp	x8, _maccontrol@GOTPAGE
Lloh1:
	ldr	x8, [x8, _maccontrol@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_D11REGOFFS
	mov	x1, x0
	mov	x0, x22
	bl	_bcma_read32
Lloh3:
	adrp	x8, _MCTL_EN_MAC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MCTL_EN_MAC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ands	w27, w8, w0
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _M_CTS_DURATION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _M_CTS_DURATION@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w2, #10000
	bl	_wlapi_bmac_write_shm
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	bl	_wlapi_suspend_mac_and_wait
LBB0_2:
	mov	w28, #1
	mov	x0, x19
	mov	w1, #1
	bl	_wlc_lcnphy_deaf_mode
	mov	x0, x19
	bl	_wlc_lcnphy_txpwrtbl_iqlo_cal
Lloh9:
	adrp	x8, _lcnphy_rx_iqcomp_table_rev0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _lcnphy_rx_iqcomp_table_rev0@GOTPAGEOFF]
Lloh11:
	ldr	x0, [x8]
	bl	_ARRAY_SIZE
	ldr	w0, [x19, #24]
	mov	w1, #1
	bl	_LCNREV_IS
	cmp	x0, #0
	mov	w8, #40
	mov	w9, #127
	csel	w6, w9, w8, eq
	mov	x0, x19
	mov	x1, #0
	mov	w2, #0
	mov	w3, #1
	mov	w4, #0
	mov	w5, #1
	bl	_wlc_lcnphy_rx_iq_cal
	mov	x0, x19
	bl	_wlc_lcnphy_tssi_based_pwr_ctrl_enabled
	cbz	x0, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_wlc_lcnphy_idle_tssi_est
	ldr	x8, [x19, #8]
	ldp	w22, w23, [x8]
	ldr	w24, [x8, #8]
	mov	w0, #125
	mov	x1, x24
	mov	x2, x22
	mov	x3, x23
	bl	_wlc_lcnphy_tssi2dbm
	mov	x25, x0
	mov	w26, #0
Lloh12:
	adrp	x8, _LCNPHY_TBL_ID_TXPWRCTL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LCNPHY_TBL_ID_TXPWRCTL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [sp, #40]
	mov	w8, #32
	str	w8, [sp, #8]
	add	x8, sp, #4
	str	x8, [sp, #16]
	str	w28, [sp, #24]
	str	xzr, [sp, #32]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x26
	mov	x1, x24
	mov	x2, x22
	mov	x3, x23
	bl	_wlc_lcnphy_tssi2dbm
	cmp	w0, w25
	csel	w8, w0, w25, gt
	str	w8, [sp, #4]
	add	x1, sp, #8
	mov	x0, x19
	bl	_wlc_lcnphy_write_table
	ldr	x8, [sp, #32]
	add	x8, x8, #1
	str	x8, [sp, #32]
	add	w26, w26, #1
	cmp	w26, #128
	b.ne	LBB0_4
LBB0_5:
	mov	x0, x19
	mov	x1, x21
	bl	_wlc_lcnphy_set_tx_pwr_by_index
	mov	x0, x19
	mov	x1, x20
	bl	_wlc_lcnphy_set_tx_pwr_ctrl
	mov	x0, x19
	mov	w1, #0
	bl	_wlc_lcnphy_deaf_mode
	cbz	w27, LBB0_7
; %bb.6:
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	bl	_wlapi_enable_mac
LBB0_7:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_maccontrol,4,2                 ; @maccontrol
	.comm	_MCTL_EN_MAC,4,2                ; @MCTL_EN_MAC
	.comm	_M_CTS_DURATION,4,2             ; @M_CTS_DURATION
	.comm	_lcnphy_rx_iqcomp_table_rev0,8,3 ; @lcnphy_rx_iqcomp_table_rev0
	.comm	_LCNPHY_TBL_ID_TXPWRCTL,4,2     ; @LCNPHY_TBL_ID_TXPWRCTL
	.no_dead_strip	_wlc_lcnphy_periodic_cal
.subsections_via_symbols
