	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function hns_roce_reg_user_mr
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_hns_roce_reg_user_mr
	.p2align	4, 0x90
_hns_roce_reg_user_mr:                  ## @hns_roce_reg_user_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r12
	movl	%r8d, %r13d
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %edi
	callq	_to_hr_dev
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$20, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	%r13d, %ecx
	xorl	%r8d, %r8d
	callq	_ib_umem_get
	movl	%eax, (%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	movl	(%rbx), %edi
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	callq	_PTR_ERR
	movl	%eax, %r13d
	jmp	LBB0_28
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_2
LBB0_5:
	callq	_ib_umem_page_count
	movl	%eax, %r8d
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %esi
	movq	%rbx, %r12
	testl	%esi, %esi
	je	LBB0_6
## %bb.9:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	4(%r14), %ecx
	movl	$1, %ebx
	movl	$1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	testl	%esi, %esi
	jle	LBB0_21
## %bb.10:
	cmpl	$8, %esi
	jae	LBB0_12
## %bb.11:
	xorl	%ecx, %ecx
	movl	$1, %ebx
	jmp	LBB0_19
LBB0_6:
	movq	_HNS_ROCE_MAX_MTPT_PBL_NUM@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r8d
	jle	LBB0_23
## %bb.7:
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_8
LBB0_12:
	movl	%esi, %ecx
	andl	$-8, %ecx
	movd	%eax, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leal	-8(%rcx), %ebx
	movl	%ebx, %edi
	shrl	$3, %edi
	incl	%edi
	movl	%edi, %edx
	andl	$7, %edx
	cmpl	$56, %ebx
	jae	LBB0_14
## %bb.13:
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [1,1,1,1]
	movdqa	%xmm1, %xmm2
	jmp	LBB0_16
LBB0_14:
	andl	$-8, %edi
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [1,1,1,1]
	movdqa	%xmm1, %xmm2
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	addl	$-8, %edi
	jne	LBB0_15
LBB0_16:
	testl	%edx, %edx
	je	LBB0_18
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	decl	%edx
	jne	LBB0_17
LBB0_18:
	pmulld	%xmm2, %xmm1
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	pmulld	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	pmulld	%xmm0, %xmm1
	movd	%xmm1, %ebx
	cmpl	%ecx, %esi
	je	LBB0_21
LBB0_19:
	subl	%ecx, %esi
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	imull	%eax, %ebx
	decl	%esi
	jne	LBB0_20
LBB0_21:
	cmpl	%ebx, %r8d
	jle	LBB0_23
## %bb.22:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movq	%r12, %rbx
	jmp	LBB0_27
LBB0_23:
	movq	_MR_TYPE_MR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r12, %rbx
	movl	%eax, 16(%r12)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r8d, %r12d
	callq	_to_hr_pd
	movl	(%rax), %esi
	movq	%rbx, (%rsp)
	movq	%r14, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r15d, %ecx
	movl	%r13d, %r8d
	movl	%r12d, %r9d
	callq	_hns_roce_mr_alloc
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_27
## %bb.24:
	movl	(%rbx), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_hns_roce_ib_umem_write_mr
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_26
## %bb.25:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_hns_roce_mr_enable
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_29
LBB0_26:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_hns_roce_mr_free
LBB0_27:
	movl	(%rbx), %edi
	callq	_ib_umem_release
LBB0_28:
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r13d, %edi
LBB0_2:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_29:
	movl	12(%rbx), %ecx
	movq	%rbx, %rax
	addq	$4, %rax
	movl	%ecx, 4(%rbx)
	movl	%ecx, 8(%rbx)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_HNS_ROCE_MAX_MTPT_PBL_NUM,4,2  ## @HNS_ROCE_MAX_MTPT_PBL_NUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" MR len %lld err. MR is limited to 4G at most!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_BA_BYTE_LEN,4,2                ## @BA_BYTE_LEN
L_.str.1:                               ## @.str.1
	.asciz	" MR len %lld err. MR page num is limited to %lld!\n"

	.comm	_MR_TYPE_MR,4,2                 ## @MR_TYPE_MR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_reg_user_mr           ; -- Begin function hns_roce_reg_user_mr
	.p2align	2
_hns_roce_reg_user_mr:                  ; @hns_roce_reg_user_mr
	.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	x26, x5
	mov	x22, x4
	mov	x23, x3
	mov	x21, x2
	mov	x27, x1
	mov	x24, x0
	ldr	w0, [x0]
	bl	_to_hr_dev
	mov	x20, x0
	ldr	x25, [x0, #8]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #20
	bl	_kmalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	x0, x26
	mov	x1, x27
	mov	x2, x21
	mov	x3, x22
	mov	w4, #0
	bl	_ib_umem_get
	str	w0, [x19]
	bl	_IS_ERR
	mov	x8, x0
	ldr	w0, [x19]
	cbz	x8, LBB0_4
; %bb.2:
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_23
LBB0_3:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_24
LBB0_4:
	bl	_ib_umem_page_count
	mov	x26, x0
	ldr	w9, [x20]
	cbz	w9, LBB0_8
; %bb.5:
	mov	w11, #1
	cmp	w9, #1
	b.lt	LBB0_15
; %bb.6:
	ldr	w8, [x20, #4]
Lloh6:
	adrp	x10, _PAGE_SHIFT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _PAGE_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	add	w8, w10, w8
	lsl	w8, w11, w8
Lloh9:
	adrp	x10, _BA_BYTE_LEN@GOTPAGE
Lloh10:
	ldr	x10, [x10, _BA_BYTE_LEN@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	sdiv	w8, w8, w10
	cmp	w9, #16
	b.hs	LBB0_10
; %bb.7:
	mov	w10, #0
	mov	w11, #1
	b	LBB0_13
LBB0_8:
Lloh12:
	adrp	x8, _HNS_ROCE_MAX_MTPT_PBL_NUM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HNS_ROCE_MAX_MTPT_PBL_NUM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w26, w8
	b.le	LBB0_18
; %bb.9:
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_17
LBB0_10:
	dup.4s	v1, w8
	and	w10, w9, #0xfffffff0
	movi.4s	v0, #1
	mov	x11, x10
	movi.4s	v2, #1
	movi.4s	v3, #1
	movi.4s	v4, #1
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mul.4s	v0, v0, v1
	mul.4s	v2, v2, v1
	mul.4s	v3, v3, v1
	mul.4s	v4, v4, v1
	subs	w11, w11, #16
	b.ne	LBB0_11
; %bb.12:
	mul.4s	v0, v2, v0
	mul.4s	v0, v3, v0
	mul.4s	v0, v4, v0
	ext.16b	v1, v0, v0, #8
	mul.2s	v0, v0, v1
	fmov	w11, s0
	mov.s	w12, v0[1]
	mul	w11, w11, w12
	cmp	w9, w10
	b.eq	LBB0_15
LBB0_13:
	sub	w9, w9, w10
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	mul	w11, w11, w8
	subs	w9, w9, #1
	b.ne	LBB0_14
LBB0_15:
	cmp	w26, w11
	b.le	LBB0_18
; %bb.16:
	str	x11, [sp]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_17:
	mov	x0, x25
	mov	x2, x21
	bl	_dev_err
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_22
LBB0_18:
Lloh22:
	adrp	x8, _MR_TYPE_MR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MR_TYPE_MR@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	x0, x24
	bl	_to_hr_pd
	ldr	w1, [x0]
	mov	x0, x20
	mov	x2, x23
	mov	x3, x21
	mov	x4, x22
	mov	x5, x26
	mov	x6, x19
	bl	_hns_roce_mr_alloc
	mov	x21, x0
	cbnz	w0, LBB0_22
; %bb.19:
	ldr	w2, [x19]
	mov	x0, x20
	mov	x1, x19
	bl	_hns_roce_ib_umem_write_mr
	mov	x21, x0
	cbnz	w0, LBB0_21
; %bb.20:
	mov	x0, x20
	mov	x1, x19
	bl	_hns_roce_mr_enable
	mov	x21, x0
	cbz	w0, LBB0_25
LBB0_21:
	mov	x0, x20
	mov	x1, x19
	bl	_hns_roce_mr_free
LBB0_22:
	ldr	w0, [x19]
	bl	_ib_umem_release
LBB0_23:
	mov	x0, x19
	bl	_kfree
	mov	x0, x21
LBB0_24:
	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
	b	_ERR_PTR
LBB0_25:
	ldr	w8, [x19, #12]
	stp	w8, w8, [x19, #4]!
	mov	x0, x19
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_HNS_ROCE_MAX_MTPT_PBL_NUM,4,2  ; @HNS_ROCE_MAX_MTPT_PBL_NUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" MR len %lld err. MR is limited to 4G at most!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_BA_BYTE_LEN,4,2                ; @BA_BYTE_LEN
l_.str.1:                               ; @.str.1
	.asciz	" MR len %lld err. MR page num is limited to %lld!\n"

	.comm	_MR_TYPE_MR,4,2                 ; @MR_TYPE_MR
.subsections_via_symbols
