	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366_sw_set_vlan_ports      ## -- Begin function rtl8366_sw_set_vlan_ports
	.p2align	4, 0x90
_rtl8366_sw_set_vlan_ports:             ## @rtl8366_sw_set_vlan_ports
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	callq	_sw_to_rtl8366_smi
	movq	%rax, %rdi
	movq	(%rax), %rax
	movl	4(%rbx), %esi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	cmpl	$0, (%rbx)
	jle	LBB0_3
## %bb.4:
	movq	8(%rbx), %r13
	xorl	%r14d, %r14d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r12d, %r12d
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	orl	-60(%rbp), %r12d                ## 4-byte Folded Reload
	incq	%r14
	cmpl	(%rbx), %r14d
	jge	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, -48(%rbp)
	leaq	(%r14,%r14), %rbx
	movl	4(%r13,%r14,8), %edi
	callq	_BIT
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	(%r13,%r14,8), %r15d
	movq	_SWITCH_PORT_FLAG_TAGGED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	testl	%r15d, %eax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%r13,%rbx,4), %edi
	callq	_BIT
	orl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %r15
	movl	4(%r13,%rbx,4), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	-48(%rbp), %rdx
	callq	_rtl8366_get_pvid
	testl	%eax, %eax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	js	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, -48(%rbp)
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%r13,%r15,4), %esi
	movl	4(%rbx), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_rtl8366_set_pvid
	testl	%eax, %eax
	jns	LBB0_10
	jmp	LBB0_12
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_3:
	xorl	%r12d, %r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_11:
	movl	4(%rbx), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	xorl	%r8d, %r8d
	callq	_rtl8366_set_vlan
LBB0_12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ## @SWITCH_PORT_FLAG_TAGGED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366_sw_set_vlan_ports      ; -- Begin function rtl8366_sw_set_vlan_ports
	.p2align	2
_rtl8366_sw_set_vlan_ports:             ; @rtl8366_sw_set_vlan_ports
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x1
	bl	_sw_to_rtl8366_smi
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	w1, [x19, #4]
	blr	x8
	cbz	w0, LBB0_9
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.2:
	mov	w24, #0
	mov	w21, #0
	mov	w22, #0
	ldr	x8, [x19, #8]
	add	x25, x8, #4
Lloh0:
	adrp	x26, _SWITCH_PORT_FLAG_TAGGED@GOTPAGE
Lloh1:
	ldr	x26, [x26, _SWITCH_PORT_FLAG_TAGGED@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	orr	w22, w23, w22
	add	w24, w24, #1
	ldr	w8, [x19]
	add	x25, x25, #8
	cmp	w24, w8
	b.ge	LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [sp, #12]
	ldr	w0, [x25]
	bl	_BIT
	mov	x23, x0
	ldur	w27, [x25, #-4]
	ldr	w0, [x26]
	bl	_BIT
	tst	w0, w27
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x25]
	bl	_BIT
	orr	w21, w0, w21
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x25]
	add	x2, sp, #12
	mov	x0, x20
	bl	_rtl8366_get_pvid
	tbnz	w0, #31, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x25]
	ldr	w2, [x19, #4]
	mov	x0, x20
	bl	_rtl8366_set_pvid
	tbz	w0, #31, LBB0_3
	b	LBB0_12
LBB0_9:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_10:
	mov	w22, #0
	mov	w21, #0
LBB0_11:
	ldr	w1, [x19, #4]
	mov	x0, x20
	mov	x2, x22
	mov	x3, x21
	mov	w4, #0
	bl	_rtl8366_set_vlan
LBB0_12:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ; @SWITCH_PORT_FLAG_TAGGED
.subsections_via_symbols
