// File: /workspace/github_cpp_makefile_star2_O3/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 0x4a0d(%rip), %rdi      # 0x13ea5
callq 0x2340
leaq 0x4a13(%rip), %rdi      # 0x13eb7
callq 0x2340
movq 0x9b38(%rip), %rsi      # 0x18fe8
movl $0x9, %edi
callq 0x20e0
leaq -0xb8(%rbp), %rax
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq -0x3b8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x1b0(%rbp), %rcx
movl $0x1, %edx
callq 0x10286
leaq -0xc0(%rbp), %rdi
callq 0x3670
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 -0x2c8(%rbp), %r15
leaq -0x2a0(%rbp), %r14
leaq -0x270(%rbp), %rbx
movq 0x9a5e(%rip), %r13      # 0x18fc8
leaq 0x492e(%rip), %rdi      # 0x13e9f
callq 0x2200
leaq -0x100(%rbp), %rdi
movq %rax, %rsi
leaq -0xc0(%rbp), %rdx
callq 0x10040
cmpq $0x0, -0xf8(%rbp)
je 0xf5ab
movq -0x100(%rbp), %rdi
callq 0x22e0
movq -0xf8(%rbp), %rdx
jmp 0xf5ad
xorl %edx, %edx
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x100(%rbp), %rsi
addq %rsi, %rdx
leaq -0xe0(%rbp), %r12
movq %r12, %rdi
callq 0x3688
movq %r12, %rdi
leaq 0x48bf(%rip), %rsi      # 0x13e9d
callq 0x23e0
leaq -0x2e8(%rbp), %rdi
movq %r12, %rsi
callq 0x10438
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xf614
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x3d0(%rbp), %r12
movq %r12, %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x1007e
leaq -0x1b0(%rbp), %rdi
movq %r12, %rsi
callq 0x11069
movq %r12, %rdi
callq 0x10218
cmpb $0x1, -0x198(%rbp)
jne 0xf6c8
leaq -0xc0(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x3db0
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq %r13, %rdi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xfa73
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0xfa73
leaq -0xc0(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0xdfe8
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 0x3688
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 0x3688
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 0x4c74
movl -0x220(%rbp), %eax
movl %eax, -0x2d0(%rbp)
movq %r15, %rdi
leaq -0x218(%rbp), %rsi
callq 0xdfe8
movq %r14, -0x2b0(%rbp)
movq -0x200(%rbp), %rsi
movq -0x1f8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x2b0(%rbp), %rdi
callq 0x3688
movq -0x1e0(%rbp), %rax
movq %rax, -0x290(%rbp)
movl -0x1d8(%rbp), %eax
movl %eax, -0x288(%rbp)
movq %rbx, -0x280(%rbp)
movq -0x1d0(%rbp), %rsi
movq -0x1c8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x280(%rbp), %rdi
callq 0x3688
leaq -0x260(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
leaq -0x2d0(%rbp), %rdx
callq 0x5874
movq -0x280(%rbp), %rdi
cmpq %rbx, %rdi
je 0xf816
movq -0x270(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x2b0(%rbp), %rdi
cmpq %r14, %rdi
je 0xf831
movq -0x2a0(%rbp), %rsi
incq %rsi
callq 0x2240
movq %r15, %rdi
callq 0xe08a
cmpb $0x1, -0x2f0(%rbp)
jne 0xf8b5
leaq -0x48(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x4b70
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r13, %rdi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xf8a5
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2240
movb $0x1, -0x4c(%rbp)
movb $0x0, -0x2f0(%rbp)
jmp 0xf9a4
movl $0x2, %edx
movq %r13, %rdi
leaq 0x45de(%rip), %rsi      # 0x13ea2
callq 0x2290
movl -0x260(%rbp), %eax
movl %eax, -0x140(%rbp)
leaq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x258(%rbp), %rsi
movq -0x250(%rbp), %rdx
addq %rsi, %rdx
leaq -0x138(%rbp), %rdi
callq 0x3688
leaq -0x118(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x2e02
leaq -0x48(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x11d89
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r13, %rdi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xf976
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 0xf9a4
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x238(%rbp), %rdi
callq 0x2c20
movq -0x258(%rbp), %rdi
leaq -0x248(%rbp), %rax
cmpq %rax, %rdi
je 0xf9d2
movq -0x248(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x1d0(%rbp), %rdi
leaq -0x1c0(%rbp), %rax
cmpq %rax, %rdi
je 0xf9f4
movq -0x1c0(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0xfa16
movq -0x1f0(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x218(%rbp), %rdi
callq 0xe08a
cmpb $0x0, -0x4c(%rbp)
je 0xf751
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xfa45
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xfa67
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0xc0(%rbp), %rdi
callq 0xe08a
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0xfa95
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0xfab7
movq -0x180(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x1b0(%rbp), %rdi
callq 0xe08a
leaq -0x2e8(%rbp), %rdi
callq 0x10218
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xf56a
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0xf56a
movq %rax, %r12
jmp 0xfd15
movq %rax, %r12
jmp 0xfd37
jmp 0xfb0c
movq %rax, %r12
jmp 0xfd43
jmp 0xfb62
movq %rax, %r12
leaq -0x3d0(%rbp), %rdi
callq 0x10218
jmp 0xfd93
movq %rax, %r12
jmp 0xfd93
jmp 0xfb34
movq %rax, %r12
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xfd9f
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0xfd9f
movq %rax, %r12
jmp 0xfd9f
jmp 0xfb6c
movq %rax, %r12
jmp 0xfdc1
movq %rax, %r12
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xfd43
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2240
jmp 0xfd43
jmp 0xfbb6
movq %rax, %r12
jmp 0xfc3a
jmp 0xfbb6
movq %rax, %r12
jmp 0xfc46
movq %rax, %r12
jmp 0xfc7e
movq %rax, %r12
jmp 0xfcfc
movq %rax, %r12
jmp 0xfcac
movq %rax, %r12
jmp 0xfc11
movq %rax, %r12
jmp 0xfbf6
movq %rax, %r12
movq -0x280(%rbp), %rdi
cmpq %rbx, %rdi
je 0xfbf6
movq -0x270(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x2b0(%rbp), %rdi
cmpq %r14, %rdi
je 0xfc11
movq -0x2a0(%rbp), %rsi
incq %rsi
callq 0x2240
movq %r15, %rdi
callq 0xe08a
jmp 0xfcac
movq %rax, %r12
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xfc3a
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 0xfc7e
movq -0x128(%rbp), %rsi
jmp 0xfc76
movq %rax, %r12
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xfc7e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x238(%rbp), %rdi
callq 0x2c20
movq -0x258(%rbp), %rdi
leaq -0x248(%rbp), %rax
cmpq %rax, %rdi
je 0xfcac
movq -0x248(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x1d0(%rbp), %rdi
leaq -0x1c0(%rbp), %rax
cmpq %rax, %rdi
je 0xfcce
movq -0x1c0(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0xfcf0
movq -0x1f0(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x218(%rbp), %rdi
callq 0xe08a
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xfd15
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xfd37
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0xc0(%rbp), %rdi
callq 0xe08a
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0xfd65
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0xfd87
movq -0x180(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x1b0(%rbp), %rdi
callq 0xe08a
leaq -0x2e8(%rbp), %rdi
callq 0x10218
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xfdc1
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x318(%rbp), %rdi
leaq -0x308(%rbp), %rax
cmpq %rax, %rdi
je 0xfde3
movq -0x308(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x348(%rbp), %rdi
leaq -0x338(%rbp), %rax
cmpq %rax, %rdi
je 0xfe05
movq -0x338(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x370(%rbp), %rdi
leaq -0x360(%rbp), %rax
cmpq %rax, %rdi
je 0xfe27
movq -0x360(%rbp), %rsi
incq %rsi
callq 0x2240
movq -0x398(%rbp), %rdi
leaq -0x388(%rbp), %rax
cmpq %rax, %rdi
je 0xfe49
movq -0x388(%rbp), %rsi
incq %rsi
callq 0x2240
leaq -0x3b8(%rbp), %rdi
callq 0x103e2
jmp 0xfe66
movq %rax, %r12
leaq -0xc0(%rbp), %rdi
callq 0x3670
movq %r12, %rdi
callq 0x23a0