	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_alloc_mr                ## -- Begin function ocrdma_alloc_mr
	.p2align	4, 0x90
_ocrdma_alloc_mr:                       ## @ocrdma_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
	movq	%rdx, %r13
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_get_ocrdma_pd
	movq	%rax, %r15
	movl	(%rbx), %edi
	callq	_get_ocrdma_dev
	movq	%rax, %r12
	movq	_IB_MR_TYPE_MEM_REG@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_2
## %bb.1:
	cmpq	%r13, 8(%r12)
	jge	LBB0_4
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_4:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.5:
	movq	%rax, %r14
	movl	(%rbx), %edx
	movq	%r13, %rdi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_11
## %bb.6:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	_ocrdma_get_pbl_info
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:
	leaq	8(%r14), %rbx
	movl	$1, 8(%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%r14)
	movups	%xmm0, 32(%r14)
	movq	$0, 48(%r14)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ocrdma_build_pbl_tbl
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:
	movl	(%r15), %edx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_ocrdma_reg_mr
	testl	%eax, %eax
	je	LBB0_13
## %bb.9:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ocrdma_free_mr_pbl_tbl
LBB0_10:
	movq	(%r14), %rdi
	callq	_kfree
LBB0_11:
	movq	%r14, %rdi
	callq	_kfree
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_13:
	movl	12(%r14), %ecx
	movq	%r14, %rax
	addq	$56, %rax
	movl	%ecx, 56(%r14)
	movl	%ecx, 60(%r14)
	movq	(%r12), %rdx
	sarl	$8, %ecx
	movq	_OCRDMA_MAX_STAG@GOTPCREL(%rip), %rsi
	movslq	(%rsi), %rsi
	decq	%rsi
	movslq	%ecx, %rcx
	andq	%rsi, %rcx
	movq	%r14, (%rdx,%rcx,8)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_MR_TYPE_MEM_REG,4,2         ## @IB_MR_TYPE_MEM_REG
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_OCRDMA_MAX_STAG,4,2            ## @OCRDMA_MAX_STAG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_alloc_mr                ; -- Begin function ocrdma_alloc_mr
	.p2align	2
_ocrdma_alloc_mr:                       ; @ocrdma_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
	bl	_get_ocrdma_pd
	mov	x21, x0
	ldr	w0, [x19]
	bl	_get_ocrdma_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_2
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
	cmp	x8, x22
	b.ge	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_3:
Lloh5:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #64
	bl	_kzalloc
	cbz	x0, LBB0_11
; %bb.4:
	mov	x20, x0
	ldr	w2, [x23]
	mov	x0, x22
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x20]
	cbz	x0, LBB0_10
; %bb.5:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_ocrdma_get_pbl_info
	cbnz	w0, LBB0_9
; %bb.6:
	mov	w8, #1
	mov	x22, x20
	str	w8, [x22, #8]!
	movi.2d	v0, #0000000000000000
	stur	q0, [x22, #8]
	stur	q0, [x22, #24]
	str	xzr, [x22, #40]
	mov	x0, x19
	mov	x1, x22
	bl	_ocrdma_build_pbl_tbl
	cbnz	w0, LBB0_9
; %bb.7:
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x22
	mov	w3, #0
	bl	_ocrdma_reg_mr
	cbz	w0, LBB0_13
; %bb.8:
	mov	x0, x19
	mov	x1, x22
	bl	_ocrdma_free_mr_pbl_tbl
LBB0_9:
	ldr	x0, [x20]
	bl	_kfree
LBB0_10:
	mov	x0, x20
	bl	_kfree
LBB0_11:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
	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_13:
	ldr	w8, [x20, #12]
	mov	x0, x20
	str	w8, [x0, #56]!
	str	w8, [x20, #60]
	ldr	x9, [x19]
Lloh9:
	adrp	x10, _OCRDMA_MAX_STAG@GOTPAGE
Lloh10:
	ldr	x10, [x10, _OCRDMA_MAX_STAG@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	sub	w10, w10, #1
	and	w8, w10, w8, asr #8
	str	x20, [x9, w8, sxtw #3]
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_MR_TYPE_MEM_REG,4,2         ; @IB_MR_TYPE_MEM_REG
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_OCRDMA_MAX_STAG,4,2            ; @OCRDMA_MAX_STAG
.subsections_via_symbols
