	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxl_read_afu_descriptor
_cxl_read_afu_descriptor:               ## @cxl_read_afu_descriptor
	.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, %rbx
	callq	_AFUD_READ_INFO
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_AFUD_NUM_INTS_PER_PROC
	movl	%eax, 52(%rbx)
	movl	%r14d, %edi
	callq	_AFUD_NUM_PROCS
	movl	%eax, 48(%rbx)
	movl	%r14d, %edi
	callq	_AFUD_NUM_CRS
	movl	%eax, 44(%rbx)
	movl	%r14d, %edi
	callq	_AFUD_AFU_DIRECTED
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_CXL_MODE_DIRECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 40(%rbx)
LBB0_2:
	movl	%r14d, %edi
	callq	_AFUD_DEDICATED_PROCESS
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_CXL_MODE_DEDICATED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 40(%rbx)
LBB0_4:
	movl	%r14d, %edi
	callq	_AFUD_TIME_SLICED
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_CXL_MODE_TIME_SLICED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 40(%rbx)
LBB0_6:
	movq	%rbx, %rdi
	callq	_AFUD_READ_PPPSA
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_AFUD_PPPSA_LEN
	shll	$12, %eax
	movl	%eax, (%rbx)
	movl	%r14d, %edi
	callq	_AFUD_PPPSA_PSA
	movl	%eax, 36(%rbx)
	movl	%r14d, %edi
	callq	_AFUD_PPPSA_PP
	movl	%eax, 32(%rbx)
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_AFUD_READ_PPPSA_OFF
	movq	24(%rbx), %rcx
	movl	%eax, (%rcx)
LBB0_8:
	movq	%rbx, %rdi
	callq	_AFUD_READ_CR
	movl	%eax, %edi
	callq	_AFUD_CR_LEN
	shll	$8, %eax
	movl	%eax, 4(%rbx)
	movq	%rbx, %rdi
	callq	_AFUD_READ_CR_OFF
	movl	%eax, 20(%rbx)
	movq	%rbx, %rdi
	callq	_AFUD_READ_EB
	movl	%eax, %edi
	callq	_AFUD_EB_LEN
	shll	$12, %eax
	movl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	callq	_AFUD_READ_EB_OFF
	movl	%eax, 16(%rbx)
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	$11, %edx
	callq	_EXTRACT_PPC_BITS
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	12(%rbx), %r14
	movl	16(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_warn
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	movl	$0, 8(%rbx)
LBB0_10:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CXL_MODE_DIRECTED,4,2          ## @CXL_MODE_DIRECTED
	.comm	_CXL_MODE_DEDICATED,4,2         ## @CXL_MODE_DEDICATED
	.comm	_CXL_MODE_TIME_SLICED,4,2       ## @CXL_MODE_TIME_SLICED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid AFU error buffer offset %Lx\n"

L_.str.1:                               ## @.str.1
	.asciz	"Ignoring AFU error buffer in the descriptor\n"

	.no_dead_strip	_cxl_read_afu_descriptor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cxl_read_afu_descriptor
_cxl_read_afu_descriptor:               ; @cxl_read_afu_descriptor
	.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
	bl	_AFUD_READ_INFO
	mov	x20, x0
	bl	_AFUD_NUM_INTS_PER_PROC
	str	w0, [x19, #52]
	mov	x0, x20
	bl	_AFUD_NUM_PROCS
	str	w0, [x19, #48]
	mov	x0, x20
	bl	_AFUD_NUM_CRS
	str	w0, [x19, #44]
	mov	x0, x20
	bl	_AFUD_AFU_DIRECTED
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _CXL_MODE_DIRECTED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CXL_MODE_DIRECTED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #40]
	orr	w8, w9, w8
	str	w8, [x19, #40]
LBB0_2:
	mov	x0, x20
	bl	_AFUD_DEDICATED_PROCESS
	cbz	x0, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _CXL_MODE_DEDICATED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CXL_MODE_DEDICATED@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19, #40]
	orr	w8, w9, w8
	str	w8, [x19, #40]
LBB0_4:
	mov	x0, x20
	bl	_AFUD_TIME_SLICED
	cbz	x0, LBB0_6
; %bb.5:
Lloh6:
	adrp	x8, _CXL_MODE_TIME_SLICED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CXL_MODE_TIME_SLICED@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x19, #40]
	orr	w8, w9, w8
	str	w8, [x19, #40]
LBB0_6:
	mov	x0, x19
	bl	_AFUD_READ_PPPSA
	mov	x20, x0
	bl	_AFUD_PPPSA_LEN
	lsl	w8, w0, #12
	str	w8, [x19]
	mov	x0, x20
	bl	_AFUD_PPPSA_PSA
	str	w0, [x19, #36]
	mov	x0, x20
	bl	_AFUD_PPPSA_PP
	str	w0, [x19, #32]
	cbz	w0, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_AFUD_READ_PPPSA_OFF
	ldr	x8, [x19, #24]
	str	w0, [x8]
LBB0_8:
	mov	x0, x19
	bl	_AFUD_READ_CR
	bl	_AFUD_CR_LEN
	lsl	w8, w0, #8
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_AFUD_READ_CR_OFF
	str	w0, [x19, #20]
	mov	x0, x19
	bl	_AFUD_READ_EB
	bl	_AFUD_EB_LEN
	lsl	w8, w0, #12
	str	w8, [x19, #8]
	mov	x0, x19
	bl	_AFUD_READ_EB_OFF
	str	w0, [x19, #16]
	mov	w1, #0
	mov	w2, #11
	bl	_EXTRACT_PPC_BITS
	cbz	x0, LBB0_10
; %bb.9:
	add	x20, x19, #12
	ldr	w2, [x19, #16]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_info
	str	wzr, [x19, #8]
LBB0_10:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_CXL_MODE_DIRECTED,4,2          ; @CXL_MODE_DIRECTED
	.comm	_CXL_MODE_DEDICATED,4,2         ; @CXL_MODE_DEDICATED
	.comm	_CXL_MODE_TIME_SLICED,4,2       ; @CXL_MODE_TIME_SLICED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid AFU error buffer offset %Lx\n"

l_.str.1:                               ; @.str.1
	.asciz	"Ignoring AFU error buffer in the descriptor\n"

	.no_dead_strip	_cxl_read_afu_descriptor
.subsections_via_symbols
