	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtw8822c_gain_check_state
_rtw8822c_gain_check_state:             ## @rtw8822c_gain_check_state
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	20(%rsi), %esi
	movq	_RF_TX_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BIT_GAIN_TXBB@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_rtw_read_rf
	movq	%rax, 40(%rbx)
	movl	20(%rbx), %esi
	movq	_RF_MODE_TRXAGC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BIT_RXAGC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_rtw_read_rf
	movq	%rax, 32(%rbx)
	cmpq	$0, 24(%rbx)
	je	LBB0_1
LBB0_5:
	movq	_RTW_DPK_LOSS_CHECK@GOTPCREL(%rip), %rax
LBB0_6:
	movq	(%rax), %rax
LBB0_7:
	movl	(%rbx), %ecx
	leal	1(%rcx), %edx
	movl	%edx, (%rbx)
	cmpl	$5, %ecx
	jl	LBB0_9
## %bb.8:
	movq	_RTW_DPK_AGC_OUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movl	16(%rbx), %edx
	movl	20(%rbx), %esi
	movq	%r14, %rdi
	callq	_rtw8822c_dpk_agc_gain_chk
	movq	_RTW_DPK_GAIN_CHECK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_4
## %bb.2:
	cmpq	$0, 8(%rbx)
	je	LBB0_4
## %bb.3:
	movq	_RTW_DPK_AGC_OUT@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	cmpq	%rcx, %rax
	je	LBB0_5
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_RF_TX_GAIN,4,2                 ## @RF_TX_GAIN
	.comm	_BIT_GAIN_TXBB,4,2              ## @BIT_GAIN_TXBB
	.comm	_RF_MODE_TRXAGC,4,2             ## @RF_MODE_TRXAGC
	.comm	_BIT_RXAGC,4,2                  ## @BIT_RXAGC
	.comm	_RTW_DPK_LOSS_CHECK,8,3         ## @RTW_DPK_LOSS_CHECK
	.comm	_RTW_DPK_GAIN_CHECK,8,3         ## @RTW_DPK_GAIN_CHECK
	.comm	_RTW_DPK_AGC_OUT,8,3            ## @RTW_DPK_AGC_OUT
	.no_dead_strip	_rtw8822c_gain_check_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtw8822c_gain_check_state
_rtw8822c_gain_check_state:             ; @rtw8822c_gain_check_state
	.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	x19, x1
	mov	x20, x0
	ldr	w1, [x1, #20]
Lloh0:
	adrp	x8, _RF_TX_GAIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RF_TX_GAIN@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x8, _BIT_GAIN_TXBB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BIT_GAIN_TXBB@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	bl	_rtw_read_rf
	str	x0, [x19, #40]
	ldr	w1, [x19, #20]
Lloh6:
	adrp	x8, _RF_MODE_TRXAGC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RF_MODE_TRXAGC@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _BIT_RXAGC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BIT_RXAGC@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_rtw_read_rf
	str	x0, [x19, #32]
	ldr	x8, [x19, #24]
Lloh12:
	adrp	x21, _RTW_DPK_AGC_OUT@GOTPAGE
Lloh13:
	ldr	x21, [x21, _RTW_DPK_AGC_OUT@GOTPAGEOFF]
	cbz	x8, LBB0_2
; %bb.1:
Lloh14:
	adrp	x8, _RTW_DPK_LOSS_CHECK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RTW_DPK_LOSS_CHECK@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	b	LBB0_6
LBB0_2:
	ldp	w2, w1, [x19, #16]
	mov	x0, x20
	bl	_rtw8822c_dpk_agc_gain_chk
Lloh17:
	adrp	x8, _RTW_DPK_GAIN_CHECK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _RTW_DPK_GAIN_CHECK@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.3:
	ldr	x9, [x19, #8]
	cbz	x9, LBB0_5
; %bb.4:
	ldr	x8, [x21]
	b	LBB0_6
LBB0_5:
Lloh20:
	adrp	x9, _RTW_DPK_LOSS_CHECK@GOTPAGE
Lloh21:
	ldr	x9, [x9, _RTW_DPK_LOSS_CHECK@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x0, x8
	csel	x8, x9, x0, eq
LBB0_6:
	ldr	w9, [x19]
	add	w10, w9, #1
	str	w10, [x19]
	ldr	x10, [x21]
	cmp	w9, #4
	csel	x0, x10, x8, gt
	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
	ret
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_RF_TX_GAIN,4,2                 ; @RF_TX_GAIN
	.comm	_BIT_GAIN_TXBB,4,2              ; @BIT_GAIN_TXBB
	.comm	_RF_MODE_TRXAGC,4,2             ; @RF_MODE_TRXAGC
	.comm	_BIT_RXAGC,4,2                  ; @BIT_RXAGC
	.comm	_RTW_DPK_LOSS_CHECK,8,3         ; @RTW_DPK_LOSS_CHECK
	.comm	_RTW_DPK_GAIN_CHECK,8,3         ; @RTW_DPK_GAIN_CHECK
	.comm	_RTW_DPK_AGC_OUT,8,3            ; @RTW_DPK_AGC_OUT
	.no_dead_strip	_rtw8822c_gain_check_state
.subsections_via_symbols
