	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gvt_destroy_vgpu         ## -- Begin function intel_gvt_destroy_vgpu
	.p2align	4, 0x90
_intel_gvt_destroy_vgpu:                ## @intel_gvt_destroy_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	leaq	4(%rdi), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_WARN
	movq	%rbx, %rdi
	callq	_intel_gvt_debugfs_remove_vgpu
	movq	%rbx, %rdi
	callq	_intel_vgpu_clean_sched_policy
	movq	%rbx, %rdi
	callq	_intel_vgpu_clean_submission
	movq	%rbx, %rdi
	callq	_intel_vgpu_clean_display
	movq	%rbx, %rdi
	callq	_intel_vgpu_clean_opregion
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_intel_vgpu_reset_ggtt
	movq	%rbx, %rdi
	callq	_intel_vgpu_clean_gtt
	movq	%rbx, %rdi
	callq	_intel_gvt_hypervisor_detach_vgpu
	movq	%rbx, %rdi
	callq	_intel_vgpu_free_resource
	movq	%rbx, %rdi
	callq	_intel_vgpu_clean_mmio
	movq	%rbx, %rdi
	callq	_intel_vgpu_dmabuf_cleanup
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_mutex_lock
	leaq	4(%r14), %r15
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_idr_remove
	movq	%r15, %rdi
	callq	_idr_is_empty
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_intel_gvt_clean_irq
LBB0_2:
	movq	%r14, %rdi
	callq	_intel_gvt_update_vgpu_types
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vGPU is still active!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gvt_destroy_vgpu         ; -- Begin function intel_gvt_destroy_vgpu
	.p2align	2
_intel_gvt_destroy_vgpu:                ; @intel_gvt_destroy_vgpu
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x20, [x0, #16]
	add	x21, x0, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN
	mov	x0, x19
	bl	_intel_gvt_debugfs_remove_vgpu
	mov	x0, x19
	bl	_intel_vgpu_clean_sched_policy
	mov	x0, x19
	bl	_intel_vgpu_clean_submission
	mov	x0, x19
	bl	_intel_vgpu_clean_display
	mov	x0, x19
	bl	_intel_vgpu_clean_opregion
	mov	x0, x19
	mov	w1, #1
	bl	_intel_vgpu_reset_ggtt
	mov	x0, x19
	bl	_intel_vgpu_clean_gtt
	mov	x0, x19
	bl	_intel_gvt_hypervisor_detach_vgpu
	mov	x0, x19
	bl	_intel_vgpu_free_resource
	mov	x0, x19
	bl	_intel_vgpu_clean_mmio
	mov	x0, x19
	bl	_intel_vgpu_dmabuf_cleanup
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x20
	bl	_mutex_lock
	add	x21, x20, #4
	ldr	w1, [x19]
	mov	x0, x21
	bl	_idr_remove
	mov	x0, x21
	bl	_idr_is_empty
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_intel_gvt_clean_irq
LBB0_2:
	mov	x0, x20
	bl	_intel_gvt_update_vgpu_types
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_vfree
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vGPU is still active!\n"

.subsections_via_symbols
