	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipath_alloc_lkey               ## -- Begin function ipath_alloc_lkey
	.p2align	4, 0x90
_ipath_alloc_lkey:                      ## @ipath_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	16(%rdi), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	(%rbx), %rcx
	movq	24(%rbx), %rax
	movslq	8(%rbx), %rsi
	decq	%rsi
	movq	%rcx, %rdx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	leaq	1(%rdx), %rdi
	andq	%rsi, %rdi
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rdi, %rdx
	cmpq	%rcx, %rdi
	jne	LBB0_1
## %bb.3:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	leaq	L_.str(%rip), %rdi
	callq	_ipath_dbg
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_4:
	movq	%rdi, (%rbx)
	movl	12(%rbx), %r8d
	leal	1(%r8), %r9d
	movl	%r9d, 12(%rbx)
	movq	_ib_ipath_lkey_table_size@GOTPCREL(%rip), %rcx
	movb	(%rcx), %sil
	leal	32(%rsi), %ecx
	negb	%cl
	movq	%rdx, %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	%r9d, %esi
	shll	$8, %esi
	movslq	%esi, %rcx
	orq	%rdi, %rcx
	movq	%rcx, (%r14)
	jne	LBB0_6
## %bb.5:
	movq	$256, (%r14)                    ## imm = 0x100
	addl	$2, %r8d
	movl	%r8d, 12(%rbx)
LBB0_6:
	movq	%r14, (%rax,%rdx,8)
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	$1, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LKEY table full\n"

	.comm	_ib_ipath_lkey_table_size,4,2   ## @ib_ipath_lkey_table_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipath_alloc_lkey               ; -- Begin function ipath_alloc_lkey
	.p2align	2
_ipath_alloc_lkey:                      ; @ipath_alloc_lkey
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x21, x0
	add	x19, x0, #16
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x10, [x21]
	ldr	x8, [x21, #24]
	ldrsw	x9, [x21, #8]
	sub	x11, x9, #1
	mov	x9, x10
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x8, x9, lsl #3]
	add	x12, x9, #1
	and	x12, x12, x11
	cbz	x13, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x9, x12
	cmp	x12, x10
	b.ne	LBB0_1
; %bb.3:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ipath_dbg
	mov	w0, #0
	b	LBB0_7
LBB0_4:
	str	x12, [x21]
	ldr	w10, [x21, #12]
	add	w11, w10, #1
	str	w11, [x21, #12]
Lloh2:
	adrp	x12, _ib_ipath_lkey_table_size@GOTPAGE
Lloh3:
	ldr	x12, [x12, _ib_ipath_lkey_table_size@GOTPAGEOFF]
Lloh4:
	ldr	w12, [x12]
	mov	w13, #32
	sub	w13, w13, w12
	lsl	x13, x9, x13
	mov	w14, #24
	sub	w12, w14, w12
	mov	w14, #-1
	lsl	w12, w14, w12
	bic	w11, w11, w12
	lsl	w11, w11, #8
	sxtw	x11, w11
	orr	x11, x13, x11
	str	x11, [x20]
	cbnz	x11, LBB0_6
; %bb.5:
	mov	w11, #256
	str	x11, [x20]
	add	w10, w10, #2
	str	w10, [x21, #12]
LBB0_6:
	str	x20, [x8, x9, lsl #3]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #1
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LKEY table full\n"

	.comm	_ib_ipath_lkey_table_size,4,2   ; @ib_ipath_lkey_table_size
.subsections_via_symbols
