	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtw8822c_dpk_gainloss
_rtw8822c_dpk_gainloss:                 ## @rtw8822c_dpk_gainloss
	.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	%rsi, %r14
	movq	%rdi, %rbx
	callq	_rtw8822c_dpk_rf_setting
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_RF_MODE_TRXAGC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BIT_TXAGC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw_read_rf
	movq	%rax, %r15
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw8822c_dpk_rxbb_dc_cal
	movq	_RTW_DPK_DAGC@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw8822c_dpk_one_shot
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw8822c_dpk_dgain_read
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw8822c_dpk_dc_corr_check
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw8822c_dpk_rxbb_dc_cal
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw8822c_dpk_one_shot
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw8822c_dpk_dc_corr_check
LBB0_2:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw8822c_dpk_thermal_read
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_rtw8822c_dpk_pas_agc
	movq	%rax, %r13
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw8822c_dpk_gainloss_result
	subq	%rax, %r13
	cmovgeq	%r13, %r12
	movq	_RF_TX_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BIT_GAIN_TXBB@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r12, %r8
	callq	_rtw_write_rf
	subq	-56(%rbp), %r15                 ## 8-byte Folded Reload
	addq	%r12, %r15
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rtw8822c_dpk_thermal_read
	subq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	movq	%rax, %rdi
	callq	_abs
	movq	(%rbx), %rcx
	movl	%eax, (%rcx,%r14,4)
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RF_MODE_TRXAGC,4,2             ## @RF_MODE_TRXAGC
	.comm	_BIT_TXAGC,4,2                  ## @BIT_TXAGC
	.comm	_RTW_DPK_DAGC,4,2               ## @RTW_DPK_DAGC
	.comm	_RF_TX_GAIN,4,2                 ## @RF_TX_GAIN
	.comm	_BIT_GAIN_TXBB,4,2              ## @BIT_GAIN_TXBB
	.no_dead_strip	_rtw8822c_dpk_gainloss
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtw8822c_dpk_gainloss
_rtw8822c_dpk_gainloss:                 ; @rtw8822c_dpk_gainloss
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x1
	mov	x20, x0
	bl	_rtw8822c_dpk_rf_setting
	mov	x21, x0
Lloh0:
	adrp	x8, _RF_MODE_TRXAGC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RF_MODE_TRXAGC@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x8, _BIT_TXAGC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BIT_TXAGC@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_rtw_read_rf
	mov	x22, x0
	mov	x0, x20
	mov	x1, x19
	bl	_rtw8822c_dpk_rxbb_dc_cal
Lloh6:
	adrp	x23, _RTW_DPK_DAGC@GOTPAGE
Lloh7:
	ldr	x23, [x23, _RTW_DPK_DAGC@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x20
	mov	x1, x19
	bl	_rtw8822c_dpk_one_shot
	mov	x0, x20
	mov	x1, x19
	bl	_rtw8822c_dpk_dgain_read
	mov	x0, x20
	mov	x1, x19
	bl	_rtw8822c_dpk_dc_corr_check
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	bl	_rtw8822c_dpk_rxbb_dc_cal
	ldr	w2, [x23]
	mov	x0, x20
	mov	x1, x19
	bl	_rtw8822c_dpk_one_shot
	mov	x0, x20
	mov	x1, x19
	bl	_rtw8822c_dpk_dc_corr_check
LBB0_2:
	mov	x0, x20
	mov	x1, x19
	bl	_rtw8822c_dpk_thermal_read
	mov	x23, x0
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	mov	w3, #1
	bl	_rtw8822c_dpk_pas_agc
	mov	x24, x0
	mov	x0, x20
	mov	x1, x19
	bl	_rtw8822c_dpk_gainloss_result
	subs	x8, x24, x0
	csel	x24, xzr, x8, lt
Lloh8:
	adrp	x8, _RF_TX_GAIN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RF_TX_GAIN@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
Lloh11:
	adrp	x8, _BIT_GAIN_TXBB@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BIT_GAIN_TXBB@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	x4, x24
	bl	_rtw_write_rf
	sub	x8, x22, x21
	add	x21, x8, x24
	mov	x0, x20
	mov	x1, x19
	bl	_rtw8822c_dpk_thermal_read
	sub	x0, x0, x23
	bl	_abs
	ldr	x8, [x20]
	str	w0, [x8, x19, lsl #2]
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_RF_MODE_TRXAGC,4,2             ; @RF_MODE_TRXAGC
	.comm	_BIT_TXAGC,4,2                  ; @BIT_TXAGC
	.comm	_RTW_DPK_DAGC,4,2               ; @RTW_DPK_DAGC
	.comm	_RF_TX_GAIN,4,2                 ; @RF_TX_GAIN
	.comm	_BIT_GAIN_TXBB,4,2              ; @BIT_GAIN_TXBB
	.no_dead_strip	_rtw8822c_dpk_gainloss
.subsections_via_symbols
