	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8366rb_set_vlan_4k
_rtl8366rb_set_vlan_4k:                 ## @rtl8366rb_set_vlan_4k
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %edx
	movq	_RTL8366RB_NUM_VIDS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jge	LBB0_4
## %bb.1:
	movl	4(%rsi), %r13d
	movq	_RTL8366RB_VLAN_MEMBER_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	cmpl	%ebx, %r13d
	jg	LBB0_4
## %bb.2:
	movl	8(%rsi), %r14d
	movq	_RTL8366RB_VLAN_UNTAG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	cmpl	%r12d, %r14d
	jg	LBB0_4
## %bb.3:
	movl	12(%rsi), %ecx
	movq	_RTL8366RB_FIDMAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jle	LBB0_5
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rdi, %r15
	movq	_RTL8366RB_VLAN_VID_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %edx
	movq	_RTL8366RB_VLAN_UNTAG_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_RTL8366RB_VLAN_FID_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_RTL8366RB_VLAN_TABLE_WRITE_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_rtl8366_smi_write_reg
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:
	andl	%r14d, %r12d
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	andl	%r13d, %ebx
	orl	%r12d, %ebx
	movq	_RTL8366RB_VLAN_TABLE_WRITE_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	incq	%rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_rtl8366_smi_write_reg
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	_RTL8366RB_VLAN_TABLE_WRITE_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$2, %rsi
	movq	%r15, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_rtl8366_smi_write_reg
	testl	%eax, %eax
	jne	LBB0_8
## %bb.9:
	movq	_RTL8366RB_TABLE_ACCESS_CTRL_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_RTL8366RB_TABLE_VLAN_WRITE_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rtl8366_smi_write_reg          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8366RB_NUM_VIDS,4,2         ## @RTL8366RB_NUM_VIDS
	.comm	_RTL8366RB_VLAN_MEMBER_MASK,4,2 ## @RTL8366RB_VLAN_MEMBER_MASK
	.comm	_RTL8366RB_VLAN_UNTAG_MASK,4,2  ## @RTL8366RB_VLAN_UNTAG_MASK
	.comm	_RTL8366RB_FIDMAX,4,2           ## @RTL8366RB_FIDMAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RTL8366RB_VLAN_VID_MASK,4,2    ## @RTL8366RB_VLAN_VID_MASK
	.comm	_RTL8366RB_VLAN_UNTAG_SHIFT,4,2 ## @RTL8366RB_VLAN_UNTAG_SHIFT
	.comm	_RTL8366RB_VLAN_FID_MASK,4,2    ## @RTL8366RB_VLAN_FID_MASK
	.comm	_RTL8366RB_VLAN_TABLE_WRITE_BASE,8,3 ## @RTL8366RB_VLAN_TABLE_WRITE_BASE
	.comm	_RTL8366RB_TABLE_ACCESS_CTRL_REG,8,3 ## @RTL8366RB_TABLE_ACCESS_CTRL_REG
	.comm	_RTL8366RB_TABLE_VLAN_WRITE_CTRL,4,2 ## @RTL8366RB_TABLE_VLAN_WRITE_CTRL
	.no_dead_strip	_rtl8366rb_set_vlan_4k
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8366rb_set_vlan_4k
_rtl8366rb_set_vlan_4k:                 ; @rtl8366rb_set_vlan_4k
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _RTL8366RB_NUM_VIDS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RTL8366RB_NUM_VIDS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_4
; %bb.1:
	ldr	w21, [x1, #4]
Lloh3:
	adrp	x9, _RTL8366RB_VLAN_MEMBER_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RTL8366RB_VLAN_MEMBER_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x9]
	cmp	w21, w22
	b.gt	LBB0_4
; %bb.2:
	ldr	w23, [x1, #8]
Lloh6:
	adrp	x9, _RTL8366RB_VLAN_UNTAG_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RTL8366RB_VLAN_UNTAG_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w25, [x9]
	cmp	w23, w25
	b.gt	LBB0_4
; %bb.3:
	ldr	w20, [x1, #12]
Lloh9:
	adrp	x9, _RTL8366RB_FIDMAX@GOTPAGE
Lloh10:
	ldr	x9, [x9, _RTL8366RB_FIDMAX@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w20, w9
	b.le	LBB0_6
LBB0_4:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x19, x0
Lloh15:
	adrp	x9, _RTL8366RB_VLAN_VID_MASK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _RTL8366RB_VLAN_VID_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	and	w2, w9, w8
Lloh18:
	adrp	x8, _RTL8366RB_VLAN_UNTAG_SHIFT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RTL8366RB_VLAN_UNTAG_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w27, [x8]
Lloh21:
	adrp	x8, _RTL8366RB_VLAN_FID_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RTL8366RB_VLAN_FID_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w26, [x8]
Lloh24:
	adrp	x24, _RTL8366RB_VLAN_TABLE_WRITE_BASE@GOTPAGE
Lloh25:
	ldr	x24, [x24, _RTL8366RB_VLAN_TABLE_WRITE_BASE@GOTPAGEOFF]
	ldr	x1, [x24]
	bl	_rtl8366_smi_write_reg
	cbnz	w0, LBB0_5
; %bb.7:
	and	w8, w25, w23
	lsl	w8, w8, w27
	and	w9, w22, w21
	orr	w2, w8, w9
	ldr	x8, [x24]
	add	x1, x8, #1
	mov	x0, x19
	bl	_rtl8366_smi_write_reg
	cbnz	w0, LBB0_5
; %bb.8:
	and	w2, w26, w20
	ldr	x8, [x24]
	add	x1, x8, #2
	mov	x0, x19
	bl	_rtl8366_smi_write_reg
	cbnz	w0, LBB0_5
; %bb.9:
Lloh26:
	adrp	x8, _RTL8366RB_TABLE_ACCESS_CTRL_REG@GOTPAGE
Lloh27:
	ldr	x8, [x8, _RTL8366RB_TABLE_ACCESS_CTRL_REG@GOTPAGEOFF]
Lloh28:
	ldr	x1, [x8]
Lloh29:
	adrp	x8, _RTL8366RB_TABLE_VLAN_WRITE_CTRL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _RTL8366RB_TABLE_VLAN_WRITE_CTRL@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_rtl8366_smi_write_reg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8366RB_NUM_VIDS,4,2         ; @RTL8366RB_NUM_VIDS
	.comm	_RTL8366RB_VLAN_MEMBER_MASK,4,2 ; @RTL8366RB_VLAN_MEMBER_MASK
	.comm	_RTL8366RB_VLAN_UNTAG_MASK,4,2  ; @RTL8366RB_VLAN_UNTAG_MASK
	.comm	_RTL8366RB_FIDMAX,4,2           ; @RTL8366RB_FIDMAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RTL8366RB_VLAN_VID_MASK,4,2    ; @RTL8366RB_VLAN_VID_MASK
	.comm	_RTL8366RB_VLAN_UNTAG_SHIFT,4,2 ; @RTL8366RB_VLAN_UNTAG_SHIFT
	.comm	_RTL8366RB_VLAN_FID_MASK,4,2    ; @RTL8366RB_VLAN_FID_MASK
	.comm	_RTL8366RB_VLAN_TABLE_WRITE_BASE,8,3 ; @RTL8366RB_VLAN_TABLE_WRITE_BASE
	.comm	_RTL8366RB_TABLE_ACCESS_CTRL_REG,8,3 ; @RTL8366RB_TABLE_ACCESS_CTRL_REG
	.comm	_RTL8366RB_TABLE_VLAN_WRITE_CTRL,4,2 ; @RTL8366RB_TABLE_VLAN_WRITE_CTRL
	.no_dead_strip	_rtl8366rb_set_vlan_4k
.subsections_via_symbols
