	.file	"extr_mtkswitch_mt7620.c_mtkswitch_vlan_getvgroup.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mtkswitch_vlan_getvgroup, @function
mtkswitch_vlan_getvgroup:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	esi, DWORD PTR MA_NOTOWNED[rip]
	call	MTKSWITCH_LOCK_ASSERT@PLT
	mov	rax, QWORD PTR ETHERSWITCH_VLAN_DOT1Q[rip]
	cmp	QWORD PTR 0[rbp], rax
	jne	.L2
	mov	rax, QWORD PTR 16[rbp]
	cmp	QWORD PTR [rbx], rax
	jle	.L3
.L2:
	mov	r15d, DWORD PTR EINVAL[rip]
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	QWORD PTR 8[rbx], 0
	mov	rdi, rbp
	mov	QWORD PTR 24[rbx], 0
	call	MTKSWITCH_LOCK@PLT
	mov	rax, QWORD PTR MTK_SWITCH_MT7620[rip]
	cmp	QWORD PTR 8[rbp], rax
	je	.L22
	mov	rax, QWORD PTR [rbx]
	mov	DWORD PTR 16[rbx], eax
	.p2align 4,,10
	.p2align 3
.L7:
	mov	esi, DWORD PTR MTKSWITCH_VTCR[rip]
	mov	rdi, rbp
	call	[QWORD PTR 32[rbp]]
	mov	edx, DWORD PTR VTCR_BUSY[rip]
	test	eax, edx
	jne	.L7
	mov	rax, QWORD PTR [rbx]
	and	eax, DWORD PTR VTCR_VID_MASK[rip]
	mov	rdi, rbp
	or	eax, DWORD PTR VTCR_FUNC_VID_READ[rip]
	mov	esi, DWORD PTR MTKSWITCH_VTCR[rip]
	or	edx, eax
	call	[QWORD PTR 40[rbp]]
	.p2align 4,,10
	.p2align 3
.L8:
	mov	esi, DWORD PTR MTKSWITCH_VTCR[rip]
	mov	rdi, rbp
	call	[QWORD PTR 32[rbp]]
	mov	r15d, eax
	and	r15d, DWORD PTR VTCR_BUSY[rip]
	jne	.L8
	and	eax, DWORD PTR VTCR_IDX_INVALID[rip]
	mov	r12d, eax
	jne	.L10
	mov	esi, DWORD PTR MTKSWITCH_VAWD1[rip]
	mov	rdi, rbp
	call	[QWORD PTR 32[rbp]]
	test	DWORD PTR VAWD1_VALID[rip], eax
	je	.L10
	mov	ecx, DWORD PTR VAWD1_MEMBER_OFF[rip]
	mov	edx, DWORD PTR ETHERSWITCH_VID_VALID[rip]
	mov	rdi, rbp
	or	DWORD PTR 16[rbx], edx
	mov	esi, DWORD PTR MTKSWITCH_VAWD2[rip]
	sar	eax, cl
	and	eax, DWORD PTR VAWD1_MEMBER_MASK[rip]
	mov	DWORD PTR 12[rbx], eax
	call	[QWORD PTR 32[rbp]]
	mov	r14d, eax
	mov	eax, DWORD PTR 24[rbp]
	test	eax, eax
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edi, r12d
	call	VAWD2_PORT_MASK@PLT
	mov	edi, r12d
	and	eax, r14d
	mov	r13d, eax
	call	VAWD2_PORT_UNTAGGED@PLT
	cmp	r13d, eax
	jne	.L12
	mov	eax, 1
	mov	ecx, r12d
	sal	eax, cl
	or	DWORD PTR 8[rbx], eax
.L12:
	add	r12d, 1
	cmp	DWORD PTR 24[rbp], r12d
	jg	.L13
.L10:
	mov	rdi, rbp
	call	MTKSWITCH_UNLOCK@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rdi, QWORD PTR [rbx]
	mov	r12, QWORD PTR 32[rbp]
	call	MTKSWITCH_VTIM@PLT
	mov	rdi, rbp
	mov	esi, eax
	call	r12
	mov	rdi, QWORD PTR [rbx]
	mov	r12d, eax
	call	VTIM_OFF@PLT
	mov	ecx, eax
	sar	r12d, cl
	and	r12d, DWORD PTR VTIM_MASK[rip]
	mov	DWORD PTR 16[rbx], r12d
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	mtkswitch_vlan_getvgroup, .-mtkswitch_vlan_getvgroup
	.comm	VTIM_MASK,4,4
	.comm	VTCR_VID_MASK,4,4
	.comm	VTCR_IDX_INVALID,4,4
	.comm	VTCR_FUNC_VID_READ,4,4
	.comm	VTCR_BUSY,4,4
	.comm	VAWD1_VALID,4,4
	.comm	VAWD1_MEMBER_OFF,4,4
	.comm	VAWD1_MEMBER_MASK,4,4
	.comm	MTK_SWITCH_MT7620,8,8
	.comm	MTKSWITCH_VTCR,4,4
	.comm	MTKSWITCH_VAWD2,4,4
	.comm	MTKSWITCH_VAWD1,4,4
	.comm	MA_NOTOWNED,4,4
	.comm	ETHERSWITCH_VLAN_DOT1Q,8,8
	.comm	ETHERSWITCH_VID_VALID,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mtkswitch_mt7620.c_mtkswitch_vlan_getvgroup.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mtkswitch_vlan_getvgroup, %function
mtkswitch_vlan_getvgroup:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r0
	ldr	r3, .L23
	mov	r7, r1
	ldr	r1, [r3]
	bl	MTKSWITCH_LOCK_ASSERT
	ldr	r3, .L23+4
	ldr	r2, [r5]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L2
	ldr	r2, [r7]
	ldr	r3, [r5, #8]
	cmp	r2, r3
	ble	.L3
.L2:
	ldr	r3, .L23+8
	ldr	r6, [r3]
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L3:
	mov	r3, #0
	mov	r0, r5
	str	r3, [r7, #4]
	str	r3, [r7, #8]
	str	r3, [r7, #16]
	bl	MTKSWITCH_LOCK
	ldr	r3, .L23+12
	ldr	r2, [r5, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L22
	ldr	r3, [r7]
	str	r3, [r7, #12]
.L6:
	ldr	r4, .L23+16
	ldr	r8, .L23+20
.L7:
	ldr	r3, [r5, #16]
	mov	r0, r5
	ldr	r1, [r4]
	blx	r3
	ldr	r3, [r8]
	tst	r0, r3
	bne	.L7
	ldr	r2, .L23+24
	ldr	r1, .L23+28
	ldr	r0, [r2]
	ldr	r2, [r7]
	ldr	r1, [r1]
	and	r2, r2, r0
	orr	r2, r2, r1
	orr	r2, r2, r3
	mov	r0, r5
	ldr	r3, [r5, #20]
	ldr	r1, [r4]
	blx	r3
.L8:
	ldr	r3, [r5, #16]
	mov	r0, r5
	ldr	r1, [r4]
	blx	r3
	ldr	r3, [r8]
	ands	r6, r0, r3
	bne	.L8
	ldr	r3, .L23+32
	ldr	r4, [r3]
	ands	r4, r0, r4
	bne	.L10
	ldr	r2, .L23+36
	ldr	r3, [r5, #16]
	mov	r0, r5
	ldr	r1, [r2]
	blx	r3
	ldr	r3, .L23+40
	ldr	r3, [r3]
	tst	r0, r3
	beq	.L10
	ldr	r1, .L23+44
	ldr	r3, .L23+48
	ldr	r2, .L23+52
	ldr	r1, [r1]
	ldr	r3, [r3]
	ldr	ip, [r2]
	ldr	r2, [r7, #12]
	and	r0, r3, r0, asr r1
	ldr	r3, .L23+56
	orr	r2, r2, ip
	ldr	r1, [r3]
	str	r0, [r7, #8]
	ldr	r3, [r5, #16]
	mov	r0, r5
	str	r2, [r7, #12]
	blx	r3
	ldr	r3, [r5, #12]
	mov	r9, r0
	cmp	r3, #0
	ble	.L10
	mov	r10, #1
.L13:
	mov	r0, r4
	bl	VAWD2_PORT_MASK
	mov	r8, r0
	mov	r0, r4
	bl	VAWD2_PORT_UNTAGGED
	and	r8, r8, r9
	cmp	r8, r0
	ldreq	r3, [r7, #4]
	orreq	r3, r3, r10, lsl r4
	streq	r3, [r7, #4]
	ldr	r3, [r5, #12]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L13
.L10:
	mov	r0, r5
	bl	MTKSWITCH_UNLOCK
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L22:
	ldr	r0, [r7]
	ldr	r4, [r5, #16]
	bl	MTKSWITCH_VTIM
	mov	r1, r0
	mov	r0, r5
	blx	r4
	mov	r4, r0
	ldr	r0, [r7]
	bl	VTIM_OFF
	ldr	r3, .L23+60
	ldr	r3, [r3]
	and	r3, r3, r4, asr r0
	str	r3, [r7, #12]
	b	.L6
.L24:
	.align	2
.L23:
	.word	MA_NOTOWNED
	.word	ETHERSWITCH_VLAN_DOT1Q
	.word	EINVAL
	.word	MTK_SWITCH_MT7620
	.word	MTKSWITCH_VTCR
	.word	VTCR_BUSY
	.word	VTCR_VID_MASK
	.word	VTCR_FUNC_VID_READ
	.word	VTCR_IDX_INVALID
	.word	MTKSWITCH_VAWD1
	.word	VAWD1_VALID
	.word	VAWD1_MEMBER_OFF
	.word	VAWD1_MEMBER_MASK
	.word	ETHERSWITCH_VID_VALID
	.word	MTKSWITCH_VAWD2
	.word	VTIM_MASK
	.size	mtkswitch_vlan_getvgroup, .-mtkswitch_vlan_getvgroup
	.comm	VTIM_MASK,4,4
	.comm	VTCR_VID_MASK,4,4
	.comm	VTCR_IDX_INVALID,4,4
	.comm	VTCR_FUNC_VID_READ,4,4
	.comm	VTCR_BUSY,4,4
	.comm	VAWD1_VALID,4,4
	.comm	VAWD1_MEMBER_OFF,4,4
	.comm	VAWD1_MEMBER_MASK,4,4
	.comm	MTK_SWITCH_MT7620,4,4
	.comm	MTKSWITCH_VTCR,4,4
	.comm	MTKSWITCH_VAWD2,4,4
	.comm	MTKSWITCH_VAWD1,4,4
	.comm	MA_NOTOWNED,4,4
	.comm	ETHERSWITCH_VLAN_DOT1Q,4,4
	.comm	ETHERSWITCH_VID_VALID,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
