	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlxsw_sp_buffers_init          ## -- Begin function mlxsw_sp_buffers_init
	.p2align	4, 0x90
_mlxsw_sp_buffers_init:                 ## @mlxsw_sp_buffers_init
	.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	%rdi, %r15
	movl	$0, -40(%rbp)
	movl	$0, -36(%rbp)
	movl	8(%rdi), %edi
	movq	_CELL_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_MLXSW_CORE_RES_VALID
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movl	8(%r15), %edi
	movq	_MAX_BUFFER_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	callq	_MLXSW_CORE_RES_VALID
	testl	%eax, %eax
	je	LBB0_1
## %bb.4:
	movl	8(%r15), %edi
	movq	_MAX_HEADROOM_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_MLXSW_CORE_RES_VALID
	testl	%eax, %eax
	je	LBB0_1
## %bb.5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movl	8(%r15), %edi
	movl	(%rbx), %esi
	callq	_MLXSW_CORE_RES_GET
	movq	(%r15), %rcx
	movl	%eax, (%rcx)
	movl	8(%r15), %edi
	movl	(%r14), %esi
	callq	_MLXSW_CORE_RES_GET
	movq	(%r15), %rcx
	movq	%rax, 8(%rcx)
	movl	8(%r15), %edi
	movl	(%r12), %esi
	callq	_MLXSW_CORE_RES_GET
	movq	(%r15), %rcx
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	(%rcx)
	movl	%eax, 4(%rcx)
	movq	%r15, %rdi
	callq	_mlxsw_sp_sb_ports_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.8:
	movq	16(%r15), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movq	%r15, %rdi
	callq	_mlxsw_sp_sb_prs_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.9:
	movq	%r15, %rdi
	callq	_mlxsw_sp_cpu_port_sb_cms_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.10:
	movq	%r15, %rdi
	callq	_mlxsw_sp_cpu_port_sb_pms_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:
	movq	%r15, %rdi
	callq	_mlxsw_sp_sb_mms_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	leaq	-40(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	_mlxsw_sp_pool_count
	movl	8(%r15), %edi
	callq	_priv_to_devlink
	movq	(%r15), %rcx
	movq	8(%rcx), %rdx
	movl	-40(%rbp), %ecx
	movl	-36(%rbp), %r8d
	movq	_MLXSW_SP_SB_ING_TC_COUNT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	movq	_MLXSW_SP_SB_EG_TC_COUNT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, (%rsp)
	xorl	%ebx, %ebx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_devlink_sb_register
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_15
LBB0_13:
	movq	%r15, %rdi
	callq	_mlxsw_sp_sb_ports_fini
LBB0_14:
	movq	(%r15), %rdi
	callq	_kfree
	movl	%r14d, %ebx
	jmp	LBB0_15
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_CELL_SIZE,4,2                  ## @CELL_SIZE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MAX_BUFFER_SIZE,4,2            ## @MAX_BUFFER_SIZE
	.comm	_MAX_HEADROOM_SIZE,4,2          ## @MAX_HEADROOM_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MLXSW_SP_SB_ING_TC_COUNT,4,2   ## @MLXSW_SP_SB_ING_TC_COUNT
	.comm	_MLXSW_SP_SB_EG_TC_COUNT,4,2    ## @MLXSW_SP_SB_EG_TC_COUNT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlxsw_sp_buffers_init          ; -- Begin function mlxsw_sp_buffers_init
	.p2align	2
_mlxsw_sp_buffers_init:                 ; @mlxsw_sp_buffers_init
	.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	x19, x0
	str	xzr, [sp, #8]
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x20, _CELL_SIZE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _CELL_SIZE@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_MLXSW_CORE_RES_VALID
	cbz	w0, LBB0_12
; %bb.1:
	ldr	w0, [x19, #8]
Lloh2:
	adrp	x21, _MAX_BUFFER_SIZE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _MAX_BUFFER_SIZE@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_MLXSW_CORE_RES_VALID
	cbz	w0, LBB0_12
; %bb.2:
	ldr	w0, [x19, #8]
Lloh4:
	adrp	x22, _MAX_HEADROOM_SIZE@GOTPAGE
Lloh5:
	ldr	x22, [x22, _MAX_HEADROOM_SIZE@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_MLXSW_CORE_RES_VALID
	cbz	w0, LBB0_12
; %bb.3:
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	str	x0, [x19]
	cbz	x0, LBB0_15
; %bb.4:
	ldr	w0, [x19, #8]
	ldr	w1, [x20]
	bl	_MLXSW_CORE_RES_GET
	ldr	x8, [x19]
	str	w0, [x8]
	ldr	w0, [x19, #8]
	ldr	w1, [x21]
	bl	_MLXSW_CORE_RES_GET
	ldr	x8, [x19]
	str	x0, [x8, #8]
	ldr	w0, [x19, #8]
	ldr	w1, [x22]
	bl	_MLXSW_CORE_RES_GET
	ldr	x8, [x19]
	ldr	w9, [x8]
	sdiv	w9, w0, w9
	str	w9, [x8, #4]
	mov	x0, x19
	bl	_mlxsw_sp_sb_ports_init
	mov	x20, x0
	cbnz	w0, LBB0_11
; %bb.5:
	ldr	x8, [x19, #16]
	ldp	w2, w1, [x8]
	mov	x0, x19
	bl	_mlxsw_sp_sb_prs_init
	mov	x20, x0
	cbnz	w0, LBB0_10
; %bb.6:
	mov	x0, x19
	bl	_mlxsw_sp_cpu_port_sb_cms_init
	mov	x20, x0
	cbnz	w0, LBB0_10
; %bb.7:
	mov	x0, x19
	bl	_mlxsw_sp_cpu_port_sb_pms_init
	mov	x20, x0
	cbnz	w0, LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_mlxsw_sp_sb_mms_init
	mov	x20, x0
	cbnz	w0, LBB0_10
; %bb.9:
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x19
	bl	_mlxsw_sp_pool_count
	ldr	w0, [x19, #8]
	bl	_priv_to_devlink
	ldr	x8, [x19]
	ldr	x2, [x8, #8]
	ldp	w4, w3, [sp, #8]
Lloh9:
	adrp	x8, _MLXSW_SP_SB_ING_TC_COUNT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MLXSW_SP_SB_ING_TC_COUNT@GOTPAGEOFF]
Lloh11:
	ldr	w5, [x8]
Lloh12:
	adrp	x8, _MLXSW_SP_SB_EG_TC_COUNT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MLXSW_SP_SB_EG_TC_COUNT@GOTPAGEOFF]
Lloh14:
	ldr	w6, [x8]
	mov	w1, #0
	bl	_devlink_sb_register
	mov	x20, x0
	cbz	w0, LBB0_14
LBB0_10:
	mov	x0, x19
	bl	_mlxsw_sp_sb_ports_fini
LBB0_11:
	ldr	x0, [x19]
	bl	_kfree
	b	LBB0_14
LBB0_12:
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_14:
	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_15:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_CELL_SIZE,4,2                  ; @CELL_SIZE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MAX_BUFFER_SIZE,4,2            ; @MAX_BUFFER_SIZE
	.comm	_MAX_HEADROOM_SIZE,4,2          ; @MAX_HEADROOM_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MLXSW_SP_SB_ING_TC_COUNT,4,2   ; @MLXSW_SP_SB_ING_TC_COUNT
	.comm	_MLXSW_SP_SB_EG_TC_COUNT,4,2    ; @MLXSW_SP_SB_EG_TC_COUNT
.subsections_via_symbols
