// File: /workspace/github_cpp_makefile_star2_O2/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 $0x98, %rsp
movq %rdx, %rbx
movq %rsi, -0x60(%rbp)
leaq 0x700c(%rip), %rax      # 0x9d78
leaq -0xa8(%rbp), %rcx
movq %rax, -0x10(%rcx)
andl $0x0, (%rcx)
andq $0x0, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
andq $0x0, 0x20(%rcx)
movq %rdi, %r15
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rcx
movaps %xmm0, (%rcx)
andq $0x0, 0x10(%rcx)
leaq 0x30(%rdi), %rdx
leaq -0xb8(%rbp), %rsi
callq 0x2898
leaq -0x50(%rbp), %rdi
callq 0x3d52
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x70(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x8(%r15), %r13
leaq -0x80(%rbp), %r12
leaq -0x2c(%rbp), %r14
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x259d
testb %al, %al
je 0x2f33
movq -0x50(%rbp), %rdi
movl 0x48(%r15), %esi
movq %rdi, -0x58(%rbp)
callq 0x25ec
movl %eax, -0x30(%rbp)
testl %eax, %eax
je 0x2efb
movq %r15, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3e7e
cmpq %r13, %rax
je 0x2f12
andq $0x0, -0x78(%rbp)
movq -0x80(%rbp), %rax
movb $0x0, (%rax)
movq -0x50(%rbp), %rsi
leaq 0x345f(%rip), %rdi      # 0x629f
xorl %eax, %eax
callq 0x2040
leaq -0xb8(%rbp), %rdi
movq %r12, %rsi
callq 0x383c
movl %eax, -0x2c(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e7e
cmpq %r13, %rax
je 0x2f63
movl -0x2c(%rbp), %edx
cmpl -0x30(%rbp), %edx
je 0x2ee0
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e7e
movq 0x40(%rax), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rsi
callq 0x2150
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x2260
movl -0x2c(%rbp), %eax
andl -0x30(%rbp), %eax
movl %eax, %ecx
shrl %ecx
andl $0x55555555, %ecx       # imm = 0x55555555
subl %ecx, %eax
movl %eax, %ecx
movl $0x33333333, %edx       # imm = 0x33333333
andl %edx, %ecx
shrl $0x2, %eax
andl %edx, %eax
addl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
addl %eax, %ecx
andl $0xf0f0f0f, %ecx        # imm = 0xF0F0F0F
imull $0x1010101, %ecx, %esi  # imm = 0x1010101
shrl $0x18, %esi
movq %r12, %rdi
callq 0x2d0e
jmp 0x2e47
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3776
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x2260
jmp 0x2de3
movq 0x70de(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
leaq 0x3372(%rip), %rsi      # 0x627e
movq -0x58(%rbp), %rdx
jmp 0x2f27
movq 0x70c7(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
movq -0x50(%rbp), %rdx
leaq 0x3365(%rip), %rsi      # 0x628c
xorl %eax, %eax
callq 0x21b0
jmp 0x2de3
leaq -0x80(%rbp), %rdi
callq 0x20a0
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq -0xb8(%rbp), %rdi
callq 0x3880
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x333a(%rip), %rdi      # 0x62a4
leaq 0x30e8(%rip), %rsi      # 0x6059
leaq 0x334e(%rip), %rcx      # 0x62c6
movl $0x21f, %edx            # imm = 0x21F
callq 0x20c0
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x3d52
jmp 0x2faf
jmp 0x2f9a
jmp 0x2f9a
jmp 0x2f9a
jmp 0x2f9a
jmp 0x2f9a
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x20a0
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq -0xb8(%rbp), %rdi
callq 0x3880
movq %rbx, %rdi
callq 0x2230
nop