// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rcx, %r15
movl %edx, -0x4c(%rbp)
movq %rsi, -0x58(%rbp)
movq %rdi, %rbx
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4b313
movq %rax, -0x30(%rbp)
testq %r15, %r15
movq %r14, -0x60(%rbp)
je 0x3d621
movq %r15, %rdi
callq 0x411ea
testq %rax, %rax
movq %r15, -0x40(%rbp)
je 0x3d633
movq %rax, -0x48(%rbp)
movq %rax, %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x4b366
movq %rax, %rdi
callq 0x28c2a
movl $0x0, -0x34(%rbp)
jmp 0x3d640
movb $0x1, %al
movl %eax, -0x34(%rbp)
leaq 0x260dc(%rip), %rax     # 0x63709
movq %rax, -0x40(%rbp)
jmp 0x3d638
movb $0x1, %al
movl %eax, -0x34(%rbp)
movq $0x0, -0x48(%rbp)
movabsq $-0x1000000000000, %r14 # imm = 0xFFFF000000000000
leaq 0x40c4f(%rip), %rdi     # 0x7e2a0
pushq $0x70
popq %rsi
callq 0x12d92
movq %rax, %r12
movq %rax, %rdi
callq 0x35e65
movq %r12, %rdi
movq %r14, %rsi
callq 0x4b3ab
movq %rax, %rdi
callq 0x28c2a
xorl %r14d, %r14d
movl $0x0, -0x38(%rbp)
xorl %r15d, %r15d
movb $0x1, %r13b
testb $0x1, %r13b
je 0x3d8b5
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x36430
testl %eax, %eax
je 0x3d7e4
movq %r12, %rdi
callq 0x35daa
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
movq %rbx, %rdx
movq -0x48(%rbp), %rcx
callq 0x1c36f
cmpl $0x0, -0x68(%rbp)
je 0x3d74c
movq -0x80(%rbp), %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x4b366
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 0x3d705
movl 0x58(%r12), %r9d
movl 0x50(%r12), %r8d
cmpq $0x0, -0x78(%rbp)
movq 0x428df(%rip), %rax     # 0x7fff0
movq (%rax), %rsi
je 0x3d7b6
leaq 0x192fd(%rip), %rdi     # 0x56a1e
leaq 0x27084(%rip), %rdx     # 0x647ac
movq -0x40(%rbp), %rcx
xorl %eax, %eax
callq 0x2c621
movq -0x78(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0x2a9bb(%rip), %rdx     # 0x680fd
callq 0x1e979
jmp 0x3d7d7
movq -0x88(%rbp), %rdi
callq 0x1757a
movq %rax, %rdi
pushq $0x40
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x271c9
movq %rax, %r14
movq %rbx, 0x28(%rax)
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4b313
movq %r14, %rdi
movq %rax, %rsi
leaq -0x30(%rbp), %rdx
callq 0x47bb8
testl %eax, %eax
je 0x3d694
cmpl $0xd, %eax
je 0x3d694
movq -0x30(%rbp), %rsi
movq %r14, %rdi
leaq 0x2a952(%rip), %rdx     # 0x680fd
callq 0x1e979
orl $0x1, %r15d
jmp 0x3d7db
movq -0x80(%rbp), %rax
movq %rax, (%rsp)
leaq 0x19259(%rip), %rdi     # 0x56a1e
leaq 0x26ff8(%rip), %rdx     # 0x647c4
movq -0x40(%rbp), %rcx
xorl %eax, %eax
callq 0x2c621
orl $0x2, %r15d
pushq $0x1
popq %r13
jmp 0x3d694
testl %r13d, %r13d
jne 0x3d8b5
movq %r12, %rdi
callq 0x35d1e
movb $0x1, %r13b
cmpl $0x3, %eax
ja 0x3d687
movl %eax, %eax
leaq 0x26f92(%rip), %rcx     # 0x6479c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r12, %rdi
callq 0x35d68
movq %rax, %r13
orl $0x4, %r15d
movq %rax, %rdi
callq 0x411ea
movq %rax, %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x4b366
movq %rax, -0x30(%rbp)
movl 0x50(%r12), %r8d
movl 0x58(%r12), %r9d
movq 0x4279f(%rip), %rax     # 0x7fff0
movq (%rax), %rsi
movq %r13, (%rsp)
xorl %r13d, %r13d
leaq 0x191bc(%rip), %rdi     # 0x56a1e
leaq 0x26f78(%rip), %rdx     # 0x647e1
movq -0x40(%rbp), %rcx
xorl %eax, %eax
callq 0x2c621
jmp 0x3d687
xorl %r13d, %r13d
jmp 0x3d687
movl -0x38(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jl 0x3d896
movq %r12, %rdi
callq 0x35bd1
jmp 0x3d684
movl -0x38(%rbp), %ecx
movl %ecx, %eax
incl %ecx
movl %ecx, -0x38(%rbp)
movq -0x58(%rbp), %rcx
movzbl (%rcx,%rax), %esi
movq %r12, %rdi
callq 0x35b32
jmp 0x3d684
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %r12, %rdi
callq 0x4b3ab
movq %rax, %rdi
callq 0x293b5
cmpb $0x0, -0x34(%rbp)
jne 0x3d8f0
movq -0x48(%rbp), %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x4b366
movq %rax, %rdi
callq 0x293b5
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
cmpl $0x0, 0x18(%rax)
jne 0x3d94f
testq %r14, %r14
je 0x3d94a
movabsq $-0x6800000000000, %rbx # imm = 0xFFF9800000000000
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4b3ab
movq %rax, %rdi
callq 0x28c2a
callq 0x22d74
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4b3ab
movq %rax, %rdi
callq 0x293b5
movq 0x40(%r14), %rax
movq %rax, -0x30(%rbp)
jmp 0x3d94f
callq 0x22d74
movq -0x60(%rbp), %rcx
testq %rcx, %rcx
je 0x3d95f
movq -0x30(%rbp), %rax
movq %rax, (%rcx)
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq