	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_mbx_alloc_lkey          ## -- Begin function ocrdma_mbx_alloc_lkey
	.p2align	4, 0x90
_ocrdma_mbx_alloc_lkey:                 ## @ocrdma_mbx_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	%ecx, %r13d
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_OCRDMA_CMD_ALLOC_LKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$8, %esi
	callq	_ocrdma_init_emb_mqe
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movl	%r15d, 4(%rax)
	orl	(%rax), %r13d
	movl	%r13d, (%rax)
	movl	(%r14), %eax
	movq	_OCRDMA_ALLOC_LKEY_FMR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%r13d, %eax
	movl	%eax, (%rbx)
	movl	4(%r14), %edx
	movq	_OCRDMA_ALLOC_LKEY_REMOTE_WR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, (%rbx)
	movl	8(%r14), %eax
	movq	_OCRDMA_ALLOC_LKEY_REMOTE_RD_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%edx, %eax
	movl	%eax, (%rbx)
	movl	12(%r14), %edx
	movq	_OCRDMA_ALLOC_LKEY_LOCAL_WR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, (%rbx)
	movl	16(%r14), %eax
	movq	_OCRDMA_ALLOC_LKEY_REMOTE_ATOMIC_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%edx, %eax
	movl	%eax, (%rbx)
	movl	20(%r14), %edx
	movq	_OCRDMA_ALLOC_LKEY_PBL_SIZE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, (%rbx)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_ocrdma_mbx_cmd
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movl	(%rbx), %eax
	movl	%eax, 24(%r14)
LBB0_4:
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_5
LBB0_1:
	negl	%r12d
LBB0_5:
	movl	%r12d, %eax
	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
	.comm	_OCRDMA_CMD_ALLOC_LKEY,4,2      ## @OCRDMA_CMD_ALLOC_LKEY
	.comm	_OCRDMA_ALLOC_LKEY_FMR_SHIFT,4,2 ## @OCRDMA_ALLOC_LKEY_FMR_SHIFT
	.comm	_OCRDMA_ALLOC_LKEY_REMOTE_WR_SHIFT,4,2 ## @OCRDMA_ALLOC_LKEY_REMOTE_WR_SHIFT
	.comm	_OCRDMA_ALLOC_LKEY_REMOTE_RD_SHIFT,4,2 ## @OCRDMA_ALLOC_LKEY_REMOTE_RD_SHIFT
	.comm	_OCRDMA_ALLOC_LKEY_LOCAL_WR_SHIFT,4,2 ## @OCRDMA_ALLOC_LKEY_LOCAL_WR_SHIFT
	.comm	_OCRDMA_ALLOC_LKEY_REMOTE_ATOMIC_SHIFT,4,2 ## @OCRDMA_ALLOC_LKEY_REMOTE_ATOMIC_SHIFT
	.comm	_OCRDMA_ALLOC_LKEY_PBL_SIZE_SHIFT,4,2 ## @OCRDMA_ALLOC_LKEY_PBL_SIZE_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_mbx_alloc_lkey          ; -- Begin function ocrdma_mbx_alloc_lkey
	.p2align	2
_ocrdma_mbx_alloc_lkey:                 ; @ocrdma_mbx_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	x23, x3
	mov	x22, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x8, _OCRDMA_CMD_ALLOC_LKEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OCRDMA_CMD_ALLOC_LKEY@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	w1, #8
	bl	_ocrdma_init_emb_mqe
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0]
	orr	w8, w8, w23
	stp	w8, w22, [x0]
Lloh6:
	adrp	x9, _OCRDMA_ALLOC_LKEY_FMR_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _OCRDMA_ALLOC_LKEY_FMR_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	ldp	w10, w11, [x19]
	lsl	w9, w10, w9
	orr	w8, w9, w8
	str	w8, [x0]
Lloh9:
	adrp	x9, _OCRDMA_ALLOC_LKEY_REMOTE_WR_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _OCRDMA_ALLOC_LKEY_REMOTE_WR_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	lsl	w9, w11, w9
	orr	w8, w9, w8
	str	w8, [x0]
Lloh12:
	adrp	x9, _OCRDMA_ALLOC_LKEY_REMOTE_RD_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _OCRDMA_ALLOC_LKEY_REMOTE_RD_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	ldp	w10, w11, [x19, #8]
	lsl	w9, w10, w9
	orr	w8, w9, w8
	str	w8, [x0]
Lloh15:
	adrp	x9, _OCRDMA_ALLOC_LKEY_LOCAL_WR_SHIFT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _OCRDMA_ALLOC_LKEY_LOCAL_WR_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	lsl	w9, w11, w9
	orr	w8, w9, w8
	str	w8, [x0]
Lloh18:
	adrp	x9, _OCRDMA_ALLOC_LKEY_REMOTE_ATOMIC_SHIFT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _OCRDMA_ALLOC_LKEY_REMOTE_ATOMIC_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	ldp	w10, w11, [x19, #16]
	lsl	w9, w10, w9
	orr	w8, w9, w8
	str	w8, [x0]
Lloh21:
	adrp	x9, _OCRDMA_ALLOC_LKEY_PBL_SIZE_SHIFT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _OCRDMA_ALLOC_LKEY_PBL_SIZE_SHIFT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	lsl	w9, w11, w9
	orr	w8, w9, w8
	str	w8, [x0]
	mov	x0, x21
	mov	x1, x20
	bl	_ocrdma_mbx_cmd
	mov	x21, x0
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w8, [x20]
	str	w8, [x19, #24]
LBB0_3:
	mov	x0, x20
	bl	_kfree
	b	LBB0_5
LBB0_4:
	neg	w21, w24
LBB0_5:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_OCRDMA_CMD_ALLOC_LKEY,4,2      ; @OCRDMA_CMD_ALLOC_LKEY
	.comm	_OCRDMA_ALLOC_LKEY_FMR_SHIFT,4,2 ; @OCRDMA_ALLOC_LKEY_FMR_SHIFT
	.comm	_OCRDMA_ALLOC_LKEY_REMOTE_WR_SHIFT,4,2 ; @OCRDMA_ALLOC_LKEY_REMOTE_WR_SHIFT
	.comm	_OCRDMA_ALLOC_LKEY_REMOTE_RD_SHIFT,4,2 ; @OCRDMA_ALLOC_LKEY_REMOTE_RD_SHIFT
	.comm	_OCRDMA_ALLOC_LKEY_LOCAL_WR_SHIFT,4,2 ; @OCRDMA_ALLOC_LKEY_LOCAL_WR_SHIFT
	.comm	_OCRDMA_ALLOC_LKEY_REMOTE_ATOMIC_SHIFT,4,2 ; @OCRDMA_ALLOC_LKEY_REMOTE_ATOMIC_SHIFT
	.comm	_OCRDMA_ALLOC_LKEY_PBL_SIZE_SHIFT,4,2 ; @OCRDMA_ALLOC_LKEY_PBL_SIZE_SHIFT
.subsections_via_symbols
