	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_sp_rif_create
_mlxsw_sp_rif_create:                   ## @mlxsw_sp_rif_create
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	(%rsi), %edi
	callq	_l3mdev_fib_table
	movq	%rax, %rbx
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_mlxsw_sp_dev_rif_type
	movq	8(%r12), %rcx
	movl	%eax, %eax
	testq	%rbx, %rbx
	jne	LBB0_2
## %bb.1:
	movq	_RT_TABLE_MAIN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
LBB0_2:
	movq	(%rcx,%rax,8), %r13
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	_mlxsw_sp_vr_get
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.29:
	movq	%rbx, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_CAST                       ## TAILCALL
LBB0_3:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	incl	(%rbx)
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	_mlxsw_sp_rif_index_alloc
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_NL_SET_ERR_MSG_MOD
	jmp	LBB0_5
LBB0_6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	32(%rax), %edi
	movq	-56(%rbp), %rsi
	movl	16(%rbx), %edx
	movl	(%r14), %ecx
	callq	_mlxsw_sp_rif_alloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r13
	movl	(%rax), %edi
	callq	_dev_hold
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rcx
	movq	%r13, (%rax,%rcx,8)
	movq	%r12, 24(%r13)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r13)
	movq	24(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.10:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	*%rcx
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	%r13, %r14
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %r13d
	jmp	LBB0_12
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_5
LBB0_9:
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_13:
	movq	%r15, 8(%r13)
LBB0_14:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rax
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	*%rax
LBB0_16:
	movq	%r13, %r14
	movq	%r13, %rdi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	callq	*(%rax)
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_17
## %bb.24:
	testq	%r15, %r15
	je	LBB0_12
LBB0_25:
	movq	%r15, %rdi
	callq	_mlxsw_sp_fid_put
LBB0_12:
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rcx
	movq	$0, (%rax,%rcx,8)
	movl	(%r14), %edi
	callq	_dev_put
	movq	%r14, %rdi
	callq	_kfree
LBB0_5:
	decl	(%rbx)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_mlxsw_sp_vr_put
	movl	%r13d, %edi
	callq	_ERR_PTR
	movq	%rax, %r14
LBB0_28:
	movq	%r14, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	_MLXSW_SP_L3_PROTO_MAX@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_27
## %bb.18:
	movq	%rbx, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movl	(%rax,%rbx,4), %edi
	movq	%r14, %rsi
	callq	_mlxsw_sp_mr_rif_add
	testl	%eax, %eax
	jne	LBB0_20
## %bb.26:                              ##   in Loop: Header=BB0_19 Depth=1
	incq	%rbx
	movq	_MLXSW_SP_L3_PROTO_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	LBB0_19
LBB0_27:
	movq	%r14, %rdi
	callq	_mlxsw_sp_rif_counters_alloc
	jmp	LBB0_28
LBB0_20:
	movl	%eax, %r13d
	testl	%ebx, %ebx
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %r15
	je	LBB0_23
## %bb.21:
	incq	%rbx
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	-8(%rax,%rbx,4), %edi
	movq	%r15, %rsi
	callq	_mlxsw_sp_mr_rif_del
	decq	%rbx
	cmpq	$1, %rbx
	jg	LBB0_22
LBB0_23:
	movq	%r15, %rdi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	callq	*8(%rax)
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	testq	%r15, %r15
	jne	LBB0_25
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_RT_TABLE_MAIN,4,2              ## @RT_TABLE_MAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Exceeded number of supported router interfaces"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MLXSW_SP_L3_PROTO_MAX,4,2      ## @MLXSW_SP_L3_PROTO_MAX
	.no_dead_strip	_mlxsw_sp_rif_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_sp_rif_create
_mlxsw_sp_rif_create:                   ; @mlxsw_sp_rif_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x1]
	bl	_l3mdev_fib_table
	mov	x20, x0
	ldr	w1, [x22]
	mov	x0, x19
	bl	_mlxsw_sp_dev_rif_type
	ldr	x8, [x19, #8]
	ldr	x25, [x8, w0, uxtw #3]
Lloh0:
	adrp	x8, _RT_TABLE_MAIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RT_TABLE_MAIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	x20, #0
	csel	w1, w8, w20, eq
	mov	x0, x19
	mov	x2, x23
	bl	_mlxsw_sp_vr_get
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	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
	add	sp, sp, #96
	b	_ERR_CAST
LBB0_2:
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	add	x1, sp, #8
	mov	x0, x19
	bl	_mlxsw_sp_rif_index_alloc
	cbz	w0, LBB0_4
; %bb.3:
	mov	x24, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	bl	_NL_SET_ERR_MSG_MOD
	b	LBB0_15
LBB0_4:
	ldr	w0, [x25, #32]
	ldr	x1, [sp, #8]
	ldr	w2, [x20, #16]
	ldr	w3, [x22]
	bl	_mlxsw_sp_rif_alloc
	cbz	x0, LBB0_8
; %bb.5:
	mov	x21, x0
	ldr	w0, [x0]
	bl	_dev_hold
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x9, [sp, #8]
	str	x21, [x8, x9, lsl #3]
	stp	x25, x19, [x21, #16]
	ldr	x8, [x25, #24]
	cbz	x8, LBB0_9
; %bb.6:
	mov	x0, x21
	mov	x1, x23
	blr	x8
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_17
; %bb.7:
	mov	x0, x23
	bl	_PTR_ERR
	mov	x24, x0
	b	LBB0_14
LBB0_8:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_15
LBB0_9:
	mov	x23, #0
	ldr	x8, [x25, #16]
	cbz	x8, LBB0_11
LBB0_10:
	mov	x0, x21
	mov	x1, x22
	blr	x8
LBB0_11:
	ldr	x8, [x25]
	mov	x0, x21
	blr	x8
	mov	x24, x0
	cbz	w0, LBB0_18
; %bb.12:
	cbz	x23, LBB0_14
LBB0_13:
	mov	x0, x23
	bl	_mlxsw_sp_fid_put
LBB0_14:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x9, [sp, #8]
	str	xzr, [x8, x9, lsl #3]
	ldr	w0, [x21]
	bl	_dev_put
	mov	x0, x21
	bl	_kfree
LBB0_15:
	ldr	w8, [x20]
	sub	w8, w8, #1
	str	w8, [x20]
	mov	x0, x19
	mov	x1, x20
	bl	_mlxsw_sp_vr_put
	mov	x0, x24
	bl	_ERR_PTR
	mov	x21, x0
LBB0_16:
	mov	x0, x21
	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
	add	sp, sp, #96
	ret
LBB0_17:
	str	x23, [x21, #8]
	ldr	x8, [x25, #16]
	cbnz	x8, LBB0_10
	b	LBB0_11
LBB0_18:
Lloh8:
	adrp	x22, _MLXSW_SP_L3_PROTO_MAX@GOTPAGE
Lloh9:
	ldr	x22, [x22, _MLXSW_SP_L3_PROTO_MAX@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.19:
	mov	x26, #0
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	w0, [x8, x26, lsl #2]
	mov	x1, x21
	bl	_mlxsw_sp_mr_rif_add
	cbnz	w0, LBB0_23
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x22]
	cmp	x26, x8
	b.lt	LBB0_20
LBB0_22:
	mov	x0, x21
	bl	_mlxsw_sp_rif_counters_alloc
	b	LBB0_16
LBB0_23:
	mov	x24, x0
	cbz	w26, LBB0_26
; %bb.24:
	sub	x22, x26, #1
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	w0, [x8, x22, lsl #2]
	mov	x1, x21
	bl	_mlxsw_sp_mr_rif_del
	add	x8, x22, #1
	sub	x22, x22, #1
	cmp	x8, #1
	b.gt	LBB0_25
LBB0_26:
	ldr	x8, [x25, #8]
	mov	x0, x21
	blr	x8
	cbnz	x23, LBB0_13
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_RT_TABLE_MAIN,4,2              ; @RT_TABLE_MAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Exceeded number of supported router interfaces"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MLXSW_SP_L3_PROTO_MAX,4,2      ; @MLXSW_SP_L3_PROTO_MAX
	.no_dead_strip	_mlxsw_sp_rif_create
.subsections_via_symbols
