// File: /workspace/github_cpp_makefile_star2_O3/mitchblank[P]qiksolve/qiksolve.cpp
// Function: Dictionary::batch(_IO_FILE*, _IO_FILE*) const
void Dictionary::batch(FILE * const fin, FILE * const fout) const
{
	SolutionTree tree;
	{
		AnswerSequence seq;
		recursiveSolve(&tree, keys_, &seq);
	}
	string wstr;
	string key;
	while (read_uppercase_word(fin, &wstr)) {
		Word const target = string_to_bitmask(wstr.c_str(), wordLength());
		if (target == 0) {
			fprintf(stderr, "Bad word: %s\n", wstr.c_str());
		} else if (words_.find(target) == words_.end()) {
			fprintf(stderr, "Unknown  word: %s\n", wstr.c_str());
		} else {
			key.clear();
			printf("%s: ", wstr.c_str());
			for (;;) {
				Word const play = tree[key];
				assert(words_.find(play) != words_.end());
				if (play == target) {
					describeWord(fout, target);
					putc('\n', fout);
					break;
				}
				fputs(words_.find(play)->second.cbegin()->c_str(), fout);
				putc(' ', fout);
				append_unsigned_period(&key, correct_letters(target, play));
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, %rbx
movq %rsi, -0x58(%rbp)
movq %rdi, %r15
leaq 0x5e55(%rip), %rcx      # 0x8d78
leaq -0xa0(%rbp), %rax
movq %rcx, -0x10(%rax)
movl $0x0, (%rax)
xorl %edx, %edx
movq %rdx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rdx, 0x20(%rax)
leaq -0x120(%rbp), %rcx
movq %rdx, 0x10(%rcx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rcx)
leaq 0x30(%rdi), %rdx
leaq -0xb0(%rbp), %rsi
callq 0x2a02
movq -0x120(%rbp), %rdi
testq %rdi, %rdi
je 0x2f78
callq 0x2140
leaq -0x68(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x40(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x8(%r15), %r12
movq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x26cf
testb %al, %al
je 0x319e
movq -0x78(%rbp), %rdi
movl 0x48(%r15), %esi
movq %rdi, -0x30(%rbp)
callq 0x2721
testl %eax, %eax
je 0x317d
movl %eax, %r13d
movq %r15, %r14
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x3159
movq %r12, %rcx
xorl %edx, %edx
cmpl %r13d, 0x20(%rax)
setb %dl
cmovaeq %rax, %rcx
movq 0x10(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x2fde
cmpq %r12, %rcx
je 0x3159
cmpl 0x20(%rcx), %r13d
jb 0x3159
movq $0x0, -0x48(%rbp)
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
movq -0x78(%rbp), %rsi
leaq 0x327d(%rip), %rdi      # 0x629f
xorl %eax, %eax
callq 0x2040
leaq -0xb0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3b90
movl %eax, %r15d
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x31eb
movq %rax, %rdx
movq %r12, %rcx
xorl %esi, %esi
cmpl %r15d, 0x20(%rdx)
setb %sil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x304f
cmpq %r12, %rcx
je 0x31eb
cmpl 0x20(%rcx), %r15d
jb 0x31eb
movq %r12, %rcx
cmpl %r13d, %r15d
je 0x3136
xorl %edx, %edx
cmpl %r15d, 0x20(%rax)
setb %dl
cmovaeq %rax, %rcx
movq 0x10(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x3086
movq %r12, %rax
cmpq %r12, %rcx
je 0x30b0
cmpl 0x20(%rcx), %r15d
cmovbq %r12, %rcx
movq %rcx, %rax
movq 0x40(%rax), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rsi
callq 0x2170
movl $0x20, %edi
movq %rbx, %rsi
callq 0x2280
andl %r13d, %r15d
movl %r15d, %eax
shrl %eax
andl $0x55555555, %eax       # imm = 0x55555555
subl %eax, %r15d
movl %r15d, %eax
movl $0x33333333, %ecx       # imm = 0x33333333
andl %ecx, %eax
shrl $0x2, %r15d
andl %ecx, %r15d
addl %eax, %r15d
movl %r15d, %eax
shrl $0x4, %eax
addl %r15d, %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
imull $0x1010101, %eax, %ecx  # imm = 0x1010101
shrl $0x18, %ecx
movl $0x64, %esi
leaq -0x120(%rbp), %r15
movq %r15, %rdi
leaq 0x33d1(%rip), %rdx      # 0x64ef
xorl %eax, %eax
callq 0x2200
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x2270
jmp 0x3029
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
callq 0x3aae
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2280
movq %r14, %r15
jmp 0x2f9a
movq 0x5e80(%rip), %rax      # 0x8fe0
movq (%rax), %rdi
leaq 0x3122(%rip), %rsi      # 0x628c
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x21c0
movq %r14, %r15
jmp 0x2f9a
movq 0x5e5c(%rip), %rax      # 0x8fe0
movq (%rax), %rdi
leaq 0x30f0(%rip), %rsi      # 0x627e
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x2f9a
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x31b0
callq 0x2140
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x31c2
callq 0x2140
leaq -0xa8(%rbp), %rdi
leaq 0x5ba8(%rip), %rax      # 0x8d78
movq %rax, -0x8(%rdi)
callq 0x405c
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30b2(%rip), %rdi      # 0x62a4
leaq 0x2e60(%rip), %rsi      # 0x6059
leaq 0x30c6(%rip), %rcx      # 0x62c6
movl $0x21f, %edx            # imm = 0x21F
callq 0x20c0
movq %rax, %rbx
movq -0x120(%rbp), %rdi
testq %rdi, %rdi
jne 0x3241
jmp 0x3246
jmp 0x321f
jmp 0x321f
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3234
callq 0x2140
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x3246
callq 0x2140
leaq -0xa8(%rbp), %rdi
leaq 0x5b24(%rip), %rax      # 0x8d78
movq %rax, -0x8(%rdi)
callq 0x405c
movq %rbx, %rdi
callq 0x2240
nop