	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_ib_alloc_cq_buf
_hns_roce_ib_alloc_cq_buf:              ## @hns_roce_ib_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rdi), %r8d
	addl	(%rax), %r8d
	movl	4(%rdi), %esi
	imull	%edx, %esi
	movl	$2, %edx
	movl	%r8d, %ecx
	shll	%cl, %edx
	movq	%r15, %rcx
	callq	_hns_roce_buf_alloc
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movq	_HEM_TYPE_CQE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_hns_roce_check_whether_mhop
	testq	%rax, %rax
	jne	LBB0_2
## %bb.3:
	movq	_MTT_TYPE_WQE@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_MTT_TYPE_CQE@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	leaq	8(%r15), %r13
	movl	%eax, 8(%r15)
	movl	(%r15), %edx
	movl	4(%r15), %esi
	movq	%r12, %rdi
	movq	%r13, %rcx
	callq	_hns_roce_mtt_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_hns_roce_buf_write_mtt
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	%eax, %ebx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_hns_roce_mtt_cleanup
LBB0_8:
	imull	4(%r12), %r14d
	movq	%r12, %rdi
	movl	%r14d, %esi
	movq	%r15, %rdx
	callq	_hns_roce_buf_free
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_HEM_TYPE_CQE,4,2               ## @HEM_TYPE_CQE
	.comm	_MTT_TYPE_CQE,4,2               ## @MTT_TYPE_CQE
	.comm	_MTT_TYPE_WQE,4,2               ## @MTT_TYPE_WQE
	.no_dead_strip	_hns_roce_ib_alloc_cq_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_ib_alloc_cq_buf
_hns_roce_ib_alloc_cq_buf:              ; @hns_roce_ib_alloc_cq_buf
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	w9, w10, [x0]
	add	w4, w9, w8
	mul	w1, w10, w2
	mov	w8, #2
	lsl	w2, w8, w4
	mov	x3, x19
	bl	_hns_roce_buf_alloc
	mov	x22, x0
	cbnz	w0, LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, _HEM_TYPE_CQE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HEM_TYPE_CQE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_hns_roce_check_whether_mhop
Lloh6:
	adrp	x8, _MTT_TYPE_WQE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MTT_TYPE_WQE@GOTPAGEOFF]
Lloh8:
	adrp	x9, _MTT_TYPE_CQE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MTT_TYPE_CQE@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	mov	x23, x19
	str	w8, [x23, #8]!
	ldp	w2, w1, [x19]
	mov	x0, x20
	mov	x3, x23
	bl	_hns_roce_mtt_init
	mov	x22, x0
	cbnz	w0, LBB0_4
; %bb.2:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x19
	bl	_hns_roce_buf_write_mtt
	mov	x22, x0
	cbz	w0, LBB0_5
; %bb.3:
	mov	x0, x20
	mov	x1, x23
	bl	_hns_roce_mtt_cleanup
LBB0_4:
	ldr	w8, [x20, #4]
	mul	w1, w8, w21
	mov	x0, x20
	mov	x2, x19
	bl	_hns_roce_buf_free
LBB0_5:
	mov	x0, x22
	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 AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_HEM_TYPE_CQE,4,2               ; @HEM_TYPE_CQE
	.comm	_MTT_TYPE_CQE,4,2               ; @MTT_TYPE_CQE
	.comm	_MTT_TYPE_WQE,4,2               ; @MTT_TYPE_WQE
	.no_dead_strip	_hns_roce_ib_alloc_cq_buf
.subsections_via_symbols
