	.file	"extr_ar8327.c_ar8327_setup_port.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ar8327_setup_port, @function
ar8327_setup_port:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movsx	r15, esi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, edx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, r15
	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
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR 8[rdi]
	mov	ecx, DWORD PTR AR8327_PORT_VLAN0_DEF_SVID_S[rip]
	mov	rdx, QWORD PTR [rax+r15*8]
	mov	rax, QWORD PTR [rdi]
	mov	edx, DWORD PTR [rax+rdx*4]
	mov	eax, edx
	sal	eax, cl
	mov	ecx, DWORD PTR AR8327_PORT_VLAN0_DEF_CVID_S[rip]
	sal	edx, cl
	or	edx, eax
	cmp	QWORD PTR 24[rdi], 0
	je	.L2
	mov	rax, QWORD PTR 16[rdi]
	mov	r12d, DWORD PTR AR8327_PORT_VLAN1_OUT_MODE_UNMOD[rip]
	mov	ebx, DWORD PTR AR8216_IN_SECURE[rip]
	mov	eax, DWORD PTR [rax+r15*4]
	test	eax, eax
	jne	.L3
.L4:
	mov	edi, r13d
	mov	DWORD PTR 12[rsp], edx
	call	AR8327_REG_PORT_VLAN0@PLT
	mov	edx, DWORD PTR 12[rsp]
	mov	rdi, rbp
	mov	esi, eax
	call	ar8xxx_write@PLT
	mov	ecx, DWORD PTR AR8327_PORT_VLAN1_OUT_MODE_S[rip]
	sal	r12d, cl
	or	r12d, DWORD PTR AR8327_PORT_VLAN1_PORT_VLAN_PROP[rip]
	cmp	QWORD PTR 24[rbp], 0
	je	.L5
	mov	rax, QWORD PTR 16[rbp]
	mov	eax, DWORD PTR [rax+r15*4]
	test	eax, eax
	je	.L5
	or	r12d, DWORD PTR AR8327_PORT_VLAN1_VLAN_PRI_PROP[rip]
.L5:
	mov	edi, r13d
	call	AR8327_REG_PORT_VLAN1@PLT
	mov	edx, r12d
	mov	rdi, rbp
	mov	esi, eax
	call	ar8xxx_write@PLT
	mov	ecx, DWORD PTR AR8327_PORT_LOOKUP_STATE_S[rip]
	mov	r12d, DWORD PTR AR8216_PORT_STATE_FORWARD[rip]
	mov	edi, r13d
	sal	r12d, cl
	mov	ecx, DWORD PTR AR8327_PORT_LOOKUP_IN_MODE_S[rip]
	or	r12d, DWORD PTR AR8327_PORT_LOOKUP_LEARN[rip]
	or	r12d, r14d
	sal	ebx, cl
	call	AR8327_REG_PORT_LOOKUP@PLT
	or	r12d, ebx
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 48
	mov	edx, r12d
	pop	rbp
	.cfi_def_cfa_offset 40
	mov	esi, eax
	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	ar8xxx_write@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r12d, DWORD PTR AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH[rip]
	mov	ebx, DWORD PTR AR8216_IN_PORT_ONLY[rip]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	mov	ecx, DWORD PTR AR8327_PORT_VLAN0_DEF_SPRI_S[rip]
	mov	esi, eax
	sal	esi, cl
	mov	ecx, DWORD PTR AR8327_PORT_VLAN0_DEF_CPRI_S[rip]
	sal	eax, cl
	or	eax, esi
	or	edx, eax
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	ar8327_setup_port, .-ar8327_setup_port
	.comm	AR8327_PORT_VLAN1_VLAN_PRI_PROP,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_SPRI_S,4,4
	.comm	AR8327_PORT_VLAN0_DEF_CVID_S,4,4
	.comm	AR8327_PORT_VLAN0_DEF_CPRI_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	AR8216_PORT_STATE_FORWARD,4,4
	.comm	AR8216_IN_SECURE,4,4
	.comm	AR8216_IN_PORT_ONLY,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_ar8327.c_ar8327_setup_port.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar8327_setup_port, %function
ar8327_setup_port:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r6, r1
	mov	r4, r0
	ldr	r1, [r0, #4]
	ldr	r3, [r0]
	ldr	ip, [r1, r6, lsl #2]
	ldr	r0, .L14
	ldr	r1, .L14+4
	ldr	r3, [r3, ip, lsl #2]
	ldr	r7, [r0]
	ldr	r0, [r4, #12]
	ldr	r1, [r1]
	lsl	r7, r3, r7
	cmp	r0, #0
	mov	r9, r2
	orr	r7, r7, r3, lsl r1
	beq	.L2
	ldr	r3, [r4, #8]
	ldr	r1, .L14+8
	ldr	r2, [r3, r6, lsl #2]
	ldr	r3, .L14+12
	cmp	r2, #0
	ldr	r5, [r1]
	ldr	r8, [r3]
	bne	.L3
.L4:
	mov	r0, r6
	bl	AR8327_REG_PORT_VLAN0
	mov	r2, r7
	mov	r1, r0
	mov	r0, r4
	bl	ar8xxx_write
	ldr	r1, .L14+16
	ldr	r2, .L14+20
	ldr	r3, [r4, #12]
	ldr	r7, [r1]
	ldr	r2, [r2]
	cmp	r3, #0
	orr	r7, r7, r5, lsl r2
	beq	.L5
	ldr	r3, [r4, #8]
	ldr	r3, [r3, r6, lsl #2]
	cmp	r3, #0
	ldrne	r3, .L14+24
	ldrne	r3, [r3]
	orrne	r7, r7, r3
.L5:
	mov	r0, r6
	bl	AR8327_REG_PORT_VLAN1
	mov	r2, r7
	mov	r1, r0
	mov	r0, r4
	bl	ar8xxx_write
	ldr	r1, .L14+28
	ldr	r2, .L14+32
	ldr	r3, .L14+36
	ldr	r2, [r2]
	ldr	r5, [r1]
	ldr	r3, [r3]
	ldr	r1, .L14+40
	orr	r5, r3, r2, lsl r5
	ldr	r3, [r1]
	orr	r2, r5, r9
	mov	r0, r6
	orr	r8, r2, r8, lsl r3
	bl	AR8327_REG_PORT_LOOKUP
	mov	r2, r8
	mov	r1, r0
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	ar8xxx_write
.L2:
	ldr	r2, .L14+44
	ldr	r3, .L14+48
	ldr	r5, [r2]
	ldr	r8, [r3]
	b	.L4
.L3:
	ldr	r3, .L14+52
	ldr	r1, .L14+56
	ldr	r3, [r3]
	ldr	r1, [r1]
	lsl	r3, r2, r3
	orr	r3, r3, r2, lsl r1
	orr	r7, r7, r3
	b	.L4
.L15:
	.align	2
.L14:
	.word	AR8327_PORT_VLAN0_DEF_CVID_S
	.word	AR8327_PORT_VLAN0_DEF_SVID_S
	.word	AR8327_PORT_VLAN1_OUT_MODE_UNMOD
	.word	AR8216_IN_SECURE
	.word	AR8327_PORT_VLAN1_PORT_VLAN_PROP
	.word	AR8327_PORT_VLAN1_OUT_MODE_S
	.word	AR8327_PORT_VLAN1_VLAN_PRI_PROP
	.word	AR8327_PORT_LOOKUP_STATE_S
	.word	AR8216_PORT_STATE_FORWARD
	.word	AR8327_PORT_LOOKUP_LEARN
	.word	AR8327_PORT_LOOKUP_IN_MODE_S
	.word	AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH
	.word	AR8216_IN_PORT_ONLY
	.word	AR8327_PORT_VLAN0_DEF_CPRI_S
	.word	AR8327_PORT_VLAN0_DEF_SPRI_S
	.size	ar8327_setup_port, .-ar8327_setup_port
	.comm	AR8327_PORT_VLAN1_VLAN_PRI_PROP,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_SPRI_S,4,4
	.comm	AR8327_PORT_VLAN0_DEF_CVID_S,4,4
	.comm	AR8327_PORT_VLAN0_DEF_CPRI_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	AR8216_PORT_STATE_FORWARD,4,4
	.comm	AR8216_IN_SECURE,4,4
	.comm	AR8216_IN_PORT_ONLY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
