// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_vm.c
// Function: vmFree
void vmFree(VM *vm)
{
    HeapPage *page = pageFind(&vm->pages, vm->mainFiber->stack);
    if (UNLIKELY(!page))
       vm->error->runtimeHandler(vm->error->context, ERR_RUNTIME, "No fiber stack");

    chunkChangeRefCnt(&vm->pages, page, vm->mainFiber->stack, -1);
    pageFree(&vm->pages, vm->terminatedNormally);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
addq $0x10, %rdi
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rcx
cmpq %rcx, 0x18(%rbx)
movq %rdi, 0x10(%rsp)
ja 0x16907
movq 0x20(%rbx), %rax
testq %rax, %rax
setne %dl
cmpq %rcx, %rax
setbe %al
testb %al, %dl
jne 0x16907
movq %rdi, %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x16907
leaq 0x30(%rbp), %rdx
cmpq %rcx, %rdx
ja 0x16901
cmpq %rcx, 0x28(%rbp)
ja 0x16bc1
addq $0x20, %rbp
jmp 0x168e5
movq 0x80(%rbx), %rcx
movq 0x20(%rcx), %rdi
leaq 0x58097(%rip), %rdx     # 0x6e9b0
xorl %ebp, %ebp
pushq $-0x1
popq %rsi
xorl %eax, %eax
callq *0x8(%rcx)
movq 0x8(%rbx), %rax
movq 0x10(%rax), %r15
movq %r15, %rax
subq %rbp, %rax
addq $-0x30, %rax
movslq 0x14(%rbp), %rcx
cqto
idivq %rcx
movq %rdx, %r12
movq %r15, %rax
subq %rdx, %rax
negq %r12
movl (%rax), %eax
testl %eax, %eax
jle 0x16bfa
cmpl %eax, 0x4(%rbp)
jl 0x16bfa
movq 0x10(%r15,%r12), %rcx
testq %rcx, %rcx
je 0x169cf
cmpl $0x1, %eax
jne 0x169cf
movq $0x2, 0x648f9(%rip) # 0x7b270
leaq 0x648f2(%rip), %rax     # 0x7b270
movq $0x1, 0x648f7(%rip) # 0x7b280
andq $0x0, 0x648e7(%rip)     # 0x7b278
xorps %xmm0, %xmm0
movups %xmm0, 0x648ed(%rip)    # 0x7b288
movq %rax, 0x648fe(%rip)     # 0x7b2a0
movq %r15, 0x64917(%rip)     # 0x7b2c0
leaq 0x64910(%rip), %rdi     # 0x7b2c0
movq 0x40(%rbx), %rax
movq 0x20(%rax), %rax
movq %rax, 0x64909(%rip)     # 0x7b2c8
leaq 0x64902(%rip), %rsi     # 0x7b2c8
callq *%rcx
decl 0x10(%rbp)
movl (%r15,%r12), %eax
decl %eax
movl %eax, (%r15,%r12)
movl 0x4(%rbp), %eax
decl %eax
movl %eax, 0x4(%rbp)
movq %rbx, %r14
movq 0x38(%rbx), %r13
cmpq %r15, 0x18(%r13)
ja 0x16a59
movslq 0x28(%r13), %rcx
shlq $0x3, %rcx
addq 0x10(%r13), %rcx
cmpq %r15, %rcx
jbe 0x16a59
leaq 0x20(%r13), %rbx
movq (%rbx), %rbx
leaq 0x8(%rbx), %r12
movq -0x10(%rbx), %rax
movq 0x10(%rax), %rax
leaq (%r12,%rax,8), %rax
cmpq %r15, %rax
jae 0x16a52
movq 0x10(%r13), %rax
movslq 0x28(%r13), %rcx
leaq (%rax,%rcx,8), %rax
addq $-0x8, %rax
cmpq %rax, %rbx
je 0x16a39
movl (%r12), %eax
notl %eax
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jne 0x169ff
movq 0x40(%r14), %rcx
movq 0x20(%rcx), %rdi
pushq $-0x1
popq %rsi
leaq 0x58054(%rip), %rdx     # 0x6ea9f
xorl %eax, %eax
callq *0x8(%rcx)
jmp 0x16a06
decq -0x8(%rbx)
movl 0x4(%rbp), %eax
testl %eax, %eax
movq %r14, %rbx
jne 0x16aa8
movslq 0x8(%rbp), %rax
movslq 0x14(%rbp), %rcx
imulq %rax, %rcx
subq %rcx, 0x30(%rbx)
cmpq %rbp, 0x10(%rbx)
jne 0x16a82
movq 0x20(%rbp), %rax
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq 0x18(%rbp), %rcx
movq 0x20(%rbp), %rax
testq %rcx, %rcx
je 0x16a93
movq %rax, 0x20(%rcx)
testq %rax, %rax
je 0x16aa0
movq 0x18(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq %rbp, %rdi
callq 0x3040
movb 0x70(%rbx), %al
movb %al, 0xf(%rsp)
movq 0x10(%rbx), %r15
leaq 0x64806(%rip), %r12     # 0x7b2c0
leaq 0x64807(%rip), %r13     # 0x7b2c8
testq %r15, %r15
je 0x16bb2
movq 0x20(%r15), %rax
movq %rax, 0x10(%rsp)
cmpb $0x0, 0xf(%rsp)
jne 0x16b8d
leaq 0x30(%r15), %rbx
xorl %ebp, %ebp
cmpl 0xc(%r15), %ebp
jge 0x16b7b
cmpl $0x0, 0x10(%r15)
jle 0x16b7b
movslq 0x14(%r15), %rcx
movslq %ebp, %rax
imulq %rcx, %rax
cmpl $0x0, 0x30(%r15,%rax)
je 0x16b74
addq %rbx, %rax
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x16b74
movq $0x2, 0x6474d(%rip) # 0x7b270
movq $0x1, 0x64752(%rip) # 0x7b280
andq $0x0, 0x64742(%rip)     # 0x7b278
addq $0x28, %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x64744(%rip)    # 0x7b288
leaq 0x64725(%rip), %rdx     # 0x7b270
movq %rdx, 0x6474e(%rip)     # 0x7b2a0
movq %rax, 0x64767(%rip)     # 0x7b2c0
movq 0x40(%r14), %rax
movq 0x20(%rax), %rax
movq %rax, 0x64760(%rip)     # 0x7b2c8
movq %r12, %rdi
movq %r13, %rsi
callq *%rcx
decl 0x10(%r15)
incl %ebp
jmp 0x16ae4
movq %r15, %rdi
callq 0x3040
movq 0x10(%rsp), %r15
jmp 0x16ac1
movq 0x64464(%rip), %rax     # 0x7aff8
movq (%rax), %rdi
leaq 0x30(%r15), %rdx
movl 0x4(%r15), %ecx
leaq 0x57f0f(%rip), %rsi     # 0x6eab5
xorl %eax, %eax
callq 0x3220
jmp 0x16ade
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, %rax
subq %rdx, %rax
movslq 0x14(%rbp), %rsi
cqto
idivq %rsi
negq %rdx
cmpl $0x0, (%rcx,%rdx)
jg 0x16923
movq 0x40(%rbx), %r8
movq 0x20(%r8), %rdi
leaq 0x57e74(%rip), %rdx     # 0x6ea60
pushq $-0x1
popq %rsi
xorl %eax, %eax
callq *0x8(%r8)
jmp 0x16923
movq 0x40(%rbx), %r8
movq 0x20(%r8), %rdi
leaq 0x57e6e(%rip), %rdx     # 0x6ea77
pushq $-0x1
popq %rsi
movq %r15, %rcx
xorl %eax, %eax
callq *0x8(%r8)
movl (%r15,%r12), %eax
jmp 0x1695d