	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function map_vgpu_opregion
_map_vgpu_opregion:                     ## @map_vgpu_opregion
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_INTEL_GVT_OPREGION_PAGES@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_7
## %bb.1:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_vgpu_opregion
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movslq	%r13d, %rdi
	imulq	%rcx, %rdi
	addq	16(%rax), %rdi
	callq	_intel_gvt_hypervisor_virt_to_mfn
	movq	%rax, %rbx
	movq	_INTEL_GVT_INVALID_ADDR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rdi
	callq	_vgpu_opregion
	movq	8(%rax), %rax
	movl	(%rax,%r13,4), %esi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	movl	$1, %ecx
	movl	%r14d, %r8d
	callq	_intel_gvt_hypervisor_map_gfn_to_mfn
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%r13
	movslq	(%r12), %rax
	cmpq	%rax, %r13
	jl	LBB0_3
LBB0_7:
	movq	%r15, %rdi
	callq	_vgpu_opregion
	movl	%r14d, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_6:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INTEL_GVT_OPREGION_PAGES,4,2   ## @INTEL_GVT_OPREGION_PAGES
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_INTEL_GVT_INVALID_ADDR,8,3     ## @INTEL_GVT_INVALID_ADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fail to get MFN from VA\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"fail to map GFN to MFN, errno: %d\n"

	.no_dead_strip	_map_vgpu_opregion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function map_vgpu_opregion
_map_vgpu_opregion:                     ; @map_vgpu_opregion
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _INTEL_GVT_OPREGION_PAGES@GOTPAGE
Lloh1:
	ldr	x22, [x22, _INTEL_GVT_OPREGION_PAGES@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x23, #0
Lloh2:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	adrp	x25, _INTEL_GVT_INVALID_ADDR@GOTPAGE
Lloh5:
	ldr	x25, [x25, _INTEL_GVT_INVALID_ADDR@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_vgpu_opregion
	ldr	x8, [x0, #16]
	ldrsw	x9, [x24]
	sxtw	x10, w23
	madd	x0, x9, x10, x8
	bl	_intel_gvt_hypervisor_virt_to_mfn
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x21, x0
	mov	x0, x20
	bl	_vgpu_opregion
	ldr	x8, [x0, #8]
	ldr	w1, [x8, x23, lsl #2]
	mov	x0, x20
	mov	x2, x21
	mov	w3, #1
	mov	x4, x19
	bl	_intel_gvt_hypervisor_map_gfn_to_mfn
	cbnz	w0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x22]
	cmp	x23, x8
	b.lt	LBB0_2
LBB0_5:
	mov	x0, x20
	bl	_vgpu_opregion
	mov	w21, #0
	str	w19, [x0]
	b	LBB0_8
LBB0_6:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_vgpu_err
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_7:
	mov	x21, x0
	str	x21, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_gvt_vgpu_err
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_INTEL_GVT_OPREGION_PAGES,4,2   ; @INTEL_GVT_OPREGION_PAGES
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_INTEL_GVT_INVALID_ADDR,8,3     ; @INTEL_GVT_INVALID_ADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fail to get MFN from VA\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"fail to map GFN to MFN, errno: %d\n"

	.no_dead_strip	_map_vgpu_opregion
.subsections_via_symbols
