	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_sp_rif_destroy
_mlxsw_sp_rif_destroy:                  ## @mlxsw_sp_rif_destroy
	.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	%rdi, %rbx
	movq	40(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	32(%rdi), %r14
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mlxsw_sp_router_rif_gone_sync
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rax
	movq	8(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %r13
	movq	%rbx, %rdi
	callq	_mlxsw_sp_rif_counters_free
	movq	_MLXSW_SP_L3_PROTO_MAX@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_3
## %bb.1:
	movq	%r13, %rax
	shlq	$4, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax), %r12
	addq	$8, %r12
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movl	(%rax,%r14,4), %edi
	movq	%rbx, %rsi
	callq	_mlxsw_sp_mr_rif_del
	incq	%r14
	movslq	(%r15), %rax
	cmpq	%rax, %r14
	jl	LBB0_2
LBB0_3:
	movq	%rbx, %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	callq	*(%rax)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_mlxsw_sp_fid_put
LBB0_5:
	shlq	$4, %r13
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	leaq	(%r12,%r13), %r15
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	8(%rbx), %rcx
	movq	$0, (%rax,%rcx,8)
	movl	16(%rbx), %edi
	callq	_dev_put
	movq	%rbx, %rdi
	callq	_kfree
	decl	(%r12,%r13)
	movq	%r14, %rdi
	movq	%r15, %rsi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mlxsw_sp_vr_put                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MLXSW_SP_L3_PROTO_MAX,4,2      ## @MLXSW_SP_L3_PROTO_MAX
	.no_dead_strip	_mlxsw_sp_rif_destroy
.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_destroy
_mlxsw_sp_rif_destroy:                  ; @mlxsw_sp_rif_destroy
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	ldp	x19, x24, [x0, #32]
	ldr	x21, [x0, #24]
	mov	x0, x19
	mov	x1, x20
	bl	_mlxsw_sp_router_rif_gone_sync
	ldr	x8, [x19]
	ldr	x22, [x8, #8]
	ldr	x23, [x20]
	mov	x0, x20
	bl	_mlxsw_sp_rif_counters_free
Lloh0:
	adrp	x25, _MLXSW_SP_L3_PROTO_MAX@GOTPAGE
Lloh1:
	ldr	x25, [x25, _MLXSW_SP_L3_PROTO_MAX@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x26, #0
	add	x8, x22, x23, lsl #4
	add	x27, x8, #8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	ldr	w0, [x8, x26, lsl #2]
	mov	x1, x20
	bl	_mlxsw_sp_mr_rif_del
	add	x26, x26, #1
	ldrsw	x8, [x25]
	cmp	x26, x8
	b.lt	LBB0_2
LBB0_3:
	ldr	x8, [x24]
	mov	x0, x20
	blr	x8
	cbz	x21, LBB0_5
; %bb.4:
	mov	x0, x21
	bl	_mlxsw_sp_fid_put
LBB0_5:
	add	x21, x22, x23, lsl #4
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	str	xzr, [x8, x9, lsl #3]
	ldr	w0, [x20, #16]
	bl	_dev_put
	mov	x0, x20
	bl	_kfree
	ldr	w8, [x21]
	sub	w8, w8, #1
	str	w8, [x21]
	mov	x0, x19
	mov	x1, 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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_mlxsw_sp_vr_put
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MLXSW_SP_L3_PROTO_MAX,4,2      ; @MLXSW_SP_L3_PROTO_MAX
	.no_dead_strip	_mlxsw_sp_rif_destroy
.subsections_via_symbols
