	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_h_attach_process           ## -- Begin function cxl_h_attach_process
	.p2align	4, 0x90
_cxl_h_attach_process:                  ## @cxl_h_attach_process
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PLPAR_HCALL_BUFSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	_H_ATTACH_CA_PROCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r13, %rdi
	callq	_virt_to_phys
	movq	%rbx, %rsi
	movl	%r14d, %edx
	movq	%r15, %rcx
	movl	%eax, %r8d
	callq	_CXL_H_WAIT_UNTIL_DONE
	movq	%r13, %rdi
	callq	_virt_to_phys
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	movl	%eax, %ecx
	callq	__PRINT_MSG
	movq	%r13, %rdi
	callq	_virt_to_phys
	movq	(%rbx), %rdx
	movq	8(%rbx), %rcx
	movq	16(%rbx), %r8
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_trace_cxl_hcall_attach
	movq	(%rbx), %rsi
	movq	8(%rbx), %rdx
	movq	16(%rbx), %rcx
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_devel
	movq	%r13, %rdi
	movl	$4, %esi
	callq	_cxl_dump_debug_buffer
	movq	(%rbx), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	testq	%r12, %r12
	je	LBB0_2
## %bb.1:
	movq	8(%rbx), %rax
	movq	%rax, (%r12)
LBB0_2:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.3:
	movq	16(%rbx), %rax
	movq	%rax, (%rcx)
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PLPAR_HCALL_BUFSIZE,4,2        ## @PLPAR_HCALL_BUFSIZE
	.comm	_H_ATTACH_CA_PROCESS,4,2        ## @H_ATTACH_CA_PROCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cxl_h_attach_process(%#.16llx, %#.16lx): %li\n"

L_.str.1:                               ## @.str.1
	.asciz	"token: 0x%.8lx mmio_addr: 0x%lx mmio_size: 0x%lx\nProcess Element Structure:\n"

	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_EBUSY,8,3                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_h_attach_process           ; -- Begin function cxl_h_attach_process
	.p2align	2
_cxl_h_attach_process:                  ; @cxl_h_attach_process
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x23, x1
	mov	x24, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _PLPAR_HCALL_BUFSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PLPAR_HCALL_BUFSIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #3
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x22, x9, x8
	mov	sp, x22
Lloh8:
	adrp	x8, _H_ATTACH_CA_PROCESS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _H_ATTACH_CA_PROCESS@GOTPAGEOFF]
Lloh10:
	ldr	w25, [x8]
	mov	x0, x1
	bl	_virt_to_phys
	mov	x1, x22
	mov	x2, x25
	mov	x3, x24
	mov	x4, x0
	bl	_CXL_H_WAIT_UNTIL_DONE
	mov	x0, x23
	bl	_virt_to_phys
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x24
	mov	x3, x0
	bl	__PRINT_MSG
	mov	x0, x23
	bl	_virt_to_phys
	mov	x1, x0
	ldp	x2, x3, [x22]
	ldr	x4, [x22, #16]
	mov	x0, x24
	bl	_trace_cxl_hcall_attach
	ldp	x1, x2, [x22]
	ldr	x3, [x22, #16]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_devel
	mov	x0, x23
	mov	w1, #4
	bl	_cxl_dump_debug_buffer
	ldr	x8, [x22]
	str	x8, [x21]
	cbz	x20, LBB0_2
; %bb.1:
	ldr	x8, [x22, #8]
	str	x8, [x20]
LBB0_2:
	cbz	x19, LBB0_4
; %bb.3:
	ldr	x8, [x22, #16]
	str	x8, [x19]
LBB0_4:
	ldur	x8, [x29, #-72]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	mov	x0, #0
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PLPAR_HCALL_BUFSIZE,4,2        ; @PLPAR_HCALL_BUFSIZE
	.comm	_H_ATTACH_CA_PROCESS,4,2        ; @H_ATTACH_CA_PROCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cxl_h_attach_process(%#.16llx, %#.16lx): %li\n"

l_.str.1:                               ; @.str.1
	.asciz	"token: 0x%.8lx mmio_addr: 0x%lx mmio_size: 0x%lx\nProcess Element Structure:\n"

	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_EBUSY,8,3                      ; @EBUSY
.subsections_via_symbols
