LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_collect
void janet_collect(void) {
    uint32_t i;
    if (janet_vm.gc_suspend) return;
    depth = JANET_RECURSION_GUARD;
    janet_vm.gc_mark_phase = 1;
    /* Try to prevent many major collections back to back.
     * A full collection will take O(janet_vm.block_count) time.
     * If we have a large heap, make sure our interval is not too
     * small so we won't make many collections over it. This is just a
     * heuristic for automatically changing the gc interval */
    if (janet_vm.block_count * 8 > janet_vm.gc_interval) {
        janet_vm.gc_interval = janet_vm.block_count * sizeof(JanetGCObject);
    }
    orig_rootcount = janet_vm.root_count;
#ifdef JANET_EV
    janet_ev_mark();
#endif
    janet_mark_fiber(janet_vm.root_fiber);
    for (i = 0; i < orig_rootcount; i++)
        janet_mark(janet_vm.roots[i]);
    while (orig_rootcount < janet_vm.root_count) {
        Janet x = janet_vm.roots[--janet_vm.root_count];
        janet_mark(x);
    }
    janet_vm.gc_mark_phase = 0;
    janet_sweep();
    janet_vm.next_collection = 0;
    janet_free_all_scratch();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
cmpl $0x0, 0xb8(%rax)
je 0x2929a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %fs:0x0, %rax
movl $0x400, -0x358(%rax)    # imm = 0x400
movl $0x1, 0xbc(%rbx)
movq 0xb0(%rbx), %rcx
leaq (,%rcx,8), %rdx
cmpq 0xa0(%rbx), %rdx
jbe 0x292e0
shlq $0x4, %rcx
movq %rcx, 0xa0(%rbx)
movq 0xc8(%rbx), %rcx
leaq -0x350(%rax), %r14
movq %rcx, (%r14)
callq 0x209d6
movq 0x28(%rbx), %rdi
callq 0x28aa7
xorl %eax, %eax
movl %eax, %r15d
movq (%r14), %rax
cmpq %r15, %rax
jbe 0x29341
movq 0xc0(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x28843
leal 0x1(%r15), %eax
jmp 0x29301
movq 0xc0(%rbx), %rax
leaq -0x1(%rcx), %rdx
movq %rdx, 0xc8(%rbx)
movq -0x8(%rax,%rcx,8), %rdi
callq 0x28843
movq (%r14), %rax
movq 0xc8(%rbx), %rcx
cmpq %rcx, %rax
jb 0x29322
andl $0x0, 0xbc(%rbx)
callq 0x28cd4
andq $0x0, 0xa8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2936d
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_gcunroot
int janet_gcunroot(Janet root) {
    Janet *vtop = janet_vm.roots + janet_vm.root_count;
    /* Search from top to bottom as access is most likely LIFO */
    for (Janet *v = janet_vm.roots; v < vtop; v++) {
        if (janet_gc_idequals(root, *v)) {
            *v = janet_vm.roots[--janet_vm.root_count];
            return 1;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
movq 0xc0(%rax), %r15
movq 0xc8(%rax), %rax
leaq (%r15,%rax,8), %r12
cmpq %r12, %r15
jae 0x29423
movq (%r15), %rsi
movq %r14, %rdi
callq 0x29434
testl %eax, %eax
jne 0x29402
addq $0x8, %r15
jmp 0x293e8
movq 0xc0(%rbx), %rax
movq 0xc8(%rbx), %rcx
leaq -0x1(%rcx), %rdx
movq %rdx, 0xc8(%rbx)
movq -0x8(%rax,%rcx,8), %rax
movq %rax, (%r15)
xorl %eax, %eax
cmpq %r12, %r15
setb %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_gcunrootall
int janet_gcunrootall(Janet root) {
    Janet *vtop = janet_vm.roots + janet_vm.root_count;
    int ret = 0;
    /* Search from top to bottom as access is most likely LIFO */
    for (Janet *v = janet_vm.roots; v < vtop; v++) {
        if (janet_gc_idequals(root, *v)) {
            *v = janet_vm.roots[--janet_vm.root_count];
            vtop--;
            ret = 1;
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %r14
movq 0xc0(%rax), %r12
movq 0xc8(%rax), %rax
leaq (%r12,%rax,8), %r13
xorl %r15d, %r15d
cmpq %r13, %r12
jae 0x29517
movq (%r12), %rsi
movq %rbx, %rdi
callq 0x29434
testl %eax, %eax
je 0x29511
movq 0xc0(%r14), %rax
movq 0xc8(%r14), %rcx
leaq -0x1(%rcx), %rdx
movq %rdx, 0xc8(%r14)
movq -0x8(%rax,%rcx,8), %rax
movq %rax, (%r12)
addq $-0x8, %r13
pushq $0x1
popq %r15
addq $0x8, %r12
jmp 0x294d2
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_clear_memory
void janet_clear_memory(void) {
#ifdef JANET_EV
    JanetKV *items = janet_vm.threaded_abstracts.data;
    for (int32_t i = 0; i < janet_vm.threaded_abstracts.capacity; i++) {
        if (janet_checktype(items[i].key, JANET_ABSTRACT)) {
            void *abst = janet_unwrap_abstract(items[i].key);
            if (0 == janet_abstract_decref(abst)) {
                JanetAbstractHead *head = janet_abstract_head(abst);
                if (head->type->gc) {
                    janet_assert(!head->type->gc(head->data, head->size), "finalizer failed");
                }
                janet_free(janet_abstract_head(abst));
            }
        }
    }
#endif
    JanetGCObject *current = janet_vm.blocks;
    while (NULL != current) {
        janet_deinit_block(current);
        JanetGCObject *next = current->data.next;
        janet_free(current);
        current = next;
    }
    janet_vm.blocks = NULL;
    janet_free_all_scratch();
    janet_free(janet_vm.scratch_mem);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
movq 0x288(%rax), %r15
xorl %r12d, %r12d
movslq 0x27c(%rbx), %rax
cmpq %rax, %r12
jge 0x295b1
movq (%r15), %rdi
movq %rdi, %rax
shrq $0x2f, %rax
cmpl $0x1fffe, %eax          # imm = 0x1FFFE
jne 0x295a8
callq 0x4b1f1
movq %rax, %r14
movq %rax, %rdi
callq 0x12f5a
testl %eax, %eax
jne 0x295a8
movq -0x10(%r14), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x2959c
movq -0x8(%r14), %rsi
movq %r14, %rdi
callq *%rax
testl %eax, %eax
jne 0x295f7
addq $-0x20, %r14
movq %r14, %rdi
callq 0x120b0
incq %r12
addq $0x10, %r15
jmp 0x29551
movq 0x90(%rbx), %r14
testq %r14, %r14
je 0x295d6
movq %r14, %rdi
callq 0x2907e
movq 0x8(%r14), %r15
movq %r14, %rdi
callq 0x120b0
movq %r15, %r14
jmp 0x295b8
andq $0x0, 0x90(%rbx)
callq 0x2936d
movq 0xd8(%rbx), %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x120b0
movq 0x569f2(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x26a08(%rip), %rsi     # 0x50010
leaq 0x30721(%rip), %rcx     # 0x59d30
leaq 0x30728(%rip), %r8      # 0x59d3e
movl $0x2a6, %edx            # imm = 0x2A6
xorl %eax, %eax
callq 0x125e0
callq 0x12100
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_smalloc
void *janet_smalloc(size_t size) {
    JanetScratch *s = janet_malloc(sizeof(JanetScratch) + size);
    if (NULL == s) {
        JANET_OUT_OF_MEMORY;
    }
    s->finalize = NULL;
    if (janet_vm.scratch_len == janet_vm.scratch_cap) {
        size_t newcap = 2 * janet_vm.scratch_cap + 2;
        JanetScratch **newmem = (JanetScratch **) janet_realloc(janet_vm.scratch_mem, newcap * sizeof(JanetScratch));
        if (NULL == newmem) {
            JANET_OUT_OF_MEMORY;
        }
        janet_vm.scratch_cap = newcap;
        janet_vm.scratch_mem = newmem;
    }
    janet_vm.scratch_mem[janet_vm.scratch_len++] = s;
    return (char *)(s->mem);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
addq $0x8, %rdi
callq 0x12760
testq %rax, %rax
je 0x2971d
movq %rax, %rbx
andq $0x0, (%rax)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %r14
movq 0xe8(%rax), %r15
cmpq 0xe0(%rax), %r15
jne 0x296f5
leaq (%r15,%r15), %rax
movq 0xd8(%r14), %rdi
leaq 0x10(,%rax,8), %rsi
callq 0x12840
testq %rax, %rax
je 0x2973c
leaq 0x2(,%r15,2), %rcx
movq %rcx, 0xe0(%r14)
movq %rax, 0xd8(%r14)
movq 0xe8(%r14), %r15
jmp 0x296fc
movq 0xd8(%r14), %rax
leaq 0x1(%r15), %rcx
movq %rcx, 0xe8(%r14)
movq %rbx, (%rax,%r15,8)
addq $0x8, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x568cc(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x238d6(%rip), %rsi     # 0x4d004
leaq 0x305fb(%rip), %rdx     # 0x59d30
movl $0x2c8, %ecx            # imm = 0x2C8
jmp 0x29759
movq 0x568ad(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x238b7(%rip), %rsi     # 0x4d004
leaq 0x305dc(%rip), %rdx     # 0x59d30
movl $0x2cf, %ecx            # imm = 0x2CF
xorl %eax, %eax
callq 0x125e0
pushq $0x1
popq %rdi
callq 0x12a60
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_scalloc
void *janet_scalloc(size_t nmemb, size_t size) {
    if (nmemb && size > SIZE_MAX / nmemb) {
        JANET_OUT_OF_MEMORY;
    }
    size_t n = nmemb * size;
    void *p = janet_smalloc(n);
    memset(p, 0, n);
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rdi, %rdi
je 0x2977e
movq %rdi, %rax
mulq %rbx
jo 0x2979d
imulq %rdi, %rbx
movq %rbx, %rdi
callq 0x29673
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x12410
movq 0x5684c(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x23856(%rip), %rsi     # 0x4d004
leaq 0x3057b(%rip), %rdx     # 0x59d30
movl $0x2da, %ecx            # imm = 0x2DA
xorl %eax, %eax
callq 0x125e0
pushq $0x1
popq %rdi
callq 0x12a60
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_srealloc
void *janet_srealloc(void *mem, size_t size) {
    if (NULL == mem) return janet_smalloc(size);
    JanetScratch *s = janet_mem2scratch(mem);
    if (janet_vm.scratch_len) {
        for (size_t i = janet_vm.scratch_len - 1; ; i--) {
            if (janet_vm.scratch_mem[i] == s) {
                JanetScratch *news = janet_realloc(s, size + sizeof(JanetScratch));
                if (NULL == news) {
                    JANET_OUT_OF_MEMORY;
                }
                janet_vm.scratch_mem[i] = news;
                return (char *)(news->mem);
            }
            if (i == 0) break;
        }
    }
    JANET_EXIT("invalid janet_srealloc");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
testq %rdi, %rdi
je 0x2987b
movq %rdi, %r15
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0xe8(%rax), %r12
testq %r12, %r12
je 0x2981f
movq %rax, %r14
addq $-0x8, %r15
movq 0xd8(%rax), %rax
movq %r12, %rcx
decq %r12
cmpq %r15, -0x8(%rax,%rcx,8)
je 0x2984f
testq %r12, %r12
jne 0x2980d
movq 0x567ca(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x267e0(%rip), %rsi     # 0x50010
leaq 0x304f9(%rip), %rcx     # 0x59d30
leaq 0x30534(%rip), %r8      # 0x59d72
movl $0x2f2, %edx            # imm = 0x2F2
xorl %eax, %eax
callq 0x125e0
callq 0x12100
addq $0x8, %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x12840
testq %rax, %rax
je 0x2988b
movq 0xd8(%r14), %rcx
movq %rax, (%rcx,%r12,8)
addq $0x8, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x29673
movq 0x5675e(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x23768(%rip), %rsi     # 0x4d004
leaq 0x3048d(%rip), %rdx     # 0x59d30
movl $0x2ea, %ecx            # imm = 0x2EA
xorl %eax, %eax
callq 0x125e0
pushq $0x1
popq %rdi
callq 0x12a60
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_sfree
void janet_sfree(void *mem) {
    if (NULL == mem) return;
    JanetScratch *s = janet_mem2scratch(mem);
    if (janet_vm.scratch_len) {
        for (size_t i = janet_vm.scratch_len - 1; ; i--) {
            if (janet_vm.scratch_mem[i] == s) {
                janet_vm.scratch_mem[i] = janet_vm.scratch_mem[--janet_vm.scratch_len];
                free_one_scratch(s);
                return;
            }
            if (i == 0) break;
        }
    }
    JANET_EXIT("invalid janet_sfree");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2995e
movq %rdi, %rbx
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0xe8(%rax), %rcx
testq %rcx, %rcx
je 0x2990f
addq $-0x8, %rbx
movq 0xd8(%rax), %rdx
movq %rcx, %rsi
movq %rsi, %rdi
decq %rsi
cmpq %rbx, -0x8(%rdx,%rdi,8)
je 0x2993f
testq %rsi, %rsi
jne 0x298fd
movq 0x566da(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x266f0(%rip), %rsi     # 0x50010
leaq 0x30409(%rip), %rcx     # 0x59d30
leaq 0x3045b(%rip), %r8      # 0x59d89
movl $0x307, %edx            # imm = 0x307
xorl %eax, %eax
callq 0x125e0
callq 0x12100
leaq -0x1(%rcx), %rdi
movq %rdi, 0xe8(%rax)
movq -0x8(%rdx,%rcx,8), %rax
movq %rax, (%rdx,%rsi,8)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x29965
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_mark_many
static void janet_mark_many(const Janet *values, int32_t n) {
    if (values == NULL)
        return;
    const Janet *end = values + n;
    while (values < end) {
        janet_mark(*values);
        values += 1;
    }
}

// Assembly:
testq %rdi, %rdi
je 0x299b7
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movslq %esi, %rax
leaq (%rdi,%rax,8), %r14
cmpq %r14, %rbx
jae 0x299b3
movq (%rbx), %rdi
callq 0x28843
addq $0x8, %rbx
jmp 0x299a0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_mark_kvs
static void janet_mark_kvs(const JanetKV *kvs, int32_t n) {
    const JanetKV *end = kvs + n;
    while (kvs < end) {
        janet_mark(kvs->key);
        janet_mark(kvs->value);
        kvs++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movslq %esi, %r14
shlq $0x4, %r14
addq %rdi, %r14
cmpq %r14, %rbx
jae 0x299e8
movq (%rbx), %rdi
callq 0x28843
movq 0x8(%rbx), %rdi
callq 0x28843
addq $0x10, %rbx
jmp 0x299cc
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_mark_funcenv
static void janet_mark_funcenv(JanetFuncEnv *env) {
    if (janet_gc_reachable(env))
        return;
    janet_gc_mark(env);
    /* If closure env references a dead fiber, we can just copy out the stack frame we need so
     * we don't need to keep around the whole dead fiber. */
    janet_env_maybe_detach(env);
    if (env->offset > 0) {
        /* On stack */
        janet_mark_fiber(env->as.fiber);
    } else {
        /* Not on stack */
        janet_mark_many(env->as.values, env->length);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl (%rdi), %eax
btl $0x8, %eax
jb 0x29a1f
movq %rdi, %rbx
orl $0x100, %eax            # imm = 0x100
movl %eax, (%rdi)
callq 0x27501
cmpl $0x0, 0x1c(%rbx)
movq 0x10(%rbx), %rdi
jle 0x29a26
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x28aa7
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl 0x18(%rbx), %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2998a
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/gc.c
// Function: janet_mark_funcdef
static void janet_mark_funcdef(JanetFuncDef *def) {
    int32_t i;
    if (janet_gc_reachable(def))
        return;
    janet_gc_mark(def);
    janet_mark_many(def->constants, def->constants_length);
    for (i = 0; i < def->defs_length; ++i) {
        janet_mark_funcdef(def->defs[i]);
    }
    if (def->source)
        janet_mark_string(def->source);
    if (def->name)
        janet_mark_string(def->name);
    if (def->symbolmap) {
        for (int i = 0; i < def->symbolmap_length; i++) {
            janet_mark_string(def->symbolmap[i].symbol);
        }
    }

}

// Assembly:
movl (%rdi), %eax
btl $0x8, %eax
jb 0x29ac7
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
orl $0x100, %eax            # imm = 0x100
movl %eax, (%rdi)
movq 0x18(%rdi), %rdi
movl 0x6c(%rbx), %esi
callq 0x2998a
xorl %r14d, %r14d
movslq 0x78(%rbx), %rax
cmpq %rax, %r14
jge 0x29a7b
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x29a34
incq %r14
jmp 0x29a60
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x29a88
orb $0x1, -0x17(%rax)
movq 0x48(%rbx), %rax
testq %rax, %rax
je 0x29a95
orb $0x1, -0x17(%rax)
movq 0x50(%rbx), %rax
testq %rax, %rax
je 0x29ac3
movl 0x7c(%rbx), %edx
xorl %ecx, %ecx
testl %edx, %edx
cmovlel %ecx, %edx
imulq $0x18, %rdx, %rdx
cmpq %rcx, %rdx
je 0x29ac3
movq 0x10(%rax,%rcx), %rsi
orl $0x100, -0x18(%rsi)     # imm = 0x100
addq $0x18, %rcx
jmp 0x29aac
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/inttypes.c
// Function: janet_unwrap_s64
int64_t janet_unwrap_s64(Janet x) {
    switch (janet_type(x)) {
        default:
            break;
        case JANET_NUMBER : {
            double d = janet_unwrap_number(x);
            if (!janet_checkint64range(d)) break;
            return (int64_t) d;
        }
        case JANET_STRING: {
            int64_t value;
            const uint8_t *str = janet_unwrap_string(x);
            if (janet_scan_int64(str, janet_string_length(str), &value))
                return value;
            break;
        }
        case JANET_ABSTRACT: {
            void *abst = janet_unwrap_abstract(x);
            if (janet_abstract_type(abst) == &janet_s64_type ||
                    (janet_abstract_type(abst) == &janet_u64_type))
                return *(int64_t *)abst;
            break;
        }
    }
    janet_panicf("can not convert %t %q to 64 bit signed integer", x, x);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, %xmm0
movq %rdi, %rcx
shrq $0x2f, %rcx
andl $0xf, %ecx
xorl %eax, %eax
ucomisd %xmm0, %xmm0
cmovpl %ecx, %eax
cmpl $0xe, %eax
je 0x29ceb
cmpl $0x4, %eax
je 0x29cca
testl %eax, %eax
jne 0x29d19
movapd 0x300fc(%rip), %xmm1    # 0x59da0
andpd %xmm0, %xmm1
movsd 0x30100(%rip), %xmm2    # 0x59db0
ucomisd %xmm1, %xmm2
jb 0x29d19
cvttsd2si %xmm0, %rax
cvtsi2sd %rax, %xmm1
ucomisd %xmm1, %xmm0
jne 0x29d19
jnp 0x29d12
jmp 0x29d19
movq %rbx, %rdi
callq 0x4b1f1
movl -0x8(%rax), %esi
leaq -0x10(%rbp), %rdx
movq %rax, %rdi
callq 0x428a6
testl %eax, %eax
je 0x29d19
movq -0x10(%rbp), %rax
jmp 0x29d12
movq %rbx, %rdi
callq 0x4b1f1
movq -0x10(%rax), %rcx
cmpq 0x562d2(%rip), %rcx     # 0x7ffd0
setne %dl
cmpq 0x562c0(%rip), %rcx     # 0x7ffc8
setne %cl
testb %cl, %dl
jne 0x29d19
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x300c2(%rip), %rdi     # 0x59de2
movq %rbx, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x176c9
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/inttypes.c
// Function: janet_unwrap_u64
uint64_t janet_unwrap_u64(Janet x) {
    switch (janet_type(x)) {
        default:
            break;
        case JANET_NUMBER : {
            double d = janet_unwrap_number(x);
            if (!janet_checkuint64range(d)) break;
            return (uint64_t) d;
        }
        case JANET_STRING: {
            uint64_t value;
            const uint8_t *str = janet_unwrap_string(x);
            if (janet_scan_uint64(str, janet_string_length(str), &value))
                return value;
            break;
        }
        case JANET_ABSTRACT: {
            void *abst = janet_unwrap_abstract(x);
            if (janet_abstract_type(abst) == &janet_s64_type ||
                    (janet_abstract_type(abst) == &janet_u64_type))
                return *(uint64_t *)abst;
            break;
        }
    }
    janet_panicf("can not convert %t %q to a 64 bit unsigned integer", x, x);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, %xmm0
movq %rdi, %rcx
shrq $0x2f, %rcx
andl $0xf, %ecx
xorl %eax, %eax
ucomisd %xmm0, %xmm0
cmovpl %ecx, %eax
cmpl $0xe, %eax
je 0x29df3
cmpl $0x4, %eax
je 0x29dd2
testl %eax, %eax
jne 0x29e21
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x29e21
movsd 0x30036(%rip), %xmm1    # 0x59db0
ucomisd %xmm0, %xmm1
jb 0x29e21
cvttsd2si %xmm0, %rcx
movq %rcx, %rdx
movapd %xmm0, %xmm1
subsd 0x26300(%rip), %xmm1    # 0x50098
sarq $0x3f, %rdx
cvttsd2si %xmm1, %rax
andq %rdx, %rax
orq %rcx, %rax
movq %rax, %xmm1
punpckldq 0x26a8c(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x26a94(%rip), %xmm1    # 0x50850
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jne 0x29e21
jnp 0x29e1a
jmp 0x29e21
movq %rbx, %rdi
callq 0x4b1f1
movl -0x8(%rax), %esi
leaq -0x10(%rbp), %rdx
movq %rax, %rdi
callq 0x42a74
testl %eax, %eax
je 0x29e21
movq -0x10(%rbp), %rax
jmp 0x29e1a
movq %rbx, %rdi
callq 0x4b1f1
movq -0x10(%rax), %rcx
cmpq 0x561ca(%rip), %rcx     # 0x7ffd0
setne %dl
cmpq 0x561b8(%rip), %rcx     # 0x7ffc8
setne %cl
testb %cl, %dl
jne 0x29e21
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x2ffe9(%rip), %rdi     # 0x59e11
movq %rbx, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x176c9
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/inttypes.c
// Function: janet_lib_inttypes
void janet_lib_inttypes(JanetTable *env) {
    JanetRegExt it_cfuns[] = {
        JANET_CORE_REG("int/s64", cfun_it_s64_new),
        JANET_CORE_REG("int/u64", cfun_it_u64_new),
        JANET_CORE_REG("int/to-number", cfun_to_number),
        JANET_CORE_REG("int/to-bytes", cfun_to_bytes),
        JANET_REG_END
    };
    janet_core_cfuns_ext(env, NULL, it_cfuns);
    janet_register_abstract_type(&janet_s64_type);
    janet_register_abstract_type(&janet_u64_type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x5238d(%rip), %rsi     # 0x7c520
leaq -0xe0(%rbp), %r14
movl $0xc8, %edx
movq %r14, %rdi
callq 0x12670
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x452db
leaq 0x52285(%rip), %rdi     # 0x7c440
callq 0x455ed
leaq 0x522e9(%rip), %rdi     # 0x7c4b0
callq 0x455ed
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/inttypes.c
// Function: cfun_it_s64_divf
static Janet cfun_it_s64_divf(int32_t argc, Janet *argv) {
    janet_fixarity(argc, 2);
    int64_t *box = janet_abstract(&janet_s64_type, sizeof(int64_t));
    int64_t op1 = janet_unwrap_s64(argv[0]);
    int64_t op2 = janet_unwrap_s64(argv[1]);
    if (op2 == 0) janet_panic("division by zero");
    int64_t x = op1 / op2;
    *box = x - (((op1 ^ op2) < 0) && (x * op2 != op1));
    return janet_wrap_abstract(box);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
pushq $0x2
popq %rsi
callq 0x17801
leaq 0x51f37(%rip), %rdi     # 0x7c440
pushq $0x8
popq %rsi
callq 0x12d92
movq %rax, %rbx
movq (%r15), %rdi
callq 0x29c6d
movq %rax, %r14
movq 0x8(%r15), %rdi
callq 0x29c6d
testq %rax, %rax
je 0x2a572
movq %rax, %rcx
movq %r14, %rax
cqto
idivq %rcx
movq %rax, %rdx
imulq %rcx, %rdx
xorq %r14, %rcx
sets %cl
cmpq %r14, %rdx
setne %dl
andb %cl, %dl
movzbl %dl, %ecx
subq %rcx, %rax
movq %rax, (%rbx)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4b3ab
leaq 0x2fa3b(%rip), %rdi     # 0x59fb4
callq 0x177b1
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/inttypes.c
// Function: cfun_it_s64_mod
static Janet cfun_it_s64_mod(int32_t argc, Janet *argv) {
    janet_fixarity(argc, 2);
    int64_t *box = janet_abstract(&janet_s64_type, sizeof(int64_t));
    int64_t op1 = janet_unwrap_s64(argv[0]);
    int64_t op2 = janet_unwrap_s64(argv[1]);
    if (op2 == 0) {
        *box = op1;
    } else {
        int64_t x = op1 % op2;
        *box = (((op1 ^ op2) < 0) && (x != 0)) ? x + op2 : x;
    }
    return janet_wrap_abstract(box);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
pushq $0x2
popq %rsi
callq 0x17801
leaq 0x51e18(%rip), %rdi     # 0x7c440
pushq $0x8
popq %rsi
callq 0x12d92
movq %rax, %rbx
movq (%r15), %rdi
callq 0x29c6d
movq %rax, %r14
movq 0x8(%r15), %rdi
callq 0x29c6d
testq %rax, %rax
je 0x2a66b
movq %rax, %rcx
movq %r14, %rax
cqto
idivq %rcx
xorq %rcx, %r14
testq %rdx, %rdx
cmoveq %rdx, %rcx
sarq $0x3f, %r14
andq %rcx, %r14
addq %rdx, %r14
movq %r14, (%rbx)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4b3ab
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/inttypes.c
// Function: cfun_it_s64_compare
static Janet cfun_it_s64_compare(int32_t argc, Janet *argv) {
    janet_fixarity(argc, 2);
    if (janet_is_int(argv[0]) != JANET_INT_S64) {
        janet_panic("compare method requires int/s64 as first argument");
    }
    int64_t x = janet_unwrap_s64(argv[0]);
    switch (janet_type(argv[1])) {
        default:
            break;
        case JANET_NUMBER : {
            double y = janet_unwrap_number(argv[1]);
            return janet_wrap_number(compare_int64_double(x, y));
        }
        case JANET_ABSTRACT: {
            void *abst = janet_unwrap_abstract(argv[1]);
            if (janet_abstract_type(abst) == &janet_s64_type) {
                int64_t y = *(int64_t *)abst;
                return janet_wrap_number((x < y) ? -1 : (x > y ? 1 : 0));
            } else if (janet_abstract_type(abst) == &janet_u64_type) {
                uint64_t y = *(uint64_t *)abst;
                if (x < 0) {
                    return janet_wrap_number(-1);
                } else if (y > INT64_MAX) {
                    return janet_wrap_number(-1);
                } else {
                    int64_t y2 = (int64_t) y;
                    return janet_wrap_number((x < y2) ? -1 : (x > y2 ? 1 : 0));
                }
            }
            break;
        }
    }
    return janet_wrap_nil();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
pushq $0x2
popq %rsi
callq 0x17801
movq (%r14), %rdi
callq 0x29e35
cmpl $0x1, %eax
jne 0x2abb9
movq (%r14), %rdi
callq 0x29c6d
movq %rax, %rbx
movsd 0x8(%r14), %xmm0
ucomisd %xmm0, %xmm0
jp 0x2abc5
movapd 0x2f254(%rip), %xmm1    # 0x59da0
andpd %xmm0, %xmm1
movsd 0x2f258(%rip), %xmm2    # 0x59db0
ucomisd %xmm1, %xmm2
jbe 0x2ab78
cvtsi2sd %rbx, %xmm1
xorl %ecx, %ecx
ucomisd %xmm0, %xmm1
seta %cl
ucomisd %xmm1, %xmm0
pushq $-0x1
popq %rax
cmovbel %ecx, %eax
jmp 0x2abac
ucomisd 0x25518(%rip), %xmm0    # 0x50098
jbe 0x2ab86
pushq $-0x1
jmp 0x2ab96
movsd 0x2f232(%rip), %xmm1    # 0x59dc0
ucomisd %xmm0, %xmm1
jbe 0x2ab99
pushq $0x1
popq %rax
jmp 0x2abac
cvttsd2si %xmm0, %rax
xorl %ecx, %ecx
cmpq %rax, %rbx
setg %cl
pushq $-0x1
popq %rax
cmovgel %ecx, %eax
cvtsi2sd %eax, %xmm0
popq %rbx
popq %r14
popq %rbp
jmp 0x4b471
leaq 0x2f41d(%rip), %rdi     # 0x59fdd
callq 0x177b1
movq %xmm0, %rdi
movq %rdi, %rax
shrq $0x2f, %rax
andl $0xf, %eax
je 0x2abac
cmpl $0xe, %eax
jne 0x2abf6
callq 0x4b1f1
movq -0x10(%rax), %rcx
cmpq 0x553e5(%rip), %rcx     # 0x7ffd0
je 0x2ac09
cmpq 0x553d4(%rip), %rcx     # 0x7ffc8
je 0x2ac14
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
popq %rbx
popq %r14
popq %rbp
jmp 0x4b313
cmpq (%rax), %rbx
jg 0x2ac2c
xorpd %xmm0, %xmm0
jmp 0x2ac34
testq %rbx, %rbx
js 0x2ac3a
movq (%rax), %rax
testq %rax, %rax
js 0x2ac3a
cmpq %rax, %rbx
ja 0x2ac47
xorpd %xmm0, %xmm0
jmp 0x2ac4f
movsd 0x256e4(%rip), %xmm0    # 0x50318
jge 0x2abb0
movsd 0x256de(%rip), %xmm0    # 0x50320
jmp 0x2abb0
movsd 0x256c9(%rip), %xmm0    # 0x50318
jae 0x2abb0
jmp 0x2ac3a
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/io.c
// Function: io_file_marshal
static void io_file_marshal(void *p, JanetMarshalContext *ctx) {
    JanetFile *iof = (JanetFile *)p;
    if (ctx->flags & JANET_MARSHAL_UNSAFE) {
        janet_marshal_abstract(ctx, p);
#ifdef JANET_WINDOWS
        janet_marshal_int(ctx, _fileno(iof->file));
#else
        janet_marshal_int(ctx, fileno(iof->file));
#endif
        janet_marshal_int(ctx, iof->flags);
    } else {
        janet_panic("cannot marshal file in safe mode");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testb $0x2, 0x12(%rsi)
je 0x2b5c3
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x2d938
movq (%r14), %rdi
callq 0x126f0
movq %rbx, %rdi
movl %eax, %esi
callq 0x2ccce
movl 0x8(%r14), %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2ccce
leaq 0x2f095(%rip), %rdi     # 0x5a65f
callq 0x177b1
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/io.c
// Function: io_file_unmarshal
static void *io_file_unmarshal(JanetMarshalContext *ctx) {
    if (ctx->flags & JANET_MARSHAL_UNSAFE) {
        JanetFile *iof = janet_unmarshal_abstract(ctx, sizeof(JanetFile));
        int32_t fd = janet_unmarshal_int(ctx);
        int32_t flags = janet_unmarshal_int(ctx);
        char fmt[4] = {0};
        int index = 0;
        if (flags & JANET_FILE_READ) fmt[index++] = 'r';
        if (flags & JANET_FILE_APPEND) {
            fmt[index++] = 'a';
        } else if (flags & JANET_FILE_WRITE) {
            fmt[index++] = 'w';
        }
#ifdef JANET_WINDOWS
        iof->file = _fdopen(fd, fmt);
#else
        iof->file = fdopen(fd, fmt);
#endif
        if (iof->file == NULL) {
            iof->flags = JANET_FILE_CLOSED;
        } else {
            iof->flags = flags;
        }
        return iof;
    } else {
        janet_panic("cannot unmarshal file in safe mode");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testb $0x2, 0x12(%rdi)
je 0x2b658
movq %rdi, %r14
pushq $0x10
popq %rsi
callq 0x2ee58
movq %rax, %rbx
movq %r14, %rdi
callq 0x2da50
movl %eax, %r15d
movq %r14, %rdi
callq 0x2da50
movl %eax, %r14d
andl $0x0, -0x1c(%rbp)
testb $0x2, %r14b
jne 0x2b613
leaq -0x1c(%rbp), %rax
jmp 0x2b61b
leaq -0x1b(%rbp), %rax
movb $0x72, -0x1(%rax)
movb $0x61, %cl
testb $0x4, %r14b
jne 0x2b62b
movb $0x77, %cl
testb $0x1, %r14b
je 0x2b62d
movb %cl, (%rax)
leaq -0x1c(%rbp), %rsi
movl %r15d, %edi
callq 0x12850
movq %rax, (%rbx)
testq %rax, %rax
pushq $0x20
popq %rax
cmovel %eax, %r14d
movl %r14d, 0x8(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f021(%rip), %rdi     # 0x5a680
callq 0x177b1
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/io.c
// Function: read_chunk
static void read_chunk(JanetFile *iof, JanetBuffer *buffer, int32_t nBytesMax) {
    if (!(iof->flags & (JANET_FILE_READ | JANET_FILE_UPDATE)))
        janet_panic("file is not readable");
    janet_buffer_extra(buffer, nBytesMax);
    size_t ntoread = nBytesMax;
    size_t nread = fread((char *)(buffer->data + buffer->count), 1, ntoread, iof->file);
    if (nread != ntoread && ferror(iof->file))
        janet_panic("could not read file");
    buffer->count += (int32_t) nread;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testb $0xa, 0x8(%rdi)
je 0x2bb24
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl %edx, %esi
callq 0x16095
movl %r15d, %r12d
movslq 0x10(%rbx), %rdi
addq 0x18(%rbx), %rdi
movq (%r14), %rcx
pushq $0x1
popq %rsi
movq %r12, %rdx
callq 0x121d0
movq %rax, %r15
cmpq %r12, %rax
je 0x2bb17
movq (%r14), %rdi
callq 0x121a0
testl %eax, %eax
jne 0x2bb30
addl %r15d, 0x10(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2eb0b(%rip), %rdi     # 0x5a636
callq 0x177b1
leaq 0x2eb14(%rip), %rdi     # 0x5a64b
callq 0x177b1
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/io.c
// Function: io_assert_writeable
static void io_assert_writeable(JanetFile *iof) {
    if (iof->flags & JANET_FILE_CLOSED)
        janet_panic("file is closed");
    if (!(iof->flags & (JANET_FILE_WRITE | JANET_FILE_APPEND | JANET_FILE_UPDATE)))
        janet_panic("file is not writeable");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x8(%rdi), %eax
testb $0x20, %al
jne 0x2bc5d
testb $0xd, %al
je 0x2bc69
popq %rbp
retq
leaq 0x2e760(%rip), %rdi     # 0x5a3c4
callq 0x177b1
leaq 0x2e787(%rip), %rdi     # 0x5a3f7
callq 0x177b1
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/io.c
// Function: janet_file_close
int janet_file_close(JanetFile *file) {
    int ret = 0;
    if (!(file->flags & (JANET_FILE_NOT_CLOSEABLE | JANET_FILE_CLOSED))) {
        ret = fclose(file->file);
        file->flags |= JANET_FILE_CLOSED;
        file->file = NULL; /* NULL dereference is easier to debug then other problems */
        return ret;
    }
    return 0;
}

// Assembly:
testb $0x30, 0x8(%rdi)
je 0x2bc7e
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x122b0
orb $0x20, 0x8(%rbx)
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/io.c
// Function: janet_dynfile
FILE *janet_dynfile(const char *name, FILE *def) {
    Janet x = janet_dyn(name);
    if (!janet_checktype(x, JANET_ABSTRACT)) return def;
    void *abstract = janet_unwrap_abstract(x);
    if (janet_abstract_type(abstract) != &janet_file_type) return def;
    JanetFile *iofile = abstract;
    return iofile->file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x1839c
movq %rax, %rcx
shrq $0x2f, %rcx
cmpl $0x1fffe, %ecx          # imm = 0x1FFFE
jne 0x2bea1
movq %rax, %rdi
callq 0x4b1f1
movq -0x10(%rax), %rcx
cmpq 0x540f4(%rip), %rcx     # 0x7ff90
jne 0x2bea1
movq (%rax), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/io.c
// Function: janet_flusher
static void janet_flusher(const char *name, FILE *dflt_file) {
    Janet x = janet_dyn(name);
    switch (janet_type(x)) {
        default:
            break;
        case JANET_NIL:
            fflush(dflt_file);
            break;
        case JANET_ABSTRACT: {
            void *abstract = janet_unwrap_abstract(x);
            if (janet_abstract_type(abstract) != &janet_file_type) break;
            JanetFile *iofile = abstract;
            fflush(iofile->file);
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x1839c
movq %rax, %xmm0
movq %rax, %rdx
shrq $0x2f, %rdx
andl $0xf, %edx
xorl %ecx, %ecx
ucomisd %xmm0, %xmm0
cmovpl %edx, %ecx
cmpl $0x1, %ecx
je 0x2c5e2
cmpl $0xe, %ecx
jne 0x2c5d8
movq %rax, %rdi
callq 0x4b1f1
movq -0x10(%rax), %rcx
cmpq 0x539ba(%rip), %rcx     # 0x7ff90
je 0x2c5df
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq (%rax), %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x12770
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/io.c
// Function: makef
static void *makef(FILE *f, int32_t flags) {
    JanetFile *iof = (JanetFile *) janet_abstract(&janet_file_type, sizeof(JanetFile));
    iof->file = f;
    iof->flags = flags;
#ifndef JANET_WINDOWS
    /* While we would like fopen to set cloexec by default (like O_CLOEXEC) with the e flag, that is
     * not standard. */
    if (!(flags & JANET_FILE_NOT_CLOSEABLE))
        fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
#endif
    return iof;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %r14
leaq 0x4fdc1(%rip), %rdi     # 0x7c5f0
pushq $0x10
popq %rsi
callq 0x12d92
movq %rax, %rbx
movq %r14, (%rax)
movl %r15d, 0x8(%rax)
testb $0x10, %r15b
jne 0x2c85e
movq %r14, %rdi
callq 0x126f0
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movl %eax, %edi
xorl %eax, %eax
callq 0x12910
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/marsh.c
// Function: janet_env_lookup_into
void janet_env_lookup_into(JanetTable *renv, JanetTable *env, const char *prefix, int recurse) {
    while (env) {
        for (int32_t i = 0; i < env->capacity; i++) {
            if (janet_checktype(env->data[i].key, JANET_SYMBOL)) {
                if (prefix) {
                    int32_t prelen = (int32_t) strlen(prefix);
                    const uint8_t *oldsym = janet_unwrap_symbol(env->data[i].key);
                    int32_t oldlen = janet_string_length(oldsym);
                    uint8_t *symbuf = janet_smalloc(prelen + oldlen);
                    safe_memcpy(symbuf, prefix, prelen);
                    safe_memcpy(symbuf + prelen, oldsym, oldlen);
                    Janet s = janet_symbolv(symbuf, prelen + oldlen);
                    janet_sfree(symbuf);
                    janet_table_put(renv, s, entry_getval(env->data[i].value));
                } else {
                    janet_table_put(renv,
                                    env->data[i].key,
                                    entry_getval(env->data[i].value));
                }
            }
        }
        env = recurse ? env->proto : NULL;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, -0x2c(%rbp)
movq %rdx, %r14
movq %rdi, -0x38(%rbp)
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
movq %r14, -0x48(%rbp)
testq %rsi, %rsi
je 0x2cb0d
movq %rsi, %rdi
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %rsi, -0x40(%rbp)
movslq 0x14(%rdi), %rax
cmpq %rax, %r15
jge 0x2caf5
movq 0x20(%rdi), %rbx
movq (%rbx,%r12), %r13
movq %r13, %rax
andq %rdx, %rax
movabsq $-0x5800000000000, %rcx # imm = 0xFFFA800000000000
cmpq %rcx, %rax
jne 0x2cae9
testq %r14, %r14
je 0x2cac1
movq %r14, %rdi
callq 0x12310
movq %rax, %rbx
movq %r13, %rdi
callq 0x4b1f1
movq %rax, %r13
movslq -0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movslq %ebx, %rbx
leaq (%rax,%rbx), %rdi
movq %rdi, -0x58(%rbp)
callq 0x29673
movq %rax, %r14
movq %rax, %rdi
movq -0x48(%rbp), %rsi
movq %rbx, %rdx
callq 0x44ae2
addq %r14, %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq -0x50(%rbp), %rdx
callq 0x44ae2
movq %r14, %rdi
movq -0x58(%rbp), %rsi
callq 0x437eb
movq %rax, %rdi
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
callq 0x4b366
movq %rax, %rbx
movq %r14, %rdi
movq -0x48(%rbp), %r14
callq 0x298c1
movq -0x40(%rbp), %r13
movq 0x20(%r13), %rax
movq 0x8(%rax,%r12), %rdi
callq 0x2cb1c
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x43e19
movq %r13, %rdi
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
jmp 0x2cae9
movq 0x8(%rbx,%r12), %rdi
callq 0x2cb1c
movq (%rbx,%r12), %rsi
movq -0x38(%rbp), %rdi
movq %rax, %rdx
callq 0x43e19
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
movq -0x40(%rbp), %rdi
incq %r15
addq $0x10, %r12
jmp 0x2c9db
movl $0x0, %esi
cmpl $0x0, -0x2c(%rbp)
je 0x2c9c5
movq 0x28(%rdi), %rsi
jmp 0x2c9c5
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/marsh.c
// Function: entry_getval
static Janet entry_getval(Janet env_entry) {
    if (janet_checktype(env_entry, JANET_TABLE)) {
        JanetTable *entry = janet_unwrap_table(env_entry);
        Janet checkval = janet_table_get(entry, janet_ckeywordv("value"));
        if (janet_checktype(checkval, JANET_NIL)) {
            checkval = janet_table_get(entry, janet_ckeywordv("ref"));
        }
        return checkval;
    } else if (janet_checktype(env_entry, JANET_STRUCT)) {
        const JanetKV *entry = janet_unwrap_struct(env_entry);
        Janet checkval = janet_struct_get(entry, janet_ckeywordv("value"));
        if (janet_checktype(checkval, JANET_NIL)) {
            checkval = janet_struct_get(entry, janet_ckeywordv("ref"));
        }
        return checkval;
    } else {
        return janet_wrap_nil();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movabsq $-0x800000000000, %r12  # imm = 0xFFFF800000000000
movabsq $-0x7800000000000, %rbx # imm = 0xFFF8800000000000
movq %rdi, %rax
andq %r12, %rax
movabsq $-0x3000000000000, %rcx # imm = 0xFFFD000000000000
cmpq %rcx, %rax
je 0x2cbcd
movabsq $-0x3800000000000, %rcx # imm = 0xFFFC800000000000
cmpq %rcx, %rax
jne 0x2cc3c
movabsq $-0x5000000000000, %r14 # imm = 0xFFFB000000000000
callq 0x4b1f1
movq %rax, %r15
leaq 0x2c48a(%rip), %rdi     # 0x59006
callq 0x439c6
movq %rax, %rdi
movq %r14, %rsi
callq 0x4b366
movq %r15, %rdi
movq %rax, %rsi
callq 0x43c35
andq %rax, %r12
cmpq %rbx, %r12
jne 0x2cc33
leaq 0x3752d(%rip), %rdi     # 0x640d7
callq 0x439c6
movq %rax, %rdi
movq %r14, %rsi
callq 0x4b366
movq %r15, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x43c35
movabsq $-0x5000000000000, %r14 # imm = 0xFFFB000000000000
callq 0x4b1f1
movq %rax, %r15
leaq 0x2c420(%rip), %rdi     # 0x59006
callq 0x439c6
movq %rax, %rdi
movq %r14, %rsi
callq 0x4b366
movq %r15, %rdi
movq %rax, %rsi
callq 0x430d3
andq %rax, %r12
cmpq %rbx, %r12
jne 0x2cc33
leaq 0x374c7(%rip), %rdi     # 0x640d7
callq 0x439c6
movq %rax, %rdi
movq %r14, %rsi
callq 0x4b366
movq %r15, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x430d3
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
incq %rbx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4b313
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/marsh.c
// Function: pushint
static void pushint(MarshalState *st, int32_t x) {
    if (x >= 0 && x < 128) {
        janet_buffer_push_u8(st->buf, x);
    } else if (x <= 8191 && x >= -8192) {
        uint8_t intbuf[2];
        intbuf[0] = ((x >> 8) & 0x3F) | 0x80;
        intbuf[1] = x & 0xFF;
        janet_buffer_push_bytes(st->buf, intbuf, 2);
    } else {
        uint8_t intbuf[5];
        intbuf[0] = LB_INTEGER;
        intbuf[1] = (x >> 24) & 0xFF;
        intbuf[2] = (x >> 16) & 0xFF;
        intbuf[3] = (x >> 8) & 0xFF;
        intbuf[4] = x & 0xFF;
        janet_buffer_push_bytes(st->buf, intbuf, 5);
    }
}

// Assembly:
movl %esi, %eax
cmpl $0x7f, %esi
ja 0x2ccea
movq (%rdi), %rdi
movzbl %al, %esi
jmp 0x161be
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leal 0x2000(%rax), %ecx
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x2cd1b
movl %eax, %ecx
shrl $0x8, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
leaq -0x2(%rbp), %rsi
movb %cl, (%rsi)
movb %al, 0x1(%rsi)
movq (%rdi), %rdi
pushq $0x2
jmp 0x2cd3d
leaq -0x7(%rbp), %rsi
movb $-0x33, (%rsi)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x1(%rsi)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x2(%rsi)
movb %ah, -0x4(%rbp)
movb %al, 0x4(%rsi)
movq (%rdi), %rdi
pushq $0x5
popq %rdx
callq 0x16172
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/marsh.c
// Function: janet_marshal_ptr
void janet_marshal_ptr(JanetMarshalContext *ctx, const void *ptr) {
    if (!(ctx->flags & JANET_MARSHAL_UNSAFE)) {
        janet_panic("can only marshal pointers in unsafe mode");
    }
    MarshalState *st = (MarshalState *)(ctx->m_state);
    pushpointer(st, ptr);
}

// Assembly:
testb $0x2, 0x12(%rdi)
je 0x2cd54
movq (%rdi), %rdi
jmp 0x2cd64
pushq %rbp
movq %rsp, %rbp
leaq 0x2ede2(%rip), %rdi     # 0x5bb41
callq 0x177b1
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/marsh.c
// Function: janet_marshal
void janet_marshal(
    JanetBuffer *buf,
    Janet x,
    JanetTable *rreg,
    int flags) {
    MarshalState st;
    st.buf = buf;
    st.nextid = 0;
    st.seen_defs = NULL;
    st.seen_envs = NULL;
    st.rreg = rreg;
    st.maybe_cycles = !(flags & JANET_MARSHAL_NO_CYCLES);
    janet_table_init(&st.seen, 0);
    marshal_one(&st, x, flags);
    janet_table_deinit(&st.seen);
    janet_v_free(st.seen_envs);
    janet_v_free(st.seen_defs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl %ecx, %ebx
movq %rsi, %r14
leaq -0x70(%rbp), %r15
movq %rdi, -0x8(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r15)
andl $0x0, 0x48(%r15)
movq %rdx, 0x30(%r15)
xorl %eax, %eax
btl $0x12, %ecx
setae %al
movl %eax, 0x4c(%r15)
movq %r15, %rdi
xorl %esi, %esi
callq 0x43ac0
leaq -0x78(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x2cddb
movq %r15, %rdi
callq 0x43b70
movq 0x40(%r12), %rdi
testq %rdi, %rdi
je 0x2da0f
addq $-0x8, %rdi
callq 0x298c1
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x2da21
addq $-0x8, %rdi
callq 0x298c1
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/marsh.c
// Function: readint
static int32_t readint(UnmarshalState *st, const uint8_t **atdata) {
    const uint8_t *data = *atdata;
    int32_t ret;
    MARSH_EOS(st, data);
    if (*data < 128) {
        ret = *data++;
    } else if (*data < 192) {
        MARSH_EOS(st, data + 1);
        uint32_t uret = ((data[0] & 0x3F) << 8) + data[1];
        /* Sign extend 18 MSBs */
        uret |= (uret >> 13) ? 0xFFFFC000 : 0;
        ret = (int32_t)uret;
        data += 2;
    } else if (*data == LB_INTEGER) {
        MARSH_EOS(st, data + 4);
        uint32_t ui = ((uint32_t)(data[1]) << 24) |
                      ((uint32_t)(data[2]) << 16) |
                      ((uint32_t)(data[3]) << 8) |
                      (uint32_t)(data[4]);
        ret = (int32_t)ui;
        data += 5;
    } else {
        janet_panicf("expected integer, got byte %x at index %d",
                     *data,
                     data - st->start);
        ret = 0;
    }
    *atdata = data;
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rsi), %rdx
movq 0xf0(%rdi), %rcx
cmpq %rcx, %rdx
jae 0x2dad1
movzbl (%rdx), %eax
testb %al, %al
js 0x2da80
pushq $0x1
jmp 0x2dac8
cmpb $-0x41, %al
ja 0x2dab1
leaq 0x1(%rdx), %rdi
cmpq %rcx, %rdi
jae 0x2dad1
andl $0x3f, %eax
shll $0x8, %eax
movzbl (%rdi), %ecx
xorl %edi, %edi
cmpl $0x2000, %eax           # imm = 0x2000
setb %dil
shll $0xe, %edi
orl %ecx, %edi
addl %edi, %eax
addl $0xffffc000, %eax       # imm = 0xFFFFC000
pushq $0x2
jmp 0x2dac8
cmpl $0xcd, %eax
jne 0x2dadd
leaq 0x4(%rdx), %rax
cmpq %rcx, %rax
jae 0x2dad1
movl 0x1(%rdx), %eax
bswapl %eax
pushq $0x5
popq %rcx
addq %rcx, %rdx
movq %rdx, (%rsi)
popq %rbp
retq
leaq 0x2e0b4(%rip), %rdi     # 0x5bb8c
callq 0x177b1
subq 0xe8(%rdi), %rdx
leaq 0x2e1ca(%rip), %rdi     # 0x5bcb5
movl %eax, %esi
xorl %eax, %eax
callq 0x176c9
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/marsh.c
// Function: janet_unmarshal_ptr
void *janet_unmarshal_ptr(JanetMarshalContext *ctx) {
    if (!(ctx->flags & JANET_MARSHAL_UNSAFE)) {
        janet_panic("can only unmarshal pointers in unsafe mode");
    }
    UnmarshalState *st = (UnmarshalState *)(ctx->u_state);
    void *ptr;
    MARSH_EOS(st, ctx->data + sizeof(void *) - 1);
    memcpy((char *) &ptr, ctx->data, sizeof(void *));
    ctx->data += sizeof(void *);
    return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testb $0x2, 0x12(%rdi)
je 0x2db9b
movq 0x8(%rdi), %rax
movq 0x18(%rdi), %rcx
leaq 0x7(%rcx), %rdx
cmpq 0xf0(%rax), %rdx
jae 0x2dba7
movq (%rcx), %rax
addq $0x8, %rcx
movq %rcx, 0x18(%rdi)
popq %rbp
retq
leaq 0x2e003(%rip), %rdi     # 0x5bba5
callq 0x177b1
leaq 0x2dfde(%rip), %rdi     # 0x5bb8c
callq 0x177b1
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/marsh.c
// Function: janet_unmarshal_bytes
void janet_unmarshal_bytes(JanetMarshalContext *ctx, uint8_t *dest, size_t len) {
    UnmarshalState *st = (UnmarshalState *)(ctx->u_state);
    MARSH_EOS(st, ctx->data + len - 1);
    safe_memcpy(dest, ctx->data, len);
    ctx->data += len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq 0x8(%rdi), %rcx
movq 0x18(%rdi), %rax
addq %rax, %rdx
decq %rdx
cmpq 0xf0(%rcx), %rdx
jae 0x2dc1a
movq %rdi, %r14
movq %rsi, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x44ae2
addq %rbx, 0x18(%r14)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2df6b(%rip), %rdi     # 0x5bb8c
callq 0x177b1