	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_vgpu_create_ppgtt_mm     ## -- Begin function intel_vgpu_create_ppgtt_mm
	.p2align	4, 0x90
_intel_vgpu_create_ppgtt_mm:            ## @intel_vgpu_create_ppgtt_mm
	.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
	movq	%rdx, %r13
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	callq	_vgpu_alloc_mm
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	_INTEL_GVT_MM_PPGTT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_GTT_TYPE_PPGTT_ROOT_L3_ENTRY@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	setne	%al
	movq	_GTT_TYPE_PPGTT_ROOT_L4_ENTRY@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	setne	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_GEM_BUG_ON
	movl	%r14d, (%rbx)
	leaq	8(%rbx), %r12
	movq	%r12, %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, %r13
	addq	$4, %r13
	movq	%r13, %rdi
	callq	_INIT_LIST_HEAD
	movq	_GTT_TYPE_PPGTT_ROOT_L4_ENTRY@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_5
## %bb.4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movq	16(%rbx), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_2
LBB0_5:
	movq	16(%rbx), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	$8, %edx
	callq	_memcpy
LBB0_6:
	movq	%rbx, %rdi
	callq	_shadow_ppgtt_mm
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	callq	_gvt_vgpu_err
	movq	%rbx, %rdi
	callq	_vgpu_free_mm
	movl	%r14d, %edi
LBB0_2:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_8:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_list_add_tail
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_mutex_lock
	leaq	4(%r14), %rsi
	movq	%r13, %rdi
	callq	_list_add_tail
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_INTEL_GVT_MM_PPGTT,4,2         ## @INTEL_GVT_MM_PPGTT
	.comm	_GTT_TYPE_PPGTT_ROOT_L3_ENTRY,4,2 ## @GTT_TYPE_PPGTT_ROOT_L3_ENTRY
	.comm	_GTT_TYPE_PPGTT_ROOT_L4_ENTRY,4,2 ## @GTT_TYPE_PPGTT_ROOT_L4_ENTRY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to shadow ppgtt mm\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_vgpu_create_ppgtt_mm     ; -- Begin function intel_vgpu_create_ppgtt_mm
	.p2align	2
_intel_vgpu_create_ppgtt_mm:            ; @intel_vgpu_create_ppgtt_mm
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x2
	mov	x25, x1
	mov	x21, x0
	ldr	x20, [x0, #8]
	bl	_vgpu_alloc_mm
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _INTEL_GVT_MM_PPGTT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INTEL_GVT_MM_PPGTT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #24]
Lloh3:
	adrp	x8, _GTT_TYPE_PPGTT_ROOT_L3_ENTRY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GTT_TYPE_PPGTT_ROOT_L3_ENTRY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w25
Lloh6:
	adrp	x26, _GTT_TYPE_PPGTT_ROOT_L4_ENTRY@GOTPAGE
Lloh7:
	ldr	x26, [x26, _GTT_TYPE_PPGTT_ROOT_L4_ENTRY@GOTPAGEOFF]
	ldr	w8, [x26]
	ccmp	w8, w25, #4, ne
	cset	w0, ne
	bl	_GEM_BUG_ON
	str	w25, [x19]
	add	x24, x19, #8
	mov	x0, x24
	bl	_INIT_LIST_HEAD
	add	x23, x19, #4
	mov	x0, x23
	bl	_INIT_LIST_HEAD
	ldr	w8, [x26]
	cmp	w8, w25
	b.ne	LBB0_4
; %bb.2:
	ldr	w8, [x22]
	ldr	x9, [x19, #16]
	str	w8, [x9]
	b	LBB0_5
LBB0_3:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_4:
	ldr	x0, [x19, #16]
	mov	x1, x22
	mov	w2, #8
	bl	_memcpy
LBB0_5:
	mov	x0, x19
	bl	_shadow_ppgtt_mm
	cbz	w0, LBB0_8
; %bb.6:
	mov	x22, x0
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_vgpu_err
	mov	x0, x19
	bl	_vgpu_free_mm
	mov	x0, x22
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_8:
	mov	x0, x24
	mov	x1, x21
	bl	_list_add_tail
	mov	x0, x20
	bl	_mutex_lock
	add	x1, x20, #4
	mov	x0, x23
	bl	_list_add_tail
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_INTEL_GVT_MM_PPGTT,4,2         ; @INTEL_GVT_MM_PPGTT
	.comm	_GTT_TYPE_PPGTT_ROOT_L3_ENTRY,4,2 ; @GTT_TYPE_PPGTT_ROOT_L3_ENTRY
	.comm	_GTT_TYPE_PPGTT_ROOT_L4_ENTRY,4,2 ; @GTT_TYPE_PPGTT_ROOT_L4_ENTRY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to shadow ppgtt mm\n"

.subsections_via_symbols
