	.file	"extr_spectrum_buffers.c_mlxsw_sp_buffers_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	mlxsw_sp_buffers_init
	.type	mlxsw_sp_buffers_init, @function
mlxsw_sp_buffers_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edi, DWORD PTR 8[rdi]
	mov	esi, DWORD PTR CELL_SIZE[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	DWORD PTR [rsp], 0
	mov	DWORD PTR 4[rsp], 0
	call	MLXSW_CORE_RES_VALID@PLT
	test	eax, eax
	jne	.L2
.L19:
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L21
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR MAX_BUFFER_SIZE[rip]
	call	MLXSW_CORE_RES_VALID@PLT
	test	eax, eax
	je	.L19
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR MAX_HEADROOM_SIZE[rip]
	call	MLXSW_CORE_RES_VALID@PLT
	test	eax, eax
	je	.L19
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	edi, 16
	call	kzalloc@PLT
	mov	r12d, DWORD PTR ENOMEM[rip]
	mov	QWORD PTR [rbx], rax
	neg	r12d
	test	rax, rax
	je	.L1
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR CELL_SIZE[rip]
	call	MLXSW_CORE_RES_GET@PLT
	mov	r12, QWORD PTR [rbx]
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR MAX_BUFFER_SIZE[rip]
	mov	DWORD PTR [r12], eax
	call	MLXSW_CORE_RES_GET@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR MAX_HEADROOM_SIZE[rip]
	mov	QWORD PTR 8[r12], rax
	call	MLXSW_CORE_RES_GET@PLT
	mov	rcx, QWORD PTR [rbx]
	mov	rdi, rbx
	cdq
	idiv	DWORD PTR [rcx]
	mov	DWORD PTR 4[rcx], eax
	call	mlxsw_sp_sb_ports_init@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L22
.L7:
	mov	rdi, QWORD PTR [rbx]
	call	kfree@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rax, QWORD PTR 16[rbx]
	mov	rdi, rbx
	mov	esi, DWORD PTR 4[rax]
	mov	edx, DWORD PTR [rax]
	call	mlxsw_sp_sb_prs_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L12
	mov	rdi, rbx
	call	mlxsw_sp_cpu_port_sb_cms_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L12
	mov	rdi, rbx
	call	mlxsw_sp_cpu_port_sb_pms_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L12
	mov	rdi, rbx
	call	mlxsw_sp_sb_mms_init@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L12
	lea	rdx, 4[rsp]
	mov	rsi, rsp
	mov	rdi, rbx
	call	mlxsw_sp_pool_count@PLT
	mov	rax, QWORD PTR [rbx]
	mov	edi, DWORD PTR 8[rbx]
	mov	r15d, DWORD PTR MLXSW_SP_SB_EG_TC_COUNT[rip]
	mov	ebp, DWORD PTR 4[rsp]
	mov	r13d, DWORD PTR [rsp]
	mov	r12, QWORD PTR 8[rax]
	mov	r14d, DWORD PTR MLXSW_SP_SB_ING_TC_COUNT[rip]
	call	priv_to_devlink@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	mov	rdx, r12
	mov	r8d, ebp
	push	r15
	.cfi_def_cfa_offset 96
	mov	edi, eax
	mov	r9d, r14d
	mov	ecx, r13d
	xor	esi, esi
	call	devlink_sb_register@PLT
	mov	r12d, eax
	pop	rax
	.cfi_def_cfa_offset 88
	pop	rdx
	.cfi_def_cfa_offset 80
	test	r12d, r12d
	je	.L1
.L8:
.L9:
.L10:
.L11:
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rdi, rbx
	call	mlxsw_sp_sb_ports_fini@PLT
	jmp	.L7
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mlxsw_sp_buffers_init, .-mlxsw_sp_buffers_init
	.comm	MLXSW_SP_SB_ING_TC_COUNT,4,4
	.comm	MLXSW_SP_SB_EG_TC_COUNT,4,4
	.comm	MAX_HEADROOM_SIZE,4,4
	.comm	MAX_BUFFER_SIZE,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EIO,4,4
	.comm	CELL_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_spectrum_buffers.c_mlxsw_sp_buffers_init.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	mlxsw_sp_buffers_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	mlxsw_sp_buffers_init, %function
mlxsw_sp_buffers_init:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, r6, r7, lr}
	ldr	r5, .L24
	ldr	r2, .L24+4
	sub	sp, sp, #36
	mov	r4, r0
	ldr	r1, [r5]
	ldr	r0, [r0, #4]
	ldr	r2, [r2]
	str	r2, [sp, #28]
	mov	r2,#0
	str	r3, [sp, #20]
	str	r3, [sp, #24]
	bl	MLXSW_CORE_RES_VALID
	cmp	r0, #0
	bne	.L2
.L19:
	ldr	r3, .L24+8
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	ldr	r3, .L24+4
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	mov	r0, r5
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L2:
	ldr	r6, .L24+12
	ldr	r0, [r4, #4]
	ldr	r1, [r6]
	bl	MLXSW_CORE_RES_VALID
	cmp	r0, #0
	beq	.L19
	ldr	r7, .L24+16
	ldr	r0, [r4, #4]
	ldr	r1, [r7]
	bl	MLXSW_CORE_RES_VALID
	cmp	r0, #0
	beq	.L19
	ldr	r3, .L24+20
	mov	r0, #12
	ldr	r1, [r3]
	bl	kzalloc
	cmp	r0, #0
	str	r0, [r4]
	beq	.L22
	ldr	r1, [r5]
	ldr	r0, [r4, #4]
	bl	MLXSW_CORE_RES_GET
	ldr	r5, [r4]
	ldr	r1, [r6]
	str	r0, [r5]
	ldr	r0, [r4, #4]
	bl	MLXSW_CORE_RES_GET
	ldr	r1, [r7]
	str	r0, [r5, #8]
	ldr	r0, [r4, #4]
	bl	MLXSW_CORE_RES_GET
	ldr	r5, [r4]
	ldr	r1, [r5]
	bl	__aeabi_idiv
	mov	r3, r0
	mov	r0, r4
	str	r3, [r5, #4]
	bl	mlxsw_sp_sb_ports_init
	subs	r5, r0, #0
	beq	.L23
.L7:
	ldr	r0, [r4]
	bl	kfree
	b	.L1
.L23:
	ldr	r3, [r4, #8]
	mov	r0, r4
	ldr	r2, [r3]
	ldr	r1, [r3, #4]
	bl	mlxsw_sp_sb_prs_init
	subs	r5, r0, #0
	bne	.L12
	mov	r0, r4
	bl	mlxsw_sp_cpu_port_sb_cms_init
	subs	r5, r0, #0
	bne	.L12
	mov	r0, r4
	bl	mlxsw_sp_cpu_port_sb_pms_init
	subs	r5, r0, #0
	bne	.L12
	mov	r0, r4
	bl	mlxsw_sp_sb_mms_init
	subs	r5, r0, #0
	bne	.L12
	add	r2, sp, #24
	add	r1, sp, #20
	mov	r0, r4
	bl	mlxsw_sp_pool_count
	ldr	r0, [r4, #4]
	bl	priv_to_devlink
	ldr	r3, .L24+24
	ldr	r2, [r4]
	ldr	r3, [r3]
	ldr	r1, .L24+28
	ldr	r2, [r2, #8]
	ldr	ip, [r1]
	str	r3, [sp, #8]
	ldr	r3, [sp, #24]
	mov	r1, r5
	stm	sp, {r3, ip}
	ldr	r3, [sp, #20]
	bl	devlink_sb_register
	subs	r5, r0, #0
	beq	.L1
.L8:
.L9:
.L10:
.L11:
.L12:
	mov	r0, r4
	bl	mlxsw_sp_sb_ports_fini
	b	.L7
.L22:
	ldr	r3, .L24+32
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L21:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	CELL_SIZE
	.word	.LC0
	.word	EIO
	.word	MAX_BUFFER_SIZE
	.word	MAX_HEADROOM_SIZE
	.word	GFP_KERNEL
	.word	MLXSW_SP_SB_EG_TC_COUNT
	.word	MLXSW_SP_SB_ING_TC_COUNT
	.word	ENOMEM
	.size	mlxsw_sp_buffers_init, .-mlxsw_sp_buffers_init
	.comm	MLXSW_SP_SB_ING_TC_COUNT,4,4
	.comm	MLXSW_SP_SB_EG_TC_COUNT,4,4
	.comm	MAX_HEADROOM_SIZE,4,4
	.comm	MAX_BUFFER_SIZE,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EIO,4,4
	.comm	CELL_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
