LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/math.c
// Function: janet_rng_unmarshal
static void *janet_rng_unmarshal(JanetMarshalContext *ctx) {
    JanetRNG *rng = janet_unmarshal_abstract(ctx, sizeof(JanetRNG));
    rng->a = (uint32_t) janet_unmarshal_int(ctx);
    rng->b = (uint32_t) janet_unmarshal_int(ctx);
    rng->c = (uint32_t) janet_unmarshal_int(ctx);
    rng->d = (uint32_t) janet_unmarshal_int(ctx);
    rng->counter = (uint32_t) janet_unmarshal_int(ctx);
    return rng;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x14, %esi
callq 0x30f6c
movq %rax, %r14
movq %rbx, %rdi
callq 0x30068
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x30068
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x30068
movl %eax, 0x8(%r14)
movq %rbx, %rdi
callq 0x30068
movl %eax, 0xc(%r14)
movq %rbx, %rdi
callq 0x30068
movl %eax, 0x10(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/math.c
// Function: janet_rng_seed
void janet_rng_seed(JanetRNG *rng, uint32_t seed) {
    rng->a = seed;
    rng->b = 0x97654321u;
    rng->c = 123871873u;
    rng->d = 0xf23f56c8u;
    rng->counter = 0u;
    /* First several numbers aren't that random. */
    for (int i = 0; i < 16; i++) janet_rng_u32(rng);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x97654321, %eax       # imm = 0x97654321
movl $0x7622281, %r10d       # imm = 0x7622281
movl $0xf23f56c8, %r9d       # imm = 0xF23F56C8
movl $0x10, %ecx
movl %eax, %edx
movl %r10d, %r8d
movl %esi, %eax
movl %r9d, %esi
shrl $0x2, %esi
xorl %r9d, %esi
movl %eax, %r9d
shll $0x4, %r9d
xorl %eax, %r9d
xorl %esi, %r9d
addl %esi, %esi
xorl %r9d, %esi
movl %r10d, %r9d
movl %edx, %r10d
decl %ecx
jne 0x32b12
movl %r8d, 0xc(%rdi)
movl %esi, (%rdi)
movl %edx, 0x8(%rdi)
movl %eax, 0x4(%rdi)
movl $0x587c50, 0x10(%rdi)   # imm = 0x587C50
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/math.c
// Function: janet_rng_longseed
void janet_rng_longseed(JanetRNG *rng, const uint8_t *bytes, int32_t len) {
    uint8_t state[16] = {0};
    for (int32_t i = 0; i < len; i++)
        state[i & 0xF] ^= bytes[i];
    rng->a = state[0] + ((uint32_t) state[1] << 8) + ((uint32_t) state[2] << 16) + ((uint32_t) state[3] << 24);
    rng->b = state[4] + ((uint32_t) state[5] << 8) + ((uint32_t) state[6] << 16) + ((uint32_t) state[7] << 24);
    rng->c = state[8] + ((uint32_t) state[9] << 8) + ((uint32_t) state[10] << 16) + ((uint32_t) state[11] << 24);
    rng->d = state[12] + ((uint32_t) state[13] << 8) + ((uint32_t) state[14] << 16) + ((uint32_t) state[15] << 24);
    rng->counter = 0u;
    /* a, b, c, d can't all be 0 */
    if (rng->a == 0) rng->a = 1u;
    for (int i = 0; i < 16; i++) janet_rng_u32(rng);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorps %xmm0, %xmm0
movaps %xmm0, -0x10(%rbp)
testl %edx, %edx
jle 0x32be2
movl %edx, %eax
xorl %ecx, %ecx
movb (%rsi,%rcx), %dl
movl %ecx, %r8d
andl $0xf, %r8d
xorb %dl, -0x10(%rbp,%r8)
incq %rcx
cmpq %rcx, %rax
jne 0x32ba5
movl -0x10(%rbp), %ecx
movl -0xc(%rbp), %eax
movl -0x8(%rbp), %r8d
movl -0x4(%rbp), %edx
movl %eax, 0x4(%rdi)
movl %r8d, 0x8(%rdi)
movl %edx, 0xc(%rdi)
movl $0x0, 0x10(%rdi)
cmpl $0x1, %ecx
adcl $0x0, %ecx
jmp 0x32bf2
movups %xmm0, 0x4(%rdi)
movl $0x1, %ecx
xorl %eax, %eax
xorl %r8d, %r8d
xorl %edx, %edx
movl $0x10, %esi
movl %eax, %r9d
movl %r8d, %r10d
movl %ecx, %eax
movl %edx, %ecx
shrl $0x2, %ecx
xorl %edx, %ecx
movl %eax, %edx
shll $0x4, %edx
xorl %eax, %edx
xorl %ecx, %edx
addl %ecx, %ecx
xorl %edx, %ecx
movl %r8d, %edx
movl %r9d, %r8d
decl %esi
jne 0x32bf7
movl %r10d, 0xc(%rdi)
movl %ecx, (%rdi)
movl %r9d, 0x8(%rdi)
movl %eax, 0x4(%rdi)
movl $0x587c50, 0x10(%rdi)   # imm = 0x587C50
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/math.c
// Function: janet_gcd
static double janet_gcd(double x, double y) {
    if (isnan(x) || isnan(y)) {
#ifdef NAN
        return NAN;
#else
        return 0.0 / 0.0;
#endif
    }
    if (isinf(x) || isinf(y)) return INFINITY;
    while (y != 0) {
        double temp = y;
        y = fmod(x, y);
        x = temp;
    }
    return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
ucomisd %xmm1, %xmm0
jp 0x33963
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
sete %al
movq %xmm1, %rdx
btrq $0x3f, %rdx
cmpq %rcx, %rdx
sete %cl
orb %al, %cl
je 0x33924
movsd 0x2567e(%rip), %xmm2    # 0x58fa0
jmp 0x33959
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x33930
jnp 0x33955
movsd %xmm1, -0x8(%rbp)
callq 0x124c0
xorpd %xmm3, %xmm3
movsd -0x8(%rbp), %xmm2
movapd %xmm0, %xmm1
ucomisd %xmm3, %xmm0
movapd %xmm2, %xmm0
jne 0x33930
jp 0x33930
jmp 0x33959
movapd %xmm0, %xmm2
movapd %xmm2, %xmm0
addq $0x10, %rsp
popq %rbp
retq
movsd 0x2c6d5(%rip), %xmm2    # 0x60040
jmp 0x33959
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/net.c
// Function: net_callback_connect
void net_callback_connect(JanetFiber *fiber, JanetAsyncEvent event) {
    JanetStream *stream = fiber->ev_stream;
    switch (event) {
        default:
            break;
#ifndef JANET_WINDOWS
        /* Wait until we have an actual event before checking.
         * Windows doesn't support async connect with this, just try immediately.*/
        case JANET_ASYNC_EVENT_INIT:
#endif
        case JANET_ASYNC_EVENT_DEINIT:
            return;
        case JANET_ASYNC_EVENT_CLOSE:
            janet_cancel(fiber, janet_cstringv("stream closed"));
            janet_async_end(fiber);
            return;
    }
#ifdef JANET_WINDOWS
    int res = 0;
    int size = sizeof(res);
    int r = getsockopt((SOCKET)stream->handle, SOL_SOCKET, SO_ERROR, (char *)&res, &size);
#else
    int res = 0;
    socklen_t size = sizeof res;
    int r = getsockopt(stream->handle, SOL_SOCKET, SO_ERROR, &res, &size);
#endif
    if (r == 0) {
        if (res == 0) {
            janet_schedule(fiber, janet_wrap_abstract(stream));
        } else {
            janet_cancel(fiber, janet_cstringv(janet_strerror(res)));
            stream->flags |= JANET_STREAM_TOCLOSE;
        }
    } else {
        janet_cancel(fiber, janet_ev_lasterr());
        stream->flags |= JANET_STREAM_TOCLOSE;
    }
    janet_async_end(fiber);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
testl %esi, %esi
je 0x33d65
cmpl $0x2, %esi
je 0x33d65
movq %rdi, %rbx
cmpl $0x3, %esi
jne 0x33cf1
leaq 0x26d4a(%rip), %rdi     # 0x5aa09
callq 0x4482c
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4ed39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2297e
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x22350
movq 0x58(%rbx), %r14
leaq -0x14(%rbp), %rcx
movl $0x0, (%rcx)
leaq -0x18(%rbp), %r8
movl $0x4, (%r8)
movl (%r14), %edi
movl $0x1, %esi
movl $0x4, %edx
callq 0x12560
testl %eax, %eax
je 0x33d27
callq 0x254ee
jmp 0x33d4d
movl -0x14(%rbp), %edi
testl %edi, %edi
je 0x33d6e
callq 0x49d9a
movq %rax, %rdi
callq 0x4482c
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4ed39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2297e
orb $0x1, 0x6(%r14)
movq %rbx, %rdi
callq 0x22350
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %r14, %rdi
callq 0x4ed7e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2298f
jmp 0x33d5d
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/net.c
// Function: janet_get_sockettype
static int janet_get_sockettype(Janet *argv, int32_t argc, int32_t n) {
    JanetKeyword stype = janet_optkeyword(argv, argc, n, NULL);
    int socktype = SOCK_DGRAM;
    if ((NULL == stype) || !janet_cstrcmp(stype, "stream")) {
        socktype = SOCK_STREAM;
    } else if (janet_cstrcmp(stype, "datagram")) {
        janet_panicf("expected socket type as :stream or :datagram, got %v", argv[n]);
    }
    return socktype;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x1963a
movl $0x1, %r14d
testq %rax, %rax
je 0x34133
movq %rax, %r15
leaq 0x2699f(%rip), %rsi     # 0x5aaad
movq %rax, %rdi
callq 0x4872e
testl %eax, %eax
je 0x34133
leaq 0x2e651(%rip), %rsi     # 0x62772
movq %r15, %rdi
callq 0x4872e
movl $0x2, %r14d
testl %eax, %eax
jne 0x34141
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rsi
leaq 0x2e62f(%rip), %rdi     # 0x6277b
xorl %eax, %eax
callq 0x190bb
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/net.c
// Function: serverify_socket
static const char *serverify_socket(JSock sfd, int reuse_addr, int reuse_port) {
    /* Set various socket options */
    int enable = 1;
    if (reuse_addr) {
        if (setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, (char *) &enable, sizeof(int)) < 0) {
            return "setsockopt(SO_REUSEADDR) failed";
        }
    }
    if (reuse_port) {
#ifdef SO_REUSEPORT
        if (setsockopt(sfd, SOL_SOCKET, SO_REUSEPORT, &enable, sizeof(int)) < 0) {
            return "setsockopt(SO_REUSEPORT) failed";
        }
#else
        (void) reuse_port;
#endif
    }
    janet_net_socknoblock(sfd);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %edi, %ebx
movl $0x1, -0x14(%rbp)
testl %esi, %esi
je 0x34945
leaq -0x14(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x121f0
testl %eax, %eax
js 0x34993
testl %r14d, %r14d
je 0x34969
leaq -0x14(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0xf, %edx
movl $0x4, %r8d
callq 0x121f0
testl %eax, %eax
js 0x3499c
xorl %r14d, %r14d
movl %ebx, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x12910
orl $0x800, %eax            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x12910
jmp 0x349a3
leaq 0x2de3a(%rip), %r14     # 0x627d4
jmp 0x349a3
leaq 0x2de51(%rip), %r14     # 0x627f4
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/net.c
// Function: janet_so_getname
static Janet janet_so_getname(const void *sa_any) {
    const struct sockaddr *sa = sa_any;
    char buffer[SA_ADDRSTRLEN];
    switch (sa->sa_family) {
        default:
            janet_panic("unknown address family");
        case AF_INET: {
            const struct sockaddr_in *sai = sa_any;
            if (!inet_ntop(AF_INET, &(sai->sin_addr), buffer, sizeof(buffer))) {
                janet_panic("unable to decode ipv4 host address");
            }
            Janet pair[2] = {janet_cstringv(buffer), janet_wrap_integer(ntohs(sai->sin_port))};
            return janet_wrap_tuple(janet_tuple_n(pair, 2));
        }
#ifndef JANET_NO_IPV6
        case AF_INET6: {
            const struct sockaddr_in6 *sai6 = sa_any;
            if (!inet_ntop(AF_INET6, &(sai6->sin6_addr), buffer, sizeof(buffer))) {
                janet_panic("unable to decode ipv4 host address");
            }
            Janet pair[2] = {janet_cstringv(buffer), janet_wrap_integer(ntohs(sai6->sin6_port))};
            return janet_wrap_tuple(janet_tuple_n(pair, 2));
        }
#endif
#ifndef JANET_WINDOWS
        case AF_UNIX: {
            const struct sockaddr_un *sun = sa_any;
            Janet pathname;
            if (sun->sun_path[0] == '\0') {
                memcpy(buffer, sun->sun_path, sizeof(sun->sun_path));
                buffer[0] = '@';
                pathname = janet_cstringv(buffer);
            } else {
                pathname = janet_cstringv(sun->sun_path);
            }
            return janet_wrap_tuple(janet_tuple_n(&pathname, 1));
        }
#endif
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movzwl (%rdi), %eax
cmpl $0x1, %eax
je 0x34b0d
cmpl $0x2, %eax
je 0x34aa3
cmpl $0xa, %eax
jne 0x34b8b
leaq 0x8(%rbx), %rsi
leaq -0x90(%rbp), %rdx
movl $0xa, %edi
jmp 0x34ab3
leaq 0x4(%rbx), %rsi
leaq -0x90(%rbp), %rdx
movl $0x2, %edi
movl $0x6d, %ecx
callq 0x12030
testq %rax, %rax
je 0x34b7f
leaq -0x90(%rbp), %rdi
callq 0x4482c
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4ed39
leaq -0x20(%rbp), %r14
movq %rax, (%r14)
movzwl 0x2(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
callq 0x4ee44
movq %rax, 0x8(%r14)
movq %r14, %rdi
movl $0x2, %esi
jmp 0x34b5c
movabsq $-0x6000000000000, %r14 # imm = 0xFFFA000000000000
leaq 0x2(%rbx), %rsi
cmpb $0x0, 0x2(%rbx)
je 0x34b26
movq %rsi, %rdi
jmp 0x34b40
leaq -0x90(%rbp), %rbx
movl $0x6c, %edx
movq %rbx, %rdi
callq 0x12670
movb $0x40, (%rbx)
movq %rbx, %rdi
callq 0x4482c
movq %rax, %rdi
movq %r14, %rsi
callq 0x4ed39
leaq -0x20(%rbp), %rdi
movq %rax, (%rdi)
movl $0x1, %esi
callq 0x47fef
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
callq 0x4ed39
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2dca5(%rip), %rdi     # 0x6282b
callq 0x191a3
leaq 0x2dc82(%rip), %rdi     # 0x62814
callq 0x191a3
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/net.c
// Function: janet_sched_accept
JANET_NO_RETURN static void janet_sched_accept(JanetStream *stream, JanetFunction *fun) {
    NetStateAccept *state = janet_malloc(sizeof(NetStateAccept));
    memset(state, 0, sizeof(NetStateAccept));
    state->function = fun;
    if (fun) janet_stream_level_triggered(stream);
    janet_async_start(stream, JANET_ASYNC_LISTEN_READ, net_callback_accept, state);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movl $0x8, %edi
callq 0x12760
movq %rax, %r14
movq %r15, (%rax)
testq %r15, %r15
je 0x34d10
movq %rbx, %rdi
callq 0x25008
leaq -0xf8a(%rip), %rdx      # 0x33d8d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rcx
callq 0x224c9
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: os_proc_wait_impl
static Janet
#endif
os_proc_wait_impl(JanetProc *proc) {
    if (proc->flags & (JANET_PROC_WAITED | JANET_PROC_WAITING)) {
        janet_panicf("cannot wait twice on a process");
    }
#ifdef JANET_EV
    /* Event loop implementation - threaded call */
    proc->flags |= JANET_PROC_WAITING;
    JanetEVGenericMessage targs;
    memset(&targs, 0, sizeof(targs));
    targs.argp = proc;
    targs.fiber = janet_root_fiber();
    targs.argi = (uint32_t) targs.fiber->sched_id;
    janet_gcroot(janet_wrap_abstract(proc));
    janet_gcroot(janet_wrap_fiber(targs.fiber));
    janet_ev_threaded_call(janet_proc_wait_subr, targs, janet_proc_wait_cb);
    janet_await();
#else
    /* Non evented implementation */
    proc->flags |= JANET_PROC_WAITED;
    int status = 0;
#ifdef JANET_WINDOWS
    WaitForSingleObject(proc->pHandle, INFINITE);
    GetExitCodeProcess(proc->pHandle, &status);
    if (!(proc->flags & JANET_PROC_CLOSED)) {
        proc->flags |= JANET_PROC_CLOSED;
        CloseHandle(proc->pHandle);
        CloseHandle(proc->tHandle);
    }
#else
    waitpid(proc->pid, &status, 0);
#endif
    proc->return_code = (int32_t) status;
    return janet_wrap_integer(proc->return_code);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movl (%rdi), %eax
testb $0x6, %al
jne 0x35669
movq %rdi, %rbx
orl $0x4, %eax
movl %eax, (%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
movq %rdi, -0x28(%rbp)
callq 0x29df3
movq %rax, %r14
movq %rax, -0x18(%rbp)
movl 0x48(%rax), %eax
movl %eax, -0x2c(%rbp)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %rbx, %rdi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2b13a
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %r14, %rdi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2b13a
movaps -0x30(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x2d2e(%rip), %rdi      # 0x38386
leaq 0x2dde(%rip), %rsi      # 0x3843d
callq 0x25157
callq 0x2250a
leaq 0x30d65(%rip), %rdi     # 0x663d5
xorl %eax, %eax
callq 0x190bb
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: get_signal_kw
static int get_signal_kw(const Janet *argv, int32_t n) {
    JanetKeyword signal_kw = janet_getkeyword(argv, n);
    const struct keyword_signal *ptr = signal_keywords;
    while (ptr->keyword) {
        if (!janet_cstrcmp(signal_kw, ptr->keyword)) {
            return ptr->signal;
        }
        ptr++;
    }
    janet_panicf("undefined signal %v", argv[n]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
callq 0x1943f
movq %rax, %r15
leaq 0x30c22(%rip), %rsi     # 0x66392
leaq 0x4d7f9(%rip), %r12     # 0x82f70
movq %r15, %rdi
callq 0x4872e
testl %eax, %eax
je 0x357a5
movq (%r12), %rsi
addq $0x10, %r12
testq %rsi, %rsi
jne 0x35777
movl %r14d, %eax
movq (%rbx,%rax,8), %rsi
leaq 0x30cb3(%rip), %rdi     # 0x66451
xorl %eax, %eax
callq 0x190bb
movl -0x8(%r12), %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: janet_signal_trampoline
static void janet_signal_trampoline(int sig) {
    /* Do not interact with global janet state here except for janet_ev_post_event, unsafe! */
    JanetEVGenericMessage msg;
    memset(&msg, 0, sizeof(msg));
    msg.tag = sig;
    msg.argi = 1;
    janet_interpreter_interrupt(NULL);
    janet_ev_post_event(&janet_vm, janet_signal_callback, msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
xorps %xmm0, %xmm0
movups %xmm0, -0x18(%rbp)
movq $0x0, -0x8(%rbp)
movl %edi, -0x20(%rbp)
movl $0x1, -0x1c(%rbp)
xorl %edi, %edi
callq 0x446a7
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movups -0x20(%rbp), %xmm0
movups -0x10(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x2a95(%rip), %rsi      # 0x38521
movq %rax, %rdi
callq 0x24172
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: janet_signal_trampoline_no_interrupt
static void janet_signal_trampoline_no_interrupt(int sig) {
    /* Do not interact with global janet state here except for janet_ev_post_event, unsafe! */
    JanetEVGenericMessage msg;
    memset(&msg, 0, sizeof(msg));
    msg.tag = sig;
    janet_ev_post_event(&janet_vm, janet_signal_callback, msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%rbp)
movaps %xmm0, -0x10(%rbp)
movl %edi, -0x20(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movaps -0x20(%rbp), %xmm0
movaps -0x10(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x2a49(%rip), %rsi      # 0x38521
movq %rax, %rdi
callq 0x24172
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: time_to_tm
static struct tm *time_to_tm(const Janet *argv, int32_t argc, int32_t n, struct tm *t_infos) {
    time_t t;
    if (argc > n && !janet_checktype(argv[n], JANET_NIL)) {
        int64_t integer = janet_getinteger64(argv, n);
        t = (time_t) integer;
    } else {
        time(&t);
    }
    struct tm *t_info = NULL;
    if (argc > n + 1 && janet_truthy(argv[n + 1])) {
        /* local time */
#ifdef JANET_WINDOWS
        _tzset();
        localtime_s(t_infos, &t);
        t_info = t_infos;
#else
        tzset();
        t_info = localtime_r(&t, t_infos);
#endif
    } else {
        /* utc time */
#ifdef JANET_WINDOWS
        gmtime_s(t_infos, &t);
        t_info = t_infos;
#else
        t_info = gmtime_r(&t, t_infos);
#endif
    }
    return t_info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r14d
movl %esi, %r12d
movq %rdi, %r15
movabsq $-0x800000000000, %r13  # imm = 0xFFFF800000000000
cmpl %edx, %esi
jle 0x36fbb
movl %r14d, %eax
movq (%r15,%rax,8), %rax
andq %r13, %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
jne 0x36fc6
leaq -0x30(%rbp), %rdi
callq 0x126e0
jmp 0x36fd5
movq %r15, %rdi
movl %r14d, %esi
callq 0x19b4c
movq %rax, -0x30(%rbp)
incl %r14d
cmpl %r12d, %r14d
jge 0x37009
movl %r14d, %eax
movq (%r15,%rax,8), %rax
andq %rax, %r13
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %r13
je 0x37009
movabsq $-0x7000000000000, %rcx # imm = 0xFFF9000000000000
cmpq %rcx, %r13
jne 0x37017
testb $0x1, %al
jne 0x37017
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x123d0
jmp 0x37028
callq 0x126c0
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x12170
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/os.c
// Function: entry_getint
static timeint_t entry_getint(Janet env_entry, char *field) {
    Janet i;
    if (janet_checktype(env_entry, JANET_TABLE)) {
        JanetTable *entry = janet_unwrap_table(env_entry);
        i = janet_table_get(entry, janet_ckeywordv(field));
    } else if (janet_checktype(env_entry, JANET_STRUCT)) {
        const JanetKV *entry = janet_unwrap_struct(env_entry);
        i = janet_struct_get(entry, janet_ckeywordv(field));
    } else {
        return 0;
    }

    if (janet_checktype(i, JANET_NIL)) {
        return 0;
    }

#ifdef JANET_WINDOWS
    if (!janet_checkint(i)) {
        janet_panicf("bad slot #%s, expected 32 bit signed integer, got %v",
                     field, i);
    }
#else
    if (!janet_checkint64(i)) {
        janet_panicf("bad slot #%s, expected 64 bit signed integer, got %v",
                     field, i);
    }
#endif

    return (timeint_t)janet_unwrap_number(i);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movabsq $-0x800000000000, %r15  # imm = 0xFFFF800000000000
movq %rdi, %rax
andq %r15, %rax
movabsq $-0x3000000000000, %rcx # imm = 0xFFFD000000000000
cmpq %rcx, %rax
je 0x3739b
movabsq $-0x3800000000000, %rcx # imm = 0xFFFC800000000000
cmpq %rcx, %rax
jne 0x373dd
callq 0x4ebc4
movq %rax, %r14
movq %rbx, %rdi
callq 0x47261
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4ed39
movq %r14, %rdi
movq %rax, %rsi
callq 0x474e0
jmp 0x373c8
callq 0x4ebc4
movq %rax, %r14
movq %rbx, %rdi
callq 0x47261
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4ed39
movq %r14, %rdi
movq %rax, %rsi
callq 0x46988
movq %rax, %r14
andq %rax, %r15
movabsq $-0x7800000000000, %rax # imm = 0xFFF8800000000000
cmpq %rax, %r15
jne 0x373e1
xorl %eax, %eax
jmp 0x373f7
movq %r14, %rdi
callq 0x499e3
testl %eax, %eax
je 0x37402
movq %r14, %xmm0
cvttsd2si %xmm0, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f192(%rip), %rdi     # 0x6659b
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x190bb
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: os_make_permstring
static Janet os_make_permstring(int32_t permissions) {
    uint8_t bytes[9] = {0};
    bytes[0] = (permissions & 0400) ? 'r' : '-';
    bytes[1] = (permissions & 0200) ? 'w' : '-';
    bytes[2] = (permissions & 0100) ? 'x' : '-';
    bytes[3] = (permissions & 0040) ? 'r' : '-';
    bytes[4] = (permissions & 0020) ? 'w' : '-';
    bytes[5] = (permissions & 0010) ? 'x' : '-';
    bytes[6] = (permissions & 0004) ? 'r' : '-';
    bytes[7] = (permissions & 0002) ? 'w' : '-';
    bytes[8] = (permissions & 0001) ? 'x' : '-';
    return janet_stringv(bytes, sizeof(bytes));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
btl $0x8, %edi
movl $0x2d, %ecx
movl $0x72, %edx
movl $0x72, %esi
cmovael %ecx, %esi
leaq -0x9(%rbp), %rax
movb %sil, (%rax)
testb %dil, %dil
movl $0x77, %esi
movl $0x77, %r8d
cmovnsl %ecx, %r8d
movb %r8b, 0x1(%rax)
testb $0x40, %dil
movl $0x78, %r8d
cmovel %ecx, %r8d
movb %r8b, 0x2(%rax)
testb $0x20, %dil
movl $0x72, %r8d
cmovel %ecx, %r8d
movl $0x78, %r9d
movb %r8b, 0x3(%rax)
testb $0x10, %dil
movl $0x77, %r8d
cmovel %ecx, %r8d
movb %r8b, 0x4(%rax)
testb $0x8, %dil
movl $0x78, %r8d
cmovel %ecx, %r8d
movb %r8b, 0x5(%rax)
testb $0x4, %dil
cmovel %ecx, %edx
movb %dl, 0x6(%rax)
testb $0x2, %dil
cmovel %ecx, %esi
movb %sil, 0x7(%rax)
testb $0x1, %dil
cmovel %ecx, %r9d
movb %r9b, 0x8(%rax)
movq %rax, %rdi
movl $0x9, %esi
callq 0x44754
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4ed39
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: os_get_unix_mode
static int32_t os_get_unix_mode(const Janet *argv, int32_t n) {
    int32_t unix_mode;
    if (janet_checkint(argv[n])) {
        /* Integer mode */
        int32_t x = janet_unwrap_integer(argv[n]);
        if (x < 0 || x > 0777) {
            janet_panicf("bad slot #%d, expected integer in range [0, 8r777], got %v", n, argv[n]);
        }
        unix_mode = x;
    } else {
        /* Bytes mode */
        JanetByteView bytes = janet_getbytes(argv, n);
        if (bytes.len != 9) {
            janet_panicf("bad slot #%d: expected byte sequence of length 9, got %v", n, argv[n]);
        }
        unix_mode = os_parse_permstring(bytes.bytes);
    }
    return unix_mode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %r15d
movq (%rdi,%r15,8), %rdi
callq 0x49912
testl %eax, %eax
je 0x37fd0
movsd (%r14,%r15,8), %xmm0
cvttsd2si %xmm0, %ecx
cmpl $0x200, %ecx            # imm = 0x200
jb 0x38046
movq %xmm0, %rdx
leaq 0x2e66a(%rip), %rdi     # 0x66635
jmp 0x3805e
movq %r14, %rdi
movl %ebx, %esi
callq 0x19909
cmpl $0x9, %edx
jne 0x38053
xorl %ecx, %ecx
cmpb $0x72, (%rax)
sete %cl
shll $0x8, %ecx
cmpb $0x77, 0x1(%rax)
leal 0x80(%rcx), %edx
cmovnel %ecx, %edx
leal 0x40(%rdx), %ecx
cmpb $0x78, 0x2(%rax)
cmovnel %edx, %ecx
leal 0x20(%rcx), %edx
cmpb $0x72, 0x3(%rax)
cmovnel %ecx, %edx
movl %edx, %ecx
orl $0x10, %ecx
cmpb $0x77, 0x4(%rax)
cmovnel %edx, %ecx
movl %ecx, %edx
orl $0x8, %edx
cmpb $0x78, 0x5(%rax)
cmovnel %ecx, %edx
movl %edx, %ecx
orl $0x4, %ecx
cmpb $0x72, 0x6(%rax)
cmovnel %edx, %ecx
movl %ecx, %edx
orl $0x2, %edx
cmpb $0x77, 0x7(%rax)
cmovnel %ecx, %edx
xorl %ecx, %ecx
cmpb $0x78, 0x8(%rax)
sete %cl
orl %edx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq (%r14,%r15,8), %rdx
leaq 0x2e612(%rip), %rdi     # 0x66670
movl %ebx, %esi
xorl %eax, %eax
callq 0x190bb
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: janet_proc_wait_cb
static void janet_proc_wait_cb(JanetEVGenericMessage args) {
    JanetProc *proc = (JanetProc *) args.argp;
    if (NULL != proc) {
        int status = args.tag;
        proc->return_code = (int32_t) status;
        proc->flags |= JANET_PROC_WAITED;
        proc->flags &= ~JANET_PROC_WAITING;
        janet_gcunroot(janet_wrap_abstract(proc));
        janet_gcunroot(janet_wrap_fiber(args.fiber));
        uint32_t sched_id = (uint32_t) args.argi;
        if (janet_fiber_can_resume(args.fiber) && args.fiber->sched_id == sched_id) {
            if ((status != 0) && (proc->flags & JANET_PROC_ERROR_NONZERO)) {
                JanetString s = janet_formatc("command failed with non-zero exit code %d", status);
                janet_cancel(args.fiber, janet_wrap_string(s));
            } else {
                janet_schedule(args.fiber, janet_wrap_integer(status));
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x18(%rbp), %r15
testq %r15, %r15
je 0x384e3
leaq 0x10(%rbp), %r12
movl (%r12), %ebx
movl %ebx, 0x8(%r15)
movl (%r15), %eax
andl $-0x7, %eax
orl $0x2, %eax
movl %eax, (%r15)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %r15, %rdi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2b88a
movq 0x18(%r12), %r14
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %r14, %rdi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2b88a
movl 0x4(%r12), %r12d
movq %r14, %rdi
callq 0x2a1ca
testl %eax, %eax
je 0x384e3
cmpl %r12d, 0x48(%r14)
jne 0x384e3
testl %ebx, %ebx
je 0x384c7
testb $0x8, (%r15)
jne 0x384ec
cvtsi2sd %ebx, %xmm0
callq 0x4ee44
movq %r14, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2298f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2df34(%rip), %rdi     # 0x66427
movl %ebx, %esi
xorl %eax, %eax
callq 0x3f652
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4ed39
movq %r14, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2297e
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: janet_signal_callback
static void janet_signal_callback(JanetEVGenericMessage msg) {
    int sig = msg.tag;
    if (msg.argi) janet_interpreter_interrupt_handled(NULL);
    Janet handlerv = janet_table_get(&janet_vm.signal_handlers, janet_wrap_integer(sig));
    if (!janet_checktype(handlerv, JANET_FUNCTION)) {
        /* Let another thread/process try to handle this */
        sigset_t set;
        sigemptyset(&set);
        sigaddset(&set, sig);
#ifdef JANET_THREADS
        pthread_sigmask(SIG_BLOCK, &set, NULL);
#else
        sigprocmask(SIG_BLOCK, &set, NULL);
#endif
        raise(sig);
        return;
    }
    JanetFunction *handler = janet_unwrap_function(handlerv);
    JanetFiber *fiber = janet_fiber(handler, 64, 0, NULL);
    janet_schedule_soon(fiber, janet_wrap_nil(), JANET_SIGNAL_OK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movl 0x10(%rbp), %ebx
cmpl $0x0, 0x14(%rbp)
je 0x3853f
xorl %edi, %edi
callq 0x446d9
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
leaq 0x2c8(%rax), %r14
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
callq 0x4ee44
movq %r14, %rdi
movq %rax, %rsi
callq 0x474e0
movq %rax, %rcx
shrq $0x2f, %rcx
cmpl $0x1fffc, %ecx          # imm = 0x1FFFC
jne 0x385bf
movq %rax, %rdi
callq 0x4ebc4
movq %rax, %rdi
movl $0x40, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x295e4
movq %rax, %rbx
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4ece6
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2296f
leaq -0x90(%rbp), %r14
movq %r14, %rdi
callq 0x125f0
movq %r14, %rdi
movl %ebx, %esi
callq 0x12bc0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x12080
movl %ebx, %edi
callq 0x120a0
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: janet_proc_mark
static int janet_proc_mark(void *p, size_t s) {
    (void) s;
    JanetProc *proc = (JanetProc *)p;
    if (NULL != proc->in) janet_mark(janet_wrap_abstract(proc->in));
    if (NULL != proc->out) janet_mark(janet_wrap_abstract(proc->out));
    if (NULL != proc->err) janet_mark(janet_wrap_abstract(proc->err));
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movabsq $-0x1000000000000, %rbx # imm = 0xFFFF000000000000
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x3865b
movq %rbx, %rsi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2aca7
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x38674
movq %rbx, %rsi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2aca7
movq 0x20(%r14), %rdi
testq %rdi, %rdi
je 0x3868d
movq %rbx, %rsi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2aca7
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: janet_proc_get
static int janet_proc_get(void *p, Janet key, Janet *out) {
    JanetProc *proc = (JanetProc *)p;
    if (janet_keyeq(key, "in")) {
        *out = (NULL == proc->in) ? janet_wrap_nil() : janet_wrap_abstract(proc->in);
        return 1;
    }
    if (janet_keyeq(key, "out")) {
        *out = (NULL == proc->out) ? janet_wrap_nil() : janet_wrap_abstract(proc->out);
        return 1;
    }
    if (janet_keyeq(key, "err")) {
        *out = (NULL == proc->err) ? janet_wrap_nil() : janet_wrap_abstract(proc->err);
        return 1;
    }
#ifndef JANET_WINDOWS
    if (janet_keyeq(key, "pid")) {
        *out = janet_wrap_number(proc->pid);
        return 1;
    }
#endif
    if ((-1 != proc->return_code) && janet_keyeq(key, "return-code")) {
        *out = janet_wrap_integer(proc->return_code);
        return 1;
    }
    if (!janet_checktype(key, JANET_KEYWORD)) return 0;
    return janet_getmethod(janet_unwrap_keyword(key), proc_methods, out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x1fd04(%rip), %rsi     # 0x583b2
movq %r14, %rdi
callq 0x19331
testl %eax, %eax
je 0x386c0
movq 0x10(%r15), %rdi
jmp 0x386f0
leaq 0x25e9a(%rip), %rsi     # 0x5e561
movq %r14, %rdi
callq 0x19331
testl %eax, %eax
je 0x386d9
movq 0x18(%r15), %rdi
jmp 0x386f0
leaq 0x2233e(%rip), %rsi     # 0x5aa1e
movq %r14, %rdi
callq 0x19331
testl %eax, %eax
je 0x38728
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x38706
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
callq 0x4ed7e
jmp 0x38715
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4ece6
movq %rax, (%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2dc7c(%rip), %rsi     # 0x663ab
movq %r14, %rdi
callq 0x19331
testl %eax, %eax
je 0x38748
cvtsi2sdl 0x4(%r15), %xmm0
callq 0x4ee44
jmp 0x38715
cmpl $-0x1, 0x8(%r15)
je 0x3876a
leaq 0x2dd8d(%rip), %rsi     # 0x664e3
movq %r14, %rdi
callq 0x19331
testl %eax, %eax
je 0x3876a
cvtsi2sdl 0x8(%r15), %xmm0
jmp 0x38741
movq %r14, %rcx
shrq $0x2f, %rcx
xorl %eax, %eax
cmpl $0x1fff6, %ecx          # imm = 0x1FFF6
jne 0x3871d
movq %r14, %rdi
callq 0x4ebc4
leaq 0x4a9a6(%rip), %rsi     # 0x83130
movq %rax, %rdi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1924f
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: janet_getjstream
static JanetHandle janet_getjstream(Janet *argv, int32_t n, void **orig) {
#ifdef JANET_EV
    JanetStream *stream = janet_checkabstract(argv[n], &janet_stream_type);
    if (stream != NULL) {
        if (stream->flags & JANET_STREAM_CLOSED)
            janet_panic("stream is closed");
        *orig = stream;
        return stream->handle;
    }
#endif
    JanetFile *f = janet_checkabstract(argv[n], &janet_file_type);
    if (f != NULL) {
        if (f->flags & JANET_FILE_CLOSED) {
            janet_panic("file is closed");
        }
        *orig = f;
#ifdef JANET_WINDOWS
        return (HANDLE) _get_osfhandle(_fileno(f->file));
#else
        return fileno(f->file);
#endif
    }
    janet_panicf("expected file|stream, got %v", argv[n]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
leaq 0x47c49(%rip), %rsi     # 0x80410
callq 0x199b8
testq %rax, %rax
je 0x387e1
testb $0x1, 0x4(%rax)
jne 0x3880a
movq %rax, (%rbx)
movl (%rax), %eax
popq %rbx
popq %r14
popq %rbp
retq
movq (%r14), %rdi
leaq 0x48e05(%rip), %rsi     # 0x815f0
callq 0x199b8
testq %rax, %rax
je 0x38816
testb $0x20, 0x8(%rax)
jne 0x38827
movq %rax, (%rbx)
movq (%rax), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x126f0
leaq 0x2219a(%rip), %rdi     # 0x5a9ab
callq 0x191a3
movq (%r14), %rsi
leaq 0x2dd5e(%rip), %rdi     # 0x6657e
xorl %eax, %eax
callq 0x190bb
leaq 0x25b96(%rip), %rdi     # 0x5e3c4
callq 0x191a3
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/os.c
// Function: get_stdio_for_handle
static JanetStream *get_stdio_for_handle(JanetHandle handle, void *orig, int iswrite) {
    if (orig == NULL) {
        return janet_stream(handle, iswrite ? JANET_STREAM_WRITABLE : JANET_STREAM_READABLE, NULL);
    } else if (janet_abstract_type(orig) == &janet_file_type) {
        JanetFile *jf = (JanetFile *)orig;
        uint32_t flags = 0;
        if (jf->flags & JANET_FILE_WRITE) {
            flags |= JANET_STREAM_WRITABLE;
        }
        if (jf->flags & JANET_FILE_READ) {
            flags |= JANET_STREAM_READABLE;
        }
        /* duplicate handle when converting file to stream */
#ifdef JANET_WINDOWS
        HANDLE prochandle = GetCurrentProcess();
        HANDLE newHandle = INVALID_HANDLE_VALUE;
        if (!DuplicateHandle(prochandle, handle, prochandle, &newHandle, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
            return NULL;
        }
#else
        int newHandle = dup(handle);
        if (newHandle < 0) {
            return NULL;
        }
#endif
        return janet_stream(newHandle, flags, NULL);
    } else {
        return orig;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x38855
movq -0x10(%rsi), %rax
cmpq 0x4c747(%rip), %rax     # 0x84f90
je 0x38868
movq %rsi, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %esi, %esi
testl %edx, %edx
setne %sil
shll $0x9, %esi
addl $0x200, %esi            # imm = 0x200
jmp 0x388b7
movl 0x8(%rsi), %ebx
callq 0x123e0
testl %eax, %eax
js 0x388c4
andl $0x3, %ebx
rolw $0x8, %bx
movl %ebx, %ecx
shrl $0x4, %ecx
movl $0xf0f, %edx            # imm = 0xF0F
andl %edx, %ecx
andl %edx, %ebx
shll $0x4, %ebx
orl %ecx, %ebx
movl $0x3333, %ecx           # imm = 0x3333
movl %ebx, %edx
andl %ecx, %edx
shrl $0x2, %ebx
andl %ecx, %ebx
leal (%rbx,%rdx,4), %ecx
movl %ecx, %edx
andl $0x5550, %edx           # imm = 0x5550
shrl %ecx
andl $0x5540, %ecx           # imm = 0x5540
leal (%rcx,%rdx,2), %esi
shrl $0x5, %esi
movl %eax, %edi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x225ac
xorl %esi, %esi
jmp 0x3884b
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/parse.c
// Function: janet_valid_utf8
int janet_valid_utf8(const uint8_t *str, int32_t len) {
    int32_t i = 0;
    int32_t j;
    while (i < len) {
        int32_t nexti;
        uint8_t c = str[i];

        /* Check the number of bytes in code point */
        if (c < 0x80) nexti = i + 1;
        else if ((c >> 5) == 0x06) nexti = i + 2;
        else if ((c >> 4) == 0x0E) nexti = i + 3;
        else if ((c >> 3) == 0x1E) nexti = i + 4;
        /* Don't allow 5 or 6 byte code points */
        else return 0;

        /* No overflow */
        if (nexti > len) return 0;

        /* Ensure trailing bytes are well formed (10XX XXXX) */
        for (j = i + 1; j < nexti; j++) {
            if ((str[j] >> 6) != 2) return 0;
        }

        /* Check for overlong encoding */
        if ((nexti == i + 2) && str[i] < 0xC2) return 0;
        if ((str[i] == 0xE0) && str[i + 1] < 0xA0) return 0;
        if ((str[i] == 0xF0) && str[i + 1] < 0x90) return 0;

        i = nexti;
    }
    return 1;
}

// Assembly:
testl %esi, %esi
jle 0x38b6a
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %ecx, %ecx
xorl %eax, %eax
movl %ecx, %edx
movzbl (%rdi,%rdx), %r8d
testb %r8b, %r8b
js 0x38ab0
movl $0x1, %r10d
xorl %r9d, %r9d
jmp 0x38afc
movl %r8d, %r9d
andl $-0x20, %r9d
cmpl $0xc0, %r9d
jne 0x38acb
movl $0x2, %r10d
movb $0x1, %r9b
jmp 0x38afc
movl %r8d, %r10d
andl $-0x10, %r10d
xorl %r9d, %r9d
cmpl $0xe0, %r10d
jne 0x38ae6
movl $0x3, %r10d
jmp 0x38afc
movl %r8d, %r10d
andl $-0x8, %r10d
cmpl $0xf0, %r10d
jne 0x38b70
movl $0x4, %r10d
addl %r10d, %ecx
cmpl %esi, %ecx
jg 0x38b65
testb %r8b, %r8b
jns 0x38b29
leaq (%rdi,%rdx), %r11
movl %r10d, %r10d
movl $0x1, %ebx
movb (%r11,%rbx), %r14b
andb $-0x40, %r14b
negb %r14b
jno 0x38b65
incq %rbx
cmpl %ebx, %r10d
jne 0x38b14
cmpb $-0x3e, %r8b
setb %r10b
testb %r9b, %r10b
jne 0x38b65
cmpl $0xf0, %r8d
je 0x38b51
cmpl $0xe0, %r8d
jne 0x38b58
cmpb $-0x60, 0x1(%rdi,%rdx)
jae 0x38b58
jmp 0x38b65
cmpb $-0x70, 0x1(%rdi,%rdx)
jb 0x38b65
cmpl %esi, %ecx
jl 0x38a99
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0x1, %eax
retq
xorl %eax, %eax
jmp 0x38b65
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/parse.c
// Function: janet_parser_consume
void janet_parser_consume(JanetParser *parser, uint8_t c) {
    int consumed = 0;
    janet_parser_checkdead(parser);
    if (c == '\r') {
        parser->line++;
        parser->column = 0;
    } else if (c == '\n') {
        parser->column = 0;
        if (parser->lookback != '\r')
            parser->line++;
    } else {
        parser->column++;
    }
    while (!consumed && !parser->error) {
        JanetParseState *state = parser->states + parser->statecount - 1;
        consumed = state->consumer(parser, state, c);
    }
    parser->lookback = c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
callq 0x38bed
cmpl $0xa, %r14d
je 0x38ba0
cmpl $0xd, %r14d
jne 0x38bb4
incq 0x50(%rbx)
movq $0x0, 0x58(%rbx)
jmp 0x38bb8
movq $0x0, 0x58(%rbx)
cmpl $0xd, 0x68(%rbx)
je 0x38bb8
incq 0x50(%rbx)
jmp 0x38bb8
incq 0x58(%rbx)
movzbl %r14b, %r14d
cmpq $0x0, 0x8(%rbx)
jne 0x38be4
movq 0x10(%rbx), %rax
movq 0x30(%rbx), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rsi
addq $-0x28, %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq *0x20(%rsi)
testl %eax, %eax
je 0x38bbc
movl %r14d, 0x68(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/parse.c
// Function: janet_parser_eof
void janet_parser_eof(JanetParser *parser) {
    janet_parser_checkdead(parser);
    size_t oldcolumn = parser->column;
    size_t oldline = parser->line;
    janet_parser_consume(parser, '\n');
    if (parser->statecount > 1) {
        delim_error(parser, parser->statecount - 1, 0, "unexpected end of source");
    }
    parser->line = oldline;
    parser->column = oldcolumn;
    parser->flag |= JANET_PARSER_DEAD;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x38bed
movq 0x50(%rbx), %r15
movq 0x58(%rbx), %r14
movq %rbx, %rdi
movl $0xa, %esi
callq 0x38b74
movq 0x30(%rbx), %rsi
cmpq $0x2, %rsi
jb 0x38c5d
decq %rsi
leaq 0x26f39(%rip), %rcx     # 0x5fb8c
movq %rbx, %rdi
xorl %edx, %edx
callq 0x38c74
movq %r15, 0x50(%rbx)
movq %r14, 0x58(%rbx)
orb $0x1, 0x6c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/parse.c
// Function: delim_error
static void delim_error(JanetParser *parser, size_t stack_index, char c, const char *msg) {
    JanetParseState *s = parser->states + stack_index;
    JanetBuffer *buffer = janet_buffer(40);
    if (msg) {
        janet_buffer_push_cstring(buffer, msg);
    }
    if (c) {
        janet_buffer_push_u8(buffer, c);
    }
    if (stack_index > 0) {
        janet_buffer_push_cstring(buffer, ", ");
        if (s->flags & PFLAG_PARENS) {
            janet_buffer_push_u8(buffer, '(');
        } else if (s->flags & PFLAG_SQRBRACKETS) {
            janet_buffer_push_u8(buffer, '[');
        } else if (s->flags & PFLAG_CURLYBRACKETS) {
            janet_buffer_push_u8(buffer, '{');
        } else if (s->flags & PFLAG_STRING) {
            janet_buffer_push_u8(buffer, '"');
        } else if (s->flags & PFLAG_LONGSTRING) {
            int32_t i;
            for (i = 0; i < s->argn; i++) {
                janet_buffer_push_u8(buffer, '`');
            }
        }
        janet_formatb(buffer, " opened at line %d, column %d", (int32_t) s->line, (int32_t) s->column);
    }
    parser->error = (const char *) janet_string(buffer->data, buffer->count);
    parser->flag |= JANET_PARSER_GENERATED_ERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movl %edx, %r12d
movq %rsi, %r15
leaq (%rsi,%rsi,4), %rbx
shlq $0x3, %rbx
movq %rdi, -0x30(%rbp)
addq 0x10(%rdi), %rbx
movl $0x28, %edi
callq 0x176f7
movq %rax, %r14
testq %r13, %r13
je 0x38cb8
movq %r14, %rdi
movq %r13, %rsi
callq 0x17878
testb %r12b, %r12b
je 0x38cc9
movzbl %r12b, %esi
movq %r14, %rdi
callq 0x17947
testq %r15, %r15
je 0x38d49
leaq 0x2e8e2(%rip), %rsi     # 0x675b7
movq %r14, %rdi
callq 0x17878
movl 0x8(%rbx), %eax
movb $0x28, %cl
btl $0xa, %eax
jb 0x38d27
movb $0x5b, %cl
btl $0xb, %eax
jb 0x38d27
movb $0x7b, %cl
btl $0xc, %eax
jb 0x38d27
movb $0x22, %cl
btl $0xd, %eax
jb 0x38d27
btl $0xe, %eax
jae 0x38d32
cmpl $0x0, 0x4(%rbx)
jle 0x38d32
xorl %r15d, %r15d
movq %r14, %rdi
movl $0x60, %esi
callq 0x17947
incl %r15d
cmpl 0x4(%rbx), %r15d
jl 0x38d0f
jmp 0x38d32
movzbl %cl, %esi
movq %r14, %rdi
callq 0x17947
movl 0x10(%rbx), %edx
movl 0x18(%rbx), %ecx
leaq 0x2e87b(%rip), %rsi     # 0x675ba
movq %r14, %rdi
xorl %eax, %eax
callq 0x3f726
movq 0x18(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x44754
movq -0x30(%rbp), %rcx
movq %rax, 0x8(%rcx)
orb $0x2, 0x6c(%rcx)
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/parse.c
// Function: janet_parser_status
enum JanetParserStatus janet_parser_status(JanetParser *parser) {
    if (parser->error) return JANET_PARSE_ERROR;
    if (parser->flag) return JANET_PARSE_DEAD;
    if (parser->statecount > 1) return JANET_PARSE_PENDING;
    return JANET_PARSE_ROOT;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, %eax
cmpq $0x0, 0x8(%rdi)
jne 0x38d98
movl $0x3, %eax
cmpl $0x0, 0x6c(%rdi)
jne 0x38d98
xorl %eax, %eax
cmpq $0x2, 0x30(%rdi)
setae %al
addl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/parse.c
// Function: janet_parser_error
const char *janet_parser_error(JanetParser *parser) {
    enum JanetParserStatus status = janet_parser_status(parser);
    if (status == JANET_PARSE_ERROR) {
        const char *e = parser->error;
        parser->error = NULL;
        parser->flag &= ~JANET_PARSER_GENERATED_ERROR;
        janet_parser_flush(parser);
        return e;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x38de1
xorl %ecx, %ecx
movq %rcx, 0x8(%rdi)
andb $-0x3, 0x6c(%rdi)
movq %rcx, 0x20(%rdi)
movq $0x1, 0x30(%rdi)
movq %rcx, 0x40(%rdi)
movq %rcx, 0x60(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/parse.c
// Function: janet_parser_produce
Janet janet_parser_produce(JanetParser *parser) {
    Janet ret;
    size_t i;
    if (parser->pending == 0) return janet_wrap_nil();
    ret = janet_unwrap_tuple(parser->args[0])[0];
    for (i = 1; i < parser->argcount; i++) {
        parser->args[i - 1] = parser->args[i];
    }
    parser->pending--;
    parser->argcount--;
    parser->states[0].argn--;
    return ret;
}

// Assembly:
cmpq $0x0, 0x60(%rdi)
je 0x38e41
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movq (%rax), %rdi
callq 0x4ebc4
movq (%rax), %rax
movq 0x20(%rbx), %rcx
cmpq $0x2, %rcx
jb 0x38e28
movl $0x1, %edx
movq (%rbx), %rcx
movq (%rcx,%rdx,8), %rsi
movq %rsi, -0x8(%rcx,%rdx,8)
incq %rdx
movq 0x20(%rbx), %rcx
cmpq %rcx, %rdx
jb 0x38e10
decq 0x60(%rbx)
decq %rcx
movq %rcx, 0x20(%rbx)
movq 0x10(%rbx), %rcx
decl 0x4(%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
jmp 0x4ece6
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/parse.c
// Function: janet_parser_produce_wrapped
Janet janet_parser_produce_wrapped(JanetParser *parser) {
    Janet ret;
    size_t i;
    if (parser->pending == 0) return janet_wrap_nil();
    ret = parser->args[0];
    for (i = 1; i < parser->argcount; i++) {
        parser->args[i - 1] = parser->args[i];
    }
    parser->pending--;
    parser->argcount--;
    parser->states[0].argn--;
    return ret;
}

// Assembly:
movq 0x60(%rdi), %rdx
testq %rdx, %rdx
je 0x38ea5
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movq 0x20(%rdi), %rcx
movq (%rax), %rax
cmpq $0x2, %rcx
jb 0x38e8e
movl $0x1, %edx
movq (%rdi), %rcx
movq (%rcx,%rdx,8), %rsi
movq %rsi, -0x8(%rcx,%rdx,8)
incq %rdx
movq 0x20(%rdi), %rcx
cmpq %rcx, %rdx
jb 0x38e72
movq 0x60(%rdi), %rdx
decq %rdx
movq %rdx, 0x60(%rdi)
decq %rcx
movq %rcx, 0x20(%rdi)
movq 0x10(%rdi), %rcx
decl 0x4(%rcx)
popq %rbp
retq
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
jmp 0x4ece6