	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ppgtt_populate_shadow_entry
_ppgtt_populate_shadow_entry:           ## @ppgtt_populate_shadow_entry
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %r13
	movl	(%rcx), %eax
	movl	%eax, -48(%rbp)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	%rcx, %rdi
	callq	*16(%r13)
	xorl	%r12d, %r12d
	testl	%eax, %eax
	je	LBB0_16
## %bb.1:
	movq	%r15, %rdi
	callq	*(%r13)
	movl	(%r15), %edx
	addl	$-128, %edx
	cmpl	$3, %edx
	ja	LBB0_4
## %bb.2:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rdx,4), %rdx
	addq	%rcx, %rdx
	jmpq	*%rdx
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_gvt_vdbg_mm
	leaq	-48(%rbp), %rcx
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_split_64KB_gtt_entry
	jmp	LBB0_15
LBB0_4:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$1, %edi
	callq	_GEM_BUG_ON
	jmp	LBB0_9
LBB0_5:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rdi
	callq	_gvt_vdbg_mm
	jmp	LBB0_9
LBB0_6:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	L_.str.2(%rip), %rdi
	callq	_gvt_vdbg_mm
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_is_2MB_gtt_possible
	testl	%eax, %eax
	je	LBB0_14
## %bb.7:
	js	LBB0_15
## %bb.8:
	movq	_I915_GTT_PAGE_SIZE_2M@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
LBB0_9:
	leaq	-76(%rbp), %rcx
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_intel_gvt_hypervisor_dma_map_guest_page
	testl	%eax, %eax
	je	LBB0_13
## %bb.10:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str.3(%rip), %rdi
	callq	_gvt_vgpu_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_12:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_16
LBB0_13:
	movl	-76(%rbp), %esi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %esi
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	*8(%r13)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_ppgtt_set_shadow_entry
	jmp	LBB0_16
LBB0_14:
	leaq	-48(%rbp), %rcx
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_split_2MB_gtt_entry
LBB0_15:
	movl	%eax, %r12d
LBB0_16:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
LJTI0_0:
	.long	L0_0_set_3
	.long	L0_0_set_5
	.long	L0_0_set_6
	.long	L0_0_set_11
	.end_data_region
                                        ## -- End function
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"shadow 4K gtt entry\n"

L_.str.1:                               ## @.str.1
	.asciz	"shadow 64K gtt entry\n"

L_.str.2:                               ## @.str.2
	.asciz	"shadow 2M gtt entry\n"

	.comm	_I915_GTT_PAGE_SIZE_2M,8,3      ## @I915_GTT_PAGE_SIZE_2M
L_.str.3:                               ## @.str.3
	.asciz	"GVT doesn't support 1GB entry\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_ppgtt_populate_shadow_entry
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ppgtt_populate_shadow_entry
_ppgtt_populate_shadow_entry:           ; @ppgtt_populate_shadow_entry
	.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	x24, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0]
	ldr	x25, [x8]
	ldr	w8, [x3]
	str	w8, [sp, #8]
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	ldr	x8, [x25, #16]
	mov	x0, x3
	blr	x8
	cbz	w0, LBB0_15
; %bb.1:
	ldr	x8, [x25]
	mov	x0, x24
	blr	x8
	mov	x22, x0
	ldr	w8, [x24]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_4
; %bb.2:
Lloh3:
	adrp	x9, lJTI0_0@PAGE
Lloh4:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_3
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_3:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_gvt_vdbg_mm
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_split_64KB_gtt_entry
	b	LBB0_15
LBB0_4:
	mov	w0, #1
	bl	_GEM_BUG_ON
	b	LBB0_9
LBB0_5:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_vdbg_mm
	b	LBB0_9
LBB0_6:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_gvt_vdbg_mm
	mov	x0, x21
	mov	x1, x24
	bl	_is_2MB_gtt_possible
	cbz	w0, LBB0_14
; %bb.7:
	tbnz	w0, #31, LBB0_15
; %bb.8:
Lloh11:
	adrp	x8, _I915_GTT_PAGE_SIZE_2M@GOTPAGE
Lloh12:
	ldr	x8, [x8, _I915_GTT_PAGE_SIZE_2M@GOTPAGEOFF]
Lloh13:
	ldr	x23, [x8]
LBB0_9:
	add	x3, sp, #4
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_intel_gvt_hypervisor_dma_map_guest_page
	cbz	w0, LBB0_13
; %bb.10:
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_gvt_vgpu_err
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_13:
	ldr	x8, [x25, #8]
	ldr	w9, [sp, #4]
Lloh20:
	adrp	x10, _PAGE_SHIFT@GOTPAGE
Lloh21:
	ldr	x10, [x10, _PAGE_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	asr	w1, w9, w10
	add	x0, sp, #8
	blr	x8
	add	x1, sp, #8
	mov	x0, x20
	mov	x2, x19
	bl	_ppgtt_set_shadow_entry
	mov	w0, #0
	b	LBB0_15
LBB0_14:
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_split_2MB_gtt_entry
LBB0_15:
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_3-LBB0_3)>>2
	.byte	(LBB0_5-LBB0_3)>>2
	.byte	(LBB0_6-LBB0_3)>>2
	.byte	(LBB0_11-LBB0_3)>>2
                                        ; -- End function
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"shadow 4K gtt entry\n"

l_.str.1:                               ; @.str.1
	.asciz	"shadow 64K gtt entry\n"

l_.str.2:                               ; @.str.2
	.asciz	"shadow 2M gtt entry\n"

	.comm	_I915_GTT_PAGE_SIZE_2M,8,3      ; @I915_GTT_PAGE_SIZE_2M
l_.str.3:                               ; @.str.3
	.asciz	"GVT doesn't support 1GB entry\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_ppgtt_populate_shadow_entry
.subsections_via_symbols
