// File: /workspace/github_cpp_makefile_star2_O3/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, 0x10(%rsp)
movq %rdi, %r15
callq 0x7180
movq %rax, %r12
movq 0x151b9(%rip), %rbx     # 0x2e3e0
testq %rbx, %rbx
je 0x1925e
leaq 0x151b5(%rip), %r14     # 0x2e3e8
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7190
testl %eax, %eax
jne 0x19252
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x1347c
movq (%r14), %rbx
addq $0x8, %r14
testq %rbx, %rbx
jne 0x19233
cmpq $0x0, 0x1556a(%rip)     # 0x2e7d0
je 0x1929c
leaq 0x15541(%rip), %r14     # 0x2e7b0
movq (%r14), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7190
testl %eax, %eax
jne 0x19291
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x1347c
cmpq $0x0, 0x48(%r14)
leaq 0x28(%r14), %r14
jne 0x1926f
movq 0x15605(%rip), %rbx     # 0x2e8a8
testq %rbx, %rbx
je 0x19491
movl 0x8(%rbx), %eax
testl %eax, %eax
je 0x19491
leal 0x1(%rax), %ecx
lock
cmpxchgl %ecx, 0x8(%rbx)
jne 0x192af
movl 0x8(%rbx), %eax
testl %eax, %eax
setne %cl
movq 0x155d0(%rip), %rsi     # 0x2e8a0
testq %rsi, %rsi
setne %dl
testb %dl, %cl
je 0x19489
movq 0x14cdb(%rip), %rcx     # 0x2dfc0
cmpb $0x0, (%rcx)
je 0x192f1
incl %eax
movl %eax, 0x8(%rbx)
jmp 0x192f5
lock
incl 0x8(%rbx)
leaq 0x28(%rsp), %rbp
movq %rbx, 0x38(%rsp)
movq %rbx, 0x8(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x10(%rsi), %rbx
testq %rbx, %rbx
je 0x1942b
movq 0x8(%rbx), %rsi
movq %rsp, %rdi
callq 0xe311
movq (%rsp), %rsi
testq %rsi, %rsi
je 0x19370
movq (%rsi), %rax
leaq 0x18(%rsp), %rdi
callq *0x30(%rax)
movq 0x18(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7190
movl %eax, %r14d
cmpq %rbp, %r13
je 0x19361
movq 0x28(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x7330
movq (%rsp), %rsi
testl %r14d, %r14d
jne 0x19415
jmp 0x193ae
movq %rbp, 0x18(%rsp)
movabsq $0x5f7274705f6f6e3c, %rax # imm = 0x5F7274705F6F6E3C
movq %rax, (%rbp)
movl $0x3e666572, 0x8(%rbp)  # imm = 0x3E666572
movq $0xc, 0x20(%rsp)
movb $0x0, 0x34(%rsp)
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7190
movq (%rsp), %rsi
testl %eax, %eax
jne 0x19415
testq %rsi, %rsi
je 0x193c5
movq (%rsi), %rax
leaq 0x18(%rsp), %rdi
callq *0x30(%rax)
movq 0x18(%rsp), %rsi
jmp 0x193f0
movq %rbp, 0x18(%rsp)
movabsq $0x5f7274705f6f6e3c, %rax # imm = 0x5F7274705F6F6E3C
movq %rax, (%rbp)
movl $0x3e666572, 0x8(%rbp)  # imm = 0x3E666572
movq $0xc, 0x20(%rsp)
movb $0x0, 0x34(%rsp)
movq %rbp, %rsi
movq 0x10(%rsp), %rdi
callq 0x1347c
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0x19411
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7330
movq (%rsp), %rsi
testq %rsi, %rsi
je 0x19423
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x10(%rax)
movq (%rbx), %rbx
jmp 0x1930d
movq 0x40(%rsp), %rax
movq 0x38(%rax), %r14
testq %r14, %r14
je 0x19475
movq 0x40(%rax), %rbx
testq %rbx, %rbx
movq 0x8(%rsp), %rdi
je 0x1945c
movq 0x14b72(%rip), %rax     # 0x2dfc0
cmpb $0x0, (%rax)
je 0x19458
incl 0x8(%rbx)
jmp 0x1945c
lock
incl 0x8(%rbx)
movq %r14, %rsi
testq %rdi, %rdi
je 0x192ff
callq 0xac0e
movq %r14, %rsi
jmp 0x192ff
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
movq 0x38(%rsp), %rbx
je 0x19489
callq 0xac0e
movq %rbx, %rdi
callq 0xac0e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x194be
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0x194c1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x7330
jmp 0x194c1
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x194d5
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x194d5
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x194e4
callq 0xac0e
movq 0x38(%rsp), %rdi
callq 0xac0e
movq %rbx, %rdi
callq 0x7630