	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mvsw61xx_set_vlan_ports
_mvsw61xx_set_vlan_ports:               ## @mvsw61xx_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_get_state
	movl	(%r15), %edx
	testl	%edx, %edx
	jle	LBB0_2
## %bb.1:
	cmpl	(%rbx), %edx
	jge	LBB0_2
## %bb.3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movq	%rdx, %rcx
	shlq	$4, %rcx
	movq	$0, (%rax,%rcx)
	movl	$0, 8(%rax,%rcx)
	cmpl	$0, 12(%rax,%rcx)
	jne	LBB0_5
## %bb.4:
	leaq	(%rax,%rcx), %rsi
	addq	$12, %rsi
	movl	%edx, (%rsi)
LBB0_5:
	leaq	(%rax,%rcx), %r8
	addq	$4, %r8
	movl	4(%r15), %r9d
	movl	$0, %ebx
	movl	$0, %r14d
	testl	%r9d, %r9d
	jle	LBB0_10
## %bb.6:
	leaq	(%rax,%rcx), %r10
	leaq	(%rax,%rcx), %r11
	addq	$8, %r11
	movq	8(%r15), %r15
	xorl	%edx, %edx
	movq	_MV_STUCTL_STATE_FORWARDING@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r12), %esi
	shll	$2, %ecx
	shll	%cl, %esi
	orl	%esi, %ebx
	movl	%ebx, (%r8)
	movl	(%r13), %esi
	orb	$2, %cl
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	orl	%esi, %edx
	movl	%edx, (%r11)
	incq	%rax
	cmpq	%rax, %r9
	je	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rax,8), %ecx
	btsl	%ecx, %r14d
	movl	%r14d, (%r10)
	movl	4(%r15,%rax,8), %esi
	movq	_SWITCH_PORT_FLAG_TAGGED@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	btl	%edi, %esi
	movq	_MV_VTUCTL_EGRESS_TAGGED@GOTPCREL(%rip), %r12
	jb	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_MV_VTUCTL_EGRESS_UNTAGGED@GOTPCREL(%rip), %r12
	jmp	LBB0_9
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %r9d
	testl	%r9d, %r9d
	movl	$0, %eax
	jle	LBB0_22
## %bb.11:
	xorl	%eax, %eax
	cmpl	$1, %r9d
	jne	LBB0_13
## %bb.12:
	xorl	%edx, %edx
LBB0_19:
	testb	$1, %r9b
	je	LBB0_22
## %bb.20:
	btl	%edx, %r14d
	jb	LBB0_22
## %bb.21:
	movq	_MV_VTUCTL_DISCARD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	shll	$2, %edx
	movl	%edx, %ecx
	shll	%cl, %esi
	orl	%esi, %ebx
	movl	%ebx, (%r8)
	jmp	LBB0_22
LBB0_13:
	movl	%r9d, %r10d
	andl	$-2, %r10d
	xorl	%edx, %edx
	movl	$4, %esi
	movq	_MV_VTUCTL_DISCARD@GOTPCREL(%rip), %r11
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	addl	$2, %edx
	addl	$8, %esi
	cmpl	%edx, %r10d
	je	LBB0_19
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	btl	%edx, %r14d
	jb	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	(%r11), %edi
	leal	-4(%rsi), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edi
	orl	%edi, %ebx
	movl	%ebx, (%r8)
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	%r14d, %edi
	movl	%edx, %ecx
	shrl	%cl, %edi
	testb	$2, %dil
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	(%r11), %edi
	movl	%esi, %ecx
	shll	%cl, %edi
	orl	%edi, %ebx
	movl	%ebx, (%r8)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ## @SWITCH_PORT_FLAG_TAGGED
	.comm	_MV_VTUCTL_EGRESS_TAGGED,4,2    ## @MV_VTUCTL_EGRESS_TAGGED
	.comm	_MV_VTUCTL_EGRESS_UNTAGGED,4,2  ## @MV_VTUCTL_EGRESS_UNTAGGED
	.comm	_MV_STUCTL_STATE_FORWARDING,4,2 ## @MV_STUCTL_STATE_FORWARDING
	.comm	_MV_VTUCTL_DISCARD,4,2          ## @MV_VTUCTL_DISCARD
	.no_dead_strip	_mvsw61xx_set_vlan_ports
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mvsw61xx_set_vlan_ports
_mvsw61xx_set_vlan_ports:               ; @mvsw61xx_set_vlan_ports
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_get_state
	ldr	w9, [x20]
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.1:
	ldr	w8, [x19]
	cmp	w9, w8
	b.ge	LBB0_7
; %bb.2:
	ldr	x8, [x0]
	add	x11, x8, x9, lsl #4
	mov	x8, x11
	str	wzr, [x8, #4]!
	str	wzr, [x11]
	mov	x12, x11
	str	wzr, [x12, #8]!
	mov	x10, x11
	ldr	w13, [x10, #12]!
	cbnz	w13, LBB0_4
; %bb.3:
	str	w9, [x10]
LBB0_4:
	ldr	w13, [x20, #4]
	cmp	w13, #1
	b.lt	LBB0_8
; %bb.5:
	mov	w14, #0
	mov	w9, #0
	mov	w10, #0
	ldr	x15, [x20, #8]
	add	x15, x15, #4
	mov	w16, #1
Lloh0:
	adrp	x17, _SWITCH_PORT_FLAG_TAGGED@GOTPAGE
Lloh1:
	ldr	x17, [x17, _SWITCH_PORT_FLAG_TAGGED@GOTPAGEOFF]
Lloh2:
	adrp	x0, _MV_VTUCTL_EGRESS_UNTAGGED@GOTPAGE
Lloh3:
	ldr	x0, [x0, _MV_VTUCTL_EGRESS_UNTAGGED@GOTPAGEOFF]
Lloh4:
	adrp	x1, _MV_VTUCTL_EGRESS_TAGGED@GOTPAGE
Lloh5:
	ldr	x1, [x1, _MV_VTUCTL_EGRESS_TAGGED@GOTPAGEOFF]
Lloh6:
	adrp	x2, _MV_STUCTL_STATE_FORWARDING@GOTPAGE
Lloh7:
	ldr	x2, [x2, _MV_STUCTL_STATE_FORWARDING@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w3, [x15, #-4]
	lsl	w4, w16, w3
	orr	w10, w10, w4
	str	w10, [x11]
	ldr	w4, [x15], #8
	ldr	w5, [x17]
	lsr	w4, w4, w5
	tst	w4, #0x1
	csel	x4, x0, x1, eq
	ldr	w4, [x4]
	lsl	w5, w3, #2
	lsl	w4, w4, w5
	orr	w9, w4, w9
	str	w9, [x8]
	ldr	w4, [x2]
	mov	w5, #2
	bfi	w5, w3, #2, #30
	lsl	w3, w4, w5
	orr	w14, w14, w3
	str	w14, [x12]
	subs	x13, x13, #1
	b.ne	LBB0_6
	b	LBB0_9
LBB0_7:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_8:
	mov	w9, #0
	mov	w10, #0
LBB0_9:
	ldr	w11, [x19, #4]
	cmp	w11, #1
	b.lt	LBB0_14
; %bb.10:
	mov	w12, #0
	mov	w13, #0
Lloh11:
	adrp	x14, _MV_VTUCTL_DISCARD@GOTPAGE
Lloh12:
	ldr	x14, [x14, _MV_VTUCTL_DISCARD@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	w13, w13, #1
	add	w12, w12, #4
	cmp	w11, w13
	b.eq	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	lsr	w15, w10, w13
	tbnz	w15, #0, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w15, [x14]
	lsl	w15, w15, w12
	orr	w9, w9, w15
	str	w9, [x8]
	b	LBB0_11
LBB0_14:
	mov	w0, #0
LBB0_15:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ; @SWITCH_PORT_FLAG_TAGGED
	.comm	_MV_VTUCTL_EGRESS_TAGGED,4,2    ; @MV_VTUCTL_EGRESS_TAGGED
	.comm	_MV_VTUCTL_EGRESS_UNTAGGED,4,2  ; @MV_VTUCTL_EGRESS_UNTAGGED
	.comm	_MV_STUCTL_STATE_FORWARDING,4,2 ; @MV_STUCTL_STATE_FORWARDING
	.comm	_MV_VTUCTL_DISCARD,4,2          ; @MV_VTUCTL_DISCARD
	.no_dead_strip	_mvsw61xx_set_vlan_ports
.subsections_via_symbols
