// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movq %rsi, 0x18(%rsp)
movq %rdi, %r15
callq 0x7180
movq %rax, %r12
movq 0x15cb9(%rip), %rbx     # 0x2f6c0
testq %rbx, %rbx
je 0x19a3e
leaq 0x15cb5(%rip), %r14     # 0x2f6c8
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7190
testl %eax, %eax
jne 0x19a32
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x13a20
movq (%r14), %rbx
addq $0x8, %r14
testq %rbx, %rbx
jne 0x19a13
cmpq $0x0, 0x1606a(%rip)     # 0x2fab0
je 0x19a7c
leaq 0x16041(%rip), %r14     # 0x2fa90
movq (%r14), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7190
testl %eax, %eax
jne 0x19a71
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x13a20
cmpq $0x0, 0x48(%r14)
leaq 0x28(%r14), %r14
jne 0x19a4f
movq 0x16105(%rip), %r14     # 0x2fb88
testq %r14, %r14
je 0x19aa0
movl 0x8(%r14), %eax
testl %eax, %eax
je 0x19a9d
leal 0x1(%rax), %ecx
lock
cmpxchgl %ecx, 0x8(%r14)
jne 0x19a8c
jmp 0x19aa0
xorl %r14d, %r14d
testq %r14, %r14
je 0x19ab0
movl 0x8(%r14), %eax
testl %eax, %eax
sete %al
jmp 0x19ab2
movb $0x1, %al
movq 0x160c7(%rip), %rdx     # 0x2fb80
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x19c5a
testq %r14, %r14
je 0x19ae3
movq 0x154ed(%rip), %rax     # 0x2efc0
cmpb $0x0, (%rax)
je 0x19ade
incl 0x8(%r14)
jmp 0x19ae3
lock
incl 0x8(%r14)
leaq 0x30(%rsp), %rbx
movq %r14, 0x8(%rsp)
movq %r14, (%rsp)
movq %rdx, 0x40(%rsp)
movq 0x10(%rdx), %rbp
testq %rbp, %rbp
je 0x19bfc
movq 0x8(%rbp), %rsi
leaq 0x10(%rsp), %rdi
callq 0xe5a1
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
je 0x19b28
movq (%rsi), %rax
leaq 0x20(%rsp), %rdi
callq *0x30(%rax)
jmp 0x19b4f
movq %rbx, 0x20(%rsp)
movabsq $0x5f7274705f6f6e3c, %rax # imm = 0x5F7274705F6F6E3C
movq %rax, (%rbx)
movl $0x3e666572, 0x8(%rbx)  # imm = 0x3E666572
movq $0xc, 0x28(%rsp)
movb $0x0, 0x3c(%rsp)
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7190
movl %eax, %r14d
cmpq %rbx, %r13
je 0x19b7a
movq 0x30(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x7320
testl %r14d, %r14d
jne 0x19be3
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
je 0x19b96
movq (%rsi), %rax
leaq 0x20(%rsp), %rdi
callq *0x30(%rax)
jmp 0x19bbd
movq %rbx, 0x20(%rsp)
movabsq $0x5f7274705f6f6e3c, %rax # imm = 0x5F7274705F6F6E3C
movq %rax, (%rbx)
movl $0x3e666572, 0x8(%rbx)  # imm = 0x3E666572
movq $0xc, 0x28(%rsp)
movb $0x0, 0x3c(%rsp)
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0x13a20
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x19be3
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7320
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19bf3
movq (%rdi), %rax
callq *0x10(%rax)
movq (%rbp), %rbp
jmp 0x19afa
movq 0x40(%rsp), %rax
movq 0x38(%rax), %r13
testq %r13, %r13
je 0x19c47
movq 0x40(%rax), %r14
testq %r14, %r14
movq (%rsp), %rdi
je 0x19c2e
movq 0x153a2(%rip), %rax     # 0x2efc0
cmpb $0x0, (%rax)
je 0x19c29
incl 0x8(%r14)
jmp 0x19c2e
lock
incl 0x8(%r14)
movq %r13, %rdx
testq %rdi, %rdi
je 0x19aed
callq 0xad5c
movq %r13, %rdx
jmp 0x19aed
movq (%rsp), %rdi
testq %rdi, %rdi
movq 0x8(%rsp), %r14
je 0x19c5a
callq 0xad5c
testq %r14, %r14
je 0x19c67
movq %r14, %rdi
callq 0xad5c
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x19c94
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x19c97
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7320
jmp 0x19c97
movq %rax, %r14
movq 0x8(%rsp), %rbx
movq (%rsp), %r15
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19cb0
movq (%rdi), %rax
callq *0x10(%rax)
movq $0x0, 0x10(%rsp)
jmp 0x19cc7
movq %rax, %r14
movq 0x8(%rsp), %rbx
movq (%rsp), %r15
testq %r15, %r15
je 0x19cd4
movq %r15, %rdi
callq 0xad5c
testq %rbx, %rbx
je 0x19ce1
movq %rbx, %rdi
callq 0xad5c
movq %r14, %rdi
callq 0x7620