	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_efa_reg_mr                     ## -- Begin function efa_reg_mr
	.p2align	4, 0x90
_efa_reg_mr:                            ## @efa_reg_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	$72, %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, %r14d
	movl	%ecx, -72(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movl	(%rdi), %edi
	callq	_to_edev
	movq	%rax, %r15
	xorps	%xmm0, %xmm0
	movups	%xmm0, -100(%rbp)
	movaps	%xmm0, -112(%rbp)
	movq	$0, -64(%rbp)
	cmpq	$0, (%r12)
	je	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_ib_is_udata_cleared
	testl	%eax, %eax
	je	LBB0_2
LBB0_5:
	movq	_EFA_SUPPORTED_ACCESS_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %eax
	notl	%eax
	testl	%r14d, %eax
	je	LBB0_7
## %bb.6:
	movq	%r15, %r12
	movq	%r15, %rdi
	addq	$4, %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_ibdev_dbg
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_7:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %rbx
	movq	%r12, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edx
	movl	%r14d, %ecx
	xorl	%r8d, %r8d
	callq	_ib_umem_get
	movl	%eax, (%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movl	(%rbx), %edi
	callq	_PTR_ERR
	movq	%rbx, %r13
	movl	%eax, %ebx
	movq	%r15, %r12
	movq	%r15, %rdi
	addq	$4, %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_ibdev_dbg
	jmp	LBB0_11
LBB0_2:
	movq	%r15, %r12
	movq	%r15, %rdi
	addq	$4, %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_ibdev_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	subl	(%rax), %ebx
LBB0_4:
	movq	%r12, %rdi
	callq	_atomic64_inc
	movl	%ebx, %edi
	callq	_ERR_PTR
	movq	%rax, %rbx
LBB0_21:
	movq	%rbx, %rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r15, %r12
	jmp	LBB0_4
LBB0_12:
	movq	%r13, %rdi
	callq	_to_epd
	movl	(%rax), %eax
	movl	%eax, -88(%rbp)
	movl	-72(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, -112(%rbp)
	movl	%r12d, -108(%rbp)
	andl	$1, %r14d
	movl	%r14d, -104(%rbp)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	movl	%r12d, %r13d
	movq	%r15, %r12
	movl	12(%r15), %esi
	callq	_ib_umem_find_best_pgsz
	testl	%eax, %eax
	je	LBB0_13
## %bb.14:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	___ffs
	movl	%eax, %r14d
	movl	%eax, -92(%rbp)
	movl	%ebx, %edi
	decl	%edi
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	andl	%r15d, %edi
	addl	%r13d, %edi
	movl	%ebx, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
	movl	%eax, -100(%rbp)
	leaq	4(%r12), %rdi
	leaq	L_.str.4(%rip), %rsi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	%r15d, %edx
	movl	%r13d, %ecx
	movl	%r14d, %r8d
	movl	%eax, %r9d
	xorl	%eax, %eax
	callq	_ibdev_dbg
	xorl	%edi, %edi
	callq	_ARRAY_SIZE
	cmpl	%eax, %ebx
	jle	LBB0_15
## %bb.18:
	leaq	-80(%rbp), %rsi
	leaq	-112(%rbp), %rcx
	movq	%r12, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_efa_create_pbl
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
## %bb.19:
	movq	%r12, %rdi
	addq	$8, %rdi
	leaq	-112(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	callq	_efa_com_register_mr
	movl	%eax, %ebx
	leaq	-80(%rbp), %rsi
	movq	%r12, %rdi
	callq	_pbl_destroy
	testl	%ebx, %ebx
	jne	LBB0_17
	jmp	LBB0_20
LBB0_13:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r12, %rdi
	addq	$4, %rdi
	movl	12(%r12), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_ibdev_dbg
	jmp	LBB0_17
LBB0_15:
	leaq	-112(%rbp), %rdx
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_efa_create_inline_pbl
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
## %bb.16:
	movq	%r12, %rdi
	addq	$8, %rdi
	leaq	-112(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	callq	_efa_com_register_mr
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_20
LBB0_17:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	(%r13), %edi
	callq	_ib_umem_release
LBB0_11:
	movq	%r13, %rdi
	callq	_kfree
	jmp	LBB0_4
LBB0_20:
	movl	-64(%rbp), %edx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rbx
	addq	$4, %rbx
	movl	%edx, 4(%r13)
	movl	-60(%rbp), %eax
	movl	%eax, 12(%r13)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r13)
	leaq	L_.str.5(%rip), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_ibdev_dbg
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Incompatible ABI params, udata not cleared\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EFA_SUPPORTED_ACCESS_FLAGS,4,2 ## @EFA_SUPPORTED_ACCESS_FLAGS
L_.str.1:                               ## @.str.1
	.asciz	"Unsupported access flags[%#x], supported[%#x]\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Failed to pin and map user space memory[%d]\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to find a suitable page size in page_size_cap %#llx\n"

L_.str.4:                               ## @.str.4
	.asciz	"start %#llx length %#llx params.page_shift %u params.page_num %u\n"

L_.str.5:                               ## @.str.5
	.asciz	"Registered mr[%d]\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_efa_reg_mr                     ; -- Begin function efa_reg_mr
	.p2align	2
_efa_reg_mr:                            ; @efa_reg_mr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x26, x5
	mov	x23, x4
	mov	x24, x3
	mov	x21, x2
	mov	x22, x1
	mov	x25, x0
	ldr	w0, [x0]
	bl	_to_edev
	mov	x19, x0
	stp	xzr, xzr, [sp, #48]
	str	wzr, [sp, #72]
	str	xzr, [sp, #64]
	str	xzr, [sp, #40]
	ldr	x8, [x26]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x26
	mov	w1, #0
	mov	w2, #8
	bl	_ib_is_udata_cleared
	cbz	w0, LBB0_7
LBB0_2:
Lloh0:
	adrp	x8, _EFA_SUPPORTED_ACCESS_FLAGS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EFA_SUPPORTED_ACCESS_FLAGS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	bics	wzr, w23, w8
	b.eq	LBB0_4
; %bb.3:
	add	x0, x19, #4
	stp	x23, x8, [sp]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_ibdev_dbg
Lloh5:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_8
; %bb.5:
	mov	x20, x0
	mov	x0, x26
	mov	x1, x22
	mov	x2, x21
	mov	x3, x23
	mov	w4, #0
	bl	_ib_umem_get
	str	w0, [x20]
	bl	_IS_ERR
	cbz	x0, LBB0_12
; %bb.6:
	ldr	w0, [x20]
	bl	_PTR_ERR
	mov	x22, x0
	add	x0, x19, #4
	str	x22, [sp]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_ibdev_dbg
	b	LBB0_20
LBB0_7:
	add	x0, x19, #4
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ibdev_dbg
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_10:
	mov	x0, x19
	bl	_atomic64_inc
	mov	x0, x22
	bl	_ERR_PTR
	mov	x20, x0
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_12:
	mov	x0, x25
	bl	_to_epd
	ldr	w8, [x0]
	stp	w24, w21, [sp, #48]
	and	w9, w23, #0x1
	str	w8, [sp, #72]
	str	w9, [sp, #56]
	ldr	w0, [x20]
	ldr	w1, [x19, #12]
	mov	x2, x24
	bl	_ib_umem_find_best_pgsz
	cbz	w0, LBB0_16
; %bb.13:
	mov	x23, x0
	bl	___ffs
	mov	x24, x0
	str	w0, [sp, #68]
	sub	w8, w23, #1
	and	w8, w8, w22
	add	w0, w8, w21
	mov	x1, x23
	bl	_DIV_ROUND_UP
	mov	x25, x0
	str	w0, [sp, #60]
	add	x23, x19, #4
	stp	x24, x25, [sp, #16]
	stp	x22, x21, [sp]
Lloh18:
	adrp	x1, l_.str.4@PAGE
Lloh19:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x23
	bl	_ibdev_dbg
	mov	w0, #0
	bl	_ARRAY_SIZE
	cmp	w25, w0
	b.le	LBB0_17
; %bb.14:
	add	x1, sp, #32
	add	x3, sp, #48
	mov	x0, x19
	mov	x2, x20
	bl	_efa_create_pbl
	mov	x22, x0
	cbnz	w0, LBB0_19
; %bb.15:
	add	x0, x19, #8
	add	x1, sp, #48
	add	x2, sp, #40
	bl	_efa_com_register_mr
	mov	x22, x0
	add	x1, sp, #32
	mov	x0, x19
	bl	_pbl_destroy
	cbnz	w22, LBB0_19
	b	LBB0_21
LBB0_16:
Lloh20:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w22, w8
	add	x0, x19, #4
	ldr	w8, [x19, #12]
	str	x8, [sp]
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_ibdev_dbg
	b	LBB0_19
LBB0_17:
	add	x2, sp, #48
	mov	x0, x19
	mov	x1, x20
	bl	_efa_create_inline_pbl
	mov	x22, x0
	cbnz	w0, LBB0_19
; %bb.18:
	add	x0, x19, #8
	add	x1, sp, #48
	add	x2, sp, #40
	bl	_efa_com_register_mr
	mov	x22, x0
	cbz	w0, LBB0_21
LBB0_19:
	ldr	w0, [x20]
	bl	_ib_umem_release
LBB0_20:
	mov	x0, x20
	bl	_kfree
	b	LBB0_10
LBB0_21:
	ldr	w8, [sp, #40]
	str	w8, [x20, #4]!
	ldr	w9, [sp, #44]
	stp	w21, w9, [x20, #4]
	str	x8, [sp]
Lloh25:
	adrp	x1, l_.str.5@PAGE
Lloh26:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x23
	bl	_ibdev_dbg
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Incompatible ABI params, udata not cleared\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EFA_SUPPORTED_ACCESS_FLAGS,4,2 ; @EFA_SUPPORTED_ACCESS_FLAGS
l_.str.1:                               ; @.str.1
	.asciz	"Unsupported access flags[%#x], supported[%#x]\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Failed to pin and map user space memory[%d]\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to find a suitable page size in page_size_cap %#llx\n"

l_.str.4:                               ; @.str.4
	.asciz	"start %#llx length %#llx params.page_shift %u params.page_num %u\n"

l_.str.5:                               ; @.str.5
	.asciz	"Registered mr[%d]\n"

.subsections_via_symbols
