// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/run.c
// Function: janet_dobytes
int janet_dobytes(JanetTable *env, const uint8_t *bytes, int32_t len, const char *sourcePath, Janet *out) {
    JanetParser *parser;
    int errflags = 0, done = 0;
    int32_t index = 0;
    Janet ret = janet_wrap_nil();
    JanetFiber *fiber = NULL;
    const uint8_t *where = sourcePath ? janet_cstring(sourcePath) : NULL;

    if (where) janet_gcroot(janet_wrap_string(where));
    if (NULL == sourcePath) sourcePath = "<unknown>";
    parser = janet_abstract(&janet_parser_type, sizeof(JanetParser));
    janet_parser_init(parser);
    janet_gcroot(janet_wrap_abstract(parser));

    /* While we haven't seen an error */
    while (!done) {

        /* Evaluate parsed values */
        while (janet_parser_has_more(parser)) {
            Janet form = janet_parser_produce(parser);
            JanetCompileResult cres = janet_compile(form, env, where);
            if (cres.status == JANET_COMPILE_OK) {
                JanetFunction *f = janet_thunk(cres.funcdef);
                fiber = janet_fiber(f, 64, 0, NULL);
                fiber->env = env;
                JanetSignal status = janet_continue(fiber, janet_wrap_nil(), &ret);
                if (status != JANET_SIGNAL_OK && status != JANET_SIGNAL_EVENT) {
                    janet_stacktrace_ext(fiber, ret, "");
                    errflags |= 0x01;
                    done = 1;
                }
            } else {
                ret = janet_wrap_string(cres.error);
                int32_t line = (int32_t) parser->line;
                int32_t col = (int32_t) parser->column;
                if ((cres.error_mapping.line > 0) &&
                        (cres.error_mapping.column > 0)) {
                    line = cres.error_mapping.line;
                    col = cres.error_mapping.column;
                }
                if (cres.macrofiber) {
                    janet_eprintf("%s:%d:%d: compile error", sourcePath,
                                  line, col);
                    janet_stacktrace_ext(cres.macrofiber, ret, "");
                } else {
                    janet_eprintf("%s:%d:%d: compile error: %s\n", sourcePath,
                                  line, col, (const char *)cres.error);
                }
                errflags |= 0x02;
                done = 1;
            }
        }

        if (done) break;

        /* Dispatch based on parse state */
        switch (janet_parser_status(parser)) {
            case JANET_PARSE_DEAD:
                done = 1;
                break;
            case JANET_PARSE_ERROR: {
                const char *e = janet_parser_error(parser);
                errflags |= 0x04;
                ret = janet_cstringv(e);
                int32_t line = (int32_t) parser->line;
                int32_t col = (int32_t) parser->column;
                janet_eprintf("%s:%d:%d: parse error: %s\n", sourcePath, line, col, e);
                done = 1;
                break;
            }
            case JANET_PARSE_ROOT:
            case JANET_PARSE_PENDING:
                if (index >= len) {
                    janet_parser_eof(parser);
                } else {
                    janet_parser_consume(parser, bytes[index++]);
                }
                break;
        }

    }

    /* Clean up and return errors */
    janet_gcunroot(janet_wrap_abstract(parser));
    if (where) janet_gcunroot(janet_wrap_string(where));
#ifdef JANET_EV
    /* Enter the event loop if we are not already in it */
    if (janet_vm.stackn == 0) {
        if (fiber) {
            janet_gcroot(janet_wrap_fiber(fiber));
        }
        janet_loop();
        if (fiber) {
            janet_gcunroot(janet_wrap_fiber(fiber));
            ret = fiber->last_value;
        }
    }
#endif
    if (out) *out = ret;
    return errflags;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, -0x58(%rbp)
movq %rcx, %r15
movl %edx, -0x44(%rbp)
movq %rsi, -0x60(%rbp)
movq %rdi, %rbx
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4f95a
movq %rax, -0x30(%rbp)
testq %r15, %r15
je 0x4136f
movq %r15, %rdi
callq 0x4516c
movq %rax, %r14
jmp 0x41372
xorl %r14d, %r14d
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
testq %r14, %r14
je 0x41391
movq %r14, %rdi
callq 0x4f9ad
movq %rax, %rdi
callq 0x2b5e5
movq %r14, -0x50(%rbp)
testq %r15, %r15
movabsq $-0x1000000000000, %r14 # imm = 0xFFFF000000000000
leaq 0x27360(%rip), %rax     # 0x68709
cmovneq %r15, %rax
movq %rax, -0x40(%rbp)
leaq 0x42ee8(%rip), %rdi     # 0x842a0
movl $0x70, %esi
callq 0x144d2
movq %rax, %r15
movq %rax, %rdi
callq 0x393d4
movq %r15, %rdi
movq %r14, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b5e5
xorl %r13d, %r13d
xorl %r14d, %r14d
movl $0x0, -0x34(%rbp)
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x39825
testl %eax, %eax
je 0x4153e
movq %r15, %rdi
callq 0x3930c
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
movq %rbx, %rdx
movq -0x50(%rbp), %rcx
callq 0x1e3d5
cmpl $0x0, -0x68(%rbp)
je 0x414a2
movq -0x80(%rbp), %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x4f9ad
movq %rax, -0x30(%rbp)
movl -0x70(%rbp), %r8d
movl -0x6c(%rbp), %r9d
testl %r8d, %r8d
setg %al
testl %r9d, %r9d
setg %cl
testb %cl, %al
jne 0x4145b
movl 0x58(%r15), %r9d
movl 0x50(%r15), %r8d
cmpq $0x0, -0x78(%rbp)
movq 0x44b89(%rip), %rax     # 0x85ff0
movq (%rax), %rsi
je 0x4150e
leaq 0x1a5a7(%rip), %rdi     # 0x5ba1e
leaq 0x2832e(%rip), %rdx     # 0x697ac
movq -0x40(%rbp), %rcx
xorl %eax, %eax
callq 0x2f340
movq -0x78(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0x2bc65(%rip), %rdx     # 0x6d0fd
callq 0x20b8f
jmp 0x4152f
movq -0x88(%rbp), %rdi
callq 0x19053
movq %rax, %rdi
movl $0x40, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x29abc
movq %rax, %r12
movq %rbx, 0x28(%rax)
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4f95a
movq %r12, %rdi
movq %rax, %rsi
leaq -0x30(%rbp), %rdx
callq 0x4c28d
testl %eax, %eax
je 0x413f0
cmpl $0xd, %eax
je 0x413f0
movq -0x30(%rbp), %rsi
movq %r12, %rdi
leaq 0x2bbfa(%rip), %rdx     # 0x6d0fd
callq 0x20b8f
orl $0x1, %r13d
jmp 0x41533
movq -0x80(%rbp), %rax
movq %rax, (%rsp)
leaq 0x1a501(%rip), %rdi     # 0x5ba1e
leaq 0x282a0(%rip), %rdx     # 0x697c4
movq -0x40(%rbp), %rcx
xorl %eax, %eax
callq 0x2f340
orl $0x2, %r13d
movl $0x1, %r14d
jmp 0x413f0
testl %r14d, %r14d
jne 0x41617
movq %r15, %rdi
callq 0x39296
xorl %r14d, %r14d
movb $0x1, %cl
cmpl $0x3, %eax
ja 0x4160f
movl %eax, %eax
leaq 0x28236(%rip), %rcx     # 0x6979c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x34(%rbp), %ecx
cmpl -0x44(%rbp), %ecx
jge 0x41605
movslq %ecx, %rax
incl %ecx
movl %ecx, -0x34(%rbp)
movq -0x60(%rbp), %rcx
movzbl (%rcx,%rax), %esi
movq %r15, %rdi
callq 0x39099
jmp 0x4160d
movq %r15, %rdi
callq 0x392db
movq %rax, %r14
orl $0x4, %r13d
movq %rax, %rdi
callq 0x4516c
movq %rax, %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x4f9ad
movq %rax, -0x30(%rbp)
movl 0x50(%r15), %r8d
movl 0x58(%r15), %r9d
movq 0x44a1f(%rip), %rax     # 0x85ff0
movq (%rax), %rsi
movq %r14, (%rsp)
leaq 0x1a43f(%rip), %rdi     # 0x5ba1e
leaq 0x281fb(%rip), %rdx     # 0x697e1
movq -0x40(%rbp), %rcx
xorl %eax, %eax
callq 0x2f340
xorl %ecx, %ecx
movl $0x1, %r14d
jmp 0x4160f
movl $0x1, %r14d
xorl %ecx, %ecx
jmp 0x4160f
movq %r15, %rdi
callq 0x3913d
movb $0x1, %cl
testb %cl, %cl
jne 0x413f0
movq %r15, %rdi
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
callq 0x4f9f2
movq %rax, %rdi
callq 0x2bd0b
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x41651
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x4f9ad
movq %rax, %rdi
callq 0x2bd0b
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
cmpl $0x0, 0x18(%rax)
jne 0x416b1
testq %r12, %r12
je 0x416ac
movabsq $-0x6800000000000, %rbx # imm = 0xFFF9800000000000
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b5e5
callq 0x25348
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2bd0b
movq 0x40(%r12), %rax
movq %rax, -0x30(%rbp)
jmp 0x416b1
callq 0x25348
movq -0x58(%rbp), %rcx
testq %rcx, %rcx
je 0x416c1
movq -0x30(%rbp), %rax
movq %rax, (%rcx)
movl %r13d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq