	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sw_enable
_sw_enable:                             ## @sw_enable
	.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	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r15
	movq	_SWITCH_PORT_NUM@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	testl	%esi, %esi
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	movq	_STP_STATE_DISABLED@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_HOST_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	btsl	%ebx, %edx
	cmpl	$2, (%r15)
	movq	_PORT_MASK@GOTPCREL(%rip), %rcx
	cmovll	(%rcx), %edx
	movq	_STP_STATE_FORWARDING@GOTPCREL(%rip), %r12
	cmovgeq	%r13, %r12
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_sw_cfg_port_base_vlan
	movl	(%r12), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_port_set_stp_state
	incl	%ebx
	movl	(%r14), %esi
	cmpl	%esi, %ebx
	jl	LBB0_2
LBB0_3:
	cmpl	$2, (%r15)
	jl	LBB0_4
## %bb.5:
	movq	_STP_STATE_SIMPLE@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_STP_STATE_FORWARDING@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_port_set_stp_state
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	testl	%edi, %edi
	je	LBB0_8
## %bb.7:
	movq	_KS8842_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
LBB0_8:
	movq	_KS884X_CHIP_ID_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writew                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SWITCH_PORT_NUM,4,2            ## @SWITCH_PORT_NUM
	.comm	_HOST_MASK,4,2                  ## @HOST_MASK
	.comm	_STP_STATE_DISABLED,4,2         ## @STP_STATE_DISABLED
	.comm	_PORT_MASK,4,2                  ## @PORT_MASK
	.comm	_STP_STATE_FORWARDING,4,2       ## @STP_STATE_FORWARDING
	.comm	_STP_STATE_SIMPLE,4,2           ## @STP_STATE_SIMPLE
	.comm	_KS8842_START,4,2               ## @KS8842_START
	.comm	_KS884X_CHIP_ID_OFFSET,8,3      ## @KS884X_CHIP_ID_OFFSET
	.no_dead_strip	_sw_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sw_enable
_sw_enable:                             ; @sw_enable
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _SWITCH_PORT_NUM@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SWITCH_PORT_NUM@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x22, _STP_STATE_FORWARDING@GOTPAGE
Lloh3:
	ldr	x22, [x22, _STP_STATE_FORWARDING@GOTPAGEOFF]
	cmp	w1, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w21, #0
Lloh4:
	adrp	x24, _HOST_MASK@GOTPAGE
Lloh5:
	ldr	x24, [x24, _HOST_MASK@GOTPAGEOFF]
	mov	w25, #1
Lloh6:
	adrp	x26, _PORT_MASK@GOTPAGE
Lloh7:
	ldr	x26, [x26, _PORT_MASK@GOTPAGEOFF]
Lloh8:
	adrp	x27, _STP_STATE_DISABLED@GOTPAGE
Lloh9:
	ldr	x27, [x27, _STP_STATE_DISABLED@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	ldr	w9, [x24]
	lsl	w10, w25, w21
	orr	w9, w9, w10
	ldr	w10, [x26]
	cmp	w8, #1
	csel	w2, w9, w10, gt
	csel	x28, x27, x22, gt
	mov	x0, x19
	mov	x1, x21
	bl	_sw_cfg_port_base_vlan
	ldr	w2, [x28]
	mov	x0, x19
	mov	x1, x21
	bl	_port_set_stp_state
	add	w21, w21, #1
	ldr	w1, [x23]
	cmp	w21, w1
	b.lt	LBB0_2
LBB0_3:
	ldr	w8, [x19]
Lloh10:
	adrp	x9, _STP_STATE_SIMPLE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _STP_STATE_SIMPLE@GOTPAGEOFF]
	cmp	w8, #1
	csel	x8, x9, x22, gt
	ldr	w2, [x8]
	mov	x0, x19
	bl	_port_set_stp_state
Lloh12:
	adrp	x8, _KS8842_START@GOTPAGE
Lloh13:
	ldr	x8, [x8, _KS8842_START@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w20, #0
	csel	w0, wzr, w8, eq
	ldr	x8, [x19, #8]
Lloh15:
	adrp	x9, _KS884X_CHIP_ID_OFFSET@GOTPAGE
Lloh16:
	ldr	x9, [x9, _KS884X_CHIP_ID_OFFSET@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	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	_writew
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_SWITCH_PORT_NUM,4,2            ; @SWITCH_PORT_NUM
	.comm	_HOST_MASK,4,2                  ; @HOST_MASK
	.comm	_STP_STATE_DISABLED,4,2         ; @STP_STATE_DISABLED
	.comm	_PORT_MASK,4,2                  ; @PORT_MASK
	.comm	_STP_STATE_FORWARDING,4,2       ; @STP_STATE_FORWARDING
	.comm	_STP_STATE_SIMPLE,4,2           ; @STP_STATE_SIMPLE
	.comm	_KS8842_START,4,2               ; @KS8842_START
	.comm	_KS884X_CHIP_ID_OFFSET,8,3      ; @KS884X_CHIP_ID_OFFSET
	.no_dead_strip	_sw_enable
.subsections_via_symbols
