	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_afu_control
_read_afu_control:                      ## @read_afu_control
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movl	24(%rsi), %esi
	callq	_find_dvsec_afu_ctrl
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, (%r12)
	movslq	%eax, %rbx
	movq	_OCXL_DVSEC_AFU_CTRL_PASID_SUP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rbx, %rsi
	leaq	-40(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_byte
	movl	-40(%rbp), %edi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_EXTRACT_BITS
	movq	%rax, 16(%r12)
	movq	_OCXL_DVSEC_AFU_CTRL_ACTAG_SUP@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_pci_read_config_word
	movl	-36(%rbp), %edi
	xorl	%esi, %esi
	movl	$11, %edx
	callq	_EXTRACT_BITS
	movq	%rax, 8(%r12)
	jmp	LBB0_3
LBB0_1:
	movl	24(%r12), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_3:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't find AFU control DVSEC for AFU %d\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_OCXL_DVSEC_AFU_CTRL_PASID_SUP,8,3 ## @OCXL_DVSEC_AFU_CTRL_PASID_SUP
	.comm	_OCXL_DVSEC_AFU_CTRL_ACTAG_SUP,8,3 ## @OCXL_DVSEC_AFU_CTRL_ACTAG_SUP
	.no_dead_strip	_read_afu_control
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_afu_control
_read_afu_control:                      ; @read_afu_control
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
	ldr	w1, [x1, #24]
	bl	_find_dvsec_afu_ctrl
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_2
; %bb.1:
	str	w0, [x19]
	sxtw	x21, w0
Lloh0:
	adrp	x8, _OCXL_DVSEC_AFU_CTRL_PASID_SUP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OCXL_DVSEC_AFU_CTRL_PASID_SUP@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x1, x8, x21
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_read_config_byte
	ldr	w0, [sp, #12]
	mov	w1, #0
	mov	w2, #4
	bl	_EXTRACT_BITS
	str	x0, [x19, #16]
Lloh3:
	adrp	x8, _OCXL_DVSEC_AFU_CTRL_ACTAG_SUP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OCXL_DVSEC_AFU_CTRL_ACTAG_SUP@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x1, x8, x21
	add	x2, sp, #8
	mov	x0, x20
	bl	_pci_read_config_word
	ldr	w0, [sp, #8]
	mov	w1, #0
	mov	w2, #11
	bl	_EXTRACT_BITS
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19, #8]
	b	LBB0_3
LBB0_2:
	ldr	w2, [x19, #24]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't find AFU control DVSEC for AFU %d\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_OCXL_DVSEC_AFU_CTRL_PASID_SUP,8,3 ; @OCXL_DVSEC_AFU_CTRL_PASID_SUP
	.comm	_OCXL_DVSEC_AFU_CTRL_ACTAG_SUP,8,3 ; @OCXL_DVSEC_AFU_CTRL_ACTAG_SUP
	.no_dead_strip	_read_afu_control
.subsections_via_symbols
