	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxl_pci_error_detected
_cxl_pci_error_detected:                ## @cxl_pci_error_detected
	.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
	movl	%esi, %r13d
	movq	%rdi, %r14
	callq	_pci_get_drvdata
	movq	%rax, %r15
	movq	%rax, %r12
	movq	_PCI_ERS_RESULT_NEED_RESET@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	xorl	%eax, %eax
	callq	_schedule
	movq	_pci_channel_io_perm_failure@GOTPCREL(%rip), %rax
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	cmpl	%r13d, (%rax)
	jne	LBB0_5
## %bb.1:
	addq	$12, %r15
	movq	%r15, %rdi
	callq	_spin_lock
	cmpl	$0, (%r12)
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jle	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	movl	%r14d, %esi
	callq	_cxl_vphb_error_detected
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_4:
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	_PCI_ERS_RESULT_DISCONNECT@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_5:
	cmpq	$0, 32(%r12)
	je	LBB0_7
## %bb.6:
	cmpl	$0, 24(%r12)
	je	LBB0_18
LBB0_7:
	leaq	12(%r15), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	cmpl	$0, (%r12)
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_14
## %bb.8:
	xorl	%r15d, %r15d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_11 Depth=1
	movq	%rbx, %r14
LBB0_10:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r15
	movslq	(%r12), %rax
	movq	%r14, %rbx
	cmpq	%rax, %r15
	jge	LBB0_15
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movq	(%rax,%r15,8), %r13
	testq	%r13, %r13
	je	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_cxl_vphb_error_detected
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_cxl_context_detach_all
	movq	_cxl_ops@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r13), %esi
	movq	%r13, %rdi
	callq	*(%rax)
	movq	%r13, %rdi
	callq	_pci_deconfigure_afu
	movq	_PCI_ERS_RESULT_DISCONNECT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	je	LBB0_10
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_PCI_ERS_RESULT_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorq	%rax, %r14
	movq	_PCI_ERS_RESULT_NEED_RESET@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorq	%rbx, %rcx
	orq	%r14, %rcx
	cmoveq	%rax, %rbx
	jmp	LBB0_9
LBB0_14:
	movq	%rbx, %r14
LBB0_15:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	%r12, %rdi
	callq	_cxl_adapter_context_lock
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	8(%rdi), %r15
	addq	$4, %rdi
	callq	_atomic_read
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_dev_warn
LBB0_17:
	movq	%r12, %rdi
	callq	_cxl_deconfigure_adapter
	jmp	LBB0_20
LBB0_18:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	movq	_PCI_ERS_RESULT_NONE@GOTPCREL(%rip), %rax
LBB0_19:
	movq	(%rax), %r14
LBB0_20:
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_ERS_RESULT_NEED_RESET,8,3  ## @PCI_ERS_RESULT_NEED_RESET
	.comm	_pci_channel_io_perm_failure,4,2 ## @pci_channel_io_perm_failure
	.comm	_PCI_ERS_RESULT_DISCONNECT,8,3  ## @PCI_ERS_RESULT_DISCONNECT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reflashing, so opting out of EEH!\n"

	.comm	_PCI_ERS_RESULT_NONE,8,3        ## @PCI_ERS_RESULT_NONE
	.comm	_cxl_ops,8,3                    ## @cxl_ops
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't take context lock with %d active-contexts\n"

	.no_dead_strip	_cxl_pci_error_detected
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cxl_pci_error_detected
_cxl_pci_error_detected:                ; @cxl_pci_error_detected
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x21, x0
	bl	_pci_get_drvdata
	mov	x19, x0
Lloh0:
	adrp	x24, _PCI_ERS_RESULT_NEED_RESET@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PCI_ERS_RESULT_NEED_RESET@GOTPAGEOFF]
	ldr	x25, [x24]
	bl	_schedule
Lloh2:
	adrp	x8, _pci_channel_io_perm_failure@GOTPAGE
Lloh3:
	ldr	x8, [x8, _pci_channel_io_perm_failure@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_5
; %bb.1:
	add	x21, x19, #12
	mov	x0, x21
	bl	_spin_lock
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x22, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x0, [x8, x22, lsl #3]
	mov	x1, x20
	bl	_cxl_vphb_error_detected
	add	x22, x22, #1
	ldrsw	x8, [x19]
	cmp	x22, x8
	b.lt	LBB0_3
LBB0_4:
	mov	x0, x21
	bl	_spin_unlock
Lloh5:
	adrp	x8, _PCI_ERS_RESULT_DISCONNECT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCI_ERS_RESULT_DISCONNECT@GOTPAGEOFF]
	b	LBB0_19
LBB0_5:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_18
LBB0_7:
	add	x21, x19, #12
	mov	x0, x21
	bl	_spin_lock
	ldr	w8, [x19]
	cmp	w8, #1
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
	b.lt	LBB0_14
; %bb.8:
	mov	x26, #0
Lloh7:
	adrp	x27, _cxl_ops@GOTPAGE
Lloh8:
	ldr	x27, [x27, _cxl_ops@GOTPAGEOFF]
Lloh9:
	adrp	x28, _PCI_ERS_RESULT_DISCONNECT@GOTPAGE
Lloh10:
	ldr	x28, [x28, _PCI_ERS_RESULT_DISCONNECT@GOTPAGEOFF]
Lloh11:
	adrp	x22, _PCI_ERS_RESULT_NONE@GOTPAGE
Lloh12:
	ldr	x22, [x22, _PCI_ERS_RESULT_NONE@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	x21, x25
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x19]
	mov	x25, x21
	cmp	x26, x8
	b.ge	LBB0_15
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x23, [x8, x26, lsl #3]
	cbz	x23, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x23
	mov	x1, x20
	bl	_cxl_vphb_error_detected
	mov	x21, x0
	mov	x0, x23
	bl	_cxl_context_detach_all
	ldr	x8, [x27]
	ldr	x8, [x8]
	ldr	w1, [x23]
	mov	x0, x23
	blr	x8
	mov	x0, x23
	bl	_pci_deconfigure_afu
	ldr	x8, [x28]
	cmp	x21, x8
	b.eq	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x22]
	ldr	x9, [x24]
	cmp	x25, x9
	ccmp	x21, x8, #0, eq
	csel	x21, x8, x25, eq
	b	LBB0_10
LBB0_14:
	mov	x21, x25
LBB0_15:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_spin_unlock
	mov	x0, x19
	bl	_cxl_adapter_context_lock
	cbz	x0, LBB0_17
; %bb.16:
	add	x20, x19, #8
	add	x0, x19, #4
	bl	_atomic_read
	mov	x2, x0
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
LBB0_17:
	mov	x0, x19
	bl	_cxl_deconfigure_adapter
	b	LBB0_20
LBB0_18:
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_info
Lloh17:
	adrp	x8, _PCI_ERS_RESULT_NONE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PCI_ERS_RESULT_NONE@GOTPAGEOFF]
LBB0_19:
	ldr	x21, [x8]
LBB0_20:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_ERS_RESULT_NEED_RESET,8,3  ; @PCI_ERS_RESULT_NEED_RESET
	.comm	_pci_channel_io_perm_failure,4,2 ; @pci_channel_io_perm_failure
	.comm	_PCI_ERS_RESULT_DISCONNECT,8,3  ; @PCI_ERS_RESULT_DISCONNECT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reflashing, so opting out of EEH!\n"

	.comm	_PCI_ERS_RESULT_NONE,8,3        ; @PCI_ERS_RESULT_NONE
	.comm	_cxl_ops,8,3                    ; @cxl_ops
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't take context lock with %d active-contexts\n"

	.no_dead_strip	_cxl_pci_error_detected
.subsections_via_symbols
