	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_sp_vrs_lpm_tree_replace
_mlxsw_sp_vrs_lpm_tree_replace:         ## @mlxsw_sp_vrs_lpm_tree_replace
	.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, %r13
	movl	(%rsi), %ecx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	4(%rdx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rax,%rcx,8), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	4(%rax), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	8(%rdi), %edi
	movq	_MAX_VRS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MLXSW_CORE_RES_GET
	testl	%eax, %eax
	jle	LBB0_10
## %bb.1:
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r15
	movl	8(%r13), %edi
	movq	_MAX_VRS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MLXSW_CORE_RES_GET
	cltq
	addq	$4, %r14
	cmpq	%rax, %r15
	jge	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	8(%rax), %r12
	addq	%r14, %r12
	movq	%r12, %rdi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %esi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	callq	_mlxsw_sp_vr_lpm_tree_should_replace
	testl	%eax, %eax
	je	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_mlxsw_sp_vr_fib
	movq	%r13, %rdi
	movl	%eax, %esi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_mlxsw_sp_vr_lpm_tree_replace
	testl	%eax, %eax
	je	LBB0_9
## %bb.4:
	movl	%eax, %ebx
	testl	%r15d, %r15d
	je	LBB0_11
## %bb.5:
	incq	%r15
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	decl	%r15d
	cmpl	$1, %r15d
	jle	LBB0_11
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_mlxsw_sp_vr_lpm_tree_should_replace
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_mlxsw_sp_vr_fib
	movq	%r13, %rdi
	movl	%eax, %esi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_mlxsw_sp_vr_lpm_tree_replace
	jmp	LBB0_8
LBB0_10:
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %edi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %esi
	movl	$4, %edx
	callq	_memcpy
	movq	(%r13), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%r15, (%rax,%rcx,8)
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_mlxsw_sp_lpm_tree_put
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_VRS,4,2                    ## @MAX_VRS
	.no_dead_strip	_mlxsw_sp_vrs_lpm_tree_replace
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_sp_vrs_lpm_tree_replace
_mlxsw_sp_vrs_lpm_tree_replace:         ; @mlxsw_sp_vrs_lpm_tree_replace
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x2
	mov	x19, x0
	ldr	w20, [x1]
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x21, [x8, x20, lsl #3]
	ldr	w8, [x2, #4]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	ldr	w24, [x21, #4]
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x26, _MAX_VRS@GOTPAGE
Lloh1:
	ldr	x26, [x26, _MAX_VRS@GOTPAGEOFF]
	ldr	w1, [x26]
	bl	_MLXSW_CORE_RES_GET
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.1:
	mov	x27, #0
	mov	x28, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x28, x28, #1
	ldr	w0, [x19, #8]
	ldr	w1, [x26]
	bl	_MLXSW_CORE_RES_GET
	add	x27, x27, #4
	cmp	x28, w0, sxtw
	b.ge	LBB0_10
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x22, [x8, #8]
	add	x25, x22, x27
	mov	x0, x25
	mov	x1, x20
	mov	x2, x24
	bl	_mlxsw_sp_vr_lpm_tree_should_replace
	cbz	w0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x25
	mov	x1, x20
	bl	_mlxsw_sp_vr_fib
	mov	x1, x0
	mov	x0, x19
	mov	x2, x23
	bl	_mlxsw_sp_vr_lpm_tree_replace
	cbz	w0, LBB0_2
; %bb.5:
	mov	x25, x0
	cbz	w28, LBB0_11
; %bb.6:
	add	x24, x28, #1
	add	x23, x22, x27
	ldr	w22, [sp, #12]                  ; 4-byte Folded Reload
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	sub	w24, w24, #1
	cmp	w24, #1
	b.le	LBB0_11
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x20
	mov	x2, x22
	bl	_mlxsw_sp_vr_lpm_tree_should_replace
	cbz	w0, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x23
	mov	x1, x20
	bl	_mlxsw_sp_vr_fib
	mov	x1, x0
	mov	x0, x19
	mov	x2, x21
	bl	_mlxsw_sp_vr_lpm_tree_replace
	b	LBB0_7
LBB0_10:
	ldr	w0, [x23]
	ldr	w1, [x21]
	mov	w2, #4
	bl	_memcpy
	ldr	x8, [x19]
	ldr	x8, [x8]
	str	x23, [x8, x20, lsl #3]
	mov	x0, x19
	mov	x1, x21
	bl	_mlxsw_sp_lpm_tree_put
	mov	w25, #0
LBB0_11:
	mov	x0, x25
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_VRS,4,2                    ; @MAX_VRS
	.no_dead_strip	_mlxsw_sp_vrs_lpm_tree_replace
.subsections_via_symbols
