	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wlc_lcnphy_rx_iq_cal_gain
_wlc_lcnphy_rx_iq_cal_gain:             ## @wlc_lcnphy_rx_iq_cal_gain
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %eax
	movl	%edx, %r9d
	movl	%esi, %r8d
	movq	%rdi, %rbx
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	pushq	$0
	pushq	%rax
	callq	_wlc_lcnphy_set_rx_gain_by_distribution
	addq	$16, %rsp
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_wlc_lcnphy_rx_gain_override_enable
	movq	%rbx, %rdi
	movl	$2000, %esi                     ## imm = 0x7D0
	movl	$20, %edx
	xorl	%ecx, %ecx
	callq	_wlc_lcnphy_start_tx_tone
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_udelay
	movq	_RADIO_2064_REG112@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_write_radio_reg
	leaq	-32(%rbp), %rcx
	movq	%rbx, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	movl	$32, %edx
	callq	_wlc_lcnphy_rx_iq_est
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	movl	$2000, %esi                     ## imm = 0x7D0
	movl	$40, %edx
	xorl	%ecx, %ecx
	callq	_wlc_lcnphy_start_tx_tone
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_udelay
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_write_radio_reg
	leaq	-40(%rbp), %rcx
	movq	%rbx, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	movl	$32, %edx
	callq	_wlc_lcnphy_rx_iq_est
	testl	%eax, %eax
	je	LBB0_7
## %bb.2:
	movl	-32(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-40(%rbp), %ecx
	cmpl	%edx, %ecx
	jle	LBB0_6
## %bb.3:
	leal	(%rax,%rax,4), %eax
	cmpl	%eax, %ecx
	jge	LBB0_6
## %bb.4:
	movl	-28(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-36(%rbp), %ecx
	cmpl	%edx, %ecx
	jle	LBB0_6
## %bb.5:
	leal	(%rax,%rax,4), %eax
	movl	$1, %r14d
	cmpl	%eax, %ecx
	jl	LBB0_7
LBB0_6:
	xorl	%r14d, %r14d
LBB0_7:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADIO_2064_REG112,4,2          ## @RADIO_2064_REG112
	.no_dead_strip	_wlc_lcnphy_rx_iq_cal_gain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wlc_lcnphy_rx_iq_cal_gain
_wlc_lcnphy_rx_iq_cal_gain:             ; @wlc_lcnphy_rx_iq_cal_gain
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x6, x3
	mov	x5, x2
	mov	x4, x1
	mov	x19, x0
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w7, #0
	bl	_wlc_lcnphy_set_rx_gain_by_distribution
	mov	x0, x19
	mov	w1, #1
	bl	_wlc_lcnphy_rx_gain_override_enable
	mov	x0, x19
	mov	w1, #2000
	mov	w2, #20
	mov	w3, #0
	bl	_wlc_lcnphy_start_tx_tone
	mov	w0, #500
	bl	_udelay
Lloh0:
	adrp	x20, _RADIO_2064_REG112@GOTPAGE
Lloh1:
	ldr	x20, [x20, _RADIO_2064_REG112@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_write_radio_reg
	mov	x3, sp
	mov	x0, x19
	mov	w1, #1024
	mov	w2, #32
	bl	_wlc_lcnphy_rx_iq_est
	cbz	w0, LBB0_8
; %bb.1:
	mov	x0, x19
	mov	w1, #2000
	mov	w2, #40
	mov	w3, #0
	bl	_wlc_lcnphy_start_tx_tone
	mov	w0, #500
	bl	_udelay
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_write_radio_reg
	add	x3, sp, #8
	mov	x0, x19
	mov	w1, #1024
	mov	w2, #32
	bl	_wlc_lcnphy_rx_iq_est
	cbz	w0, LBB0_8
; %bb.2:
	ldr	w8, [sp]
	ldr	w9, [sp, #8]
	cmp	w9, w8, lsl #1
	b.le	LBB0_7
; %bb.3:
	add	w8, w8, w8, lsl #2
	cmp	w9, w8
	b.ge	LBB0_7
; %bb.4:
	ldr	w8, [sp, #4]
	ldr	w9, [sp, #12]
	cmp	w9, w8, lsl #1
	b.le	LBB0_7
; %bb.5:
	add	w8, w8, w8, lsl #2
	cmp	w9, w8
	b.ge	LBB0_7
; %bb.6:
	mov	w0, #1
	b	LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_RADIO_2064_REG112,4,2          ; @RADIO_2064_REG112
	.no_dead_strip	_wlc_lcnphy_rx_iq_cal_gain
.subsections_via_symbols
