LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/minidump.c
// Function: print_minidump_misc_info
void print_minidump_misc_info(FILE *in)
{
  printf("\n");
  printf("           len_info: %u\n", read_uint32(in));
  printf("             flags1: %u\n", read_uint32(in));
  printf("         process_id: %u\n", read_uint32(in));
  printf("process_create_time: %u\n", read_uint32(in));
  printf("  process_user_time: %u\n", read_uint32(in));
  printf("process_kernel_time: %u\n", read_uint32(in));
  printf("        cpu_max_mhz: %u\n", read_uint32(in));
  printf("        cpu_cur_mhz: %u\n", read_uint32(in));
  printf("      cpu_limit_mhz: %u\n", read_uint32(in));
  printf(" cpu_max_idle_state: %u\n", read_uint32(in));
  printf(" cpu_cur_idle_state: %u\n", read_uint32(in));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0xa, %edi
callq 0x1030
movq %rbx, %rdi
callq 0x1782
leaq 0x1938(%rip), %rdi      # 0x4b6a
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x1939(%rip), %rdi      # 0x4b83
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x193a(%rip), %rdi      # 0x4b9c
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x193b(%rip), %rdi      # 0x4bb5
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x193c(%rip), %rdi      # 0x4bce
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x193d(%rip), %rdi      # 0x4be7
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x193e(%rip), %rdi      # 0x4c00
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x193f(%rip), %rdi      # 0x4c19
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x1940(%rip), %rdi      # 0x4c32
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x1941(%rip), %rdi      # 0x4c4b
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x1942(%rip), %rdi      # 0x4c64
movl %eax, %esi
xorl %eax, %eax
popq %rbx
jmp 0x1060
// File: /workspace/github_c_makefile_star2_O3/mikeakohn[P]print_pe/build/../src/minidump.c
// Function: print_minidump_thread_info_list
void print_minidump_thread_info_list(FILE *in)
{
  printf("\n");
  printf("     size_of_header: %u\n", read_uint32(in));
  printf("      size_of_entry: %u\n", read_uint32(in));
  printf("  number_of_entries: %u\n", read_uint32(in));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0xa, %edi
callq 0x1030
movq %rbx, %rdi
callq 0x1782
leaq 0x16a2(%rip), %rdi      # 0x49eb
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x191c(%rip), %rdi      # 0x4c7d
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1782
leaq 0x191d(%rip), %rdi      # 0x4c96
movl %eax, %esi
xorl %eax, %eax
popq %rbx
jmp 0x1060
nop
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/util.c
// Function: janet_core_cfuns_ext
void janet_core_cfuns_ext(JanetTable *env, const char *regprefix, const JanetRegExt *cfuns) {
    (void) regprefix;
    while (cfuns->name) {
        Janet fun = janet_wrap_cfunction(cfuns->cfun);
        janet_table_put(env, janet_csymbolv(cfuns->name), fun);
        janet_registry_put(cfuns->cfun, cfuns->name, regprefix, cfuns->source_file, cfuns->source_line);
        cfuns++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %r12
testq %r12, %r12
je 0x18a99
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
addq $0x28, %rbx
movabsq $-0x5800000000000, %rbp # imm = 0xFFFA800000000000
movq -0x20(%rbx), %r13
movabsq $-0x1800000000000, %rax # imm = 0xFFFE800000000000
orq %rax, %r13
movq %r12, %rdi
callq 0x15310
movq %r12, %rdi
movl %eax, %esi
callq 0x23893
orq %rbp, %rax
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x176cb
movq -0x28(%rbx), %rsi
movq -0x20(%rbx), %rdi
movq -0x10(%rbx), %rcx
movl -0x8(%rbx), %r8d
movq %r14, %rdx
callq 0x2f2aa
movq (%rbx), %r12
addq $0x28, %rbx
testq %r12, %r12
jne 0x18a41
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/corelib.c
// Function: janet_core_env
JanetTable *janet_core_env(JanetTable *replacements) {
    /* Memoize core env, ignoring replacements the second time around. */
    if (NULL != janet_vm.core_env) {
        return janet_vm.core_env;
    }

    JanetTable *dict = janet_core_lookup_table(replacements);

    /* Unmarshal bytecode */
    Janet marsh_out = janet_unmarshal(
                          janet_core_image,
                          janet_core_image_size,
                          0,
                          dict,
                          NULL);

    /* Memoize */
    janet_gcroot(marsh_out);
    JanetTable *env = janet_unwrap_table(marsh_out);
    janet_vm.core_env = env;

    /* Invert image dict manually here. We can't do this in boot.janet as it
     * breaks deterministic builds */
    Janet lidv, midv;
    lidv = midv = janet_wrap_nil();
    janet_resolve(env, janet_csymbol("load-image-dict"), &lidv);
    janet_resolve(env, janet_csymbol("make-image-dict"), &midv);
    JanetTable *lid = janet_unwrap_table(lidv);
    JanetTable *mid = janet_unwrap_table(midv);
    for (int32_t i = 0; i < lid->capacity; i++) {
        const JanetKV *kv = lid->data + i;
        if (!janet_checktype(kv->key, JANET_NIL)) {
            janet_table_put(mid, kv->value, kv->key);
        }
    }

    return env;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq %fs:0x0, %rax
movq -0x1ad0(%rax), %rcx
testq %rcx, %rcx
jne 0x25536
leaq -0x1ae0(%rax), %rbx
movabsq $-0x77fffffffffff, %r13 # imm = 0xFFF8800000000001
movq %r14, %rdi
callq 0x25548
movq 0xa1345(%rip), %rdi     # 0xc6798
movq 0xa1346(%rip), %rsi     # 0xc67a0
xorl %edx, %edx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x2575e
movq %rax, %rbp
movq %rax, %rdi
callq 0x25804
movabsq $0x7fffffffffff, %r14   # imm = 0x7FFFFFFFFFFF
andq %r14, %rbp
movq %rbp, 0x10(%rbx)
leaq 0x8(%rsp), %r15
movq %r13, (%r15)
leaq 0x10(%rsp), %r12
movq %r13, (%r12)
leaq 0x823a3(%rip), %rdi     # 0xa783e
movl $0xf, %esi
callq 0x23893
movq %rbp, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x2587d
leaq 0x82394(%rip), %rdi     # 0xa784e
movl $0xf, %esi
callq 0x23893
movq %rbp, (%rsp)
movq %rbp, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x2587d
movq (%r12), %r15
andq %r14, %r15
movl 0x14(%r15), %eax
testl %eax, %eax
jle 0x25532
andq 0x8(%rsp), %r14
movl $0x8, %r12d
xorl %ebp, %ebp
movabsq $-0x800000000000, %rbx  # imm = 0xFFFF800000000000
decq %r13
movq 0x20(%r15), %rcx
movq -0x8(%rcx,%r12), %rdx
movq %rdx, %rsi
andq %rbx, %rsi
cmpq %r13, %rsi
je 0x25523
movq (%rcx,%r12), %rsi
movq %r14, %rdi
callq 0x176cb
movl 0x14(%r15), %eax
incq %rbp
movslq %eax, %rcx
addq $0x10, %r12
cmpq %rcx, %rbp
jl 0x254ff
movq (%rsp), %rcx
movq %rcx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/emit.c
// Function: janetc_free_regnear
static void janetc_free_regnear(JanetCompiler *c, JanetSlot s, int32_t reg, JanetcRegisterTemp tag) {
    if (reg != s.index ||
            s.envindex >= 0 ||
            s.flags & (JANET_SLOT_CONSTANT | JANET_SLOT_REF)) {
        /* We need to free the temporary slot */
        janetc_regalloc_freetemp(&c->scope->ra, reg, tag);
    }
}

// Assembly:
cmpl %esi, 0x10(%rsp)
jne 0x273a7
cmpl $0x0, 0x14(%rsp)
jns 0x273a7
leaq 0x8(%rsp), %rax
testb $0x9, 0x12(%rax)
je 0x273d9
movq (%rdi), %rax
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
movl %edx, %ecx
roll %cl, %r8d
andl %r8d, 0x44(%rax)
cmpl $0xef, %esi
jg 0x273d9
movl %esi, %edx
sarl $0x5, %edx
movl %esi, %ecx
roll %cl, %edi
movq 0x30(%rax), %rax
movslq %edx, %rcx
andl %edi, (%rax,%rcx,4)
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_stream_getter
static int janet_stream_getter(void *p, Janet key, Janet *out) {
    JanetStream *stream = (JanetStream *)p;
    if (!janet_checktype(key, JANET_KEYWORD)) return 0;
    const JanetMethod *stream_methods = stream->methods;
    return janet_getmethod(janet_unwrap_keyword(key), stream_methods, out);
}

// Assembly:
movq %rsi, %rax
shrq $0x2f, %rax
cmpl $0x1fff6, %eax          # imm = 0x1FFF6
jne 0x27a05
movq 0x20(%rdi), %rax
movabsq $0x7fffffffffff, %rcx   # imm = 0x7FFFFFFFFFFF
andq %rcx, %rsi
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x1de5d
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/filewatch.c
// Function: cfun_filewatch_remove
static void janet_watcher_remove(JanetWatcher *watcher, const char *path) {
    if (watcher->stream == NULL) janet_panic("watcher closed");
    Janet check = janet_table_get(watcher->watch_descriptors, janet_cstringv(path));
    janet_assert(janet_checktype(check, JANET_NUMBER), "bad watch descriptor");
    int watch_handle = janet_unwrap_integer(check);
    int result;
    do {
        result = inotify_rm_watch(watcher->stream->handle, watch_handle);
    } while (result != -1 && errno == EINTR);
    if (result == -1) {
        janet_panicv(janet_ev_lasterr());
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $0x2, %edi
jne 0x307a9
movq %rsi, %rbx
leaq 0x90f39(%rip), %rdx     # 0xc1638
movq %rsi, %rdi
xorl %esi, %esi
callq 0x1eed9
movq %rax, %r14
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1e622
cmpq $0x0, (%r14)
je 0x307be
movq %rax, %r15
movq 0x8(%r14), %r12
movq %rax, %rdi
callq 0x15310
movq %r15, %rdi
movl %eax, %esi
callq 0x1dde5
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
orq %rax, %rsi
movq %r12, %rdi
callq 0x1f0cb
movq %rax, %xmm0
ucomisd %xmm0, %xmm0
setnp %cl
movabsq $0x7800000000000, %rdx  # imm = 0x7800000000000
testq %rdx, %rax
sete %al
orb %cl, %al
je 0x307ca
cvttsd2si %xmm0, %ebp
movq (%r14), %rax
movl (%rax), %edi
movl %ebp, %esi
callq 0x15b80
cmpl $-0x1, %eax
je 0x3079c
callq 0x15120
cmpl $0x4, (%rax)
je 0x30775
movq (%rbx), %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x2ad59
movq %rax, %rdi
callq 0x1d806
movl %edi, %edx
leaq 0x76b32(%rip), %rdi     # 0xa72e4
movl $0x2, %esi
xorl %eax, %eax
callq 0x18600
leaq 0x7a1c0(%rip), %rdi     # 0xaa985
callq 0x17886
callq 0x168df
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/inttypes.c
// Function: janet_is_int
JanetIntType janet_is_int(Janet x) {
    if (!janet_checktype(x, JANET_ABSTRACT)) return JANET_INT_NONE;
    const JanetAbstractType *at = janet_abstract_type(janet_unwrap_abstract(x));
    return (at == &janet_s64_type) ? JANET_INT_S64 :
           ((at == &janet_u64_type) ? JANET_INT_U64 :
            JANET_INT_NONE);
}

// Assembly:
movq %rdi, %rcx
shrq $0x2f, %rcx
xorl %eax, %eax
cmpl $0x1fffe, %ecx          # imm = 0x1FFFE
jne 0x3159e
movabsq $0x7fffffffffff, %rax   # imm = 0x7FFFFFFFFFFF
andq %rax, %rdi
movq -0x10(%rdi), %rax
xorl %ecx, %ecx
cmpq 0x94a3e(%rip), %rax     # 0xc5fc8
sete %cl
addl %ecx, %ecx
cmpq 0x94a3a(%rip), %rax     # 0xc5fd0
movl $0x1, %eax
cmovnel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/util.c
// Function: janet_core_def_sm
void janet_core_def_sm(JanetTable *env, const char *name, Janet x, const void *p, const void *sf, int32_t sl) {
    (void) sf;
    (void) sl;
    (void) p;
    Janet key = janet_csymbolv(name);
    janet_table_put(env, key, x);
    if (janet_checktype(x, JANET_CFUNCTION)) {
        janet_registry_put(janet_unwrap_cfunction(x), name, NULL, NULL, 0);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x15310
movq %rbx, %rdi
movl %eax, %esi
callq 0x23893
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
orq %rax, %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x176cb
movq %r14, %rax
shrq $0x2f, %rax
cmpl $0x1fffd, %eax          # imm = 0x1FFFD
jne 0x33006
movabsq $0x7fffffffffff, %rax   # imm = 0x7FFFFFFFFFFF
andq %rax, %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
popq %rbx
popq %r14
popq %r15
jmp 0x2f2aa
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/specials.c
// Function: janetc_unquote
static JanetSlot janetc_unquote(JanetFopts opts, int32_t argn, const Janet *argv) {
    (void) argn;
    (void) argv;
    janetc_cerror(opts.compiler, "cannot use unquote here");
    return janetc_cslot(janet_wrap_nil());
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rsp), %rdi
leaq 0x5800f(%rip), %rsi     # 0xabfdb
callq 0x1f5a4
movl $0xffffffff, 0x8(%rbx)  # imm = 0xFFFFFFFF
movabsq $-0x77fffffffffff, %rax # imm = 0xFFF8800000000001
movq %rax, (%rbx)
movabsq $0x10002ffffffff, %rax  # imm = 0x10002FFFFFFFF
movq %rax, 0xc(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: janet_line_getter
Janet janet_line_getter(int32_t argc, Janet *argv) {
    janet_arity(argc, 0, 3);
    const char *str = (argc >= 1) ? (const char *) janet_getstring(argv, 0) : "";
    JanetBuffer *buf = (argc >= 2) ? janet_getbuffer(argv, 1) : janet_buffer(10);
    gbl_complete_env = (argc >= 3) ? janet_gettable(argv, 2) : NULL;
    janet_line_get(str, buf);
    gbl_complete_env = NULL;

    Janet result;
    if (gbl_cancel_current_repl_form) {
        gbl_cancel_current_repl_form = 0;

        /* Signal that the user bailed out of the current form */
        result = janet_ckeywordv("cancel");
    } else {
        result = janet_wrap_buffer(buf);
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movl %edi, %ebp
xorl %esi, %esi
movl $0x3, %edx
callq 0x17d13
testl %ebp, %ebp
jle 0x56785
movq %r15, %rdi
xorl %esi, %esi
callq 0x1c9fe
movq %rax, %rbx
cmpl $0x1, %ebp
je 0x5678c
movq %r15, %rdi
movl $0x1, %esi
callq 0x1b80f
movq %rax, %r14
cmpl $0x3, %ebp
jb 0x56799
movq %r15, %rdi
movl $0x2, %esi
callq 0x1df8d
movq %rax, %r15
jmp 0x5679c
leaq 0x55d80(%rip), %rbx     # 0xac50c
movl $0xa, %edi
callq 0x1b27d
movq %rax, %r14
xorl %r15d, %r15d
movq %fs:0x0, %rax
movq %rax, %r12
movq %rax, %r13
movq %r15, -0x1790(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x56832
movq $0x0, -0x1790(%r13)
movq %r12, %rax
cmpl $0x0, -0x1788(%r12)
je 0x56812
leaq -0x1788(%rax), %rax
movl $0x0, (%rax)
leaq 0x55b7e(%rip), %rdi     # 0xac36b
callq 0x1a519
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1a512
movabsq $-0x2800000000000, %rsi # imm = 0xFFFD800000000000
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17805
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: janet_line_deinit
void janet_line_deinit() {
    int i;
    norawmode();
    for (i = 0; i < gbl_history_count; i++)
        janet_free(gbl_history[i]);
    gbl_historyi = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %fs:0x0, %rax
movq %rax, %rbx
cmpl $0x0, -0x1050(%rax)
je 0x5776d
movq %rax, %r14
leaq -0x104c(%rbx), %rdx
xorl %edi, %edi
movl $0x1, %esi
callq 0x15990
cmpl $-0x1, %eax
je 0x5776d
leaq -0x1050(%r14), %rax
movl $0x0, (%rax)
movslq -0x1784(%rbx), %r14
testq %r14, %r14
jle 0x57794
leaq -0x1780(%rbx), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x150b0
incq %r12
cmpq %r12, %r14
jne 0x57783
movl $0x0, -0x1460(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: rawmode
static int rawmode(void) {
    struct termios t;
    if (!isatty(STDIN_FILENO)) goto fatal;
    if (tcgetattr(STDIN_FILENO, &gbl_termios_start) == -1) goto fatal;
    t = gbl_termios_start;
    t.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
    t.c_cflag |= (CS8);
    t.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
    t.c_cc[VMIN] = 1;
    t.c_cc[VTIME] = 0;
    if (tcsetattr(STDIN_FILENO, TCSADRAIN, &t) < 0) goto fatal;
    gbl_israwmode = 1;
    return 0;
fatal:
    errno = ENOTTY;
    return -1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
xorl %edi, %edi
callq 0x151c0
testl %eax, %eax
je 0x57a37
movq %fs:0x0, %rax
movq %rax, %rbx
leaq -0x104c(%rax), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x15980
cmpl $-0x1, %eax
je 0x57a37
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups 0x2c(%r14), %xmm3
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movaps %xmm1, 0x10(%rdx)
movups %xmm3, 0x2c(%rdx)
andl $0xfffffacd, (%rdx)     # imm = 0xFFFFFACD
movaps %xmm2, 0x20(%rdx)
orb $0x30, 0x8(%rdx)
andl $0xffff7ff4, 0xc(%rdx)  # imm = 0xFFFF7FF4
movw $0x100, 0x16(%rdx)      # imm = 0x100
xorl %ebp, %ebp
xorl %edi, %edi
movl $0x1, %esi
callq 0x15990
testl %eax, %eax
js 0x57a37
movl $0x1, -0x1050(%rbx)
jmp 0x57a47
callq 0x15120
movl $0x19, (%rax)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: getcols
static int getcols(void) {
#ifdef _WIN32
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
    return (int)(csbi.srWindow.Right - csbi.srWindow.Left + 1);
#else
    struct winsize ws;
    if (ioctl(1, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0) {
        int start, cols;
        start = curpos();
        if (start == -1) goto failed;
        if (write_console("\x1b[999C", 6) != 6) goto failed;
        cols = curpos();
        if (cols == -1) goto failed;
        if (cols > start) {
            char seq[32];
            snprintf(seq, 32, "\x1b[%dD", cols - start);
            if (write_console(seq, strlen(seq)) == -1) {
                exit(1);
            }
        }
        return cols;
    } else {
        return ws.ws_col;
    }
failed:
    return 80;
#endif
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
leaq 0x8(%rsp), %rbx
movl $0x5413, %esi           # imm = 0x5413
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x15410
cmpl $-0x1, %eax
sete %cl
movzwl 0x2(%rbx), %eax
testw %ax, %ax
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x57b08
callq 0x581c0
movl $0x50, %ebp
cmpl $-0x1, %eax
je 0x57b0b
movl %eax, %r14d
leaq 0x54a28(%rip), %rsi     # 0xac4cb
movl $0x6, %edx
movl $0x1, %edi
callq 0x15250
cmpq $0x6, %rax
jne 0x57b0b
callq 0x581c0
cmpl $-0x1, %eax
je 0x57b0b
movl %eax, %ebx
movl %eax, %ecx
subl %r14d, %ecx
jle 0x57b04
leaq 0x54a00(%rip), %rdx     # 0xac4d2
leaq 0x10(%rsp), %r14
movl $0x20, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x15390
movq %r14, %rdi
callq 0x15310
movl $0x1, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x15250
cmpq $-0x1, %rax
je 0x57b16
movl %ebx, %ebp
jmp 0x57b0b
movzwl %ax, %ebp
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x1, %edi
callq 0x15aa0
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: insert
static int insert(char c, int draw) {
    if (gbl_len < JANET_LINE_MAX - 1) {
        if (gbl_len == gbl_pos) {
            gbl_buf[gbl_pos++] = c;
            gbl_buf[++gbl_len] = '\0';
            if (draw) {
                if (gbl_plen + gbl_len < gbl_cols) {
                    /* Avoid a full update of the line in the
                     * trivial case. */
                    if (write_console(&c, 1) == -1) return -1;
                } else {
                    refresh();
                }
            }
        } else {
            memmove(gbl_buf + gbl_pos + 1, gbl_buf + gbl_pos, gbl_len - gbl_pos);
            gbl_buf[gbl_pos++] = c;
            gbl_buf[++gbl_len] = '\0';
            if (draw) refresh();
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r14d
movl %edi, %ebp
movb %bpl, 0xb(%rsp)
movq %fs:0x0, %rax
movslq -0x145c(%rax), %r15
cmpq $0x3fe, %r15            # imm = 0x3FE
jg 0x57c0e
leaq -0x145c(%rax), %rsi
leaq -0x1010(%rax), %r12
movslq (%r12), %rbx
leaq -0x1450(%rax), %r13
cmpl %ebx, %r15d
jne 0x57bbf
leaq 0x1(%r15), %rdx
movl %edx, (%r12)
movb %bpl, (%r13,%r15)
movl %edx, (%rsi)
movb $0x0, 0x1(%r13,%r15)
testl %r14d, %r14d
je 0x57c0e
addl -0x1aec(%rax), %edx
cmpl -0x1af0(%rax), %edx
jge 0x57c09
leaq 0xb(%rsp), %rsi
movl $0x1, %edx
movl $0x1, %edi
callq 0x15250
cmpq $-0x1, %rax
jne 0x57c0e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x57c10
movq %rsi, 0x10(%rsp)
leaq (%rbx,%r13), %rsi
movl %r14d, 0xc(%rsp)
leaq (%rbx,%r13), %r14
incq %r14
movl %r15d, %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
callq 0x15950
leal 0x1(%rbx), %eax
movl %eax, (%r12)
movb %bpl, -0x1(%r14)
movq %r15, %rax
incq %rax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
movb $0x0, 0x1(%r13,%r15)
cmpl $0x0, 0xc(%rsp)
je 0x57c0e
callq 0x57c1f
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: refresh
static void refresh(void) {
    char seq[64];
    JanetBuffer b;

    /* Keep cursor position on screen */
    char *_buf = gbl_buf;
    int _len = gbl_len;
    int _pos = gbl_pos;
    while ((gbl_plen + _pos) >= gbl_cols) {
        _buf++;
        _len--;
        _pos--;
    }
    while ((gbl_plen + _len) > gbl_cols) {
        _len--;
    }

    janet_buffer_init(&b, 0);
    /* Cursor to left edge, gbl_prompt and buffer */
    janet_buffer_push_u8(&b, '\r');
    janet_buffer_push_cstring(&b, gbl_prompt);
    janet_buffer_push_bytes(&b, (uint8_t *) _buf, _len);
    /* Erase to right */
    janet_buffer_push_cstring(&b, "\x1b[0K");
    /* Move cursor to original position. */
    snprintf(seq, 64, "\r\x1b[%dC", (int)(_pos + gbl_plen));
    janet_buffer_push_cstring(&b, seq);
    if (write_console((char *) b.data, b.count) == -1) {
        exit(1);
    }
    janet_buffer_deinit(&b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %fs:0x0, %rax
movq %rax, %r14
leaq -0x1450(%rax), %rbx
movl -0x145c(%rax), %ebp
movl -0x1010(%rax), %edx
leaq -0x1aec(%rax), %r13
movl (%r13), %ecx
movl -0x1af0(%rax), %eax
leal (%rcx,%rdx), %esi
cmpl %eax, %esi
jge 0x57c6c
movl %edx, %r15d
jmp 0x57c83
incq %rbx
decl %ebp
movl %edx, %r15d
decl %r15d
leal (%rcx,%rdx), %esi
decl %esi
movl %r15d, %edx
cmpl %eax, %esi
jge 0x57c6c
addl %ecx, %ebp
cmpl %ebp, %eax
cmovll %eax, %ebp
subl %ecx, %ebp
movq %rsp, %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x1b1b1
movq %r12, %rdi
movl $0xd, %esi
callq 0x1b4c7
movq -0x1af8(%r14), %rsi
movq %r12, %rdi
callq 0x1b416
movq %r12, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x1b459
leaq 0x5481a(%rip), %rsi     # 0xac4e3
movq %r12, %rdi
callq 0x1b416
addl (%r13), %r15d
leaq 0x5480c(%rip), %rdx     # 0xac4e8
leaq 0x20(%rsp), %rbx
movl $0x40, %esi
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x15390
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1b416
movq 0x18(%r12), %rsi
movslq 0x10(%r12), %rdx
movl $0x1, %edi
callq 0x15250
cmpq $-0x1, %rax
je 0x57d2f
movq %rsp, %rdi
callq 0x1b26d
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x15aa0
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: clearlines
static void clearlines(void) {
    for (int i = 0; i < gbl_lines_below; i++) {
        fprintf(stderr, "\x1b[1B\x1b[999D\x1b[K");
    }
    if (gbl_lines_below) {
        fprintf(stderr, "\x1b[%dA\x1b[999D", gbl_lines_below);
        fflush(stderr);
        gbl_lines_below = 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %fs:0x0, %rax
leaq -0x100c(%rax), %rbx
movl (%rbx), %edi
testl %edi, %edi
jle 0x57d86
xorl %ebp, %ebp
movq 0x6e28e(%rip), %r15     # 0xc5ff0
leaq 0x54786(%rip), %r14     # 0xac4ef
movq (%r15), %rcx
movl $0xd, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x15ac0
incl %ebp
movl (%rbx), %edi
cmpl %edi, %ebp
jl 0x57d69
testl %edi, %edi
jne 0x57d95
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rsi
callq 0x17417
jmp 0x57d8a
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: kdelete
static void kdelete(int draw) {
    if (gbl_pos != gbl_len) {
        memmove(gbl_buf + gbl_pos, gbl_buf + gbl_pos + 1, gbl_len - gbl_pos);
        gbl_buf[--gbl_len] = '\0';
        if (draw) refresh();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movq %fs:0x0, %rax
movslq -0x1010(%rax), %rdx
movslq -0x145c(%rax), %r15
cmpl %edx, %r15d
je 0x57e1a
leaq -0x145c(%rax), %r12
movq %rax, %r14
leaq (%rax,%rdx), %rdi
addq $-0x1450, %rdi          # imm = 0xEBB0
leaq (%rax,%rdx), %rsi
addq $-0x144f, %rsi          # imm = 0xEBB1
movl %r15d, %eax
subl %edx, %eax
movslq %eax, %rdx
callq 0x15950
leaq -0x1(%r15), %rax
movl %eax, (%r12)
movb $0x0, -0x1451(%r14,%r15)
testl %ebx, %ebx
je 0x57e1a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x57c1f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: historymove
static void historymove(int delta) {
    if (gbl_history_count > 1) {
        janet_free(gbl_history[gbl_historyi]);
        gbl_history[gbl_historyi] = sdup(gbl_buf);

        gbl_historyi += delta;
        if (gbl_historyi < 0) {
            gbl_historyi = 0;
        } else if (gbl_historyi >= gbl_history_count) {
            gbl_historyi = gbl_history_count - 1;
        }
        strncpy(gbl_buf, gbl_history[gbl_historyi], JANET_LINE_MAX - 1);
        gbl_pos = gbl_len = (int) strlen(gbl_buf);
        gbl_buf[gbl_len] = '\0';

        refresh();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebp
movq %fs:0x0, %rax
cmpl $0x2, -0x1784(%rax)
jl 0x57eb3
movq %rax, %rbx
movq %rax, %r12
movq %rax, %r13
leaq -0x1780(%rax), %rax
movq %rax, (%rsp)
movq %rbx, %rax
movq %rax, %r15
movslq -0x1460(%rax), %rax
movq -0x1780(%r13,%rax,8), %rdi
callq 0x150b0
leaq -0x1450(%rbx), %r14
movq %r14, %rdi
callq 0x5826a
movslq -0x1460(%r15), %rcx
movq %rax, -0x1780(%r13,%rcx,8)
addl %ecx, %ebp
movl %ebp, -0x1460(%r15)
js 0x57ec2
leaq -0x1784(%r12), %rax
movl (%rax), %eax
cmpl %eax, %ebp
jl 0x57ecd
decl %eax
movl %eax, %ebp
jmp 0x57ec4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
leaq -0x1460(%r15), %rax
movl %ebp, (%rax)
movslq %ebp, %rax
movq (%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
callq 0x15150
movq %r14, %rdi
callq 0x15310
movq %rax, %rcx
movl %ecx, -0x145c(%rbx)
movl %ecx, -0x1010(%rbx)
movslq %ecx, %rax
movb $0x0, (%r14,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x57c1f
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: kbackspacew
static void kbackspacew(void) {
    while (gbl_pos && isspace(gbl_buf[gbl_pos - 1])) {
        kbackspace(0);
    }
    while (gbl_pos && !isspace(gbl_buf[gbl_pos - 1])) {
        kbackspace(0);
    }
    refresh();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %fs:0x0, %rax
movq %rax, 0x8(%rsp)
movl -0x1010(%rax), %ebp
testl %ebp, %ebp
je 0x58035
leaq -0x1010(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x15c60
movq %rax, %r14
movq 0x8(%rsp), %rcx
leaq -0x1450(%rcx), %r12
leaq -0x145c(%rcx), %r13
movl (%r13), %ebx
movq (%r14), %rax
movslq %ebp, %r15
movsbq -0x1(%r12,%r15), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x57fc4
testl %ebp, %ebp
jle 0x57fbe
decq %r15
movl %ebp, %eax
leaq (%r12,%rax), %rsi
leaq (%r12,%rax), %rdi
decq %rdi
movl %ebx, %eax
subl %ebp, %eax
movslq %eax, %rdx
callq 0x15950
movq 0x10(%rsp), %rax
movl %r15d, (%rax)
movslq %ebx, %rax
leaq -0x1(%rax), %rbx
movl %ebx, (%r13)
movb $0x0, -0x1(%r12,%rax)
movl %r15d, %ebp
testl %ebp, %ebp
jne 0x57f6f
jmp 0x58035
callq 0x15c60
movq %rax, %r14
movq 0x8(%rsp), %rcx
leaq -0x1450(%rcx), %r12
leaq -0x145c(%rcx), %rbx
movl (%rbx), %r13d
movq (%r14), %rax
movslq %ebp, %r15
movsbq -0x1(%r12,%r15), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x58035
testl %ebp, %ebp
jle 0x58031
decq %r15
movl %ebp, %eax
leaq (%r12,%rax), %rsi
leaq (%r12,%rax), %rdi
decq %rdi
movl %r13d, %eax
subl %ebp, %eax
movslq %eax, %rdx
callq 0x15950
movq 0x10(%rsp), %rax
movl %r15d, (%rax)
movslq %r13d, %rax
leaq -0x1(%rax), %r13
movl %r13d, (%rbx)
movb $0x0, -0x1(%r12,%rax)
movl %r15d, %ebp
testl %ebp, %ebp
jne 0x57fe2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x57c1f
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: krightw
static void krightw(void) {
    while (gbl_pos != gbl_len && isspace(gbl_buf[gbl_pos])) {
        gbl_pos++;
    }
    while (gbl_pos != gbl_len && !isspace(gbl_buf[gbl_pos])) {
        gbl_pos++;
    }
    refresh();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %fs:0x0, %rax
movl -0x145c(%rax), %r14d
movl -0x1010(%rax), %ebp
cmpl %r14d, %ebp
je 0x58100
movq %rax, %rbx
leaq -0x1010(%rax), %r15
movslq %ebp, %r12
callq 0x15c60
movq (%rax), %rcx
movq %rbx, %rax
movsbq -0x1450(%rbx,%r12), %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0x580c3
leaq -0x1450(%rax), %rax
addq %r12, %rax
incq %rax
incl %ebp
cmpl %ebp, %r14d
je 0x580fd
movsbq (%rax), %rdx
incq %rax
incl %ebp
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x580a9
decl %ebp
movl %ebp, (%r15)
callq 0x15c60
movq (%rax), %rcx
movslq %ebp, %rdx
leaq (%rbx,%rdx), %rax
addq $-0x1450, %rax          # imm = 0xEBB0
negl %r14d
incl %edx
movsbq (%rax), %rsi
testb $0x20, 0x1(%rcx,%rsi,2)
jne 0x58100
movl %edx, (%r15)
incq %rax
leal (%r14,%rdx), %esi
incl %esi
incl %edx
cmpl $0x1, %esi
jne 0x580dd
jmp 0x58100
movl %ebp, (%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x57c1f
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: kleftw
static void kleftw(void) {
    while (gbl_pos > 0 && isspace(gbl_buf[gbl_pos - 1])) {
        gbl_pos--;
    }
    while (gbl_pos > 0 && !isspace(gbl_buf[gbl_pos - 1])) {
        gbl_pos--;
    }
    refresh();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %fs:0x0, %rax
movslq -0x1010(%rax), %r15
testq %r15, %r15
jle 0x581b6
movq %rax, %rbx
leaq -0x1010(%rax), %r14
callq 0x15c60
movq (%rax), %rcx
movq %rbx, %rax
movsbq -0x1451(%r15,%rbx), %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0x5817c
leaq -0x1450(%rax), %rdx
movq %r15, %rax
cmpq $0x1, %r15
jbe 0x58174
movsbq -0x2(%rdx,%rax), %rsi
leaq -0x1(%rax), %r15
testb $0x20, 0x1(%rcx,%rsi,2)
jne 0x5815a
decl %eax
movl %eax, (%r14)
movl %eax, %r15d
testl %r15d, %r15d
jle 0x581b6
callq 0x15c60
movq (%rax), %rcx
leaq -0x1450(%rbx), %rax
movl %r15d, %edx
movsbq -0x1(%rax,%rdx), %rsi
testb $0x20, 0x1(%rcx,%rsi,2)
jne 0x581b6
leaq -0x1(%rdx), %rsi
decl %edx
movl %edx, (%r14)
leaq 0x1(%rsi), %rdi
movq %rsi, %rdx
cmpq $0x1, %rdi
ja 0x58193
popq %rbx
popq %r14
popq %r15
jmp 0x57c1f
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: curpos
static int curpos(void) {
    char buf[32];
    int cols, rows;
    unsigned int i = 0;
    if (write_console("\x1b[6n", 4) != 4) return -1;
    while (i < sizeof(buf) - 1) {
        if (read_console(buf + i, 1) != 1) break;
        if (buf[i] == 'R') break;
        i++;
    }
    buf[i] = '\0';
    if (buf[0] != 27 || buf[1] != '[') return -1;
    if (sscanf(buf + 2, "%d;%d", &rows, &cols) != 2) return -1;
    return cols;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
leaq 0x54308(%rip), %rsi     # 0xac4d8
movl $0x4, %edx
movl $0x1, %edi
callq 0x15250
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq $0x4, %rax
jne 0x5825e
xorl %r15d, %r15d
leaq (%rsp,%r15), %r14
addq $0x10, %r14
movl $0x1, %edx
xorl %edi, %edi
movq %r14, %rsi
callq 0x15530
cmpq $0x1, %rax
jne 0x5821f
cmpb $0x52, (%r14)
je 0x5821f
incq %r15
cmpq $0x1f, %r15
jne 0x581ed
movl $0x1f, %r15d
movb $0x0, 0x10(%rsp,%r15)
cmpb $0x1b, 0x10(%rsp)
jne 0x5825e
cmpb $0x5b, 0x11(%rsp)
jne 0x5825e
leaq 0x12(%rsp), %rdi
leaq 0x5429e(%rip), %rsi     # 0xac4dd
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x157c0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
jne 0x5825e
movl 0x8(%rsp), %ebx
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: sdup
static char *sdup(const char *s) {
    size_t len = strlen(s) + 1;
    char *mem = janet_malloc(len);
    if (!mem) {
        return NULL;
    }
    return memcpy(mem, s, len);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x15310
movq %rax, %r14
incq %r14
movq %r14, %rdi
callq 0x15780
testq %rax, %rax
je 0x5829e
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x15690
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: get_symprefix
static JanetByteView get_symprefix(void) {
    /* Calculate current partial symbol. Maybe we could actually hook up the Janet
     * parser here...*/
    int i;
    JanetByteView ret;
    ret.len = 0;
    for (i = gbl_pos - 1; i >= 0; i--) {
        uint8_t c = (uint8_t) gbl_buf[i];
        if (!is_symbol_char_gen(c)) break;
        ret.len++;
    }
    /* Will be const for duration of match checking */
    ret.bytes = (const uint8_t *)(gbl_buf + i + 1);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %fs:0x0, %rax
movl -0x1010(%rax), %r15d
leaq -0x1450(%rax), %r14
movl %r15d, %r12d
sarl $0x1f, %r12d
andl %r15d, %r12d
movl %r15d, %ebx
subl %r12d, %ebx
leal -0x1(%r12), %eax
movl %eax, 0x4(%rsp)
negl %r12d
addq %r15, %r12
movq $-0x1, %rbp
xorl %r13d, %r13d
cmpl %r13d, %r12d
je 0x583bd
leal (%r15,%rbp), %eax
movzbl (%r14,%rax), %edi
callq 0x582a6
incq %r13
decq %rbp
testl %eax, %eax
jne 0x58392
subl %r13d, %r15d
decl %r13d
movl %r13d, %ebx
movl %r15d, %eax
jmp 0x583c1
movl 0x4(%rsp), %eax
cltq
addq %r14, %rax
incq %rax
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/build/c/shell.c
// Function: check_match
static void check_match(JanetByteView src, const uint8_t *testsym, int32_t testlen) {
    JanetByteView test;
    test.bytes = testsym;
    test.len = testlen;
    if (src.len > test.len || strncmp((const char *) src.bytes, (const char *) test.bytes, src.len)) return;
    JanetByteView mm = test;
    for (int i = 0; i < gbl_match_count; i++) {
        if (compare_bytes(mm, gbl_matches[i]) < 0) {
            JanetByteView temp = mm;
            mm = gbl_matches[i];
            gbl_matches[i] = temp;
        }
    }
    if (gbl_match_count == JANET_MATCH_MAX) return;
    gbl_matches[gbl_match_count++] = mm;
}

// Assembly:
cmpl %ecx, %esi
jg 0x587fc
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movq %rdx, %rax
movslq %esi, %rdx
movq %rax, %rsi
movq %rax, %rbx
callq 0x15170
testl %eax, %eax
jne 0x587ee
movq %fs:0x0, %rax
movq %rax, %rcx
movslq -0x1008(%rax), %rdx
testq %rdx, %rdx
jle 0x587c4
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
leaq -0x1000(%rax), %r12
movq %rdx, 0x18(%rsp)
shlq $0x4, %rdx
movq %rdx, 0x20(%rsp)
xorl %r15d, %r15d
movq %rbx, %rdi
movl %ebp, 0x4(%rsp)
movq (%r12,%r15), %r13
movl 0x8(%r12,%r15), %ebx
xorl %r14d, %r14d
cmpl %ebx, %ebp
movl %ebx, %eax
cmovll %ebp, %eax
movslq %eax, %rdx
setl %r14b
movq %r13, %rsi
movq %rdi, %rbp
callq 0x15170
xorl %ecx, %ecx
testl %eax, %eax
sets %cl
cmovnel %ecx, %r14d
cmpb $0x1, %r14b
jne 0x58795
movl 0xc(%r12,%r15), %eax
movq %rbp, (%r12,%r15)
movl 0x4(%rsp), %ecx
movl %ecx, 0x8(%r12,%r15)
movl (%rsp), %ecx
movl %ecx, 0xc(%r12,%r15)
movl %eax, (%rsp)
movl %ebx, %ebp
movq %r13, %rdi
jmp 0x5879c
movq %rbp, %rdi
movl 0x4(%rsp), %ebp
addq $0x10, %r15
cmpq %r15, 0x20(%rsp)
jne 0x58737
movq 0x18(%rsp), %rdx
cmpl $0x100, %edx            # imm = 0x100
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movl (%rsp), %r8d
jne 0x587c7
jmp 0x587ee
movq %rbx, %rdi
leaq -0x1008(%rcx), %rsi
leal 0x1(%rdx), %ecx
movl %ecx, (%rsi)
shlq $0x4, %rdx
movq %rdi, -0x1000(%rax,%rdx)
movl %ebp, -0xff8(%rax,%rdx)
movl %r8d, -0xff4(%rax,%rdx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/algorithm-archivists[P]GathVL/vis_test.cpp
// Function: main
int main() {
    camera cam(vec{1280, 720});
    scene world = scene({1280, 720}, {0, 0, 0, 1});

    cam.add_encoder<video_encoder>("/tmp/video.mp4", cam.size, 50);

    first_scene(cam, world);

    second_scene(cam, world);

    cam.clear_encoders();

    return 0;
}

// Assembly:
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
leaq 0x50(%rsp), %rdi
movsd 0x1cc4f(%rip), %xmm2    # 0x23030
movsd 0x1cc2f(%rip), %xmm3    # 0x23018
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x79dc
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x48(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xa8(%rsp), %rdi
movsd 0x1cbf9(%rip), %xmm0    # 0x23030
movsd 0x1cbd9(%rip), %xmm1    # 0x23018
callq 0x7bcc
leaq 0x2c(%rsp), %rcx
movl $0x32, (%rcx)
leaq 0x1cc86(%rip), %rsi     # 0x230dc
leaq 0x50(%rsp), %rdi
movq %rdi, %rdx
callq 0x6710
leaq 0x50(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x5b1c
leaq 0x50(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x5f17
leaq 0x50(%rsp), %rdi
callq 0x7990
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x64a5
callq *0x100(%rsp)
movq $0x0, 0x108(%rsp)
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x64c5
callq *0xf0(%rsp)
leaq 0xd8(%rsp), %rdi
movq $0x0, 0x20(%rdi)
callq 0x6864
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x64ee
callq *0x98(%rsp)
movq $0x0, 0xa0(%rsp)
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x650e
callq *0x88(%rsp)
leaq 0x70(%rsp), %rdi
movq $0x0, 0x20(%rdi)
callq 0x68fa
xorl %eax, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
retq
jmp 0x6531
jmp 0x6531
jmp 0x6531
movq %rax, %rdi
callq 0x6859
jmp 0x6540
movq %rax, %rbx
jmp 0x6550
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x6762
leaq 0x50(%rsp), %rdi
callq 0x67a6
movq %rbx, %rdi
callq 0x5500
// File: /workspace/github_c_makefile_star2_O3/algorithm-archivists[P]GathVL/src/scene.cpp
// Function: scene::scene(vec, color)
scene::scene(vec scene_size, color bg_color)
    : size(scene_size), bg_clr(bg_color),
      surface(cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
      static_cast<int>(size.x), static_cast<int>(size.y)),
      cairo_surface_destroy),
      context(cairo_create(surface.get()), cairo_destroy) {

    layers.emplace_back();
    cairo_set_line_width(context.get(), 3);
    cairo_set_font_size(context.get(), 50.0);
    cairo_set_line_join(context.get(), CAIRO_LINE_JOIN_BEVEL);
    cairo_set_line_cap(context.get(), CAIRO_LINE_CAP_ROUND);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movsd %xmm0, (%rdi)
movsd %xmm1, 0x8(%rdi)
movaps 0x20(%rsp), %xmm2
movaps 0x30(%rsp), %xmm3
movups %xmm2, 0x10(%rdi)
movups %xmm3, 0x20(%rdi)
leaq 0x30(%rdi), %rbx
xorps %xmm2, %xmm2
movups %xmm2, 0x30(%rdi)
movq $0x0, 0x40(%rdi)
cvttsd2si %xmm0, %esi
cvttsd2si %xmm1, %edx
xorl %edi, %edi
callq 0x54e0
movq 0x253b0(%rip), %rcx     # 0x2cfc8
movq %rcx, 0x48(%r14)
movq %rax, 0x50(%r14)
movq %rax, %rdi
callq 0x5700
movq 0x253b9(%rip), %rcx     # 0x2cfe8
movq %rcx, 0x58(%r14)
movq %rax, 0x60(%r14)
movq 0x38(%r14), %rsi
cmpq 0x40(%r14), %rsi
je 0x7c58
xorpd %xmm0, %xmm0
movupd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
addq $0x18, 0x38(%r14)
jmp 0x7c60
movq %rbx, %rdi
callq 0x7fae
movq 0x60(%r14), %rdi
movsd 0x1b704(%rip), %xmm0    # 0x23370
callq 0x54a0
movq 0x60(%r14), %rdi
movsd 0x1b6fb(%rip), %xmm0    # 0x23378
callq 0x5400
movq 0x60(%r14), %rdi
movl $0x2, %esi
callq 0x5410
movq 0x60(%r14), %rdi
movl $0x1, %esi
callq 0x5230
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r15
jmp 0x7cc6
movq %rax, %r15
jmp 0x7cdb
movq %rax, %r15
movq 0x60(%r14), %rdi
testq %rdi, %rdi
je 0x7cbe
callq *0x58(%r14)
movq $0x0, 0x60(%r14)
movq 0x50(%r14), %rdi
testq %rdi, %rdi
je 0x7cd3
callq *0x48(%r14)
movq $0x0, 0x50(%r14)
movq %rbx, %rdi
callq 0x6864
movq %r15, %rdi
callq 0x5500
jmp 0x7ced
movq %rax, %rdi
callq 0x6859
nop
// File: /workspace/github_c_makefile_star2_O3/algorithm-archivists[P]GathVL/src/scene.cpp
// Function: scene::draw()
void scene::draw() {
    cairo_set_source_rgba(context.get(), bg_clr.r, bg_clr.g, bg_clr.b,
                            bg_clr.a);
    cairo_set_operator(context.get(), CAIRO_OPERATOR_SOURCE);
    cairo_paint(context.get());

    for (const auto& l : layers) {
        l.draw(context.get());
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
movsd 0x10(%rbx), %xmm0
movsd 0x18(%rbx), %xmm1
movsd 0x20(%rbx), %xmm2
movsd 0x28(%rbx), %xmm3
callq 0x5320
movq 0x60(%rbx), %rdi
movl $0x1, %esi
callq 0x5050
movq 0x60(%rbx), %rdi
callq 0x51a0
movq 0x30(%rbx), %r14
movq 0x38(%rbx), %r15
cmpq %r15, %r14
je 0x7d51
movq 0x60(%rbx), %rsi
movq %r14, %rdi
callq 0x7a80
addq $0x18, %r14
jmp 0x7d3a
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/algorithm-archivists[P]GathVL/src/objects/arc.cpp
// Function: arc::draw(_cairo*) const
void arc::draw(cairo_t *ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);

    if (size.x < size.y && (size.x != 0 || size.y != 0)) {
        cairo_scale(ctx, size.x / size.y, 1.0);
        cairo_arc(ctx, location.x, location.y, size.y, angles.x, angles.y);
    } else if (size.x > size.y && (size.x != 0 || size.y != 0)) {
        cairo_scale(ctx, 1.0, size.y / size.x);
        cairo_arc(ctx, location.x, location.y, size.x, angles.x, angles.y);
    } else if (size.x == size.y && size.x != 0) {
        cairo_arc(ctx, location.x, location.y, size.x, angles.x, angles.y);
    }

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54b0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5320
movsd 0x50(%r14), %xmm2
movsd 0x58(%r14), %xmm1
ucomisd %xmm2, %xmm1
jbe 0x8dd0
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x8e0c
jp 0x8e0c
ucomisd %xmm0, %xmm1
jne 0x8e0c
jp 0x8e0c
ucomisd %xmm1, %xmm2
jbe 0x8dea
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x8e38
jp 0x8e38
ucomisd %xmm0, %xmm1
jne 0x8e38
jp 0x8e38
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x8df6
jnp 0x8e72
ucomisd %xmm1, %xmm2
jne 0x8e72
jp 0x8e72
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
jmp 0x8e5e
divsd %xmm1, %xmm2
movsd 0x1a580(%rip), %xmm1    # 0x23398
movq %rbx, %rdi
movapd %xmm2, %xmm0
callq 0x5690
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movsd 0x58(%r14), %xmm2
jmp 0x8e5e
divsd %xmm2, %xmm1
movsd 0x1a554(%rip), %xmm0    # 0x23398
movq %rbx, %rdi
callq 0x5690
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movsd 0x50(%r14), %xmm2
movsd 0x60(%r14), %xmm3
movsd 0x68(%r14), %xmm4
movq %rbx, %rdi
callq 0x5330
movq %rbx, %rdi
callq 0x54f0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5600
nop
// File: /workspace/github_c_makefile_star2_O3/algorithm-archivists[P]GathVL/src/objects/arrow.cpp
// Function: arrow::draw(_cairo*) const
void arrow::draw(cairo_t *ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);
    cairo_translate(ctx, location.x, location.y);
    cairo_rotate(ctx, rotation);

    cairo_move_to(ctx, 0, 0);
    cairo_line_to(ctx, length, 0);
    cairo_rotate(ctx, -M_PI / 4);
    cairo_move_to(ctx, 0, 0);
    cairo_line_to(ctx, 0.25 * length, 0);
    cairo_move_to(ctx, 0, 0);
    cairo_rotate(ctx, M_PI / 2);
    cairo_line_to(ctx, 0.25 * length, 0);

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54b0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5320
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5180
movsd 0x58(%r14), %xmm0
movq %rbx, %rdi
callq 0x5480
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5560
movsd 0x50(%r14), %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x52f0
movsd 0x1a49d(%rip), %xmm0    # 0x233c8
movq %rbx, %rdi
callq 0x5480
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5560
movsd 0x50(%r14), %xmm0
mulsd 0x1a481(%rip), %xmm0    # 0x233d0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x52f0
xorpd %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5560
movsd 0x1a467(%rip), %xmm0    # 0x233d8
movq %rbx, %rdi
callq 0x5480
movsd 0x1a44f(%rip), %xmm0    # 0x233d0
mulsd 0x50(%r14), %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x52f0
movq %rbx, %rdi
callq 0x54f0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5600
nop
// File: /workspace/github_c_makefile_star2_O3/algorithm-archivists[P]GathVL/src/objects/curve.cpp
// Function: curve::draw(_cairo*) const
void curve::draw(cairo_t *ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);
    cairo_translate(ctx, origin.x, origin.y);

    if (!points.empty()) {
        cairo_move_to(ctx, points[0].x, -points[0].y);
    }

    for (const auto& point : points) {
        cairo_line_to(ctx, point.x, -point.y);
        cairo_move_to(ctx, point.x, -point.y);
    }

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54b0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5320
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5180
movq 0x50(%r14), %rax
cmpq 0x58(%r14), %rax
je 0x9083
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
xorps 0x1a32f(%rip), %xmm1    # 0x23360
movq %rbx, %rdi
callq 0x5560
movq 0x50(%r14), %r15
movq 0x58(%r14), %r14
cmpq %r14, %r15
je 0x9083
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movaps 0x1a308(%rip), %xmm2    # 0x23360
xorps %xmm2, %xmm1
movq %rbx, %rdi
callq 0x52f0
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
xorps 0x1a2eb(%rip), %xmm1    # 0x23360
movq %rbx, %rdi
callq 0x5560
addq $0x10, %r15
jmp 0x9041
movq %rbx, %rdi
callq 0x54f0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x5600