LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/emit.c
// Function: emit2s
static int32_t emit2s(JanetCompiler *c, uint8_t op, JanetSlot s1, JanetSlot s2, int32_t rest, int wr) {
    int32_t reg1 = janetc_regnear(c, s1, JANETC_REGTEMP_0);
    int32_t reg2 = janetc_regnear(c, s2, JANETC_REGTEMP_1);
    int32_t label = janet_v_count(c->buffer);
    janetc_emit(c, op | (reg1 << 8) | (reg2 << 16) | ((uint32_t)rest << 24));
    janetc_free_regnear(c, s2, reg2, JANETC_REGTEMP_1);
    if (wr)
        janetc_moveback(c, s1, reg1);
    janetc_free_regnear(c, s1, reg1, JANETC_REGTEMP_0);
    return label;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, -0x30(%rbp)
movl %edx, %r13d
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x28(%rbp), %r12
movq 0x20(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps 0x10(%rbp), %xmm0
movups %xmm0, (%rsp)
movl $0x0, -0x2c(%rbp)
xorl %esi, %esi
callq 0x2221d
movl %eax, %r15d
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2221d
movl %eax, %r12d
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x222ff
movl -0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
movzbl %r14b, %eax
movl %r15d, %ecx
shll $0x8, %ecx
orl %eax, %ecx
movl %r12d, %eax
shll $0x10, %eax
shll $0x18, %r13d
orl %eax, %r13d
orl %ecx, %r13d
movq %rbx, %rdi
movl %r13d, %esi
callq 0x21a88
leaq 0x28(%rbp), %rcx
cmpl %r12d, 0x8(%rcx)
jne 0x22340
cmpl $0x0, 0xc(%rcx)
jns 0x22340
movl $0x90000, %eax          # imm = 0x90000
andl 0x10(%rcx), %eax
je 0x22354
movq (%rbx), %rdi
addq $0x30, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x412f6
leaq 0x10(%rbp), %r14
cmpl $0x0, -0x30(%rbp)
je 0x2237a
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl %r15d, %esi
callq 0x21d73
cmpl %r15d, 0x8(%r14)
jne 0x22392
cmpl $0x0, 0xc(%r14)
jns 0x22392
movl $0x90000, %eax          # imm = 0x90000
andl 0x10(%r14), %eax
je 0x223a3
movq (%rbx), %rdi
addq $0x30, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x412f6
movl -0x2c(%rbp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/emit.c
// Function: janetc_emit_sss
int32_t janetc_emit_sss(JanetCompiler *c, uint8_t op, JanetSlot s1, JanetSlot s2, JanetSlot s3, int wr) {
    int32_t reg1 = janetc_regnear(c, s1, JANETC_REGTEMP_0);
    int32_t reg2 = janetc_regnear(c, s2, JANETC_REGTEMP_1);
    int32_t reg3 = janetc_regnear(c, s3, JANETC_REGTEMP_2);
    int32_t label = janet_v_count(c->buffer);
    janetc_emit(c, op | (reg1 << 8) | (reg2 << 16) | ((uint32_t)reg3 << 24));
    janetc_free_regnear(c, s2, reg2, JANETC_REGTEMP_1);
    janetc_free_regnear(c, s3, reg3, JANETC_REGTEMP_2);
    if (wr)
        janetc_moveback(c, s1, reg1);
    janetc_free_regnear(c, s1, reg1, JANETC_REGTEMP_0);
    return label;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, -0x34(%rbp)
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x28(%rbp), %r15
movq 0x20(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps 0x10(%rbp), %xmm0
movups %xmm0, (%rsp)
movl $0x0, -0x2c(%rbp)
xorl %esi, %esi
callq 0x2221d
movl %eax, -0x30(%rbp)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2221d
movl %eax, %r12d
movq 0x50(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x2221d
movl %eax, %r13d
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x22450
movl -0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
movzbl %r14b, %eax
movl -0x30(%rbp), %ecx
shll $0x8, %ecx
orl %eax, %ecx
movl %r12d, %eax
shll $0x10, %eax
movl %r13d, %esi
shll $0x18, %esi
orl %eax, %esi
orl %ecx, %esi
movq %rbx, %rdi
callq 0x21a88
cmpl %r12d, 0x8(%r15)
jne 0x2248c
cmpl $0x0, 0xc(%r15)
jns 0x2248c
movl $0x90000, %eax          # imm = 0x90000
andl 0x10(%r15), %eax
je 0x224a0
movq (%rbx), %rdi
addq $0x30, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x412f6
leaq 0x40(%rbp), %rcx
cmpl %r13d, 0x8(%rcx)
jne 0x224ba
cmpl $0x0, 0xc(%rcx)
jns 0x224ba
movl $0x90000, %eax          # imm = 0x90000
andl 0x10(%rcx), %eax
je 0x224ce
movq (%rbx), %rdi
addq $0x30, %rdi
movl %r13d, %esi
movl $0x2, %edx
callq 0x412f6
leaq 0x10(%rbp), %r14
cmpl $0x0, -0x34(%rbp)
movl -0x30(%rbp), %r15d
je 0x224f8
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl %r15d, %esi
callq 0x21d73
cmpl %r15d, 0x8(%r14)
jne 0x22510
cmpl $0x0, 0xc(%r14)
jns 0x22510
movl $0x90000, %eax          # imm = 0x90000
andl 0x10(%r14), %eax
je 0x22521
movq (%rbx), %rdi
addq $0x30, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x412f6
movl -0x2c(%rbp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_async_end
void janet_async_end(JanetFiber *fiber) {
    if (fiber->ev_callback) {
        if (fiber->ev_stream->read_fiber == fiber) {
            fiber->ev_stream->read_fiber = NULL;
        }
        if (fiber->ev_stream->write_fiber == fiber) {
            fiber->ev_stream->write_fiber = NULL;
        }
        fiber->ev_callback(fiber, JANET_ASYNC_EVENT_DEINIT);
        janet_gcunroot(janet_wrap_abstract(fiber->ev_stream));
        fiber->ev_callback = NULL;
        if (!(fiber->flags & JANET_FIBER_EV_FLAG_IN_FLIGHT)) {
            if (fiber->ev_state) {
                janet_free(fiber->ev_state);
                fiber->ev_state = NULL;
            }
            janet_ev_dec_refcount();
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x50(%rdi), %rax
testq %rax, %rax
je 0x22755
movq %rdi, %rbx
movq 0x58(%rdi), %rcx
cmpq %rdi, 0x10(%rcx)
jne 0x226dc
movq $0x0, 0x10(%rcx)
cmpq %rbx, 0x18(%rcx)
jne 0x226ea
movq $0x0, 0x18(%rcx)
movq %rbx, %rdi
movl $0x2, %esi
callq *%rax
movq 0x58(%rbx), %rdi
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
callq 0x4f9f2
movq %rax, %rdi
callq 0x2bd0b
movq $0x0, 0x50(%rbx)
testb $0x1, 0x10(%rbx)
jne 0x22755
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x22733
callq 0x120b0
movq $0x0, 0x60(%rbx)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
leaq 0x264(%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1a24d
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_async_start_fiber
void janet_async_start_fiber(JanetFiber *fiber, JanetStream *stream, JanetAsyncMode mode, JanetEVCallback callback, void *state) {
    janet_assert(!fiber->ev_callback, "double async on fiber");
    if (mode & JANET_ASYNC_LISTEN_READ) {
        stream->read_fiber = fiber;
    }
    if (mode & JANET_ASYNC_LISTEN_WRITE) {
        stream->write_fiber = fiber;
    }
    fiber->ev_callback = callback;
    fiber->ev_stream = stream;
    janet_ev_inc_refcount();
    janet_gcroot(janet_wrap_abstract(stream));
    fiber->ev_state = state;
    callback(fiber, JANET_ASYNC_EVENT_INIT);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpq $0x0, 0x50(%rdi)
jne 0x22807
movq %r8, %rbx
movq %rsi, %r15
movq %rdi, %r14
testb $0x1, %dl
je 0x227a7
movq %r14, 0x10(%r15)
testb $0x2, %dl
je 0x227b0
movq %r14, 0x18(%r15)
movq %rcx, 0x50(%r14)
movq %r15, 0x58(%r14)
movq %rcx, %r12
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
leaq 0x264(%rax), %rdi
callq 0x1a23c
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %r15, %rdi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b5e5
movq %rbx, 0x60(%r14)
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
callq 0x132d4
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_stream_ext
JanetStream *janet_stream_ext(JanetHandle handle, uint32_t flags, const JanetMethod *methods, size_t size) {
    janet_assert(size >= sizeof(JanetStream), "bad size");
    JanetStream *stream = janet_abstract(&janet_stream_type, size);
    stream->handle = handle;
    stream->flags = flags;
    stream->read_fiber = NULL;
    stream->write_fiber = NULL;
    if (methods == NULL) methods = ev_default_stream_methods;
    stream->methods = methods;
    stream->index = 0;
    janet_register_stream(stream);
    return stream;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpq $0x27, %rcx
jbe 0x2290b
movq %rdx, %rbx
movl %esi, %r14d
movl %edi, %r15d
leaq 0x5eb57(%rip), %rdi     # 0x81410
movq %rcx, %rsi
callq 0x144d2
movq %rax, %r12
movl %r15d, (%rax)
movl %r14d, 0x4(%rax)
testq %rbx, %rbx
leaq 0x5ebab(%rip), %rax     # 0x81480
cmovneq %rbx, %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
movq %rax, 0x20(%r12)
movl $0x0, 0x8(%r12)
movq %r12, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x253a5
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x13308
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_stream_close
void janet_stream_close(JanetStream *stream) {
    JanetFiber *rf = stream->read_fiber;
    JanetFiber *wf = stream->write_fiber;
    if (rf && rf->ev_callback) {
        rf->ev_callback(rf, JANET_ASYNC_EVENT_CLOSE);
        stream->read_fiber = NULL;
    }
    if (wf && wf->ev_callback) {
        wf->ev_callback(wf, JANET_ASYNC_EVENT_CLOSE);
        stream->write_fiber = NULL;
    }
    janet_stream_close_impl(stream);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq 0x18(%rbx), %r14
testq %rdi, %rdi
je 0x229ae
movq 0x50(%rdi), %rax
testq %rax, %rax
je 0x229ae
movl $0x3, %esi
callq *%rax
movq $0x0, 0x10(%rbx)
testq %r14, %r14
je 0x229ce
movq 0x50(%r14), %rax
testq %rax, %rax
je 0x229ce
movq %r14, %rdi
movl $0x3, %esi
callq *%rax
movq $0x0, 0x18(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x229d7
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_stream_mark
static int janet_stream_mark(void *p, size_t s) {
    (void) s;
    JanetStream *stream = (JanetStream *) p;
    JanetFiber *rf = stream->read_fiber;
    JanetFiber *wf = stream->write_fiber;
    if (rf) {
        janet_mark(janet_wrap_fiber(rf));
    }
    if (wf) {
        janet_mark(janet_wrap_fiber(wf));
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rax
movabsq $-0x6800000000000, %rbx # imm = 0xFFF9800000000000
movq 0x10(%rdi), %rdi
movq 0x18(%rax), %r14
testq %rdi, %rdi
je 0x22a48
movq %rbx, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
testq %r14, %r14
je 0x22a60
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_stream_marshal
static void janet_stream_marshal(void *p, JanetMarshalContext *ctx) {
    JanetStream *s = p;
    if (!(ctx->flags & JANET_MARSHAL_UNSAFE)) {
        janet_panic("can only marshal stream with unsafe flag");
    }
    janet_marshal_abstract(ctx, p);
    janet_marshal_int(ctx, (int32_t) s->flags);
    janet_marshal_ptr(ctx, s->methods);
#ifdef JANET_WINDOWS
    /* TODO - ref counting to avoid situation where a handle is closed or GCed
     * while in transit, and it's value gets reused. DuplicateHandle does not work
     * for network sockets, and in general for winsock it is better to not duplicate
     * unless there is a need to. */
    HANDLE duph = INVALID_HANDLE_VALUE;
    if (s->flags & JANET_STREAM_SOCKET) {
        duph = s->handle;
    } else {
        DuplicateHandle(
            GetCurrentProcess(),
            s->handle,
            GetCurrentProcess(),
            &duph,
            0,
            FALSE,
            DUPLICATE_SAME_ACCESS);
    }
    janet_marshal_int64(ctx, (int64_t)(duph));
#else
    /* Marshal after dup because it is easier than maintaining our own ref counting. */
    int duph = dup(s->handle);
    if (duph < 0) janet_panicf("failed to duplicate stream handle: %V", janet_ev_lasterr());
    janet_marshal_int(ctx, (int32_t)(duph));
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testb $0x2, 0x12(%rsi)
je 0x22af0
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x304eb
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x2fa6f
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x2faef
movl (%r14), %edi
callq 0x123e0
testl %eax, %eax
js 0x22afc
movq %rbx, %rdi
movl %eax, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x2fa6f
leaq 0x39107(%rip), %rdi     # 0x5bbfe
callq 0x19263
callq 0x25958
leaq 0x3911f(%rip), %rdi     # 0x5bc27
movq %rax, %rsi
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_stream_unmarshal
static void *janet_stream_unmarshal(JanetMarshalContext *ctx) {
    if (!(ctx->flags & JANET_MARSHAL_UNSAFE)) {
        janet_panic("can only unmarshal stream with unsafe flag");
    }
    JanetStream *p = janet_unmarshal_abstract(ctx, sizeof(JanetStream));
    /* Can't share listening state and such across threads */
    p->read_fiber = NULL;
    p->write_fiber = NULL;
    p->flags = (uint32_t) janet_unmarshal_int(ctx);
    p->methods =  janet_unmarshal_ptr(ctx);
#ifdef JANET_WINDOWS
    p->handle = (JanetHandle) janet_unmarshal_int64(ctx);
#else
    p->handle = (JanetHandle) janet_unmarshal_int(ctx);
#endif
#ifdef JANET_EV_POLL
    janet_register_stream(p);
#endif
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testb $0x2, 0x12(%rdi)
je 0x22b61
movq %rdi, %rbx
movl $0x28, %esi
callq 0x31543
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq %rbx, %rdi
callq 0x30606
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x30736
movq %rax, 0x20(%r14)
movq %rbx, %rdi
callq 0x30606
movl %eax, (%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x390e5(%rip), %rdi     # 0x5bc4d
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/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 0x22ccf
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 0x22c18
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %r14, %rdi
callq 0x4f9f2
movq %rax, -0x48(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
leaq 0x298(%rax), %r13
movabsq $-0x6ffffffffffff, %rdi # imm = 0xFFF9000000000001
callq 0x4f95a
movq %r13, %rdi
movq -0x48(%rbp), %rsi
movq %rax, %rdx
callq 0x481b3
movq %r14, -0x40(%rbp)
movq %r12, -0x38(%rbp)
movl %r15d, -0x30(%rbp)
movl 0x48(%r14), %eax
incl %eax
movl %eax, 0x48(%r14)
movl %eax, -0x2c(%rbp)
xorl %eax, %eax
cmpl $0x1, %r15d
sete %al
shll $0x10, %eax
orl (%r14), %eax
orl $0x40000, %eax          # imm = 0x40000
movl %eax, (%r14)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
leaq 0x230(%rax), %rdi
testl %ebx, %ebx
je 0x22cb3
movq %rax, %r14
movl $0x18, %esi
callq 0x27305
testl %eax, %eax
jne 0x22cc1
movl 0x234(%r14), %eax
xorl %ecx, %ecx
testl %eax, %eax
jg 0x22c88
movl 0x230(%r14), %ecx
addl %ecx, %eax
decl %eax
movq 0x240(%r14), %rcx
cltq
leaq (%rax,%rax,2), %rdx
movq -0x30(%rbp), %rsi
movq %rsi, 0x10(%rcx,%rdx,8)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rcx,%rdx,8)
movl %eax, 0x234(%r14)
jmp 0x22cc1
leaq -0x40(%rbp), %rsi
movl $0x18, %edx
callq 0x272ae
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/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
cmpl 0x238(%rax), %r12d
jle 0x22dcb
cmpl 0x230(%r14), %r12d
jge 0x22d89
leaq (%r12,%r12,2), %rax
leaq (%r15,%rax,8), %r13
addq $0x8, %r13
movq -0x8(%r13), %rdi
movq %rbx, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
movq (%r13), %rdi
callq 0x2b15b
incq %r12
movslq 0x230(%r14), %rax
addq $0x18, %r13
cmpq %rax, %r12
jl 0x22d59
cmpl $0x0, 0x238(%r14)
jle 0x22e0f
addq $0x8, %r15
xorl %r12d, %r12d
movq -0x8(%r15), %rdi
movq %rbx, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
movq (%r15), %rdi
callq 0x2b15b
incq %r12
movslq 0x238(%r14), %rax
addq $0x18, %r15
cmpq %rax, %r12
jl 0x22d9a
jmp 0x22e0f
cmpl 0x238(%r14), %r12d
jge 0x22e0f
leaq (%r12,%r12,2), %rax
leaq (%r15,%rax,8), %r15
addq $0x8, %r15
movq -0x8(%r15), %rdi
movq %rbx, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
movq (%r15), %rdi
callq 0x2b15b
incq %r12
movslq 0x238(%r14), %rax
addq $0x18, %r15
cmpq %rax, %r12
jl 0x22de0
cmpq $0x0, 0x220(%r14)
je 0x22e6c
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x248(%r14), %rax
movq 0x8(%rax,%r15), %rdi
movq %rbx, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
movq 0x248(%r14), %rax
movq 0x10(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x22e5c
movq %rbx, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b15b
incq %r12
addq $0x30, %r15
cmpq 0x220(%r14), %r12
jb 0x22e1f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/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 0x47e73
leaq 0x298(%rbx), %rdi
xorl %esi, %esi
callq 0x47e73
leaq 0x2c8(%rbx), %rdi
xorl %esi, %esi
callq 0x47e73
leaq 0x250(%rbx), %rdi
xorl %esi, %esi
callq 0x3307c
addq $0x2f8, %rbx            # imm = 0x2F8
movq %rbx, %rdi
callq 0x12540
movq %rbx, %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x12710
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_ev_deinit_common
void janet_ev_deinit_common(void) {
    JanetTimeout to;
    while (peek_timeout(&to)) {
        handle_timeout_worker(to, 1);
        pop_timeout(0);
    }
    janet_q_deinit(&janet_vm.spawn);
    janet_free(janet_vm.tq);
    janet_table_deinit(&janet_vm.threaded_abstracts);
    janet_table_deinit(&janet_vm.active_tasks);
    janet_table_deinit(&janet_vm.signal_handlers);
#ifndef JANET_WINDOWS
    pthread_attr_destroy(&janet_vm.new_thread_attr);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq %rax, %rbx
cmpq $0x0, 0x220(%rax)
je 0x22f65
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 $0x1, %edi
callq 0x22fb6
callq 0x23000
cmpq $0x0, 0x220(%rbx)
jne 0x22f2c
movq 0x240(%rbx), %rdi
callq 0x120b0
movq 0x248(%rbx), %rdi
callq 0x120b0
leaq 0x268(%rbx), %rdi
callq 0x47e7c
leaq 0x298(%rbx), %rdi
callq 0x47e7c
leaq 0x2c8(%rbx), %rdi
callq 0x47e7c
addq $0x2f8, %rbx            # imm = 0x2F8
movq %rbx, %rdi
addq $0x38, %rsp
popq %rbx
popq %rbp
jmp 0x12a10
// File: /workspace/github_c_makefile_star2_O1/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 0x22fef
leaq 0x10(%rbp), %rbx
testl %edi, %edi
je 0x22fd7
movq 0x28(%rbx), %rdi
callq 0x12b70
testl %eax, %eax
jne 0x22ffb
leaq -0x10(%rbp), %rsi
movq $0x0, (%rsi)
movq 0x28(%rbx), %rdi
callq 0x12b30
testl %eax, %eax
jne 0x22ff6
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x13370
callq 0x1333c
// File: /workspace/github_c_makefile_star2_O1/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 0x2315c
movq 0x248(%rax), %rdx
decq %rcx
movq %rcx, 0x220(%rax)
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movups (%rdx,%rcx), %xmm0
movups 0x10(%rdx,%rcx), %xmm1
movups 0x20(%rdx,%rcx), %xmm2
movups %xmm2, 0x20(%rdx)
movups %xmm1, 0x10(%rdx)
movups %xmm0, (%rdx)
xorl %ecx, %ecx
leaq 0x1(,%rcx,2), %rdi
movq 0x220(%rax), %rsi
movq %rcx, %rdx
cmpq %rsi, %rdi
jae 0x2309a
movq 0x248(%rax), %rdx
leaq (%rdi,%rdi,2), %r8
shlq $0x4, %r8
movq (%rdx,%r8), %r8
leaq (%rcx,%rcx,2), %r9
shlq $0x4, %r9
cmpq (%rdx,%r9), %r8
jl 0x23097
movq %rcx, %rdi
movq %rdi, %rdx
leaq 0x2(,%rcx,2), %rdi
cmpq %rsi, %rdi
jae 0x230ce
movq 0x248(%rax), %rsi
leaq (%rdi,%rdi,2), %r8
shlq $0x4, %r8
movq (%rsi,%r8), %r8
leaq (%rdx,%rdx,2), %r9
shlq $0x4, %r9
cmpq (%rsi,%r9), %r8
jl 0x230cb
movq %rdx, %rdi
movq %rdi, %rdx
movq %rcx, %rsi
cmpq %rcx, %rdx
je 0x23150
movq 0x248(%rax), %rsi
leaq (%rcx,%rcx,2), %rdi
shlq $0x4, %rdi
movups (%rsi,%rdi), %xmm0
movups 0x10(%rsi,%rdi), %xmm1
movups 0x20(%rsi,%rdi), %xmm2
movaps %xmm2, -0x10(%rbp)
movaps %xmm1, -0x20(%rbp)
movaps %xmm0, -0x30(%rbp)
movq %rdx, %r8
shlq $0x4, %r8
leaq (%r8,%r8,2), %r8
movups (%rsi,%r8), %xmm0
movups 0x10(%rsi,%r8), %xmm1
movups 0x20(%rsi,%r8), %xmm2
movups %xmm0, (%rsi,%rdi)
movups %xmm1, 0x10(%rsi,%rdi)
movups %xmm2, 0x20(%rsi,%rdi)
movq 0x248(%rax), %rsi
movaps -0x30(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
movaps -0x10(%rbp), %xmm2
movups %xmm2, 0x20(%rsi,%r8)
movups %xmm1, 0x10(%rsi,%r8)
movups %xmm0, (%rsi,%r8)
movq %rdx, %rsi
cmpq %rcx, %rdx
movq %rsi, %rcx
jne 0x2305c
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_addtimeout
void janet_addtimeout(double sec) {
    JanetFiber *fiber = janet_vm.root_fiber;
    JanetTimeout to;
    to.when = ts_delta(ts_now(), sec);
    to.fiber = fiber;
    to.curr_fiber = NULL;
    to.sched_id = fiber->sched_id;
    to.is_error = 1;
    to.has_worker = 0;
    add_timeout(to);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %xmm0, -0x20(%rbp)
movq %xmm0, %r15
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x28(%rax), %r14
callq 0x2327e
movq %rax, %rbx
btrq $0x3f, %r15
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
cmpq %rax, %r15
jne 0x231c2
pxor %xmm0, %xmm0
ucomisd -0x20(%rbp), %xmm0
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmovaq %rbx, %rax
jmp 0x231df
movsd -0x20(%rbp), %xmm0
mulsd 0x36db9(%rip), %xmm0    # 0x59f88
callq 0x12140
cvttsd2si %xmm0, %rax
addq %rax, %rbx
movq %rbx, %rax
movq %rax, -0x50(%rbp)
movq %r14, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movl 0x48(%r14), %eax
movl %eax, -0x38(%rbp)
movq $0x1, -0x34(%rbp)
movups -0x50(%rbp), %xmm0
movups -0x40(%rbp), %xmm1
movups -0x30(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x232cb
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: 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 0x23262
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmovaq %rbx, %rax
jmp 0x23277
mulsd 0x36d1e(%rip), %xmm0    # 0x59f88
callq 0x12140
cvttsd2si %xmm0, %rax
addq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: ts_now
static JanetTimestamp ts_now(void) {
    struct timespec now;
    janet_assert(-1 != clock_gettime(CLOCK_MONOTONIC, &now), "failed to get time");
    uint64_t res = 1000 * now.tv_sec;
    res += now.tv_nsec / 1000000;
    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x12230
cmpl $-0x1, %eax
je 0x232c6
imulq $0x3e8, -0x10(%rbp), %rcx # imm = 0x3E8
movabsq $0x431bde82d7b634db, %rax # imm = 0x431BDE82D7B634DB
imulq -0x8(%rbp)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %rdx
addq %rdx, %rax
addq %rcx, %rax
addq $0x10, %rsp
popq %rbp
retq
callq 0x133a4
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x1(%r14), %r15
cmpq 0x228(%rax), %r15
jbe 0x23331
movq 0x248(%rbx), %rdi
movq %r15, %rax
shlq $0x5, %rax
leaq (%rax,%rax,2), %rsi
callq 0x12850
testq %rax, %rax
je 0x2340a
leaq (%r15,%r15), %rcx
movq %rax, 0x248(%rbx)
movq %rcx, 0x228(%rbx)
leaq 0x10(%rbp), %rax
movslq %r15d, %rcx
movq %rcx, 0x220(%rbx)
movq 0x248(%rbx), %rcx
leaq (%r14,%r14,2), %rdx
shlq $0x4, %rdx
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rcx,%rdx)
movups %xmm1, 0x10(%rcx,%rdx)
movups %xmm0, (%rcx,%rdx)
testq %r14, %r14
je 0x233ff
leaq -0x1(%r14), %rax
shrq %rax
movq 0x248(%rbx), %r8
leaq (%rax,%rax,2), %rdx
shlq $0x4, %rdx
movq (%r8,%rdx), %rcx
leaq (%r14,%r14,2), %rdi
shlq $0x4, %rdi
movq (%r8,%rdi), %rsi
cmpq %rsi, %rcx
jle 0x233f6
leaq (%r8,%rdx), %r9
addq %r8, %rdi
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups 0x20(%rdi), %xmm2
movaps %xmm2, -0x30(%rbp)
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movups (%r9), %xmm0
movups 0x10(%r9), %xmm1
movups 0x20(%r9), %xmm2
movups %xmm0, (%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm2, 0x20(%rdi)
movq 0x248(%rbx), %rdi
movaps -0x50(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
movaps -0x30(%rbp), %xmm2
movups %xmm2, 0x20(%rdi,%rdx)
movups %xmm1, 0x10(%rdi,%rdx)
movups %xmm0, (%rdi,%rdx)
movq %rax, %r14
cmpq %rsi, %rcx
jg 0x23367
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x133d8
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_addtimeout_nil
void janet_addtimeout_nil(double sec) {
    JanetFiber *fiber = janet_vm.root_fiber;
    JanetTimeout to;
    to.when = ts_delta(ts_now(), sec);
    to.fiber = fiber;
    to.curr_fiber = NULL;
    to.sched_id = fiber->sched_id;
    to.is_error = 0;
    to.has_worker = 0;
    add_timeout(to);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %xmm0, -0x20(%rbp)
movq %xmm0, %r15
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x28(%rax), %r14
callq 0x2327e
movq %rax, %rbx
btrq $0x3f, %r15
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
cmpq %rax, %r15
jne 0x2346f
pxor %xmm0, %xmm0
ucomisd -0x20(%rbp), %xmm0
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmovaq %rbx, %rax
jmp 0x2348c
movsd -0x20(%rbp), %xmm0
mulsd 0x36b0c(%rip), %xmm0    # 0x59f88
callq 0x12140
cvttsd2si %xmm0, %rax
addq %rax, %rbx
movq %rbx, %rax
movq %rax, -0x50(%rbp)
movq %r14, -0x48(%rbp)
xorl %eax, %eax
movq %rax, -0x40(%rbp)
movl 0x48(%r14), %ecx
movl %ecx, -0x38(%rbp)
movq %rax, -0x34(%rbp)
movups -0x50(%rbp), %xmm0
movups -0x40(%rbp), %xmm1
movups -0x30(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x232cb
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_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 0x235fd
movl %edi, %ebx
leaq 0x5df1a(%rip), %rdi     # 0x814d0
movl $0x80, %esi
callq 0x144d2
movq %rax, %r14
movl %ebx, 0x48(%rax)
xorl %eax, %eax
movq %rax, 0x4c(%r14)
movl %eax, 0x8(%r14)
movq %rax, (%r14)
movq %rax, 0x40(%r14)
leaq 0x58(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movl %eax, 0x20(%r14)
movups %xmm0, 0x28(%r14)
movl %eax, 0x38(%r14)
callq 0x145db
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x13408
// File: /workspace/github_c_makefile_star2_O1/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 0x2365d
movl %edi, %ebx
leaq 0x5deba(%rip), %rdi     # 0x814d0
movl $0x80, %esi
callq 0x145b6
movq %rax, %r14
movl %ebx, 0x48(%rax)
xorl %eax, %eax
movq %rax, 0x4c(%r14)
movl %eax, 0x8(%r14)
movq %rax, (%r14)
movq %rax, 0x40(%r14)
leaq 0x58(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movl %eax, 0x20(%r14)
movups %xmm0, 0x28(%r14)
movl %eax, 0x38(%r14)
callq 0x145db
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x1343c
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: chan_unlock_args
static void chan_unlock_args(const Janet *argv, int32_t n) {
    for (int32_t i = 0; i < n; i++) {
        int32_t len;
        const Janet *data;
        JanetChannel *chan;
        if (janet_indexed_view(argv[i], &data, &len) && len == 2) {
            chan = janet_getchannel(data, 0);
        } else {
            chan = janet_getchannel(argv, i);
        }
        janet_chan_unlock(chan);
    }
}

// Assembly:
testl %esi, %esi
jle 0x23a0e
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl %esi, %r15d
xorl %r14d, %r14d
leaq -0x2c(%rbp), %r12
leaq 0x5db1a(%rip), %r13     # 0x814d0
movq (%rbx,%r14,8), %rdi
leaq -0x38(%rbp), %rsi
movq %r12, %rdx
callq 0x4a23e
testl %eax, %eax
je 0x239d8
cmpl $0x2, -0x2c(%rbp)
jne 0x239d8
movq -0x38(%rbp), %rdi
xorl %esi, %esi
jmp 0x239de
movq %rbx, %rdi
movl %r14d, %esi
movq %r13, %rdx
callq 0x19e14
cmpl $0x0, 0x50(%rax)
je 0x239f8
addq $0x58, %rax
movq %rax, %rdi
callq 0x1462a
incq %r14
cmpq %r14, %r15
jne 0x239b6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: make_close_result
static Janet make_close_result(JanetChannel *channel) {
    Janet *tup = janet_tuple_begin(2);
    tup[0] = janet_ckeywordv("close");
    tup[1] = janet_wrap_channel(channel);
    return janet_wrap_tuple(janet_tuple_end(tup));
}

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x3, %edi
callq 0x48a50
movq %rax, %r15
leaq 0x37afd(%rip), %rdi     # 0x5babf
callq 0x47cd3
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4f9ad
movq %rax, (%r15)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %r14, %rdi
callq 0x4f9f2
movq %rax, 0x8(%r15)
movq %rbx, 0x10(%r15)
movq %r15, %rdi
callq 0x48a81
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4f9ad
// File: /workspace/github_c_makefile_star2_O1/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 0x1a23c
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
movl $0x4, %r12d
testl %r12d, %r12d
jle 0x245e6
movl $0x28, %edx
movl %r14d, %edi
movq %rbx, %rsi
callq 0x12250
movq %rax, %r15
cmpl $-0x1, %r15d
jne 0x245d2
callq 0x12120
cmpl $0x4, (%rax)
je 0x245af
testl %r15d, %r15d
jg 0x245e1
xorl %edi, %edi
callq 0x12b90
decl %r12d
testl %r15d, %r15d
jle 0x245aa
testl %r12d, %r12d
jle 0x245f8
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x134d4
// File: /workspace/github_c_makefile_star2_O1/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 0x248ad
leaq 0x58(%rbx), %r14
movq %r14, %rdi
callq 0x14620
movq 0x28(%rbx), %rdi
callq 0x120b0
movq 0x40(%rbx), %rdi
callq 0x120b0
movl 0x4(%rbx), %eax
cmpl 0x8(%rbx), %eax
je 0x24894
xorl %r12d, %r12d
leaq -0x28(%rbp), %r15
movq 0x10(%rbx), %rcx
cltq
movq (%rcx,%rax,8), %rcx
movq %rcx, -0x28(%rbp)
incl %eax
cmpl (%rbx), %eax
cmovgel %r12d, %eax
movl %eax, 0x4(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x273b5
movl 0x4(%rbx), %eax
cmpl 0x8(%rbx), %eax
jne 0x24863
movq 0x10(%rbx), %rdi
callq 0x120b0
cmpl $0x0, 0x50(%rbx)
je 0x248c8
movq %r14, %rdi
callq 0x1462a
jmp 0x248c8
movq 0x28(%rbx), %rdi
callq 0x120b0
movq 0x40(%rbx), %rdi
callq 0x120b0
movq 0x10(%rbx), %rdi
callq 0x120b0
addq $0x58, %rbx
movq %rbx, %rdi
callq 0x14616
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_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 0x27453
leaq 0x30(%rbx), %rdi
callq 0x27453
movq 0x10(%rbx), %r14
movslq 0x4(%rbx), %r15
cmpl 0x8(%rbx), %r15d
jle 0x24949
cmpl (%rbx), %r15d
jge 0x24929
movq (%r14,%r15,8), %rdi
callq 0x2b15b
incq %r15
movslq (%rbx), %rax
cmpq %rax, %r15
jl 0x24915
cmpl $0x0, 0x8(%rbx)
jle 0x24964
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
callq 0x2b15b
incq %r15
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jl 0x24932
jmp 0x24964
cmpl 0x8(%rbx), %r15d
jge 0x24964
movq (%r14,%r15,8), %rdi
callq 0x2b15b
incq %r15
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jl 0x2494f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_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 0x2fb29
movq %rbx, %rdi
movq %r14, %rsi
callq 0x304eb
movzbl 0x4c(%r14), %esi
movq %rbx, %rdi
callq 0x2fb29
movl 0x48(%r14), %esi
movq %rbx, %rdi
callq 0x2fa6f
movl 0x4(%r14), %eax
movl 0x8(%r14), %esi
cmpl %esi, %eax
jle 0x249fb
addl (%r14), %esi
subl %eax, %esi
movq %rbx, %rdi
callq 0x2fa6f
movq 0x10(%r14), %r15
movslq 0x4(%r14), %r12
cmpl 0x8(%r14), %r12d
jle 0x24a53
cmpl (%r14), %r12d
jge 0x24a2f
movq (%r15,%r12,8), %rsi
movq %rbx, %rdi
callq 0x2fb5d
incq %r12
movslq (%r14), %rax
cmpq %rax, %r12
jl 0x24a18
cmpl $0x0, 0x8(%r14)
jle 0x24a71
xorl %r12d, %r12d
movq (%r15,%r12,8), %rsi
movq %rbx, %rdi
callq 0x2fb5d
incq %r12
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jl 0x24a39
jmp 0x24a71
cmpl 0x8(%r14), %r12d
jge 0x24a71
movq (%r15,%r12,8), %rsi
movq %rbx, %rdi
callq 0x2fb5d
incq %r12
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jl 0x24a59
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_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 0x3077a
movl $0x80, %esi
movq %rbx, %rdi
testb %al, %al
je 0x24aa3
callq 0x3156c
jmp 0x24aa8
callq 0x31543
movq %rax, %r14
movq %rbx, %rdi
callq 0x3077a
movl %eax, %r12d
movq %rbx, %rdi
callq 0x30606
movl %eax, %r13d
movq %rbx, %rdi
callq 0x30606
testl %eax, %eax
js 0x24b4b
movl %eax, %r15d
movl %r13d, 0x48(%r14)
xorl %eax, %eax
movq %rax, 0x4c(%r14)
movl %eax, 0x8(%r14)
movq %rax, (%r14)
movq %rax, 0x40(%r14)
leaq 0x58(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movl %eax, 0x20(%r14)
movups %xmm0, 0x28(%r14)
movl %eax, 0x38(%r14)
callq 0x145db
xorl %eax, %eax
testb %r12b, %r12b
setne %al
movl %eax, 0x4c(%r14)
testl %r15d, %r15d
je 0x24b39
leaq -0x30(%rbp), %r12
movq %rbx, %rdi
callq 0x307ed
movq %rax, -0x30(%rbp)
movl $0x8, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x272ae
decl %r15d
jne 0x24b18
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x371a0(%rip), %rdi     # 0x5bcf2
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/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 0x44fe7
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 0x2454b
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/ev.c
// Function: janet_loop
void janet_loop(void) {
    while (!janet_loop_done()) {
        JanetFiber *interrupted_fiber = janet_loop1();
        if (NULL != interrupted_fiber) {
            janet_schedule(interrupted_fiber, janet_wrap_nil());
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x24b68
testl %eax, %eax
jne 0x2538f
movabsq $-0x77fffffffffff, %rbx # imm = 0xFFF8800000000001
callq 0x24bb0
testq %rax, %rax
je 0x25386
movq %rax, %r14
movq %rbx, %rdi
callq 0x4f95a
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x22b9f
callq 0x24b68
testl %eax, %eax
je 0x25362
popq %rbx
popq %r14
popq %rbp
retq