	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ppgtt_handle_guest_write_page_table
_ppgtt_handle_guest_write_page_table:   ## @ppgtt_handle_guest_write_page_table
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rdi, %r15
	movq	8(%rdi), %r13
	movslq	(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rax
	movq	(%rax), %r14
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	*(%r14)
	movl	%eax, %r12d
	leaq	-72(%rbp), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_ppgtt_get_shadow_entry
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.1:
	movq	%r15, %rdi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_ppgtt_handle_guest_entry_add
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	leaq	-72(%rbp), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_ppgtt_handle_guest_entry_removal
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_5
LBB0_3:
	xorl	%r12d, %r12d
	jmp	LBB0_6
LBB0_4:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	leaq	-72(%rbp), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_ppgtt_handle_guest_entry_removal
	movl	%eax, %r12d
	testl	%eax, %eax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_7
LBB0_5:
	movl	8(%r14), %edx
	movq	(%r14), %rcx
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	callq	_gvt_vgpu_err
LBB0_6:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	-72(%rbp), %rdi
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	callq	*32(%r14)
	testq	%rax, %rax
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_10
## %bb.8:
	movq	_GTT_64K_PTE_STRIDE@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_15
## %bb.9:
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rcx
	testq	%rdx, %rdx
	je	LBB0_16
LBB0_10:
	movq	-72(%rbp), %rax
	movq	_GTT_TYPE_PPGTT_PTE_2M_ENTRY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.11:
	movq	_GTT_TYPE_PPGTT_PTE_1G_ENTRY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.12:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax,%r13,4), %esi
	leaq	-72(%rbp), %r12
	jmp	LBB0_14
LBB0_13:
	leaq	-72(%rbp), %r12
	movq	%r12, %rdi
	callq	*16(%r14)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax,%r13,4), %esi
LBB0_14:
	movq	%r12, %rdi
	callq	*8(%r14)
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_ppgtt_set_shadow_entry
	xorl	%r12d, %r12d
	jmp	LBB0_6
LBB0_15:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	testq	%rdx, %rdx
	jne	LBB0_10
LBB0_16:
	leaq	L_.str(%rip), %rdi
	callq	_gvt_vdbg_mm
	cmpq	$0, (%r12)
	je	LBB0_3
## %bb.17:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	leaq	-72(%rbp), %rbx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	*24(%r14)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx,4), %esi
	movq	%rbx, %rdi
	callq	*8(%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r13), %rdx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ppgtt_set_shadow_entry
	incq	%r13
	movq	_GTT_64K_PTE_STRIDE@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	ja	LBB0_18
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_GTT_64K_PTE_STRIDE,8,3         ## @GTT_64K_PTE_STRIDE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"remove splited 64K shadow entries\n"

	.comm	_GTT_TYPE_PPGTT_PTE_2M_ENTRY,8,3 ## @GTT_TYPE_PPGTT_PTE_2M_ENTRY
	.comm	_GTT_TYPE_PPGTT_PTE_1G_ENTRY,8,3 ## @GTT_TYPE_PPGTT_PTE_1G_ENTRY
L_.str.1:                               ## @.str.1
	.asciz	"fail: shadow page %p guest entry 0x%llx type %d.\n"

	.no_dead_strip	_ppgtt_handle_guest_write_page_table
.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_write_page_table
_ppgtt_handle_guest_write_page_table:   ; @ppgtt_handle_guest_write_page_table
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x24, [x0, #8]
	ldrsw	x23, [x0]
	ldr	x8, [x24, #8]
	ldr	x25, [x8]
	ldr	x8, [x25]
	mov	x0, x1
	blr	x8
	mov	x22, x0
	mov	x1, sp
	mov	x0, x19
	mov	x2, x20
	bl	_ppgtt_get_shadow_entry
	cbz	w22, LBB0_3
; %bb.1:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_ppgtt_handle_guest_entry_add
	mov	x22, x0
	cbnz	w0, LBB0_4
; %bb.2:
	mov	x1, sp
	mov	x0, x19
	mov	x2, x20
	bl	_ppgtt_handle_guest_entry_removal
	mov	x22, x0
	cbnz	w0, LBB0_4
	b	LBB0_5
LBB0_3:
	mov	x1, sp
	mov	x0, x19
	mov	x2, x20
	bl	_ppgtt_handle_guest_entry_removal
	mov	x22, x0
	cbz	w0, LBB0_6
LBB0_4:
	ldr	w2, [x21, #8]
	ldr	x3, [x21]
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_gvt_vgpu_err
LBB0_5:
	mov	x0, x22
	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
LBB0_6:
	ldr	x8, [x25, #32]
	mov	x0, sp
	blr	x8
	cbz	x0, LBB0_8
; %bb.7:
Lloh2:
	adrp	x21, _GTT_64K_PTE_STRIDE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _GTT_64K_PTE_STRIDE@GOTPAGEOFF]
	ldr	x8, [x21]
	udiv	x9, x20, x8
	msub	x8, x9, x8, x20
	cbz	x8, LBB0_11
LBB0_8:
	ldr	x8, [sp]
Lloh4:
	adrp	x9, _GTT_TYPE_PPGTT_PTE_2M_ENTRY@GOTPAGE
Lloh5:
	ldr	x9, [x9, _GTT_TYPE_PPGTT_PTE_2M_ENTRY@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
Lloh7:
	adrp	x10, _GTT_TYPE_PPGTT_PTE_1G_ENTRY@GOTPAGE
Lloh8:
	ldr	x10, [x10, _GTT_TYPE_PPGTT_PTE_1G_ENTRY@GOTPAGEOFF]
Lloh9:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_10
; %bb.9:
	ldr	x8, [x25, #16]
	mov	x0, sp
	blr	x8
LBB0_10:
	ldr	x8, [x25, #8]
	ldr	x9, [x24]
	ldr	w1, [x9, x23, lsl #2]
	mov	x0, sp
	blr	x8
	mov	x1, sp
	mov	x0, x19
	mov	x2, x20
	bl	_ppgtt_set_shadow_entry
	mov	w22, #0
	b	LBB0_5
LBB0_11:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_vdbg_mm
	ldr	x8, [x21]
	cbz	x8, LBB0_14
; %bb.12:
	mov	x26, #0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25, #24]
	mov	x0, sp
	blr	x8
	ldr	x8, [x25, #8]
	ldr	x9, [x24]
	ldr	w1, [x9, x23, lsl #2]
	mov	x0, sp
	blr	x8
	add	x2, x20, x26
	mov	x1, sp
	mov	x0, x19
	bl	_ppgtt_set_shadow_entry
	mov	w22, #0
	add	x26, x26, #1
	ldr	x8, [x21]
	cmp	x8, x26
	b.hi	LBB0_13
	b	LBB0_5
LBB0_14:
	mov	w22, #0
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GTT_64K_PTE_STRIDE,8,3         ; @GTT_64K_PTE_STRIDE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"remove splited 64K shadow entries\n"

	.comm	_GTT_TYPE_PPGTT_PTE_2M_ENTRY,8,3 ; @GTT_TYPE_PPGTT_PTE_2M_ENTRY
	.comm	_GTT_TYPE_PPGTT_PTE_1G_ENTRY,8,3 ; @GTT_TYPE_PPGTT_PTE_1G_ENTRY
l_.str.1:                               ; @.str.1
	.asciz	"fail: shadow page %p guest entry 0x%llx type %d.\n"

	.no_dead_strip	_ppgtt_handle_guest_write_page_table
.subsections_via_symbols
