LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x209ab
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 0x208f8
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %r14, %rdi
callq 0x4b3ab
movq %rax, -0x48(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
leaq 0x298(%rax), %r13
movabsq $-0x6ffffffffffff, %rdi # imm = 0xFFF9000000000001
callq 0x4b313
movq %r13, %rdi
movq -0x48(%rbp), %rsi
movq %rax, %rdx
callq 0x43e19
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 0x20991
movq %rax, %r14
pushq $0x18
popq %rsi
callq 0x24c8c
testl %eax, %eax
jne 0x2099d
movl 0x234(%r14), %eax
xorl %ecx, %ecx
testl %eax, %eax
jg 0x20966
movl 0x230(%r14), %ecx
addl %ecx, %eax
decl %eax
movq 0x240(%r14), %rcx
cltq
imulq $0x18, %rax, %rdx
movq -0x30(%rbp), %rsi
movq %rsi, 0x10(%rcx,%rdx)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rcx,%rdx)
movl %eax, 0x234(%r14)
jmp 0x2099d
leaq -0x40(%rbp), %rsi
pushq $0x18
popq %rdx
callq 0x24c37
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/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 0x20a58
imulq $0x18, %r12, %rax
leaq (%rax,%r15), %r13
addq $0x8, %r13
movslq 0x230(%r14), %rax
cmpq %rax, %r12
jge 0x20a96
movq -0x8(%r13), %rdi
movq %rbx, %rsi
callq 0x4b3ab
movq %rax, %rdi
callq 0x28843
movq (%r13), %rdi
callq 0x28843
incq %r12
addq $0x18, %r13
jmp 0x20a26
imulq $0x18, %r12, %rcx
addq %rcx, %r15
addq $0x8, %r15
cltq
cmpq %rax, %r12
jge 0x20ace
movq -0x8(%r15), %rdi
movq %rbx, %rsi
callq 0x4b3ab
movq %rax, %rdi
callq 0x28843
movq (%r15), %rdi
callq 0x28843
incq %r12
movl 0x238(%r14), %eax
addq $0x18, %r15
jmp 0x20a63
addq $0x8, %r15
xorl %r12d, %r12d
movslq 0x238(%r14), %rax
cmpq %rax, %r12
jge 0x20ace
movq -0x8(%r15), %rdi
movq %rbx, %rsi
callq 0x4b3ab
movq %rax, %rdi
callq 0x28843
movq (%r15), %rdi
callq 0x28843
incq %r12
addq $0x18, %r15
jmp 0x20a9d
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq 0x220(%r14), %r12
jae 0x20b23
movq 0x248(%r14), %rax
movq 0x8(%rax,%r15), %rdi
movq %rbx, %rsi
callq 0x4b3ab
movq %rax, %rdi
callq 0x28843
movq 0x248(%r14), %rax
movq 0x10(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x20b1a
movq %rbx, %rsi
callq 0x4b3ab
movq %rax, %rdi
callq 0x28843
incq %r12
addq $0x30, %r15
jmp 0x20ad4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/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 0x43b64
leaq 0x298(%rbx), %rdi
xorl %esi, %esi
callq 0x43b64
leaq 0x2c8(%rbx), %rdi
xorl %esi, %esi
callq 0x43b64
leaq 0x250(%rbx), %rdi
xorl %esi, %esi
callq 0x3004a
addq $0x2f8, %rbx            # imm = 0x2F8
movq %rbx, %rdi
callq 0x12540
pushq $0x1
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x12700
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x30, %rsp
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
pushq $0x1
popq %r14
cmpq $0x0, 0x220(%rbx)
je 0x20c16
movq 0x248(%rbx), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %r14d, %edi
callq 0x20c69
callq 0x20cfe
jmp 0x20bdd
leaq 0x230(%rbx), %rdi
callq 0x20e31
movq 0x248(%rbx), %rdi
callq 0x120b0
leaq 0x268(%rbx), %rdi
callq 0x43b70
leaq 0x298(%rbx), %rdi
callq 0x43b70
leaq 0x2c8(%rbx), %rdi
callq 0x43b70
addq $0x2f8, %rbx            # imm = 0x2F8
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x12a00
// File: /workspace/github_c_makefile_star2_O2/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
cmpl $0x0, 0x30(%rbp)
je 0x20ca1
leaq 0x10(%rbp), %rax
movq 0x28(%rax), %rbx
testl %edi, %edi
je 0x20c8d
movq %rbx, %rdi
callq 0x12b60
testl %eax, %eax
jne 0x20cce
leaq -0x10(%rbp), %rsi
andq $0x0, (%rsi)
movq %rbx, %rdi
callq 0x12b20
testl %eax, %eax
jne 0x20ca8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x5f341(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x2f357(%rip), %rsi     # 0x50010
leaq 0x35ba8(%rip), %rcx     # 0x56868
leaq 0x35fc8(%rip), %r8      # 0x56c8f
movl $0x27a, %edx            # imm = 0x27A
jmp 0x20cf2
movq 0x5f31b(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x2f331(%rip), %rsi     # 0x50010
leaq 0x35b82(%rip), %rcx     # 0x56868
leaq 0x35f93(%rip), %r8      # 0x56c80
movl $0x277, %edx            # imm = 0x277
xorl %eax, %eax
callq 0x125e0
callq 0x12100
// File: /workspace/github_c_makefile_star2_O2/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 0x20e2b
movq 0x248(%rax), %rdx
decq %rcx
movq %rcx, 0x220(%rax)
imulq $0x30, %rcx, %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 0x20d8c
movq 0x248(%rax), %rcx
imulq $0x30, %rdi, %r8
movq (%rcx,%r8), %r8
imulq $0x30, %rdx, %r9
cmpq (%rcx,%r9), %r8
jl 0x20d89
movq %rdx, %rdi
movq %rdi, %rcx
leaq 0x2(,%rdx,2), %rdi
cmpq %rsi, %rdi
jae 0x20db8
movq 0x248(%rax), %rsi
imulq $0x30, %rdi, %r8
movq (%rsi,%r8), %r8
imulq $0x30, %rcx, %r9
cmpq (%rsi,%r9), %r8
jl 0x20db5
movq %rcx, %rdi
movq %rdi, %rcx
cmpq %rdx, %rcx
je 0x20e2b
movq 0x248(%rax), %rsi
imulq $0x30, %rdx, %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)
imulq $0x30, %rcx, %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 0x20d59
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
subq $0x68, %rsp
movsd %xmm0, -0x10(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x28(%rax), %rbx
callq 0x20f0a
movq %rax, %rdi
movsd -0x10(%rbp), %xmm0
callq 0x20eb4
movq %rax, -0x40(%rbp)
movq %rbx, -0x38(%rbp)
andq $0x0, -0x30(%rbp)
movl 0x48(%rbx), %eax
movl %eax, -0x28(%rbp)
movq $0x1, -0x24(%rbp)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x20f72
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x20eee
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmovaq %rbx, %rax
jmp 0x20f03
mulsd 0x34092(%rip), %xmm0    # 0x54f88
callq 0x12140
cvttsd2si %xmm0, %rax
addq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
leaq -0x10(%rbp), %rsi
callq 0x12230
cmpl $-0x1, %eax
je 0x20f42
imulq $0x3e8, -0x10(%rbp), %rcx # imm = 0x3E8
movq -0x8(%rbp), %rax
movl $0xf4240, %esi          # imm = 0xF4240
cqto
idivq %rsi
addq %rcx, %rax
addq $0x10, %rsp
popq %rbp
retq
movq 0x5f0a7(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x2f0bd(%rip), %rsi     # 0x50010
leaq 0x3590e(%rip), %rcx     # 0x56868
leaq 0x35db8(%rip), %r8      # 0x56d19
movl $0x69e, %edx            # imm = 0x69E
xorl %eax, %eax
callq 0x125e0
callq 0x12100
// File: /workspace/github_c_makefile_star2_O2/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 0x20fd4
imulq $0x60, %r15, %rsi
movq %rax, %rdi
callq 0x12840
testq %rax, %rax
je 0x21089
leaq (%r15,%r15), %rcx
movq %rax, 0x248(%rbx)
movq %rcx, 0x228(%rbx)
leaq 0x10(%rbp), %rcx
movslq %r15d, %rdx
movq %rdx, 0x220(%rbx)
imulq $0x30, %r14, %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 0x2107e
leaq -0x1(%r14), %rax
shrq %rax
movq 0x248(%rbx), %rsi
imulq $0x30, %rax, %rcx
movq (%rsi,%rcx), %rdi
imulq $0x30, %r14, %rdx
cmpq (%rsi,%rdx), %rdi
jle 0x2107e
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)
movq %rax, %r14
jmp 0x20fff
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x5ef60(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x2bf6a(%rip), %rsi     # 0x4d004
leaq 0x357c7(%rip), %rdx     # 0x56868
movl $0xf2, %ecx
xorl %eax, %eax
callq 0x125e0
pushq $0x1
popq %rdi
callq 0x12a60
// File: /workspace/github_c_makefile_star2_O2/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 0x21211
movl %edi, %ebx
leaq 0x5a2e0(%rip), %rdi     # 0x7b4d0
movl $0x80, %esi
callq 0x12d92
movq %rax, %r14
movq %rax, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x21241
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5edd8(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x2edee(%rip), %rsi     # 0x50010
leaq 0x3563f(%rip), %rcx     # 0x56868
leaq 0x35671(%rip), %r8      # 0x568a1
movl $0x452, %edx            # imm = 0x452
xorl %eax, %eax
callq 0x125e0
callq 0x12100
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/ev.c
// Function: janet_chan_init
static void janet_chan_init(JanetChannel *chan, int32_t limit, int threaded) {
    chan->limit = limit;
    chan->closed = 0;
    chan->is_threaded = threaded;
    janet_q_init(&chan->items);
    janet_q_init(&chan->read_pending);
    janet_q_init(&chan->write_pending);
    janet_os_mutex_init((JanetOSMutex *) &chan->lock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, 0x48(%rdi)
andl $0x0, 0x4c(%rdi)
movl %edx, 0x50(%rdi)
andl $0x0, 0x8(%rdi)
andq $0x0, (%rdi)
andq $0x0, 0x40(%rdi)
leaq 0x58(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
andl $0x0, 0x20(%rdi)
movups %xmm0, 0x28(%rdi)
andl $0x0, 0x38(%rdi)
movq %rax, %rdi
popq %rbp
jmp 0x12ea6
// File: /workspace/github_c_makefile_star2_O2/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 0x212b1
movl %edi, %ebx
leaq 0x5a240(%rip), %rdi     # 0x7b4d0
movl $0x80, %esi
callq 0x12e77
movq %rax, %r14
movq %rax, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x21241
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5ed38(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x2ed4e(%rip), %rsi     # 0x50010
leaq 0x3559f(%rip), %rcx     # 0x56868
leaq 0x355d1(%rip), %r8      # 0x568a1
movl $0x459, %edx            # imm = 0x459
xorl %eax, %eax
callq 0x125e0
callq 0x12100
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
testl %esi, %esi
cmovlel %r15d, %ebx
leaq -0x38(%rbp), %r12
leaq -0x2c(%rbp), %r13
cmpq %r15, %rbx
je 0x2160e
movq (%r14,%r15,8), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x45c58
testl %eax, %eax
je 0x215f6
cmpl $0x2, -0x2c(%rbp)
jne 0x215f6
movq -0x38(%rbp), %rdi
xorl %esi, %esi
jmp 0x215fc
movq %r14, %rdi
movl %r15d, %esi
callq 0x21130
movq %rax, %rdi
callq 0x21593
incq %r15
jmp 0x215d0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/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
pushq $0x2
popq %rdi
callq 0x44648
movq %rax, %r14
leaq 0x40d76(%rip), %rdi     # 0x623af
callq 0x439c6
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4b366
movq %rax, (%r14)
movq %rbx, %rdi
callq 0x24d75
movq %rax, 0x8(%r14)
movq %r14, %rdi
callq 0x44674
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4b366
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x2
popq %rdi
callq 0x44648
movq %rax, %r14
leaq 0x35186(%rip), %rdi     # 0x56ab7
callq 0x439c6
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4b366
movq %rax, (%r14)
movq %rbx, %rdi
callq 0x24d75
movq %rax, 0x8(%r14)
movq %r14, %rdi
callq 0x44674
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4b366
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x3
popq %rdi
callq 0x44648
movq %rax, %r15
leaq 0x34f58(%rip), %rdi     # 0x56abf
callq 0x439c6
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4b366
movq %rax, (%r15)
movq %r14, %rdi
callq 0x24d75
movq %rax, 0x8(%r15)
movq %rbx, 0x10(%r15)
movq %r15, %rdi
callq 0x44674
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4b366
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x30, %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 0x186ad
movaps 0x10(%rbp), %xmm0
movaps 0x20(%rbp), %xmm1
leaq -0x50(%rbp), %rbx
movaps %xmm1, 0x10(%rbx)
movaps %xmm0, (%rbx)
movq %r14, 0x20(%rbx)
movl 0x334(%r15), %r14d
pushq $0x4
popq %r12
pushq $0x28
popq %r15
subl $0x1, %r12d
jb 0x220a6
movl %r14d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x12250
cmpl $-0x1, %eax
jne 0x2208c
callq 0x12120
cmpl $0x4, (%rax)
je 0x2206d
jmp 0x22090
testl %eax, %eax
jg 0x22099
xorl %edi, %edi
callq 0x12b80
jmp 0x22067
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x5df43(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x2df59(%rip), %rsi     # 0x50010
leaq 0x347aa(%rip), %rcx     # 0x56868
leaq 0x348c3(%rip), %r8      # 0x56988
movl $0x88c, %edx            # imm = 0x88C
xorl %eax, %eax
callq 0x125e0
callq 0x12100
// File: /workspace/github_c_makefile_star2_O2/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 0x2234a
movq %rbx, %rdi
callq 0x2157d
leaq 0x18(%rbx), %rdi
callq 0x20e31
leaq 0x30(%rbx), %rdi
callq 0x20e31
leaq -0x28(%rbp), %r14
pushq $0x8
popq %r15
pushq $0x1
popq %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x21fc7
movq %rbx, %rdi
testl %eax, %eax
jne 0x2233b
movq %r14, %rsi
movl %r12d, %edx
callq 0x24d89
jmp 0x22319
callq 0x20e31
movq %rbx, %rdi
callq 0x21593
jmp 0x22364
leaq 0x18(%rbx), %rdi
callq 0x20e31
leaq 0x30(%rbx), %rdi
callq 0x20e31
movq %rbx, %rdi
callq 0x20e31
addq $0x58, %rbx
movq %rbx, %rdi
callq 0x12edf
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/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 0x24e26
leaq 0x30(%rbx), %rdi
callq 0x24e26
movq 0x10(%rbx), %r14
movslq 0x4(%rbx), %r15
movl 0x8(%rbx), %eax
cmpl %eax, %r15d
jg 0x223d2
cltq
cmpq %rax, %r15
jge 0x223f4
movq (%r14,%r15,8), %rdi
callq 0x28843
incq %r15
movl 0x8(%rbx), %eax
jmp 0x223ae
movq (%r14,%r15,8), %rdi
callq 0x28843
incq %r15
movslq (%rbx), %rax
cmpq %rax, %r15
jl 0x223c6
xorl %r15d, %r15d
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jge 0x223f4
movq (%r14,%r15,8), %rdi
callq 0x28843
incq %r15
jmp 0x223dd
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/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 0x2cd87
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2d938
movzbl 0x4c(%r14), %esi
movq %rbx, %rdi
callq 0x2cd87
movl 0x48(%r14), %esi
movq %rbx, %rdi
callq 0x2ccce
movl 0x4(%r14), %eax
movl 0x8(%r14), %esi
cmpl %esi, %eax
jle 0x2248b
addl (%r14), %esi
subl %eax, %esi
movq %rbx, %rdi
callq 0x2ccce
movq 0x10(%r14), %r15
movslq 0x4(%r14), %r12
movl 0x8(%r14), %eax
cmpl %eax, %r12d
jg 0x224d1
cltq
cmpq %rax, %r12
jge 0x224f6
movq (%r15,%r12,8), %rsi
movq %rbx, %rdi
callq 0x2cdc9
incq %r12
movl 0x8(%r14), %eax
jmp 0x224a6
movq (%r15,%r12,8), %rsi
movq %rbx, %rdi
callq 0x2cdc9
incq %r12
movslq (%r14), %rax
cmpq %rax, %r12
jl 0x224c2
xorl %r12d, %r12d
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jge 0x224f6
movq (%r15,%r12,8), %rsi
movq %rbx, %rdi
callq 0x2cdc9
incq %r12
jmp 0x224dc
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2dbb3
movl $0x80, %esi
movq %rbx, %rdi
testb %al, %al
je 0x22528
callq 0x2ee81
jmp 0x2252d
callq 0x2ee58
movq %rax, %r14
movq %rbx, %rdi
callq 0x2dbb3
movl %eax, %r12d
movq %rbx, %rdi
callq 0x2da50
movl %eax, %r13d
movq %rbx, %rdi
callq 0x2da50
testl %eax, %eax
js 0x225aa
movl %eax, %r15d
movq %r14, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x21241
xorl %eax, %eax
testb %r12b, %r12b
setne %al
movl %eax, 0x4c(%r14)
leaq -0x30(%rbp), %r12
pushq $0x8
popq %r13
subl $0x1, %r15d
jb 0x22598
movq %rbx, %rdi
callq 0x2dc26
movq %rax, -0x30(%rbp)
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x24c37
jmp 0x22576
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x34741(%rip), %rdi     # 0x56cf2
callq 0x177b1
// File: /workspace/github_c_makefile_star2_O2/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 0x4106c
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 0x22006
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
movabsq $-0x77fffffffffff, %rbx # imm = 0xFFF8800000000001
callq 0x225c7
testl %eax, %eax
jne 0x22db0
callq 0x2260f
testq %rax, %rax
je 0x22d85
movq %rax, %r14
movq %rbx, %rdi
callq 0x4b313
movq %r14, %rdi
movq %rax, %rsi
callq 0x209ca
jmp 0x22d85
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
testw $0xe00, %cx             # imm = 0xE00
je 0x22e06
xorl %edx, %edx
testw $0xa00, %cx             # 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 0x22e60
callq 0x12120
movl (%rax), %eax
cmpl $0x4, %eax
je 0x22e31
cmpl $0x1, %eax
jne 0x22e6d
orb $0x4, 0x4(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x233ac
movq %rax, %rdi
callq 0x176ba
// File: /workspace/github_c_makefile_star2_O2/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 0x20b32
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
leaq 0x330(%rax), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x239c6
testl %eax, %eax
jne 0x22f7f
movl $0x80000, %edi          # imm = 0x80000
callq 0x12bb0
movl %eax, 0x338(%rbx)
pushq $0x1
popq %rdi
movl $0x80800, %esi          # imm = 0x80800
callq 0x12650
movl %eax, 0x33c(%rbx)
andl $0x0, 0x340(%rbx)
movl 0x338(%rbx), %edi
cmpl $-0x1, %edi
je 0x22f59
cmpl $-0x1, %eax
je 0x22f59
movq %rbx, %rdx
addq $0x33c, %rdx            # imm = 0x33C
leaq -0x1c(%rbp), %rcx
movl $0x80000001, (%rcx)     # imm = 0x80000001
movq %rdx, 0x4(%rcx)
pushq $0x1
popq %rsi
movl %eax, %edx
callq 0x124f0
cmpl $-0x1, %eax
je 0x22f59
leaq -0x1c(%rbp), %rcx
movl $0x80000001, (%rcx)     # imm = 0x80000001
movq %r14, 0x4(%rcx)
movl 0x330(%rbx), %edx
movl 0x338(%rbx), %edi
pushq $0x1
popq %rsi
callq 0x124f0
cmpl $-0x1, %eax
je 0x22f59
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5d090(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x2d0a6(%rip), %rsi     # 0x50010
leaq 0x338f7(%rip), %rcx     # 0x56868
leaq 0x339f0(%rip), %r8      # 0x56968
movl $0x718, %edx            # imm = 0x718
jmp 0x22fa3
movq 0x5d06a(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x2d080(%rip), %rsi     # 0x50010
leaq 0x338d1(%rip), %rcx     # 0x56868
leaq 0x33d8e(%rip), %r8      # 0x56d2c
movl $0x629, %edx            # imm = 0x629
xorl %eax, %eax
callq 0x125e0
callq 0x12100
// File: /workspace/github_c_makefile_star2_O2/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 0x20bbb
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
andl $0x0, 0x338(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x38
popq %rdi
callq 0x12760
testq %rax, %rax
je 0x23088
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
movl 0x334(%rax), %ecx
movl %ecx, 0x30(%rbx)
leaq 0x2f8(%rax), %rsi
leaq 0x70(%rip), %rdx        # 0x230d8
leaq -0x20(%rbp), %rdi
movq %rbx, %rcx
callq 0x128d0
testl %eax, %eax
jne 0x230b4
callq 0x2052f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x5cf61(%rip), %rax     # 0x7fff0
movq (%rax), %rdi
leaq 0x29f6b(%rip), %rsi     # 0x4d004
leaq 0x337c8(%rip), %rdx     # 0x56868
movl $0x8c3, %ecx            # imm = 0x8C3
xorl %eax, %eax
callq 0x125e0
pushq $0x1
popq %rdi
callq 0x12a60
movl %eax, %r14d
movq %rbx, %rdi
callq 0x120b0
movl %r14d, %edi
callq 0x46283
leaq 0x40f64(%rip), %rdi     # 0x64032
movq %rax, %rsi
xorl %eax, %eax
callq 0x176c9
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq 0x20(%rdi), %r15
movq 0x28(%rdi), %r12
movl 0x30(%rdi), %ebx
callq 0x120b0
movaps -0x50(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0x78(%rbp), %r14
movq %r14, %rdi
callq *%r12
movq %r15, 0x20(%r14)
pushq $0x4
popq %r13
pushq $0x28
popq %r15
pushq $0x1
popq %r12
subl $0x1, %r13d
jb 0x23165
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x12250
cmpl $-0x1, %eax
jne 0x23157
callq 0x12120
cmpl $0x4, (%rax)
je 0x23139
jmp 0x2315b
testl %eax, %eax
jg 0x23165
movl %r12d, %edi
callq 0x12b80
jmp 0x23133
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/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
andq $0x0, -0x18(%rbp)
movq %rdi, %rbx
movl %esi, -0x28(%rbp)
movl %edx, -0x24(%rbp)
movq %rcx, -0x20(%rbp)
callq 0x2799c
movq %rax, -0x10(%rbp)
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %rax, %rdi
callq 0x4b3ab
movq %rax, %rdi
callq 0x28c2a
movups -0x28(%rbp), %xmm0
movups -0x18(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0x1a0(%rip), %rsi      # 0x23176
movq %rbx, %rdi
callq 0x23007
callq 0x20591
// File: /workspace/github_c_makefile_star2_O2/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 0x23336
notl %eax
testl %eax, %esi
jne 0x23342
popq %rbp
retq
leaq 0x3366e(%rip), %rdi     # 0x569ab
callq 0x177b1
btl $0x9, %esi
leaq 0x44db0(%rip), %rdi     # 0x680fd
leaq 0x33668(%rip), %rax     # 0x569bc
cmovaeq %rdi, %rax
btl $0xa, %esi
leaq 0x33663(%rip), %rdx     # 0x569c6
cmovaeq %rdi, %rdx
btl $0xb, %esi
leaq 0x3365e(%rip), %rcx     # 0x569d0
cmovaeq %rdi, %rcx
btl $0xc, %esi
leaq 0x33657(%rip), %r8      # 0x569d8
cmovaeq %rdi, %r8
testb $0x2, %sil
leaq 0x3371d(%rip), %rsi     # 0x56aad
leaq 0x3364b(%rip), %r9      # 0x569e2
cmoveq %rsi, %r9
leaq 0x33647(%rip), %rdi     # 0x569e9
movq %rax, %rsi
xorl %eax, %eax
callq 0x176c9
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x20
popq %rdi
callq 0x12760
movl %r15d, 0x18(%rax)
movq %r13, 0x10(%rax)
movl %r12d, 0x4(%rax)
andl $0x0, 0x8(%rax)
movl %r14d, 0x1c(%rax)
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x2bf(%rip), %rdx      # 0x233d7
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x20550
// File: /workspace/github_c_makefile_star2_O2/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, %ebx
movl %r8d, %r14d
movl %ecx, %r15d
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, -0x30(%rbp)
pushq $0x20
popq %rdi
callq 0x12760
movl %r14d, 0x10(%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x18(%rax)
movl %r15d, 0x14(%rax)
movl %ebx, (%rax)
andl $0x0, 0x4(%rax)
leaq -0x26b(%rip), %rdx      # 0x236ec
pushq $0x2
popq %rsi
movq -0x30(%rbp), %rdi
movq %rax, %rcx
callq 0x20550
// File: /workspace/github_c_makefile_star2_O2/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 0x20f0a
movq %rax, %rdi
movsd -0x8(%rbp), %xmm0
callq 0x20eb4
movq %rax, -0x38(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
andl $0x0, -0x1c(%rbp)
movl 0x48(%rax), %eax
movl %eax, -0x20(%rbp)
andq $0x0, -0x28(%rbp)
andl $0x0, -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 0x20f72
callq 0x20591