LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_schedule_general
static void janet_schedule_general(JanetFiber *fiber, Janet value, JanetSignal sig, int soon) {
    if (fiber->gc.flags & JANET_FIBER_EV_FLAG_CANCELED) return;
    if (!(fiber->gc.flags & JANET_FIBER_FLAG_ROOT)) {
        Janet task_element = janet_wrap_fiber(fiber);
        janet_table_put(&janet_vm.active_tasks, task_element, janet_wrap_true());
    }
    JanetTask t = { fiber, value, sig, ++fiber->sched_id };
    fiber->gc.flags |= JANET_FIBER_FLAG_ROOT;
    if (sig == JANET_SIGNAL_ERROR) fiber->gc.flags |= JANET_FIBER_EV_FLAG_CANCELED;
    if (soon) {
        janet_q_push_head(&janet_vm.spawn, &t, sizeof(t));
    } else {
        janet_q_push(&janet_vm.spawn, &t, sizeof(t));
    }
}

// Assembly:
movl (%rdi), %eax
btl $0x10, %eax
jb 0x2296e
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebx
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r14
btl $0x12, %eax
jb 0x228b7
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %r14, %rdi
callq 0x4ed7e
movq %rax, -0x48(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
leaq 0x298(%rax), %r13
movabsq $-0x6ffffffffffff, %rdi # imm = 0xFFF9000000000001
callq 0x4ece6
movq %r13, %rdi
movq -0x48(%rbp), %rsi
movq %rax, %rdx
callq 0x476f0
movl (%r14), %eax
movq %r14, -0x40(%rbp)
movq %r12, -0x38(%rbp)
movl %r15d, -0x30(%rbp)
movl 0x48(%r14), %ecx
incl %ecx
movl %ecx, 0x48(%r14)
movl %ecx, -0x2c(%rbp)
xorl %ecx, %ecx
cmpl $0x1, %r15d
sete %cl
shll $0x10, %ecx
orl %eax, %ecx
orl $0x40000, %ecx          # imm = 0x40000
movl %ecx, (%r14)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
leaq 0x230(%rax), %rdi
testl %ebx, %ebx
je 0x22952
movq %rax, %r14
movl $0x18, %esi
callq 0x26e6f
testl %eax, %eax
jne 0x22960
movl 0x234(%r14), %eax
xorl %ecx, %ecx
testl %eax, %eax
jg 0x22927
movl 0x230(%r14), %ecx
addl %ecx, %eax
decl %eax
movq 0x240(%r14), %rcx
cltq
leaq (%rax,%rax,2), %rdx
movq -0x30(%rbp), %rsi
movq %rsi, 0x10(%rcx,%rdx,8)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rcx,%rdx,8)
movl %eax, 0x234(%r14)
jmp 0x22960
leaq -0x40(%rbp), %rsi
movl $0x18, %edx
callq 0x26e18
addq $0x28, %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/ev.c
// Function: janet_ev_mark
void janet_ev_mark(void) {

    /* Pending tasks */
    JanetTask *tasks = janet_vm.spawn.data;
    if (janet_vm.spawn.head <= janet_vm.spawn.tail) {
        for (int32_t i = janet_vm.spawn.head; i < janet_vm.spawn.tail; i++) {
            janet_mark(janet_wrap_fiber(tasks[i].fiber));
            janet_mark(tasks[i].value);
        }
    } else {
        for (int32_t i = janet_vm.spawn.head; i < janet_vm.spawn.capacity; i++) {
            janet_mark(janet_wrap_fiber(tasks[i].fiber));
            janet_mark(tasks[i].value);
        }
        for (int32_t i = 0; i < janet_vm.spawn.tail; i++) {
            janet_mark(janet_wrap_fiber(tasks[i].fiber));
            janet_mark(tasks[i].value);
        }
    }

    /* Pending timeouts */
    for (size_t i = 0; i < janet_vm.tq_count; i++) {
        janet_mark(janet_wrap_fiber(janet_vm.tq[i].fiber));
        if (janet_vm.tq[i].curr_fiber != NULL) {
            janet_mark(janet_wrap_fiber(janet_vm.tq[i].curr_fiber));
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movabsq $-0x6800000000000, %rbx # imm = 0xFFF9800000000000
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %r14
movq 0x240(%rax), %r15
movslq 0x234(%rax), %r12
movl 0x238(%rax), %eax
cmpl %eax, %r12d
jle 0x22a6d
cmpl 0x230(%r14), %r12d
jge 0x22a31
leaq (%r12,%r12,2), %rax
leaq (%r15,%rax,8), %r13
addq $0x8, %r13
movq -0x8(%r13), %rdi
movq %rbx, %rsi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2aca7
movq (%r13), %rdi
callq 0x2aca7
incq %r12
movslq 0x230(%r14), %rax
addq $0x18, %r13
cmpq %rax, %r12
jl 0x229fa
movl 0x238(%r14), %eax
testl %eax, %eax
jle 0x22aad
addq $0x8, %r15
xorl %r12d, %r12d
movq -0x8(%r15), %rdi
movq %rbx, %rsi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2aca7
movq (%r15), %rdi
callq 0x2aca7
incq %r12
movslq 0x238(%r14), %rax
addq $0x18, %r15
cmpq %rax, %r12
jl 0x22a3c
jmp 0x22aad
cmpl %eax, %r12d
jge 0x22aad
leaq (%r12,%r12,2), %rax
leaq (%r15,%rax,8), %r15
addq $0x8, %r15
movq -0x8(%r15), %rdi
movq %rbx, %rsi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2aca7
movq (%r15), %rdi
callq 0x2aca7
incq %r12
movslq 0x238(%r14), %rax
addq $0x18, %r15
cmpq %rax, %r12
jl 0x22a7e
cmpq $0x0, 0x220(%r14)
je 0x22b0a
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x248(%r14), %rax
movq 0x8(%rax,%r15), %rdi
movq %rbx, %rsi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2aca7
movq 0x248(%r14), %rax
movq 0x10(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x22afa
movq %rbx, %rsi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2aca7
incq %r12
addq $0x30, %r15
cmpq 0x220(%r14), %r12
jb 0x22abd
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/ev.c
// Function: janet_ev_init_common
void janet_ev_init_common(void) {
    janet_q_init(&janet_vm.spawn);
    janet_vm.tq = NULL;
    janet_vm.tq_count = 0;
    janet_vm.tq_capacity = 0;
    janet_table_init_raw(&janet_vm.threaded_abstracts, 0);
    janet_table_init_raw(&janet_vm.active_tasks, 0);
    janet_table_init_raw(&janet_vm.signal_handlers, 0);
    janet_rng_seed(&janet_vm.ev_rng, 0);
#ifndef JANET_WINDOWS
    pthread_attr_init(&janet_vm.new_thread_attr);
    pthread_attr_setdetachstate(&janet_vm.new_thread_attr, PTHREAD_CREATE_DETACHED);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
leaq 0x268(%rax), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x22c(%rax)
movups %xmm0, 0x220(%rax)
movups %xmm0, 0x240(%rax)
xorl %esi, %esi
callq 0x47402
leaq 0x298(%rbx), %rdi
xorl %esi, %esi
callq 0x47402
leaq 0x2c8(%rbx), %rdi
xorl %esi, %esi
callq 0x47402
leaq 0x250(%rbx), %rdi
xorl %esi, %esi
callq 0x32af8
addq $0x2f8, %rbx            # imm = 0x2F8
movq %rbx, %rdi
callq 0x12540
movq %rbx, %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x12700
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_deinit_common
void janet_ev_deinit_common(void) {
    JanetTimeout to;
    while (peek_timeout(&to)) {
        handle_timeout_worker(to, 1);
        pop_timeout(0);
    }
    janet_q_deinit(&janet_vm.spawn);
    janet_free(janet_vm.tq);
    janet_table_deinit(&janet_vm.threaded_abstracts);
    janet_table_deinit(&janet_vm.active_tasks);
    janet_table_deinit(&janet_vm.signal_handlers);
#ifndef JANET_WINDOWS
    pthread_attr_destroy(&janet_vm.new_thread_attr);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
cmpq $0x0, 0x220(%rax)
je 0x22bee
movq 0x248(%rbx), %rax
movl 0x20(%rax), %edi
movq 0x28(%rax), %rsi
movl $0x1, %edx
callq 0x22c3f
callq 0x22c84
cmpq $0x0, 0x220(%rbx)
jne 0x22bc7
movq 0x240(%rbx), %rdi
callq 0x120b0
movq 0x248(%rbx), %rdi
callq 0x120b0
leaq 0x268(%rbx), %rdi
callq 0x4740b
leaq 0x298(%rbx), %rdi
callq 0x4740b
leaq 0x2c8(%rbx), %rdi
callq 0x4740b
addq $0x2f8, %rbx            # imm = 0x2F8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x12a00
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: handle_timeout_worker
static void handle_timeout_worker(JanetTimeout to, int cancel) {
    if (!to.has_worker) return;
#ifdef JANET_WINDOWS
    (void) cancel;
    QueueUserAPC(janet_timeout_stop, to.worker, 0);
    WaitForSingleObject(to.worker, INFINITE);
    CloseHandle(to.worker);
#else
#ifdef JANET_ANDROID
    if (cancel) janet_assert(!pthread_kill(to.worker, SIGUSR1), "pthread_kill");
#else
    if (cancel) janet_assert(!pthread_cancel(to.worker), "pthread_cancel");
#endif
    void *res = NULL;
    janet_assert(!pthread_join(to.worker, &res), "pthread_join");
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testl %edi, %edi
je 0x22c73
movq %rsi, %rbx
testl %edx, %edx
je 0x22c5c
movq %rbx, %rdi
callq 0x12b60
testl %eax, %eax
jne 0x22c7f
leaq -0x10(%rbp), %rsi
movq $0x0, (%rsi)
movq %rbx, %rdi
callq 0x12b20
testl %eax, %eax
jne 0x22c7a
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x13360
callq 0x1332c
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: pop_timeout
static void pop_timeout(size_t index) {
    if (janet_vm.tq_count <= index) return;
    janet_vm.tq[index] = janet_vm.tq[--janet_vm.tq_count];
    for (;;) {
        size_t left = (index << 1) + 1;
        size_t right = left + 1;
        size_t smallest = index;
        if (left < janet_vm.tq_count &&
                (janet_vm.tq[left].when < janet_vm.tq[smallest].when))
            smallest = left;
        if (right < janet_vm.tq_count &&
                (janet_vm.tq[right].when < janet_vm.tq[smallest].when))
            smallest = right;
        if (smallest == index) return;
        JanetTimeout temp = janet_vm.tq[index];
        janet_vm.tq[index] = janet_vm.tq[smallest];
        janet_vm.tq[smallest] = temp;
        index = smallest;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x220(%rax), %rcx
testq %rcx, %rcx
je 0x22dd0
movq 0x248(%rax), %rdx
decq %rcx
movq %rcx, 0x220(%rax)
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movups (%rdx,%rcx), %xmm0
movups 0x10(%rdx,%rcx), %xmm1
movups 0x20(%rdx,%rcx), %xmm2
movups %xmm2, 0x20(%rdx)
movups %xmm1, 0x10(%rdx)
movups %xmm0, (%rdx)
xorl %edx, %edx
movq %rdx, %rcx
leaq 0x1(,%rdx,2), %rdi
movq 0x220(%rax), %rsi
cmpq %rsi, %rdi
jae 0x22d1e
movq 0x248(%rax), %rcx
leaq (%rdi,%rdi,2), %r8
shlq $0x4, %r8
movq (%rcx,%r8), %r8
leaq (%rdx,%rdx,2), %r9
shlq $0x4, %r9
cmpq (%rcx,%r9), %r8
jl 0x22d1b
movq %rdx, %rdi
movq %rdi, %rcx
leaq 0x2(,%rdx,2), %rdi
cmpq %rsi, %rdi
jae 0x22d52
movq 0x248(%rax), %rsi
leaq (%rdi,%rdi,2), %r8
shlq $0x4, %r8
movq (%rsi,%r8), %r8
leaq (%rcx,%rcx,2), %r9
shlq $0x4, %r9
cmpq (%rsi,%r9), %r8
jl 0x22d4f
movq %rcx, %rdi
movq %rdi, %rcx
cmpq %rdx, %rcx
je 0x22dd0
movq 0x248(%rax), %rsi
leaq (%rdx,%rdx,2), %rdx
shlq $0x4, %rdx
movups (%rsi,%rdx), %xmm0
movups 0x10(%rsi,%rdx), %xmm1
movups 0x20(%rsi,%rdx), %xmm2
movaps %xmm2, -0x10(%rbp)
movaps %xmm1, -0x20(%rbp)
movaps %xmm0, -0x30(%rbp)
movq %rcx, %rdi
shlq $0x4, %rdi
leaq (%rdi,%rdi,2), %rdi
movups (%rsi,%rdi), %xmm0
movups 0x10(%rsi,%rdi), %xmm1
movups 0x20(%rsi,%rdi), %xmm2
movups %xmm0, (%rsi,%rdx)
movups %xmm1, 0x10(%rsi,%rdx)
movups %xmm2, 0x20(%rsi,%rdx)
movq 0x248(%rax), %rdx
movaps -0x30(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
movaps -0x10(%rbp), %xmm2
movups %xmm2, 0x20(%rdx,%rdi)
movups %xmm1, 0x10(%rdx,%rdi)
movups %xmm0, (%rdx,%rdi)
movq %rcx, %rdx
jmp 0x22ce3
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_addtimeout
void janet_addtimeout(double sec) {
    JanetFiber *fiber = janet_vm.root_fiber;
    JanetTimeout to;
    to.when = ts_delta(ts_now(), sec);
    to.fiber = fiber;
    to.curr_fiber = NULL;
    to.sched_id = fiber->sched_id;
    to.is_error = 1;
    to.has_worker = 0;
    add_timeout(to);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %xmm0, -0x20(%rbp)
movq %xmm0, %r15
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x28(%rax), %r14
callq 0x22ef2
movq %rax, %rbx
btrq $0x3f, %r15
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
cmpq %rax, %r15
jne 0x22e36
pxor %xmm0, %xmm0
ucomisd -0x20(%rbp), %xmm0
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmovaq %rbx, %rax
jmp 0x22e53
movsd -0x20(%rbp), %xmm0
mulsd 0x36145(%rip), %xmm0    # 0x58f88
callq 0x12140
cvttsd2si %xmm0, %rax
addq %rax, %rbx
movq %rbx, %rax
movq %rax, -0x50(%rbp)
movq %r14, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movl 0x48(%r14), %eax
movl %eax, -0x38(%rbp)
movq $0x1, -0x34(%rbp)
movups -0x50(%rbp), %xmm0
movups -0x40(%rbp), %xmm1
movups -0x30(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x22f3f
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: ts_delta
static JanetTimestamp ts_delta(JanetTimestamp ts, double delta) {
    if (isinf(delta)) {
        return delta < 0 ? ts : INT64_MAX;
    }
    ts += (int64_t)round(delta * 1000);
    return ts;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
jne 0x22ed6
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmovaq %rbx, %rax
jmp 0x22eeb
mulsd 0x360aa(%rip), %xmm0    # 0x58f88
callq 0x12140
cvttsd2si %xmm0, %rax
addq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: ts_now
static JanetTimestamp ts_now(void) {
    struct timespec now;
    janet_assert(-1 != clock_gettime(CLOCK_MONOTONIC, &now), "failed to get time");
    uint64_t res = 1000 * now.tv_sec;
    res += now.tv_nsec / 1000000;
    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x12230
cmpl $-0x1, %eax
je 0x22f3a
imulq $0x3e8, -0x10(%rbp), %rcx # imm = 0x3E8
movabsq $0x431bde82d7b634db, %rax # imm = 0x431BDE82D7B634DB
imulq -0x8(%rbp)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %rdx
addq %rdx, %rax
addq %rcx, %rax
addq $0x10, %rsp
popq %rbp
retq
callq 0x13394
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: add_timeout
static void add_timeout(JanetTimeout to) {
    size_t oldcount = janet_vm.tq_count;
    size_t newcount = oldcount + 1;
    if (newcount > janet_vm.tq_capacity) {
        size_t newcap = 2 * newcount;
        JanetTimeout *tq = janet_realloc(janet_vm.tq, newcap * sizeof(JanetTimeout));
        if (NULL == tq) {
            JANET_OUT_OF_MEMORY;
        }
        janet_vm.tq = tq;
        janet_vm.tq_capacity = newcap;
    }
    /* Append */
    janet_vm.tq_count = (int32_t) newcount;
    janet_vm.tq[oldcount] = to;
    /* Heapify */
    size_t index = oldcount;
    while (index > 0) {
        size_t parent = (index - 1) >> 1;
        if (janet_vm.tq[parent].when <= janet_vm.tq[index].when) break;
        /* Swap */
        JanetTimeout tmp = janet_vm.tq[index];
        janet_vm.tq[index] = janet_vm.tq[parent];
        janet_vm.tq[parent] = tmp;
        /* Next */
        index = parent;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
movq 0x220(%rax), %r14
movq 0x248(%rax), %rax
leaq 0x1(%r14), %r15
cmpq 0x228(%rbx), %r15
jbe 0x22fa8
movq %r15, %rcx
shlq $0x5, %rcx
leaq (%rcx,%rcx,2), %rsi
movq %rax, %rdi
callq 0x12840
testq %rax, %rax
je 0x23075
leaq (%r15,%r15), %rcx
movq %rax, 0x248(%rbx)
movq %rcx, 0x228(%rbx)
leaq 0x10(%rbp), %rcx
movslq %r15d, %rdx
movq %rdx, 0x220(%rbx)
leaq (%r14,%r14,2), %rdx
shlq $0x4, %rdx
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20(%rax,%rdx)
movups %xmm1, 0x10(%rax,%rdx)
movups %xmm0, (%rax,%rdx)
testq %r14, %r14
je 0x2306a
leaq -0x1(%r14), %rax
leaq (%r14,%r14,2), %rdx
movq %rax, %r14
shrq %r14
movq 0x248(%rbx), %rsi
leaq (%r14,%r14,2), %rcx
shlq $0x4, %rcx
movq (%rsi,%rcx), %rdi
shlq $0x4, %rdx
cmpq (%rsi,%rdx), %rdi
jle 0x2306a
leaq (%rsi,%rcx), %rdi
addq %rsi, %rdx
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups 0x20(%rdx), %xmm2
movaps %xmm2, -0x30(%rbp)
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups 0x20(%rdi), %xmm2
movups %xmm0, (%rdx)
movups %xmm1, 0x10(%rdx)
movups %xmm2, 0x20(%rdx)
movq 0x248(%rbx), %rdx
movaps -0x50(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
movaps -0x30(%rbp), %xmm2
movups %xmm2, 0x20(%rdx,%rcx)
movups %xmm1, 0x10(%rdx,%rcx)
movups %xmm0, (%rdx,%rcx)
cmpq $0x1, %rax
ja 0x22fe0
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x133c8
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_addtimeout_nil
void janet_addtimeout_nil(double sec) {
    JanetFiber *fiber = janet_vm.root_fiber;
    JanetTimeout to;
    to.when = ts_delta(ts_now(), sec);
    to.fiber = fiber;
    to.curr_fiber = NULL;
    to.sched_id = fiber->sched_id;
    to.is_error = 0;
    to.has_worker = 0;
    add_timeout(to);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %xmm0, -0x20(%rbp)
movq %xmm0, %r15
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x28(%rax), %r14
callq 0x22ef2
movq %rax, %rbx
btrq $0x3f, %r15
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
cmpq %rax, %r15
jne 0x230da
pxor %xmm0, %xmm0
ucomisd -0x20(%rbp), %xmm0
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmovaq %rbx, %rax
jmp 0x230f7
movsd -0x20(%rbp), %xmm0
mulsd 0x35ea1(%rip), %xmm0    # 0x58f88
callq 0x12140
cvttsd2si %xmm0, %rax
addq %rax, %rbx
movq %rbx, %rax
movq %rax, -0x50(%rbp)
movq %r14, -0x48(%rbp)
xorl %eax, %eax
movq %rax, -0x40(%rbp)
movl 0x48(%r14), %ecx
movl %ecx, -0x38(%rbp)
movq %rax, -0x34(%rbp)
movups -0x50(%rbp), %xmm0
movups -0x40(%rbp), %xmm1
movups -0x30(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x22f3f
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_channel_make
JanetChannel *janet_channel_make(uint32_t limit) {
    janet_assert(limit <= INT32_MAX, "bad limit");
    JanetChannel *channel = janet_abstract(&janet_channel_type, sizeof(JanetChannel));
    janet_chan_init(channel, (int32_t) limit, 0);
    return channel;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testl %edi, %edi
js 0x23268
movl %edi, %ebx
leaq 0x5d2af(%rip), %rdi     # 0x804d0
movl $0x80, %esi
callq 0x144c2
movq %rax, %r14
movl %ebx, 0x48(%rax)
xorl %eax, %eax
movq %rax, 0x4c(%r14)
movl %eax, 0x8(%r14)
movq %rax, (%r14)
movq %rax, 0x40(%r14)
leaq 0x58(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movl %eax, 0x20(%r14)
movups %xmm0, 0x28(%r14)
movl %eax, 0x38(%r14)
callq 0x145cb
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x133f8
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_channel_make_threaded
JanetChannel *janet_channel_make_threaded(uint32_t limit) {
    janet_assert(limit <= INT32_MAX, "bad limit");
    JanetChannel *channel = janet_abstract_threaded(&janet_channel_type, sizeof(JanetChannel));
    janet_chan_init(channel, (int32_t) limit, 0);
    return channel;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testl %edi, %edi
js 0x232c8
movl %edi, %ebx
leaq 0x5d24f(%rip), %rdi     # 0x804d0
movl $0x80, %esi
callq 0x145a6
movq %rax, %r14
movl %ebx, 0x48(%rax)
xorl %eax, %eax
movq %rax, 0x4c(%r14)
movl %eax, 0x8(%r14)
movq %rax, (%r14)
movq %rax, 0x40(%r14)
leaq 0x58(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movl %eax, 0x20(%r14)
movups %xmm0, 0x28(%r14)
movl %eax, 0x38(%r14)
callq 0x145cb
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x1342c
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: chan_unlock_args
static void chan_unlock_args(const Janet *argv, int32_t n) {
    for (int32_t i = 0; i < n; i++) {
        int32_t len;
        const Janet *data;
        JanetChannel *chan;
        if (janet_indexed_view(argv[i], &data, &len) && len == 2) {
            chan = janet_getchannel(data, 0);
        } else {
            chan = janet_getchannel(argv, i);
        }
        janet_chan_unlock(chan);
    }
}

// Assembly:
testl %esi, %esi
jle 0x23668
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl %esi, %r15d
xorl %r14d, %r14d
leaq -0x2c(%rbp), %r12
leaq 0x5cec0(%rip), %r13     # 0x804d0
movq (%rbx,%r14,8), %rdi
leaq -0x38(%rbp), %rsi
movq %r12, %rdx
callq 0x49726
testl %eax, %eax
je 0x23632
cmpl $0x2, -0x2c(%rbp)
jne 0x23632
movq -0x38(%rbp), %rdi
xorl %esi, %esi
jmp 0x23638
movq %rbx, %rdi
movl %r14d, %esi
movq %r13, %rdx
callq 0x19d4e
cmpl $0x0, 0x50(%rax)
je 0x23652
addq $0x58, %rax
movq %rax, %rdi
callq 0x1461a
incq %r14
cmpq %r14, %r15
jne 0x23610
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: make_close_result
static Janet make_close_result(JanetChannel *channel) {
    Janet *tup = janet_tuple_begin(2);
    tup[0] = janet_ckeywordv("close");
    tup[1] = janet_wrap_channel(channel);
    return janet_wrap_tuple(janet_tuple_end(tup));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x2, %edi
callq 0x47fa0
movq %rax, %r14
leaq 0x42d18(%rip), %rdi     # 0x6639f
callq 0x47261
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4ed39
movq %rax, (%r14)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %rbx, %rdi
callq 0x4ed7e
movq %rax, 0x8(%r14)
movq %r14, %rdi
callq 0x47fd1
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4ed39
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: make_write_result
static Janet make_write_result(JanetChannel *channel) {
    Janet *tup = janet_tuple_begin(2);
    tup[0] = janet_ckeywordv("give");
    tup[1] = janet_wrap_channel(channel);
    return janet_wrap_tuple(janet_tuple_end(tup));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x2, %edi
callq 0x47fa0
movq %rax, %r14
leaq 0x37127(%rip), %rdi     # 0x5aab7
callq 0x47261
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4ed39
movq %rax, (%r14)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %rbx, %rdi
callq 0x4ed7e
movq %rax, 0x8(%r14)
movq %r14, %rdi
callq 0x47fd1
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4ed39
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: make_read_result
static Janet make_read_result(JanetChannel *channel, Janet x) {
    Janet *tup = janet_tuple_begin(3);
    tup[0] = janet_ckeywordv("take");
    tup[1] = janet_wrap_channel(channel);
    tup[2] = x;
    return janet_wrap_tuple(janet_tuple_end(tup));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x3, %edi
callq 0x47fa0
movq %rax, %r15
leaq 0x36ece(%rip), %rdi     # 0x5aabf
callq 0x47261
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4ed39
movq %rax, (%r15)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %r14, %rdi
callq 0x4ed7e
movq %rax, 0x8(%r15)
movq %rbx, 0x10(%r15)
movq %r15, %rdi
callq 0x47fd1
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4ed39
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_post_event
void janet_ev_post_event(JanetVM *vm, JanetCallback cb, JanetEVGenericMessage msg) {
    vm = vm ? vm : &janet_vm;
    janet_atomic_inc(&vm->listener_count);
#ifdef JANET_WINDOWS
    JanetHandle iocp = vm->iocp;
    JanetSelfPipeEvent *event = janet_malloc(sizeof(JanetSelfPipeEvent));
    if (NULL == event) {
        JANET_OUT_OF_MEMORY;
    }
    event->msg = msg;
    event->cb = cb;
    janet_assert(PostQueuedCompletionStatus(iocp,
                                            sizeof(JanetSelfPipeEvent),
                                            0,
                                            (LPOVERLAPPED) event),
                 "failed to post completion event");
#else
    JanetSelfPipeEvent event;
    memset(&event, 0, sizeof(event));
    event.msg = msg;
    event.cb = cb;
    int fd = vm->selfpipe[1];
    /* handle a bit of back pressure before giving up. */
    int tries = 4;
    while (tries > 0) {
        int status;
        do {
            status = write(fd, &event, sizeof(event));
        } while (status == -1 && errno == EINTR);
        if (status > 0) break;
        sleep(0);
        tries--;
    }
    janet_assert(tries > 0, "failed to write event to self-pipe");
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %r15
testq %rbx, %rbx
cmovneq %rbx, %r15
leaq 0x264(%r15), %rdi
callq 0x1a147
movaps 0x10(%rbp), %xmm0
movaps 0x20(%rbp), %xmm1
leaq -0x40(%rbp), %rbx
movaps %xmm1, 0x10(%rbx)
movaps %xmm0, (%rbx)
movq %r14, 0x20(%rbx)
movl 0x334(%r15), %r14d
movl $0x4, %r15d
movl $0x28, %edx
movl %r14d, %edi
movq %rbx, %rsi
callq 0x12250
cmpl $-0x1, %eax
jne 0x241f0
callq 0x12120
cmpl $0x4, (%rax)
je 0x241cf
jmp 0x241f4
testl %eax, %eax
jg 0x2420d
xorl %edi, %edi
callq 0x12b80
leal -0x1(%r15), %eax
cmpl $0x1, %r15d
movl %eax, %r15d
ja 0x241cf
callq 0x134c4
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_chanat_gc
static int janet_chanat_gc(void *p, size_t s) {
    (void) s;
    JanetChannel *channel = p;
    janet_chan_deinit(channel);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x50(%rdi)
je 0x244a9
leaq 0x58(%rbx), %r14
movq %r14, %rdi
callq 0x14610
movq 0x28(%rbx), %rdi
callq 0x120b0
movq 0x40(%rbx), %rdi
callq 0x120b0
movl 0x4(%rbx), %eax
cmpl 0x8(%rbx), %eax
je 0x24490
xorl %r12d, %r12d
leaq -0x28(%rbp), %r15
movq 0x10(%rbx), %rcx
cltq
movq (%rcx,%rax,8), %rcx
movq %rcx, -0x28(%rbp)
incl %eax
cmpl (%rbx), %eax
cmovgel %r12d, %eax
movl %eax, 0x4(%rbx)
movl 0x50(%rbx), %edi
movq %r15, %rsi
movl $0x1, %edx
callq 0x26f27
movl 0x4(%rbx), %eax
cmpl 0x8(%rbx), %eax
jne 0x2445f
movq 0x10(%rbx), %rdi
callq 0x120b0
cmpl $0x0, 0x50(%rbx)
je 0x244c4
movq %r14, %rdi
callq 0x1461a
jmp 0x244c4
movq 0x28(%rbx), %rdi
callq 0x120b0
movq 0x40(%rbx), %rdi
callq 0x120b0
movq 0x10(%rbx), %rdi
callq 0x120b0
addq $0x58, %rbx
movq %rbx, %rdi
callq 0x14606
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_chanat_mark
static int janet_chanat_mark(void *p, size_t s) {
    (void) s;
    JanetChannel *chan = p;
    janet_chanat_mark_fq(&chan->read_pending);
    janet_chanat_mark_fq(&chan->write_pending);
    JanetQueue *items = &chan->items;
    Janet *data = chan->items.data;
    if (items->head <= items->tail) {
        for (int32_t i = items->head; i < items->tail; i++)
            janet_mark(data[i]);
    } else {
        for (int32_t i = items->head; i < items->capacity; i++)
            janet_mark(data[i]);
        for (int32_t i = 0; i < items->tail; i++)
            janet_mark(data[i]);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x18, %rdi
callq 0x26fc4
leaq 0x30(%rbx), %rdi
callq 0x26fc4
movq 0x10(%rbx), %r14
movslq 0x4(%rbx), %r15
movl 0x8(%rbx), %eax
cmpl %eax, %r15d
jle 0x24548
cmpl (%rbx), %r15d
jge 0x2452a
movq (%r14,%r15,8), %rdi
callq 0x2aca7
incq %r15
movslq (%rbx), %rax
cmpq %rax, %r15
jl 0x24513
movl 0x8(%rbx), %eax
testl %eax, %eax
jle 0x24562
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
callq 0x2aca7
incq %r15
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jl 0x24531
jmp 0x24562
cmpl %eax, %r15d
jge 0x24562
movq (%r14,%r15,8), %rdi
callq 0x2aca7
incq %r15
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jl 0x2454d
xorl %eax, %eax
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/ev.c
// Function: janet_chanat_marshal
static void janet_chanat_marshal(void *p, JanetMarshalContext *ctx) {
    JanetChannel *channel = (JanetChannel *)p;
    janet_marshal_byte(ctx, channel->is_threaded);
    janet_marshal_abstract(ctx, channel);
    janet_marshal_byte(ctx, channel->closed);
    janet_marshal_int(ctx, channel->limit);
    int32_t count = janet_q_count(&channel->items);
    janet_marshal_int(ctx, count);
    JanetQueue *items = &channel->items;
    Janet *data = channel->items.data;
    if (items->head <= items->tail) {
        for (int32_t i = items->head; i < items->tail; i++)
            janet_marshal_janet(ctx, data[i]);
    } else {
        for (int32_t i = items->head; i < items->capacity; i++)
            janet_marshal_janet(ctx, data[i]);
        for (int32_t i = 0; i < items->tail; i++)
            janet_marshal_janet(ctx, data[i]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0x50(%rdi), %esi
movq %rbx, %rdi
callq 0x2f571
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2ff4d
movzbl 0x4c(%r14), %esi
movq %rbx, %rdi
callq 0x2f571
movl 0x48(%r14), %esi
movq %rbx, %rdi
callq 0x2f4b7
movl 0x4(%r14), %eax
movl 0x8(%r14), %esi
cmpl %esi, %eax
jle 0x245f9
addl (%r14), %esi
subl %eax, %esi
movq %rbx, %rdi
callq 0x2f4b7
movq 0x10(%r14), %r15
movslq 0x4(%r14), %r12
movl 0x8(%r14), %eax
cmpl %eax, %r12d
jle 0x24655
cmpl (%r14), %r12d
jge 0x24634
movq (%r15,%r12,8), %rsi
movq %rbx, %rdi
callq 0x2f5a5
incq %r12
movslq (%r14), %rax
cmpq %rax, %r12
jl 0x24619
movl 0x8(%r14), %eax
testl %eax, %eax
jle 0x24672
xorl %r12d, %r12d
movq (%r15,%r12,8), %rsi
movq %rbx, %rdi
callq 0x2f5a5
incq %r12
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jl 0x2463b
jmp 0x24672
cmpl %eax, %r12d
jge 0x24672
movq (%r15,%r12,8), %rsi
movq %rbx, %rdi
callq 0x2f5a5
incq %r12
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jl 0x2465a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_chanat_unmarshal
static void *janet_chanat_unmarshal(JanetMarshalContext *ctx) {
    uint8_t is_threaded = janet_unmarshal_byte(ctx);
    JanetChannel *abst;
    if (is_threaded) {
        abst = janet_unmarshal_abstract_threaded(ctx, sizeof(JanetChannel));
    } else {
        abst = janet_unmarshal_abstract(ctx, sizeof(JanetChannel));
    }
    uint8_t is_closed = janet_unmarshal_byte(ctx);
    int32_t limit = janet_unmarshal_int(ctx);
    int32_t count = janet_unmarshal_int(ctx);
    if (count < 0) janet_panic("invalid negative channel count");
    janet_chan_init(abst, limit, 0);
    abst->closed = !!is_closed;
    for (int32_t i = 0; i < count; i++) {
        Janet item = janet_unmarshal_janet(ctx);
        janet_q_push(&abst->items, &item, sizeof(item));
    }
    return abst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x301dc
movl $0x80, %esi
movq %rbx, %rdi
testb %al, %al
je 0x246a4
callq 0x30f95
jmp 0x246a9
callq 0x30f6c
movq %rax, %r14
movq %rbx, %rdi
callq 0x301dc
movl %eax, %r12d
movq %rbx, %rdi
callq 0x30068
movl %eax, %r13d
movq %rbx, %rdi
callq 0x30068
testl %eax, %eax
js 0x2474c
movl %eax, %r15d
movl %r13d, 0x48(%r14)
xorl %eax, %eax
movq %rax, 0x4c(%r14)
movl %eax, 0x8(%r14)
movq %rax, (%r14)
movq %rax, 0x40(%r14)
leaq 0x58(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movl %eax, 0x20(%r14)
movups %xmm0, 0x28(%r14)
movl %eax, 0x38(%r14)
callq 0x145cb
xorl %eax, %eax
testb %r12b, %r12b
setne %al
movl %eax, 0x4c(%r14)
testl %r15d, %r15d
je 0x2473a
leaq -0x30(%rbp), %r12
movq %rbx, %rdi
callq 0x3024f
movq %rax, -0x30(%rbp)
movl $0x8, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x26e18
decl %r15d
jne 0x24719
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3659f(%rip), %rdi     # 0x5acf2
callq 0x191a3
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_loop1_interrupt
void janet_loop1_interrupt(JanetVM *vm) {
    janet_interpreter_interrupt(vm);
    JanetEVGenericMessage msg = {0};
    JanetCallback cb = NULL;
    janet_ev_post_event(vm, cb, msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
callq 0x446a7
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%rbp)
movaps %xmm0, -0x30(%rbp)
movaps -0x30(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x24172
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ev.c
// Function: janet_loop
void janet_loop(void) {
    while (!janet_loop_done()) {
        JanetFiber *interrupted_fiber = janet_loop1();
        if (NULL != interrupted_fiber) {
            janet_schedule(interrupted_fiber, janet_wrap_nil());
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x24769
testl %eax, %eax
jne 0x24f39
movabsq $-0x77fffffffffff, %rbx # imm = 0xFFF8800000000001
callq 0x247b1
testq %rax, %rax
je 0x24f30
movq %rax, %r14
movq %rbx, %rdi
callq 0x4ece6
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2283b
callq 0x24769
testl %eax, %eax
je 0x24f0c
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, %r14d
movq %rdi, %rbx
xorl %eax, %eax
testl %edx, %edx
setne %al
shll $0x1f, %eax
movl %eax, -0x2c(%rbp)
movl 0x4(%rdi), %ecx
testl $0xe00, %ecx            # imm = 0xE00
je 0x24f94
xorl %edx, %edx
testl $0xa00, %ecx            # imm = 0xA00
setne %dl
shrl $0x8, %ecx
andl $0x4, %ecx
orl %edx, %ecx
orl %eax, %ecx
movl %ecx, -0x2c(%rbp)
leaq -0x2c(%rbp), %r15
movq %rbx, 0x4(%r15)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %r12
xorl %eax, %eax
testl %r14d, %r14d
setne %al
leal 0x1(,%rax,2), %r14d
movl 0x338(%r12), %edi
movl (%rbx), %edx
movl %r14d, %esi
movq %r15, %rcx
callq 0x124f0
cmpl $-0x1, %eax
jne 0x24fee
callq 0x12120
movl (%rax), %eax
cmpl $0x4, %eax
je 0x24fbf
cmpl $0x1, %eax
jne 0x24ffb
orb $0x4, 0x4(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x254ee
movq %rax, %rdi
callq 0x190aa
// File: /workspace/github_c_makefile_star2_O3/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 0x22b19
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
leaq 0x330(%rax), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x25b52
testl %eax, %eax
jne 0x250f7
movl $0x80000, %edi          # imm = 0x80000
callq 0x12bb0
movl %eax, 0x338(%rbx)
movl $0x1, %edi
movl $0x80800, %esi          # imm = 0x80800
callq 0x12650
movl %eax, 0x33c(%rbx)
movl $0x0, 0x340(%rbx)
movl 0x338(%rbx), %edi
cmpl $-0x1, %edi
je 0x250f2
cmpl $-0x1, %eax
je 0x250f2
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 0x250f2
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 0x250f2
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x135c8
callq 0x13594
// File: /workspace/github_c_makefile_star2_O3/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 0x12760
testq %rax, %rax
je 0x251e7
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        # 0x25210
leaq -0x20(%rbp), %rdi
movq %rbx, %rcx
callq 0x128d0
testl %eax, %eax
jne 0x251ec
addq $0x264, %r14            # imm = 0x264
movq %r14, %rdi
callq 0x1a147
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x135fc
movl %eax, %r15d
movq %rbx, %rdi
callq 0x120b0
movl %r15d, %edi
callq 0x49d9a
leaq 0x42e0c(%rip), %rdi     # 0x68012
movq %rax, %rsi
xorl %eax, %eax
callq 0x190bb
// File: /workspace/github_c_makefile_star2_O3/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, %r15d
movl $0x28, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x12250
cmpl $-0x1, %eax
jne 0x25283
callq 0x12120
cmpl $0x4, (%rax)
je 0x25263
jmp 0x25287
testl %eax, %eax
jg 0x2529e
movl $0x1, %edi
callq 0x12b80
leal -0x1(%r15), %eax
cmpl $0x1, %r15d
movl %eax, %r15d
ja 0x25263
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movq $0x0, -0x18(%rbp)
movl %esi, -0x28(%rbp)
movl %edx, -0x24(%rbp)
movq %rcx, -0x20(%rbp)
callq 0x29df3
movq %rax, -0x10(%rbp)
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %rax, %rdi
callq 0x4ed7e
movq %rax, %rdi
callq 0x2b13a
movups -0x28(%rbp), %xmm0
movups -0x18(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0x1ab(%rip), %rsi      # 0x252ad
movq %rbx, %rdi
callq 0x25157
callq 0x2250a
// File: /workspace/github_c_makefile_star2_O3/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 0x25478
notl %eax
testl %eax, %esi
jne 0x25484
popq %rbp
retq
leaq 0x3552c(%rip), %rdi     # 0x5a9ab
callq 0x191a3
btl $0x9, %esi
leaq 0x46c4e(%rip), %rdi     # 0x6c0dd
leaq 0x35526(%rip), %rax     # 0x5a9bc
cmovaeq %rdi, %rax
btl $0xa, %esi
leaq 0x35521(%rip), %rdx     # 0x5a9c6
cmovaeq %rdi, %rdx
btl $0xb, %esi
leaq 0x3551c(%rip), %rcx     # 0x5a9d0
cmovaeq %rdi, %rcx
btl $0xc, %esi
leaq 0x35515(%rip), %r8      # 0x5a9d8
cmovaeq %rdi, %r8
testb $0x2, %sil
leaq 0x355db(%rip), %rsi     # 0x5aaad
leaq 0x35509(%rip), %r9      # 0x5a9e2
cmoveq %rsi, %r9
leaq 0x35505(%rip), %rdi     # 0x5a9e9
movq %rax, %rsi
xorl %eax, %eax
callq 0x190bb
// File: /workspace/github_c_makefile_star2_O3/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 0x12760
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 -0x2d3(%rip), %rdx      # 0x25519
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rcx
callq 0x224c9
// File: /workspace/github_c_makefile_star2_O3/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 0x12760
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 -0x286(%rip), %rdx      # 0x2584f
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rcx
callq 0x224c9
// File: /workspace/github_c_makefile_star2_O3/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 0x22ef2
movq %rax, %rdi
movsd -0x8(%rbp), %xmm0
callq 0x22e9c
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 0x22f3f
callq 0x2250a