	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_mr_alloc
_hns_roce_mr_alloc:                     ## @hns_roce_mr_alloc
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r15d
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %r14
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	$0, -56(%rbp)
	addq	$4, %rdi
	leaq	-56(%rbp), %rsi
	callq	_hns_roce_bitmap_alloc
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %r13d
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	16(%rbp), %r15
	movq	%r14, (%r15)
	movq	%r12, 8(%r15)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 104(%r15)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 96(%r15)
	movq	$0, 88(%r15)
	movq	-56(%rbp), %rdi
	callq	_hw_index_to_key
	movl	%eax, 80(%r15)
	cmpq	$-1, %r12
	je	LBB0_3
## %bb.4:
	cmpl	$0, (%rbx)
	je	LBB0_5
## %bb.6:
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%r15, %rdx
	callq	_hns_roce_mhop_alloc
	movl	%eax, %r13d
	jmp	LBB0_7
LBB0_3:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 64(%r15)
	movups	%xmm0, 48(%r15)
	movups	%xmm0, 32(%r15)
	movups	%xmm0, 16(%r15)
	jmp	LBB0_7
LBB0_5:
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	imull	(%rax), %esi
	leaq	24(%r15), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_dma_alloc_coherent
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	jne	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_7:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_BA_BYTE_LEN,4,2                ## @BA_BYTE_LEN
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_hns_roce_mr_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_mr_alloc
_hns_roce_mr_alloc:                     ; @hns_roce_mr_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x6
	mov	x21, x5
	mov	x25, x4
	mov	x24, x3
	mov	x27, x2
	mov	x26, x1
	mov	x23, x0
	ldr	x22, [x0, #8]
	str	xzr, [sp, #8]
	add	x0, x0, #4
	add	x1, sp, #8
	bl	_hns_roce_bitmap_alloc
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.1:
	mov	x20, x0
	stp	x27, x24, [x19]
	stp	x25, x26, [x19, #96]
	str	xzr, [x19, #88]
	ldr	x0, [sp, #8]
	bl	_hw_index_to_key
	str	w0, [x19, #80]
	cmn	x24, #1
	b.eq	LBB0_4
; %bb.2:
	ldr	w8, [x23]
	cbz	w8, LBB0_5
; %bb.3:
	mov	x0, x23
	mov	x1, x21
	mov	x2, x19
	bl	_hns_roce_mhop_alloc
	mov	x20, x0
	b	LBB0_7
LBB0_4:
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x19, #48]
	stp	q0, q0, [x19, #16]
	b	LBB0_7
LBB0_5:
Lloh0:
	adrp	x8, _BA_BYTE_LEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BA_BYTE_LEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mul	w1, w8, w21
	add	x2, x19, #24
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x22
	bl	_dma_alloc_coherent
	str	x0, [x19, #16]
	cbnz	x0, LBB0_7
LBB0_6:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_BA_BYTE_LEN,4,2                ; @BA_BYTE_LEN
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_hns_roce_mr_alloc
.subsections_via_symbols
