	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function copy_gma_to_hva
_copy_gma_to_hva:                       ## @copy_gma_to_hva
	.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
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	cmpq	%rcx, %rdx
	je	LBB0_5
## %bb.1:
	movq	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rsi, %r13
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_intel_vgpu_gma_to_gpa
	movq	_INTEL_GVT_INVALID_ADDR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_I915_GTT_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %r15
	leaq	-1(%r15), %rcx
	andq	%rbx, %rcx
	movq	%r12, %rdx
	subq	%rbx, %rdx
	subq	%rcx, %r15
	cmpq	%r15, %rdx
	cmovbq	%rdx, %r15
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%r14), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	movq	%r15, %rcx
	callq	_intel_gvt_hypervisor_read_gpa
	addq	%r15, %r14
	addq	%r15, %rbx
	cmpq	%r12, %rbx
	jne	LBB0_2
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_gvt_vgpu_err
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_5:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INTEL_GVT_INVALID_ADDR,8,3     ## @INTEL_GVT_INVALID_ADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid gma address: %lx\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_I915_GTT_PAGE_SIZE,4,2         ## @I915_GTT_PAGE_SIZE
	.no_dead_strip	_copy_gma_to_hva
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function copy_gma_to_hva
_copy_gma_to_hva:                       ; @copy_gma_to_hva
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cmp	x2, x3
	b.ne	LBB0_2
; %bb.1:
	mov	w19, #0
	b	LBB0_6
LBB0_2:
	mov	x21, x4
	mov	x22, x3
	mov	x20, x2
	mov	x23, x1
	mov	x24, x0
	mov	x19, #0
Lloh0:
	adrp	x26, _INTEL_GVT_INVALID_ADDR@GOTPAGE
Lloh1:
	ldr	x26, [x26, _INTEL_GVT_INVALID_ADDR@GOTPAGEOFF]
Lloh2:
	adrp	x27, _I915_GTT_PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x27, [x27, _I915_GTT_PAGE_SIZE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x20
	bl	_intel_vgpu_gma_to_gpa
	ldr	x8, [x26]
	cmp	x0, x8
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x0
	ldrsw	x8, [x27]
	sub	x9, x8, #1
	and	x9, x20, x9
	sub	x10, x22, x20
	sub	x8, x8, x9
	cmp	x10, x8
	csel	x25, x10, x8, lo
	add	x2, x21, x19
	mov	x0, x24
	mov	x3, x25
	bl	_intel_gvt_hypervisor_read_gpa
	add	x19, x25, x19
	add	x20, x25, x20
	cmp	x20, x22
	b.ne	LBB0_3
	b	LBB0_6
LBB0_5:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_gvt_vgpu_err
Lloh6:
	adrp	x8, _EFAULT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_6:
	mov	x0, x19
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_INTEL_GVT_INVALID_ADDR,8,3     ; @INTEL_GVT_INVALID_ADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid gma address: %lx\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_I915_GTT_PAGE_SIZE,4,2         ; @I915_GTT_PAGE_SIZE
	.no_dead_strip	_copy_gma_to_hva
.subsections_via_symbols
