	.file	"extr_arswitch_8327.c_ar8327_reset_vlans.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ar8327_reset_vlans, @function
ar8327_reset_vlans:
.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
	xor	r14d, r14d
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, 1
	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
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	esi, DWORD PTR MA_NOTOWNED[rip]
	call	ARSWITCH_LOCK_ASSERT@PLT
	mov	rdi, rbp
	call	ARSWITCH_LOCK@PLT
	mov	rdi, QWORD PTR 0[rbp]
	mov	edx, 8
	xor	esi, esi
	call	memset@PLT
	mov	ecx, DWORD PTR AR8327_FWD_CTRL0_MIRROR_PORT_S[rip]
	mov	eax, 15
	mov	edi, DWORD PTR 32[rbp]
	mov	edx, DWORD PTR AR8327_FWD_CTRL0_MIRROR_PORT[rip]
	mov	esi, DWORD PTR AR8327_REG_FWD_CTRL0[rip]
	sal	eax, cl
	mov	ecx, eax
	call	arswitch_modifyreg@PLT
	mov	edx, DWORD PTR AR8327_NUM_PORTS[rip]
	test	edx, edx
	jg	.L2
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	rax, QWORD PTR ETHERSWITCH_VLAN_DOT1Q[rip]
	je	.L21
	mov	ebx, DWORD PTR AR8X16_PORT_VLAN_MODE_PORT_ONLY[rip]
	mov	r15d, DWORD PTR AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH[rip]
.L6:
	mov	ecx, DWORD PTR AR8327_PORT_VLAN0_DEF_CVID_S[rip]
	mov	edx, r12d
	mov	edi, r13d
	add	r14, 1
	mov	eax, DWORD PTR AR8327_PORT_VLAN0_DEF_SVID_S[rip]
	sal	edx, cl
	bts	edx, eax
	mov	DWORD PTR 12[rsp], edx
	call	AR8327_REG_PORT_VLAN0@PLT
	mov	edx, DWORD PTR 12[rsp]
	mov	edi, DWORD PTR 32[rbp]
	mov	esi, eax
	call	arswitch_writereg@PLT
	mov	ecx, DWORD PTR AR8327_PORT_VLAN1_OUT_MODE_S[rip]
	mov	edi, r13d
	sal	r15d, cl
	or	r15d, DWORD PTR AR8327_PORT_VLAN1_PORT_VLAN_PROP[rip]
	call	AR8327_REG_PORT_VLAN1@PLT
	mov	edi, DWORD PTR 32[rbp]
	mov	edx, r15d
	mov	esi, eax
	call	arswitch_writereg@PLT
	mov	ecx, DWORD PTR AR8327_PORT_LOOKUP_STATE_S[rip]
	mov	eax, r12d
	mov	edi, r13d
	mov	edx, DWORD PTR AR8X16_PORT_CTRL_STATE_FORWARD[rip]
	sal	edx, cl
	mov	ecx, r13d
	or	edx, DWORD PTR AR8327_PORT_LOOKUP_LEARN[rip]
	sal	eax, cl
	mov	ecx, DWORD PTR AR8327_PORT_LOOKUP_IN_MODE_S[rip]
	not	eax
	and	eax, 127
	sal	ebx, cl
	or	edx, eax
	or	ebx, edx
	call	AR8327_REG_PORT_LOOKUP@PLT
	mov	edi, DWORD PTR 32[rbp]
	mov	edx, ebx
	mov	esi, eax
	call	arswitch_writereg@PLT
	mov	eax, DWORD PTR AR8327_NUM_PORTS[rip]
	cmp	eax, r14d
	jle	.L22
.L2:
	mov	rax, QWORD PTR 8[rbp]
	cmp	rax, QWORD PTR ETHERSWITCH_VLAN_PORT[rip]
	mov	r13d, r14d
	jne	.L5
	mov	edx, DWORD PTR ETHERSWITCH_VID_VALID[rip]
	mov	rax, QWORD PTR 0[rbp]
	or	edx, r14d
	mov	DWORD PTR [rax+r14*4], edx
	mov	ebx, DWORD PTR AR8X16_PORT_VLAN_MODE_PORT_ONLY[rip]
	mov	r15d, DWORD PTR AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH[rip]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	mov	ebx, DWORD PTR AR8X16_PORT_VLAN_MODE_SECURE[rip]
	mov	r15d, DWORD PTR AR8327_PORT_VLAN1_OUT_MODE_UNMOD[rip]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L22:
	test	eax, eax
	jle	.L8
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L9:
	mov	esi, ebx
	mov	rdi, rbp
	add	ebx, 1
	call	ar8327_port_disable_mirror@PLT
	cmp	DWORD PTR AR8327_NUM_PORTS[rip], ebx
	jg	.L9
.L8:
	mov	rax, QWORD PTR ETHERSWITCH_VLAN_DOT1Q[rip]
	cmp	QWORD PTR 8[rbp], rax
	je	.L23
.L4:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, rbp
	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
	jmp	ARSWITCH_UNLOCK@PLT
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	mov	rax, QWORD PTR 0[rbp]
	mov	DWORD PTR [rax], 1
	mov	eax, DWORD PTR AR8327_NUM_PORTS[rip]
	test	eax, eax
	jle	.L14
	mov	edx, 1
	xor	ebx, ebx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	mov	edx, DWORD PTR [rax]
.L12:
	mov	esi, ebx
	mov	rdi, rbp
	add	ebx, 1
	call	[QWORD PTR 24[rbp]]
	cmp	DWORD PTR AR8327_NUM_PORTS[rip], ebx
	mov	rax, QWORD PTR 0[rbp]
	jg	.L11
	mov	ecx, DWORD PTR [rax]
.L10:
	mov	edx, 127
	mov	esi, 127
	mov	rdi, rbp
	call	[QWORD PTR 16[rbp]]
	mov	rax, QWORD PTR 0[rbp]
	mov	edx, DWORD PTR ETHERSWITCH_VID_VALID[rip]
	or	DWORD PTR [rax], edx
	jmp	.L4
.L14:
	mov	ecx, 1
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	ar8327_reset_vlans, .-ar8327_reset_vlans
	.comm	MA_NOTOWNED,4,4
	.comm	ETHERSWITCH_VLAN_PORT,8,8
	.comm	ETHERSWITCH_VLAN_DOT1Q,8,8
	.comm	ETHERSWITCH_VID_VALID,4,4
	.comm	AR8X16_PORT_VLAN_MODE_SECURE,4,4
	.comm	AR8X16_PORT_VLAN_MODE_PORT_ONLY,4,4
	.comm	AR8X16_PORT_CTRL_STATE_FORWARD,4,4
	.comm	AR8327_REG_FWD_CTRL0,4,4
	.comm	AR8327_PORT_VLAN1_PORT_VLAN_PROP,4,4
	.comm	AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH,4,4
	.comm	AR8327_PORT_VLAN1_OUT_MODE_UNMOD,4,4
	.comm	AR8327_PORT_VLAN1_OUT_MODE_S,4,4
	.comm	AR8327_PORT_VLAN0_DEF_SVID_S,4,4
	.comm	AR8327_PORT_VLAN0_DEF_CVID_S,4,4
	.comm	AR8327_PORT_LOOKUP_STATE_S,4,4
	.comm	AR8327_PORT_LOOKUP_LEARN,4,4
	.comm	AR8327_PORT_LOOKUP_IN_MODE_S,4,4
	.comm	AR8327_NUM_PORTS,4,4
	.comm	AR8327_FWD_CTRL0_MIRROR_PORT_S,4,4
	.comm	AR8327_FWD_CTRL0_MIRROR_PORT,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_arswitch_8327.c_ar8327_reset_vlans.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar8327_reset_vlans, %function
ar8327_reset_vlans:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	ldr	r3, .L22
	mov	r4, #0
	ldr	r1, [r3]
	sub	sp, sp, #12
	bl	ARSWITCH_LOCK_ASSERT
	mov	r0, r5
	bl	ARSWITCH_LOCK
	mov	r0, #15
	ldr	r2, [r5]
	ldr	r3, .L22+4
	strb	r4, [r2]
	strb	r4, [r2, #1]
	strb	r4, [r2, #2]
	strb	r4, [r2, #3]
	ldr	r3, [r3]
	ldr	r2, .L22+8
	ldr	r1, .L22+12
	ldr	r7, .L22+16
	lsl	r3, r0, r3
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r0, [r5, #16]
	bl	arswitch_modifyreg
	ldr	r3, [r7]
	cmp	r3, r4
	ble	.L19
	ldr	r3, .L22+20
	mov	r6, #1
	str	r3, [sp, #4]
	ldr	fp, .L22+24
	ldr	r3, .L22+28
	b	.L2
.L5:
	ldr	r1, [sp, #4]
	ldr	r1, [r1]
	cmp	r2, r1
	ldreq	r2, .L22+32
	ldrne	r2, .L22+36
	ldreq	r9, [r2]
	ldrne	r9, [r2]
	ldreq	r2, .L22+40
	ldrne	r2, .L22+44
	ldr	r10, [r2]
.L6:
	ldr	r3, .L22+48
	ldr	r1, [fp]
	ldr	r2, [r3]
	mov	r0, r4
	lsl	r2, r6, r2
	orr	r2, r2, r6, lsl r1
	ldr	r8, [r5, #16]
	str	r2, [sp]
	bl	AR8327_REG_PORT_VLAN0
	ldr	r2, [sp]
	mov	r1, r0
	mov	r0, r8
	bl	arswitch_writereg
	ldr	r3, .L22+52
	mov	r0, r4
	ldr	r2, [r3]
	ldr	r3, .L22+56
	ldr	r8, [r5, #16]
	ldr	r1, [r3]
	orr	r10, r2, r10, lsl r1
	bl	AR8327_REG_PORT_VLAN1
	mov	r2, r10
	mov	r1, r0
	mov	r0, r8
	bl	arswitch_writereg
	mvn	r1, r6, lsl r4
	ldr	r3, .L22+60
	and	r1, r1, #127
	ldr	ip, [r3]
	ldr	r3, .L22+64
	ldr	r8, [r5, #16]
	ldr	r0, [r3]
	ldr	r3, .L22+68
	ldr	r2, [r3]
	ldr	r3, .L22+72
	orr	r2, r2, ip, lsl r0
	ldr	r0, [r3]
	orr	r2, r2, r1
	orr	r9, r2, r9, lsl r0
	mov	r0, r4
	bl	AR8327_REG_PORT_LOOKUP
	mov	r2, r9
	mov	r1, r0
	mov	r0, r8
	bl	arswitch_writereg
	ldr	r2, [r7]
	add	r4, r4, #1
	cmp	r2, r4
	ldr	r3, .L22+28
	ble	.L20
.L2:
	ldr	r2, [r5, #4]
	ldr	r1, [r3]
	cmp	r2, r1
	bne	.L5
	ldr	r2, .L22+76
	ldr	r1, [r5]
	ldr	r2, [r2]
	orr	r2, r2, r4
	str	r2, [r1, r4, lsl #2]
	ldr	r2, .L22+36
	ldr	r9, [r2]
	ldr	r2, .L22+44
	ldr	r10, [r2]
	b	.L6
.L20:
	cmp	r2, #0
	ble	.L8
	mov	r4, #0
.L9:
	mov	r1, r4
	mov	r0, r5
	bl	ar8327_port_disable_mirror
	ldr	r3, [r7]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L9
.L8:
	ldr	r3, [sp, #4]
	ldr	r2, [r5, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L21
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	ARSWITCH_UNLOCK
.L21:
	mov	r2, #1
	ldr	r3, [r5]
	str	r2, [r3]
	ldr	r3, [r7]
	cmp	r3, #0
	ble	.L14
	mov	r4, #0
	b	.L12
.L11:
	ldr	r2, [r3]
.L12:
	mov	r1, r4
	ldr	r3, [r5, #12]
	mov	r0, r5
	blx	r3
	ldr	r3, [r7]
	add	r4, r4, #1
	cmp	r3, r4
	ldr	r3, [r5]
	bgt	.L11
	ldr	r3, [r3]
.L10:
	mov	r2, #127
	mov	r0, r5
	mov	r1, r2
	ldr	r4, [r5, #8]
	blx	r4
	mov	r0, r5
	ldr	r2, [r5]
	ldr	r1, .L22+76
	ldr	r3, [r2]
	ldr	r1, [r1]
	orr	r3, r3, r1
	str	r3, [r2]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	ARSWITCH_UNLOCK
.L19:
	ldr	r3, .L22+20
	str	r3, [sp, #4]
	b	.L8
.L14:
	mov	r3, r2
	b	.L10
.L23:
	.align	2
.L22:
	.word	MA_NOTOWNED
	.word	AR8327_FWD_CTRL0_MIRROR_PORT_S
	.word	AR8327_FWD_CTRL0_MIRROR_PORT
	.word	AR8327_REG_FWD_CTRL0
	.word	AR8327_NUM_PORTS
	.word	ETHERSWITCH_VLAN_DOT1Q
	.word	AR8327_PORT_VLAN0_DEF_SVID_S
	.word	ETHERSWITCH_VLAN_PORT
	.word	AR8X16_PORT_VLAN_MODE_SECURE
	.word	AR8X16_PORT_VLAN_MODE_PORT_ONLY
	.word	AR8327_PORT_VLAN1_OUT_MODE_UNMOD
	.word	AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH
	.word	AR8327_PORT_VLAN0_DEF_CVID_S
	.word	AR8327_PORT_VLAN1_PORT_VLAN_PROP
	.word	AR8327_PORT_VLAN1_OUT_MODE_S
	.word	AR8X16_PORT_CTRL_STATE_FORWARD
	.word	AR8327_PORT_LOOKUP_STATE_S
	.word	AR8327_PORT_LOOKUP_LEARN
	.word	AR8327_PORT_LOOKUP_IN_MODE_S
	.word	ETHERSWITCH_VID_VALID
	.size	ar8327_reset_vlans, .-ar8327_reset_vlans
	.comm	MA_NOTOWNED,4,4
	.comm	ETHERSWITCH_VLAN_PORT,4,4
	.comm	ETHERSWITCH_VLAN_DOT1Q,4,4
	.comm	ETHERSWITCH_VID_VALID,4,4
	.comm	AR8X16_PORT_VLAN_MODE_SECURE,4,4
	.comm	AR8X16_PORT_VLAN_MODE_PORT_ONLY,4,4
	.comm	AR8X16_PORT_CTRL_STATE_FORWARD,4,4
	.comm	AR8327_REG_FWD_CTRL0,4,4
	.comm	AR8327_PORT_VLAN1_PORT_VLAN_PROP,4,4
	.comm	AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH,4,4
	.comm	AR8327_PORT_VLAN1_OUT_MODE_UNMOD,4,4
	.comm	AR8327_PORT_VLAN1_OUT_MODE_S,4,4
	.comm	AR8327_PORT_VLAN0_DEF_SVID_S,4,4
	.comm	AR8327_PORT_VLAN0_DEF_CVID_S,4,4
	.comm	AR8327_PORT_LOOKUP_STATE_S,4,4
	.comm	AR8327_PORT_LOOKUP_LEARN,4,4
	.comm	AR8327_PORT_LOOKUP_IN_MODE_S,4,4
	.comm	AR8327_NUM_PORTS,4,4
	.comm	AR8327_FWD_CTRL0_MIRROR_PORT_S,4,4
	.comm	AR8327_FWD_CTRL0_MIRROR_PORT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
