	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_vgpu_emulate_opregion_request ## -- Begin function intel_vgpu_emulate_opregion_request
	.p2align	4, 0x90
_intel_vgpu_emulate_opregion_request:   ## @intel_vgpu_emulate_opregion_request
	.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, %r15
	movq	_intel_gvt_host@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	cmpl	$129, %eax
	je	LBB0_3
## %bb.1:
	cmpl	$128, %eax
	jne	LBB0_21
## %bb.2:
	movq	%r15, %rdi
	callq	_vgpu_opregion
	movq	8(%rax), %rax
	movq	_INTEL_GVT_OPREGION_SCIC@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -44(%rbp)
	movq	%r15, %rdi
	callq	_vgpu_opregion
	movq	8(%rax), %rax
	movq	_INTEL_GVT_OPREGION_PARM@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -56(%rbp)
	xorl	%r14d, %r14d
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
LBB0_7:
	movq	_SWSCI_SCI_SELECT@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_8
## %bb.9:
	movq	%r15, %rdi
	callq	_vgpu_cfg_space
	movq	_INTEL_GVT_PCI_SWSCI@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_SWSCI_SCI_TRIGGER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%r12d, %r12d
	testl	%ecx, (%rax,%rdx,4)
	jne	LBB0_22
## %bb.10:
	andl	%r13d, %ecx
	je	LBB0_22
## %bb.11:
	movl	-44(%rbp), %edi
	callq	_GVT_OPREGION_FUNC
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	-44(%rbp), %edi
	callq	_GVT_OPREGION_SUBFUNC
	movl	%eax, %r13d
	movl	-44(%rbp), %edi
	callq	_querying_capabilities
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	$0, -44(%rbp)
	movl	$0, -56(%rbp)
	xorl	%r13d, %r13d
	jmp	LBB0_14
LBB0_3:
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movq	%r15, %rdi
	callq	_vgpu_opregion
	movq	(%rax), %rax
	movl	(%rax), %r14d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rbx
	movb	(%rbx), %cl
	shll	%cl, %r14d
	movq	_INTEL_GVT_OPREGION_SCIC@GOTPCREL(%rip), %rax
	addl	(%rax), %r14d
	movq	%r15, %rdi
	callq	_vgpu_opregion
	movq	(%rax), %rax
	movl	(%rax), %r13d
	movl	(%rbx), %ebx
	movq	_INTEL_GVT_OPREGION_PARM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$4, %ecx
	callq	_intel_gvt_hypervisor_read_gpa
	testl	%eax, %eax
	jne	LBB0_4
## %bb.5:
	movl	%ebx, %ecx
	shll	%cl, %r13d
	addl	-52(%rbp), %r13d                ## 4-byte Folded Reload
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	$4, %ecx
	callq	_intel_gvt_hypervisor_read_gpa
	testl	%eax, %eax
	je	LBB0_6
LBB0_4:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rdi
	movl	$4, %ecx
	movl	%eax, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	jmp	LBB0_22
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	jmp	LBB0_22
LBB0_6:
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movq	_intel_gvt_host@GOTPCREL(%rip), %rbx
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	jmp	LBB0_7
LBB0_12:
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_opregion_func_name
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%r13d, %edi
	callq	_opregion_subfunc_name
	leaq	L_.str.3(%rip), %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movq	_OPREGION_SCIC_EXIT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	notl	%r13d
	andl	-44(%rbp), %r13d
	movl	%r13d, -44(%rbp)
LBB0_14:
	movl	(%rbx), %eax
	cmpl	$129, %eax
	je	LBB0_17
## %bb.15:
	cmpl	$128, %eax
	jne	LBB0_21
## %bb.16:
	movq	%r15, %rdi
	callq	_vgpu_opregion
	movq	8(%rax), %rax
	movq	_INTEL_GVT_OPREGION_SCIC@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movl	%r13d, (%rax,%rcx,4)
	movl	-56(%rbp), %r14d
	movq	%r15, %rdi
	callq	_vgpu_opregion
	movq	8(%rax), %rax
	movq	_INTEL_GVT_OPREGION_PARM@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movl	%r14d, (%rax,%rcx,4)
	jmp	LBB0_22
LBB0_21:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_22:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$4, %ecx
	callq	_intel_gvt_hypervisor_write_gpa
	testl	%eax, %eax
	je	LBB0_19
## %bb.18:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rdi
	movl	$4, %ecx
	movl	%eax, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movl	%ebx, %r12d
	jmp	LBB0_22
LBB0_19:
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	$4, %ecx
	callq	_intel_gvt_hypervisor_write_gpa
	testl	%eax, %eax
	je	LBB0_22
## %bb.20:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rdi
	movl	$4, %ecx
	movl	%eax, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movl	%r15d, %r12d
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_intel_gvt_host,4,2             ## @intel_gvt_host
	.comm	_INTEL_GVT_OPREGION_SCIC,4,2    ## @INTEL_GVT_OPREGION_SCIC
	.comm	_INTEL_GVT_OPREGION_PARM,4,2    ## @INTEL_GVT_OPREGION_PARM
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"guest opregion read error %d, gpa 0x%llx, len %lu\n"

L_.str.1:                               ## @.str.1
	.asciz	"not supported hypervisor\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SWSCI_SCI_SELECT,4,2           ## @SWSCI_SCI_SELECT
L_.str.2:                               ## @.str.2
	.asciz	"requesting SMI service\n"

	.comm	_INTEL_GVT_PCI_SWSCI,8,3        ## @INTEL_GVT_PCI_SWSCI
	.comm	_SWSCI_SCI_TRIGGER,4,2          ## @SWSCI_SCI_TRIGGER
L_.str.3:                               ## @.str.3
	.asciz	"requesting runtime service: func \"%s\", subfunc \"%s\"\n"

	.comm	_OPREGION_SCIC_EXIT_MASK,4,2    ## @OPREGION_SCIC_EXIT_MASK
L_.str.4:                               ## @.str.4
	.asciz	"guest opregion write error %d, gpa 0x%llx, len %lu\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_vgpu_emulate_opregion_request ; -- Begin function intel_vgpu_emulate_opregion_request
	.p2align	2
_intel_vgpu_emulate_opregion_request:   ; @intel_vgpu_emulate_opregion_request
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x24, _intel_gvt_host@GOTPAGE
Lloh1:
	ldr	x24, [x24, _intel_gvt_host@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #129
	b.eq	LBB0_6
; %bb.1:
	cmp	w8, #128
	b.ne	LBB0_17
; %bb.2:
	mov	x0, x19
	bl	_vgpu_opregion
	ldr	x8, [x0, #8]
Lloh2:
	adrp	x9, _INTEL_GVT_OPREGION_SCIC@GOTPAGE
Lloh3:
	ldr	x9, [x9, _INTEL_GVT_OPREGION_SCIC@GOTPAGEOFF]
Lloh4:
	ldrsw	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
	str	w8, [sp, #28]
	mov	x0, x19
	bl	_vgpu_opregion
	mov	w20, #0
	mov	w21, #0
	ldr	x8, [x0, #8]
Lloh5:
	adrp	x9, _INTEL_GVT_OPREGION_PARM@GOTPAGE
Lloh6:
	ldr	x9, [x9, _INTEL_GVT_OPREGION_PARM@GOTPAGEOFF]
Lloh7:
	ldrsw	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
	str	w8, [sp, #24]
LBB0_3:
Lloh8:
	adrp	x8, _SWSCI_SCI_SELECT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SWSCI_SCI_SELECT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_8
; %bb.4:
	mov	x0, x19
	bl	_vgpu_cfg_space
Lloh11:
	adrp	x8, _INTEL_GVT_PCI_SWSCI@GOTPAGE
Lloh12:
	ldr	x8, [x8, _INTEL_GVT_PCI_SWSCI@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldr	w8, [x0, x8, lsl #2]
Lloh14:
	adrp	x9, _SWSCI_SCI_TRIGGER@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SWSCI_SCI_TRIGGER@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	and	w8, w9, w8
	and	w9, w9, w22
	cmp	w8, #0
	ccmp	w9, #0, #4, eq
	b.ne	LBB0_11
; %bb.5:
	mov	w21, #0
	b	LBB0_18
LBB0_6:
	mov	x0, x19
	bl	_vgpu_opregion
	ldr	x8, [x0]
	ldr	w8, [x8]
Lloh17:
	adrp	x21, _PAGE_SHIFT@GOTPAGE
Lloh18:
	ldr	x21, [x21, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w9, [x21]
	lsl	w8, w8, w9
Lloh19:
	adrp	x9, _INTEL_GVT_OPREGION_SCIC@GOTPAGE
Lloh20:
	ldr	x9, [x9, _INTEL_GVT_OPREGION_SCIC@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	add	w20, w8, w9
	mov	x0, x19
	bl	_vgpu_opregion
	ldr	x8, [x0]
	ldr	w23, [x8]
	ldr	w25, [x21]
Lloh22:
	adrp	x8, _INTEL_GVT_OPREGION_PARM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _INTEL_GVT_OPREGION_PARM@GOTPAGEOFF]
Lloh24:
	ldr	w26, [x8]
	add	x2, sp, #28
	mov	x0, x19
	mov	x1, x20
	mov	w3, #4
	bl	_intel_gvt_hypervisor_read_gpa
	cbz	w0, LBB0_9
; %bb.7:
	mov	x21, x0
	mov	w8, #4
	stp	x20, x8, [sp, #8]
	str	x21, [sp]
Lloh25:
	adrp	x0, l_.str@PAGE
Lloh26:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_vgpu_err
	b	LBB0_18
LBB0_8:
Lloh27:
	adrp	x0, l_.str.2@PAGE
Lloh28:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_gvt_vgpu_err
	mov	w21, #0
	b	LBB0_18
LBB0_9:
	lsl	w8, w23, w25
	add	w21, w8, w26
	add	x2, sp, #24
	mov	x0, x19
	mov	x1, x21
	mov	w3, #4
	bl	_intel_gvt_hypervisor_read_gpa
	cbz	w0, LBB0_3
; %bb.10:
	mov	x23, x0
	mov	w8, #4
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	stp	x20, x8, [sp, #8]
	str	x23, [sp]
Lloh29:
	adrp	x0, l_.str@PAGE
Lloh30:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_vgpu_err
	mov	x21, x23
	b	LBB0_18
LBB0_11:
	ldr	w0, [sp, #28]
	bl	_GVT_OPREGION_FUNC
	mov	x22, x0
	ldr	w0, [sp, #28]
	bl	_GVT_OPREGION_SUBFUNC
	mov	x23, x0
	ldr	w0, [sp, #28]
	bl	_querying_capabilities
	cbz	w0, LBB0_13
; %bb.12:
	mov	w22, #0
	str	xzr, [sp, #24]
	b	LBB0_14
LBB0_13:
	mov	x0, x22
	bl	_opregion_func_name
	mov	x22, x0
	mov	x0, x23
	bl	_opregion_subfunc_name
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x22, x0, [sp]
Lloh31:
	adrp	x0, l_.str.3@PAGE
Lloh32:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_gvt_vgpu_err
Lloh33:
	adrp	x8, _OPREGION_SCIC_EXIT_MASK@GOTPAGE
Lloh34:
	ldr	x8, [x8, _OPREGION_SCIC_EXIT_MASK@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	ldr	w9, [sp, #28]
	bic	w22, w9, w8
	str	w22, [sp, #28]
LBB0_14:
	ldr	w8, [x24]
	cmp	w8, #129
	b.eq	LBB0_19
; %bb.15:
	cmp	w8, #128
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_vgpu_opregion
	ldr	x8, [x0, #8]
Lloh36:
	adrp	x9, _INTEL_GVT_OPREGION_SCIC@GOTPAGE
Lloh37:
	ldr	x9, [x9, _INTEL_GVT_OPREGION_SCIC@GOTPAGEOFF]
Lloh38:
	ldrsw	x9, [x9]
	str	w22, [x8, x9, lsl #2]
	ldr	w20, [sp, #24]
	mov	x0, x19
	bl	_vgpu_opregion
	mov	w21, #0
	ldr	x8, [x0, #8]
Lloh39:
	adrp	x9, _INTEL_GVT_OPREGION_PARM@GOTPAGE
Lloh40:
	ldr	x9, [x9, _INTEL_GVT_OPREGION_PARM@GOTPAGEOFF]
Lloh41:
	ldrsw	x9, [x9]
	str	w20, [x8, x9, lsl #2]
	b	LBB0_18
LBB0_17:
Lloh42:
	adrp	x0, l_.str.1@PAGE
Lloh43:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_gvt_vgpu_err
Lloh44:
	adrp	x8, _EINVAL@GOTPAGE
Lloh45:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_18:
	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
	add	sp, sp, #112
	ret
LBB0_19:
	add	x2, sp, #28
	mov	x0, x19
	mov	x1, x20
	mov	w3, #4
	bl	_intel_gvt_hypervisor_write_gpa
	cbz	w0, LBB0_21
; %bb.20:
	mov	x22, x0
	mov	w8, #4
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	stp	x20, x8, [sp, #8]
	str	x22, [sp]
Lloh47:
	adrp	x0, l_.str.4@PAGE
Lloh48:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_gvt_vgpu_err
	mov	x21, x22
	b	LBB0_18
LBB0_21:
	add	x2, sp, #24
	mov	x0, x19
	mov	x1, x21
	mov	w3, #4
	bl	_intel_gvt_hypervisor_write_gpa
	mov	x21, x0
	cbz	w0, LBB0_18
; %bb.22:
	mov	w8, #4
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	stp	x20, x8, [sp, #8]
	str	x21, [sp]
Lloh49:
	adrp	x0, l_.str.4@PAGE
Lloh50:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_gvt_vgpu_err
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpAdd	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_intel_gvt_host,4,2             ; @intel_gvt_host
	.comm	_INTEL_GVT_OPREGION_SCIC,4,2    ; @INTEL_GVT_OPREGION_SCIC
	.comm	_INTEL_GVT_OPREGION_PARM,4,2    ; @INTEL_GVT_OPREGION_PARM
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"guest opregion read error %d, gpa 0x%llx, len %lu\n"

l_.str.1:                               ; @.str.1
	.asciz	"not supported hypervisor\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SWSCI_SCI_SELECT,4,2           ; @SWSCI_SCI_SELECT
l_.str.2:                               ; @.str.2
	.asciz	"requesting SMI service\n"

	.comm	_INTEL_GVT_PCI_SWSCI,8,3        ; @INTEL_GVT_PCI_SWSCI
	.comm	_SWSCI_SCI_TRIGGER,4,2          ; @SWSCI_SCI_TRIGGER
l_.str.3:                               ; @.str.3
	.asciz	"requesting runtime service: func \"%s\", subfunc \"%s\"\n"

	.comm	_OPREGION_SCIC_EXIT_MASK,4,2    ; @OPREGION_SCIC_EXIT_MASK
l_.str.4:                               ; @.str.4
	.asciz	"guest opregion write error %d, gpa 0x%llx, len %lu\n"

.subsections_via_symbols
