// File: /workspace/github_cpp_makefile_star2_O2/pranavmodx[P]modlang/repl.cpp
// Function: REPL()
void REPL()
{
	const std::string PROMPT = ">> ";

	Lexer lexer;
	Parser parser;
	Evaluator evaluator;

	Environment *env = new Environment();

	std::string line;

	while (true)
	{
		std::cout << PROMPT;

		std::getline(std::cin, line);

		if (line.empty())
			continue;

		lexer.New(line);
		parser.New(lexer);

		Program *program = parser.ParseProgram();

		if (parser.Errors().size())
			for (std::string error : parser.Errors())
				std::cout << error << std::endl;

		else {
			Object *obj = evaluator.Eval(program, env);
			if (obj != __NULL)
				std::cout << obj->inspect() << std::endl;
		}

		parser.resetErrors();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
leaq 0x12592(%rip), %rsi     # 0x1c0e6
leaq 0x98(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0x9da4
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xb8(%rsp), %rdi
callq 0xddf0
pushq $0x40
popq %rdi
callq 0x51d0
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, (%rax)
movq $0x1, 0x8(%rax)
movups %xmm0, 0x10(%rax)
movl $0x3f800000, 0x20(%rax) # imm = 0x3F800000
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movq %rax, 0x8(%rsp)
movups %xmm0, 0x28(%rax)
movb $0x0, (%rcx)
movq 0x203f0(%rip), %r14     # 0x29fc8
leaq 0x48(%rsp), %r13
leaq 0x68(%rsp), %rbx
leaq 0x28(%rsp), %r15
movq %r14, %rdi
leaq 0x98(%rsp), %rsi
callq 0x51b0
movq 0x203e2(%rip), %rdi     # 0x29fe0
movq %r13, %rsi
callq 0x5070
cmpq $0x0, 0x50(%rsp)
je 0x9be7
movq %rbx, %rdi
movq %r13, %rsi
callq 0xab66
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
callq 0xe18c
leaq 0xb8(%rsp), %rdi
callq 0xf9ae
movq %rax, %r12
movq %r15, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x1010e
movq %r13, %rbx
movq 0x30(%rsp), %rbp
movq 0x28(%rsp), %r13
movq %r15, %rdi
callq 0x9de0
cmpq %r13, %rbp
je 0x9cc4
leaq 0x10(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x1010e
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rbp
movq %rbx, %r13
leaq 0x68(%rsp), %rbx
cmpq %rbp, %r12
je 0x9cb8
movq %r15, %rdi
movq %r12, %rsi
callq 0x5260
movq %r14, %rdi
movq %r15, %rsi
callq 0x51b0
movq %rax, %rdi
callq 0x5100
movq %r15, %rdi
callq 0x5388
addq $0x20, %r12
jmp 0x9c87
leaq 0x10(%rsp), %rdi
callq 0x9de0
jmp 0x9d11
leaq 0x7(%rsp), %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
callq 0x15ad8
leaq 0x2281b(%rip), %rcx     # 0x2c4f8
cmpq (%rcx), %rax
movq %rbx, %r13
leaq 0x68(%rsp), %rbx
je 0x9d11
movq (%rax), %rcx
movq %r15, %rdi
movq %rax, %rsi
callq *0x8(%rcx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x51b0
movq %rax, %rdi
callq 0x5100
movq %r15, %rdi
callq 0x5388
leaq 0xb8(%rsp), %rdi
callq 0x10124
jmp 0x9be7
jmp 0x9d3c
jmp 0x9d3c
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5388
jmp 0x9d5d
jmp 0x9d3c
jmp 0x9d3c
jmp 0x9d3c
movq %rax, %rbx
jmp 0x9d5d
movq %rax, %rbx
jmp 0x9d53
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5388
leaq 0x10(%rsp), %rdi
callq 0x9de0
leaq 0x48(%rsp), %rdi
callq 0x5388
jmp 0x9d6c
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x9e02
jmp 0x9d7e
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x5388
leaq 0x98(%rsp), %rdi
callq 0x5388
movq %rbx, %rdi
callq 0x5330