	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocxl_context_attach            ## -- Begin function ocxl_context_attach
	.p2align	4, 0x90
_ocxl_context_attach:                   ## @ocxl_context_attach
	.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
	movl	%esi, %r12d
	movq	%rdi, %r13
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%r13), %rax
	movq	_OPENED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	testq	%r15, %r15
	je	LBB0_3
## %bb.4:
	movq	(%r15), %rdx
	jmp	LBB0_5
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_3:
	xorl	%edx, %edx
LBB0_5:
	movq	24(%r13), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movl	12(%r13), %ecx
	movl	16(%r13), %esi
	movq	_xsl_fault_error@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r12d, %r8d
	movq	%r15, %r9
	pushq	%r13
	pushq	%rax
	callq	_ocxl_link_add_pe
	addq	$16, %rsp
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	_ATTACHED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r13)
	xorl	%ebx, %ebx
LBB0_7:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPENED,8,3                     ## @OPENED
	.comm	_EIO,4,2                        ## @EIO
	.comm	_xsl_fault_error,4,2            ## @xsl_fault_error
	.comm	_ATTACHED,8,3                   ## @ATTACHED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocxl_context_attach            ; -- Begin function ocxl_context_attach
	.p2align	2
_ocxl_context_attach:                   ; @ocxl_context_attach
	.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	x21, x2
	mov	x22, x1
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _OPENED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _OPENED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	cbz	x21, LBB0_4
; %bb.2:
	ldr	x2, [x21]
	b	LBB0_5
LBB0_3:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_7
LBB0_4:
	mov	x2, #0
LBB0_5:
	ldr	x8, [x20, #24]
	ldr	x8, [x8]
	ldr	w0, [x8]
	ldp	w3, w1, [x20, #12]
Lloh6:
	adrp	x8, _xsl_fault_error@GOTPAGE
Lloh7:
	ldr	x8, [x8, _xsl_fault_error@GOTPAGEOFF]
Lloh8:
	ldr	w6, [x8]
	mov	x4, x22
	mov	x5, x21
	mov	x7, x20
	bl	_ocxl_link_add_pe
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.6:
Lloh9:
	adrp	x8, _ATTACHED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATTACHED@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	str	x8, [x20]
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_OPENED,8,3                     ; @OPENED
	.comm	_EIO,4,2                        ; @EIO
	.comm	_xsl_fault_error,4,2            ; @xsl_fault_error
	.comm	_ATTACHED,8,3                   ; @ATTACHED
.subsections_via_symbols
