	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_reg_user_mr             ## -- Begin function ocrdma_reg_user_mr
	.p2align	4, 0x90
_ocrdma_reg_user_mr:                    ## @ocrdma_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, -80(%rbp)                  ## 8-byte Spill
	movl	%r8d, %r15d
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movl	(%rdi), %edi
	callq	_get_ocrdma_dev
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_get_ocrdma_pd
	movq	_IB_ACCESS_REMOTE_WRITE@GOTPCREL(%rip), %rcx
	testl	%r15d, (%rcx)
	je	LBB0_3
## %bb.1:
	movq	_IB_ACCESS_LOCAL_WRITE@GOTPCREL(%rip), %rcx
	testl	%r15d, (%rcx)
	je	LBB0_2
LBB0_3:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rax, %r15
	xorl	%r14d, %r14d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r12, %rbx
	movq	%r12, %rdx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	xorl	%r8d, %r8d
	callq	_ib_umem_get
	movl	%eax, 56(%r15)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_16
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_5
LBB0_8:
	movl	56(%r15), %edi
	callq	_ib_umem_page_count
	movl	%eax, %r13d
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_ocrdma_get_pbl_info
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.9:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%r15)
	movl	56(%r15), %edi
	callq	_ib_umem_offset
	movl	%eax, 40(%r15)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 32(%r15)
	movq	%rbx, 24(%r15)
	xorl	%eax, %eax
	movq	_IB_ACCESS_REMOTE_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	andl	%edx, %ecx
	setne	%al
	movl	%eax, (%r15)
	movq	_IB_ACCESS_REMOTE_READ@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %eax
	andl	%edx, %eax
	setne	%cl
	movl	%ecx, 4(%r15)
	movq	_IB_ACCESS_LOCAL_WRITE@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %eax
	andl	%edx, %eax
	setne	%cl
	movl	%ecx, 8(%r15)
	movl	$1, 12(%r15)
	movq	_IB_ACCESS_REMOTE_ATOMIC@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %eax
	andl	%edx, %eax
	setne	%cl
	movl	%ecx, 16(%r15)
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_ocrdma_build_pbl_tbl
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.10:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r13d, %edx
	callq	_build_user_pbes
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_ocrdma_reg_mr
	testl	%eax, %eax
	je	LBB0_11
## %bb.15:
	movl	%eax, %r14d
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_ocrdma_free_mr_pbl_tbl
LBB0_16:
	movq	%r15, %rdi
	callq	_kfree
LBB0_4:
	movl	%r14d, %edi
LBB0_5:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_11:
	movl	20(%r15), %ecx
	movq	%r15, %rax
	addq	$48, %rax
	movl	%ecx, 52(%r15)
	cmpl	$0, (%r15)
	jne	LBB0_13
## %bb.12:
	cmpl	$0, 4(%r15)
	je	LBB0_14
LBB0_13:
	movl	%ecx, (%rax)
LBB0_14:
	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	_IB_ACCESS_REMOTE_WRITE,4,2     ## @IB_ACCESS_REMOTE_WRITE
	.comm	_IB_ACCESS_LOCAL_WRITE,4,2      ## @IB_ACCESS_LOCAL_WRITE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_IB_ACCESS_REMOTE_READ,4,2      ## @IB_ACCESS_REMOTE_READ
	.comm	_IB_ACCESS_REMOTE_ATOMIC,4,2    ## @IB_ACCESS_REMOTE_ATOMIC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_reg_user_mr             ; -- Begin function ocrdma_reg_user_mr
	.p2align	2
_ocrdma_reg_user_mr:                    ; @ocrdma_reg_user_mr
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x25, x5
	mov	x19, x4
	mov	x24, x3
	mov	x23, x2
	mov	x26, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w28, [x8]
	ldr	w0, [x0]
	bl	_get_ocrdma_dev
	mov	x20, x0
	mov	x0, x21
	bl	_get_ocrdma_pd
	mov	x22, x0
Lloh3:
	adrp	x27, _IB_ACCESS_REMOTE_WRITE@GOTPAGE
Lloh4:
	ldr	x27, [x27, _IB_ACCESS_REMOTE_WRITE@GOTPAGEOFF]
	ldr	w8, [x27]
	tst	w8, w19
	b.eq	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _IB_ACCESS_LOCAL_WRITE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IB_ACCESS_LOCAL_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_6
LBB0_2:
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.3:
	mov	x21, x0
	mov	x0, x25
	mov	x1, x26
	mov	x2, x23
	mov	x3, x19
	mov	w4, #0
	bl	_ib_umem_get
	str	w0, [x21, #56]
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.4:
Lloh11:
	adrp	x8, _EFAULT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_11
LBB0_5:
	neg	w0, w28
	b	LBB0_12
LBB0_6:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_7:
	ldr	w0, [x21, #56]
	bl	_ib_umem_page_count
	mov	x25, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x25
	bl	_ocrdma_get_pbl_info
	mov	x26, x0
	cbnz	w0, LBB0_11
; %bb.8:
Lloh17:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x21, #44]
	ldr	w0, [x21, #56]
	bl	_ib_umem_offset
	str	w0, [x21, #40]
	stp	x23, x24, [x21, #24]
	ldr	w8, [x27]
	tst	w8, w19
	cset	w8, ne
	str	w8, [x21]
Lloh20:
	adrp	x8, _IB_ACCESS_REMOTE_READ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _IB_ACCESS_REMOTE_READ@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	tst	w8, w19
	cset	w8, ne
Lloh23:
	adrp	x9, _IB_ACCESS_LOCAL_WRITE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _IB_ACCESS_LOCAL_WRITE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w19
	cset	w9, ne
	stp	w8, w9, [x21, #4]
Lloh26:
	adrp	x8, _IB_ACCESS_REMOTE_ATOMIC@GOTPAGE
Lloh27:
	ldr	x8, [x8, _IB_ACCESS_REMOTE_ATOMIC@GOTPAGEOFF]
	mov	w9, #1
Lloh28:
	ldr	w8, [x8]
	tst	w8, w19
	cset	w8, ne
	stp	w9, w8, [x21, #12]
	mov	x0, x20
	mov	x1, x21
	bl	_ocrdma_build_pbl_tbl
	mov	x26, x0
	cbnz	w0, LBB0_11
; %bb.9:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x25
	bl	_build_user_pbes
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x21
	mov	x3, x19
	bl	_ocrdma_reg_mr
	cbz	w0, LBB0_13
; %bb.10:
	mov	x26, x0
	mov	x0, x20
	mov	x1, x21
	bl	_ocrdma_free_mr_pbl_tbl
LBB0_11:
	mov	x0, x21
	bl	_kfree
	mov	x0, x26
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_13:
	ldr	w8, [x21, #20]
	add	x0, x21, #48
	str	w8, [x21, #52]
	ldr	w9, [x21]
	cbnz	w9, LBB0_15
; %bb.14:
	ldr	w9, [x21, #4]
	cbz	w9, LBB0_16
LBB0_15:
	str	w8, [x0]
LBB0_16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IB_ACCESS_REMOTE_WRITE,4,2     ; @IB_ACCESS_REMOTE_WRITE
	.comm	_IB_ACCESS_LOCAL_WRITE,4,2      ; @IB_ACCESS_LOCAL_WRITE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_IB_ACCESS_REMOTE_READ,4,2      ; @IB_ACCESS_REMOTE_READ
	.comm	_IB_ACCESS_REMOTE_ATOMIC,4,2    ; @IB_ACCESS_REMOTE_ATOMIC
.subsections_via_symbols
