	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlxsw_sp_counter_pool_init     ## -- Begin function mlxsw_sp_counter_pool_init
	.p2align	4, 0x90
_mlxsw_sp_counter_pool_init:            ## @mlxsw_sp_counter_pool_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	%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	%rdi, %r15
	movl	8(%rdi), %edi
	movq	_COUNTER_POOL_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_MLXSW_CORE_RES_VALID
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	%r15, %rdi
	callq	_mlxsw_sp_counter_pool_validate
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.4:
	movq	%r15, %rdi
	callq	_mlxsw_sp_counter_sub_pools_prepare
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r14
	movl	8(%r15), %edi
	movl	(%r12), %esi
	callq	_MLXSW_CORE_RES_GET
	movl	%eax, (%r14)
	movl	%eax, %edi
	callq	_BITS_TO_LONGS
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,8), %edi
	movl	(%rbx), %esi
	callq	_kzalloc
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	_mlxsw_sp_counter_sub_pools@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rdi, 8(%r14)
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_14
## %bb.10:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r12
	movq	_mlxsw_sp_counter_sub_pools@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	movslq	%eax, %rcx
	addq	$12, %rbx
	movl	%r13d, %eax
	cmpq	%rcx, %r12
	jge	LBB0_14
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rcx
	movq	_MLXSW_SP_COUNTER_POOL_BANK_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r13d
	imull	4(%rcx,%rbx), %r13d
	movl	%r13d, (%rcx,%rbx)
	movl	%eax, 8(%rcx,%rbx)
	addl	%eax, %r13d
	movl	(%r14), %edx
	cmpl	%edx, %r13d
	jbe	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	subl	%eax, %edx
	movl	%edx, (%rcx,%rbx)
	jmp	LBB0_13
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	%r14, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_COUNTER_POOL_SIZE,4,2          ## @COUNTER_POOL_SIZE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_mlxsw_sp_counter_sub_pools,8,3 ## @mlxsw_sp_counter_sub_pools
	.comm	_MLXSW_SP_COUNTER_POOL_BANK_SIZE,4,2 ## @MLXSW_SP_COUNTER_POOL_BANK_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlxsw_sp_counter_pool_init     ; -- Begin function mlxsw_sp_counter_pool_init
	.p2align	2
_mlxsw_sp_counter_pool_init:            ; @mlxsw_sp_counter_pool_init
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x22, _COUNTER_POOL_SIZE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _COUNTER_POOL_SIZE@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_MLXSW_CORE_RES_VALID
	cbz	w0, LBB0_10
; %bb.1:
	mov	x0, x19
	bl	_mlxsw_sp_counter_pool_validate
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.2:
	mov	x0, x19
	bl	_mlxsw_sp_counter_sub_pools_prepare
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.3:
Lloh2:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_14
; %bb.4:
	mov	x20, x0
	ldr	w0, [x19, #8]
	ldr	w1, [x22]
	bl	_MLXSW_CORE_RES_GET
	str	w0, [x20]
	bl	_BITS_TO_LONGS
	lsl	w0, w0, #3
	ldr	w1, [x21]
	bl	_kzalloc
	str	x0, [x20, #16]
	cbz	x0, LBB0_15
; %bb.5:
Lloh4:
	adrp	x21, _mlxsw_sp_counter_sub_pools@GOTPAGE
Lloh5:
	ldr	x21, [x21, _mlxsw_sp_counter_sub_pools@GOTPAGEOFF]
	ldr	x0, [x21]
	str	x0, [x20, #8]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_13
; %bb.6:
	mov	x22, #0
	mov	x23, #0
	mov	w8, #0
Lloh6:
	adrp	x24, _MLXSW_SP_COUNTER_POOL_BANK_SIZE@GOTPAGE
Lloh7:
	ldr	x24, [x24, _MLXSW_SP_COUNTER_POOL_BANK_SIZE@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x23, x23, #1
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	add	x22, x22, #12
	cmp	x23, w0, sxtw
	mov	x8, x25
	b.ge	LBB0_13
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20, #8]
	add	x10, x9, x22
	ldr	w11, [x10, #4]
	ldr	w12, [x24]
	mul	w11, w12, w11
	str	w11, [x10]
	str	w8, [x10, #8]
	ldr	w10, [x20]
	add	w25, w11, w8
	cmp	w25, w10
	b.ls	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	sub	w8, w10, w8
	str	w8, [x9, x22]
	b	LBB0_7
LBB0_10:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
	mov	w21, #0
	str	x20, [x19]
	b	LBB0_12
LBB0_14:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
LBB0_15:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
	mov	x0, x20
	bl	_kfree
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_COUNTER_POOL_SIZE,4,2          ; @COUNTER_POOL_SIZE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_mlxsw_sp_counter_sub_pools,8,3 ; @mlxsw_sp_counter_sub_pools
	.comm	_MLXSW_SP_COUNTER_POOL_BANK_SIZE,4,2 ; @MLXSW_SP_COUNTER_POOL_BANK_SIZE
.subsections_via_symbols
