	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_ib_get_cq_umem
_hns_roce_ib_get_cq_umem:               ## @hns_roce_ib_get_cq_umem
	.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
	movq	%rcx, %r15
	movq	%rdx, %r14
	movq	%rdi, %rbx
	imull	(%rdi), %r9d
	movq	_IB_ACCESS_LOCAL_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rsi, %rdi
	movl	%r8d, %esi
	movl	%r9d, %edx
	movl	$1, %r8d
	callq	_ib_umem_get
	movq	%rax, (%r15)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.13:
	movq	(%r15), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	_HEM_TYPE_CQE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %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
	movl	%eax, (%r14)
	movl	4(%rbx), %r12d
	movq	(%r15), %rdi
	callq	_ib_umem_page_count
                                        ## kill: def $eax killed $eax def $rax
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.5:
	movl	4(%rbx), %ecx
	movl	$1, %esi
	shll	%cl, %esi
	addl	%esi, %eax
	decl	%eax
	cltd
	idivl	%esi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rdx
	addl	(%rdx), %ecx
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	%ecx, %edx
	jmp	LBB0_7
LBB0_6:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
LBB0_7:
	movq	%r14, %rcx
	callq	_hns_roce_mtt_init
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.8:
	movq	(%r15), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_hns_roce_ib_umem_write_mtt
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	%eax, %r12d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_hns_roce_mtt_cleanup
LBB0_11:
	movq	(%r15), %rdi
	callq	_ib_umem_release
LBB0_12:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	xorl	%r12d, %r12d
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_ACCESS_LOCAL_WRITE,4,2      ## @IB_ACCESS_LOCAL_WRITE
	.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
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_hns_roce_ib_get_cq_umem
.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_get_cq_umem
_hns_roce_ib_get_cq_umem:               ; @hns_roce_ib_get_cq_umem
	.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, x3
	mov	x20, x2
	mov	x21, x0
	ldr	w8, [x0]
	mul	w2, w8, w5
Lloh0:
	adrp	x8, _IB_ACCESS_LOCAL_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_ACCESS_LOCAL_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x1
	mov	x1, x4
	mov	w4, #1
	bl	_ib_umem_get
	str	x0, [x19]
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x0, [x19]
	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
	b	_PTR_ERR
LBB0_2:
Lloh3:
	adrp	x8, _HEM_TYPE_CQE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HEM_TYPE_CQE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	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]
	str	w8, [x20]
	ldr	w22, [x21, #4]
	ldr	x0, [x19]
	bl	_ib_umem_page_count
	mov	x1, x0
	cbz	w22, LBB0_4
; %bb.3:
	ldr	w8, [x21, #4]
	mov	w9, #1
	lsl	w9, w9, w8
	add	w10, w1, w9
	sub	w10, w10, #1
	sdiv	w1, w10, w9
Lloh10:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	add	w2, w9, w8
	b	LBB0_5
LBB0_4:
Lloh13:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
LBB0_5:
	mov	x0, x21
	mov	x3, x20
	bl	_hns_roce_mtt_init
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.6:
	ldr	x2, [x19]
	mov	x0, x21
	mov	x1, x20
	bl	_hns_roce_ib_umem_write_mtt
	mov	x22, x0
	cbz	w0, LBB0_9
; %bb.7:
	mov	x0, x21
	mov	x1, x20
	bl	_hns_roce_mtt_cleanup
LBB0_8:
	ldr	x0, [x19]
	bl	_ib_umem_release
LBB0_9:
	mov	x0, x22
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_ACCESS_LOCAL_WRITE,4,2      ; @IB_ACCESS_LOCAL_WRITE
	.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
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_hns_roce_ib_get_cq_umem
.subsections_via_symbols
