	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___detach_context               ## -- Begin function __detach_context
	.p2align	4, 0x90
___detach_context:                      ## @__detach_context
	.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	%rdi, %r15
	leaq	32(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movl	(%r15), %r14d
	movq	_CLOSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_STARTED@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_1
## %bb.2:
	movq	_cxl_ops@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	%r15, %rdi
	callq	*16(%rax)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	(%rbx), %rax
	movq	16(%r15), %rsi
	movl	(%rsi), %edi
	callq	*8(%rax)
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	jmp	LBB0_5
LBB0_1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_10
LBB0_3:
	xorl	%edi, %edi
LBB0_5:
	callq	_WARN_ON
	leaq	28(%r15), %rdi
	callq	_flush_work
	movq	(%rbx), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	*%rax
LBB0_7:
	movl	24(%r15), %edi
	callq	_put_pid
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cxl_ctx_put
	movq	16(%r15), %rax
	movl	(%rax), %edi
	callq	_cxl_adapter_context_put
	movq	%r15, %rdi
	callq	_cxl_context_mm_count_put
	movq	8(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	callq	_mm_context_remove_copro
LBB0_9:
	movq	$0, 8(%r15)
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CLOSED,4,2                     ## @CLOSED
	.comm	_STARTED,4,2                    ## @STARTED
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_cxl_ops,8,3                    ## @cxl_ops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___detach_context               ; -- Begin function __detach_context
	.p2align	2
___detach_context:                      ; @__detach_context
	.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	x19, x0
	add	x20, x0, #32
	mov	x0, x20
	bl	_mutex_lock
	ldr	w21, [x19]
Lloh0:
	adrp	x8, _CLOSED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CLOSED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x20
	bl	_mutex_unlock
Lloh3:
	adrp	x8, _STARTED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STARTED@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ne	LBB0_8
; %bb.1:
Lloh6:
	adrp	x20, _cxl_ops@GOTPAGE
Lloh7:
	ldr	x20, [x20, _cxl_ops@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x8, [x8, #16]
	mov	x0, x19
	blr	x8
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	ldr	x1, [x19, #16]
	ldr	w0, [x1]
	blr	x8
	cmp	x0, #0
	cset	w0, ne
LBB0_3:
	bl	_WARN_ON
	add	x0, x19, #28
	bl	_flush_work
	ldr	x8, [x20]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x19
	blr	x8
LBB0_5:
	ldr	w0, [x19, #24]
	bl	_put_pid
	bl	_cxl_ctx_put
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	bl	_cxl_adapter_context_put
	mov	x0, x19
	bl	_cxl_context_mm_count_put
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_mm_context_remove_copro
LBB0_7:
	mov	w0, #0
	str	xzr, [x19, #8]
	b	LBB0_9
LBB0_8:
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_CLOSED,4,2                     ; @CLOSED
	.comm	_STARTED,4,2                    ; @STARTED
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_cxl_ops,8,3                    ; @cxl_ops
.subsections_via_symbols
