	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_sp_kvd_sizes_get
_mlxsw_sp_kvd_sizes_get:                ## @mlxsw_sp_kvd_sizes_get
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %rbx
	movq	%rcx, %r15
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r12
	callq	_priv_to_devlink
	movq	%rax, %r13
	movq	_KVD_SINGLE_MIN_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_MLXSW_CORE_RES_VALID
	testl	%eax, %eax
	je	LBB0_15
## %bb.1:
	movq	_KVD_DOUBLE_MIN_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_MLXSW_CORE_RES_VALID
	testl	%eax, %eax
	je	LBB0_15
## %bb.2:
	movq	_MLXSW_SP_RESOURCE_KVD_LINEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movq	%rbx, %rdx
	callq	_devlink_resource_size_get
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	(%r14), %rax
	movq	%rax, (%rbx)
LBB0_4:
	movq	_MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movq	%r15, %rdx
	callq	_devlink_resource_size_get
	testl	%eax, %eax
	je	LBB0_9
## %bb.5:
	movq	_KVD_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_MLXSW_CORE_RES_GET
	subq	(%rbx), %rax
	movq	16(%r14), %rcx
	imulq	%rcx, %rax
	addq	8(%r14), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_6
## %bb.7:
	cqto
	idivq	%rcx
	jmp	LBB0_8
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, (%r15)
LBB0_9:
	movq	_MLXSW_SP_RESOURCE_KVD_HASH_SINGLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	_devlink_resource_size_get
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movq	_KVD_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_MLXSW_CORE_RES_GET
	movq	%rbx, %rcx
	movq	%rax, %rbx
	movq	(%r15), %rax
	movq	%rcx, %r14
	addq	(%rcx), %rax
	subq	%rax, %rbx
	movq	%rbx, (%r13)
	jmp	LBB0_12
LBB0_10:
	movq	%rbx, %r14
	movq	(%r13), %rbx
LBB0_12:
	movq	_KVD_SINGLE_MIN_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_MLXSW_CORE_RES_GET
	cmpq	%rax, %rbx
	jl	LBB0_15
## %bb.13:
	movq	(%r15), %rbx
	movq	_KVD_DOUBLE_MIN_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_MLXSW_CORE_RES_GET
	cmpq	%rax, %rbx
	jl	LBB0_15
## %bb.14:
	movq	_KVD_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_MLXSW_CORE_RES_GET
	movq	%rax, %rcx
	xorl	%eax, %eax
	cmpq	(%r14), %rcx
	jge	LBB0_16
LBB0_15:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KVD_SINGLE_MIN_SIZE,4,2        ## @KVD_SINGLE_MIN_SIZE
	.comm	_KVD_DOUBLE_MIN_SIZE,4,2        ## @KVD_DOUBLE_MIN_SIZE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MLXSW_SP_RESOURCE_KVD_LINEAR,4,2 ## @MLXSW_SP_RESOURCE_KVD_LINEAR
	.comm	_MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE,4,2 ## @MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE
	.comm	_KVD_SIZE,4,2                   ## @KVD_SIZE
	.comm	_MLXSW_SP_KVD_GRANULARITY,4,2   ## @MLXSW_SP_KVD_GRANULARITY
	.comm	_MLXSW_SP_RESOURCE_KVD_HASH_SINGLE,4,2 ## @MLXSW_SP_RESOURCE_KVD_HASH_SINGLE
	.no_dead_strip	_mlxsw_sp_kvd_sizes_get
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_sp_kvd_sizes_get
_mlxsw_sp_kvd_sizes_get:                ; @mlxsw_sp_kvd_sizes_get
	.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	x19, x4
	mov	x21, x3
	mov	x22, x2
	mov	x24, x1
	mov	x20, x0
	bl	_priv_to_devlink
	mov	x23, x0
Lloh0:
	adrp	x26, _KVD_SINGLE_MIN_SIZE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _KVD_SINGLE_MIN_SIZE@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x20
	bl	_MLXSW_CORE_RES_VALID
	cbz	w0, LBB0_12
; %bb.1:
Lloh2:
	adrp	x25, _KVD_DOUBLE_MIN_SIZE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _KVD_DOUBLE_MIN_SIZE@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x20
	bl	_MLXSW_CORE_RES_VALID
	cbz	w0, LBB0_12
; %bb.2:
Lloh4:
	adrp	x8, _MLXSW_SP_RESOURCE_KVD_LINEAR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MLXSW_SP_RESOURCE_KVD_LINEAR@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x23
	mov	x2, x19
	bl	_devlink_resource_size_get
	cbz	w0, LBB0_4
; %bb.3:
	ldr	x8, [x24]
	str	x8, [x19]
LBB0_4:
Lloh7:
	adrp	x8, _MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x23
	mov	x2, x21
	bl	_devlink_resource_size_get
Lloh10:
	adrp	x27, _KVD_SIZE@GOTPAGE
Lloh11:
	ldr	x27, [x27, _KVD_SIZE@GOTPAGEOFF]
	cbz	w0, LBB0_6
; %bb.5:
	ldr	w1, [x27]
	mov	x0, x20
	bl	_MLXSW_CORE_RES_GET
	ldr	x8, [x19]
	sub	x8, x0, x8
	ldp	x10, x9, [x24, #8]
	mul	x8, x8, x9
	add	x9, x10, x9
Lloh12:
	adrp	x10, _MLXSW_SP_KVD_GRANULARITY@GOTPAGE
Lloh13:
	ldr	x10, [x10, _MLXSW_SP_KVD_GRANULARITY@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x10]
	sdiv	x0, x8, x9
	bl	_rounddown
	str	x0, [x21]
LBB0_6:
Lloh15:
	adrp	x8, _MLXSW_SP_RESOURCE_KVD_HASH_SINGLE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MLXSW_SP_RESOURCE_KVD_HASH_SINGLE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x23
	mov	x2, x22
	bl	_devlink_resource_size_get
	cbz	w0, LBB0_8
; %bb.7:
	ldr	w1, [x27]
	mov	x0, x20
	bl	_MLXSW_CORE_RES_GET
	ldr	x8, [x21]
	ldr	x9, [x19]
	add	x8, x8, x9
	sub	x23, x0, x8
	str	x23, [x22]
	b	LBB0_9
LBB0_8:
	ldr	x23, [x22]
LBB0_9:
	ldr	w1, [x26]
	mov	x0, x20
	bl	_MLXSW_CORE_RES_GET
	cmp	x23, x0
	b.lt	LBB0_12
; %bb.10:
	ldr	x21, [x21]
	ldr	w1, [x25]
	mov	x0, x20
	bl	_MLXSW_CORE_RES_GET
	cmp	x21, x0
	b.lt	LBB0_12
; %bb.11:
	ldr	w1, [x27]
	mov	x0, x20
	bl	_MLXSW_CORE_RES_GET
	ldr	x8, [x19]
	cmp	x0, x8
	b.ge	LBB0_14
LBB0_12:
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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
	ret
LBB0_14:
	mov	w0, #0
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_KVD_SINGLE_MIN_SIZE,4,2        ; @KVD_SINGLE_MIN_SIZE
	.comm	_KVD_DOUBLE_MIN_SIZE,4,2        ; @KVD_DOUBLE_MIN_SIZE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MLXSW_SP_RESOURCE_KVD_LINEAR,4,2 ; @MLXSW_SP_RESOURCE_KVD_LINEAR
	.comm	_MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE,4,2 ; @MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE
	.comm	_KVD_SIZE,4,2                   ; @KVD_SIZE
	.comm	_MLXSW_SP_KVD_GRANULARITY,4,2   ; @MLXSW_SP_KVD_GRANULARITY
	.comm	_MLXSW_SP_RESOURCE_KVD_HASH_SINGLE,4,2 ; @MLXSW_SP_RESOURCE_KVD_HASH_SINGLE
	.no_dead_strip	_mlxsw_sp_kvd_sizes_get
.subsections_via_symbols
