// File: /workspace/github_c_makefile_star2_O1/MuvikLabs[P]runt/runt.c
// Function: runt_compile
runt_int runt_compile(runt_vm *vm, const char *str)
{
    runt_uint size = strlen(str);
    runt_uint pos = 0;
    runt_uint word_size = 0;
    runt_uint next = 0;
    runt_stacklet *s;
    runt_cell *tmp;
    runt_entry *entry;
    runt_ptr ptr;
    runt_uint c, m;
    float val = 0.0;

    runt_int rc = RUNT_OK;

    while(runt_tokenize(vm, str, size, &pos, &word_size, &next) == RUNT_CONTINUE)
    {
        switch(runt_lex(vm, str, pos, word_size)) {
            case RUNT_FLOAT:

                val = runt_atof(str, pos, word_size);
                if(!(vm->status & RUNT_MODE_INTERACTIVE)) {
                    if(runt_cell_new(vm, &tmp) == 0) return RUNT_NOT_OK;
                    /* this needs to happen after runt_new_cell */
                    s = runt_push(vm);
                    s->f = val;
                    s->t = RUNT_FLOAT;
                    runt_copy_float(vm, vm->f_cell, tmp);
                } else {
                    s = runt_push(vm);
                    s->f = val;
                    s->t = RUNT_FLOAT;
                }

                break;
            case RUNT_HEX:
                val = hex2flt(vm, str, pos, word_size);
                if(!(vm->status & RUNT_MODE_INTERACTIVE)) {
                    if(runt_cell_new(vm, &tmp) == 0) return RUNT_NOT_OK;
                    /* this needs to happen after runt_new_cell */
                    s = runt_push(vm);
                    s->f = val;
                    runt_copy_float(vm, vm->f_cell, tmp);
                } else {
                    s = runt_push(vm);
                    s->f = val;
                }
                break;
            case RUNT_STRING:
                if(runt_cell_new(vm, &tmp) == 0) return RUNT_NOT_OK;
                s = runt_push(vm);
                ptr = runt_mk_string(vm, &str[pos + 1], word_size - 2);
                s->p = ptr;
                runt_copy_string(vm, vm->s_cell, tmp);
                if(vm->status & RUNT_MODE_INTERACTIVE) {
                    s = runt_push(vm);
                    s->p = ptr;
                    s->t = RUNT_STRING;
                }
                break;
            case RUNT_WORD:
                if(runt_word_search(vm,
                            &str[pos + 1],
                            word_size - 1,
                            &entry) == RUNT_NOT_OK) {
                    runt_print(vm, "Could not find word '%*.*s'\n",
                               word_size - 1,
                               word_size - 1,
                               &str[pos + 1]);
                    return RUNT_NOT_OK;
                }
                if(!(vm->status & RUNT_MODE_INTERACTIVE)) {
                    if(runt_cell_new(vm, &tmp) == 0) return RUNT_NOT_OK;
                    s = runt_push(vm);
                    if(entry->cell->id > 0) {
                        s->f = entry->cell->id;
                        runt_copy_float(vm, vm->f_cell, tmp);
                    } else {
                        s->p = runt_mk_cptr(vm, entry->cell);
                        runt_copy_cell(vm, tmp);
                    }
                } else {
                    s = runt_push(vm);
                    s->f = entry->cell->id;
                    s->p = runt_mk_cptr(vm, entry->cell);
                }

                break;
            case RUNT_PROC:
                if(vm->status & RUNT_MODE_KEYWORD) {

                    if(str[pos] == '@' && word_size == 1) {
                        s = runt_peak(vm);
                        tmp = runt_to_cell(s->p);
                        runt_cell_clear(vm, tmp);
                        runt_entry_create(vm, tmp, &entry);
                        vm->anon = entry;
                    } else {
                        rc = runt_word_search(vm, &str[pos], word_size, &entry);

                        s = runt_peak(vm);
                        tmp = runt_to_cell(s->p);

                        if(rc == RUNT_OK) {
                            runt_print(vm,
                                "Word '%*.*s' previously defined\n",
                                word_size, word_size, &str[pos]);

                            /* on failure, break to interactive mode */
                            runt_set_state(vm, RUNT_MODE_KEYWORD, RUNT_OFF);
                            runt_set_state(vm, RUNT_MODE_INTERACTIVE, RUNT_ON);
                            return RUNT_NOT_OK;
                        } else {
                            c = runt_cell_pool_used(vm);
                            m = runt_memory_pool_used(vm);
                            entry = NULL;
                            runt_cell_clear(vm, tmp);
                            runt_entry_create(vm, tmp, &entry);
                            runt_word(vm, &str[pos], word_size, entry);
                            runt_word_last_defined(vm, entry, c - 1, m);
                        }
                    }

                    runt_set_state(vm, RUNT_MODE_KEYWORD, RUNT_OFF);
                    break;
                }

                if(runt_word_search(vm, &str[pos], word_size, &entry) == RUNT_OK) {
                    if(vm->status & RUNT_MODE_INTERACTIVE) {
                        if(runt_entry_exec(vm, entry) == RUNT_NOT_OK) {
                            runt_print(vm, "Error with word '%*.*s'\n",
                                    word_size, word_size, &str[pos]);
                            return RUNT_NOT_OK;
                        }

                    } else {
                        if(runt_cell_new(vm, &tmp) == 0) return RUNT_NOT_OK;
                        runt_entry_copy(vm, entry, tmp);
                    }
                } else {
                    /*TODO: cleaner error reporting */
                    runt_print(vm, "Could not find function '%*.*s'\n",
                            word_size, word_size, str + pos);
                    return RUNT_NOT_OK;
                }
                break;

            case RUNT_NIL:
                break;
            default:
                runt_print(vm, "UNKOWN TYPE\n");
        }
    }
    return RUNT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1070
movq %rax, %rdx
xorl %eax, %eax
leaq 0x24(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x20(%rsp), %r8
movl %eax, (%r8)
leaq 0x34(%rsp), %r9
movl %eax, (%r9)
movq %r14, %rsi
movq %rdx, 0x40(%rsp)
callq 0x2894
movl $0x1, %r12d
cmpl $0x2, %eax
jne 0x3493
leaq 0x1168(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0x2(%r14), %rax
movq %rax, 0x38(%rsp)
movl 0x24(%rsp), %r13d
movl 0x20(%rsp), %ebp
movq %r14, %rsi
movl %r13d, %edx
movl %ebp, %ecx
callq 0x29e1
cmpl $0x8, %eax
ja 0x2dd7
movl %eax, %eax
leaq 0x448d(%rip), %rcx      # 0x70c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0x2a77
testb $0x2, 0x1158(%rbx)
jne 0x2ec9
movss %xmm0, 0x1c(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1c27
testl %eax, %eax
je 0x3432
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x34a5
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x20(%rbx,%rax,8)
movl $0x1, (%rbx,%rax,8)
jmp 0x31a6
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1c27
testl %eax, %eax
je 0x3432
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
jne 0x2f30
movq %rbx, %rdi
leaq 0x4522(%rip), %rsi      # 0x7201
xorl %eax, %eax
callq 0x1cfe
xorl %eax, %eax
jmp 0x2f41
movl %ebp, %edx
addl $-0x2, %edx
je 0x3028
shll $0x2, %ebp
addb $-0xc, %bpl
movl $0x1, %eax
movl %ebp, %ecx
shll %cl, %eax
addq 0x38(%rsp), %r13
movl %edx, %ecx
xorps %xmm1, %xmm1
xorl %edx, %edx
leaq 0x43f1(%rip), %r8       # 0x710c
leaq 0x43c6(%rip), %r9       # 0x70e8
movzbl (%r13,%rdx), %esi
leal -0x31(%rsi), %edi
cmpl $0x8, %edi
ja 0x2d40
movslq (%r9,%rdi,4), %rsi
addq %r9, %rsi
jmpq *%rsi
movl $0x1, %esi
jmp 0x2db5
addl $-0x61, %esi
cmpl $0x5, %esi
ja 0x2db3
movslq (%r8,%rsi,4), %rsi
addq %r8, %rsi
jmpq *%rsi
movl $0xa, %esi
jmp 0x2db5
movl $0x5, %esi
jmp 0x2db5
movl $0xe, %esi
jmp 0x2db5
movl $0x3, %esi
jmp 0x2db5
movl $0xc, %esi
jmp 0x2db5
movl $0x4, %esi
jmp 0x2db5
movl $0x8, %esi
jmp 0x2db5
movl $0xd, %esi
jmp 0x2db5
movl $0x2, %esi
jmp 0x2db5
movl $0xb, %esi
jmp 0x2db5
movl $0x6, %esi
jmp 0x2db5
movl $0xf, %esi
jmp 0x2db5
movl $0x7, %esi
jmp 0x2db5
movl $0x9, %esi
jmp 0x2db5
xorl %esi, %esi
imull %eax, %esi
xorps %xmm0, %xmm0
cvtsi2ss %esi, %xmm0
addss %xmm0, %xmm1
shrl $0x4, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x2d22
jmp 0x302b
movq %rbx, %rdi
leaq 0x44ff(%rip), %rsi      # 0x72e0
xorl %eax, %eax
callq 0x1cfe
jmp 0x33eb
incl %r13d
addq %r14, %r13
decl %ebp
movq 0x540(%rbx), %r8
movq %r13, %rsi
movl %ebp, %edx
leaq 0x10(%rsp), %rcx
callq 0x2477
testl %eax, %eax
je 0x3437
testb $0x2, 0x1158(%rbx)
jne 0x2fdd
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1c27
testl %eax, %eax
je 0x3432
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
jne 0x3177
movq %rbx, %rdi
leaq 0x43af(%rip), %rsi      # 0x7201
xorl %eax, %eax
callq 0x1cfe
xorl %eax, %eax
jmp 0x3188
movl 0x1158(%rbx), %r15d
addq %r14, %r13
testb $0x4, %r15b
jne 0x2efb
movq 0x540(%rbx), %r8
movq %r13, %rsi
movl %ebp, %edx
leaq 0x10(%rsp), %rcx
callq 0x2477
testl %eax, %eax
je 0x3440
testb $0x2, %r15b
jne 0x315a
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1c27
testl %eax, %eax
je 0x3432
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rdx
movq (%rax), %rsi
movq %rbx, %rdi
callq *0x8(%rax)
jmp 0x33eb
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x34a5
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
movss %xmm0, 0x20(%rbx,%rax,8)
movl $0x1, (%rbx,%rax,8)
jmp 0x33eb
cmpl $0x1, %ebp
jne 0x3120
cmpb $0x40, (%r13)
jne 0x3120
movslq 0x500(%rbx), %rax
testq %rax, %rax
jle 0x3305
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
addq $-0x28, %rax
jmp 0x3319
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
leal -0x1(%rbp), %ecx
movl 0x530(%rbx), %esi
movl 0x534(%rbx), %edx
leaq (%rdx,%rcx), %rdi
cmpq %rsi, %rdi
jae 0x2f71
movq %rdx, %r12
addq 0x528(%rbx), %r12
leal 0x1(%rdx), %r15d
addl %edx, %ecx
movl %ecx, 0x534(%rbx)
jmp 0x2f77
xorl %r12d, %r12d
xorl %r15d, %r15d
addl $-0x2, %ebp
movl %ebp, %ecx
je 0x2f97
incl %r13d
addq %r14, %r13
xorl %edx, %edx
movb (%r13,%rdx), %sil
movb %sil, (%r12,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x2f86
movb $0x0, (%r12,%rcx)
movl $0x2, 0x8(%rax)
movq %r12, 0x10(%rax)
movl %r15d, 0x18(%rax)
movq 0x1188(%rbx), %rbp
movq 0x8(%rsp), %r13
movslq 0x500(%rbx), %rax
testq %rax, %rax
jle 0x30ab
decq %rax
movl %eax, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
jmp 0x30bf
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x34a5
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movl 0x24(%rcx), %edx
xorps %xmm0, %xmm0
cvtsi2ss %rdx, %xmm0
leaq (%rax,%rax,4), %rax
movss %xmm0, 0x20(%rbx,%rax,8)
movl $0x3, 0x8(%rbx,%rax,8)
movq %rcx, 0x10(%rbx,%rax,8)
jmp 0x33eb
xorps %xmm1, %xmm1
testb $0x2, 0x1158(%rbx)
jne 0x3080
movss %xmm1, 0x1c(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1c27
testl %eax, %eax
je 0x3432
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x34a5
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x20(%rbx,%rax,8)
jmp 0x31a6
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x34a5
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
movss %xmm1, 0x20(%rbx,%rax,8)
jmp 0x33eb
movq %rbx, %rdi
leaq 0x415d(%rip), %rsi      # 0x7212
xorl %eax, %eax
callq 0x1cfe
movq %rbx, %rax
movq (%rbp), %rcx
movq %rcx, (%r13)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%r13)
movups 0x8(%rax), %xmm0
movups %xmm0, 0x8(%r13)
testb $0x2, 0x1158(%rbx)
je 0x33eb
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x34a5
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
movl $0x2, %ecx
movl %ecx, 0x8(%rbx,%rax,8)
movq %r12, 0x10(%rbx,%rax,8)
movl %r15d, 0x18(%rbx,%rax,8)
movl %ecx, (%rbx,%rax,8)
jmp 0x33eb
movq 0x540(%rbx), %r8
movq %r13, %rsi
movl %ebp, %edx
leaq 0x10(%rsp), %rcx
callq 0x2477
movl %eax, %r12d
movslq 0x500(%rbx), %rax
testq %rax, %rax
jle 0x31f5
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
addq $-0x28, %rax
jmp 0x3209
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x1f14
testl %eax, %eax
jne 0x33eb
jmp 0x3478
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movl 0x24(%rcx), %edx
testl %edx, %edx
je 0x31bf
movl %edx, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
movss %xmm0, 0x20(%rax)
movq 0x1180(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x34b6
jmp 0x33eb
movl $0x3, 0x8(%rax)
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %r15
movslq 0x500(%rbx), %rax
testq %rax, %rax
jle 0x33bc
decq %rax
movl %eax, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
jmp 0x33d0
movq %rbx, %rdi
leaq 0x4013(%rip), %rsi      # 0x7212
xorl %eax, %eax
callq 0x1cfe
movq %rbx, %rax
cmpl $0x6, 0x8(%rax)
jne 0x3412
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
testl %r12d, %r12d
jne 0x3449
movl 0x51c(%rbx), %r15d
movl 0x534(%rbx), %ecx
movl %ecx, 0x1c(%rsp)
movq $0x0, 0x10(%rsp)
leaq -0x1db3(%rip), %rcx     # 0x1493
movq %rcx, (%rax)
movq 0x28(%rsp), %rcx
movups (%rcx), %xmm0
movups %xmm0, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x18(%rax)
movl $0x0, 0x20(%rax)
movl 0x530(%rbx), %edx
movl 0x534(%rbx), %ecx
leaq 0x58(%rcx), %rsi
cmpq %rdx, %rsi
jae 0x3291
movq %rcx, %rdx
addq 0x528(%rbx), %rdx
movq %rdx, 0x10(%rsp)
addl $0x58, %ecx
movl %ecx, 0x534(%rbx)
movq 0x10(%rsp), %r12
leaq -0x12b2(%rip), %rcx     # 0x1feb
movq %rcx, 0x8(%r12)
movq %rax, (%r12)
movq 0x28(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x10(%r12)
movq 0x10(%rax), %rax
movq %rax, 0x20(%r12)
movl $0x0, 0x28(%r12)
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %edx
movq %r12, %rcx
callq 0x2313
decl %r15d
movl %r15d, 0x2c(%r12)
movl 0x1c(%rsp), %eax
movl %eax, 0x30(%r12)
movq 0x11f0(%rbx), %rax
movq %rax, 0x50(%r12)
movq %r12, 0x11f0(%rbx)
incl 0x11f8(%rbx)
jmp 0x33b3
movq %rbx, %rdi
leaq 0x3f03(%rip), %rsi      # 0x7212
xorl %eax, %eax
callq 0x1cfe
movq %rbx, %rax
cmpl $0x6, 0x8(%rax)
jne 0x341e
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
leaq -0x1ea0(%rip), %rcx     # 0x1493
movq %rcx, (%rax)
movq 0x28(%rsp), %rcx
movups (%rcx), %xmm0
movups %xmm0, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x18(%rax)
movl $0x0, 0x20(%rax)
movl 0x530(%rbx), %edx
movl 0x534(%rbx), %ecx
leaq 0x58(%rcx), %rsi
cmpq %rdx, %rsi
jae 0x337e
movq %rcx, %rdx
addq 0x528(%rbx), %rdx
movq %rdx, 0x10(%rsp)
addl $0x58, %ecx
movl %ecx, 0x534(%rbx)
movq 0x10(%rsp), %rcx
leaq -0x139f(%rip), %rdx     # 0x1feb
movq %rdx, 0x8(%rcx)
movq %rax, (%rcx)
movq 0x28(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x10(%rcx)
movq 0x10(%rax), %rax
movq %rax, 0x20(%rcx)
movl $0x0, 0x28(%rcx)
movq %rcx, 0x14a8(%rbx)
andb $-0x5, 0x1158(%rbx)
jmp 0x33eb
movq %rbx, %rdi
leaq 0x3e4c(%rip), %rsi      # 0x7212
xorl %eax, %eax
callq 0x1cfe
movq %rbx, %rax
leaq 0xd5d(%rip), %rcx       # 0x4134
movq %rcx, (%r15)
movups 0x8(%rax), %xmm0
movups %xmm0, 0x8(%r15)
movq 0x18(%rax), %rax
movq %rax, 0x18(%r15)
movq %r14, %rsi
movq 0x40(%rsp), %rdx
leaq 0x24(%rsp), %rcx
leaq 0x20(%rsp), %r8
leaq 0x34(%rsp), %r9
callq 0x2894
cmpl $0x2, %eax
je 0x2c0f
jmp 0x342a
callq 0x1201
xorl %eax, %eax
jmp 0x3217
callq 0x121d
xorl %eax, %eax
jmp 0x3327
movl $0x1, %r12d
jmp 0x3493
xorl %r12d, %r12d
jmp 0x3493
leaq 0x3e2a(%rip), %rsi      # 0x7268
jmp 0x347f
leaq 0x3e78(%rip), %rsi      # 0x72bf
jmp 0x347f
leaq 0x3e35(%rip), %rsi      # 0x7285
xorl %r12d, %r12d
movq %rbx, %rdi
movl %ebp, %edx
movl %ebp, %ecx
movq %r13, %r8
xorl %eax, %eax
callq 0x1cfe
movl 0x1158(%rbx), %eax
andl $-0x7, %eax
orl $0x2, %eax
movl %eax, 0x1158(%rbx)
jmp 0x3493
leaq 0x3e27(%rip), %rsi      # 0x72a6
xorl %r12d, %r12d
movq %rbx, %rdi
movl %ebp, %edx
movl %ebp, %ecx
movq %r13, %r8
xorl %eax, %eax
callq 0x1cfe
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3d55(%rip), %rsi      # 0x7201
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1cfe