	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_guest_remove_afu           ## -- Begin function cxl_guest_remove_afu
	.p2align	4, 0x90
_cxl_guest_remove_afu:                  ## @cxl_guest_remove_afu
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %rdi
	movl	$0, (%rdi)
	addq	$4, %rdi
	callq	_flush_delayed_work
	movq	%rbx, %rdi
	callq	_cxl_pci_vphb_remove
	movq	%rbx, %rdi
	callq	_cxl_sysfs_afu_remove
	movq	16(%rbx), %rdi
	callq	_spin_lock
	movq	(%rbx), %rax
	movq	16(%rbx), %rcx
	movq	8(%rcx), %rcx
	movq	$0, (%rcx,%rax,8)
	movq	16(%rbx), %rdi
	callq	_spin_unlock
	movq	%rbx, %rdi
	callq	_cxl_context_detach_all
	movq	_cxl_ops@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	12(%rbx), %esi
	movq	%rbx, %rdi
	callq	*(%rax)
	movq	%rbx, %rdi
	callq	_guest_release_serr_irq
	movq	%rbx, %rdi
	callq	_guest_unmap_slice_regs
	addq	$8, %rbx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_device_unregister              ## TAILCALL
LBB0_1:
	retq
	.cfi_endproc
                                        ## -- End function
	.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	_cxl_guest_remove_afu           ; -- Begin function cxl_guest_remove_afu
	.p2align	2
_cxl_guest_remove_afu:                  ; @cxl_guest_remove_afu
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_2
; %bb.1:
	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	x0, [x0, #24]
	str	wzr, [x0], #4
	bl	_flush_delayed_work
	mov	x0, x19
	bl	_cxl_pci_vphb_remove
	mov	x0, x19
	bl	_cxl_sysfs_afu_remove
	ldr	x0, [x19, #16]
	bl	_spin_lock
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #8]
	ldr	x9, [x19]
	str	xzr, [x8, x9, lsl #3]
	ldr	x0, [x19, #16]
	bl	_spin_unlock
	mov	x0, x19
	bl	_cxl_context_detach_all
Lloh0:
	adrp	x8, _cxl_ops@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cxl_ops@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	w1, [x19, #12]
	mov	x0, x19
	blr	x8
	mov	x0, x19
	bl	_guest_release_serr_irq
	mov	x0, x19
	bl	_guest_unmap_slice_regs
	add	x0, x19, #8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_device_unregister
LBB0_2:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_cxl_ops,8,3                    ; @cxl_ops
.subsections_via_symbols
