	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366_vlan_add               ## -- Begin function rtl8366_vlan_add
	.p2align	4, 0x90
_rtl8366_vlan_add:                      ## @rtl8366_vlan_add
	.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	%rdx, %r13
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	movl	(%rdx), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	4(%rdx), %ebx
	movq	_BRIDGE_VLAN_INFO_UNTAGGED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_BRIDGE_VLAN_INFO_PVID@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	(%rdi), %r12
	cmpl	8(%rdx), %ebx
	jge	LBB0_1
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_19
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	incl	%ebx
	cmpl	8(%r13), %ebx
	jl	LBB0_7
LBB0_1:
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	testl	%edx, -52(%rbp)                 ## 4-byte Folded Reload
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rcx
	cmoveq	%rax, %rcx
	testl	%edx, %r15d
	movl	(%r12), %edi
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %r8
	cmoveq	%rax, %r8
	leaq	L_.str(%rip), %rsi
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_info
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_dsa_is_dsa_port
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_dsa_is_cpu_port
	testq	%rax, %rax
	je	LBB0_4
LBB0_3:
	movl	(%r12), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_4:
	movq	%r13, %rax
	movl	4(%r13), %r13d
	xorl	%r15d, %r15d
	cmpl	8(%rax), %r13d
	jle	LBB0_8
## %bb.5:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	%r13d, %ebx
LBB0_16:
	movq	%r12, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	xorl	%r8d, %r8d
	callq	_rtl8366_set_vlan
	testl	%eax, %eax
	je	LBB0_19
## %bb.17:
	movl	(%r12), %edi
	leaq	L_.str.8(%rip), %rsi
	jmp	LBB0_18
LBB0_8:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r15d, %r15d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=1
	orl	%r14d, %r15d
	leal	1(%r13), %ebx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	cmpl	8(%rax), %r13d
	movl	%ebx, %r13d
	jge	LBB0_16
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, -60(%rbp)
	movl	(%r12), %edi
	leaq	L_.str.6(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_info
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_BIT
	movl	%eax, %r14d
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, -56(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	%ebx, %edi
	callq	_BIT
	orl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	leaq	-60(%rbp), %rdx
	callq	_rtl8366_get_pvid
	testl	%eax, %eax
	js	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpl	$0, -60(%rbp)
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	callq	_rtl8366_set_pvid
	testl	%eax, %eax
	jns	LBB0_15
	jmp	LBB0_19
LBB0_12:
	movl	(%r12), %edi
	leaq	L_.str.7(%rip), %rsi
LBB0_18:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_19:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BRIDGE_VLAN_INFO_UNTAGGED,4,2  ## @BRIDGE_VLAN_INFO_UNTAGGED
	.comm	_BRIDGE_VLAN_INFO_PVID,4,2      ## @BRIDGE_VLAN_INFO_PVID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"add VLAN on port %d, %s, %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"untagged"

L_.str.2:                               ## @.str.2
	.asciz	"tagged"

L_.str.3:                               ## @.str.3
	.asciz	" PVID"

L_.str.4:                               ## @.str.4
	.asciz	"no PVID"

L_.str.5:                               ## @.str.5
	.asciz	"port is DSA or CPU port\n"

L_.str.6:                               ## @.str.6
	.asciz	"add VLAN %04x\n"

L_.str.7:                               ## @.str.7
	.asciz	"could not lookup PVID for port %d\n"

L_.str.8:                               ## @.str.8
	.asciz	"failed to set up VLAN %04x"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366_vlan_add               ; -- Begin function rtl8366_vlan_add
	.p2align	2
_rtl8366_vlan_add:                      ; @rtl8366_vlan_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x21, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _BRIDGE_VLAN_INFO_UNTAGGED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BRIDGE_VLAN_INFO_UNTAGGED@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x8, _BRIDGE_VLAN_INFO_PVID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BRIDGE_VLAN_INFO_PVID@GOTPAGEOFF]
Lloh5:
	ldr	w25, [x8]
	ldr	x20, [x0]
	ldp	w26, w23, [x2]
	ldr	w8, [x2, #8]
	cmp	w23, w8
	b.ge	LBB0_3
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	mov	x0, x20
	mov	x1, x23
	blr	x8
	cbz	w0, LBB0_19
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w23, w23, #1
	ldr	w8, [x21, #8]
	cmp	w23, w8
	b.lt	LBB0_1
LBB0_3:
	and	w27, w24, w26
	and	w8, w25, w26
	ldr	w0, [x20]
Lloh6:
	adrp	x9, l_.str.1@PAGE
Lloh7:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh8:
	adrp	x10, l_.str.2@PAGE
Lloh9:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	w27, #0
	csel	x9, x10, x9, eq
Lloh10:
	adrp	x10, l_.str.3@PAGE
Lloh11:
	add	x10, x10, l_.str.3@PAGEOFF
Lloh12:
	adrp	x11, l_.str.4@PAGE
Lloh13:
	add	x11, x11, l_.str.4@PAGEOFF
	cmp	w8, #0
	csel	x8, x11, x10, eq
	stp	x9, x8, [sp]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_info
	mov	x0, x22
	mov	x1, x19
	bl	_dsa_is_dsa_port
	cbnz	x0, LBB0_5
; %bb.4:
	mov	x0, x22
	mov	x1, x19
	bl	_dsa_is_cpu_port
	cbz	x0, LBB0_6
LBB0_5:
	ldr	w0, [x20]
Lloh16:
	adrp	x1, l_.str.5@PAGE
Lloh17:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
LBB0_6:
	ldp	w26, w8, [x21, #4]
	cmp	w26, w8
	b.le	LBB0_10
; %bb.7:
	mov	w23, #0
	mov	w22, #0
LBB0_8:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	mov	x3, x22
	mov	w4, #0
	bl	_rtl8366_set_vlan
	cbz	w0, LBB0_19
; %bb.9:
	ldr	w0, [x20]
	str	x26, [sp]
Lloh18:
	adrp	x1, l_.str.8@PAGE
Lloh19:
	add	x1, x1, l_.str.8@PAGEOFF
	b	LBB0_18
LBB0_10:
	mov	w22, #0
	mov	w23, #0
	mov	x25, x26
Lloh20:
	adrp	x24, l_.str.6@PAGE
Lloh21:
	add	x24, x24, l_.str.6@PAGEOFF
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	orr	w23, w26, w23
	add	w26, w25, #1
	ldr	w8, [x21, #8]
	cmp	w25, w8
	mov	x25, x26
	b.ge	LBB0_8
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	str	wzr, [sp, #28]
	ldr	w0, [x20]
	mov	x1, x24
	mov	x2, x25
	bl	_dev_info
	mov	x0, x19
	bl	_BIT
	mov	x26, x0
	cbz	w27, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x19
	bl	_BIT
	orr	w22, w0, w22
LBB0_14:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x2, sp, #28
	mov	x0, x20
	mov	x1, x19
	bl	_rtl8366_get_pvid
	tbnz	w0, #31, LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [sp, #28]
	cbnz	w8, LBB0_11
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x20
	mov	x1, x19
	mov	x2, x25
	bl	_rtl8366_set_pvid
	tbz	w0, #31, LBB0_11
	b	LBB0_19
LBB0_17:
	ldr	w0, [x20]
	str	x19, [sp]
Lloh22:
	adrp	x1, l_.str.7@PAGE
Lloh23:
	add	x1, x1, l_.str.7@PAGEOFF
LBB0_18:
	bl	_dev_err
LBB0_19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_BRIDGE_VLAN_INFO_UNTAGGED,4,2  ; @BRIDGE_VLAN_INFO_UNTAGGED
	.comm	_BRIDGE_VLAN_INFO_PVID,4,2      ; @BRIDGE_VLAN_INFO_PVID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"add VLAN on port %d, %s, %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"untagged"

l_.str.2:                               ; @.str.2
	.asciz	"tagged"

l_.str.3:                               ; @.str.3
	.asciz	" PVID"

l_.str.4:                               ; @.str.4
	.asciz	"no PVID"

l_.str.5:                               ; @.str.5
	.asciz	"port is DSA or CPU port\n"

l_.str.6:                               ; @.str.6
	.asciz	"add VLAN %04x\n"

l_.str.7:                               ; @.str.7
	.asciz	"could not lookup PVID for port %d\n"

l_.str.8:                               ; @.str.8
	.asciz	"failed to set up VLAN %04x"

.subsections_via_symbols
