// File: /workspace/github_c_makefile_star2_O3/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
pushq %rax
movq %rdi, %rbp
movq 0x8(%rdi), %rax
movq 0x10(%rax), %rsi
cmpq %rsi, 0x18(%rdi)
ja 0x1b72d
movq 0x20(%rbp), %rax
testq %rax, %rax
setne %cl
cmpq %rsi, %rax
setbe %al
testb %al, %cl
jne 0x1b72d
movq 0x10(%rbp), %r14
testq %r14, %r14
je 0x1b72d
leaq 0x30(%r14), %rcx
cmpq %rsi, %rcx
ja 0x1b727
cmpq %rsi, 0x28(%r14)
ja 0x1ba07
movq 0x20(%r14), %r14
jmp 0x1b70f
movq 0x80(%rbp), %rcx
movq 0x20(%rcx), %rdi
leaq 0x5f979(%rip), %rdx     # 0x7b0b8
xorl %r14d, %r14d
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq *0x8(%rcx)
movq 0x8(%rbp), %rax
movq 0x10(%rax), %r15
movq %r15, %rax
subq %r14, %rax
addq $-0x30, %rax
movslq 0x14(%r14), %rcx
cqto
idivq %rcx
movq %rdx, %r12
movq %r15, %rax
subq %rdx, %rax
negq %r12
movl (%rax), %eax
testl %eax, %eax
jle 0x1ba30
cmpl %eax, 0x4(%r14)
jl 0x1ba30
movq 0x10(%r15,%r12), %rcx
testq %rcx, %rcx
je 0x1b7fd
cmpl $0x1, %eax
jne 0x1b7fd
movq $0x2, 0x6bacf(%rip) # 0x87270
leaq 0x6bac8(%rip), %rax     # 0x87270
movq $0x1, 0x6bacd(%rip) # 0x87280
movq $0x0, 0x6baba(%rip) # 0x87278
xorps %xmm0, %xmm0
movups %xmm0, 0x6bac0(%rip)    # 0x87288
movq %rax, 0x6bad1(%rip)     # 0x872a0
movq %r15, 0x6baea(%rip)     # 0x872c0
leaq 0x6bae3(%rip), %rdi     # 0x872c0
movq 0x40(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x6badc(%rip)     # 0x872c8
leaq 0x6bad5(%rip), %rsi     # 0x872c8
callq *%rcx
decl 0x10(%r14)
movl (%r15,%r12), %eax
decl %eax
movl %eax, (%r15,%r12)
movl 0x4(%r14), %eax
decl %eax
movl %eax, 0x4(%r14)
movq 0x38(%rbp), %rbx
cmpq %r15, 0x18(%rbx)
ja 0x1b8a4
movslq 0x28(%rbx), %rcx
shlq $0x3, %rcx
addq 0x10(%rbx), %rcx
cmpq %r15, %rcx
jbe 0x1b8a4
movq 0x20(%rbx), %r13
movq -0x10(%r13), %rcx
movq 0x10(%rcx), %rcx
leaq 0x8(,%rcx,8), %rcx
addq %r13, %rcx
cmpq %r15, %rcx
jae 0x1b8a0
leaq 0x8(%r13), %rax
leaq 0x40(%rbp), %r12
movq 0x10(%rbx), %rcx
movslq 0x28(%rbx), %rdx
leaq (%rcx,%rdx,8), %rcx
addq $-0x8, %rcx
cmpq %rcx, %r13
je 0x1b892
movl (%rax), %eax
notl %eax
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0x1b892
movq (%r13), %r13
movq -0x10(%r13), %rcx
leaq 0x8(%r13), %rax
movq 0x10(%rcx), %rcx
leaq 0x8(,%rcx,8), %rcx
addq %r13, %rcx
cmpq %r15, %rcx
jb 0x1b850
jmp 0x1b89c
movq %r12, %rdi
callq 0x34d5
jmp 0x1b874
movl 0x4(%r14), %eax
decq -0x8(%r13)
testl %eax, %eax
jne 0x1b8ec
movslq 0x8(%r14), %rax
movslq 0x14(%r14), %rcx
imulq %rax, %rcx
subq %rcx, 0x30(%rbp)
cmpq %r14, 0x10(%rbp)
jne 0x1b8c6
movq 0x20(%r14), %rax
movq %rax, 0x10(%rbp)
movq 0x18(%r14), %rcx
movq 0x20(%r14), %rax
testq %rcx, %rcx
je 0x1b8d7
movq %rax, 0x20(%rcx)
testq %rax, %rax
je 0x1b8e4
movq 0x18(%r14), %rcx
movq %rcx, 0x18(%rax)
movq %r14, %rdi
callq 0x3040
movq 0x10(%rbp), %r13
testq %r13, %r13
je 0x1b9f8
movq %rbp, %r14
movb 0x70(%rbp), %al
movb %al, 0x7(%rsp)
leaq 0x6b9be(%rip), %r15     # 0x872c8
movq %r13, %r12
movq 0x20(%r13), %r13
cmpb $0x0, 0x7(%rsp)
jne 0x1b9eb
movl 0xc(%r12), %eax
testl %eax, %eax
jle 0x1b9d8
leaq 0x30(%r12), %rbx
movl 0x10(%r12), %ecx
xorl %ebp, %ebp
testl %ecx, %ecx
jle 0x1b9d8
movslq 0x14(%r12), %rsi
movslq %ebp, %rdx
imulq %rsi, %rdx
cmpl $0x0, 0x30(%r12,%rdx)
je 0x1b9ce
addq %rbx, %rdx
movq 0x10(%rdx), %r8
testq %r8, %r8
je 0x1b9ce
addq $0x28, %rdx
movq $0x2, 0x6b904(%rip) # 0x87270
movq $0x1, 0x6b909(%rip) # 0x87280
movq $0x0, 0x6b8f6(%rip) # 0x87278
xorps %xmm0, %xmm0
movups %xmm0, 0x6b8fc(%rip)    # 0x87288
leaq 0x6b8dd(%rip), %rax     # 0x87270
movq %rax, 0x6b906(%rip)     # 0x872a0
movq %rdx, 0x6b91f(%rip)     # 0x872c0
movq 0x40(%r14), %rax
movq 0x20(%rax), %rax
movq %rax, 0x6b918(%rip)     # 0x872c8
leaq 0x6b909(%rip), %rdi     # 0x872c0
movq %r15, %rsi
callq *%r8
movl 0xc(%r12), %eax
movl 0x10(%r12), %ecx
decl %ecx
movl %ecx, 0x10(%r12)
incl %ebp
cmpl %eax, %ebp
jl 0x1b935
movq %r12, %rdi
callq 0x3040
testq %r13, %r13
jne 0x1b90a
jmp 0x1b9f8
movq %r12, %rdi
callq 0x34ee
jmp 0x1b91c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rax
subq %rcx, %rax
movslq 0x14(%r14), %rcx
cqto
idivq %rcx
negq %rdx
cmpl $0x0, (%rsi,%rdx)
jg 0x1b74c
movq %rbp, %rdi
callq 0x34b7
jmp 0x1b74c
movq 0x40(%rbp), %r8
movq 0x20(%r8), %rdi
leaq 0x5f740(%rip), %rdx     # 0x7b17f
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r15, %rcx
xorl %eax, %eax
callq *0x8(%r8)
movl (%r15,%r12), %eax
jmp 0x1b787