	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_sp_ul_rif_create
_mlxsw_sp_ul_rif_create:                ## @mlxsw_sp_ul_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r14
	leaq	-40(%rbp), %rsi
	callq	_mlxsw_sp_rif_index_alloc
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_NL_SET_ERR_MSG_MOD
LBB0_6:
	movl	%r15d, %edi
	callq	_ERR_PTR
	movq	%rax, %rbx
LBB0_7:
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	-40(%rbp), %rsi
	movl	(%r12), %edx
	xorl	%r15d, %r15d
	movl	$8, %edi
	xorl	%ecx, %ecx
	callq	_mlxsw_sp_rif_alloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	-40(%rbp), %rcx
	movq	%rbx, (%rax,%rcx,8)
	movq	%r14, (%rbx)
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_mlxsw_sp_rif_ipip_lb_ul_rif_op
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %r15d
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	-40(%rbp), %rcx
	movq	$0, (%rax,%rcx,8)
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_6
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Exceeded number of supported router interfaces"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_mlxsw_sp_ul_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_ul_rif_create
_mlxsw_sp_ul_rif_create:                ; @mlxsw_sp_ul_rif_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	add	x1, sp, #8
	bl	_mlxsw_sp_rif_index_alloc
	cbz	w0, LBB0_4
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_NL_SET_ERR_MSG_MOD
LBB0_2:
	mov	x0, x21
	bl	_ERR_PTR
	mov	x20, x0
LBB0_3:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
LBB0_4:
	ldr	x1, [sp, #8]
	ldr	w2, [x22]
	mov	w0, #8
	mov	x3, #0
	bl	_mlxsw_sp_rif_alloc
	cbz	x0, LBB0_7
; %bb.5:
	mov	x20, x0
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x9, [sp, #8]
	str	x0, [x8, x9, lsl #3]
	str	x19, [x0]
	mov	w1, #1
	bl	_mlxsw_sp_rif_ipip_lb_ul_rif_op
	cbz	w0, LBB0_3
; %bb.6:
	mov	x21, x0
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x9, [sp, #8]
	str	xzr, [x8, x9, lsl #3]
	mov	x0, x20
	bl	_kfree
	b	LBB0_2
LBB0_7:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Exceeded number of supported router interfaces"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_mlxsw_sp_ul_rif_create
.subsections_via_symbols
