	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_alloc_mr              ## -- Begin function hns_roce_alloc_mr
	.p2align	4, 0x90
_hns_roce_alloc_mr:                     ## @hns_roce_alloc_mr
	.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
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	(%rdi), %edi
	callq	_to_hr_dev
	movq	%rax, %r12
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	(%r12), %ecx
	movl	%r14d, %r13d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r13d
	movq	_IB_MR_TYPE_MEM_REG@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_1
## %bb.4:
	movq	_HNS_ROCE_FRMR_MAX_PA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmpl	%r14d, %edx
	jge	LBB0_6
## %bb.5:
	movq	8(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%edi, %edi
	subl	(%rax), %edi
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_6:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %rbx
	movq	_MR_TYPE_FRMR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	%r15, %rdi
	callq	_to_hr_pd
	movl	(%rax), %esi
	movq	%rbx, (%rsp)
	movq	%r12, %rdi
	xorl	%edx, %edx
	movl	%r13d, %ecx
	xorl	%r8d, %r8d
	movl	%r14d, %r9d
	callq	_hns_roce_mr_alloc
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_hns_roce_mr_enable
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	movl	%eax, %r14d
	movl	(%r15), %edi
	callq	_to_hr_dev
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_hns_roce_mr_free
LBB0_11:
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r14d, %edi
	jmp	LBB0_3
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_12:
	movl	16(%rbx), %eax
	movl	%eax, (%rbx)
	movl	%eax, 4(%rbx)
	movq	$0, 8(%rbx)
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_IB_MR_TYPE_MEM_REG,4,2         ## @IB_MR_TYPE_MEM_REG
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HNS_ROCE_FRMR_MAX_PA,4,2       ## @HNS_ROCE_FRMR_MAX_PA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"max_num_sg larger than %d\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MR_TYPE_FRMR,4,2               ## @MR_TYPE_FRMR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_alloc_mr              ; -- Begin function hns_roce_alloc_mr
	.p2align	2
_hns_roce_alloc_mr:                     ; @hns_roce_alloc_mr
	.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	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_to_hr_dev
Lloh0:
	adrp	x8, _IB_MR_TYPE_MEM_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_MR_TYPE_MEM_REG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_3
; %bb.1:
	mov	x21, x0
Lloh3:
	adrp	x8, _HNS_ROCE_FRMR_MAX_PA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HNS_ROCE_FRMR_MAX_PA@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	cmp	w2, w22
	b.ge	LBB0_6
; %bb.2:
	ldr	x0, [x21, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_3:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	b	_ERR_PTR
LBB0_6:
	ldr	w23, [x21]
Lloh10:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh12:
	ldr	w24, [x8]
Lloh13:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_11
; %bb.7:
	mov	x20, x0
	add	w8, w24, w23
	lsl	w23, w22, w8
Lloh16:
	adrp	x8, _MR_TYPE_FRMR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MR_TYPE_FRMR@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x0, #20]
	mov	x0, x19
	bl	_to_hr_pd
	ldr	w1, [x0]
	mov	x0, x21
	mov	w2, #0
	mov	x3, x23
	mov	w4, #0
	mov	x5, x22
	mov	x6, x20
	bl	_hns_roce_mr_alloc
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.8:
	mov	x0, x21
	mov	x1, x20
	bl	_hns_roce_mr_enable
	cbz	w0, LBB0_12
; %bb.9:
	mov	x22, x0
	ldr	w0, [x19]
	bl	_to_hr_dev
	mov	x1, x20
	bl	_hns_roce_mr_free
LBB0_10:
	mov	x0, x20
	bl	_kfree
	mov	x0, x22
	b	LBB0_5
LBB0_11:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
LBB0_12:
	ldr	w8, [x20, #16]
	stp	w8, w8, [x20]
	str	xzr, [x20, #8]
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_IB_MR_TYPE_MEM_REG,4,2         ; @IB_MR_TYPE_MEM_REG
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HNS_ROCE_FRMR_MAX_PA,4,2       ; @HNS_ROCE_FRMR_MAX_PA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"max_num_sg larger than %d\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MR_TYPE_FRMR,4,2               ; @MR_TYPE_FRMR
.subsections_via_symbols
