// File: mitchblank[P]qiksolve/qiksolve.cpp
// Function: Dictionary::Dictionary(_IO_FILE*, unsigned int)
Dictionary::Dictionary(FILE * const dictionary_file, unsigned const word_length)
	: word_length_(word_length)
{
	// Build words_[] map filled with all of the
	// valid words of "word_length" all-unique letters
	{
		string w;
		while (read_uppercase_word(dictionary_file, &w)) {
			Word const g = string_to_bitmask(w.c_str(), word_length);
			if (g != 0)
				words_[g].insert(w);
		}
	}
	if (!words_.empty()) {
		// Compute the keys_[] vector
		keys_.reserve(words_.size());
		size_t total_words = 0;
		for (auto it = words_.cbegin(); it != words_.cend(); ++it) {
			total_words += it->second.size();
			keys_.push_back(it->first);
		}
#if 0
		fprintf(stderr, "Searching for %u (2^%lf) words (%u unique without anagrams)\n",
			static_cast<unsigned>(total_words),
			log(total_words) / M_LN2,
			static_cast<unsigned>(words_.size()));
#endif // 0
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x4670
movq -0x78(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0x80(%rbp)
callq 0x4690
movq -0x78(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, 0x48(%rax)
leaq -0x38(%rbp), %rdi
callq 0x21d0
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2850
movb %al, -0x81(%rbp)
jmp 0x268c
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x269b
jmp 0x2730
leaq -0x38(%rbp), %rdi
callq 0x20a0
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x28d0
movl %eax, -0x88(%rbp)
jmp 0x26b7
movl -0x88(%rbp), %eax
movl %eax, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
je 0x272b
movq -0x78(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x46b0
movq %rax, -0x90(%rbp)
jmp 0x26dc
movq -0x90(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4790
movb %dl, -0x99(%rbp)
movq %rax, -0x98(%rbp)
jmp 0x26fb
movb -0x99(%rbp), %al
movq -0x98(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movb %al, -0x50(%rbp)
jmp 0x272b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x20d0
jmp 0x2826
jmp 0x2677
leaq -0x38(%rbp), %rdi
callq 0x20d0
movq -0x78(%rbp), %rdi
callq 0x47e0
testb $0x1, %al
jne 0x281d
movq -0x78(%rbp), %rdi
movq %rdi, %rax
addq $0x30, %rax
movq %rax, -0xa8(%rbp)
callq 0x4900
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x4800
jmp 0x2772
movq -0x78(%rbp), %rdi
movq $0x0, -0x60(%rbp)
callq 0x4920
movq %rax, -0x68(%rbp)
movq -0x78(%rbp), %rdi
callq 0x4980
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4950
testb $0x1, %al
jne 0x27a7
jmp 0x281b
leaq -0x68(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x49b0
movq %rax, %rdi
addq $0x8, %rdi
callq 0x49d0
movq -0xb8(%rbp), %rdi
movq %rax, %rdx
movq -0x78(%rbp), %rax
movq -0x60(%rbp), %rcx
addq %rdx, %rcx
movq %rcx, -0x60(%rbp)
addq $0x30, %rax
movq %rax, -0xb0(%rbp)
callq 0x49b0
movq -0xb0(%rbp), %rdi
movq %rax, %rsi
callq 0x49f0
jmp 0x27fd
jmp 0x27ff
leaq -0x68(%rbp), %rdi
callq 0x4a60
jmp 0x2787
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2826
jmp 0x281d
addq $0xc0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x4a90
movq -0x78(%rbp), %rdi
callq 0x4af0
movq -0x40(%rbp), %rdi
callq 0x2290
nopw %cs:(%rax,%rax)