// File: /workspace/github_cpp_makefile_star2_O2/Mespyr[P]bop-lisp/src/main.cpp
// Function: evalString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int evalString(std::string code) 
{
    TokenList tokens = tokenize(code);
    AST ast = parse(tokens);

    if (ast.error_found) 
    {
        std::cout << ast.error.error() << std::endl;
        return 1;
    }
    AST_Handler ast_buf{ast};
    Evaluator eval;

    while (!ast_buf.eof) 
    {
        Node node = ast_buf.next();
        // ast_out(node.nodes);
        eval.evaluate(node);
        if (eval.error_found) 
        {
            std::cout << eval.error.error() << std::endl;
            ast_buf.eof = true;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
movq %rdi, %rsi
leaq -0x78(%rbp), %rbx
movq %rbx, %rdi
callq 0x22d0
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0xb248
leaq -0x78(%rbp), %rdi
callq 0x2130
leaq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xada2
leaq -0x180(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xba71
leaq -0x40(%rbp), %rdi
callq 0xaf54
cmpb $0x1, -0x168(%rbp)
jne 0xa700
leaq -0x160(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x3924
movq 0x88f0(%rip), %rdi      # 0x12fc8
leaq -0x250(%rbp), %rsi
callq 0x21e0
movq %rax, %rdi
callq 0x2140
leaq -0x250(%rbp), %rdi
callq 0x2130
pushq $0x1
popq %rbx
jmp 0xa7ee
leaq -0xf0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0xacfa
andl $0x0, -0x80(%rbp)
movb $0x0, -0x7c(%rbp)
leaq -0x250(%rbp), %rdi
callq 0xad3c
leaq -0x330(%rbp), %r14
leaq -0x2c0(%rbp), %r12
leaq -0x370(%rbp), %r13
leaq -0x250(%rbp), %rbx
leaq -0x110(%rbp), %r15
cmpb $0x0, -0x7c(%rbp)
jne 0xa7d4
movq %r14, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x3ffc
movq %r12, %rdi
movq %r14, %rsi
callq 0x97f0
movq %r13, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x460c
movq %r13, %rdi
callq 0x2a66
movq %r12, %rdi
callq 0x99c0
cmpb $0x1, -0x188(%rbp)
jne 0xa7c7
movq %r15, %rdi
leaq -0x238(%rbp), %rsi
callq 0x3e36
movq 0x881d(%rip), %rdi      # 0x12fc8
movq %r15, %rsi
callq 0x21e0
movq %rax, %rdi
callq 0x2140
movq %r15, %rdi
callq 0x2130
movb $0x1, -0x7c(%rbp)
movq %r14, %rdi
callq 0x99c0
jmp 0xa74a
leaq -0x250(%rbp), %rdi
callq 0xad62
leaq -0xf0(%rbp), %rdi
callq 0xad82
xorl %ebx, %ebx
leaq -0x180(%rbp), %rdi
callq 0xad82
leaq -0x58(%rbp), %rdi
callq 0xaf54
movl %ebx, %eax
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xa89f
jmp 0xa821
movq %rax, %rbx
jmp 0xa8ab
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
callq 0x2130
jmp 0xa8ab
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xaf54
jmp 0xa8b7
movq %rax, %rbx
jmp 0xa8b7
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x2130
jmp 0xa8c0
jmp 0xa85d
movq %rax, %rbx
jmp 0xa882
movq %rax, %rbx
leaq -0x2c0(%rbp), %rdi
callq 0x99c0
jmp 0xa882
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x2130
leaq -0x330(%rbp), %rdi
callq 0x99c0
jmp 0xa893
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
callq 0xad62
leaq -0xf0(%rbp), %rdi
callq 0xad82
leaq -0x180(%rbp), %rdi
callq 0xad82
leaq -0x58(%rbp), %rdi
callq 0xaf54
movq %rbx, %rdi
callq 0x2380