	.file	"extr_rtl8367b.c_rtl8367b_set_vlan_mc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rtl8367b_set_vlan_mc, @function
rtl8367b_set_vlan_mc:
.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
	push	r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rdi
	push	rbx
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR RTL8367B_VLAN_MC_NUM_WORDS[rip]
	mov	rsi, rsp
	lea	rax, 15[0+rax*8]
	mov	rcx, rax
	and	rax, -4096
	sub	rsi, rax
	and	rcx, -16
	mov	rax, rsi
	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, 7[rsp]
	mov	rdi, r14
	and	r14, -8
	shr	rdi, 3
	cmp	QWORD PTR RTL8367B_NUM_VLANS[rip], rbx
	jle	.L5
	mov	rax, QWORD PTR [rdx]
	cmp	rax, QWORD PTR RTL8367B_NUM_VIDS[rip]
	jge	.L5
	mov	rcx, QWORD PTR RTL8367B_PRIORITYMAX[rip]
	cmp	QWORD PTR 8[rdx], rcx
	jg	.L5
	mov	rcx, QWORD PTR 16[rdx]
	mov	r8, QWORD PTR RTL8367B_VLAN_MC0_MEMBER_MASK[rip]
	cmp	rcx, r8
	jg	.L5
	mov	rsi, QWORD PTR RTL8367B_UNTAG_MASK[rip]
	cmp	QWORD PTR 24[rdx], rsi
	jg	.L5
	mov	rsi, QWORD PTR 32[rdx]
	cmp	rsi, QWORD PTR RTL8367B_FIDMAX[rip]
	jg	.L5
	mov	rdx, rcx
	xor	r13d, r13d
	mov	rcx, QWORD PTR RTL8367B_VLAN_MC0_MEMBER_SHIFT[rip]
	and	rsi, QWORD PTR RTL8367B_VLAN_MC1_FID_MASK[rip]
	and	rdx, r8
	and	rax, QWORD PTR RTL8367B_VLAN_MC3_EVID_MASK[rip]
	mov	QWORD PTR 16[0+rdi*8], 0
	sal	rdx, cl
	mov	rcx, QWORD PTR RTL8367B_VLAN_MC1_FID_SHIFT[rip]
	mov	QWORD PTR 0[0+rdi*8], rdx
	sal	rsi, cl
	mov	rcx, QWORD PTR RTL8367B_VLAN_MC3_EVID_SHIFT[rip]
	mov	QWORD PTR 8[0+rdi*8], rsi
	sal	rax, cl
	mov	QWORD PTR 24[0+rdi*8], rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	mov	r15, QWORD PTR [r14+r13*8]
	mov	rdi, rbx
	call	RTL8367B_VLAN_MC_BASE@PLT
	mov	rdi, r12
	lea	rsi, 0[r13+rax]
	mov	rdx, r15
	add	r13, 1
	call	REG_WR@PLT
.L8:
	mov	rdi, r14
	call	ARRAY_SIZE@PLT
	cmp	eax, r13d
	jg	.L9
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	mov	rbx, QWORD PTR -56[rbp]
	xor	rbx, 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
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rtl8367b_set_vlan_mc, .-rtl8367b_set_vlan_mc
	.comm	RTL8367B_VLAN_MC_NUM_WORDS,4,4
	.comm	RTL8367B_VLAN_MC3_EVID_SHIFT,8,8
	.comm	RTL8367B_VLAN_MC3_EVID_MASK,8,8
	.comm	RTL8367B_VLAN_MC1_FID_SHIFT,8,8
	.comm	RTL8367B_VLAN_MC1_FID_MASK,8,8
	.comm	RTL8367B_VLAN_MC0_MEMBER_SHIFT,8,8
	.comm	RTL8367B_VLAN_MC0_MEMBER_MASK,8,8
	.comm	RTL8367B_UNTAG_MASK,8,8
	.comm	RTL8367B_PRIORITYMAX,8,8
	.comm	RTL8367B_NUM_VLANS,8,8
	.comm	RTL8367B_NUM_VIDS,8,8
	.comm	RTL8367B_FIDMAX,8,8
	.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_mc.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_mc, %function
rtl8367b_set_vlan_mc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, fp, lr}
	add	fp, sp, #24
	sub	sp, sp, #12
	mov	r4, r1
	ldr	r3, .L11
	ldr	r1, .L11+4
	ldr	r3, [r3]
	ldr	r1, [r1]
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L11+8
	cmp	r1, r4
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	ble	.L2
	ldr	r1, .L11+12
	ldr	r3, [r2]
	ldr	r1, [r1]
	cmp	r3, r1
	bge	.L2
	ldr	r1, .L11+16
	mov	r7, r0
	ldr	r1, [r1]
	ldr	r0, [r2, #4]
	cmp	r0, r1
	bgt	.L2
	ldr	r0, .L11+20
	ldr	lr, [r2, #8]
	ldr	r1, [r0]
	cmp	lr, r1
	bgt	.L2
	ldr	r0, .L11+24
	ldr	ip, [r2, #12]
	ldr	r0, [r0]
	cmp	ip, r0
	bgt	.L2
	ldr	r0, .L11+28
	ldr	r2, [r2, #16]
	ldr	r0, [r0]
	cmp	r2, r0
	bgt	.L2
	mov	r6, sp
	mov	r5, #0
	ldr	ip, .L11+32
	ldr	r0, .L11+36
	ldr	r8, [ip]
	ldr	r0, [r0]
	ldr	ip, .L11+40
	and	r1, r1, lr
	and	r3, r3, r0
	ldr	lr, [ip]
	ldr	r0, .L11+44
	ldr	ip, .L11+48
	ldr	r0, [r0]
	ldr	ip, [ip]
	and	r2, r2, r8
	lsl	r1, r1, lr
	lsl	r2, r2, ip
	lsl	r3, r3, r0
	stm	r6, {r1, r2}
	str	r3, [r6, #12]
	str	r5, [r6, #8]
	b	.L5
.L6:
	mov	r0, r4
	bl	RTL8367B_VLAN_MC_BASE
	ldr	r2, [r6, r5, lsl #2]
	add	r1, r5, r0
	mov	r0, r7
	bl	REG_WR
	add	r5, r5, #1
.L5:
	mov	r0, r6
	bl	ARRAY_SIZE
	cmp	r5, r0
	blt	.L6
	mov	r0, #0
	b	.L1
.L2:
	ldr	r3, .L11+52
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L11+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L10
	sub	sp, fp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, fp, pc}
.L10:
	bl	__stack_chk_fail
.L12:
	.align	2
.L11:
	.word	RTL8367B_VLAN_MC_NUM_WORDS
	.word	RTL8367B_NUM_VLANS
	.word	.LC0
	.word	RTL8367B_NUM_VIDS
	.word	RTL8367B_PRIORITYMAX
	.word	RTL8367B_VLAN_MC0_MEMBER_MASK
	.word	RTL8367B_UNTAG_MASK
	.word	RTL8367B_FIDMAX
	.word	RTL8367B_VLAN_MC1_FID_MASK
	.word	RTL8367B_VLAN_MC3_EVID_MASK
	.word	RTL8367B_VLAN_MC0_MEMBER_SHIFT
	.word	RTL8367B_VLAN_MC3_EVID_SHIFT
	.word	RTL8367B_VLAN_MC1_FID_SHIFT
	.word	EINVAL
	.size	rtl8367b_set_vlan_mc, .-rtl8367b_set_vlan_mc
	.comm	RTL8367B_VLAN_MC_NUM_WORDS,4,4
	.comm	RTL8367B_VLAN_MC3_EVID_SHIFT,4,4
	.comm	RTL8367B_VLAN_MC3_EVID_MASK,4,4
	.comm	RTL8367B_VLAN_MC1_FID_SHIFT,4,4
	.comm	RTL8367B_VLAN_MC1_FID_MASK,4,4
	.comm	RTL8367B_VLAN_MC0_MEMBER_SHIFT,4,4
	.comm	RTL8367B_VLAN_MC0_MEMBER_MASK,4,4
	.comm	RTL8367B_UNTAG_MASK,4,4
	.comm	RTL8367B_PRIORITYMAX,4,4
	.comm	RTL8367B_NUM_VLANS,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
