// File: /workspace/github_cpp_makefile_star2_O1/Mespyr[P]bop-lisp/src/main.cpp
// Function: REPL()
void REPL()
{  
    printf("Bop Version 1.0.0\n");
    printf("Press 'Ctrl+C' to exit.\n");

    rl_bind_key('\t', rl_insert);
    
    // Global Evaluator
    Evaluator eval;
    
    while (true) 
    {
        std::string buf = readline("$ ");
        if (buf.length() > 0) 
        {
            add_history(buf.c_str());
        }
        TokenList tokens = tokenize(buf+" ");
        AST ast = parse(tokens);

        if (ast.error_found) 
        {
            std::cout << ast.error.error() << std::endl;
            continue;
        }
        AST_Handler ast_buf{ast};

        while (!ast_buf.eof) 
        {
            Node node = ast_buf.next();
            // ast_out(node.nodes);
            object obj = eval.evaluate(node);
            if (eval.error_found) 
            {
                std::cout << eval.error.error() << std::endl;
                ast_buf.eof = true;
                eval.error_found = false;
            }
            else 
            {
                std::cout << "> " << repr(obj) << std::endl;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a8, %rsp            # imm = 0x3A8
leaq 0x49c9(%rip), %rdi      # 0x13ea5
callq 0x2340
leaq 0x49cf(%rip), %rdi      # 0x13eb7
callq 0x2340
movq 0x9af4(%rip), %rsi      # 0x18fe8
movl $0x9, %edi
callq 0x20e0
leaq -0xb8(%rbp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x8(%rax)
movaps %xmm0, 0x18(%rax)
movaps %xmm0, -0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq $0x0, 0x20(%rax)
leaq -0x3b8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x1b0(%rbp), %rcx
movl $0x1, %edx
callq 0x102c8
leaq -0xc0(%rbp), %rdi
callq 0x3666
leaq -0x388(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x360(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x338(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x308(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movb %al, 0x18(%rcx)
leaq -0x288(%rbp), %r14
leaq -0x260(%rbp), %rbx
leaq -0x230(%rbp), %r13
movq 0x9a14(%rip), %r12      # 0x18fc8
leaq 0x48e4(%rip), %rdi      # 0x13e9f
callq 0x2200
leaq -0x100(%rbp), %rdi
movq %rax, %rsi
leaq -0xc0(%rbp), %rdx
callq 0x10086
cmpq $0x0, -0xf8(%rbp)
je 0xf5ec
movq -0x100(%rbp), %rdi
callq 0x22e0
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
leaq -0xe0(%rbp), %r15
movq %r15, %rdi
callq 0x367e
movq %r15, %rdi
leaq 0x4879(%rip), %rsi      # 0x13e9d
callq 0x23e0
leaq -0x2e8(%rbp), %rdi
movq %r15, %rsi
callq 0x10474
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xf65a
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x3d0(%rbp), %r15
movq %r15, %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x100c4
leaq -0x1b0(%rbp), %rdi
movq %r15, %rsi
callq 0x11040
movq %r15, %rdi
callq 0x1025e
cmpb $0x1, -0x198(%rbp)
jne 0xf70e
leaq -0xc0(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x3db0
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq %r12, %rdi
callq 0x2290
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xfab9
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0xfab9
leaq -0xc0(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0xe02a
movb -0x198(%rbp), %al
movb %al, -0xa8(%rbp)
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x190(%rbp), %rsi
movq -0x188(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa0(%rbp), %rdi
callq 0x367e
movl -0x170(%rbp), %eax
movl %eax, -0x80(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x168(%rbp), %rsi
movq -0x160(%rbp), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rdi
callq 0x367e
movb -0x148(%rbp), %al
movb %al, -0x58(%rbp)
movl $0x0, -0x50(%rbp)
movb $0x0, -0x4c(%rbp)
leaq -0x220(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x4c94
movl -0x220(%rbp), %eax
movl %eax, -0x290(%rbp)
movq %r14, %rdi
leaq -0x218(%rbp), %rsi
callq 0xe02a
movq %rbx, -0x270(%rbp)
movq -0x200(%rbp), %rsi
movq -0x1f8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x270(%rbp), %rdi
callq 0x367e
movq -0x1e0(%rbp), %rax
movq %rax, -0x250(%rbp)
movl -0x1d8(%rbp), %eax
movl %eax, -0x248(%rbp)
movq %r13, -0x240(%rbp)
movq -0x1d0(%rbp), %rsi
movq -0x1c8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x240(%rbp), %rdi
callq 0x367e
leaq -0x2d0(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
leaq -0x290(%rbp), %rdx
callq 0x5894
movq -0x240(%rbp), %rdi
cmpq %r13, %rdi
je 0xf85c
movq -0x230(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x270(%rbp), %rdi
cmpq %rbx, %rdi
je 0xf877
movq -0x260(%rbp), %rsi
incq %rsi
callq 0x2240
movq %r14, %rdi
callq 0xe0cc
cmpb $0x1, -0x2f0(%rbp)
jne 0xf8fb
leaq -0x48(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x4b8e
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r12, %rdi
callq 0x2290
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xf8eb
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2240
movb $0x1, -0x4c(%rbp)
movb $0x0, -0x2f0(%rbp)
jmp 0xf9ea
movl $0x2, %edx
movq %r12, %rdi
leaq 0x4598(%rip), %rsi      # 0x13ea2
callq 0x2290
movl -0x2d0(%rbp), %eax
movl %eax, -0x140(%rbp)
leaq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x2c8(%rbp), %rsi
movq -0x2c0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x138(%rbp), %rdi
callq 0x367e
leaq -0x118(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x2e00
leaq -0x48(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x11d8d
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r12, %rdi
callq 0x2290
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xf9bc
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x118(%rbp), %rdi
callq 0x2c20
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xf9ea
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x2a8(%rbp), %rdi
callq 0x2c20
movq -0x2c8(%rbp), %rdi
leaq -0x2b8(%rbp), %rax
cmpq %rax, %rdi
je 0xfa18
movq -0x2b8(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x1d0(%rbp), %rdi
leaq -0x1c0(%rbp), %rax
cmpq %rax, %rdi
je 0xfa3a
movq -0x1c0(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0xfa5c
movq -0x1f0(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x218(%rbp), %rdi
callq 0xe0cc
cmpb $0x0, -0x4c(%rbp)
je 0xf797
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xfa8b
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xfaad
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0xc0(%rbp), %rdi
callq 0xe0cc
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0xfadb
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0xfafd
movq -0x180(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x1b0(%rbp), %rdi
callq 0xe0cc
leaq -0x2e8(%rbp), %rdi
callq 0x1025e
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xf5b4
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0xf5b4
movq %rax, %r15
jmp 0xfd5b
movq %rax, %r15
jmp 0xfd7d
jmp 0xfb52
movq %rax, %r15
jmp 0xfd89
jmp 0xfba8
movq %rax, %r15
leaq -0x3d0(%rbp), %rdi
callq 0x1025e
jmp 0xfdd9
movq %rax, %r15
jmp 0xfdd9
jmp 0xfb7a
movq %rax, %r15
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xfde5
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0xfde5
movq %rax, %r15
jmp 0xfde5
jmp 0xfbb2
movq %rax, %r15
jmp 0xfe07
movq %rax, %r15
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xfd89
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0xfd89
jmp 0xfbfc
movq %rax, %r15
jmp 0xfc80
jmp 0xfbfc
movq %rax, %r15
jmp 0xfc8c
movq %rax, %r15
jmp 0xfcc4
movq %rax, %r15
jmp 0xfd42
movq %rax, %r15
jmp 0xfcf2
movq %rax, %r15
jmp 0xfc57
movq %rax, %r15
jmp 0xfc3c
movq %rax, %r15
movq -0x240(%rbp), %rdi
cmpq %r13, %rdi
je 0xfc3c
movq -0x230(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x270(%rbp), %rdi
cmpq %rbx, %rdi
je 0xfc57
movq -0x260(%rbp), %rsi
incq %rsi
callq 0x2240
movq %r14, %rdi
callq 0xe0cc
jmp 0xfcf2
movq %rax, %r15
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xfc80
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x118(%rbp), %rdi
callq 0x2c20
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xfcc4
movq -0x128(%rbp), %rsi
jmp 0xfcbc
movq %rax, %r15
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xfcc4
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x2a8(%rbp), %r14
movq %r14, %rdi
callq 0x2c20
movq -0x20(%r14), %rdi
leaq -0x2b8(%rbp), %rax
cmpq %rax, %rdi
je 0xfcf2
movq -0x2b8(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x1d0(%rbp), %rdi
leaq -0x1c0(%rbp), %rax
cmpq %rax, %rdi
je 0xfd14
movq -0x1c0(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0xfd36
movq -0x1f0(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x218(%rbp), %rdi
callq 0xe0cc
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xfd5b
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xfd7d
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0xc0(%rbp), %rdi
callq 0xe0cc
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0xfdab
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0xfdcd
movq -0x180(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x1b0(%rbp), %rdi
callq 0xe0cc
leaq -0x2e8(%rbp), %rdi
callq 0x1025e
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xfe07
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x318(%rbp), %rdi
leaq -0x308(%rbp), %rax
cmpq %rax, %rdi
je 0xfe29
movq -0x308(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x348(%rbp), %rdi
leaq -0x338(%rbp), %rax
cmpq %rax, %rdi
je 0xfe4b
movq -0x338(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x370(%rbp), %rdi
leaq -0x360(%rbp), %rax
cmpq %rax, %rdi
je 0xfe6d
movq -0x360(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x398(%rbp), %rdi
leaq -0x388(%rbp), %rax
cmpq %rax, %rdi
je 0xfe8f
movq -0x388(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x3b8(%rbp), %rdi
callq 0x10424
jmp 0xfeac
movq %rax, %r15
leaq -0xc0(%rbp), %rdi
callq 0x3666
movq %r15, %rdi
callq 0x23a0