// File: /workspace/github_cpp_makefile_star2_O2/andrakis[P]alisp/repl.cpp
// Function: ALisp::REPL::completion_hook(char const*, linenoiseCompletions*)
void completion_hook(char const *prefix, linenoiseCompletions *lc) {
			size_t len = strlen(prefix);
			
			// Add builtins
			for(size_t i = 0; builtins[i] != NULL; ++i) {
				if (!strncmp(builtins[i], prefix, len))
					linenoiseAddCompletion(lc, builtins[i]);
			}

			// Add REPL commands
			for (auto it = &replCommands[0]; it->valid(); ++it) {
				if (!strncmp(it->command.c_str(), prefix, len))
					linenoiseAddCompletion(lc, it->command.c_str());
			}

			// Add environment atoms.
			// These require a reference to the current environment
			if (auto env = last_env.lock()) {
				auto e = env;
				for (;;) {
					for (auto it = e->cbegin(); it != e->cend(); ++it) {
						Cell atom = Atoms::Get(it->first);
						if (!strncmp(atom.str().c_str(), prefix, len)) {
							// Got a partial match
							linenoiseAddCompletion(lc, atom.str().c_str());
						}
					}
					if (!e->has_parent())
						break;
					e = e->get_parent();
				}
			}
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
callq 0x7170
movq %rax, %r15
leaq 0x154ba(%rip), %rbx     # 0x2b6c0
movq (%rbx), %r12
testq %r12, %r12
je 0x16233
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x7190
testl %eax, %eax
jne 0x1622d
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x110a7
addq $0x8, %rbx
jmp 0x16206
leaq 0x15876(%rip), %rbx     # 0x2bab0
cmpq $0x0, (%rbx)
je 0x16269
movq -0x20(%rbx), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x7190
testl %eax, %eax
jne 0x16263
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x110a7
addq $0x28, %rbx
jmp 0x1623a
leaq 0x15910(%rip), %rsi     # 0x2bb80
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x1692a
cmpq $0x0, (%r12)
je 0x1635b
leaq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x9dd0
leaq 0x38(%rsp), %rbp
leaq 0x10(%rsp), %r12
movq 0x18(%rsp), %rbx
addq $0x10, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x1631d
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0xc7c4
movq %rbp, %rdi
movq %r12, %rsi
callq 0x975c
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x7190
movl %eax, %r13d
movq %rbp, %rdi
callq 0x7688
testl %r13d, %r13d
jne 0x1630b
movq %rbp, %rdi
movq %r12, %rsi
callq 0x975c
movq 0x38(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x110a7
movq %rbp, %rdi
callq 0x7688
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x162aa
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x162aa
movq 0x18(%rsp), %rsi
cmpq $0x0, 0x38(%rsi)
je 0x16351
addq $0x38, %rsi
movq %rbp, %rdi
callq 0x9dd0
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x1699e
leaq 0x40(%rsp), %rdi
callq 0x9680
jmp 0x162a1
leaq 0x20(%rsp), %rdi
callq 0x9680
leaq 0x30(%rsp), %rdi
callq 0x9680
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1638a
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x7688
jmp 0x1638d
movq %rax, %rbx
jmp 0x1639d
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1639d
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x20(%rsp), %rdi
callq 0x9680
leaq 0x30(%rsp), %rdi
callq 0x9680
movq %rbx, %rdi
callq 0x7600