	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function split_64KB_gtt_entry
_split_64KB_gtt_entry:                  ## @split_64KB_gtt_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, %rbx
	movq	%rdx, %r12
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rax
	movq	(%rax), %r14
	leaq	L_.str(%rip), %rdi
	movq	%rdx, %rsi
	callq	_gvt_vdbg_mm
	movq	_GTT_64K_PTE_STRIDE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r12, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_1
## %bb.2:
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rdx, %rdi
	jmp	LBB0_3
LBB0_1:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %edi
LBB0_3:
	callq	_GEM_BUG_ON
	movq	%rbx, %rdi
	callq	*(%r14)
	movq	%rax, %rbx
	movq	_GTT_TYPE_PPGTT_PTE_4K_ENTRY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	leaq	-48(%rbp), %rdi
	callq	*16(%r14)
	movq	_GTT_64K_PTE_STRIDE@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.4:
	xorl	%r15d, %r15d
	leaq	-48(%rbp), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%rbx,%r15), %rsi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	leaq	-52(%rbp), %rcx
	callq	_intel_gvt_hypervisor_dma_map_guest_page
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-52(%rbp), %esi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	sarl	%cl, %esi
	movq	%r13, %rdi
	callq	*8(%r14)
	leaq	(%r12,%r15), %rdx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_ppgtt_set_shadow_entry
	incq	%r15
	movq	_GTT_64K_PTE_STRIDE@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	ja	LBB0_5
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	addq	$40, %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	"Split 64K gtt entry, index %lu\n"

	.comm	_GTT_64K_PTE_STRIDE,8,3         ## @GTT_64K_PTE_STRIDE
	.comm	_GTT_TYPE_PPGTT_PTE_4K_ENTRY,4,2 ## @GTT_TYPE_PPGTT_PTE_4K_ENTRY
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_split_64KB_gtt_entry
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function split_64KB_gtt_entry
_split_64KB_gtt_entry:                  ; @split_64KB_gtt_entry
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x22, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0]
	ldr	x23, [x8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x2
	bl	_gvt_vdbg_mm
Lloh2:
	adrp	x24, _GTT_64K_PTE_STRIDE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _GTT_64K_PTE_STRIDE@GOTPAGEOFF]
	ldr	x8, [x24]
	udiv	x9, x19, x8
	msub	x0, x9, x8, x19
	bl	_GEM_BUG_ON
	ldr	x8, [x23]
	mov	x0, x22
	blr	x8
	mov	x22, x0
Lloh4:
	adrp	x8, _GTT_TYPE_PPGTT_PTE_4K_ENTRY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GTT_TYPE_PPGTT_PTE_4K_ENTRY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	ldr	x8, [x23, #16]
	add	x0, sp, #8
	blr	x8
	ldr	x8, [x24]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x25, #0
Lloh7:
	adrp	x26, _PAGE_SIZE@GOTPAGE
Lloh8:
	ldr	x26, [x26, _PAGE_SIZE@GOTPAGEOFF]
Lloh9:
	adrp	x27, _PAGE_SHIFT@GOTPAGE
Lloh10:
	ldr	x27, [x27, _PAGE_SHIFT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, x22, x25
	ldr	w2, [x26]
	add	x3, sp, #4
	mov	x0, x21
	bl	_intel_gvt_hypervisor_dma_map_guest_page
	cbnz	w0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x23, #8]
	ldr	w9, [sp, #4]
	ldr	w10, [x27]
	asr	w1, w9, w10
	add	x0, sp, #8
	blr	x8
	add	x2, x19, x25
	add	x1, sp, #8
	mov	x0, x20
	bl	_ppgtt_set_shadow_entry
	add	x25, x25, #1
	ldr	x8, [x24]
	cmp	x8, x25
	b.hi	LBB0_2
LBB0_4:
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Split 64K gtt entry, index %lu\n"

	.comm	_GTT_64K_PTE_STRIDE,8,3         ; @GTT_64K_PTE_STRIDE
	.comm	_GTT_TYPE_PPGTT_PTE_4K_ENTRY,4,2 ; @GTT_TYPE_PPGTT_PTE_4K_ENTRY
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_split_64KB_gtt_entry
.subsections_via_symbols
