LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_register_stream_impl
static void janet_register_stream_impl(JanetStream *stream, int mod, int edge_trigger) {
    struct epoll_event ev;
    ev.events = edge_trigger ? EPOLLET : 0;
    if (stream->flags & (JANET_STREAM_READABLE | JANET_STREAM_ACCEPTABLE)) ev.events |= EPOLLIN;
    if (stream->flags & JANET_STREAM_WRITABLE) ev.events |= EPOLLOUT;
    ev.data.ptr = stream;
    int status;
    do {
        status = epoll_ctl(janet_vm.epoll, mod ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, stream->handle, &ev);
    } while (status == -1 && errno == EINTR);
    if (status == -1) {
        if (errno == EPERM) {
            /* Couldn't add to event loop, so assume that it completes
             * synchronously. */
            stream->flags |= JANET_STREAM_UNREGISTERED;
        } else {
            /* Unexpected error */
            janet_panicv(janet_ev_lasterr());
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r15d
movq %rdi, %rbx
xorl %eax, %eax
testl %edx, %edx
setne %al
shll $0x1f, %eax
movl %eax, -0x2c(%rbp)
movl 0x4(%rdi), %ecx
testl $0xa00, %ecx            # imm = 0xA00
je 0x253d8
orl $0x1, %eax
movl %eax, -0x2c(%rbp)
btl $0xa, %ecx
jae 0x253e2
orb $0x4, -0x2c(%rbp)
leaq -0x2c(%rbp), %r14
movq %rbx, 0x4(%r14)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %r12
xorl %eax, %eax
testl %r15d, %r15d
setne %al
leal 0x1(,%rax,2), %r15d
movl 0x338(%r12), %edi
movl (%rbx), %edx
movl %r15d, %esi
movq %r14, %rcx
callq 0x124f0
cmpl $-0x1, %eax
jne 0x2543c
callq 0x12120
movl (%rax), %eax
cmpl $0x4, %eax
je 0x2540d
cmpl $0x1, %eax
jne 0x25449
orb $0x4, 0x4(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x25958
movq %rax, %rdi
callq 0x1916a
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_init
void janet_ev_init(void) {
    janet_ev_init_common();
    janet_ev_setup_selfpipe();
    janet_vm.epoll = epoll_create1(EPOLL_CLOEXEC);
    janet_vm.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
    janet_vm.timer_enabled = 0;
    if (janet_vm.epoll == -1 || janet_vm.timerfd == -1) goto error;
    struct epoll_event ev;
    ev.events = EPOLLIN | EPOLLET;
    ev.data.ptr = &janet_vm.timerfd;
    if (-1 == epoll_ctl(janet_vm.epoll, EPOLL_CTL_ADD, janet_vm.timerfd, &ev)) goto error;
    ev.events = EPOLLIN | EPOLLET;
    ev.data.ptr = janet_vm.selfpipe;
    if (-1 == epoll_ctl(janet_vm.epoll, EPOLL_CTL_ADD, janet_vm.selfpipe[0], &ev)) goto error;
    return;
error:
    JANET_EXIT("failed to initialize event loop");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
callq 0x22e7b
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
leaq 0x330(%rax), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x26007
testl %eax, %eax
jne 0x25545
movl $0x80000, %edi          # imm = 0x80000
callq 0x12bc0
movl %eax, 0x338(%rbx)
movl $0x1, %edi
movl $0x80800, %esi          # imm = 0x80800
callq 0x12660
movl %eax, 0x33c(%rbx)
movl $0x0, 0x340(%rbx)
movl 0x338(%rbx), %edi
cmpl $-0x1, %edi
je 0x25540
cmpl $-0x1, %eax
je 0x25540
movq %rbx, %rdx
addq $0x33c, %rdx            # imm = 0x33C
leaq -0x1c(%rbp), %rcx
movl $0x80000001, (%rcx)     # imm = 0x80000001
movq %rdx, 0x4(%rcx)
movl $0x1, %esi
movl %eax, %edx
callq 0x124f0
cmpl $-0x1, %eax
je 0x25540
leaq -0x1c(%rbp), %rcx
movl $0x80000001, (%rcx)     # imm = 0x80000001
movq %r14, 0x4(%rcx)
movl 0x330(%rbx), %edx
movl 0x338(%rbx), %edi
movl $0x1, %esi
callq 0x124f0
cmpl $-0x1, %eax
je 0x25540
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x135d8
callq 0x135a4
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_deinit
void janet_ev_deinit(void) {
    janet_ev_deinit_common();
    close(janet_vm.epoll);
    close(janet_vm.timerfd);
    janet_ev_cleanup_selfpipe();
    janet_vm.epoll = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x22f06
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
movl 0x338(%rax), %edi
callq 0x12460
movl 0x33c(%rbx), %edi
callq 0x12460
movl 0x330(%rbx), %edi
callq 0x12460
movl 0x334(%rbx), %edi
callq 0x12460
movl $0x0, 0x338(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_threaded_call
void janet_ev_threaded_call(JanetThreadedSubroutine fp, JanetEVGenericMessage arguments, JanetThreadedCallback cb) {
    JanetEVThreadInit *init = janet_malloc(sizeof(JanetEVThreadInit));
    if (NULL == init) {
        JANET_OUT_OF_MEMORY;
    }
    init->msg = arguments;
    init->subr = fp;
    init->cb = cb;

#ifdef JANET_WINDOWS
    init->write_pipe = janet_vm.iocp;
    HANDLE thread_handle = CreateThread(NULL, 0, janet_thread_body, init, 0, NULL);
    if (NULL == thread_handle) {
        janet_free(init);
        janet_panic("failed to create thread");
    }
    CloseHandle(thread_handle); /* detach from thread */
#else
    init->write_pipe = janet_vm.selfpipe[1];
    pthread_t waiter_thread;
    int err = pthread_create(&waiter_thread, &janet_vm.new_thread_attr, janet_thread_body, init);
    if (err) {
        janet_free(init);
        janet_panicf("%s", janet_strerror(err));
    }
#endif

    /* Increment ev refcount so we don't quit while waiting for a subprocess */
    janet_ev_inc_refcount();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl $0x38, %edi
callq 0x12770
testq %rax, %rax
je 0x25635
movq %rax, %rbx
leaq 0x10(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movq %r15, 0x28(%rbx)
movq %r14, 0x20(%rbx)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %r14
movl 0x334(%rax), %eax
movl %eax, 0x30(%rbx)
leaq 0x2f8(%r14), %rsi
leaq 0x53(%rip), %rdx        # 0x2565e
leaq -0x20(%rbp), %rdi
movq %rbx, %rcx
callq 0x128e0
testl %eax, %eax
jne 0x2563a
addq $0x264, %r14            # imm = 0x264
movq %r14, %rdi
callq 0x1a23c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x1360c
movl %eax, %r15d
movq %rbx, %rdi
callq 0x120b0
movl %r15d, %edi
callq 0x4a8ae
leaq 0x439de(%rip), %rdi     # 0x69032
movq %rax, %rsi
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_thread_body
static void *janet_thread_body(void *ptr) {
    JanetEVThreadInit *init = (JanetEVThreadInit *)ptr;
    JanetEVGenericMessage msg = init->msg;
    JanetThreadedSubroutine subr = init->subr;
    JanetThreadedCallback cb = init->cb;
    int fd = init->write_pipe;
    janet_free(init);
    JanetSelfPipeEvent response;
    memset(&response, 0, sizeof(response));
    response.msg = subr(msg);
    response.cb = cb;
    /* handle a bit of back pressure before giving up. */
    int tries = 4;
    while (tries > 0) {
        int status;
        do {
            status = write(fd, &response, sizeof(response));
        } while (status == -1 && errno == EINTR);
        if (status > 0) break;
        sleep(1);
        tries--;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movq 0x20(%rdi), %r15
movq 0x28(%rdi), %r12
movl 0x30(%rdi), %ebx
callq 0x120b0
movaps -0x40(%rbp), %xmm0
movaps -0x30(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq *%r12
movq %r15, 0x20(%r14)
movl $0x4, %r12d
testl %r12d, %r12d
jle 0x256ef
movl $0x28, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x12250
movq %rax, %r15
cmpl $-0x1, %r15d
jne 0x256d8
callq 0x12120
cmpl $0x4, (%rax)
je 0x256b6
testl %r15d, %r15d
jg 0x256ea
movl $0x1, %edi
callq 0x12b90
decl %r12d
testl %r15d, %r15d
jle 0x256b1
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_threaded_await
JANET_NO_RETURN
void janet_ev_threaded_await(JanetThreadedSubroutine fp, int tag, int argi, void *argp) {
    JanetEVGenericMessage arguments;
    memset(&arguments, 0, sizeof(arguments));
    arguments.tag = tag;
    arguments.argi = argi;
    arguments.argp = argp;
    arguments.fiber = janet_root_fiber();
    janet_gcroot(janet_wrap_fiber(arguments.fiber));
    janet_ev_threaded_call(fp, arguments, janet_ev_default_threaded_callback);
    janet_await();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movaps %xmm0, -0x20(%rbp)
movl %esi, -0x30(%rbp)
movl %edx, -0x2c(%rbp)
movq %rcx, -0x28(%rbp)
callq 0x2a2a1
movq %rax, -0x18(%rbp)
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %rax, %rdi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b5e5
movaps -0x30(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0x1c4(%rip), %rsi      # 0x256fe
movq %rbx, %rdi
callq 0x255a5
callq 0x2286e
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_stream_flags
void janet_stream_flags(JanetStream *stream, uint32_t flags) {
    if (stream->flags & JANET_STREAM_CLOSED) {
        janet_panic("stream is closed");
    }
    if ((stream->flags & flags) != flags) {
        const char *rmsg = "", *wmsg = "", *amsg = "", *dmsg = "", *smsg = "stream";
        if (flags & JANET_STREAM_READABLE) rmsg = "readable ";
        if (flags & JANET_STREAM_WRITABLE) wmsg = "writable ";
        if (flags & JANET_STREAM_ACCEPTABLE) amsg = "server ";
        if (flags & JANET_STREAM_UDPSERVER) dmsg = "datagram ";
        if (flags & JANET_STREAM_SOCKET) smsg = "socket";
        janet_panicf("bad stream, expected %s%s%s%s%s", rmsg, wmsg, amsg, dmsg, smsg);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x4(%rdi), %eax
testb $0x1, %al
jne 0x258e2
notl %eax
testl %eax, %esi
jne 0x258ee
popq %rbp
retq
leaq 0x360c2(%rip), %rdi     # 0x5b9ab
callq 0x19263
btl $0x9, %esi
leaq 0x47804(%rip), %rdi     # 0x6d0fd
leaq 0x360bc(%rip), %rax     # 0x5b9bc
cmovaeq %rdi, %rax
btl $0xa, %esi
leaq 0x360b7(%rip), %rdx     # 0x5b9c6
cmovaeq %rdi, %rdx
btl $0xb, %esi
leaq 0x360b2(%rip), %rcx     # 0x5b9d0
cmovaeq %rdi, %rcx
btl $0xc, %esi
leaq 0x360ab(%rip), %r8      # 0x5b9d8
cmovaeq %rdi, %r8
testb $0x2, %sil
leaq 0x36171(%rip), %rsi     # 0x5baad
leaq 0x3609f(%rip), %r9      # 0x5b9e2
cmoveq %rsi, %r9
leaq 0x3609b(%rip), %rdi     # 0x5b9e9
movq %rax, %rsi
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_read_generic
static JANET_NO_RETURN void janet_ev_read_generic(JanetStream *stream, JanetBuffer *buf, int32_t nbytes, int is_chunked, JanetReadMode mode, int flags) {
    StateRead *state = janet_malloc(sizeof(StateRead));
    state->is_chunk = is_chunked;
    state->buf = buf;
    state->bytes_left = nbytes;
    state->bytes_read = 0;
    state->mode = mode;
#ifdef JANET_WINDOWS
    state->flags = (DWORD) flags;
#else
    state->flags = flags;
#endif
    janet_async_start(stream, JANET_ASYNC_LISTEN_READ, ev_callback_read, state);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, -0x2c(%rbp)
movl %r8d, %r14d
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %rbx
movl $0x20, %edi
callq 0x12770
movl %r15d, 0x18(%rax)
movq %r13, 0x10(%rax)
movl %r12d, 0x4(%rax)
movl $0x0, 0x8(%rax)
movl %r14d, 0x1c(%rax)
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x2f1(%rip), %rdx      # 0x25983
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rcx
callq 0x2282d
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_write_generic
static JANET_NO_RETURN void janet_ev_write_generic(JanetStream *stream, void *buf, void *dest_abst, JanetWriteMode mode, int is_buffer, int flags) {
    StateWrite *state = janet_malloc(sizeof(StateWrite));
    state->is_buffer = is_buffer;
    state->src.buf = buf;
    state->dest_abst = dest_abst;
    state->mode = mode;
#ifdef JANET_WINDOWS
    state->flags = (DWORD) flags;
#else
    state->flags = flags;
    state->start = 0;
#endif
    janet_async_start(stream, JANET_ASYNC_LISTEN_WRITE, ev_callback_write, state);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, -0x2c(%rbp)
movl %r8d, %r14d
movl %ecx, %r15d
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movl $0x20, %edi
callq 0x12770
movl %r14d, 0x10(%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x18(%rax)
movl %r15d, 0x14(%rax)
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movl $0x0, 0x4(%rax)
leaq -0x2b3(%rip), %rdx      # 0x25cd7
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rcx
callq 0x2282d
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_sleep_await
JANET_NO_RETURN void janet_sleep_await(double sec) {
    JanetTimeout to;
    to.when = ts_delta(ts_now(), sec);
    to.fiber = janet_vm.root_fiber;
    to.is_error = 0;
    to.sched_id = to.fiber->sched_id;
    to.curr_fiber = NULL;
    to.has_worker = 0;
    add_timeout(to);
    janet_await();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movsd %xmm0, -0x8(%rbp)
callq 0x2327e
movq %rax, %rdi
movsd -0x8(%rbp), %xmm0
callq 0x23228
movq %rax, -0x38(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
xorl %ecx, %ecx
movl %ecx, -0x1c(%rbp)
movl 0x48(%rax), %eax
movl %eax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl %ecx, -0x18(%rbp)
movups -0x38(%rbp), %xmm0
movups -0x28(%rbp), %xmm1
movups -0x18(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x232cb
callq 0x2286e
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_timeout_body
static void *janet_timeout_body(void *ptr) {
#ifdef JANET_ANDROID
    struct sigaction action;
    memset(&action, 0, sizeof(action));
    sigemptyset(&action.sa_mask);
    action.sa_flags = 0;
    action.sa_handler = &janet_timeout_stop;
    sigaction(SIGUSR1, &action, NULL);
#endif
    JanetThreadedTimeout tto = *(JanetThreadedTimeout *)ptr;
    janet_free(ptr);
    struct timespec ts;
    ts.tv_sec = (time_t) tto.sec;
    ts.tv_nsec = (tto.sec <= UINT32_MAX)
                 ? (long)((tto.sec - ((uint32_t)tto.sec)) * 1000000000)
                 : 0;
    nanosleep(&ts, &ts);
    janet_interpreter_interrupt(tto.vm);
    JanetEVGenericMessage msg = {0};
    janet_ev_post_event(tto.vm, janet_timeout_cb, msg);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x58, %rsp
movsd (%rdi), %xmm0
movsd %xmm0, -0x10(%rbp)
movq 0x8(%rdi), %rbx
callq 0x120b0
movsd -0x10(%rbp), %xmm1
cvttsd2si %xmm1, %rax
movq %rax, -0x40(%rbp)
movsd 0x333f7(%rip), %xmm0    # 0x59f90
ucomisd %xmm1, %xmm0
jae 0x26ba3
xorl %eax, %eax
jmp 0x26bbe
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
subsd %xmm0, %xmm1
mulsd 0x333df(%rip), %xmm1    # 0x59f98
cvttsd2si %xmm1, %rax
leaq -0x40(%rbp), %rdi
movq %rax, 0x8(%rdi)
movq %rdi, %rsi
callq 0x123b0
movq %rbx, %rdi
callq 0x44fe7
xorpd %xmm0, %xmm0
movapd %xmm0, -0x20(%rbp)
movapd %xmm0, -0x30(%rbp)
movaps -0x30(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x934(%rip), %rsi       # 0x27530
movq %rbx, %rdi
callq 0x2454b
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_q_push
static int janet_q_push(JanetQueue *q, void *item, size_t itemsize) {
    if (janet_q_maybe_resize(q, itemsize)) return 1;
    memcpy((char *) q->data + itemsize * q->tail, item, itemsize);
    q->tail = q->tail + 1 < q->capacity ? q->tail + 1 : 0;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x27305
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x272fa
movslq 0x8(%rbx), %rdi
imulq %r14, %rdi
addq 0x10(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x12680
movl 0x8(%rbx), %ecx
incl %ecx
xorl %eax, %eax
cmpl (%rbx), %ecx
cmovgel %eax, %ecx
movl %ecx, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_q_maybe_resize
static int janet_q_maybe_resize(JanetQueue *q, size_t itemsize) {
    int32_t count = janet_q_count(q);
    /* Resize if needed */
    if (count + 1 >= q->capacity) {
        if (count + 1 >= JANET_MAX_Q_CAPACITY) return 1;
        int32_t newcap = (count + 2) * 2;
        if (newcap > JANET_MAX_Q_CAPACITY) newcap = JANET_MAX_Q_CAPACITY;
        q->data = janet_realloc(q->data, itemsize * newcap);
        if (NULL == q->data) {
            JANET_OUT_OF_MEMORY;
        }
        if (q->head > q->tail) {
            /* Two segments, fix 2nd seg. */
            int32_t newhead = q->head + (newcap - q->capacity);
            size_t seg1 = (size_t)(q->capacity - q->head);
            if (seg1 > 0) {
                memmove((char *) q->data + (newhead * itemsize),
                        (char *) q->data + (q->head * itemsize),
                        seg1 * itemsize);
            }
            q->head = newhead;
        }
        q->capacity = newcap;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %eax
movl 0x8(%rdi), %ecx
cmpl %ecx, %eax
jle 0x27322
addl (%rbx), %ecx
subl %eax, %ecx
leal 0x1(%rcx), %edx
xorl %eax, %eax
cmpl (%rbx), %edx
jl 0x273a7
movl $0x1, %eax
cmpl $0x7fffffd, %ecx        # imm = 0x7FFFFFD
jg 0x273a7
leal 0x4(,%rcx,2), %eax
movl $0x7ffffff, %r15d       # imm = 0x7FFFFFF
cmpl %r15d, %eax
cmovll %eax, %r15d
movq 0x10(%rbx), %rdi
movslq %r15d, %rsi
imulq %r14, %rsi
callq 0x12850
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x273b0
movslq 0x4(%rbx), %rsi
cmpl 0x8(%rbx), %esi
jle 0x273a2
movl (%rbx), %ecx
movl %r15d, %r12d
subl %ecx, %r12d
addl %esi, %r12d
cmpl %esi, %ecx
je 0x2739e
subl %esi, %ecx
movslq %ecx, %rdx
movslq %r12d, %rdi
imulq %r14, %rdi
addq %rax, %rdi
imulq %r14, %rsi
addq %rax, %rsi
imulq %r14, %rdx
callq 0x12930
movl %r12d, 0x4(%rbx)
movl %r15d, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x13700
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_chan_unpack
static int janet_chan_unpack(JanetChannel *chan, Janet *x, int is_cleanup) {
    if (!janet_chan_is_threaded(chan)) return 0;
    switch (janet_type(*x)) {
        default:
            return 1;
        case JANET_BUFFER: {
            JanetBuffer *buf = janet_unwrap_buffer(*x);
            int flags = is_cleanup ? (JANET_MARSHAL_UNSAFE | JANET_MARSHAL_DECREF) : JANET_MARSHAL_UNSAFE;
            *x = janet_unmarshal(buf->data, buf->count, flags, NULL, NULL);
            janet_buffer_deinit(buf);
            janet_free(buf);
            return 0;
        }
        case JANET_NIL:
        case JANET_NUMBER:
        case JANET_POINTER:
        case JANET_BOOLEAN:
        case JANET_CFUNCTION:
            return 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $0x0, 0x50(%rdi)
je 0x273ed
movl %edx, %r15d
movq %rsi, %rbx
movsd (%rsi), %xmm0
xorl %eax, %eax
ucomisd %xmm0, %xmm0
jp 0x27447
movl $0x1, %r14d
cmpl $0xf, %eax
ja 0x273f0
movl $0xa007, %ecx           # imm = 0xA007
btl %eax, %ecx
jae 0x273fc
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xb, %eax
jne 0x273f0
movq (%rbx), %rdi
callq 0x4f838
movq %rax, %r12
xorl %edx, %edx
testl %r15d, %r15d
setne %dl
shll $0x12, %edx
orl $0x20000, %edx          # imm = 0x20000
movq 0x18(%rax), %rdi
movslq 0x10(%rax), %rsi
xorl %r14d, %r14d
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3157c
movq %rax, (%rbx)
movq %r12, %rdi
callq 0x17741
movq %r12, %rdi
callq 0x120b0
jmp 0x273f0
movq (%rbx), %rax
shrq $0x2f, %rax
andl $0xf, %eax
jmp 0x273d8
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_chanat_mark_fq
static void janet_chanat_mark_fq(JanetQueue *fq) {
    JanetChannelPending *pending = fq->data;
    if (fq->head <= fq->tail) {
        for (int32_t i = fq->head; i < fq->tail; i++)
            janet_mark(janet_wrap_fiber(pending[i].fiber));
    } else {
        for (int32_t i = fq->head; i < fq->capacity; i++)
            janet_mark(janet_wrap_fiber(pending[i].fiber));
        for (int32_t i = 0; i < fq->tail; i++)
            janet_mark(janet_wrap_fiber(pending[i].fiber));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r15
movslq 0x4(%rdi), %r12
cmpl 0x8(%rdi), %r12d
jle 0x274e2
movabsq $-0x6800000000000, %r14 # imm = 0xFFF9800000000000
cmpl (%rbx), %r12d
jge 0x274b0
leaq (%r12,%r12,2), %rax
leaq (%r15,%rax,8), %r13
addq $0x8, %r13
movq (%r13), %rdi
movq %r14, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
incq %r12
movslq (%rbx), %rax
addq $0x18, %r13
cmpq %rax, %r12
jl 0x2748d
cmpl $0x0, 0x8(%rbx)
jle 0x27521
addq $0x8, %r15
xorl %r12d, %r12d
movq (%r15), %rdi
movq %r14, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
incq %r12
movslq 0x8(%rbx), %rax
addq $0x18, %r15
cmpq %rax, %r12
jl 0x274bd
jmp 0x27521
cmpl 0x8(%rbx), %r12d
jge 0x27521
movabsq $-0x6800000000000, %r14 # imm = 0xFFF9800000000000
leaq (%r12,%r12,2), %rax
leaq (%r15,%rax,8), %r15
addq $0x8, %r15
movq (%r15), %rdi
movq %r14, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
incq %r12
movslq 0x8(%rbx), %rax
addq $0x18, %r15
cmpq %rax, %r12
jl 0x274fe
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ffi.c
// Function: signature_mark
int signature_mark(void *p, size_t s) {
    (void) s;
    JanetFFISignature *sig = p;
    for (uint32_t i = 0; i < sig->arg_count; i++) {
        JanetFFIType t = sig->args[i].type;
        if (t.prim == JANET_FFI_TYPE_STRUCT) {
            janet_mark(janet_wrap_abstract(t.st));
        }
    }
    return 0;
}

// Assembly:
cmpl $0x0, 0x4(%rdi)
je 0x275a6
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x40(%rdi), %r15
xorl %r12d, %r12d
movabsq $-0x1000000000000, %r14 # imm = 0xFFFF000000000000
cmpl $0xe, (%r15)
jne 0x2758f
movq -0x8(%r15), %rdi
movq %r14, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
incq %r12
movl 0x4(%rbx), %eax
addq $0x20, %r15
cmpq %rax, %r12
jb 0x27575
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ffi.c
// Function: struct_mark
int struct_mark(void *p, size_t s) {
    (void) s;
    JanetFFIStruct *st = p;
    for (uint32_t i = 0; i < st->field_count; i++) {
        JanetFFIType t = st->fields[i].type;
        if (t.prim == JANET_FFI_TYPE_STRUCT) {
            janet_mark(janet_wrap_abstract(t.st));
        }
    }
    return 0;
}

// Assembly:
cmpl $0x0, 0x8(%rdi)
je 0x275ff
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x18(%rdi), %r15
xorl %r12d, %r12d
movabsq $-0x1000000000000, %r14 # imm = 0xFFFF000000000000
cmpl $0xe, (%r15)
jne 0x275e8
movq -0x8(%r15), %rdi
movq %r14, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
incq %r12
movl 0x8(%rbx), %eax
addq $0x18, %r15
cmpq %rax, %r12
jb 0x275ce
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ffi.c
// Function: janet_ffi_trampoline
void janet_ffi_trampoline(void *ctx, void *userdata) {
    if (NULL == userdata) {
        /* Userdata not set. */
        janet_eprintf("no userdata found for janet callback");
        return;
    }
    Janet context = janet_wrap_pointer(ctx);
    JanetFunction *fun = userdata;
    janet_call(fun, 1, &context);
}

// Assembly:
testq %rsi, %rsi
je 0x2766c
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movabsq $-0x800000000000, %rsi  # imm = 0xFFFF800000000000
callq 0x4f9f2
leaq -0x10(%rbp), %rdx
movq %rax, (%rdx)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x4c2d6
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x5e97d(%rip), %rax     # 0x85ff0
movq (%rax), %rsi
leaq 0x343a1(%rip), %rdi     # 0x5ba1e
leaq 0x35916(%rip), %rdx     # 0x5cf9a
xorl %eax, %eax
jmp 0x2f340
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ffi.c
// Function: decode_ffi_cc
static JanetFFICallingConvention decode_ffi_cc(const uint8_t *name) {
    if (!janet_cstrcmp(name, "none")) return JANET_FFI_CC_NONE;
#ifdef JANET_FFI_WIN64_ENABLED
    if (!janet_cstrcmp(name, "win64")) return JANET_FFI_CC_WIN_64;
#endif
#ifdef JANET_FFI_SYSV64_ENABLED
    if (!janet_cstrcmp(name, "sysv64")) return JANET_FFI_CC_SYSV_64;
#endif
#ifdef JANET_FFI_AAPCS64_ENABLED
    if (!janet_cstrcmp(name, "aapcs64")) return JANET_FFI_CC_AAPCS64;
#endif
    if (!janet_cstrcmp(name, "default")) return JANET_FFI_CC_DEFAULT;
    janet_panicf("unknown calling convention %s", name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x34d72(%rip), %rsi     # 0x5d0ab
callq 0x4920e
testl %eax, %eax
je 0x2837f
leaq 0x34d5b(%rip), %rsi     # 0x5d0a4
movq %rbx, %rdi
callq 0x4920e
movl $0x1, %r14d
testl %eax, %eax
je 0x28382
leaq 0x34f22(%rip), %rsi     # 0x5d284
movq %rbx, %rdi
callq 0x4920e
testl %eax, %eax
je 0x28382
leaq 0x34f17(%rip), %rdi     # 0x5d28c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1917b
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_fiber_reset
JanetFiber *janet_fiber_reset(JanetFiber *fiber, JanetFunction *callee, int32_t argc, const Janet *argv) {
    int32_t newstacktop;
    fiber_reset(fiber);
    if (argc) {
        newstacktop = fiber->stacktop + argc;
        if (newstacktop >= fiber->capacity) {
            janet_fiber_setcapacity(fiber, 2 * newstacktop);
        }
        if (argv) {
            memcpy(fiber->data + fiber->stacktop, argv, argc * sizeof(Janet));
        } else {
            /* If argv not given, fill with nil */
            for (int32_t i = 0; i < argc; i++) {
                fiber->data[fiber->stacktop + i] = janet_wrap_nil();
            }
        }
        fiber->stacktop = newstacktop;
    }
    /* Don't panic on failure since we use this to implement janet_pcall */
    if (janet_fiber_funcframe(fiber, callee)) return NULL;
    janet_fiber_frame(fiber)->flags |= JANET_STACKFRAME_ENTRANCE;
#ifdef JANET_EV
    fiber->supervisor_channel = NULL;
#endif
    return fiber;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r13
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movabsq $-0x77fffffffffff, %r12 # imm = 0xFFF8800000000001
movl $0x7fffffff, 0x24(%rdi) # imm = 0x7FFFFFFF
xorl %eax, %eax
movq %rax, 0x38(%rdi)
movaps 0x33bfd(%rip), %xmm0    # 0x5d3d0
movups %xmm0, 0x10(%rdi)
movq %rax, 0x28(%rdi)
movq %r12, %rdi
callq 0x4f95a
movq %rbx, %rdx
movq %rax, 0x40(%rbx)
movl $0x0, 0x48(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x60(%rbx)
movl $0xffc0ffff, %eax       # imm = 0xFFC0FFFF
andl 0x10(%rbx), %eax
orl $0xe0000, %eax          # imm = 0xE0000
movl %eax, 0x10(%rbx)
testl %r15d, %r15d
je 0x298a3
movl 0x1c(%rdx), %ecx
addl %r15d, %ecx
movq %rcx, -0x38(%rbp)
cmpl 0x20(%rdx), %ecx
movq %rdx, -0x30(%rbp)
jl 0x2983b
movq -0x38(%rbp), %rax
leal (%rax,%rax), %esi
movq %rdx, %rdi
callq 0x298e0
movq -0x30(%rbp), %rdx
movq %r14, -0x40(%rbp)
testq %r13, %r13
je 0x29865
movslq 0x1c(%rdx), %rdi
shlq $0x3, %rdi
addq 0x30(%rdx), %rdi
movslq %r15d, %rdx
shlq $0x3, %rdx
movq %r13, %rsi
callq 0x12680
movq -0x30(%rbp), %rdx
jmp 0x29898
testl %r15d, %r15d
jle 0x29898
movl %r15d, %ebx
movq %r12, %r15
xorl %r13d, %r13d
movq 0x30(%rdx), %r12
movl 0x1c(%rdx), %eax
addl %r13d, %eax
movslq %eax, %r14
movq %r15, %rdi
callq 0x4f95a
movq -0x30(%rbp), %rdx
movq %rax, (%r12,%r14,8)
incl %r13d
cmpl %r13d, %ebx
jne 0x29873
movq -0x38(%rbp), %rax
movl %eax, 0x1c(%rdx)
movq -0x40(%rbp), %r14
movq %rdx, %rdi
movq %r14, %rsi
movq %rdx, %rbx
callq 0x29942
testl %eax, %eax
je 0x298b9
xorl %eax, %eax
jmp 0x298d1
movq 0x30(%rbx), %rax
movslq 0x14(%rbx), %rcx
orl $0x2, -0x4(%rax,%rcx,8)
movq $0x0, 0x68(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_fiber_setcapacity
void janet_fiber_setcapacity(JanetFiber *fiber, int32_t n) {
    int32_t old_size = fiber->capacity;
    int32_t diff = n - old_size;
    Janet *newData = janet_realloc(fiber->data, sizeof(Janet) * n);
    if (NULL == newData) {
        JANET_OUT_OF_MEMORY;
    }
    fiber->data = newData;
    fiber->capacity = n;
    janet_vm.next_collection += sizeof(Janet) * diff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movslq 0x20(%rdi), %r15
movq 0x30(%rdi), %rdi
movslq %esi, %r14
leaq (,%r14,8), %rsi
callq 0x12850
testq %rax, %rax
je 0x2993d
movq %r14, %r12
subq %r15, %r12
movq %rax, 0x30(%rbx)
movl %r14d, 0x20(%rbx)
shlq $0x3, %r12
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
addq %r12, 0xa8(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x13730
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_fiber_push
void janet_fiber_push(JanetFiber *fiber, Janet x) {
    if (fiber->stacktop == INT32_MAX) janet_panic("stack overflow");
    if (fiber->stacktop >= fiber->capacity) {
        janet_fiber_grow(fiber, fiber->stacktop);
    }
    fiber->data[fiber->stacktop++] = x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl 0x1c(%rdi), %eax
cmpl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
je 0x29b9a
movq %rsi, %rbx
movq %rdi, %r14
cmpl 0x20(%rdi), %eax
jl 0x29b82
leal (%rax,%rax), %ecx
cmpl $0x40000000, %eax       # imm = 0x40000000
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmovll %ecx, %esi
movq %r14, %rdi
callq 0x298e0
movq 0x30(%r14), %rax
movslq 0x1c(%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x1c(%r14)
movq %rbx, (%rax,%rcx,8)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x34352(%rip), %rdi     # 0x5def3
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_fiber_push2
void janet_fiber_push2(JanetFiber *fiber, Janet x, Janet y) {
    if (fiber->stacktop >= INT32_MAX - 1) janet_panic("stack overflow");
    int32_t newtop = fiber->stacktop + 2;
    if (newtop > fiber->capacity) {
        janet_fiber_grow(fiber, newtop);
    }
    fiber->data[fiber->stacktop] = x;
    fiber->data[fiber->stacktop + 1] = y;
    fiber->stacktop = newtop;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x1c(%rdi), %eax
cmpl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
jge 0x29c0d
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leal 0x2(%rax), %r12d
cmpl 0x20(%rdi), %r12d
jle 0x29be7
leal (%r12,%r12), %ecx
cmpl $0x3ffffffe, %eax       # imm = 0x3FFFFFFE
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmovll %ecx, %esi
movq %r14, %rdi
callq 0x298e0
movq 0x30(%r14), %rax
movslq 0x1c(%r14), %rcx
movq %r15, (%rax,%rcx,8)
movq 0x30(%r14), %rax
movslq 0x1c(%r14), %rcx
movq %rbx, 0x8(%rax,%rcx,8)
movl %r12d, 0x1c(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x342df(%rip), %rdi     # 0x5def3
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_fiber_push3
void janet_fiber_push3(JanetFiber *fiber, Janet x, Janet y, Janet z) {
    if (fiber->stacktop >= INT32_MAX - 2) janet_panic("stack overflow");
    int32_t newtop = fiber->stacktop + 3;
    if (newtop > fiber->capacity) {
        janet_fiber_grow(fiber, newtop);
    }
    fiber->data[fiber->stacktop] = x;
    fiber->data[fiber->stacktop + 1] = y;
    fiber->data[fiber->stacktop + 2] = z;
    fiber->stacktop = newtop;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x1c(%rdi), %eax
cmpl $0x7ffffffd, %eax       # imm = 0x7FFFFFFD
jge 0x29c9d
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leal 0x3(%rax), %r13d
cmpl 0x20(%rdi), %r13d
jle 0x29c64
leal (,%r13,2), %ecx
cmpl $0x3ffffffd, %eax       # imm = 0x3FFFFFFD
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmovll %ecx, %esi
movq %r14, %rdi
callq 0x298e0
movq 0x30(%r14), %rax
movslq 0x1c(%r14), %rcx
movq %r12, (%rax,%rcx,8)
movq 0x30(%r14), %rax
movslq 0x1c(%r14), %rcx
movq %r15, 0x8(%rax,%rcx,8)
movq 0x30(%r14), %rax
movslq 0x1c(%r14), %rcx
movq %rbx, 0x10(%rax,%rcx,8)
movl %r13d, 0x1c(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3424f(%rip), %rdi     # 0x5def3
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_fiber_pushn
void janet_fiber_pushn(JanetFiber *fiber, const Janet *arr, int32_t n) {
    if (fiber->stacktop > INT32_MAX - n) janet_panic("stack overflow");
    int32_t newtop = fiber->stacktop + n;
    if (newtop > fiber->capacity) {
        janet_fiber_grow(fiber, newtop);
    }
    safe_memcpy(fiber->data + fiber->stacktop, arr, n * sizeof(Janet));
    fiber->stacktop = newtop;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x1c(%rdi), %r12d
movl %edx, %eax
xorl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl %eax, %r12d
jg 0x29d19
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
addl %edx, %r12d
cmpl 0x20(%rdi), %r12d
jle 0x29cf1
leal (%r12,%r12), %eax
cmpl $0x40000000, %r12d      # imm = 0x40000000
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmovll %eax, %esi
movq %rbx, %rdi
callq 0x298e0
movslq 0x1c(%rbx), %rdi
shlq $0x3, %rdi
addq 0x30(%rbx), %rdi
movslq %r15d, %rdx
shlq $0x3, %rdx
movq %r14, %rsi
callq 0x49017
movl %r12d, 0x1c(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x341d3(%rip), %rdi     # 0x5def3
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: make_struct_n
static Janet make_struct_n(const Janet *args, int32_t n) {
    int32_t i = 0;
    JanetKV *st = janet_struct_begin(n & (~1));
    for (; i < n; i += 2) {
        janet_struct_put(st, args[i], args[i + 1]);
    }
    return janet_wrap_struct(janet_struct_end(st));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %edi
andl $-0x2, %edi
callq 0x46f8c
movq %rax, %r15
testl %ebx, %ebx
jle 0x29d63
xorl %r12d, %r12d
movq (%r14,%r12,8), %rsi
movq 0x8(%r14,%r12,8), %rdx
movq %r15, %rdi
callq 0x472ba
addq $0x2, %r12
cmpl %ebx, %r12d
jl 0x29d49
movq %r15, %rdi
callq 0x472c9
movabsq $-0x3000000000000, %rsi # imm = 0xFFFD000000000000
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4f9ad
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_env_valid
int janet_env_valid(JanetFuncEnv *env) {
    if (env->offset < 0) {
        int32_t real_offset = -(env->offset);
        JanetFiber *fiber = env->as.fiber;
        int32_t i = fiber->frame;
        while (i > 0) {
            JanetStackFrame *frame = (JanetStackFrame *)(fiber->data + i - JANET_FRAME_SIZE);
            if (real_offset == i &&
                    frame->env == env &&
                    frame->func &&
                    frame->func->def->slotcount == env->length) {
                env->offset = real_offset;
                return 1;
            }
            i = frame->prevframe;
        }
        /* Invalid, set to empty off-stack variant. */
        env->offset = 0;
        env->length = 0;
        env->as.values = NULL;
        return 0;
    } else {
        return 1;
    }
}

// Assembly:
movl 0x1c(%rdi), %ecx
movl $0x1, %eax
testl %ecx, %ecx
js 0x29d92
retq
pushq %rbp
movq %rsp, %rbp
negl %ecx
leaq 0x10(%rdi), %rdx
movq 0x10(%rdi), %rsi
movl 0x14(%rsi), %r8d
testl %r8d, %r8d
jle 0x29deb
movq 0x30(%rsi), %r9
movl %r8d, %r10d
cmpl %ecx, %r8d
jne 0x29dbc
cmpq %rdi, -0x10(%r9,%r10,8)
je 0x29dcb
movl -0x8(%r9,%r10,8), %r8d
movb $0x1, %r9b
testb %r9b, %r9b
jne 0x29da4
jmp 0x29df3
movq -0x20(%r9,%r10,8), %r11
testq %r11, %r11
je 0x29dbc
movq 0x10(%r11), %r11
movl 0x5c(%r11), %r11d
cmpl 0x18(%rdi), %r11d
jne 0x29dbc
movl %ecx, 0x1c(%rdi)
xorl %r9d, %r9d
jmp 0x29dc4
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_env_maybe_detach
void janet_env_maybe_detach(JanetFuncEnv *env) {
    /* Check for detachable closure envs */
    janet_env_valid(env);
    if (env->offset > 0) {
        JanetFiberStatus s = janet_fiber_status(env->as.fiber);
        int isFinished = s == JANET_STATUS_DEAD ||
                         s == JANET_STATUS_ERROR ||
                         s == JANET_STATUS_USER0 ||
                         s == JANET_STATUS_USER1 ||
                         s == JANET_STATUS_USER2 ||
                         s == JANET_STATUS_USER3 ||
                         s == JANET_STATUS_USER4;
        if (isFinished) {
            janet_env_detach(env);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x29d85
cmpl $0x0, 0x1c(%rbx)
jle 0x29e40
movq 0x10(%rbx), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
andl $0x3c0000, %ecx         # imm = 0x3C0000
cmpl $0x40000, %ecx          # imm = 0x40000
je 0x29e35
shrl $0x10, %eax
andl $0x3f, %eax
cmpl $0x8, %eax
ja 0x29e40
movl $0x103, %ecx            # imm = 0x103
btl %eax, %ecx
jae 0x29e40
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x29e54
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_env_detach
static void janet_env_detach(JanetFuncEnv *env) {
    /* Check for closure environment */
    if (env) {
        janet_env_valid(env);
        int32_t len = env->length;
        size_t s = sizeof(Janet) * (size_t) len;
        Janet *vmem = janet_malloc(s);
        janet_vm.next_collection += (uint32_t) s;
        if (NULL == vmem) {
            JANET_OUT_OF_MEMORY;
        }
        Janet *values = env->as.fiber->data + env->offset;
        safe_memcpy(vmem, values, s);
        uint32_t *bitset = janet_stack_frame(values)->func->def->closure_bitset;
        if (bitset) {
            /* Clear unneeded references in closure environment */
            for (int32_t i = 0; i < len; i += 32) {
                uint32_t mask = ~(bitset[i >> 5]);
                int32_t maxj = i + 32 > len ? len : i + 32;
                for (int32_t j = i; j < maxj; j++) {
                    if (mask & 1) vmem[j] = janet_wrap_nil();
                    mask >>= 1;
                }
            }
        }
        env->offset = 0;
        env->as.values = vmem;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x29f75
movq %rdi, %r14
callq 0x29d85
movslq 0x18(%r14), %r13
leaq (,%r13,8), %r15
movq %r15, %rdi
callq 0x12770
movq %rax, %r12
movl %r15d, %ebx
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
addq %rbx, 0xa8(%rax)
testq %r12, %r12
je 0x29f84
movq %r12, %rdi
movq 0x10(%r14), %rax
movq 0x30(%rax), %rax
movq %r14, -0x38(%rbp)
movslq 0x1c(%r14), %rcx
leaq (%rax,%rcx,8), %r12
movq %rdi, -0x30(%rbp)
movq %r12, %rsi
movq %r15, %rdx
callq 0x49017
movq -0x20(%r12), %rax
movq 0x10(%rax), %rax
movq 0x30(%rax), %rax
movq %rax, -0x48(%rbp)
testq %rax, %rax
sete %al
testl %r13d, %r13d
setle %cl
orb %al, %cl
jne 0x29f62
xorl %r14d, %r14d
movq -0x30(%rbp), %rbx
movq %r13, -0x40(%rbp)
leaq 0x20(%r14), %rax
cmpl %r13d, %eax
movq %rax, -0x50(%rbp)
cmovll %eax, %r13d
movq %r14, %rax
shrq $0x3, %rax
movq -0x48(%rbp), %rcx
movl (%rcx,%rax), %r12d
notl %r12d
xorl %r15d, %r15d
testb $0x1, %r12b
je 0x29f3f
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4f95a
movq %rax, (%rbx,%r15,8)
shrl %r12d
incq %r15
leal (%r14,%r15), %eax
cmpl %eax, %r13d
jg 0x29f26
addq $0x100, %rbx            # imm = 0x100
movq -0x40(%rbp), %r13
movq -0x50(%rbp), %r14
cmpl %r14d, %r13d
jg 0x29f02
movq -0x38(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1378c
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_fiber_cframe
void janet_fiber_cframe(JanetFiber *fiber, JanetCFunction cfun) {
    JanetStackFrame *newframe;

    int32_t oldframe = fiber->frame;
    int32_t nextframe = fiber->stackstart;
    int32_t nextstacktop = fiber->stacktop + JANET_FRAME_SIZE;

    if (fiber->capacity < nextstacktop) {
        janet_fiber_setcapacity(fiber, 2 * nextstacktop);
#ifdef JANET_DEBUG
    } else {
        janet_fiber_refresh_memory(fiber);
#endif
    }

    /* Set the next frame */
    fiber->frame = nextframe;
    fiber->stacktop = fiber->stackstart = nextstacktop;
    newframe = janet_fiber_frame(fiber);

    /* Set up the new frame */
    newframe->prevframe = oldframe;
    newframe->pc = (uint32_t *) cfun;
    newframe->func = NULL;
    newframe->env = NULL;
    newframe->flags = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x14(%rdi), %r12d
movl 0x18(%rdi), %eax
movslq %eax, %r15
movl 0x1c(%rdi), %r13d
addl $0x4, %r13d
cmpl %r13d, 0x20(%rdi)
jge 0x2a201
leal (,%r13,2), %esi
movq %r14, %rdi
callq 0x298e0
movl %r15d, 0x14(%r14)
movl %r13d, 0x18(%r14)
movl %r13d, 0x1c(%r14)
movq 0x30(%r14), %rax
movl %r12d, -0x8(%rax,%r15,8)
movq %rbx, -0x18(%rax,%r15,8)
xorl %ecx, %ecx
movq %rcx, -0x20(%rax,%r15,8)
movq %rcx, -0x10(%rax,%r15,8)
movl $0x0, -0x4(%rax,%r15,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_fiber_popframe
void janet_fiber_popframe(JanetFiber *fiber) {
    JanetStackFrame *frame = janet_fiber_frame(fiber);
    if (fiber->frame == 0) return;

    /* Clean up the frame (detach environments) */
    if (NULL != frame->func)
        janet_env_detach(frame->env);

    /* Shrink stack */
    fiber->stacktop = fiber->stackstart = fiber->frame;
    fiber->frame = frame->prevframe;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movslq 0x14(%rdi), %r14
testq %r14, %r14
je 0x2a27c
movq %rdi, %rbx
movq 0x30(%rdi), %r15
cmpq $0x0, -0x20(%r15,%r14,8)
je 0x2a26b
movq -0x10(%r15,%r14,8), %rdi
callq 0x29e54
movl 0x14(%rbx), %eax
movl %eax, 0x18(%rbx)
movl %eax, 0x1c(%rbx)
movl -0x8(%r15,%r14,8), %eax
movl %eax, 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/fiber.c
// Function: janet_fiber_can_resume
int janet_fiber_can_resume(JanetFiber *fiber) {
    JanetFiberStatus s = janet_fiber_status(fiber);
    int isFinished = s == JANET_STATUS_DEAD ||
                     s == JANET_STATUS_ERROR ||
                     s == JANET_STATUS_USER0 ||
                     s == JANET_STATUS_USER1 ||
                     s == JANET_STATUS_USER2 ||
                     s == JANET_STATUS_USER3 ||
                     s == JANET_STATUS_USER4;
    return !isFinished;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x10(%rdi), %eax
movl %eax, %ecx
shrl $0x10, %ecx
andl $0x3f, %ecx
cmpl $0x2, %ecx
setae %dl
andl $0x3c0000, %eax         # imm = 0x3C0000
cmpl $0x40000, %eax          # imm = 0x40000
setne %al
cmpl $0x8, %ecx
setne %cl
andb %al, %cl
andb %dl, %cl
movzbl %cl, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/filewatch.c
// Function: decode_watch_flags
static uint32_t decode_watch_flags(const Janet *options, int32_t n) {
    uint32_t flags = 0;
    for (int32_t i = 0; i < n; i++) {
        if (!(janet_checktype(options[i], JANET_KEYWORD))) {
            janet_panicf("expected keyword, got %v", options[i]);
        }
        JanetKeyword keyw = janet_unwrap_keyword(options[i]);
        const JanetWatchFlagName *result = janet_strbinsearch(watcher_flags_linux,
                                           sizeof(watcher_flags_linux) / sizeof(JanetWatchFlagName),
                                           sizeof(JanetWatchFlagName),
                                           keyw);
        if (!result) {
            janet_panicf("unknown inotify flag %v", options[i]);
        }
        flags |= result->flag;
    }
    return flags;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
jle 0x2a8b5
movq %rdi, %rbx
movl %esi, %r12d
xorl %r13d, %r13d
leaq 0x57ad0(%rip), %r15     # 0x82340
xorl %r14d, %r14d
movq (%rbx,%r13,8), %rsi
movq %rsi, %rax
shrq $0x2f, %rax
cmpl $0x1fff6, %eax          # imm = 0x1FFF6
jne 0x2a8d7
movq %rsi, %rdi
callq 0x4f838
movl $0x10, %esi
movl $0x10, %edx
movq %r15, %rdi
movq %rax, %rcx
callq 0x4927d
testq %rax, %rax
je 0x2a8ca
orl 0x8(%rax), %r14d
incq %r13
cmpq %r13, %r12
jne 0x2a873
jmp 0x2a8b8
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx,%r13,8), %rsi
leaq 0x342c9(%rip), %rdi     # 0x5eb9e
jmp 0x2a8de
leaq 0x342a7(%rip), %rdi     # 0x5eb85
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/filewatch.c
// Function: janet_filewatch_mark
static int janet_filewatch_mark(void *p, size_t s) {
    JanetWatcher *watcher = (JanetWatcher *) p;
    (void) s;
    if (watcher->channel == NULL) return 0; /* Incomplete initialization */
#ifdef JANET_WINDOWS
    for (int32_t i = 0; i < watcher->watch_descriptors->capacity; i++) {
        const JanetKV *kv = watcher->watch_descriptors->data + i;
        if (!janet_checktype(kv->value, JANET_POINTER)) continue;
        OverlappedWatch *ow = janet_unwrap_pointer(kv->value);
        janet_mark(janet_wrap_fiber(ow->fiber));
        janet_mark(janet_wrap_abstract(ow->stream));
        janet_mark(janet_wrap_string(ow->dir_path));
    }
#else
    janet_mark(janet_wrap_abstract(watcher->stream));
#endif
    janet_mark(janet_wrap_abstract(watcher->channel));
    janet_mark(janet_wrap_table(watcher->watch_descriptors));
    return 0;
}

// Assembly:
cmpq $0x0, 0x10(%rdi)
je 0x2ac97
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movabsq $-0x1000000000000, %r14 # imm = 0xFFFF000000000000
movq %r14, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
movq 0x8(%rbx), %rdi
movabsq $-0x3800000000000, %rsi # imm = 0xFFFC800000000000
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
popq %rbx
popq %r14
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/gc.c
// Function: janet_mark_function
static void janet_mark_function(JanetFunction *func) {
    int32_t i;
    int32_t numenvs;
    if (janet_gc_reachable(func))
        return;
    janet_gc_mark(func);
    if (NULL != func->def) {
        /* this should always be true, except if function is only partially constructed */
        numenvs = func->def->environments_length;
        for (i = 0; i < numenvs; ++i) {
            janet_mark_funcenv(func->envs[i]);
        }
        janet_mark_funcdef(func->def);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl (%rdi), %eax
btl $0x8, %eax
jb 0x2b373
movq %rdi, %rbx
orl $0x100, %eax            # imm = 0x100
movl %eax, (%rdi)
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x2b373
movslq 0x74(%rax), %r14
testq %r14, %r14
jle 0x2b360
xorl %r15d, %r15d
movq 0x18(%rbx,%r15,8), %rdi
callq 0x2c24c
incq %r15
cmpq %r15, %r14
jne 0x2b34e
movq 0x10(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2c2a9
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq