LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x2afeb
jmp 0x2b0f0
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
jne 0x2b050
movq -0x10(%rbp), %rdi
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
callq 0x7b610
movq %rax, -0x20(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
addq $0x298, %rax            # imm = 0x298
movq %rax, -0x48(%rbp)
movabsq $-0x6ffffffffffff, %rdi # imm = 0xFFF9000000000001
callq 0x7b460
movq -0x48(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x697e0
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movl 0x48(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x48(%rcx)
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
orl $0x40000, %ecx          # imm = 0x40000
movl %ecx, (%rax)
cmpl $0x1, -0x14(%rbp)
jne 0x2b098
movq -0x10(%rbp), %rax
movl (%rax), %ecx
orl $0x10000, %ecx          # imm = 0x10000
movl %ecx, (%rax)
cmpl $0x0, -0x18(%rbp)
je 0x2b0c8
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x230, %rdi            # imm = 0x230
leaq -0x40(%rbp), %rsi
movl $0x18, %edx
callq 0x32290
jmp 0x2b0f0
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x230, %rdi            # imm = 0x230
leaq -0x40(%rbp), %rsi
movl $0x18, %edx
callq 0x32320
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x230, %rdi            # imm = 0x230
callq 0x2b5c0
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq $0x0, 0x248(%rax)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq $0x0, 0x220(%rax)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq $0x0, 0x228(%rax)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x268, %rdi            # imm = 0x268
xorl %esi, %esi
callq 0x69280
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x298, %rdi            # imm = 0x298
xorl %esi, %esi
callq 0x69280
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x2c8, %rdi            # imm = 0x2C8
xorl %esi, %esi
callq 0x69280
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x250, %rdi            # imm = 0x250
xorl %esi, %esi
callq 0x45fe0
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x2f8, %rdi            # imm = 0x2F8
callq 0x12540
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x2f8, %rdi            # imm = 0x2F8
movl $0x1, %esi
callq 0x12710
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/ev.c
// Function: janet_q_init
static void janet_q_init(JanetQueue *q) {
    q->data = NULL;
    q->head = 0;
    q->tail = 0;
    q->capacity = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x60, %rsp
leaq -0x30(%rbp), %rdi
callq 0x2b710
cmpl $0x0, %eax
je 0x2b645
movups -0x30(%rbp), %xmm0
movups -0x20(%rbp), %xmm1
movups -0x10(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x1, %edi
callq 0x2b780
xorl %eax, %eax
movl %eax, %edi
callq 0x2b850
jmp 0x2b608
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x230, %rdi            # imm = 0x230
callq 0x2bb00
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x248(%rax), %rdi
callq 0x120b0
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x268, %rdi            # imm = 0x268
callq 0x692b0
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x298, %rdi            # imm = 0x298
callq 0x692b0
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x2c8, %rdi            # imm = 0x2C8
callq 0x692b0
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x2f8, %rdi            # imm = 0x2F8
callq 0x12a10
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
    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
subq $0x20, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl %edi, -0x4(%rbp)
cmpl $0x0, 0x20(%rax)
jne 0x2b79e
jmp 0x2b840
cmpl $0x0, -0x4(%rbp)
je 0x2b7ee
jmp 0x2b7a6
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x12b70
cmpl $0x0, %eax
je 0x2b7ea
jmp 0x2b7ba
movq 0x8482f(%rip), %rax     # 0xafff0
movq (%rax), %rdi
leaq 0x55849(%rip), %rsi     # 0x81014
movl $0x276, %edx            # imm = 0x276
leaq 0x5c0a1(%rip), %rcx     # 0x87878
leaq 0x5c4b2(%rip), %r8      # 0x87c90
movb $0x0, %al
callq 0x125f0
callq 0x12100
jmp 0x2b7ec
jmp 0x2b7ee
movq $0x0, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0x12b30
cmpl $0x0, %eax
je 0x2b83e
jmp 0x2b80e
movq 0x847db(%rip), %rax     # 0xafff0
movq (%rax), %rdi
leaq 0x557f5(%rip), %rsi     # 0x81014
movl $0x279, %edx            # imm = 0x279
leaq 0x5c04d(%rip), %rcx     # 0x87878
leaq 0x5c46d(%rip), %r8      # 0x87c9f
movb $0x0, %al
callq 0x125f0
callq 0x12100
jmp 0x2b840
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x70, %rsp
movsd %xmm0, -0x8(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, -0x10(%rbp)
callq 0x2bc70
movq %rax, %rdi
movsd -0x8(%rbp), %xmm0
callq 0x2bbb0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x48(%rax), %eax
movl %eax, -0x28(%rbp)
movl $0x1, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x2bd00
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm1
movaps %xmm1, %xmm0
movaps 0x5a3f0(%rip), %xmm2    # 0x85fc0
pand %xmm2, %xmm0
movq %xmm1, %rdx
movl $0x1, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x0, %rdx
cmovll %eax, %ecx
movsd 0x5a3a6(%rip), %xmm1    # 0x85f98
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setnp %sil
sete %dl
testb %sil, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
je 0x2bc38
xorps %xmm0, %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0x2bc1e
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x2bc2e
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x20(%rbp)
jmp 0x2bc2e
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2bc5f
movsd 0x5a360(%rip), %xmm0    # 0x85fa0
mulsd -0x18(%rbp), %xmm0
callq 0x12140
cvttsd2si %xmm0, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 $0x20, %rsp
movl $0x1, %edi
leaq -0x10(%rbp), %rsi
callq 0x12230
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x2bcc3
jmp 0x2bc93
movq 0x84356(%rip), %rax     # 0xafff0
movq (%rax), %rdi
leaq 0x55370(%rip), %rsi     # 0x81014
movl $0x69d, %edx            # imm = 0x69D
leaq 0x5bbc8(%rip), %rcx     # 0x87878
leaq 0x5c097(%rip), %r8      # 0x87d4e
movb $0x0, %al
callq 0x125f0
callq 0x12100
jmp 0x2bcc5
imulq $0x3e8, -0x10(%rbp), %rax # imm = 0x3E8
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/ev.c
// Function: janet_optchannel
JanetChannel *janet_optchannel(const Janet *argv, int32_t argc, int32_t n, JanetChannel *dflt) {
    if (argc > n && !janet_checktype(argv[n], JANET_NIL)) {
        return janet_getchannel(argv, n);
    } else {
        return dflt;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x2c113
xorl %eax, %eax
testb $0x1, %al
jne 0x2c0a6
jmp 0x2c0dc
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x2c0c0
jmp 0x2c113
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x2c113
jmp 0x2c101
movq -0x10(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq (%rcx,%rdx,8), %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
je 0x2c113
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x2c050
movq %rax, -0x8(%rbp)
jmp 0x2c11b
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x7fffffff, -0x4(%rbp) # imm = 0x7FFFFFFF
jbe 0x2c256
jmp 0x2c226
movq 0x83dc3(%rip), %rax     # 0xafff0
movq (%rax), %rdi
leaq 0x54ddd(%rip), %rsi     # 0x81014
movl $0x451, %edx            # imm = 0x451
leaq 0x5b635(%rip), %rcx     # 0x87878
leaq 0x5b667(%rip), %r8      # 0x878b1
movb $0x0, %al
callq 0x125f0
callq 0x12100
jmp 0x2c258
leaq 0x7fa91(%rip), %rdi     # 0xabcf0
movl $0x80, %esi
callq 0x12de0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl -0x4(%rbp), %esi
xorl %edx, %edx
callq 0x2c290
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4c(%rax)
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x8(%rbp), %rdi
callq 0x2b5c0
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
callq 0x2b5c0
movq -0x8(%rbp), %rdi
addq $0x30, %rdi
callq 0x2b5c0
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
callq 0x12fb0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x7fffffff, -0x4(%rbp) # imm = 0x7FFFFFFF
jbe 0x2c346
jmp 0x2c316
movq 0x83cd3(%rip), %rax     # 0xafff0
movq (%rax), %rdi
leaq 0x54ced(%rip), %rsi     # 0x81014
movl $0x458, %edx            # imm = 0x458
leaq 0x5b545(%rip), %rcx     # 0x87878
leaq 0x5b577(%rip), %r8      # 0x878b1
movb $0x0, %al
callq 0x125f0
callq 0x12100
jmp 0x2c348
leaq 0x7f9a1(%rip), %rdi     # 0xabcf0
movl $0x80, %esi
callq 0x12f60
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl -0x4(%rbp), %esi
xorl %edx, %edx
callq 0x2c290
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x2c7c7
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x14(%rbp), %rdx
callq 0x6d0d0
cmpl $0x0, %eax
je 0x2c7a3
cmpl $0x2, -0x14(%rbp)
jne 0x2c7a3
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x2c050
movq %rax, -0x28(%rbp)
jmp 0x2c7b3
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0x2c050
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2c720
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2c766
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl $0x2, %edi
callq 0x6a740
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x66cc5(%rip), %rdi     # 0x934be
callq 0x68d90
movq %rax, %rdi
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
callq 0x7b550
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x32540
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0x6a7a0
movq %rax, %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
callq 0x7b550
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl $0x2, %edi
callq 0x6a740
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x5aefe(%rip), %rdi     # 0x87ac7
callq 0x68d90
movq %rax, %rdi
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
callq 0x7b550
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x32540
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0x6a7a0
movq %rax, %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
callq 0x7b550
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rsi, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movl $0x3, %edi
callq 0x6a740
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x5ab82(%rip), %rdi     # 0x87acf
callq 0x68d90
movq %rax, %rdi
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
callq 0x7b550
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x32540
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rdi
callq 0x6a7a0
movq %rax, %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
callq 0x7b550
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/ev.c
// Function: fisher_yates_args
static void fisher_yates_args(int32_t argc, Janet *argv) {
    for (int32_t i = argc; i > 1; i--) {
        int32_t swap_index = janet_rng_u32(&janet_vm.ev_rng) % i;
        Janet temp = argv[swap_index];
        argv[swap_index] = argv[i - 1];
        argv[i - 1] = temp;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jle 0x2d1df
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rdi
addq $0x250, %rdi            # imm = 0x250
callq 0x46050
xorl %edx, %edx
divl -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq -0x20(%rbp), %rdx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2d165
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/ev.c
// Function: janet_q_pop
static int janet_q_pop(JanetQueue *q, void *out, size_t itemsize) {
    if (q->head == q->tail) return 1;
    memcpy(out, (char *) q->data + itemsize * q->head, itemsize);
    q->head = q->head + 1 < q->capacity ? q->head + 1 : 0;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x2d65d
movl $0x1, -0x4(%rbp)
jmp 0x2d6be
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x4(%rcx), %rcx
imulq %rcx, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0x12680
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x2d6a6
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2d6ad
xorl %eax, %eax
movl %eax, -0x24(%rbp)
jmp 0x2d6ad
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x60, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2d6f9
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x2d70d
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x264, %rdi            # imm = 0x264
callq 0x1d660
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x12420
movq -0x50(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x28(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x334(%rax), %eax
movl %eax, -0x3c(%rbp)
movl $0x4, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jle 0x2d7ca
jmp 0x2d77c
movl -0x3c(%rbp), %edi
leaq -0x38(%rbp), %rsi
movl $0x28, %edx
callq 0x12250
movl %eax, -0x44(%rbp)
xorl %eax, %eax
cmpl $-0x1, -0x44(%rbp)
movb %al, -0x59(%rbp)
jne 0x2d7a9
callq 0x12120
cmpl $0x4, (%rax)
sete %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x2d77c
cmpl $0x0, -0x44(%rbp)
jle 0x2d7b8
jmp 0x2d7ca
xorl %edi, %edi
callq 0x12b90
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x2d774
jmp 0x2d7cc
cmpl $0x0, -0x40(%rbp)
jg 0x2d804
jmp 0x2d7d4
movq 0x82815(%rip), %rax     # 0xafff0
movq (%rax), %rdi
leaq 0x5382f(%rip), %rsi     # 0x81014
movl $0x88b, %edx            # imm = 0x88B
leaq 0x5a087(%rip), %rcx     # 0x87878
leaq 0x5a1a0(%rip), %r8      # 0x87998
movb $0x0, %al
callq 0x125f0
callq 0x12100
jmp 0x2d806
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x327e0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x328a0
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x328a0
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x2dc3a
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2dc38
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x38b90
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2dc10
jmp 0x2dc9c
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x2dc6b
movq -0x28(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x38b90
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2dc44
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2dc9a
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x38b90
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2dc72
jmp 0x2dc9c
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x50(%rax), %eax
movzbl %al, %esi
callq 0x40720
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x41700
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x4c(%rax), %eax
movzbl %al, %esi
callq 0x40720
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x48(%rax), %esi
callq 0x405a0
movq -0x18(%rbp), %rdi
callq 0x2c870
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x405a0
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x2de0f
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2de0d
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x40800
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2dde1
jmp 0x2de79
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x2de44
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x40800
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2de19
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2de77
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x40800
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x2de4b
jmp 0x2de79
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x41c50
movb %al, -0x9(%rbp)
cmpb $0x0, -0x9(%rbp)
je 0x2deb2
movq -0x8(%rbp), %rdi
movl $0x80, %esi
callq 0x436d0
movq %rax, -0x18(%rbp)
jmp 0x2dec4
movq -0x8(%rbp), %rdi
movl $0x80, %esi
callq 0x43690
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x41c50
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
callq 0x41890
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x41890
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x2defa
leaq 0x59e32(%rip), %rdi     # 0x87d27
callq 0x1ad60
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %esi
xorl %edx, %edx
callq 0x2c290
cmpb $0x0, -0x19(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4c(%rax)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x2df58
movq -0x8(%rbp), %rdi
callq 0x41d30
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x32320
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2df26
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/ev.c
// Function: make_supervisor_event
static Janet make_supervisor_event(const char *name, JanetFiber *fiber, int threaded) {
    Janet tup[3];
    tup[0] = janet_ckeywordv(name);
    tup[1] = threaded ? fiber->last_value : janet_wrap_fiber(fiber) ;
    if (fiber->env != NULL) {
        tup[2] = janet_table_get(fiber->env, janet_ckeywordv("task-id"));
    } else {
        tup[2] = janet_wrap_nil();
    }
    return janet_wrap_tuple(janet_tuple_n(tup, 3));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x68d90
movq %rax, %rdi
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
callq 0x7b550
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x70(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x2e690
movq -0x70(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq %rcx, (%rax)
jmp 0x2e6b5
movq -0x18(%rbp), %rdi
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
callq 0x7b610
movq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq -0x50(%rbp), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x2e709
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x78(%rbp)
leaq 0x59673(%rip), %rdi     # 0x87d46
callq 0x68d90
movq %rax, %rdi
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
callq 0x7b550
movq -0x78(%rbp), %rdi
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rsi
callq 0x69420
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x2e724
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x40(%rbp), %rdi
movl $0x3, %esi
callq 0x6a7d0
movq %rax, %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
callq 0x7b550
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x64750
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x12420
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x28(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x2d6d0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
callq 0x2dfa0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x2ebbb
jmp 0x2ebf6
callq 0x2e040
movq %rax, -0x8(%rbp)
xorl %eax, %eax
cmpq -0x8(%rbp), %rax
je 0x2ebf4
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq -0x18(%rbp), %rdi
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rsi
callq 0x2b160
jmp 0x2eba8
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x10(%rbp), %edx
xorl %eax, %eax
movl $0x80000000, %ecx       # imm = 0x80000000
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
andl $0xa00, %eax            # imm = 0xA00
cmpl $0x0, %eax
je 0x2ec6f
movl -0x1c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x2ec89
movl -0x1c(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl 0x338(%rax), %edi
movl -0xc(%rbp), %ecx
movl $0x1, %esi
movl $0x3, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
movq -0x8(%rbp), %rax
movl (%rax), %edx
leaq -0x1c(%rbp), %rcx
callq 0x12500
movl %eax, -0x20(%rbp)
xorl %eax, %eax
cmpl $-0x1, -0x20(%rbp)
movb %al, -0x29(%rbp)
jne 0x2ece5
callq 0x12120
cmpl $0x4, (%rax)
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x2ec91
cmpl $-0x1, -0x20(%rbp)
jne 0x2ed1f
callq 0x12120
cmpl $0x1, (%rax)
jne 0x2ed0b
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x4(%rax)
jmp 0x2ed1d
callq 0x2f7c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1ac20
jmp 0x2ed1f
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_handle_selfpipe
static void janet_ev_handle_selfpipe(void) {
    JanetSelfPipeEvent response;
    int status;
recur:
    do {
        status = read(janet_vm.selfpipe[0], &response, sizeof(response));
    } while (status == -1 && errno == EINTR);
    if (status > 0) {
        if (NULL != response.cb) {
            response.cb(response.msg);
            janet_ev_dec_refcount();
        }
        goto recur;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
jmp 0x2ed6a
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl 0x330(%rax), %edi
leaq -0x28(%rbp), %rsi
movl $0x28, %edx
callq 0x12520
movl %eax, -0x2c(%rbp)
xorl %eax, %eax
cmpl $-0x1, -0x2c(%rbp)
movb %al, -0x2d(%rbp)
jne 0x2edaa
callq 0x12120
cmpl $0x4, (%rax)
sete %al
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %al
testb $0x1, %al
jne 0x2ed6a
cmpl $0x0, -0x2c(%rbp)
jle 0x2edf5
xorl %eax, %eax
cmpq -0x8(%rbp), %rax
je 0x2edf0
movq -0x8(%rbp), %rax
leaq -0x28(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rsp)
callq *%rax
callq 0x2a820
jmp 0x2ed68
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
callq 0x2b480
callq 0x2f020
movl $0x80000, %edi          # imm = 0x80000
callq 0x12bc0
movl %eax, -0x14(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl -0x14(%rbp), %ecx
movl %ecx, 0x338(%rax)
movl $0x1, %edi
movl $0x80800, %esi          # imm = 0x80800
callq 0x12660
movl %eax, -0x10(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl -0x10(%rbp), %ecx
movl %ecx, 0x33c(%rax)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl $0x0, 0x340(%rax)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
cmpl $-0x1, 0x338(%rax)
je 0x2eeff
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
cmpl $-0x1, 0x33c(%rax)
jne 0x2ef04
jmp 0x2efe2
movl $0x80000001, -0xc(%rbp) # imm = 0x80000001
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
addq $0x33c, %rax            # imm = 0x33C
movq %rax, -0x8(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl 0x338(%rax), %eax
movl %eax, -0x18(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl -0x18(%rbp), %edi
movl 0x33c(%rax), %edx
movl $0x1, %esi
leaq -0xc(%rbp), %rcx
callq 0x12500
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x2ef72
jmp 0x2efe2
movl $0x80000001, -0xc(%rbp) # imm = 0x80000001
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
addq $0x330, %rax            # imm = 0x330
movq %rax, -0x8(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl 0x338(%rax), %eax
movl %eax, -0x1c(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl -0x1c(%rbp), %edi
movl 0x330(%rax), %edx
movl $0x1, %esi
leaq -0xc(%rbp), %rcx
callq 0x12500
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x2efe0
jmp 0x2efe2
jmp 0x2f014
jmp 0x2efe4
movq 0x81005(%rip), %rax     # 0xafff0
movq (%rax), %rdi
leaq 0x5201f(%rip), %rsi     # 0x81014
movl $0x717, %edx            # imm = 0x717
leaq 0x58877(%rip), %rcx     # 0x87878
leaq 0x58970(%rip), %r8      # 0x87978
movb $0x0, %al
callq 0x125f0
callq 0x12100
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
callq 0x2b600
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl 0x338(%rax), %edi
callq 0x12470
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl 0x33c(%rax), %edi
callq 0x12470
callq 0x2f0f0
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl $0x0, 0x338(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x38, %edi
callq 0x12770
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
jne 0x2f18e
jmp 0x2f160
movq 0x80e89(%rip), %rax     # 0xafff0
movq (%rax), %rdi
leaq 0x4ee93(%rip), %rsi     # 0x7e004
leaq 0x58700(%rip), %rdx     # 0x87878
movl $0x8c2, %ecx            # imm = 0x8C2
movb $0x0, %al
callq 0x125f0
movl $0x1, %edi
callq 0x12a70
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movl 0x334(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rsi
addq $0x2f8, %rsi            # imm = 0x2F8
movq -0x18(%rbp), %rcx
leaq -0x20(%rbp), %rdi
leaq 0x3e(%rip), %rdx        # 0x2f250
callq 0x128e0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x2f242
movq -0x18(%rbp), %rdi
callq 0x120b0
movl -0x24(%rbp), %edi
callq 0x6dd40
movq %rax, %rsi
leaq 0x66127(%rip), %rdi     # 0x95362
movb $0x0, %al
callq 0x1ac40
callq 0x2a950
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)