	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qedr_alloc_ucontext            ## -- Begin function qedr_alloc_ucontext
	.p2align	4, 0x90
_qedr_alloc_ucontext:                   ## @qedr_alloc_ucontext
	.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	%r12
	pushq	%rbx
	subq	$80, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	(%rdi), %rbx
	callq	_get_qedr_ucontext
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_get_qedr_dev
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	24(%rax), %rax
	movl	20(%r12), %edi
	leaq	-56(%rbp), %rsi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_DP_ERR
	jmp	LBB0_7
LBB0_1:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_4:
	movl	-40(%rbp), %eax
	movl	%eax, 36(%r14)
	movl	-44(%rbp), %eax
	movl	%eax, 32(%r14)
	movl	-48(%rbp), %eax
	movl	%eax, 8(%r14)
	movl	-52(%rbp), %eax
	movl	%eax, 4(%r14)
	leaq	28(%r14), %rdi
	callq	_INIT_LIST_HEAD
	movq	%r14, %rdi
	addq	$24, %rdi
	callq	_mutex_init
	movl	16(%r12), %eax
	movl	%eax, -60(%rbp)
	movl	$1, -104(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -64(%rbp)
	movsd	4(%r14), %xmm0                  ## xmm0 = mem[0],zero
	movsd	8(%r12), %xmm1                  ## xmm1 = mem[0],zero
	movlhps	%xmm0, %xmm1                    ## xmm1 = xmm1[0],xmm0[0]
	movups	%xmm1, -80(%rbp)
	movl	4(%r12), %eax
	movl	%eax, -84(%rbp)
	movq	_QEDR_MAX_SQE_ELEMENTS_PER_SQE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -88(%rbp)
	movq	_QEDR_MAX_RQE_ELEMENTS_PER_RQE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -92(%rbp)
	movl	(%r12), %eax
	movl	%eax, -96(%rbp)
	movq	_QEDR_MAX_CQES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -100(%rbp)
	leaq	-104(%rbp), %rsi
	movq	%r15, %rdi
	movl	$48, %edx
	callq	_qedr_ib_copy_to_udata
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movq	%r12, 16(%r14)
	movl	4(%r14), %edx
	movl	8(%r14), %esi
	movq	%r14, %rdi
	callq	_qedr_add_mmap
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	_QEDR_MSG_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	movq	%r14, %rcx
	callq	_DP_DEBUG
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$80, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EFAULT,4,2                     ## @EFAULT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate a DPI for a new RoCE application, rc=%d. To overcome this consider to increase the number of DPIs, increase the doorbell BAR size or just close unnecessary RoCE applications. In order to increase the number of DPIs consult the qedr readme\n"

	.comm	_QEDR_MAX_SQE_ELEMENTS_PER_SQE,4,2 ## @QEDR_MAX_SQE_ELEMENTS_PER_SQE
	.comm	_QEDR_MAX_RQE_ELEMENTS_PER_RQE,4,2 ## @QEDR_MAX_RQE_ELEMENTS_PER_RQE
	.comm	_QEDR_MAX_CQES,4,2              ## @QEDR_MAX_CQES
	.comm	_QEDR_MSG_INIT,4,2              ## @QEDR_MSG_INIT
L_.str.1:                               ## @.str.1
	.asciz	"Allocating user context %p\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qedr_alloc_ucontext            ; -- Begin function qedr_alloc_ucontext
	.p2align	2
_qedr_alloc_ucontext:                   ; @qedr_alloc_ucontext
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x21, x1
	ldr	x20, [x0]
	bl	_get_qedr_ucontext
	mov	x19, x0
	mov	x0, x20
	bl	_get_qedr_dev
	cbz	x21, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0, #24]
	ldr	x8, [x8]
	ldr	w0, [x0, #20]
	add	x1, sp, #8
	blr	x8
	cbz	w0, LBB0_4
; %bb.2:
	mov	x22, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	bl	_DP_ERR
	b	LBB0_7
LBB0_3:
Lloh2:
	adrp	x8, _EFAULT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_7
LBB0_4:
	ldur	d0, [sp, #20]
	str	d0, [x19, #32]
	ldur	d0, [sp, #12]
	stur	d0, [x19, #4]
	add	x0, x19, #28
	bl	_INIT_LIST_HEAD
	add	x0, x19, #24
	bl	_mutex_init
	ldr	w8, [x20, #16]
	mov	w9, #1
	ldr	w10, [sp, #8]
	stp	w10, w8, [sp, #72]
	ldur	d0, [x19, #4]
	ldr	d1, [x20, #8]
	mov.d	v1[1], v0[0]
	stur	q1, [sp, #56]
	ldr	w8, [x20, #4]
Lloh5:
	adrp	x10, _QEDR_MAX_SQE_ELEMENTS_PER_SQE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _QEDR_MAX_SQE_ELEMENTS_PER_SQE@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	stp	w10, w8, [sp, #48]
Lloh8:
	adrp	x8, _QEDR_MAX_RQE_ELEMENTS_PER_RQE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _QEDR_MAX_RQE_ELEMENTS_PER_RQE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w9, [sp, #32]
	str	w8, [sp, #44]
	ldr	w8, [x20]
Lloh11:
	adrp	x9, _QEDR_MAX_CQES@GOTPAGE
Lloh12:
	ldr	x9, [x9, _QEDR_MAX_CQES@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #36]
	add	x1, sp, #32
	mov	x0, x21
	mov	w2, #48
	bl	_qedr_ib_copy_to_udata
	mov	x22, x0
	cbnz	w0, LBB0_7
; %bb.5:
	str	x20, [x19, #16]
	ldp	w2, w1, [x19, #4]
	mov	x0, x19
	bl	_qedr_add_mmap
	mov	x22, x0
	cbnz	w0, LBB0_7
; %bb.6:
Lloh14:
	adrp	x8, _QEDR_MSG_INIT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _QEDR_MSG_INIT@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x3, x19
	bl	_DP_DEBUG
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EFAULT,4,2                     ; @EFAULT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate a DPI for a new RoCE application, rc=%d. To overcome this consider to increase the number of DPIs, increase the doorbell BAR size or just close unnecessary RoCE applications. In order to increase the number of DPIs consult the qedr readme\n"

	.comm	_QEDR_MAX_SQE_ELEMENTS_PER_SQE,4,2 ; @QEDR_MAX_SQE_ELEMENTS_PER_SQE
	.comm	_QEDR_MAX_RQE_ELEMENTS_PER_RQE,4,2 ; @QEDR_MAX_RQE_ELEMENTS_PER_RQE
	.comm	_QEDR_MAX_CQES,4,2              ; @QEDR_MAX_CQES
	.comm	_QEDR_MSG_INIT,4,2              ; @QEDR_MSG_INIT
l_.str.1:                               ; @.str.1
	.asciz	"Allocating user context %p\n"

.subsections_via_symbols
