// File: /workspace/github_cpp_makefile_star2_O2/mitchblank[P]qiksolve/qiksolve.cpp
// Function: Dictionary::recursiveInteractive(std::vector<unsigned int, std::allocator<unsigned int>> const&) const
void Dictionary::recursiveInteractive(Words const& active_words) const
{
	if (active_words.empty()) {
		puts("No choices remain.\n");
	} else if (active_words.size() == 1) {
		fputs("Only choice remaining is: ", stdout);
		describeWord(stdout, active_words.front());
		puts("\n");
	} else {
		printf("%u choices remain", static_cast<unsigned>(active_words.size()));
		if (active_words.size() <= 5) {
			// If we're near the end, print a list
			fputs(": ", stdout);
			auto it = active_words.cbegin();
			describeWord(stdout, *it);
			do {
				fputs(", ", stdout);
				describeWord(stdout, *it);
			} while (++it != active_words.cend());
			putchar('\n');
		} else {
			puts(".");
		}
		putchar('\n');

		string cmd;
		for (;;) {
			printInteractiveSuggestions(active_words);
			fputs("Give your move in form \"<word> <result>\" like \"TAXI 2\"\n\n"
			      "> ", stdout);
			fflush(stdout);
			if (!read_uppercase_word(stdin, &cmd))
				break;	// EOF
			Word tried;
			unsigned matched;
			if (parse_move(cmd, wordLength(), &tried, &matched)) {
				DividedWordList dl(wordLength());
				dl.build(*this, active_words, tried);
				recursiveInteractive(dl[matched].choices());
				break;
			}
			puts("Invalid move.\n");
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq (%rsi), %rax
movq 0x8(%rsi), %rsi
cmpq %rsi, %rax
je 0x301f
movq %rdi, %rbx
subq %rax, %rsi
cmpq $0x4, %rsi
jne 0x3039
movq 0x6fc9(%rip), %r14      # 0x9fc0
movq (%r14), %rsi
leaq 0x3310(%rip), %rdi      # 0x6311
callq 0x2150
movq (%r14), %rsi
movq (%r15), %rax
movl (%rax), %edx
movq %rbx, %rdi
callq 0x3776
leaq 0x33fb(%rip), %rdi      # 0x6418
jmp 0x3026
leaq 0x32d7(%rip), %rdi      # 0x62fd
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21d0
shrq $0x2, %rsi
leaq 0x32e8(%rip), %rdi      # 0x632c
xorl %eax, %eax
callq 0x2040
movq 0x8(%r15), %rax
subq (%r15), %rax
cmpq $0x17, %rax
movq %r15, -0x30(%rbp)
ja 0x30bd
movq %r15, %r13
movq 0x6f5a(%rip), %r15      # 0x9fc0
movq (%r15), %rsi
leaq 0x3231(%rip), %rdi      # 0x62a1
callq 0x2150
movq (%r13), %r12
movq (%r15), %rsi
movl (%r12), %edx
movq %rbx, %rdi
callq 0x3776
leaq 0x32af(%rip), %r14      # 0x633e
movq (%r15), %rsi
movq %r14, %rdi
callq 0x2150
movq (%r15), %rsi
movl (%r12), %edx
movq %rbx, %rdi
callq 0x3776
addq $0x4, %r12
cmpq 0x8(%r13), %r12
jne 0x308f
pushq $0xa
popq %rdi
callq 0x21a0
jmp 0x30c9
leaq 0x342d(%rip), %rdi      # 0x64f1
callq 0x21d0
pushq $0xa
popq %rdi
callq 0x21a0
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x48(%rbp), %r15
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
pushq $0xa
popq %rdx
callq 0x322e
movq 0x6ec5(%rip), %r14      # 0x9fc0
movq (%r14), %rsi
leaq 0x323c(%rip), %rdi      # 0x6341
callq 0x2150
movq (%r14), %rdi
callq 0x2170
movq 0x6ebf(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
leaq -0x68(%rbp), %rsi
callq 0x259d
testb %al, %al
je 0x31f2
movl 0x48(%rbx), %r12d
andq $0x0, -0x48(%rbp)
movq -0x68(%rbp), %r13
movzbl (%r13), %eax
testl %eax, %eax
je 0x31a3
cmpl $0x9, %eax
je 0x3161
cmpl $0x20, %eax
je 0x3161
incq %r13
movsbl %al, %esi
movq %r15, %rdi
callq 0x2432
testb %al, %al
jne 0x313a
jmp 0x31a3
movl -0x48(%rbp), %r14d
cmpl %r12d, -0x44(%rbp)
setne %cl
testl %r14d, %r14d
sete %dl
orb %cl, %dl
jne 0x31a3
cmpb $0x20, %al
je 0x3182
movzbl %al, %ecx
cmpl $0x9, %ecx
jne 0x318b
movb 0x1(%r13), %al
incq %r13
jmp 0x3176
movsbl %al, %eax
addl $-0x30, %eax
cmpl $0xa, %eax
jae 0x31a3
movq %r13, %rdi
callq 0x21e0
cmpl %r12d, %eax
jbe 0x31b4
leaq 0x31d2(%rip), %rdi      # 0x637c
callq 0x21d0
jmp 0x30e5
movl %eax, %r13d
leaq -0x48(%rbp), %rdi
movl %r12d, %esi
callq 0x3716
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
movq -0x30(%rbp), %rdx
movl %r14d, %ecx
callq 0x2670
movl %r13d, %esi
shlq $0x5, %rsi
addq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x2fc4
leaq -0x48(%rbp), %rdi
callq 0x374a
leaq -0x68(%rbp), %rdi
callq 0x20a0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x321a
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x374a
jmp 0x321d
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2230