	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocxl_context_alloc             ## -- Begin function ocxl_context_alloc
	.p2align	4, 0x90
_ocxl_context_alloc:                    ## @ocxl_context_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
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	$64, %edi
	callq	_kzalloc
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%r14, 56(%rax)
	movq	%r14, %rdi
	callq	_mutex_lock
	leaq	24(%r14), %rdi
	movq	16(%r14), %rdx
	movq	8(%r14), %rcx
	addq	%rdx, %rcx
	movl	(%r13), %r8d
	movq	%rbx, %rsi
	callq	_idr_alloc
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	incl	4(%r14)
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r12d, (%rbx)
	movq	_OPENED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rbx)
	leaq	48(%rbx), %rdi
	callq	_mutex_init
	movq	%r15, 40(%rbx)
	leaq	32(%rbx), %rdi
	callq	_mutex_init
	leaq	28(%rbx), %rdi
	callq	_init_waitqueue_head
	leaq	24(%rbx), %rdi
	callq	_mutex_init
	leaq	20(%rbx), %rdi
	callq	_mutex_init
	movq	%rbx, %rdi
	addq	$16, %rdi
	callq	_idr_init
	movq	$0, 8(%rbx)
	movq	%r14, %rdi
	callq	_ocxl_afu_get
	xorl	%r12d, %r12d
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_5
LBB0_3:
	movq	%r14, %rdi
	callq	_mutex_unlock
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	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_OPENED,4,2                     ## @OPENED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocxl_context_alloc             ; -- Begin function ocxl_context_alloc
	.p2align	2
_ocxl_context_alloc:                    ; @ocxl_context_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	x21, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #64
	bl	_kzalloc
	str	x0, [x22]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	str	x19, [x0, #56]
	mov	x0, x19
	bl	_mutex_lock
	add	x0, x19, #24
	ldp	x8, x2, [x19, #8]
	add	x3, x8, x2
	ldr	w4, [x23]
	mov	x1, x20
	bl	_idr_alloc
	mov	x22, x0
	tbnz	w0, #31, LBB0_4
; %bb.2:
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_mutex_unlock
	str	w22, [x20]
Lloh2:
	adrp	x8, _OPENED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OPENED@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x20, #52]
	add	x0, x20, #48
	bl	_mutex_init
	str	x21, [x20, #40]
	add	x0, x20, #32
	bl	_mutex_init
	add	x0, x20, #28
	bl	_init_waitqueue_head
	add	x0, x20, #24
	bl	_mutex_init
	add	x0, x20, #20
	bl	_mutex_init
	add	x0, x20, #16
	bl	_idr_init
	str	xzr, [x20, #8]
	mov	x0, x19
	bl	_ocxl_afu_get
	mov	w22, #0
	b	LBB0_5
LBB0_3:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_5:
	mov	x0, x22
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_OPENED,4,2                     ; @OPENED
.subsections_via_symbols
