	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sja1105pqrs_fdb_add            ## -- Begin function sja1105pqrs_fdb_add
	.p2align	4, 0x90
_sja1105pqrs_fdb_add:                   ## @sja1105pqrs_fdb_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movl	%esi, %r13d
	movq	%rdi, %r15
	xorps	%xmm0, %xmm0
	movups	%xmm0, -72(%rbp)
	movups	%xmm0, -88(%rbp)
	movq	$0, -56(%rbp)
	movq	16(%rdi), %r12
	movq	%rdx, %rdi
	callq	_ether_addr_to_u64
	movl	%eax, -60(%rbp)
	movl	%ebx, -64(%rbp)
	movq	_SJA1105_S_TAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	-1(,%rax,8), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_GENMASK_ULL
	movl	%eax, -72(%rbp)
	movslq	%r13d, %rdi
	shlq	$2, %rdi
	addq	8(%r15), %rdi
	callq	_dsa_port_is_vlan_filtering
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_VLAN_VID_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	xorl	%edi, %edi
	callq	_BIT
	movl	%eax, %r14d
	jmp	LBB0_3
LBB0_1:
	xorl	%ebx, %ebx
LBB0_3:
	movq	%rbx, -80(%rbp)
	movl	%r14d, -96(%rbp)
	movl	%r13d, %edi
	callq	_BIT
	movl	%eax, -92(%rbp)
	movl	%r13d, %ebx
	movq	_BLK_IDX_L2_LOOKUP@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_SJA1105_SEARCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-96(%rbp), %rcx
	movq	%r12, %rdi
	callq	_sja1105_dynamic_config_read
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	_SJA1105_MAX_L2_LOOKUP_COUNT@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	LBB0_10
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	callq	_sja1105_dynamic_config_read
	testl	%eax, %eax
	js	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%ebx
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	jl	LBB0_5
LBB0_10:
	cmpl	%eax, %ebx
	jne	LBB0_12
LBB0_11:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_15
LBB0_7:
	movl	-92(%rbp), %r14d
	movl	%ebx, %edi
	callq	_BIT
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%r14d, %ecx
	jne	LBB0_15
## %bb.8:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_BIT
	orl	%eax, -92(%rbp)
	movl	-84(%rbp), %ebx
	jmp	LBB0_13
LBB0_6:
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	je	LBB0_11
LBB0_12:
	movl	$1, -88(%rbp)
	movl	%ebx, -84(%rbp)
LBB0_13:
	movl	(%r13), %esi
	leaq	-96(%rbp), %rcx
	movq	%r12, %rdi
	movl	%ebx, %edx
	movl	$1, %r8d
	callq	_sja1105_dynamic_config_write
	testl	%eax, %eax
	js	LBB0_15
## %bb.14:
	leaq	-96(%rbp), %rdx
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	$1, %ecx
	callq	_sja1105_static_fdb_change
LBB0_15:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SJA1105_S_TAG,4,2              ## @SJA1105_S_TAG
	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_VLAN_VID_MASK,8,3              ## @VLAN_VID_MASK
	.comm	_BLK_IDX_L2_LOOKUP,4,2          ## @BLK_IDX_L2_LOOKUP
	.comm	_SJA1105_SEARCH,4,2             ## @SJA1105_SEARCH
	.comm	_SJA1105_MAX_L2_LOOKUP_COUNT,4,2 ## @SJA1105_MAX_L2_LOOKUP_COUNT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FDB is full, cannot add entry.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sja1105pqrs_fdb_add            ; -- Begin function sja1105pqrs_fdb_add
	.p2align	2
_sja1105pqrs_fdb_add:                   ; @sja1105pqrs_fdb_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x22, x3
	mov	x19, x1
	mov	x21, x0
	str	xzr, [sp, #40]
	movi.2d	v0, #0000000000000000
	stur	q0, [sp, #24]
	stur	q0, [sp, #8]
	ldr	x20, [x0, #16]
	mov	x0, x2
	bl	_ether_addr_to_u64
	str	w0, [sp, #36]
Lloh0:
	adrp	x8, _SJA1105_S_TAG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SJA1105_S_TAG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	stp	w8, w22, [sp, #28]
Lloh3:
	adrp	x8, _ETH_ALEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETH_ALEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	w8, w8, #3
	sub	w0, w8, #1
	mov	w1, #0
	bl	_GENMASK_ULL
	str	w0, [sp, #24]
	ldr	x8, [x21, #8]
	add	x0, x8, w19, sxtw #2
	bl	_dsa_port_is_vlan_filtering
	cbz	x0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _VLAN_VID_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VLAN_VID_MASK@GOTPAGEOFF]
Lloh8:
	ldr	x22, [x8]
	mov	w0, #0
	bl	_BIT
	b	LBB0_3
LBB0_2:
	mov	x22, #0
LBB0_3:
	str	x22, [sp, #16]
	str	w0, [sp]
	mov	x0, x19
	bl	_BIT
	str	w0, [sp, #4]
Lloh9:
	adrp	x23, _BLK_IDX_L2_LOOKUP@GOTPAGE
Lloh10:
	ldr	x23, [x23, _BLK_IDX_L2_LOOKUP@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh11:
	adrp	x8, _SJA1105_SEARCH@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SJA1105_SEARCH@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x3, sp
	mov	x0, x20
	bl	_sja1105_dynamic_config_read
	cbz	w0, LBB0_8
; %bb.4:
Lloh14:
	adrp	x24, _SJA1105_MAX_L2_LOOKUP_COUNT@GOTPAGE
Lloh15:
	ldr	x24, [x24, _SJA1105_MAX_L2_LOOKUP_COUNT@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.5:
	mov	w22, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x20
	mov	x2, x22
	mov	x3, #0
	bl	_sja1105_dynamic_config_read
	tbnz	w0, #31, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w22, w22, #1
	ldr	w8, [x24]
	cmp	w22, w8
	b.lt	LBB0_6
	b	LBB0_11
LBB0_8:
	ldr	w21, [sp, #4]
	mov	x0, x19
	bl	_BIT
	tst	w0, w21
	b.eq	LBB0_15
; %bb.9:
	mov	w0, #0
	b	LBB0_18
LBB0_10:
	mov	w22, #0
LBB0_11:
	cmp	w22, w8
	b.ne	LBB0_14
LBB0_12:
	ldr	w0, [x21]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_18
LBB0_13:
	ldr	w8, [x24]
	cmp	w22, w8
	b.eq	LBB0_12
LBB0_14:
	mov	w8, #1
	stp	w8, w22, [sp, #8]
	b	LBB0_16
LBB0_15:
	mov	x0, x19
	bl	_BIT
	ldr	w8, [sp, #4]
	ldr	w22, [sp, #12]
	orr	w8, w8, w0
	str	w8, [sp, #4]
LBB0_16:
	ldr	w1, [x23]
	mov	x3, sp
	mov	x0, x20
	mov	x2, x22
	mov	w4, #1
	bl	_sja1105_dynamic_config_write
	tbnz	w0, #31, LBB0_18
; %bb.17:
	mov	x2, sp
	mov	x0, x20
	mov	x1, x19
	mov	w3, #1
	bl	_sja1105_static_fdb_change
LBB0_18:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SJA1105_S_TAG,4,2              ; @SJA1105_S_TAG
	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_VLAN_VID_MASK,8,3              ; @VLAN_VID_MASK
	.comm	_BLK_IDX_L2_LOOKUP,4,2          ; @BLK_IDX_L2_LOOKUP
	.comm	_SJA1105_SEARCH,4,2             ; @SJA1105_SEARCH
	.comm	_SJA1105_MAX_L2_LOOKUP_COUNT,4,2 ; @SJA1105_MAX_L2_LOOKUP_COUNT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FDB is full, cannot add entry.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
