// File: andrakis[P]alisp/repl.cpp
// Function: ALisp::REPL::REPL(ALisp::Cell)
void REPL(Cell env) {
			State state;
			Eval::EvalType evaluator = Eval::Simple::eval;
			ListType history;
			last_env = env.env();

			check_linenoise();

			invokeCommand("help", state);
			while (state.exit == false) {
				const char *prompt = state.prompt.c_str();
				if (state.continuation)
					prompt = state.prompt_continuation.c_str();
				char *line_result = linenoise(prompt);
				if (line_result == NULL)
					break;

				StringType line(line_result);
				// No longer need string allocated
				free(line_result);

				if (state.continuation) {
					line = state.continued_line + line;
					state.continuation = false;
				}
				// Check if line is a repl command
				Command *cmd = getCommand(line);
				if (cmd != nullptr) {
					cmd->modifier(state);
					continue;
				}

				// Attempt to parse
				Cell read;
				try {
					read = Parser::read(line);
				} catch (ParserException const &pe) {
					state.continuation = true;
					state.continued_line = line;
					continue;
				}

				// Parsed successfully, save and execute
				linenoiseHistoryAdd(line.c_str());

				// Execute
				try {
					Cell result = evaluator(read, env);
					history.push_back(result);
					std::cout << result.repr() << std::endl;
				} catch (KeyNotFoundException &e) {
					std::cerr << "Key not found: " << e.what() << std::endl;
				} catch (Exception &e) {
					std::cerr << "Exception: " << e.what() << std::endl;
				}
			}

			last_env.reset();
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x1b8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x30ea0
leaq -0x9566(%rip), %rax     # 0x27080
movq %rax, -0x78(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xc080
movq -0x1b8(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0xb9f0
jmp 0x3060b
leaq 0x2769e(%rip), %rdi     # 0x57cb0
leaq -0xa0(%rbp), %rsi
movq %rsi, -0x1c0(%rbp)
callq 0x30f80
movq -0x1c0(%rbp), %rdi
callq 0xb8e0
callq 0x30550
jmp 0x30638
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x87d0
movq -0x1c8(%rbp), %rdx
leaq 0xbc75(%rip), %rsi      # 0x3c2ce
leaq -0xd0(%rbp), %rdi
callq 0x8610
jmp 0x30667
leaq -0xd0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x301a0
jmp 0x30679
leaq -0xd0(%rbp), %rdi
callq 0x8878
leaq -0xd1(%rbp), %rdi
callq 0x8490
movb -0x70(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x30c40
leaq -0x70(%rbp), %rdi
addq $0x8, %rdi
callq 0x81e0
movq %rax, -0xe0(%rbp)
testb $0x1, -0x6f(%rbp)
je 0x3072c
leaq -0x70(%rbp), %rdi
addq $0x28, %rdi
callq 0x81e0
movq %rax, -0xe0(%rbp)
jmp 0x3072c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x30c6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x3071b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x8878
leaq -0xd1(%rbp), %rdi
callq 0x8490
jmp 0x30c6a
movq -0xe0(%rbp), %rdi
callq 0x224f0
movq %rax, -0x1d0(%rbp)
jmp 0x30741
movq -0x1d0(%rbp), %rax
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0xe8(%rbp)
jne 0x3075e
jmp 0x30c40
movq -0xe8(%rbp), %rax
movq %rax, -0x1e0(%rbp)
leaq -0x109(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0x87d0
movq -0x1e0(%rbp), %rsi
movq -0x1d8(%rbp), %rdx
leaq -0x108(%rbp), %rdi
callq 0x8610
jmp 0x3079b
leaq -0x109(%rbp), %rdi
callq 0x8490
movq -0xe8(%rbp), %rdi
callq 0x8510
testb $0x1, -0x6f(%rbp)
je 0x30831
leaq -0x28(%rbp), %rsi
leaq -0x130(%rbp), %rdi
leaq -0x108(%rbp), %rdx
callq 0x30fb0
jmp 0x307d2
leaq -0x108(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x8530
leaq -0x130(%rbp), %rdi
callq 0x8878
movb $0x0, -0x6f(%rbp)
jmp 0x30831
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x109(%rbp), %rdi
callq 0x8490
jmp 0x30c6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x30c32
leaq -0x158(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x8200
jmp 0x30846
leaq -0x158(%rbp), %rdi
callq 0x30130
movq %rax, -0x1e8(%rbp)
jmp 0x3085b
leaq -0x158(%rbp), %rdi
callq 0x8878
movq -0x1e8(%rbp), %rax
movq %rax, -0x138(%rbp)
cmpq $0x0, -0x138(%rbp)
je 0x308c4
movq -0x138(%rbp), %rax
movq 0x20(%rax), %rax
leaq -0x70(%rbp), %rdi
callq *%rax
jmp 0x30892
movl $0x2, -0x15c(%rbp)
jmp 0x30b43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x8878
jmp 0x30c32
leaq -0x168(%rbp), %rdi
callq 0xce00
leaq -0x170(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x2d200
jmp 0x308e5
leaq -0x168(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x13810
leaq -0x170(%rbp), %rdi
callq 0xb9d0
jmp 0x309a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x30c26
movq -0xa8(%rbp), %rdi
callq 0x81d0
movq %rax, -0x178(%rbp)
movb $0x1, -0x6f(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x8060
jmp 0x30957
movl $0x2, -0x15c(%rbp)
callq 0x8730
jmp 0x30981
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
callq 0x8730
jmp 0x3099d
jmp 0x30b37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x30c26
jmp 0x30c26
leaq -0x108(%rbp), %rdi
callq 0x81e0
movq %rax, %rdi
callq 0x22000
jmp 0x309b8
movq -0x1b8(%rbp), %rdx
movq -0x78(%rbp), %rax
leaq -0x180(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq *%rax
jmp 0x309d5
leaq -0x90(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x14d00
jmp 0x309ea
leaq -0x1a0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x136b0
jmp 0x309ff
movq 0x265c2(%rip), %rdi     # 0x56fc8
leaq -0x1a0(%rbp), %rsi
callq 0x8390
movq %rax, -0x1f0(%rbp)
jmp 0x30a1b
movq -0x1f0(%rbp), %rdi
movq 0x26567(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x30a30
leaq -0x1a0(%rbp), %rdi
callq 0x8878
leaq -0x180(%rbp), %rdi
callq 0xb9d0
jmp 0x30b2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x30a9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x30a93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x8878
leaq -0x180(%rbp), %rdi
callq 0xb9d0
movl -0xac(%rbp), %eax
movl %eax, -0x1f4(%rbp)
movl $0x3, %ecx
cmpl %ecx, %eax
jne 0x30b65
movq -0xa8(%rbp), %rdi
callq 0x81d0
movq %rax, -0x1b0(%rbp)
movq 0x2651e(%rip), %rdi     # 0x56ff0
leaq 0xcddc(%rip), %rsi      # 0x3d8b5
callq 0x83e0
movq %rax, -0x200(%rbp)
jmp 0x30ae7
movq -0x1b0(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x200(%rbp), %rdi
movq %rax, %rsi
callq 0x83e0
movq %rax, -0x208(%rbp)
jmp 0x30b0f
movq -0x208(%rbp), %rdi
movq 0x26473(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x30b24
callq 0x8730
jmp 0x30b2b
jmp 0x30b2d
movl $0x0, -0x15c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0xb9d0
leaq -0x108(%rbp), %rdi
callq 0x8878
movl -0x15c(%rbp), %eax
testl %eax, %eax
je 0x30b60
jmp 0x30b5b
jmp 0x30691
jmp 0x30691
movl -0x1f4(%rbp), %eax
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x30c26
movq -0xa8(%rbp), %rdi
callq 0x81d0
movq %rax, -0x1a8(%rbp)
movq 0x2645e(%rip), %rdi     # 0x56ff0
leaq 0xb713(%rip), %rsi      # 0x3c2ac
callq 0x83e0
movq %rax, -0x210(%rbp)
jmp 0x30ba7
movq -0x1a8(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x210(%rbp), %rdi
movq %rax, %rsi
callq 0x83e0
movq %rax, -0x218(%rbp)
jmp 0x30bcf
movq -0x218(%rbp), %rdi
movq 0x263b3(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x30be4
callq 0x8730
jmp 0x30beb
jmp 0x30b2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
callq 0x8730
jmp 0x30c09
jmp 0x30c26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
callq 0x8730
jmp 0x30c24
jmp 0x30c26
leaq -0x168(%rbp), %rdi
callq 0xb9d0
leaq -0x108(%rbp), %rdi
callq 0x8878
jmp 0x30c6a
leaq 0x27069(%rip), %rdi     # 0x57cb0
callq 0x31030
leaq -0x90(%rbp), %rdi
callq 0xc130
leaq -0x70(%rbp), %rdi
callq 0x31070
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
leaq -0x90(%rbp), %rdi
callq 0xc130
leaq -0x70(%rbp), %rdi
callq 0x31070
movq -0xa8(%rbp), %rdi
callq 0x87b0
movq %rax, %rdi
callq 0xc050
nopw %cs:(%rax,%rax)
nopl (%rax)