	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlxsw_sp_counter_alloc         ## -- Begin function mlxsw_sp_counter_alloc
	.p2align	4, 0x90
_mlxsw_sp_counter_alloc:                ## @mlxsw_sp_counter_alloc
	.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	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r12
	movq	_mlxsw_sp_counter_sub_pools@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movl	%esi, %eax
	leaq	(%rax,%rax,2), %r14
	movl	(%r13,%r14,4), %edx
	movl	4(%r13,%r14,4), %ebx
	addl	%edx, %ebx
	movl	(%r12), %edi
	movl	%ebx, %esi
	callq	_find_next_zero_bit
	cmpl	%ebx, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %r15d
	movl	8(%r13,%r14,4), %eax
	leal	(%rax,%r15), %ecx
	cmpl	%ebx, %ecx
	jbe	LBB0_3
LBB0_1:
	movq	_ENOBUFS@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_3:
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	leaq	8(,%r14,4), %r14
	addq	%r13, %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%r15,%rbx), %edi
	movl	(%r12), %esi
	callq	___set_bit
	incl	%ebx
	cmpl	(%r14), %ebx
	jb	LBB0_5
LBB0_6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mlxsw_sp_counter_sub_pools,8,3 ## @mlxsw_sp_counter_sub_pools
	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlxsw_sp_counter_alloc         ; -- Begin function mlxsw_sp_counter_alloc
	.p2align	2
_mlxsw_sp_counter_alloc:                ; @mlxsw_sp_counter_alloc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x21, x1
	ldr	x23, [x0]
Lloh0:
	adrp	x8, _mlxsw_sp_counter_sub_pools@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mlxsw_sp_counter_sub_pools@GOTPAGEOFF]
Lloh2:
	ldr	x24, [x8]
	mov	w8, #12
	umaddl	x8, w1, w8, x24
	ldp	w2, w8, [x8]
	add	w22, w8, w2
	ldr	w0, [x23]
	mov	x1, x22
	bl	_find_next_zero_bit
	cmp	w0, w22
	b.eq	LBB0_2
; %bb.1:
	mov	x20, x0
	mov	w8, w21
	mov	w9, #12
	madd	x21, x8, x9, x24
	ldr	w8, [x21, #8]!
	add	w9, w8, w0
	cmp	w9, w22
	b.ls	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_3:
	cbz	w8, LBB0_6
; %bb.4:
	mov	w22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	w0, w20, w22
	ldr	w1, [x23]
	bl	___set_bit
	add	w22, w22, #1
	ldr	w8, [x21]
	cmp	w22, w8
	b.lo	LBB0_5
LBB0_6:
	mov	w0, #0
	str	w20, [x19]
LBB0_7:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_mlxsw_sp_counter_sub_pools,8,3 ; @mlxsw_sp_counter_sub_pools
	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
.subsections_via_symbols
