// File: mitchblank[P]qiksolve/qiksolve.cpp
// Function: Dictionary::printInteractiveSuggestions(std::vector<unsigned int, std::allocator<unsigned int>> const&, unsigned int) const
void Dictionary::printInteractiveSuggestions(Words const& active_words, unsigned const show) const
{
	assert(!active_words.empty());
	assert(show > 0);
	vector<pair<double, Word>> suggestions;
	suggestions.reserve(active_words.size());
	puts("Suggestions:");
	{
		DividedWordList dl(wordLength());
		auto it = keys_.cbegin();
		do {
			dl.build(*this, active_words, *it);
			suggestions.push_back(make_pair(-dl.entropy(), *it));
		} while (++it != keys_.cend());
	}
	sort(suggestions.begin(), suggestions.end());
	{
		auto it = suggestions.cbegin();
		unsigned i = 0;
		do {
			printf("\t%2u: ", ++i);
			describeWord(stdout, it->second);
			putchar('\n');
		} while (++it != suggestions.cend() && i < show);
	}
	putchar('\n');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4550
xorb $-0x1, %al
testb $0x1, %al
jne 0x3ce2
jmp 0x3ce4
jmp 0x3d03
leaq 0x9448(%rip), %rdi      # 0xd133
leaq 0x9367(%rip), %rsi      # 0xd059
movl $0x276, %edx            # imm = 0x276
leaq 0x968d(%rip), %rcx      # 0xd38b
callq 0x20e0
cmpl $0x0, -0x14(%rbp)
jbe 0x3d0b
jmp 0x3d2a
leaq 0x96cf(%rip), %rdi      # 0xd3e1
leaq 0x9340(%rip), %rsi      # 0xd059
movl $0x277, %edx            # imm = 0x277
leaq 0x9666(%rip), %rcx      # 0xd38b
callq 0x20e0
leaq -0x30(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x5360
movq -0x10(%rbp), %rdi
callq 0x4df0
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
callq 0x5380
jmp 0x3d54
leaq 0x968f(%rip), %rdi      # 0xd3ea
callq 0x2220
jmp 0x3d62
movq -0xc0(%rbp), %rdi
callq 0x4bb0
movl %eax, -0xcc(%rbp)
jmp 0x3d76
movl -0xcc(%rbp), %esi
leaq -0x58(%rbp), %rdi
callq 0x4e70
jmp 0x3d87
movq -0xc0(%rbp), %rdi
addq $0x30, %rdi
callq 0x4590
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x45c0
movq -0xc0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movl (%rax), %ecx
leaq -0x58(%rbp), %rdi
callq 0x2990
jmp 0x3dca
leaq -0x58(%rbp), %rdi
callq 0x2b90
movsd %xmm0, -0xe0(%rbp)
jmp 0x3ddd
movsd -0xe0(%rbp), %xmm0
movaps 0x9244(%rip), %xmm1     # 0xd030
pxor %xmm1, %xmm0
movlpd %xmm0, -0x78(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x45c0
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
callq 0x54b0
movl %eax, -0xec(%rbp)
movsd %xmm0, -0xe8(%rbp)
jmp 0x3e1a
movl -0xec(%rbp), %eax
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x5480
jmp 0x3e53
jmp 0x3e55
leaq -0x60(%rbp), %rdi
callq 0x4620
movq -0xc0(%rbp), %rdi
movq %rax, -0xf8(%rbp)
addq $0x30, %rdi
callq 0x4640
movq -0xf8(%rbp), %rdi
movq %rax, -0x90(%rbp)
leaq -0x90(%rbp), %rsi
callq 0x45e0
testb $0x1, %al
jne 0x3d9b
leaq -0x58(%rbp), %rdi
callq 0x4f00
leaq -0x30(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x5520
movq -0x100(%rbp), %rdi
movq %rax, -0x98(%rbp)
callq 0x5550
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x54e0
jmp 0x3edf
leaq -0x30(%rbp), %rdi
callq 0x5580
movq %rax, -0xa8(%rbp)
movl $0x0, -0xac(%rbp)
movl -0xac(%rbp), %esi
incl %esi
movl %esi, -0xac(%rbp)
leaq 0x94e9(%rip), %rdi      # 0xd3f7
xorl %eax, %eax
callq 0x2040
jmp 0x3f17
movq 0x110a2(%rip), %rax     # 0x14fc0
movq (%rax), %rax
movq %rax, -0x108(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x55b0
movq -0xc0(%rbp), %rdi
movq -0x108(%rbp), %rsi
movl 0x8(%rax), %edx
callq 0x4f20
jmp 0x3f4c
movl $0xa, %edi
callq 0x21e0
jmp 0x3f58
jmp 0x3f5a
leaq -0xa8(%rbp), %rdi
callq 0x5610
movq %rax, -0x118(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5630
movq -0x118(%rbp), %rdi
movq %rax, -0xb8(%rbp)
leaq -0xb8(%rbp), %rsi
callq 0x55d0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x109(%rbp)
jne 0x3fa1
jmp 0x3fb3
movl -0xac(%rbp), %eax
cmpl -0x14(%rbp), %eax
setb %al
movb %al, -0x109(%rbp)
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x3ef9
movl $0xa, %edi
callq 0x21e0
jmp 0x3fcd
leaq -0x30(%rbp), %rdi
callq 0x5660
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4002
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4f00
leaq -0x30(%rbp), %rdi
callq 0x5660
movq -0x38(%rbp), %rdi
callq 0x2290
nopw %cs:(%rax,%rax)