	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emulate_ggtt_mmio_read
_emulate_ggtt_mmio_read:                ## @emulate_ggtt_mmio_read
	.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	%ecx, %r13d
	movl	%esi, %r15d
	movq	(%rdi), %r12
	movq	8(%rdi), %rax
	movb	(%r12), %cl
	movl	%esi, %ebx
	shrq	%cl, %rbx
	cmpl	$4, %r13d
	je	LBB0_3
## %bb.1:
	cmpl	$8, %r13d
	jne	LBB0_2
LBB0_3:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	_I915_GTT_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movq	%rbx, %r14
	shlq	%cl, %r14
	movl	$1, %edx
	shll	%cl, %edx
	movq	%r14, %rsi
	callq	_intel_gvt_ggtt_validate_range
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	leaq	-48(%rbp), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_ggtt_get_guest_entry
	movl	4(%r12), %eax
	decl	%eax
	andl	%r15d, %eax
	leaq	(%rax,%rbp), %rsi
	addq	$-48, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_memcpy
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_4:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	callq	_gvt_dbg_mm
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	movl	%r13d, %edx
	callq	_memset
LBB0_6:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_I915_GTT_PAGE_SHIFT,8,3        ## @I915_GTT_PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read invalid ggtt at 0x%lx\n"

	.no_dead_strip	_emulate_ggtt_mmio_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emulate_ggtt_mmio_read
_emulate_ggtt_mmio_read:                ; @emulate_ggtt_mmio_read
	.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, x3
	mov	x20, x2
	mov	x21, x1
	ldp	x25, x22, [x0]
	ldr	w8, [x25]
	cmp	w3, #4
	b.eq	LBB0_2
; %bb.1:
	cmp	w19, #8
	b.ne	LBB0_4
LBB0_2:
	mov	w9, w21
	lsr	x23, x9, x8
Lloh0:
	adrp	x8, _I915_GTT_PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_GTT_PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	lsl	x24, x23, x8
	mov	w9, #1
	lsl	w2, w9, w8
	mov	x1, x24
	bl	_intel_gvt_ggtt_validate_range
	cbz	w0, LBB0_5
; %bb.3:
	add	x24, sp, #8
	add	x1, sp, #8
	mov	x0, x22
	mov	x2, x23
	bl	_ggtt_get_guest_entry
	ldr	w8, [x25, #4]
	sub	w8, w8, #1
	and	w8, w8, w21
	add	x1, x24, x8
	mov	x0, x20
	mov	x2, x19
	bl	_memcpy
	b	LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_5:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x24
	bl	_gvt_dbg_mm
	mov	x0, x20
	mov	w1, #0
	mov	x2, x19
	bl	_memset
LBB0_6:
	mov	w0, #0
LBB0_7:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_I915_GTT_PAGE_SHIFT,8,3        ; @I915_GTT_PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read invalid ggtt at 0x%lx\n"

	.no_dead_strip	_emulate_ggtt_mmio_read
.subsections_via_symbols
