	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocxl_config_check_afu_index    ## -- Begin function ocxl_config_check_afu_index
	.p2align	4, 0x90
_ocxl_config_check_afu_index:           ## @ocxl_config_check_afu_index
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_OCXL_DVSEC_AFU_INFO_AFU_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	callq	_pci_write_config_byte
	leaq	-32(%rbp), %r14
	leaq	-28(%rbp), %rcx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_read_template_version
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movl	-28(%rbp), %eax
	xorl	%ebx, %ebx
	movl	-32(%rbp), %ecx
	orl	%eax, %ecx
	je	LBB0_9
## %bb.2:
	movl	%eax, %edx
	sarl	$8, %edx
	movzbl	%al, %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	movq	_OCXL_TEMPL_LEN_1_0@GOTPCREL(%rip), %rax
	movl	-28(%rbp), %edx
	cmpl	$5, %edx
	je	LBB0_7
## %bb.3:
	cmpl	$256, %edx                      ## imm = 0x100
	je	LBB0_7
## %bb.4:
	cmpl	$257, %edx                      ## imm = 0x101
	jne	LBB0_6
## %bb.5:
	movq	_OCXL_TEMPL_LEN_1_1@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	%r14, %rax
LBB0_7:
	movl	(%rax), %ecx
	movl	-32(%rbp), %edx
	movl	$1, %ebx
	cmpl	%ecx, %edx
	je	LBB0_9
## %bb.8:
	movl	-28(%rbp), %r8d
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OCXL_DVSEC_AFU_INFO_AFU_IDX,8,3 ## @OCXL_DVSEC_AFU_INFO_AFU_IDX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AFU descriptor template version %d.%d\n"

	.comm	_OCXL_TEMPL_LEN_1_0,4,2         ## @OCXL_TEMPL_LEN_1_0
	.comm	_OCXL_TEMPL_LEN_1_1,4,2         ## @OCXL_TEMPL_LEN_1_1
L_.str.1:                               ## @.str.1
	.asciz	"Unknown AFU template version %#x\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unexpected template length %#x in AFU information, expected %#x for version %#x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocxl_config_check_afu_index    ; -- Begin function ocxl_config_check_afu_index
	.p2align	2
_ocxl_config_check_afu_index:           ; @ocxl_config_check_afu_index
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _OCXL_DVSEC_AFU_INFO_AFU_IDX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _OCXL_DVSEC_AFU_INFO_AFU_IDX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_pci_write_config_byte
	add	x2, sp, #24
	sub	x3, x29, #20
	mov	x0, x19
	mov	x1, x20
	bl	_read_template_version
	cbnz	w0, LBB0_11
; %bb.1:
	ldur	w8, [x29, #-20]
	ldr	w9, [sp, #24]
	orr	w9, w8, w9
	cbz	w9, LBB0_6
; %bb.2:
	asr	w2, w8, #8
	and	w3, w8, #0xff
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh5:
	adrp	x8, _OCXL_TEMPL_LEN_1_0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _OCXL_TEMPL_LEN_1_0@GOTPAGEOFF]
	ldur	w2, [x29, #-20]
	cmp	w2, #5
	b.eq	LBB0_8
; %bb.3:
	cmp	w2, #256
	b.eq	LBB0_8
; %bb.4:
	cmp	w2, #257
	b.ne	LBB0_7
; %bb.5:
Lloh7:
	adrp	x8, _OCXL_TEMPL_LEN_1_1@GOTPAGE
Lloh8:
	ldr	x8, [x8, _OCXL_TEMPL_LEN_1_1@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	mov	w0, #0
	b	LBB0_11
LBB0_7:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
	add	x8, sp, #24
LBB0_8:
	ldr	w8, [x8]
	ldr	w2, [sp, #24]
	cmp	w2, w8
	b.eq	LBB0_10
; %bb.9:
	ldur	w9, [x29, #-20]
	stp	x8, x9, [sp]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
LBB0_10:
	mov	w0, #1
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_OCXL_DVSEC_AFU_INFO_AFU_IDX,8,3 ; @OCXL_DVSEC_AFU_INFO_AFU_IDX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AFU descriptor template version %d.%d\n"

	.comm	_OCXL_TEMPL_LEN_1_0,4,2         ; @OCXL_TEMPL_LEN_1_0
	.comm	_OCXL_TEMPL_LEN_1_1,4,2         ; @OCXL_TEMPL_LEN_1_1
l_.str.1:                               ; @.str.1
	.asciz	"Unknown AFU template version %#x\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unexpected template length %#x in AFU information, expected %#x for version %#x\n"

.subsections_via_symbols
