	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_alloc_cq_buf             ## -- Begin function mthca_alloc_cq_buf
	.p2align	4, 0x90
_mthca_alloc_cq_buf:                    ## @mthca_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	_MTHCA_CQ_ENTRY_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	imull	%edx, %esi
	movq	_MTHCA_MAX_DIRECT_CQ_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	8(%r12), %rcx
	leaq	4(%r12), %r8
	movq	%rdi, %r9
	pushq	%r12
	pushq	$1
	callq	_mthca_buf_alloc
	addq	$16, %rsp
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	xorl	%r15d, %r15d
	testl	%r14d, %r14d
	jle	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_get_cqe_from_buf
	movl	%eax, %edi
	callq	_set_cqe_hw
	incl	%ebx
	cmpl	%ebx, %r14d
	jne	LBB0_3
LBB0_4:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_CQ_ENTRY_SIZE,4,2        ## @MTHCA_CQ_ENTRY_SIZE
	.comm	_MTHCA_MAX_DIRECT_CQ_SIZE,4,2   ## @MTHCA_MAX_DIRECT_CQ_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_alloc_cq_buf             ; -- Begin function mthca_alloc_cq_buf
	.p2align	2
_mthca_alloc_cq_buf:                    ; @mthca_alloc_cq_buf
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x20, x1
Lloh0:
	adrp	x8, _MTHCA_CQ_ENTRY_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTHCA_CQ_ENTRY_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mul	w1, w8, w2
Lloh3:
	adrp	x8, _MTHCA_MAX_DIRECT_CQ_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MTHCA_MAX_DIRECT_CQ_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x3, x20, #8
	add	x4, x20, #4
	mov	x5, x0
	mov	w6, #1
	mov	x7, x20
	bl	_mthca_buf_alloc
	cbnz	w0, LBB0_5
; %bb.1:
	cmp	w19, #1
	b.lt	LBB0_4
; %bb.2:
	mov	w21, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_get_cqe_from_buf
	bl	_set_cqe_hw
	add	w21, w21, #1
	cmp	w19, w21
	b.ne	LBB0_3
LBB0_4:
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_CQ_ENTRY_SIZE,4,2        ; @MTHCA_CQ_ENTRY_SIZE
	.comm	_MTHCA_MAX_DIRECT_CQ_SIZE,4,2   ; @MTHCA_MAX_DIRECT_CQ_SIZE
.subsections_via_symbols
