	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function attach_spa
_attach_spa:                            ## @attach_spa
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	16(%rax), %rdi
	movl	(%rax), %ecx
	shll	$7, %ecx
	addl	$384, %ecx                      ## imm = 0x180
	movslq	%ecx, %rcx
	addq	%rdi, %rcx
	movq	%rcx, 8(%rax)
	callq	_virt_to_phys
	movq	_CXL_PSL_SPAP_Addr@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	(%r14), %rdi
	movq	_CXL_PSL_SPAP_Size_Shift@GOTPCREL(%rip), %rdx
	movb	$12, %cl
	subb	(%rdx), %cl
	movl	4(%rdi), %ebx
	sarl	%cl, %ebx
	decl	%ebx
	movq	_CXL_PSL_SPAP_Size@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	movq	_CXL_PSL_SPAP_V@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%rdi), %edx
	orl	%eax, %ebx
	movq	16(%rdi), %rsi
	movq	8(%rdi), %rcx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %r8d
	callq	_pr_devel
	movq	_CXL_PSL_SPAP_An@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_cxl_p1n_write                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CXL_PSL_SPAP_Addr,4,2          ## @CXL_PSL_SPAP_Addr
	.comm	_CXL_PSL_SPAP_Size_Shift,4,2    ## @CXL_PSL_SPAP_Size_Shift
	.comm	_CXL_PSL_SPAP_Size,4,2          ## @CXL_PSL_SPAP_Size
	.comm	_CXL_PSL_SPAP_V,4,2             ## @CXL_PSL_SPAP_V
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cxl: SPA allocated at 0x%p. Max processes: %i, sw_command_status: 0x%p CXL_PSL_SPAP_An=0x%016llx\n"

	.comm	_CXL_PSL_SPAP_An,4,2            ## @CXL_PSL_SPAP_An
	.no_dead_strip	_attach_spa
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function attach_spa
_attach_spa:                            ; @attach_spa
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x0, [x8, #16]
	ldr	w9, [x8]
	lsl	w9, w9, #7
	add	w9, w9, #384
	add	x9, x0, w9, sxtw
	str	x9, [x8, #8]
	bl	_virt_to_phys
Lloh0:
	adrp	x8, _CXL_PSL_SPAP_Addr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CXL_PSL_SPAP_Addr@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w0
	ldr	x9, [x19]
Lloh3:
	adrp	x10, _CXL_PSL_SPAP_Size_Shift@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CXL_PSL_SPAP_Size_Shift@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	mov	w11, #12
	sub	w10, w11, w10
	ldp	w2, w11, [x9]
	asr	w10, w11, w10
	sub	w10, w10, #1
Lloh6:
	adrp	x11, _CXL_PSL_SPAP_Size@GOTPAGE
Lloh7:
	ldr	x11, [x11, _CXL_PSL_SPAP_Size@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
Lloh9:
	adrp	x12, _CXL_PSL_SPAP_V@GOTPAGE
Lloh10:
	ldr	x12, [x12, _CXL_PSL_SPAP_V@GOTPAGEOFF]
	and	w10, w10, w11
Lloh11:
	ldr	w11, [x12]
	orr	w8, w11, w8
	orr	w20, w8, w10
	ldp	x3, x1, [x9, #8]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x4, x20
	bl	_pr_devel
Lloh14:
	adrp	x8, _CXL_PSL_SPAP_An@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CXL_PSL_SPAP_An@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_cxl_p1n_write
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CXL_PSL_SPAP_Addr,4,2          ; @CXL_PSL_SPAP_Addr
	.comm	_CXL_PSL_SPAP_Size_Shift,4,2    ; @CXL_PSL_SPAP_Size_Shift
	.comm	_CXL_PSL_SPAP_Size,4,2          ; @CXL_PSL_SPAP_Size
	.comm	_CXL_PSL_SPAP_V,4,2             ; @CXL_PSL_SPAP_V
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cxl: SPA allocated at 0x%p. Max processes: %i, sw_command_status: 0x%p CXL_PSL_SPAP_An=0x%016llx\n"

	.comm	_CXL_PSL_SPAP_An,4,2            ; @CXL_PSL_SPAP_An
	.no_dead_strip	_attach_spa
.subsections_via_symbols
