	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function afu_update_state
_afu_update_state:                      ## @afu_update_state
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	leaq	-20(%rbp), %rsi
	callq	_afu_read_error_state
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.1:
	movq	8(%r14), %rax
	movl	-20(%rbp), %edx
	xorl	%ebx, %ebx
	cmpl	%edx, (%rax)
	jne	LBB0_2
LBB0_14:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_devel
	movl	-20(%rbp), %edx
	leal	-128(%rdx), %eax
	cmpl	$3, %eax
	ja	LBB0_13
## %bb.3:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_11:
	movq	8(%r14), %rax
	movl	$128, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_12:
	leaq	16(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_CXL_ERROR_DETECTED_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_pci_channel_io_perm_failure@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_pci_error_handlers
	movl	-20(%rbp), %eax
	movq	8(%r14), %rcx
	movl	%eax, (%rcx)
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_4:
	movq	8(%r14), %rax
	movl	$130, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_5:
	movq	_CXL_ERROR_DETECTED_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_pci_channel_io_frozen@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_pci_error_handlers
	movq	%r14, %rdi
	callq	_cxl_context_detach_all
	movq	_cxl_ops@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r14, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_devel
LBB0_7:
	leaq	-20(%rbp), %rsi
	movq	%r14, %rdi
	callq	_afu_read_error_state
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:
	cmpl	$130, -20(%rbp)
	jne	LBB0_10
## %bb.9:
	movq	_CXL_SLOT_RESET_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_pci_channel_io_normal@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_pci_error_handlers
	movq	_CXL_RESUME_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_pci_error_handlers
LBB0_10:
	movq	8(%r14), %rax
	movl	$0, (%rax)
	jmp	LBB0_14
LBB0_13:
	movl	(%r14), %esi
	leaq	L_.str.3(%rip), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_14
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
LJTI0_0:
	.long	L0_0_set_11
	.long	L0_0_set_12
	.long	L0_0_set_4
	.long	L0_0_set_5
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AFU(%d) update state to %#x\n"

	.comm	_CXL_ERROR_DETECTED_EVENT,4,2   ## @CXL_ERROR_DETECTED_EVENT
	.comm	_pci_channel_io_frozen,4,2      ## @pci_channel_io_frozen
	.comm	_cxl_ops,8,3                    ## @cxl_ops
L_.str.1:                               ## @.str.1
	.asciz	"reset hcall failed %d\n"

	.comm	_CXL_SLOT_RESET_EVENT,4,2       ## @CXL_SLOT_RESET_EVENT
	.comm	_pci_channel_io_normal,4,2      ## @pci_channel_io_normal
	.comm	_CXL_RESUME_EVENT,4,2           ## @CXL_RESUME_EVENT
L_.str.2:                               ## @.str.2
	.asciz	"AFU is in permanent error state\n"

	.comm	_pci_channel_io_perm_failure,4,2 ## @pci_channel_io_perm_failure
L_.str.3:                               ## @.str.3
	.asciz	"Unexpected AFU(%d) error state: %#x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_afu_update_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function afu_update_state
_afu_update_state:                      ; @afu_update_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	add	x1, sp, #12
	bl	_afu_read_error_state
	mov	x20, x0
	cbnz	w0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	ldr	w8, [sp, #12]
	cmp	w9, w8
	b.ne	LBB0_4
; %bb.2:
	mov	w20, #0
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_4:
	ldr	w1, [x19]
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_devel
	ldr	w2, [sp, #12]
	sub	w8, w2, #128
	cmp	w8, #3
	b.hi	LBB0_15
; %bb.5:
Lloh2:
	adrp	x9, lJTI0_0@PAGE
Lloh3:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_6
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_6:
	mov	w20, #0
	ldr	x8, [x19, #8]
	mov	w9, #128
	str	w9, [x8]
	b	LBB0_3
LBB0_7:
	add	x0, x19, #16
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh6:
	adrp	x8, _CXL_ERROR_DETECTED_EVENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CXL_ERROR_DETECTED_EVENT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _pci_channel_io_perm_failure@GOTPAGE
Lloh10:
	ldr	x8, [x8, _pci_channel_io_perm_failure@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_pci_error_handlers
	mov	w20, #0
	ldr	w8, [sp, #12]
	ldr	x9, [x19, #8]
	str	w8, [x9]
	b	LBB0_3
LBB0_8:
	mov	w20, #0
	ldr	x8, [x19, #8]
	mov	w9, #130
	str	w9, [x8]
	b	LBB0_3
LBB0_9:
Lloh12:
	adrp	x8, _CXL_ERROR_DETECTED_EVENT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CXL_ERROR_DETECTED_EVENT@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _pci_channel_io_frozen@GOTPAGE
Lloh16:
	ldr	x8, [x8, _pci_channel_io_frozen@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_pci_error_handlers
	mov	x0, x19
	bl	_cxl_context_detach_all
Lloh18:
	adrp	x8, _cxl_ops@GOTPAGE
Lloh19:
	ldr	x8, [x8, _cxl_ops@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	cbz	w0, LBB0_11
; %bb.10:
	mov	x1, x0
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_devel
LBB0_11:
	add	x1, sp, #12
	mov	x0, x19
	bl	_afu_read_error_state
	mov	x20, x0
	cbnz	w0, LBB0_14
; %bb.12:
	ldr	w8, [sp, #12]
	cmp	w8, #130
	b.ne	LBB0_14
; %bb.13:
Lloh23:
	adrp	x8, _CXL_SLOT_RESET_EVENT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CXL_SLOT_RESET_EVENT@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _pci_channel_io_normal@GOTPAGE
Lloh27:
	ldr	x8, [x8, _pci_channel_io_normal@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_pci_error_handlers
Lloh29:
	adrp	x8, _CXL_RESUME_EVENT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CXL_RESUME_EVENT@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_pci_error_handlers
LBB0_14:
	ldr	x8, [x19, #8]
	str	wzr, [x8]
	b	LBB0_3
LBB0_15:
	ldr	w1, [x19]
Lloh32:
	adrp	x0, l_.str.3@PAGE
Lloh33:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
Lloh34:
	adrp	x8, _EINVAL@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_6-LBB0_6)>>2
	.byte	(LBB0_7-LBB0_6)>>2
	.byte	(LBB0_8-LBB0_6)>>2
	.byte	(LBB0_9-LBB0_6)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AFU(%d) update state to %#x\n"

	.comm	_CXL_ERROR_DETECTED_EVENT,4,2   ; @CXL_ERROR_DETECTED_EVENT
	.comm	_pci_channel_io_frozen,4,2      ; @pci_channel_io_frozen
	.comm	_cxl_ops,8,3                    ; @cxl_ops
l_.str.1:                               ; @.str.1
	.asciz	"reset hcall failed %d\n"

	.comm	_CXL_SLOT_RESET_EVENT,4,2       ; @CXL_SLOT_RESET_EVENT
	.comm	_pci_channel_io_normal,4,2      ; @pci_channel_io_normal
	.comm	_CXL_RESUME_EVENT,4,2           ; @CXL_RESUME_EVENT
l_.str.2:                               ; @.str.2
	.asciz	"AFU is in permanent error state\n"

	.comm	_pci_channel_io_perm_failure,4,2 ; @pci_channel_io_perm_failure
l_.str.3:                               ; @.str.3
	.asciz	"Unexpected AFU(%d) error state: %#x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_afu_update_state
.subsections_via_symbols
