	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_alloc_cq_buf              ## -- Begin function mlx5_alloc_cq_buf
	.p2align	4, 0x90
_mlx5_alloc_cq_buf:                     ## @mlx5_alloc_cq_buf
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r15d
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_to_mdev
	movq	%rax, %r13
	movq	_MLX5_ALLOC_TYPE_ANON@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str(%rip), %rdi
	callq	_mlx5_use_huge
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_MLX5_ALLOC_TYPE_HUGE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_2:
	movq	_MLX5_CQ_PREFIX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-48(%rbp), %rsi
	movl	%ebx, %edx
	callq	_mlx5_get_alloc_type
	movl	%r15d, %ebx
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	imull	%r12d, %r15d
	movl	(%r13), %esi
	movl	%r15d, %edi
	callq	_align
	movl	(%r13), %ecx
	movl	-48(%rbp), %r8d
	movq	_MLX5_CQ_PREFIX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	movq	%r14, %rdi
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_mlx5_alloc_prefered_buf
	movl	$-1, %r14d
	testl	%eax, %eax
	je	LBB0_3
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	(%r13), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_memset
	testl	%r12d, %r12d
	jle	LBB0_11
## %bb.4:
	movq	(%r13), %r8
	xorl	%r9d, %r9d
	cmpl	$128, %ebx
	sete	%r9b
	movslq	%ebx, %rax
	movl	%r12d, %r10d
	leaq	-1(%r10), %rdx
	movl	%r10d, %ecx
	andl	$3, %ecx
	xorl	%r14d, %r14d
	cmpq	$3, %rdx
	jae	LBB0_6
## %bb.5:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_6:
	leaq	(%r8,%r9,4), %rdx
	andl	$-4, %r10d
	movq	%rax, %r15
	shlq	$4, %r15
	leaq	(,%rax,4), %rdi
	leaq	(%rdi,%rdi,2), %r11
	xorl	%ebx, %ebx
	movq	_MLX5_CQE_INVALID@GOTPCREL(%rip), %rdi
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdi), %esi
	shll	$4, %esi
	movl	%esi, (%rdx)
	movl	(%rdi), %esi
	shll	$4, %esi
	movl	%esi, (%rdx,%rax,4)
	movl	(%rdi), %esi
	shll	$4, %esi
	movl	%esi, (%rdx,%rax,8)
	movl	(%rdi), %esi
	shll	$4, %esi
	movl	%esi, (%rdx,%r11)
	addq	$4, %rbx
	addq	%r15, %rdx
	cmpq	%rbx, %r10
	jne	LBB0_7
LBB0_8:
	testq	%rcx, %rcx
	je	LBB0_11
## %bb.9:
	imulq	%rax, %rbx
	addq	%r9, %rbx
	leaq	(%r8,%rbx,4), %rdx
	shlq	$2, %rax
	movq	_MLX5_CQE_INVALID@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %edi
	shll	$4, %edi
	movl	%edi, (%rdx)
	addq	%rax, %rdx
	decq	%rcx
	jne	LBB0_10
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX5_ALLOC_TYPE_ANON,4,2       ## @MLX5_ALLOC_TYPE_ANON
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HUGE_CQ"

	.comm	_MLX5_ALLOC_TYPE_HUGE,4,2       ## @MLX5_ALLOC_TYPE_HUGE
	.comm	_MLX5_CQ_PREFIX,4,2             ## @MLX5_CQ_PREFIX
	.comm	_MLX5_CQE_INVALID,4,2           ## @MLX5_CQE_INVALID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_alloc_cq_buf              ; -- Begin function mlx5_alloc_cq_buf
	.p2align	2
_mlx5_alloc_cq_buf:                     ; @mlx5_alloc_cq_buf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x4
	mov	x20, x3
	mov	x21, x2
	mov	x23, x0
	ldr	w0, [x0]
	bl	_to_mdev
	mov	x24, x0
Lloh0:
	adrp	x8, _MLX5_ALLOC_TYPE_ANON@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX5_ALLOC_TYPE_ANON@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_mlx5_use_huge
Lloh5:
	adrp	x8, _MLX5_ALLOC_TYPE_HUGE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MLX5_ALLOC_TYPE_HUGE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w2, w22, w8, eq
Lloh8:
	adrp	x25, _MLX5_CQ_PREFIX@GOTPAGE
Lloh9:
	ldr	x25, [x25, _MLX5_CQ_PREFIX@GOTPAGEOFF]
	ldr	w0, [x25]
	add	x1, sp, #12
	bl	_mlx5_get_alloc_type
	mul	w22, w19, w20
	ldr	w1, [x24]
	mov	x0, x22
	bl	_align
	mov	x2, x0
	ldr	w3, [x24]
	ldr	w4, [sp, #12]
	ldr	w5, [x25]
	mov	x0, x23
	mov	x1, x21
	bl	_mlx5_alloc_prefered_buf
	cbz	w0, LBB0_2
; %bb.1:
	mov	w0, #-1
	b	LBB0_6
LBB0_2:
	ldr	x0, [x21]
	mov	w1, #0
	mov	x2, x22
	bl	_memset
	cmp	w20, #1
	b.lt	LBB0_5
; %bb.3:
	ldr	x9, [x21]
	cmp	w19, #128
	cset	w10, eq
	mov	w8, w20
	add	x9, x9, w10, uxtw #2
	sbfiz	x10, x19, #2, #32
Lloh10:
	adrp	x11, _MLX5_CQE_INVALID@GOTPAGE
Lloh11:
	ldr	x11, [x11, _MLX5_CQE_INVALID@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	lsl	w12, w12, #4
	str	w12, [x9]
	add	x9, x9, x10
	subs	x8, x8, #1
	b.ne	LBB0_4
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX5_ALLOC_TYPE_ANON,4,2       ; @MLX5_ALLOC_TYPE_ANON
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HUGE_CQ"

	.comm	_MLX5_ALLOC_TYPE_HUGE,4,2       ; @MLX5_ALLOC_TYPE_HUGE
	.comm	_MLX5_CQ_PREFIX,4,2             ; @MLX5_CQ_PREFIX
	.comm	_MLX5_CQE_INVALID,4,2           ; @MLX5_CQE_INVALID
.subsections_via_symbols
