	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __intel_gvt_create_vgpu
___intel_gvt_create_vgpu:               ## @__intel_gvt_create_vgpu
	.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	%rsi, %rbx
	movq	%rdi, %r14
	movl	24(%rsi), %edx
	movl	20(%rsi), %ecx
	movl	12(%rsi), %esi
	movl	16(%rbx), %r8d
	leaq	L_.str(%rip), %rdi
	callq	_gvt_dbg_core
	movl	$48, %edi
	callq	_vzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	_IDLE_VGPU_IDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	incq	%rdx
	movq	_GVT_MAX_VGPU@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %r8d
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_idr_alloc
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_24
## %bb.3:
	movl	%r12d, (%r15)
	movl	12(%rbx), %eax
	movl	%eax, 40(%r15)
	movq	%r14, 32(%r15)
	movl	8(%rbx), %eax
	movl	%eax, 24(%r15)
	leaq	20(%r15), %rdi
	callq	_mutex_init
	leaq	16(%r15), %rdi
	callq	_mutex_init
	leaq	12(%r15), %rdi
	callq	_INIT_LIST_HEAD
	leaq	8(%r15), %rdi
	movl	(%r13), %esi
	callq	_INIT_RADIX_TREE
	movq	%r15, %rdi
	addq	$4, %rdi
	callq	_idr_init
	movl	4(%rbx), %esi
	movq	%r15, %rdi
	callq	_intel_vgpu_init_cfg_space
	movq	%r15, %rdi
	callq	_intel_vgpu_init_mmio
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_23
## %bb.4:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_intel_vgpu_alloc_resource
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.5:
	movq	%r15, %rdi
	callq	_populate_pvinfo_page
	movq	%r15, %rdi
	callq	_intel_gvt_hypervisor_attach_vgpu
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.6:
	movq	%r15, %rdi
	callq	_intel_vgpu_init_gtt
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_20
## %bb.7:
	movq	%r15, %rdi
	callq	_intel_vgpu_init_opregion
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_19
## %bb.8:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_intel_vgpu_init_display
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.9:
	movq	%r15, %rdi
	callq	_intel_vgpu_setup_submission
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.10:
	movq	%r15, %rdi
	callq	_intel_vgpu_init_sched_policy
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.11:
	movq	%r15, %rdi
	callq	_intel_gvt_debugfs_add_vgpu
	movq	%r15, %rdi
	callq	_intel_gvt_hypervisor_set_opregion
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.12:
	movl	4(%r14), %edi
	callq	_IS_SKYLAKE
	testq	%rax, %rax
	jne	LBB0_14
## %bb.13:
	movl	4(%r14), %edi
	callq	_IS_KABYLAKE
	testq	%rax, %rax
	je	LBB0_26
LBB0_14:
	movq	_PORT_D@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_intel_gvt_hypervisor_set_edid
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_26
LBB0_15:
	movq	%r15, %rdi
	callq	_intel_vgpu_clean_sched_policy
LBB0_16:
	movq	%r15, %rdi
	callq	_intel_vgpu_clean_submission
LBB0_17:
	movq	%r15, %rdi
	callq	_intel_vgpu_clean_display
LBB0_18:
	movq	%r15, %rdi
	callq	_intel_vgpu_clean_opregion
LBB0_19:
	movq	%r15, %rdi
	callq	_intel_vgpu_clean_gtt
LBB0_20:
	movq	%r15, %rdi
	callq	_intel_gvt_hypervisor_detach_vgpu
LBB0_21:
	movq	%r15, %rdi
	callq	_intel_vgpu_free_resource
LBB0_22:
	movq	%r15, %rdi
	callq	_intel_vgpu_clean_mmio
LBB0_23:
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_idr_remove
LBB0_24:
	movq	%r15, %rdi
	callq	_vfree
	jmp	LBB0_25
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_25:
	movl	%r12d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_26:
	movq	%r15, %rax
	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	"handle %llu low %llu MB high %llu MB fence %llu\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IDLE_VGPU_IDR,8,3              ## @IDLE_VGPU_IDR
	.comm	_GVT_MAX_VGPU,4,2               ## @GVT_MAX_VGPU
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PORT_D,4,2                     ## @PORT_D
	.no_dead_strip	___intel_gvt_create_vgpu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __intel_gvt_create_vgpu
___intel_gvt_create_vgpu:               ; @__intel_gvt_create_vgpu
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x1
	mov	x19, x0
	ldp	w3, w2, [x1, #20]
	ldr	w1, [x1, #12]
	ldr	w4, [x21, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_dbg_core
	mov	w0, #48
	bl	_vzalloc
	cbz	x0, LBB0_24
; %bb.1:
	mov	x20, x0
Lloh2:
	adrp	x8, _IDLE_VGPU_IDR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IDLE_VGPU_IDR@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	add	x2, x8, #1
Lloh5:
	adrp	x8, _GVT_MAX_VGPU@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GVT_MAX_VGPU@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
Lloh8:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w4, [x23]
	mov	x0, x19
	mov	x1, x20
	bl	_idr_alloc
	mov	x22, x0
	tbnz	w0, #31, LBB0_23
; %bb.2:
	str	w22, [x20]
	ldp	w9, w8, [x21, #8]
	str	w8, [x20, #40]
	str	x19, [x20, #32]
	str	w9, [x20, #24]
	add	x0, x20, #20
	bl	_mutex_init
	add	x0, x20, #16
	bl	_mutex_init
	add	x0, x20, #12
	bl	_INIT_LIST_HEAD
	add	x0, x20, #8
	ldr	w1, [x23]
	bl	_INIT_RADIX_TREE
	add	x0, x20, #4
	bl	_idr_init
	ldr	w1, [x21, #4]
	mov	x0, x20
	bl	_intel_vgpu_init_cfg_space
	mov	x0, x20
	bl	_intel_vgpu_init_mmio
	mov	x22, x0
	cbnz	w0, LBB0_22
; %bb.3:
	mov	x0, x20
	mov	x1, x21
	bl	_intel_vgpu_alloc_resource
	mov	x22, x0
	cbnz	w0, LBB0_21
; %bb.4:
	mov	x0, x20
	bl	_populate_pvinfo_page
	mov	x0, x20
	bl	_intel_gvt_hypervisor_attach_vgpu
	mov	x22, x0
	cbnz	w0, LBB0_20
; %bb.5:
	mov	x0, x20
	bl	_intel_vgpu_init_gtt
	mov	x22, x0
	cbnz	w0, LBB0_19
; %bb.6:
	mov	x0, x20
	bl	_intel_vgpu_init_opregion
	mov	x22, x0
	cbnz	w0, LBB0_18
; %bb.7:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_intel_vgpu_init_display
	mov	x22, x0
	cbnz	w0, LBB0_17
; %bb.8:
	mov	x0, x20
	bl	_intel_vgpu_setup_submission
	mov	x22, x0
	cbnz	w0, LBB0_16
; %bb.9:
	mov	x0, x20
	bl	_intel_vgpu_init_sched_policy
	mov	x22, x0
	cbnz	w0, LBB0_15
; %bb.10:
	mov	x0, x20
	bl	_intel_gvt_debugfs_add_vgpu
	mov	x0, x20
	bl	_intel_gvt_hypervisor_set_opregion
	mov	x22, x0
	cbnz	w0, LBB0_14
; %bb.11:
	ldr	w0, [x19, #4]
	bl	_IS_SKYLAKE
	cbnz	x0, LBB0_13
; %bb.12:
	ldr	w0, [x19, #4]
	bl	_IS_KABYLAKE
	cbz	x0, LBB0_26
LBB0_13:
Lloh10:
	adrp	x8, _PORT_D@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PORT_D@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_intel_gvt_hypervisor_set_edid
	mov	x22, x0
	cbz	w0, LBB0_26
LBB0_14:
	mov	x0, x20
	bl	_intel_vgpu_clean_sched_policy
LBB0_15:
	mov	x0, x20
	bl	_intel_vgpu_clean_submission
LBB0_16:
	mov	x0, x20
	bl	_intel_vgpu_clean_display
LBB0_17:
	mov	x0, x20
	bl	_intel_vgpu_clean_opregion
LBB0_18:
	mov	x0, x20
	bl	_intel_vgpu_clean_gtt
LBB0_19:
	mov	x0, x20
	bl	_intel_gvt_hypervisor_detach_vgpu
LBB0_20:
	mov	x0, x20
	bl	_intel_vgpu_free_resource
LBB0_21:
	mov	x0, x20
	bl	_intel_vgpu_clean_mmio
LBB0_22:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_idr_remove
LBB0_23:
	mov	x0, x20
	bl	_vfree
	b	LBB0_25
LBB0_24:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_25:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_26:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"handle %llu low %llu MB high %llu MB fence %llu\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IDLE_VGPU_IDR,8,3              ; @IDLE_VGPU_IDR
	.comm	_GVT_MAX_VGPU,4,2               ; @GVT_MAX_VGPU
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PORT_D,4,2                     ; @PORT_D
	.no_dead_strip	___intel_gvt_create_vgpu
.subsections_via_symbols
