	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mode_store
_mode_store:                            ## @mode_store
	.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	%rcx, %rbx
	movq	%rdx, %r13
	callq	_to_cxl_afu
	movq	%rax, %r12
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	4(%r12), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	leaq	16(%r12), %rdi
	callq	_idr_is_empty
	testl	%eax, %eax
	je	LBB0_5
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	$17, %edx
	callq	_strncmp
	movq	_CXL_MODE_DEDICATED@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	negl	%eax
	sbbl	%ebx, %ebx
	orl	(%rcx), %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	$12, %edx
	callq	_strncmp
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	_CXL_MODE_DIRECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_3:
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	movl	$4, %edx
	callq	_strncmp
	testl	%eax, %eax
	cmovel	%eax, %ebx
	cmpl	$-1, %ebx
	je	LBB0_4
## %bb.6:
	movl	(%r12), %r14d
	movl	$0, (%r12)
	movq	$0, 8(%r12)
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_cxl_ops@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	*(%rax)
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	(%r15), %rax
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	*8(%rax)
	testl	%eax, %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmovnel	%eax, %ecx
	movl	%ecx, %r14d
	jmp	LBB0_8
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_5:
	negl	%r14d
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dedicated_process"

	.comm	_CXL_MODE_DEDICATED,4,2         ## @CXL_MODE_DEDICATED
L_.str.1:                               ## @.str.1
	.asciz	"afu_directed"

	.comm	_CXL_MODE_DIRECTED,4,2          ## @CXL_MODE_DIRECTED
L_.str.2:                               ## @.str.2
	.asciz	"none"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_cxl_ops,8,3                    ## @cxl_ops
	.no_dead_strip	_mode_store
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mode_store
_mode_store:                            ; @mode_store
	.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	x19, x3
	mov	x22, x2
	bl	_to_cxl_afu
	mov	x20, x0
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	add	x21, x0, #4
	mov	x0, x21
	bl	_mutex_lock
	add	x0, x20, #16
	bl	_idr_is_empty
	cbz	w0, LBB0_5
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	w2, #17
	bl	_strncmp
Lloh5:
	adrp	x8, _CXL_MODE_DEDICATED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CXL_MODE_DEDICATED@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w0, #0
	csinv	w23, w8, wzr, eq
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	w2, #12
	bl	_strncmp
Lloh10:
	adrp	x8, _CXL_MODE_DIRECTED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CXL_MODE_DIRECTED@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w23, w8, w23, eq
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	mov	w2, #4
	bl	_strncmp
	cmp	w0, #0
	csel	w22, wzr, w23, eq
	cmn	w22, #1
	b.eq	LBB0_4
; %bb.2:
	ldr	w23, [x20]
	str	wzr, [x20]
	str	xzr, [x20, #8]
	mov	x0, x21
	bl	_mutex_unlock
Lloh15:
	adrp	x21, _cxl_ops@GOTPAGE
Lloh16:
	ldr	x21, [x21, _cxl_ops@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x8, [x8]
	mov	x0, x20
	mov	x1, x23
	blr	x8
	mov	x23, x0
	cbnz	w0, LBB0_6
; %bb.3:
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	mov	x0, x20
	mov	x1, x22
	blr	x8
	cmp	w0, #0
	csel	w23, w19, w0, eq
	b	LBB0_6
LBB0_4:
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w23, [x8]
LBB0_5:
	neg	w23, w23
	mov	x0, x21
	bl	_mutex_unlock
LBB0_6:
	mov	x0, x23
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dedicated_process"

	.comm	_CXL_MODE_DEDICATED,4,2         ; @CXL_MODE_DEDICATED
l_.str.1:                               ; @.str.1
	.asciz	"afu_directed"

	.comm	_CXL_MODE_DIRECTED,4,2          ; @CXL_MODE_DIRECTED
l_.str.2:                               ; @.str.2
	.asciz	"none"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_cxl_ops,8,3                    ; @cxl_ops
	.no_dead_strip	_mode_store
.subsections_via_symbols
