// File: /workspace/github_c_makefile_star2_O0/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
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x5e307
movq -0x20(%rbp), %rdi
callq 0x64a70
movq %rax, -0x100(%rbp)
jmp 0x5e312
xorl %eax, %eax
movq %rax, -0x100(%rbp)
jmp 0x5e312
movq -0x100(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x5e344
movq -0x58(%rbp), %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x7b550
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x39200
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
jne 0x5e357
leaq 0x366e9(%rip), %rax     # 0x94a3c
movq %rax, -0x20(%rbp)
leaq 0x50762(%rip), %rdi     # 0xaeac0
movl $0x70, %esi
callq 0x12de0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x4ffb0
movq -0x30(%rbp), %rdi
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
callq 0x7b610
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x39200
cmpl $0x0, -0x38(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5e3a7
jmp 0x5e6d0
jmp 0x5e3a9
movq -0x30(%rbp), %rdi
callq 0x506a0
cmpl $0x0, %eax
je 0x5e5a4
movq -0x30(%rbp), %rdi
callq 0x4fe10
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x70(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x23f70
cmpl $0x0, -0x78(%rbp)
jne 0x5e49d
movq -0x98(%rbp), %rdi
callq 0x1aa00
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
movl $0x40, %esi
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x36450
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x108(%rbp)
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq -0x108(%rbp), %rdi
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x70a80
movl %eax, -0xa4(%rbp)
cmpl $0x0, -0xa4(%rbp)
je 0x5e498
cmpl $0xd, -0xa4(%rbp)
je 0x5e498
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq 0x3b002(%rip), %rdx     # 0x99485
callq 0x27d00
movl -0x34(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x34(%rbp)
movl $0x1, -0x38(%rbp)
jmp 0x5e59f
movq -0x90(%rbp), %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x7b550
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movl %eax, -0xbc(%rbp)
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rax
movl %eax, -0xc0(%rbp)
cmpl $0x0, -0x80(%rbp)
jle 0x5e4ff
cmpl $0x0, -0x7c(%rbp)
jle 0x5e4ff
movl -0x80(%rbp), %eax
movl %eax, -0xbc(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0xc0(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x5e553
movq 0x51ae0(%rip), %rax     # 0xafff0
movq (%rax), %rsi
movq -0x20(%rbp), %rcx
movl -0xbc(%rbp), %r8d
movl -0xc0(%rbp), %r9d
leaq 0x29502(%rip), %rdi     # 0x87a2e
leaq 0x376e9(%rip), %rdx     # 0x95c1c
movb $0x0, %al
callq 0x3fa20
movq -0x88(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq 0x3af39(%rip), %rdx     # 0x99485
callq 0x27d00
jmp 0x5e58f
movq 0x51a96(%rip), %rax     # 0xafff0
movq (%rax), %rsi
movq -0x20(%rbp), %rcx
movl -0xbc(%rbp), %r8d
movl -0xc0(%rbp), %r9d
movq -0x90(%rbp), %rax
leaq 0x294b1(%rip), %rdi     # 0x87a2e
leaq 0x376b0(%rip), %rdx     # 0x95c34
movq %rax, (%rsp)
movb $0x0, %al
callq 0x3fa20
movl -0x34(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x34(%rbp)
movl $0x1, -0x38(%rbp)
jmp 0x5e3a9
cmpl $0x0, -0x38(%rbp)
je 0x5e5af
jmp 0x5e6d0
movq -0x30(%rbp), %rdi
callq 0x4fd10
movl %eax, %ecx
movq %rcx, -0x110(%rbp)
subl $0x3, %eax
ja 0x5e6cb
movq -0x110(%rbp), %rax
leaq 0x37634(%rip), %rcx     # 0x95c0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, -0x38(%rbp)
jmp 0x5e6cb
movq -0x30(%rbp), %rdi
callq 0x4fda0
movq %rax, -0xc8(%rbp)
movl -0x34(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x34(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x64a70
movq %rax, %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x7b550
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movl %eax, -0xd4(%rbp)
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rax
movl %eax, -0xd8(%rbp)
movq 0x51997(%rip), %rax     # 0xafff0
movq (%rax), %rsi
movq -0x20(%rbp), %rcx
movl -0xd4(%rbp), %r8d
movl -0xd8(%rbp), %r9d
movq -0xc8(%rbp), %rax
leaq 0x293b2(%rip), %rdi     # 0x87a2e
leaq 0x375ce(%rip), %rdx     # 0x95c51
movq %rax, (%rsp)
movb $0x0, %al
callq 0x3fa20
movl $0x1, -0x38(%rbp)
jmp 0x5e6cb
movl -0x3c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x5e6aa
movq -0x30(%rbp), %rdi
callq 0x4fad0
jmp 0x5e6c9
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x3c(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %esi
callq 0x4f990
jmp 0x5e6cb
jmp 0x5e395
movq -0x30(%rbp), %rdi
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
callq 0x7b610
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rdi
callq 0x3a2c0
cmpq $0x0, -0x58(%rbp)
je 0x5e723
movq -0x58(%rbp), %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x7b550
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rdi
callq 0x3a2c0
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
cmpl $0x0, 0x18(%rax)
jne 0x5e7a6
cmpq $0x0, -0x50(%rbp)
je 0x5e766
movq -0x50(%rbp), %rdi
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
callq 0x7b610
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rdi
callq 0x39200
callq 0x2eba0
cmpq $0x0, -0x50(%rbp)
je 0x5e7a4
movq -0x50(%rbp), %rdi
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
callq 0x7b610
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x3a2c0
movq -0x50(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x5e7a6
cmpq $0x0, -0x28(%rbp)
je 0x5e7b8
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movl -0x34(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)