// File: /workspace/github_c_makefile_star2_O2/MuvikLabs[P]runt/basic.c
// Function: runt_load_basic
runt_int runt_load_basic(runt_vm *vm)
{
    /* quit function for interactive mode */
    runt_keyword_define(vm, "quit", 4, rproc_quit, NULL);
    /* say: prints string */
    runt_keyword_define(vm, "say", 3, rproc_say, NULL);
    /* p: prints float*/
    runt_keyword_define(vm, "p", 1, rproc_print, NULL);
    /* arithmetic */
    runt_keyword_define(vm, "+", 1, rproc_add, NULL);
    runt_keyword_define(vm, "-", 1, rproc_sub, NULL);
    runt_keyword_define(vm, "*", 1, rproc_mul, NULL);
    runt_keyword_define(vm, "/", 1, rproc_div, NULL);

    /* stack operations */
    runt_keyword_define(vm, "dup", 3, rproc_dup, NULL);
    runt_keyword_define(vm, "swap", 4, rproc_swap, NULL);
    runt_keyword_define(vm, "drop", 4, rproc_drop, NULL);
    runt_keyword_define(vm, "peak", 4, rproc_peak, NULL);
    runt_keyword_define(vm, "rot", 3, rproc_rot, NULL);
    runt_keyword_define(vm, "n", 1, rproc_nitems, NULL);
    runt_keyword_define(vm, "rat", 3, rproc_rat, NULL);
    runt_keyword_define(vm, "drops", 5, rproc_drops, NULL);
    runt_keyword_define(vm, "over", 4, rproc_over, NULL);

    /* dynamic plugin loading */

    runt_keyword_define(vm, "dynload", 7, rproc_dynload, NULL);

    /* regular dictionary load */
    runt_keyword_define(vm, "load", 4, rproc_load, NULL);

    /* evaluates a file */
    runt_keyword_define(vm, "eval", 4, rproc_eval, NULL);

    /* conditionals */

    runt_keyword_define(vm, "<", 1, rproc_lt, NULL);
    runt_keyword_define(vm, ">", 1, rproc_gt, NULL);
    runt_keyword_define(vm, "=", 1, rproc_eq, NULL);
    runt_keyword_define(vm, "!=", 2, rproc_neq, NULL);

    /* control */

    load_control(vm);

    runt_keyword_define(vm, "dec", 3, rproc_decr, NULL);
    runt_keyword_define(vm, "decn", 4, rproc_decrn, NULL);
    runt_keyword_define(vm, "inc", 3, rproc_incr, NULL);
    runt_keyword_define(vm, "incn", 4, rproc_incrn, NULL);
    runt_keyword_define(vm, "rep", 3, rproc_rep, NULL);

    runt_keyword_define_with_copy(vm, "loop", 4, rproc_loop,
    rproc_call_copy, NULL);

    /* variables */
    runt_keyword_define(vm, "set", 3, rproc_set, NULL);
    runt_keyword_define_with_copy(vm, "ptr", 3, rproc_ptr, rproc_call_copy, NULL);
    runt_keyword_define_with_copy(vm, "setptr", 6, rproc_setptr, rproc_call_copy, NULL);

    /* clear: clears pools and reloads basic library */
    runt_keyword_define(vm, "clear", 5, rproc_clear, NULL);

    /* print usage */
    runt_keyword_define(vm, "u", 1, rproc_usage, NULL);
    /* get memory usage */
    runt_keyword_define(vm, "m", 1, rproc_mem, NULL);
    /* get cell usage */
    runt_keyword_define(vm, "c", 1, rproc_cells, NULL);

    /* stack bias/unbias */
    runt_keyword_define(vm, "bias", 4, rproc_bias, NULL);
    runt_keyword_define(vm, "unbias", 6, rproc_unbias, NULL);

    /* list words in dictionary */
    runt_keyword_define(vm, "w", 1, rproc_wordlist, NULL);

    /* random number generator */
    srand(time(NULL));
    runt_keyword_define(vm, "rnd", 3, rproc_rand, NULL);
    runt_keyword_define(vm, "urnd", 4, rproc_urand, NULL);

    /* proc size */
    runt_keyword_define(vm, "psize", 5, rproc_psize, NULL);

    /* restore returns the cell + memory pools to a given position */
    runt_keyword_define(vm, "restore", 7, rproc_restore, NULL);

    /* blocks */
    runt_keyword_define_with_copy(vm, "{", 1,
        rproc_block_begin, rcopy_block_begin, NULL);
    runt_keyword_define_with_copy(vm, "}", 1,
        vm->zproc, rcopy_block_end, NULL);

    /* command line arguments */
    runt_keyword_define(vm, "argv", 4, rproc_argv, NULL);
    runt_keyword_define(vm, "argc", 4, rproc_argc, NULL);

    /* dictionary swaps */
    runt_keyword_define(vm, "dnew", 4, rproc_dnew, NULL);
    runt_keyword_define(vm, "dset", 4, rproc_dset, NULL);
    runt_keyword_define(vm, "dswap", 5, rproc_dswap, NULL);

    /* add destructor */
    runt_keyword_define(vm, "dtor", 4, rproc_dtor, NULL);

    /* undo last word defined */
    runt_keyword_define(vm, "oops", 4, rproc_oops, NULL);

    /* key: wait for keypress */
    runt_keyword_define(vm, "key", 3, rproc_key, NULL);

    /* register operations */
    runt_keyword_define(vm, "regset", 6, rproc_regset, NULL);
    runt_keyword_define(vm, "regget", 6, rproc_regget, NULL);

    /* get anonymous cell position */

    runt_keyword_define(vm, "@", 1, rproc_anon, NULL);

    return runt_is_alive(vm);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2ec3(%rip), %rsi      # 0x6364
leaq 0x65c(%rip), %rcx       # 0x3b04
pushq $0x4
popq %r14
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2eab(%rip), %rsi      # 0x6369
leaq 0x650(%rip), %rcx       # 0x3b15
pushq $0x3
popq %r15
movq %rbx, %rdi
movl %r15d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2f2e(%rip), %rsi      # 0x640c
leaq 0x67f(%rip), %rcx       # 0x3b64
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2e71(%rip), %rsi      # 0x636d
leaq 0x69f(%rip), %rcx       # 0x3ba2
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2e58(%rip), %rsi      # 0x636f
leaq 0x702(%rip), %rcx       # 0x3c20
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2e3f(%rip), %rsi      # 0x6371
leaq 0x724(%rip), %rcx       # 0x3c5d
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2e26(%rip), %rsi      # 0x6373
leaq 0x746(%rip), %rcx       # 0x3c9a
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2e0d(%rip), %rsi      # 0x6375
leaq 0x768(%rip), %rcx       # 0x3cd7
movq %rbx, %rdi
movl %r15d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2e85(%rip), %rsi      # 0x6409
leaq 0x751(%rip), %rcx       # 0x3cdc
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2dd9(%rip), %rsi      # 0x6379
leaq 0x73a(%rip), %rcx       # 0x3ce1
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2dc2(%rip), %rsi      # 0x637e
leaq 0x729(%rip), %rcx       # 0x3cec
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2dab(%rip), %rsi      # 0x6383
leaq 0x76d(%rip), %rcx       # 0x3d4c
movq %rbx, %rdi
movl %r15d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2dbd(%rip), %rsi      # 0x63b1
leaq 0x84b(%rip), %rcx       # 0x3e46
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2d78(%rip), %rsi      # 0x6387
leaq 0x86e(%rip), %rcx       # 0x3e84
movq %rbx, %rdi
movl %r15d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2d60(%rip), %rsi      # 0x638b
leaq 0x94c(%rip), %rcx       # 0x3f7e
pushq $0x5
popq %rdx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0x179f
leaq 0x2d4a(%rip), %rsi      # 0x6391
leaq 0x969(%rip), %rcx       # 0x3fb7
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2d33(%rip), %rsi      # 0x6396
leaq 0x998(%rip), %rcx       # 0x4002
pushq $0x7
popq %rdx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0x179f
leaq 0x2d1a(%rip), %rsi      # 0x6399
leaq 0xa26(%rip), %rcx       # 0x40ac
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2d03(%rip), %rsi      # 0x639e
leaq 0xb5d(%rip), %rcx       # 0x41ff
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2cec(%rip), %rsi      # 0x63a3
leaq 0xba4(%rip), %rcx       # 0x4262
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2cd3(%rip), %rsi      # 0x63a5
leaq 0xbe0(%rip), %rcx       # 0x42b9
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2cbb(%rip), %rsi      # 0x63a8
leaq 0xc13(%rip), %rcx       # 0x4307
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2c9f(%rip), %rsi      # 0x63a7
leaq 0xc46(%rip), %rcx       # 0x4355
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0x179f
movq %rbx, %rdi
callq 0x43a3
leaq 0x2c7e(%rip), %rsi      # 0x63aa
leaq 0xd01(%rip), %rcx       # 0x4434
movq %rbx, %rdi
movl %r15d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2c66(%rip), %rsi      # 0x63ae
leaq 0xd11(%rip), %rcx       # 0x4460
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2c4f(%rip), %rsi      # 0x63b3
leaq 0xd44(%rip), %rcx       # 0x44af
movq %rbx, %rdi
movl %r15d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2c37(%rip), %rsi      # 0x63b7
leaq 0xd45(%rip), %rcx       # 0x44cc
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2c20(%rip), %rsi      # 0x63bc
leaq 0xd78(%rip), %rcx       # 0x451b
movq %rbx, %rdi
movl %r15d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2c08(%rip), %rsi      # 0x63c0
leaq 0xe15(%rip), %rcx       # 0x45d4
leaq 0xf30(%rip), %r12       # 0x46f6
movq %rbx, %rdi
movl %r14d, %edx
movq %r12, %r8
xorl %r9d, %r9d
callq 0x16b1
leaq 0x2c26(%rip), %rsi      # 0x6404
leaq 0xf1b(%rip), %rcx       # 0x4700
movq %rbx, %rdi
movl %r15d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2bce(%rip), %rsi      # 0x63c8
leaq 0xf5f(%rip), %rcx       # 0x4760
movq %rbx, %rdi
movl %r15d, %edx
movq %r12, %r8
xorl %r9d, %r9d
callq 0x16b1
leaq 0x2bac(%rip), %rsi      # 0x63c5
leaq 0xf72(%rip), %rcx       # 0x4792
pushq $0x6
popq %r13
movq %rbx, %rdi
movl %r13d, %edx
movq %r12, %r8
xorl %r9d, %r9d
callq 0x16b1
leaq 0x2b90(%rip), %rsi      # 0x63cc
leaq 0xfdd(%rip), %rcx       # 0x4820
movq %rbx, %rdi
pushq $0x5
popq %r12
movl %r12d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2b76(%rip), %rsi      # 0x63d2
leaq 0x1000(%rip), %rcx      # 0x4863
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2b5d(%rip), %rsi      # 0x63d4
leaq 0x105b(%rip), %rcx      # 0x48d9
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2b1a(%rip), %rsi      # 0x63ac
leaq 0x107c(%rip), %rcx      # 0x4915
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2b2b(%rip), %rsi      # 0x63d8
leaq 0x109d(%rip), %rcx      # 0x4951
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2b0d(%rip), %rsi      # 0x63d6
leaq 0x10b9(%rip), %rcx      # 0x4989
movq %rbx, %rdi
movl %r13d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2b1c(%rip), %rsi      # 0x6401
leaq 0x10ab(%rip), %rcx      # 0x4997
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
xorl %edi, %edi
callq 0x10c0
movl %eax, %edi
callq 0x10b0
leaq 0x2ad0(%rip), %rsi      # 0x63de
leaq 0x111e(%rip), %rcx      # 0x4a33
movq %rbx, %rdi
movl %r15d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2ab3(%rip), %rsi      # 0x63dd
leaq 0x1167(%rip), %rcx      # 0x4a98
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2a9c(%rip), %rsi      # 0x63e2
leaq 0x117b(%rip), %rcx      # 0x4ac8
movq %rbx, %rdi
movl %r12d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2a86(%rip), %rsi      # 0x63e8
leaq 0x11ca(%rip), %rcx      # 0x4b33
movq %rbx, %rdi
pushq $0x7
popq %rdx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2a72(%rip), %rsi      # 0x63f0
leaq 0x1220(%rip), %rcx      # 0x4ba5
leaq 0x1279(%rip), %r8       # 0x4c05
movq %rbx, %rdi
movl %ebp, %edx
xorl %r9d, %r9d
callq 0x16b1
movq 0x1160(%rbx), %rcx
leaq 0x2a4b(%rip), %rsi      # 0x63f2
leaq 0x12c6(%rip), %r8       # 0x4c74
movq %rbx, %rdi
movl %ebp, %edx
xorl %r9d, %r9d
callq 0x16b1
leaq 0x2a32(%rip), %rsi      # 0x63f4
leaq 0x1323(%rip), %rcx      # 0x4cec
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2a1b(%rip), %rsi      # 0x63f9
leaq 0x13ba(%rip), %rcx      # 0x4d9f
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2a04(%rip), %rsi      # 0x63fe
leaq 0x13d3(%rip), %rcx      # 0x4dd4
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x29ed(%rip), %rsi      # 0x6403
leaq 0x14b7(%rip), %rcx      # 0x4ed4
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x29d6(%rip), %rsi      # 0x6408
leaq 0x14fa(%rip), %rcx      # 0x4f33
movq %rbx, %rdi
movl %r12d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x29c0(%rip), %rsi      # 0x640e
leaq 0x14e9(%rip), %rcx      # 0x4f3e
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x29a9(%rip), %rsi      # 0x6413
leaq 0x1546(%rip), %rcx      # 0x4fb7
movq %rbx, %rdi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2992(%rip), %rsi      # 0x6418
leaq 0x152f(%rip), %rcx      # 0x4fbc
movq %rbx, %rdi
movl %r15d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x297a(%rip), %rsi      # 0x641c
leaq 0x1528(%rip), %rcx      # 0x4fd1
movq %rbx, %rdi
movl %r13d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2965(%rip), %rsi      # 0x6423
leaq 0x1568(%rip), %rcx      # 0x502d
movq %rbx, %rdi
movl %r13d, %edx
xorl %r8d, %r8d
callq 0x179f
leaq 0x2950(%rip), %rsi      # 0x642a
leaq 0x15bd(%rip), %rcx      # 0x509e
movq %rbx, %rdi
movl %ebp, %edx
xorl %r8d, %r8d
callq 0x179f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2c36