	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function implicit_mr_alloc
_implicit_mr_alloc:                     ## @implicit_mr_alloc
	.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	%ecx, %r12d
	movl	%edx, %r13d
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movl	(%rdi), %edi
	callq	_to_mdev
	movq	%rax, %r14
	testl	%r13d, %r13d
	jne	LBB0_1
## %bb.2:
	movq	_MLX5_IMR_MTT_CACHE_ENTRY@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_MLX5_IMR_KSM_CACHE_ENTRY@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mlx5_mr_cache_alloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
LBB0_6:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	testl	%r13d, %r13d
	movq	%r15, 32(%rbx)
	movq	%r14, 48(%rbx)
	movl	%r12d, (%rbx)
	movq	$0, 16(%rbx)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 40(%rbx)
	movq	_mlx5_imr_ksm_entries@GOTPCREL(%rip), %rax
	cmoveq	_MLX5_IMR_MTT_ENTRIES@GOTPCREL(%rip), %rax
	movq	_MLX5_KSM_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	cmoveq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rax), %edx
	movl	(%rcx), %ecx
	movq	_MLX5_IB_UPD_XLT_INDIRECT@GOTPCREL(%rip), %rax
	movq	_MLX5_IB_UPD_XLT_ENABLE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	(%rax), %r8d
	cmovel	%esi, %r8d
	movq	_MLX5_IB_UPD_XLT_ATOMIC@GOTPCREL(%rip), %rax
	cmovel	(%rax), %esi
	movq	_MLX5_IB_UPD_XLT_ZAP@GOTPCREL(%rip), %rax
	orl	(%rax), %r8d
	orl	%esi, %r8d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_mlx5_ib_update_xlt
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_mlx5_ib_err
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mlx5_mr_cache_free
	movl	%r15d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_5:
	movl	8(%rbx), %edx
	movl	%edx, 28(%rbx)
	movl	%edx, 24(%rbx)
	movl	(%r14), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%rbx, %r8
	callq	_mlx5_ib_dbg
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX5_IMR_KSM_CACHE_ENTRY,4,2   ## @MLX5_IMR_KSM_CACHE_ENTRY
	.comm	_MLX5_IMR_MTT_CACHE_ENTRY,4,2   ## @MLX5_IMR_MTT_CACHE_ENTRY
	.comm	_mlx5_imr_ksm_entries,4,2       ## @mlx5_imr_ksm_entries
	.comm	_MLX5_KSM_PAGE_SHIFT,4,2        ## @MLX5_KSM_PAGE_SHIFT
	.comm	_MLX5_IB_UPD_XLT_INDIRECT,4,2   ## @MLX5_IB_UPD_XLT_INDIRECT
	.comm	_MLX5_IB_UPD_XLT_ZAP,4,2        ## @MLX5_IB_UPD_XLT_ZAP
	.comm	_MLX5_IB_UPD_XLT_ENABLE,4,2     ## @MLX5_IB_UPD_XLT_ENABLE
	.comm	_MLX5_IMR_MTT_ENTRIES,4,2       ## @MLX5_IMR_MTT_ENTRIES
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_MLX5_IB_UPD_XLT_ATOMIC,4,2     ## @MLX5_IB_UPD_XLT_ATOMIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"key %x dev %p mr %p\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to register MKEY %d\n"

	.no_dead_strip	_implicit_mr_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function implicit_mr_alloc
_implicit_mr_alloc:                     ; @implicit_mr_alloc
	.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	x24, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	ldr	w0, [x0]
	bl	_to_mdev
	mov	x19, x0
Lloh0:
	adrp	x8, _MLX5_IMR_KSM_CACHE_ENTRY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX5_IMR_KSM_CACHE_ENTRY@GOTPAGEOFF]
Lloh2:
	adrp	x9, _MLX5_IMR_MTT_CACHE_ENTRY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MLX5_IMR_MTT_CACHE_ENTRY@GOTPAGEOFF]
	cmp	w21, #0
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
	bl	_mlx5_mr_cache_alloc
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
LBB0_1:
	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
LBB0_2:
	str	x19, [x20, #48]
	str	w24, [x20]
Lloh4:
	adrp	x8, _MLX5_IMR_MTT_ENTRIES@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MLX5_IMR_MTT_ENTRIES@GOTPAGEOFF]
	str	xzr, [x20, #16]
Lloh6:
	adrp	x9, _mlx5_imr_ksm_entries@GOTPAGE
Lloh7:
	ldr	x9, [x9, _mlx5_imr_ksm_entries@GOTPAGEOFF]
Lloh8:
	adrp	x10, _MLX5_IB_UPD_XLT_INDIRECT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _MLX5_IB_UPD_XLT_INDIRECT@GOTPAGEOFF]
	stp	x23, x22, [x20, #32]
Lloh10:
	ldr	w10, [x10]
Lloh11:
	adrp	x11, _MLX5_IB_UPD_XLT_ENABLE@GOTPAGE
Lloh12:
	ldr	x11, [x11, _MLX5_IB_UPD_XLT_ENABLE@GOTPAGEOFF]
Lloh13:
	ldr	w11, [x11]
	cmp	w21, #0
	csel	w10, w11, w10, eq
	csel	x8, x8, x9, eq
Lloh14:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh16:
	adrp	x12, _MLX5_KSM_PAGE_SHIFT@GOTPAGE
Lloh17:
	ldr	x12, [x12, _MLX5_KSM_PAGE_SHIFT@GOTPAGEOFF]
	ldr	w2, [x8]
	csel	x8, x9, x12, eq
	ldr	w3, [x8]
Lloh18:
	adrp	x8, _MLX5_IB_UPD_XLT_ZAP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MLX5_IB_UPD_XLT_ZAP@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	orr	w8, w8, w10
Lloh21:
	adrp	x9, _MLX5_IB_UPD_XLT_ATOMIC@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MLX5_IB_UPD_XLT_ATOMIC@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	csel	w9, w9, w11, eq
	orr	w4, w8, w9
	mov	x0, x20
	mov	w1, #0
	bl	_mlx5_ib_update_xlt
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_mlx5_ib_err
	mov	x0, x19
	mov	x1, x20
	bl	_mlx5_mr_cache_free
	mov	x0, x21
	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_4:
	ldr	w2, [x20, #8]
	stp	w2, w2, [x20, #24]
	ldr	w3, [x19]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x4, x20
	bl	_mlx5_ib_dbg
	b	LBB0_1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX5_IMR_KSM_CACHE_ENTRY,4,2   ; @MLX5_IMR_KSM_CACHE_ENTRY
	.comm	_MLX5_IMR_MTT_CACHE_ENTRY,4,2   ; @MLX5_IMR_MTT_CACHE_ENTRY
	.comm	_mlx5_imr_ksm_entries,4,2       ; @mlx5_imr_ksm_entries
	.comm	_MLX5_KSM_PAGE_SHIFT,4,2        ; @MLX5_KSM_PAGE_SHIFT
	.comm	_MLX5_IB_UPD_XLT_INDIRECT,4,2   ; @MLX5_IB_UPD_XLT_INDIRECT
	.comm	_MLX5_IB_UPD_XLT_ZAP,4,2        ; @MLX5_IB_UPD_XLT_ZAP
	.comm	_MLX5_IB_UPD_XLT_ENABLE,4,2     ; @MLX5_IB_UPD_XLT_ENABLE
	.comm	_MLX5_IMR_MTT_ENTRIES,4,2       ; @MLX5_IMR_MTT_ENTRIES
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_MLX5_IB_UPD_XLT_ATOMIC,4,2     ; @MLX5_IB_UPD_XLT_ATOMIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"key %x dev %p mr %p\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to register MKEY %d\n"

	.no_dead_strip	_implicit_mr_alloc
.subsections_via_symbols
