	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sja1105_init_l2_forwarding
_sja1105_init_l2_forwarding:            ## @sja1105_init_l2_forwarding
	.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	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r12
	movq	_BLK_IDX_L2_FORWARDING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %rbx
	leaq	(%r12,%rbx,8), %r14
	cmpq	$0, 8(%r12,%rbx,8)
	je	LBB0_2
## %bb.1:
	movq	(%r14), %rdi
	callq	_kfree
	movq	$0, 8(%r14)
LBB0_2:
	movq	_SJA1105_MAX_L2_FORWARDING_COUNT@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	movq	16(%r12,%rbx,8), %rax
	movl	(%rax), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_kcalloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	movq	(%r15), %rax
	movq	%rax, 8(%r14)
	movq	_SJA1105_NUM_PORTS@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_12
## %bb.5:
	xorl	%r15d, %r15d
	movq	_SJA1105_NUM_TC@GOTPCREL(%rip), %r14
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%r15
	movslq	(%r13), %rax
	cmpq	%rax, %r15
	jge	LBB0_12
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_dsa_upstream_port
	movl	%eax, %r12d
	cmpl	$0, (%r14)
	jle	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%rbx,%r15,8), %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ecx, (%rax,%rcx,4)
	incq	%rcx
	movslq	(%r14), %rdx
	cmpq	%rdx, %rcx
	jl	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	%r12d, %eax
	cmpq	%rax, %r15
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	movl	$1, %ecx
	callq	_sja1105_port_allow_traffic
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	%r15d, %edx
	movl	$1, %ecx
	callq	_sja1105_port_allow_traffic
	jmp	LBB0_11
LBB0_12:
	movq	_SJA1105_NUM_TC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	testl	%esi, %esi
	jle	LBB0_19
## %bb.13:
	xorl	%edx, %edx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	incl	%edx
	cmpl	%esi, %edx
	jge	LBB0_19
LBB0_14:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
	testl	%eax, %eax
	jle	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addl	%edx, %eax
	cltq
	movq	(%rbx,%rax,8), %rax
	movl	%edx, (%rax,%rsi,4)
	incq	%rsi
	movslq	(%r13), %rax
	cmpq	%rax, %rsi
	jl	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	(%rcx), %esi
	jmp	LBB0_18
LBB0_19:
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_20:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BLK_IDX_L2_FORWARDING,8,3      ## @BLK_IDX_L2_FORWARDING
	.comm	_SJA1105_MAX_L2_FORWARDING_COUNT,8,3 ## @SJA1105_MAX_L2_FORWARDING_COUNT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SJA1105_NUM_PORTS,4,2          ## @SJA1105_NUM_PORTS
	.comm	_SJA1105_NUM_TC,4,2             ## @SJA1105_NUM_TC
	.no_dead_strip	_sja1105_init_l2_forwarding
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sja1105_init_l2_forwarding
_sja1105_init_l2_forwarding:            ; @sja1105_init_l2_forwarding
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x8, _BLK_IDX_L2_FORWARDING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BLK_IDX_L2_FORWARDING@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	mov	w8, #24
	madd	x22, x23, x8, x19
	mov	x21, x22
	ldr	x8, [x21, #8]!
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x0, [x22]
	bl	_kfree
	str	xzr, [x21]
LBB0_2:
Lloh3:
	adrp	x24, _SJA1105_MAX_L2_FORWARDING_COUNT@GOTPAGE
Lloh4:
	ldr	x24, [x24, _SJA1105_MAX_L2_FORWARDING_COUNT@GOTPAGEOFF]
	ldr	x0, [x24]
	mov	w8, #24
	madd	x8, x23, x8, x19
	ldr	x8, [x8, #16]
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	bl	_kcalloc
	str	x0, [x22]
	cbz	x0, LBB0_11
; %bb.3:
	mov	x19, x0
	ldr	x8, [x24]
	str	x8, [x21]
Lloh8:
	adrp	x23, _SJA1105_NUM_PORTS@GOTPAGE
Lloh9:
	ldr	x23, [x23, _SJA1105_NUM_PORTS@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh10:
	adrp	x24, _SJA1105_NUM_TC@GOTPAGE
Lloh11:
	ldr	x24, [x24, _SJA1105_NUM_TC@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.4:
	mov	x21, #0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x23]
	cmp	x21, x8
	b.ge	LBB0_12
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	w0, [x20]
	mov	x1, x21
	bl	_dsa_upstream_port
	mov	x22, x0
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x8, #0
	ldr	x9, [x19, x21, lsl #3]
LBB0_8:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	str	w8, [x9, x8, lsl #2]
	add	x8, x8, #1
	ldrsw	x10, [x24]
	cmp	x8, x10
	b.lt	LBB0_8
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	cmp	x21, w22, uxtw
	b.eq	LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	mov	w3, #1
	bl	_sja1105_port_allow_traffic
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	mov	w3, #1
	bl	_sja1105_port_allow_traffic
	b	LBB0_5
LBB0_11:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_21
LBB0_12:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
LBB0_13:
	ldr	w10, [x24]
	cmp	w10, #1
	b.lt	LBB0_20
; %bb.14:
	mov	w9, #0
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	add	w9, w9, #1
	cmp	w9, w10
	b.ge	LBB0_20
LBB0_16:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x10, #0
LBB0_18:                                ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w8, w8, w9
	ldr	x8, [x19, w8, sxtw #3]
	str	w9, [x8, x10, lsl #2]
	add	x10, x10, #1
	ldrsw	x8, [x23]
	cmp	x10, x8
	b.lt	LBB0_18
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w10, [x24]
	b	LBB0_15
LBB0_20:
	mov	w0, #0
LBB0_21:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_BLK_IDX_L2_FORWARDING,8,3      ; @BLK_IDX_L2_FORWARDING
	.comm	_SJA1105_MAX_L2_FORWARDING_COUNT,8,3 ; @SJA1105_MAX_L2_FORWARDING_COUNT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SJA1105_NUM_PORTS,4,2          ; @SJA1105_NUM_PORTS
	.comm	_SJA1105_NUM_TC,4,2             ; @SJA1105_NUM_TC
	.no_dead_strip	_sja1105_init_l2_forwarding
.subsections_via_symbols
