	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sw_setup
_sw_setup:                              ## @sw_setup
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_sw_set_global_ctrl
	movq	%r14, %rdi
	callq	_sw_init_broad_storm
	movq	_BROADCAST_STORM_PROTECTION_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_hw_cfg_broad_storm
	movq	_SWITCH_PORT_NUM@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_sw_ena_broad_storm
	incl	%ebx
	cmpl	(%r15), %ebx
	jl	LBB0_2
LBB0_3:
	movq	%r14, %rdi
	callq	_sw_init_prio
	movq	%r14, %rdi
	callq	_sw_init_mirror
	movq	%r14, %rdi
	callq	_sw_init_prio_rate
	movq	%r14, %rdi
	callq	_sw_init_vlan
	movq	_STP_SUPPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	callq	_sw_init_stp
LBB0_5:
	movq	_KS8842_SWITCH_CTRL_1_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SWITCH_TX_FLOW_CTRL@GOTPCREL(%rip), %rax
	movq	_SWITCH_RX_FLOW_CTRL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_sw_chk
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	_PAUSE_FLOW_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r14)
LBB0_7:
	movq	%r14, %rdi
	movl	$1, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sw_enable                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BROADCAST_STORM_PROTECTION_RATE,4,2 ## @BROADCAST_STORM_PROTECTION_RATE
	.comm	_SWITCH_PORT_NUM,4,2            ## @SWITCH_PORT_NUM
	.comm	_STP_SUPPORT,4,2                ## @STP_SUPPORT
	.comm	_KS8842_SWITCH_CTRL_1_OFFSET,4,2 ## @KS8842_SWITCH_CTRL_1_OFFSET
	.comm	_SWITCH_TX_FLOW_CTRL,4,2        ## @SWITCH_TX_FLOW_CTRL
	.comm	_SWITCH_RX_FLOW_CTRL,4,2        ## @SWITCH_RX_FLOW_CTRL
	.comm	_PAUSE_FLOW_CTRL,4,2            ## @PAUSE_FLOW_CTRL
	.no_dead_strip	_sw_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sw_setup
_sw_setup:                              ; @sw_setup
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	bl	_sw_set_global_ctrl
	mov	x0, x19
	bl	_sw_init_broad_storm
Lloh0:
	adrp	x8, _BROADCAST_STORM_PROTECTION_RATE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BROADCAST_STORM_PROTECTION_RATE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_hw_cfg_broad_storm
Lloh3:
	adrp	x21, _SWITCH_PORT_NUM@GOTPAGE
Lloh4:
	ldr	x21, [x21, _SWITCH_PORT_NUM@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w20, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_sw_ena_broad_storm
	add	w20, w20, #1
	ldr	w8, [x21]
	cmp	w20, w8
	b.lt	LBB0_2
LBB0_3:
	mov	x0, x19
	bl	_sw_init_prio
	mov	x0, x19
	bl	_sw_init_mirror
	mov	x0, x19
	bl	_sw_init_prio_rate
	mov	x0, x19
	bl	_sw_init_vlan
	ldr	w8, [x19]
Lloh5:
	adrp	x9, _STP_SUPPORT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _STP_SUPPORT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_sw_init_stp
LBB0_5:
Lloh8:
	adrp	x8, _KS8842_SWITCH_CTRL_1_OFFSET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _KS8842_SWITCH_CTRL_1_OFFSET@GOTPAGEOFF]
Lloh10:
	adrp	x9, _SWITCH_TX_FLOW_CTRL@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SWITCH_TX_FLOW_CTRL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	ldr	w8, [x9]
Lloh14:
	adrp	x9, _SWITCH_RX_FLOW_CTRL@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SWITCH_RX_FLOW_CTRL@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_sw_chk
	cbnz	w0, LBB0_7
; %bb.6:
Lloh17:
	adrp	x8, _PAUSE_FLOW_CTRL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PAUSE_FLOW_CTRL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
LBB0_7:
	mov	x0, x19
	mov	w1, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_sw_enable
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_BROADCAST_STORM_PROTECTION_RATE,4,2 ; @BROADCAST_STORM_PROTECTION_RATE
	.comm	_SWITCH_PORT_NUM,4,2            ; @SWITCH_PORT_NUM
	.comm	_STP_SUPPORT,4,2                ; @STP_SUPPORT
	.comm	_KS8842_SWITCH_CTRL_1_OFFSET,4,2 ; @KS8842_SWITCH_CTRL_1_OFFSET
	.comm	_SWITCH_TX_FLOW_CTRL,4,2        ; @SWITCH_TX_FLOW_CTRL
	.comm	_SWITCH_RX_FLOW_CTRL,4,2        ; @SWITCH_RX_FLOW_CTRL
	.comm	_PAUSE_FLOW_CTRL,4,2            ; @PAUSE_FLOW_CTRL
	.no_dead_strip	_sw_setup
.subsections_via_symbols
