// File: /workspace/github_c_makefile_star2_O3/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 $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1070
xorl %edx, %edx
leaq 0x4(%rsp), %rcx
movl %edx, (%rcx)
leaq 0x2c(%rsp), %r8
movl %edx, (%r8)
leaq 0x44(%rsp), %r9
movl %edx, (%r9)
movq %r14, %rsi
movq %rax, 0x30(%rsp)
movl %eax, %edx
callq 0x27d4
movl $0x1, %r13d
cmpl $0x2, %eax
jne 0x33d9
leaq 0x1168(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x2(%r14), %rax
movq %rax, 0x50(%rsp)
leaq 0x4(%rsp), %r15
movq 0x30(%rsp), %r13
movq %r14, 0x48(%rsp)
movl 0x4(%rsp), %ebp
movl 0x2c(%rsp), %r12d
movq %r14, %rsi
movl %ebp, %edx
movl %r12d, %ecx
callq 0x2908
cmpl $0x8, %eax
ja 0x2cee
movl %eax, %eax
leaq 0x4578(%rip), %rcx      # 0x70c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movl %ebp, %esi
movl %r12d, %edx
callq 0x297a
testb $0x2, 0x1158(%rbx)
jne 0x2dec
movss %xmm0, 0x14(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1bea
testl %eax, %eax
je 0x3374
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x33eb
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x20(%rbx,%rax,8)
movl $0x1, (%rbx,%rax,8)
jmp 0x30e9
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1bea
testl %eax, %eax
je 0x3374
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
jne 0x2e54
movq %rbx, %rdi
leaq 0x460d(%rip), %rsi      # 0x7201
xorl %eax, %eax
callq 0x1cb9
xorl %eax, %eax
jmp 0x2e65
movl %r12d, %edx
addl $-0x2, %edx
je 0x2f18
shll $0x2, %r12d
addb $-0xc, %r12b
movl $0x1, %eax
movl %r12d, %ecx
shll %cl, %eax
addq 0x50(%rsp), %rbp
movl %edx, %ecx
xorps %xmm1, %xmm1
xorl %edx, %edx
leaq 0x44d9(%rip), %r8       # 0x710c
leaq 0x44ae(%rip), %r9       # 0x70e8
movzbl (%rbp,%rdx), %esi
leal -0x31(%rsi), %edi
cmpl $0x8, %edi
ja 0x2c57
movslq (%r9,%rdi,4), %rsi
addq %r9, %rsi
jmpq *%rsi
movl $0x1, %esi
jmp 0x2ccc
addl $-0x61, %esi
cmpl $0x5, %esi
ja 0x2cca
movslq (%r8,%rsi,4), %rsi
addq %r8, %rsi
jmpq *%rsi
movl $0xa, %esi
jmp 0x2ccc
movl $0x5, %esi
jmp 0x2ccc
movl $0xe, %esi
jmp 0x2ccc
movl $0x3, %esi
jmp 0x2ccc
movl $0xc, %esi
jmp 0x2ccc
movl $0x4, %esi
jmp 0x2ccc
movl $0x8, %esi
jmp 0x2ccc
movl $0xd, %esi
jmp 0x2ccc
movl $0x2, %esi
jmp 0x2ccc
movl $0xb, %esi
jmp 0x2ccc
movl $0x6, %esi
jmp 0x2ccc
movl $0xf, %esi
jmp 0x2ccc
movl $0x7, %esi
jmp 0x2ccc
movl $0x9, %esi
jmp 0x2ccc
xorl %esi, %esi
imull %eax, %esi
xorps %xmm0, %xmm0
cvtsi2ss %esi, %xmm0
addss %xmm0, %xmm1
shrl $0x4, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x2c3a
jmp 0x2f1b
movq %rbx, %rdi
leaq 0x45e8(%rip), %rsi      # 0x72e0
xorl %eax, %eax
callq 0x1cb9
jmp 0x32fd
incl %ebp
addq %r14, %rbp
decl %r12d
movq 0x540(%rbx), %r8
movq %rbp, %rsi
movl %r12d, %edx
leaq 0x20(%rsp), %rcx
callq 0x2413
testl %eax, %eax
je 0x3379
testb $0x2, 0x1158(%rbx)
jne 0x2ec8
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1bea
testl %eax, %eax
je 0x3374
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
jne 0x30b5
movq %rbx, %rdi
leaq 0x4497(%rip), %rsi      # 0x7201
xorl %eax, %eax
callq 0x1cb9
xorl %eax, %eax
jmp 0x30c6
movl 0x1158(%rbx), %r15d
addq %r14, %rbp
testb $0x4, %r15b
jne 0x2e1e
movq 0x540(%rbx), %r8
movq %rbp, %rsi
movl %r12d, %edx
leaq 0x20(%rsp), %rcx
callq 0x2413
testl %eax, %eax
je 0x3382
testb $0x2, %r15b
jne 0x308e
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1bea
testl %eax, %eax
leaq 0x4(%rsp), %r15
je 0x3374
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rdx
movq (%rax), %rsi
movq %rbx, %rdi
movq %rax, 0x18(%rsp)
callq *0x8(%rax)
jmp 0x32fd
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x33eb
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 0x32fd
cmpl $0x1, %r12d
jne 0x3057
cmpb $0x40, (%rbp)
jne 0x3057
movl 0x500(%rbx), %eax
testl %eax, %eax
leaq 0x4(%rsp), %r15
jle 0x3237
decl %eax
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
jmp 0x324b
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
leal -0x1(%r12), %ecx
movl 0x530(%rbx), %esi
movl 0x534(%rbx), %edx
leaq (%rdx,%rcx), %rdi
cmpq %rsi, %rdi
jae 0x2e97
movq %rdx, %r13
addq 0x528(%rbx), %r13
leal 0x1(%rdx), %r15d
addl %edx, %ecx
movl %ecx, 0x534(%rbx)
jmp 0x2e9d
xorl %r13d, %r13d
xorl %r15d, %r15d
addl $-0x2, %r12d
je 0x2f9b
incl %ebp
addq %r14, %rbp
movl %r12d, %ecx
xorl %edx, %edx
movb (%rbp,%rdx), %sil
movb %sil, (%r13,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x2eb1
jmp 0x2f9d
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x33eb
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
movq 0x20(%rsp), %rcx
movq %rcx, 0x18(%rsp)
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 0x32fd
xorps %xmm1, %xmm1
testb $0x2, 0x1158(%rbx)
jne 0x2f70
movss %xmm1, 0x14(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1bea
testl %eax, %eax
je 0x3374
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x33eb
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x20(%rbx,%rax,8)
jmp 0x30e9
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x33eb
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
movss %xmm1, 0x20(%rbx,%rax,8)
jmp 0x32fd
xorl %ecx, %ecx
movb $0x0, (%r13,%rcx)
movl $0x2, 0x8(%rax)
movq %r13, 0x10(%rax)
movl %r15d, 0x18(%rax)
movq 0x1188(%rbx), %rbp
movq 0x8(%rsp), %r12
movl 0x500(%rbx), %eax
testl %eax, %eax
jle 0x2fda
decl %eax
movl %eax, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
jmp 0x2fee
movq %rbx, %rdi
leaq 0x422e(%rip), %rsi      # 0x7212
xorl %eax, %eax
callq 0x1cb9
movq %rbx, %rax
movq (%rbp), %rcx
movq %rcx, (%r12)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%r12)
movups 0x8(%rax), %xmm0
movups %xmm0, 0x8(%r12)
testb $0x2, 0x1158(%rbx)
je 0x3048
movslq 0x500(%rbx), %rax
cmpl 0x504(%rbx), %eax
je 0x33eb
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
movl $0x2, %ecx
movl %ecx, 0x8(%rbx,%rax,8)
movq %r13, 0x10(%rbx,%rax,8)
movl %r15d, 0x18(%rbx,%rax,8)
movl %ecx, (%rbx,%rax,8)
movq 0x30(%rsp), %r13
leaq 0x4(%rsp), %r15
jmp 0x32fd
movq 0x540(%rbx), %r8
movq %rbp, %rsi
movl %r12d, %edx
leaq 0x20(%rsp), %rcx
callq 0x2413
movl %eax, %r13d
movl 0x500(%rbx), %eax
testl %eax, %eax
jle 0x3135
decl %eax
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
jmp 0x3149
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x1ec8
testl %eax, %eax
leaq 0x4(%rsp), %r15
jne 0x32fd
jmp 0x33bc
leal 0x1(%rax), %ecx
movl %ecx, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
movq 0x20(%rsp), %rsi
movq (%rsi), %rcx
movl 0x24(%rcx), %edx
testl %edx, %edx
movq %rsi, 0x18(%rsp)
je 0x3102
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 0x33fc
jmp 0x32fd
movl $0x3, 0x8(%rax)
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %r15
movl 0x500(%rbx), %eax
testl %eax, %eax
jle 0x3320
decl %eax
movl %eax, 0x500(%rbx)
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %rax
jmp 0x3334
movq %rbx, %rdi
leaq 0x40d3(%rip), %rsi      # 0x7212
xorl %eax, %eax
callq 0x1cb9
movq %rbx, %rax
cmpl $0x6, 0x8(%rax)
jne 0x3354
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
testl %r13d, %r13d
jne 0x338b
movl 0x51c(%rbx), %ecx
movl %ecx, 0x14(%rsp)
movl 0x534(%rbx), %ecx
movl %ecx, 0x18(%rsp)
leaq -0x1d01(%rip), %rcx     # 0x147f
movq %rcx, (%rax)
movq 0x38(%rsp), %rsi
movups (%rsi), %xmm0
movups %xmm0, 0x8(%rax)
movq 0x10(%rsi), %rcx
movq %rcx, 0x18(%rax)
xorl %edx, %edx
movl %edx, 0x20(%rax)
movl 0x534(%rbx), %r15d
movq 0x528(%rbx), %r13
leaq (%r15,%r13), %r14
movq %r14, 0x20(%rsp)
leal 0x58(%r15), %ecx
movl %ecx, 0x534(%rbx)
leaq -0x1237(%rip), %rcx     # 0x1f8d
movq %rcx, 0x8(%r13,%r15)
movq %rax, (%r13,%r15)
movups (%rsi), %xmm0
movups %xmm0, 0x10(%r13,%r15)
movq 0x10(%rsi), %rax
movq %rax, 0x20(%r13,%r15)
movl %edx, 0x28(%r13,%r15)
movq %rbx, %rdi
movq %rbp, %rsi
movl %r12d, %edx
movq %r14, %rcx
callq 0x22b4
movl 0x14(%rsp), %eax
decl %eax
movl %eax, 0x2c(%r13,%r15)
movl 0x18(%rsp), %eax
movl %eax, 0x30(%r13,%r15)
movq 0x11f0(%rbx), %rax
movq %rax, 0x50(%r13,%r15)
movq %r14, 0x18(%rsp)
movq %r14, 0x11f0(%rbx)
incl 0x11f8(%rbx)
movq 0x30(%rsp), %r13
leaq 0x4(%rsp), %r15
jmp 0x32f1
movq %rbx, %rdi
leaq 0x3fd1(%rip), %rsi      # 0x7212
xorl %eax, %eax
callq 0x1cb9
movq %rbx, %rax
movq 0x18(%rsp), %r14
cmpl $0x6, 0x8(%rax)
jne 0x3360
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
leaq -0x1deb(%rip), %rcx     # 0x147f
movq %rcx, (%rax)
movq 0x38(%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 0x32b5
movq %rcx, %r14
addq 0x528(%rbx), %r14
movq %r14, 0x20(%rsp)
addl $0x58, %ecx
movl %ecx, 0x534(%rbx)
leaq -0x132f(%rip), %rcx     # 0x1f8d
movq %rcx, 0x8(%r14)
movq %rax, (%r14)
movq 0x38(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x10(%r14)
movq 0x10(%rax), %rax
movq %rax, 0x20(%r14)
movl $0x0, 0x28(%r14)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %rax, 0x14a8(%rbx)
andb $-0x5, 0x1158(%rbx)
movq 0x48(%rsp), %r14
movq %r14, %rsi
movl %r13d, %edx
movq %r15, %rcx
leaq 0x2c(%rsp), %r8
leaq 0x44(%rsp), %r9
callq 0x27d4
cmpl $0x2, %eax
je 0x2b24
jmp 0x336c
movq %rbx, %rdi
leaq 0x3ee8(%rip), %rsi      # 0x7212
xorl %eax, %eax
callq 0x1cb9
movq %rbx, %rax
leaq 0xc82(%rip), %rcx       # 0x3fbd
movq %rcx, (%r15)
movups 0x8(%rax), %xmm0
movups %xmm0, 0x8(%r15)
movq 0x18(%rax), %rax
movq %rax, 0x18(%r15)
jmp 0x304d
callq 0x1201
xorl %eax, %eax
jmp 0x3157
callq 0x121d
xorl %eax, %eax
jmp 0x325e
movl $0x1, %r13d
jmp 0x33d9
xorl %r13d, %r13d
jmp 0x33d9
leaq 0x3ee8(%rip), %rsi      # 0x7268
jmp 0x33c3
leaq 0x3f36(%rip), %rsi      # 0x72bf
jmp 0x33c3
leaq 0x3ef3(%rip), %rsi      # 0x7285
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r12d, %edx
movl %r12d, %ecx
movq %rbp, %r8
xorl %eax, %eax
callq 0x1cb9
movl 0x1158(%rbx), %eax
andl $-0x7, %eax
orl $0x2, %eax
movl %eax, 0x1158(%rbx)
jmp 0x33d9
leaq 0x3ee3(%rip), %rsi      # 0x72a6
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r12d, %edx
movl %r12d, %ecx
movq %rbp, %r8
xorl %eax, %eax
callq 0x1cb9
movl %r13d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3e0f(%rip), %rsi      # 0x7201
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1cb9