	.file	"extr_rtl8367b.c_rtl8367b_set_vlan_4k.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rtl8367b_set_vlan_4k, @function
rtl8367b_set_vlan_4k:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	mov	r13, rdi
	push	r12
	.cfi_offset 12, -48
	mov	r12, rsi
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR RTL8367B_TA_VLAN_NUM_WORDS[rip]
	mov	rbx, rsp
	mov	rdx, rax
	lea	rax, 15[0+rax*4]
	mov	rcx, rax
	and	rax, -4096
	sub	rbx, rax
	and	rcx, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L3
.L16:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L16
.L3:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L17
.L4:
	lea	r14, 3[rsp]
	mov	eax, DWORD PTR RTL8367B_NUM_VIDS[rip]
	mov	rbx, r14
	and	r14, -4
	shr	rbx, 2
	cmp	DWORD PTR [r12], eax
	jge	.L5
	mov	eax, DWORD PTR RTL8367B_TA_VLAN0_MEMBER_MASK[rip]
	cmp	DWORD PTR 4[r12], eax
	jg	.L5
	mov	eax, DWORD PTR RTL8367B_UNTAG_MASK[rip]
	cmp	DWORD PTR 8[r12], eax
	jg	.L5
	mov	eax, DWORD PTR RTL8367B_FIDMAX[rip]
	cmp	DWORD PTR 12[r12], eax
	jle	.L6
.L5:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	mov	rdx, QWORD PTR -56[rbp]
	xor	rdx, QWORD PTR fs:40
	jne	.L18
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rcx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	sal	edx, 2
	xor	esi, esi
	mov	rdi, r14
	call	memset@PLT
	mov	ecx, DWORD PTR RTL8367B_TA_VLAN0_MEMBER_SHIFT[rip]
	mov	eax, DWORD PTR 4[r12]
	and	eax, DWORD PTR RTL8367B_TA_VLAN0_MEMBER_MASK[rip]
	mov	edx, DWORD PTR 8[r12]
	sal	eax, cl
	mov	ecx, DWORD PTR RTL8367B_TA_VLAN0_UNTAG_SHIFT[rip]
	and	edx, DWORD PTR RTL8367B_TA_VLAN0_UNTAG_MASK[rip]
	sal	edx, cl
	mov	ecx, DWORD PTR RTL8367B_TA_VLAN1_FID_SHIFT[rip]
	or	eax, edx
	mov	DWORD PTR 0[0+rbx*4], eax
	mov	eax, DWORD PTR 12[r12]
	and	eax, DWORD PTR RTL8367B_TA_VLAN1_FID_MASK[rip]
	sal	eax, cl
	mov	DWORD PTR 4[0+rbx*4], eax
	xor	ebx, ebx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	mov	r15d, DWORD PTR [r14+rbx*4]
	mov	edi, ebx
	add	rbx, 1
	call	RTL8367B_TA_WRDATA_REG@PLT
	mov	rdi, r13
	mov	esi, eax
	mov	edx, r15d
	call	REG_WR@PLT
.L8:
	mov	rdi, r14
	call	ARRAY_SIZE@PLT
	cmp	eax, ebx
	jg	.L9
	mov	esi, DWORD PTR RTL8367B_TA_ADDR_REG[rip]
	mov	edx, DWORD PTR [r12]
	mov	rdi, r13
	and	edx, DWORD PTR RTL8367B_TA_VLAN_VID_MASK[rip]
	call	REG_WR@PLT
	mov	edx, DWORD PTR RTL8367B_TA_CTRL_CVLAN_WRITE[rip]
	mov	esi, DWORD PTR RTL8367B_TA_CTRL_REG[rip]
	mov	rdi, r13
	call	REG_WR@PLT
	xor	eax, eax
	jmp	.L1
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rtl8367b_set_vlan_4k, .-rtl8367b_set_vlan_4k
	.comm	RTL8367B_UNTAG_MASK,4,4
	.comm	RTL8367B_TA_VLAN_VID_MASK,4,4
	.comm	RTL8367B_TA_VLAN_NUM_WORDS,4,4
	.comm	RTL8367B_TA_VLAN1_FID_SHIFT,4,4
	.comm	RTL8367B_TA_VLAN1_FID_MASK,4,4
	.comm	RTL8367B_TA_VLAN0_UNTAG_SHIFT,4,4
	.comm	RTL8367B_TA_VLAN0_UNTAG_MASK,4,4
	.comm	RTL8367B_TA_VLAN0_MEMBER_SHIFT,4,4
	.comm	RTL8367B_TA_VLAN0_MEMBER_MASK,4,4
	.comm	RTL8367B_TA_CTRL_REG,4,4
	.comm	RTL8367B_TA_CTRL_CVLAN_WRITE,4,4
	.comm	RTL8367B_TA_ADDR_REG,4,4
	.comm	RTL8367B_NUM_VIDS,4,4
	.comm	RTL8367B_FIDMAX,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_rtl8367b.c_rtl8367b_set_vlan_4k.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rtl8367b_set_vlan_4k, %function
rtl8367b_set_vlan_4k:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #12
	mov	r5, r1
	ldr	r3, .L11
	ldr	r1, .L11+4
	ldr	r2, [r3]
	ldr	ip, [r5]
	lsl	r2, r2, #2
	add	r3, r2, #7
	bic	r3, r3, #7
	ldr	r1, [r1]
	sub	sp, sp, r3
	ldr	r3, .L11+8
	cmp	ip, r1
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bge	.L2
	ldr	r3, .L11+12
	ldr	r4, [r5, #4]
	ldr	r10, [r3]
	cmp	r4, r10
	bgt	.L2
	ldr	r3, .L11+16
	ldr	r8, [r5, #8]
	ldr	r3, [r3]
	cmp	r8, r3
	bgt	.L2
	ldr	r3, .L11+20
	ldr	r9, [r5, #12]
	ldr	r3, [r3]
	cmp	r9, r3
	ble	.L3
.L2:
	ldr	r3, .L11+24
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L11+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L10
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	mov	r7, sp
	mov	r1, #0
	mov	r6, r0
	mov	r0, r7
	bl	memset
	ldr	r0, .L11+28
	ldr	r1, .L11+32
	ldr	r3, .L11+36
	ldr	ip, [r0]
	ldr	r2, .L11+40
	ldr	r0, [r1]
	ldr	r1, [r3]
	ldr	r3, .L11+44
	ldr	r2, [r2]
	ldr	r3, [r3]
	and	r4, r4, r10
	lsl	r4, r4, ip
	and	r8, r8, r0
	and	r9, r9, r1
	orr	r4, r4, r8, lsl r2
	lsl	r9, r9, r3
	stm	r7, {r4, r9}
	mov	r4, #0
	b	.L5
.L6:
	mov	r0, r4
	bl	RTL8367B_TA_WRDATA_REG
	ldr	r2, [r7, r4, lsl #2]
	mov	r1, r0
	mov	r0, r6
	bl	REG_WR
	add	r4, r4, #1
.L5:
	mov	r0, r7
	bl	ARRAY_SIZE
	cmp	r4, r0
	blt	.L6
	ldr	r3, .L11+48
	ldr	r1, [r5]
	ldr	r2, [r3]
	ldr	r3, .L11+52
	and	r2, r2, r1
	mov	r0, r6
	ldr	r1, [r3]
	bl	REG_WR
	ldr	r3, .L11+56
	ldr	r2, .L11+60
	mov	r0, r6
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	REG_WR
	mov	r0, #0
	b	.L1
.L10:
	bl	__stack_chk_fail
.L12:
	.align	2
.L11:
	.word	RTL8367B_TA_VLAN_NUM_WORDS
	.word	RTL8367B_NUM_VIDS
	.word	.LC0
	.word	RTL8367B_TA_VLAN0_MEMBER_MASK
	.word	RTL8367B_UNTAG_MASK
	.word	RTL8367B_FIDMAX
	.word	EINVAL
	.word	RTL8367B_TA_VLAN0_MEMBER_SHIFT
	.word	RTL8367B_TA_VLAN0_UNTAG_MASK
	.word	RTL8367B_TA_VLAN1_FID_MASK
	.word	RTL8367B_TA_VLAN0_UNTAG_SHIFT
	.word	RTL8367B_TA_VLAN1_FID_SHIFT
	.word	RTL8367B_TA_VLAN_VID_MASK
	.word	RTL8367B_TA_ADDR_REG
	.word	RTL8367B_TA_CTRL_REG
	.word	RTL8367B_TA_CTRL_CVLAN_WRITE
	.size	rtl8367b_set_vlan_4k, .-rtl8367b_set_vlan_4k
	.comm	RTL8367B_UNTAG_MASK,4,4
	.comm	RTL8367B_TA_VLAN_VID_MASK,4,4
	.comm	RTL8367B_TA_VLAN_NUM_WORDS,4,4
	.comm	RTL8367B_TA_VLAN1_FID_SHIFT,4,4
	.comm	RTL8367B_TA_VLAN1_FID_MASK,4,4
	.comm	RTL8367B_TA_VLAN0_UNTAG_SHIFT,4,4
	.comm	RTL8367B_TA_VLAN0_UNTAG_MASK,4,4
	.comm	RTL8367B_TA_VLAN0_MEMBER_SHIFT,4,4
	.comm	RTL8367B_TA_VLAN0_MEMBER_MASK,4,4
	.comm	RTL8367B_TA_CTRL_REG,4,4
	.comm	RTL8367B_TA_CTRL_CVLAN_WRITE,4,4
	.comm	RTL8367B_TA_ADDR_REG,4,4
	.comm	RTL8367B_NUM_VIDS,4,4
	.comm	RTL8367B_FIDMAX,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
