	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rvt_alloc_lkey
_rvt_alloc_lkey:                        ## @rvt_alloc_lkey
	.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	%esi, %r12d
	movq	%rdi, %r14
	movq	16(%rdi), %rax
	movl	(%rax), %edi
	callq	_ib_to_rvt
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_rvt_get_mr
	movq	%r13, %r15
	addq	$24, %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	testl	%r12d, %r12d
	je	LBB0_3
## %bb.1:
	movl	4(%r13), %edi
	callq	_rcu_access_pointer
	testq	%rax, %rax
	jne	LBB0_10
## %bb.2:
	movl	$1, (%r14)
	movl	4(%r13), %edi
	movq	%r14, %rsi
	callq	_rcu_assign_pointer
	movq	%r14, %rdi
	callq	_rvt_get_mr
	jmp	LBB0_10
LBB0_3:
	movq	8(%r13), %r12
	movq	%r12, %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r13), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_rcu_access_pointer
	leaq	1(%rbx), %rdx
	movslq	16(%r13), %rcx
	decq	%rcx
	andq	%rdx, %rcx
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rcx, %rbx
	cmpq	%r12, %rcx
	jne	LBB0_4
## %bb.6:
	movq	%r14, %rdi
	callq	_rvt_put_mr
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_7:
	movq	%rcx, 8(%r13)
	movl	20(%r13), %eax
	leal	1(%rax), %edx
	movl	%edx, 20(%r13)
	movb	(%r13), %sil
	leal	32(%rsi), %ecx
	negb	%cl
	movq	%rbx, %rdi
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rdi
	movb	$24, %cl
	subb	%sil, %cl
	movl	$-1, %esi
	shll	%cl, %esi
	notl	%esi
	andl	%edx, %esi
	shll	$8, %esi
	movslq	%esi, %rcx
	orq	%rdi, %rcx
	movq	%rcx, 8(%r14)
	jne	LBB0_9
## %bb.8:
	movq	$256, 8(%r14)                   ## imm = 0x100
	addl	$2, %eax
	movl	%eax, 20(%r13)
LBB0_9:
	movl	$1, (%r14)
	movq	32(%r13), %rax
	movl	(%rax,%rbx,4), %edi
	movq	%r14, %rsi
	callq	_rcu_assign_pointer
LBB0_10:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_rvt_alloc_lkey
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rvt_alloc_lkey
_rvt_alloc_lkey:                        ; @rvt_alloc_lkey
	.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, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	w0, [x8]
	bl	_ib_to_rvt
	mov	x21, x0
	mov	x0, x19
	bl	_rvt_get_mr
	add	x20, x21, #24
	mov	x0, x20
	bl	_spin_lock_irqsave
	cbz	w22, LBB0_3
; %bb.1:
	ldr	w0, [x21, #4]
	bl	_rcu_access_pointer
	cbnz	x0, LBB0_10
; %bb.2:
	mov	w8, #1
	str	w8, [x19]
	ldr	w0, [x21, #4]
	mov	x1, x19
	bl	_rcu_assign_pointer
	mov	x0, x19
	bl	_rvt_get_mr
	b	LBB0_10
LBB0_3:
	ldr	x23, [x21, #8]
	mov	x22, x23
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #32]
	ldr	w0, [x8, x22, lsl #2]
	bl	_rcu_access_pointer
	add	x8, x22, #1
	ldrsw	x9, [x21, #16]
	sub	x9, x9, #1
	and	x8, x8, x9
	cbz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x22, x8
	cmp	x8, x23
	b.ne	LBB0_4
; %bb.6:
	mov	x0, x19
	bl	_rvt_put_mr
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_7:
	str	x8, [x21, #8]
	ldr	w8, [x21, #20]
	add	w9, w8, #1
	str	w9, [x21, #20]
	ldr	w10, [x21]
	mov	w11, #32
	sub	w11, w11, w10
	lsl	x11, x22, x11
	mov	w12, #24
	sub	w10, w12, w10
	mov	w12, #-1
	lsl	w10, w12, w10
	bic	w9, w9, w10
	lsl	w9, w9, #8
	sxtw	x9, w9
	orr	x9, x11, x9
	str	x9, [x19, #8]
	cbnz	x9, LBB0_9
; %bb.8:
	mov	w9, #256
	str	x9, [x19, #8]
	add	w8, w8, #2
	str	w8, [x21, #20]
LBB0_9:
	mov	w8, #1
	str	w8, [x19]
	ldr	x8, [x21, #32]
	ldr	w0, [x8, x22, lsl #2]
	mov	x1, x19
	bl	_rcu_assign_pointer
LBB0_10:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_11:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_rvt_alloc_lkey
.subsections_via_symbols
