	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vm_cleanup
_vm_cleanup:                            ## @vm_cleanup
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	callq	_ppt_unassign_all
	movq	56(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_iommu_destroy_domain
LBB0_2:
	movl	48(%r15), %edi
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	callq	_vrtc_cleanup
	jmp	LBB0_5
LBB0_4:
	callq	_vrtc_reset
LBB0_5:
	movl	44(%r15), %edi
	callq	_vpmtmr_cleanup
	movl	40(%r15), %edi
	callq	_vatpit_cleanup
	movl	36(%r15), %edi
	callq	_vhpet_cleanup
	movl	32(%r15), %edi
	callq	_vatpic_cleanup
	movl	28(%r15), %edi
	callq	_vioapic_cleanup
	cmpl	$0, (%r15)
	jle	LBB0_8
## %bb.6:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_vcpu_cleanup
	incl	%ebx
	cmpl	(%r15), %ebx
	jl	LBB0_7
LBB0_8:
	movl	24(%r15), %edi
	callq	_VMCLEANUP
	movq	_VM_MAX_MEMMAPS@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_14
## %bb.9:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_vm_free_memmap
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	addq	$4, %r13
	cmpq	%rax, %rbx
	jge	LBB0_14
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	testl	%r14d, %r14d
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	16(%r15), %rsi
	addq	%r13, %rsi
	movq	%r15, %rdi
	callq	_sysmem_mapping
	testl	%eax, %eax
	jne	LBB0_13
	jmp	LBB0_12
LBB0_14:
	testl	%r14d, %r14d
	je	LBB0_19
## %bb.15:
	movq	_VM_MAX_MEMSEGS@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_18
## %bb.16:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_vm_free_memseg
	incl	%ebx
	cmpl	(%r14), %ebx
	jl	LBB0_17
LBB0_18:
	movq	8(%r15), %rdi
	callq	_VMSPACE_FREE
	movq	$0, 8(%r15)
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VM_MAX_MEMMAPS,4,2             ## @VM_MAX_MEMMAPS
	.comm	_VM_MAX_MEMSEGS,4,2             ## @VM_MAX_MEMSEGS
	.no_dead_strip	_vm_cleanup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vm_cleanup
_vm_cleanup:                            ; @vm_cleanup
	.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	x20, x1
	mov	x19, x0
	bl	_ppt_unassign_all
	ldr	x0, [x19, #56]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_iommu_destroy_domain
LBB0_2:
	ldr	w0, [x19, #48]
	cbz	w20, LBB0_4
; %bb.3:
	bl	_vrtc_cleanup
	b	LBB0_5
LBB0_4:
	bl	_vrtc_reset
LBB0_5:
	ldr	w0, [x19, #44]
	bl	_vpmtmr_cleanup
	ldr	w0, [x19, #40]
	bl	_vatpit_cleanup
	ldr	w0, [x19, #36]
	bl	_vhpet_cleanup
	ldr	w0, [x19, #32]
	bl	_vatpic_cleanup
	ldr	w0, [x19, #28]
	bl	_vioapic_cleanup
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:
	mov	w21, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_vcpu_cleanup
	add	w21, w21, #1
	ldr	w8, [x19]
	cmp	w21, w8
	b.lt	LBB0_7
LBB0_8:
	ldr	w0, [x19, #24]
	bl	_VMCLEANUP
Lloh0:
	adrp	x22, _VM_MAX_MEMMAPS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VM_MAX_MEMMAPS@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.9:
	mov	x23, #0
	mov	x21, #0
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_vm_free_memmap
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x22]
	add	x23, x23, #4
	cmp	x21, x8
	b.ge	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	cbnz	w20, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x19, #16]
	add	x1, x8, x23
	mov	x0, x19
	bl	_sysmem_mapping
	cbnz	w0, LBB0_11
	b	LBB0_10
LBB0_14:
	cbz	w20, LBB0_19
; %bb.15:
Lloh2:
	adrp	x21, _VM_MAX_MEMSEGS@GOTPAGE
Lloh3:
	ldr	x21, [x21, _VM_MAX_MEMSEGS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.16:
	mov	w20, #0
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_vm_free_memseg
	add	w20, w20, #1
	ldr	w8, [x21]
	cmp	w20, w8
	b.lt	LBB0_17
LBB0_18:
	ldr	x0, [x19, #8]
	bl	_VMSPACE_FREE
	str	xzr, [x19, #8]
LBB0_19:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_VM_MAX_MEMMAPS,4,2             ; @VM_MAX_MEMMAPS
	.comm	_VM_MAX_MEMSEGS,4,2             ; @VM_MAX_MEMSEGS
	.no_dead_strip	_vm_cleanup
.subsections_via_symbols
