	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x02_phy_adjust_vga_gain    ## -- Begin function mt76x02_phy_adjust_vga_gain
	.p2align	4, 0x90
_mt76x02_phy_adjust_vga_gain:           ## @mt76x02_phy_adjust_vga_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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	cmpq	$0, (%rdi)
	movl	$16, %eax
	movl	$4, %r15d
	cmovgq	%rax, %r15
	movq	_MT_RX_STAT_1_CCA_ERRORS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_MT_RX_STAT_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mt76_rr
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_FIELD_GET
	movl	%eax, 8(%rbx)
	cmpl	$801, %eax                      ## imm = 0x321
	jl	LBB0_3
## %bb.1:
	movq	16(%rbx), %rdx
	xorl	%eax, %eax
	cmpq	%r15, %rdx
	jge	LBB0_9
## %bb.2:
	addq	$2, %rdx
	jmp	LBB0_8
LBB0_3:
	movl	%eax, %ecx
	movq	16(%rbx), %rdx
	cmpl	$9, %eax
	jg	LBB0_5
## %bb.4:
	testq	%rdx, %rdx
	jg	LBB0_7
LBB0_5:
	xorl	%eax, %eax
	cmpq	%r15, %rdx
	jl	LBB0_9
## %bb.6:
	cmpl	$499, %ecx                      ## imm = 0x1F3
	jg	LBB0_9
LBB0_7:
	addq	$-2, %rdx
LBB0_8:
	movq	%rdx, 16(%rbx)
	movl	$1, %eax
LBB0_9:
	xorl	%ecx, %ecx
	cmpq	%r15, %rdx
	setge	%cl
	movl	%ecx, 24(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_RX_STAT_1_CCA_ERRORS,4,2    ## @MT_RX_STAT_1_CCA_ERRORS
	.comm	_MT_RX_STAT_1,4,2               ## @MT_RX_STAT_1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x02_phy_adjust_vga_gain    ; -- Begin function mt76x02_phy_adjust_vga_gain
	.p2align	2
_mt76x02_phy_adjust_vga_gain:           ; @mt76x02_phy_adjust_vga_gain
	.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, x0
	ldr	x8, [x0]
	mov	w9, #4
	mov	w10, #16
	cmp	x8, #0
	csel	x21, x10, x9, gt
Lloh0:
	adrp	x8, _MT_RX_STAT_1_CCA_ERRORS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_RX_STAT_1_CCA_ERRORS@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x8, _MT_RX_STAT_1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_RX_STAT_1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_mt76_rr
	mov	x1, x0
	mov	x0, x20
	bl	_FIELD_GET
	str	w0, [x19, #8]
	cmp	w0, #801
	b.lt	LBB0_3
; %bb.1:
	ldr	x9, [x19, #16]
	cmp	x9, x21
	b.ge	LBB0_8
; %bb.2:
	add	x9, x9, #2
	b	LBB0_7
LBB0_3:
	mov	x8, x0
	ldr	x9, [x19, #16]
	cmp	w0, #9
	ccmp	x9, #0, #4, le
	b.gt	LBB0_6
; %bb.4:
	mov	w0, #0
	cmp	x9, x21
	b.lt	LBB0_9
; %bb.5:
	cmp	w8, #499
	b.gt	LBB0_9
LBB0_6:
	sub	x9, x9, #2
LBB0_7:
	str	x9, [x19, #16]
	mov	w0, #1
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	cmp	x9, x21
	cset	w8, ge
	str	w8, [x19, #24]
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_RX_STAT_1_CCA_ERRORS,4,2    ; @MT_RX_STAT_1_CCA_ERRORS
	.comm	_MT_RX_STAT_1,4,2               ; @MT_RX_STAT_1
.subsections_via_symbols
