	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ppgtt_handle_guest_entry_removal
_ppgtt_handle_guest_entry_removal:      ## @ppgtt_handle_guest_entry_removal
	.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
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	(%rdi), %rcx
	movq	8(%rdi), %r12
	movq	16(%r12), %rax
	movq	(%rax), %r15
	movl	8(%r12), %edi
	movl	8(%rsi), %r8d
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdx
	movq	%rbx, %r9
	callq	_trace_spt_guest_change
	movq	(%r13), %rsi
	movl	8(%r13), %ecx
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rdx
	callq	_gvt_vdbg_mm
	movq	%r13, %rdi
	callq	*8(%r15)
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_8
## %bb.1:
	movq	%r13, %rdi
	callq	*(%r15)
	movq	(%r12), %rcx
	movq	(%r14), %rdx
	cmpq	(%rcx,%rdx,8), %rax
	je	LBB0_8
## %bb.2:
	movq	(%r13), %rdi
	callq	_get_next_pt_type
	movl	%eax, %edi
	callq	_gtt_type_is_pt
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%r13, %rdi
	callq	*(%r15)
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_intel_vgpu_find_spt_by_mfn
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rax, %rdi
	callq	_ppgtt_invalidate_spt
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_7
	jmp	LBB0_8
LBB0_5:
	movq	(%r13), %rax
	movq	_GTT_TYPE_PPGTT_PTE_64K_ENTRY@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	leaq	L_.str.3(%rip), %rsi
	callq	_WARN
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_ppgtt_invalidate_pte
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movq	_ENXIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_7:
	movl	8(%r13), %edx
	movq	(%r13), %rcx
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_gvt_vgpu_err
	movl	%r12d, %ebx
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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"remove"

L_.str.1:                               ## @.str.1
	.asciz	"destroy old shadow entry, type %d, index %lu, value %llx\n"

L_.str.2:                               ## @.str.2
	.asciz	"fail to find guest page\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_GTT_TYPE_PPGTT_PTE_64K_ENTRY,8,3 ## @GTT_TYPE_PPGTT_PTE_64K_ENTRY
L_.str.3:                               ## @.str.3
	.asciz	"suspicious 64K entry\n"

L_.str.4:                               ## @.str.4
	.asciz	"fail: shadow page %p guest entry 0x%llx type %d\n"

	.no_dead_strip	_ppgtt_handle_guest_entry_removal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ppgtt_handle_guest_entry_removal
_ppgtt_handle_guest_entry_removal:      ; @ppgtt_handle_guest_entry_removal
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldp	x3, x21, [x0]
	ldr	x8, [x21, #16]
	ldr	x23, [x8]
	ldr	w0, [x21, #8]
	ldr	w4, [x1, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x5, x22
	bl	_trace_spt_guest_change
	ldr	x1, [x20]
	ldr	w3, [x20, #8]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_gvt_vdbg_mm
	ldr	x8, [x23, #8]
	mov	x0, x20
	blr	x8
	cbz	w0, LBB0_2
; %bb.1:
	ldr	x8, [x23]
	mov	x0, x20
	blr	x8
	ldr	x8, [x21]
	ldr	x9, [x19]
	ldr	x8, [x8, x9, lsl #3]
	cmp	x0, x8
	b.ne	LBB0_4
LBB0_2:
	mov	w21, #0
LBB0_3:
	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
	add	sp, sp, #96
	ret
LBB0_4:
	ldr	x0, [x20]
	bl	_get_next_pt_type
	bl	_gtt_type_is_pt
	cbz	x0, LBB0_7
; %bb.5:
	ldr	x8, [x23]
	mov	x0, x20
	blr	x8
	mov	x1, x0
	mov	x0, x21
	bl	_intel_vgpu_find_spt_by_mfn
	cbz	x0, LBB0_8
; %bb.6:
	bl	_ppgtt_invalidate_spt
	mov	x21, x0
	cbnz	w0, LBB0_9
	b	LBB0_3
LBB0_7:
	ldr	x8, [x20]
Lloh4:
	adrp	x9, _GTT_TYPE_PPGTT_PTE_64K_ENTRY@GOTPAGE
Lloh5:
	ldr	x9, [x9, _GTT_TYPE_PPGTT_PTE_64K_ENTRY@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
Lloh7:
	adrp	x1, l_.str.3@PAGE
Lloh8:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_WARN
	mov	x0, x19
	mov	x1, x20
	bl	_ppgtt_invalidate_pte
	mov	w21, #0
	b	LBB0_3
LBB0_8:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_gvt_vgpu_err
Lloh11:
	adrp	x8, _ENXIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	ldr	x8, [x20]
	ldr	w9, [x20, #8]
	stp	x9, x8, [sp, #8]
	str	x19, [sp]
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_gvt_vgpu_err
	b	LBB0_3
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"remove"

l_.str.1:                               ; @.str.1
	.asciz	"destroy old shadow entry, type %d, index %lu, value %llx\n"

l_.str.2:                               ; @.str.2
	.asciz	"fail to find guest page\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_GTT_TYPE_PPGTT_PTE_64K_ENTRY,8,3 ; @GTT_TYPE_PPGTT_PTE_64K_ENTRY
l_.str.3:                               ; @.str.3
	.asciz	"suspicious 64K entry\n"

l_.str.4:                               ; @.str.4
	.asciz	"fail: shadow page %p guest entry 0x%llx type %d\n"

	.no_dead_strip	_ppgtt_handle_guest_entry_removal
.subsections_via_symbols
