	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx5_ib_alloc_counters
_mlx5_ib_alloc_counters:                ## @mlx5_ib_alloc_counters
	.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	16(%rdi), %edi
	movq	_log_max_uctx@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MLX5_CAP_GEN
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	16(%r15), %edi
	callq	_is_mdev_switchdev_mode
	movl	$1, %ecx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movl	(%r15), %ecx
	testl	%ecx, %ecx
	jle	LBB0_11
LBB0_2:
	movl	%ecx, %r13d
	movq	8(%r15), %rsi
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	addq	%r14, %rsi
	movq	%r15, %rdi
	callq	___mlx5_ib_alloc_counters
	testl	%eax, %eax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r15), %rax
	movl	8(%rax,%r14), %edx
	movl	12(%rax,%r14), %esi
	movq	%r15, %rdi
	callq	_mlx5_ib_fill_counters
	xorl	%edx, %edx
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_MLX5_SHARED_RESOURCE_UID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	16(%r15), %edi
	movq	8(%r15), %rax
	leaq	(%rax,%r14), %rsi
	addq	$4, %rsi
	callq	_mlx5_cmd_alloc_q_counter
	testl	%eax, %eax
	jne	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r15), %rsi
	movl	$1, (%rsi,%r14)
	incq	%r12
	addq	$16, %r14
	cmpq	%r12, %r13
	jne	LBB0_3
LBB0_11:
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_4:
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_8:
	movl	%eax, %ebx
	incl	%r12d
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_mlx5_ib_warn
LBB0_9:
	movq	%r15, %rdi
	callq	_mlx5_ib_dealloc_counters
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_log_max_uctx,4,2               ## @log_max_uctx
	.comm	_MLX5_SHARED_RESOURCE_UID,4,2   ## @MLX5_SHARED_RESOURCE_UID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"couldn't allocate queue counter for port %d, err %d\n"

	.no_dead_strip	_mlx5_ib_alloc_counters
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx5_ib_alloc_counters
_mlx5_ib_alloc_counters:                ; @mlx5_ib_alloc_counters
	.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, #16]
Lloh0:
	adrp	x8, _log_max_uctx@GOTPAGE
Lloh1:
	ldr	x8, [x8, _log_max_uctx@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_MLX5_CAP_GEN
	mov	x20, x0
	ldr	w0, [x19, #16]
	bl	_is_mdev_switchdev_mode
	mov	w22, #1
	mov	w9, #1
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w9, [x19]
	cmp	w9, #1
	b.lt	LBB0_6
LBB0_2:
	mov	x24, #0
	mov	x23, #0
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x25, _MLX5_SHARED_RESOURCE_UID@GOTPAGE
Lloh4:
	ldr	x25, [x25, _MLX5_SHARED_RESOURCE_UID@GOTPAGEOFF]
	mov	w26, w9
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, x8, x24
	mov	x0, x19
	bl	___mlx5_ib_alloc_counters
	cbnz	w0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x24
	ldp	w2, w1, [x8, #8]
	mov	x0, x19
	bl	_mlx5_ib_fill_counters
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
	add	x8, x8, x24
	add	x1, x8, #4
	ldr	w8, [x25]
	cmp	x20, #0
	csel	w2, wzr, w8, eq
	bl	_mlx5_cmd_alloc_q_counter
	cbnz	w0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #8]
	str	w22, [x8, x24]
	add	x23, x23, #1
	add	x24, x24, #16
	cmp	x26, x23
	b.ne	LBB0_3
LBB0_6:
	mov	w21, #0
	b	LBB0_10
LBB0_7:
	mov	x21, x0
	b	LBB0_9
LBB0_8:
	mov	x21, x0
	add	w2, w23, #1
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x21
	bl	_mlx5_ib_warn
LBB0_9:
	mov	x0, x19
	bl	_mlx5_ib_dealloc_counters
LBB0_10:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_log_max_uctx,4,2               ; @log_max_uctx
	.comm	_MLX5_SHARED_RESOURCE_UID,4,2   ; @MLX5_SHARED_RESOURCE_UID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"couldn't allocate queue counter for port %d, err %d\n"

	.no_dead_strip	_mlx5_ib_alloc_counters
.subsections_via_symbols
