	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_sp1_resources_kvd_register
_mlxsw_sp1_resources_kvd_register:      ## @mlxsw_sp1_resources_kvd_register
	.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
	callq	_priv_to_devlink
	movq	%rax, %r12
	movq	_KVD_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_MLXSW_CORE_RES_VALID
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	-72(%rbp), %r15
	leaq	-48(%rbp), %rdx
	leaq	-56(%rbp), %rcx
	leaq	-64(%rbp), %r8
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_mlxsw_sp_resource_size_params_prepare
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_MLXSW_CORE_RES_GET
	movq	%rax, %r14
	movq	_MLXSW_SP_RESOURCE_NAME_KVD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MLXSW_SP_RESOURCE_KVD@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	_DEVLINK_RESOURCE_ID_PARENT_TOP@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rdi
	movq	%r14, %rdx
	movq	%r15, %r9
	callq	_devlink_resource_register
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:
	movq	_mlxsw_sp1_config_profile@GOTPCREL(%rip), %rax
	movq	16(%rax), %r15
	movq	_MLXSW_SP_RESOURCE_NAME_KVD_LINEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MLXSW_SP_RESOURCE_KVD_LINEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	(%r13), %r8d
	leaq	-48(%rbp), %r9
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_devlink_resource_register
	testl	%eax, %eax
	jne	LBB0_10
## %bb.4:
	movq	%rbx, %rdi
	callq	_mlxsw_sp1_kvdl_resources_register
	testl	%eax, %eax
	jne	LBB0_10
## %bb.5:
	movq	%r14, %rax
	subq	%r15, %rax
	movq	_mlxsw_sp1_config_profile@GOTPCREL(%rip), %rdx
	movq	8(%rdx), %rcx
	imulq	%rcx, %rax
	addq	(%rdx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_6
## %bb.7:
	cqto
	idivq	%rcx
	jmp	LBB0_8
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_8:
	movq	_MLXSW_SP_KVD_GRANULARITY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_rounddown
	movq	%rax, %rbx
	movq	_MLXSW_SP_RESOURCE_NAME_KVD_HASH_DOUBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	(%r13), %r8d
	leaq	-56(%rbp), %r9
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_devlink_resource_register
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	addq	%rbx, %r15
	subq	%r15, %r14
	movq	_MLXSW_SP_RESOURCE_NAME_KVD_HASH_SINGLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MLXSW_SP_RESOURCE_KVD_HASH_SINGLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	(%r13), %r8d
	leaq	-64(%rbp), %r9
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_devlink_resource_register
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_mlxsw_sp1_config_profile,24,3  ## @mlxsw_sp1_config_profile
	.comm	_KVD_SIZE,4,2                   ## @KVD_SIZE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MLXSW_SP_RESOURCE_NAME_KVD,4,2 ## @MLXSW_SP_RESOURCE_NAME_KVD
	.comm	_MLXSW_SP_RESOURCE_KVD,4,2      ## @MLXSW_SP_RESOURCE_KVD
	.comm	_DEVLINK_RESOURCE_ID_PARENT_TOP,4,2 ## @DEVLINK_RESOURCE_ID_PARENT_TOP
	.comm	_MLXSW_SP_RESOURCE_NAME_KVD_LINEAR,4,2 ## @MLXSW_SP_RESOURCE_NAME_KVD_LINEAR
	.comm	_MLXSW_SP_RESOURCE_KVD_LINEAR,4,2 ## @MLXSW_SP_RESOURCE_KVD_LINEAR
	.comm	_MLXSW_SP_KVD_GRANULARITY,4,2   ## @MLXSW_SP_KVD_GRANULARITY
	.comm	_MLXSW_SP_RESOURCE_NAME_KVD_HASH_DOUBLE,4,2 ## @MLXSW_SP_RESOURCE_NAME_KVD_HASH_DOUBLE
	.comm	_MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE,4,2 ## @MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE
	.comm	_MLXSW_SP_RESOURCE_NAME_KVD_HASH_SINGLE,4,2 ## @MLXSW_SP_RESOURCE_NAME_KVD_HASH_SINGLE
	.comm	_MLXSW_SP_RESOURCE_KVD_HASH_SINGLE,4,2 ## @MLXSW_SP_RESOURCE_KVD_HASH_SINGLE
	.no_dead_strip	_mlxsw_sp1_resources_kvd_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_sp1_resources_kvd_register
_mlxsw_sp1_resources_kvd_register:      ; @mlxsw_sp1_resources_kvd_register
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x0
	bl	_priv_to_devlink
	mov	x19, x0
Lloh0:
	adrp	x20, _KVD_SIZE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _KVD_SIZE@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x21
	bl	_MLXSW_CORE_RES_VALID
	cbz	w0, LBB0_6
; %bb.1:
	mov	x1, sp
	add	x2, sp, #8
	add	x3, sp, #16
	add	x4, sp, #24
	mov	x0, x21
	bl	_mlxsw_sp_resource_size_params_prepare
	ldr	w1, [x20]
	mov	x0, x21
	bl	_MLXSW_CORE_RES_GET
	mov	x20, x0
Lloh2:
	adrp	x8, _MLXSW_SP_RESOURCE_NAME_KVD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MLXSW_SP_RESOURCE_NAME_KVD@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x23, _MLXSW_SP_RESOURCE_KVD@GOTPAGE
Lloh6:
	ldr	x23, [x23, _MLXSW_SP_RESOURCE_KVD@GOTPAGEOFF]
	ldr	w3, [x23]
Lloh7:
	adrp	x8, _DEVLINK_RESOURCE_ID_PARENT_TOP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DEVLINK_RESOURCE_ID_PARENT_TOP@GOTPAGEOFF]
Lloh9:
	ldr	w4, [x8]
	mov	x5, sp
	mov	x0, x19
	mov	x2, x20
	bl	_devlink_resource_register
	cbnz	w0, LBB0_7
; %bb.2:
Lloh10:
	adrp	x24, _mlxsw_sp1_config_profile@GOTPAGE
Lloh11:
	ldr	x24, [x24, _mlxsw_sp1_config_profile@GOTPAGEOFF]
Lloh12:
	adrp	x8, _MLXSW_SP_RESOURCE_NAME_KVD_LINEAR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MLXSW_SP_RESOURCE_NAME_KVD_LINEAR@GOTPAGEOFF]
	ldr	x22, [x24, #16]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _MLXSW_SP_RESOURCE_KVD_LINEAR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MLXSW_SP_RESOURCE_KVD_LINEAR@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	ldr	w4, [x23]
	add	x5, sp, #8
	mov	x0, x19
	mov	x2, x22
	bl	_devlink_resource_register
	cbnz	w0, LBB0_7
; %bb.3:
	mov	x0, x21
	bl	_mlxsw_sp1_kvdl_resources_register
	cbnz	w0, LBB0_7
; %bb.4:
	sub	x8, x20, x22
	ldp	x10, x9, [x24]
	mul	x8, x9, x8
	add	x9, x10, x9
Lloh18:
	adrp	x10, _MLXSW_SP_KVD_GRANULARITY@GOTPAGE
Lloh19:
	ldr	x10, [x10, _MLXSW_SP_KVD_GRANULARITY@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x10]
	sdiv	x0, x8, x9
	bl	_rounddown
	mov	x21, x0
Lloh21:
	adrp	x8, _MLXSW_SP_RESOURCE_NAME_KVD_HASH_DOUBLE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MLXSW_SP_RESOURCE_NAME_KVD_HASH_DOUBLE@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE@GOTPAGEOFF]
Lloh26:
	ldr	w3, [x8]
	ldr	w4, [x23]
	add	x5, sp, #16
	mov	x0, x19
	mov	x2, x21
	bl	_devlink_resource_register
	cbnz	w0, LBB0_7
; %bb.5:
Lloh27:
	adrp	x8, _MLXSW_SP_RESOURCE_NAME_KVD_HASH_SINGLE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MLXSW_SP_RESOURCE_NAME_KVD_HASH_SINGLE@GOTPAGEOFF]
	add	x9, x22, x21
	sub	x2, x20, x9
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x8, _MLXSW_SP_RESOURCE_KVD_HASH_SINGLE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _MLXSW_SP_RESOURCE_KVD_HASH_SINGLE@GOTPAGEOFF]
Lloh32:
	ldr	w3, [x8]
	ldr	w4, [x23]
	add	x5, sp, #24
	mov	x0, x19
	bl	_devlink_resource_register
	b	LBB0_7
LBB0_6:
Lloh33:
	adrp	x8, _EIO@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_mlxsw_sp1_config_profile,24,3  ; @mlxsw_sp1_config_profile
	.comm	_KVD_SIZE,4,2                   ; @KVD_SIZE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MLXSW_SP_RESOURCE_NAME_KVD,4,2 ; @MLXSW_SP_RESOURCE_NAME_KVD
	.comm	_MLXSW_SP_RESOURCE_KVD,4,2      ; @MLXSW_SP_RESOURCE_KVD
	.comm	_DEVLINK_RESOURCE_ID_PARENT_TOP,4,2 ; @DEVLINK_RESOURCE_ID_PARENT_TOP
	.comm	_MLXSW_SP_RESOURCE_NAME_KVD_LINEAR,4,2 ; @MLXSW_SP_RESOURCE_NAME_KVD_LINEAR
	.comm	_MLXSW_SP_RESOURCE_KVD_LINEAR,4,2 ; @MLXSW_SP_RESOURCE_KVD_LINEAR
	.comm	_MLXSW_SP_KVD_GRANULARITY,4,2   ; @MLXSW_SP_KVD_GRANULARITY
	.comm	_MLXSW_SP_RESOURCE_NAME_KVD_HASH_DOUBLE,4,2 ; @MLXSW_SP_RESOURCE_NAME_KVD_HASH_DOUBLE
	.comm	_MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE,4,2 ; @MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE
	.comm	_MLXSW_SP_RESOURCE_NAME_KVD_HASH_SINGLE,4,2 ; @MLXSW_SP_RESOURCE_NAME_KVD_HASH_SINGLE
	.comm	_MLXSW_SP_RESOURCE_KVD_HASH_SINGLE,4,2 ; @MLXSW_SP_RESOURCE_KVD_HASH_SINGLE
	.no_dead_strip	_mlxsw_sp1_resources_kvd_register
.subsections_via_symbols
