// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movq %rsi, %r13
movq (%rsi), %rax
movq 0x8(%rsi), %rsi
cmpq %rsi, %rax
je 0x32d0
movq %rdi, %rbx
subq %rax, %rsi
cmpq $0x4, %rsi
jne 0x32ea
movq 0x5d19(%rip), %r14      # 0x8fc0
movq (%r14), %rsi
leaq 0x3060(%rip), %rdi      # 0x6311
callq 0x2170
movq (%r14), %rsi
movq (%r13), %rax
movl (%rax), %edx
movq %rbx, %rdi
callq 0x3aca
leaq 0x3150(%rip), %rdi      # 0x641e
jmp 0x32d7
leaq 0x3026(%rip), %rdi      # 0x62fd
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21f0
shrq $0x2, %rsi
leaq 0x3037(%rip), %rdi      # 0x632c
xorl %eax, %eax
callq 0x2040
movq 0x8(%r13), %rax
subq (%r13), %rax
cmpq $0x17, %rax
movq %r13, -0x40(%rbp)
ja 0x336e
movq 0x5cab(%rip), %r14      # 0x8fc0
movq (%r14), %rsi
leaq 0x2f82(%rip), %rdi      # 0x62a1
callq 0x2170
movq (%r13), %r12
movq (%r14), %rsi
movl (%r12), %edx
movq %rbx, %rdi
callq 0x3aca
leaq 0x3000(%rip), %r15      # 0x633e
movq (%r14), %rsi
movq %r15, %rdi
callq 0x2170
movq (%r14), %rsi
movl (%r12), %edx
movq %rbx, %rdi
callq 0x3aca
addq $0x4, %r12
cmpq 0x8(%r13), %r12
jne 0x333e
movl $0xa, %edi
callq 0x21b0
jmp 0x337a
leaq 0x3182(%rip), %rdi      # 0x64f7
callq 0x21f0
movl $0xa, %edi
callq 0x21b0
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x58(%rbp), %r13
movq %rbx, -0x38(%rbp)
movq %rbx, %rdi
movq -0x40(%rbp), %rsi
movl $0xa, %edx
callq 0x351e
movq 0x5c09(%rip), %r14      # 0x8fc0
movq (%r14), %rsi
leaq 0x2f80(%rip), %rdi      # 0x6341
callq 0x2170
movq (%r14), %rdi
callq 0x2190
movq 0x5c03(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq -0x78(%rbp), %rsi
callq 0x26dd
testb %al, %al
je 0x34d0
movq %rbx, %rax
movl %r15d, %ebx
movl 0x48(%rax), %r12d
movq $0x0, -0x58(%rbp)
movq -0x78(%rbp), %r15
movzbl (%r15), %eax
testl %eax, %eax
je 0x346e
cmpl $0x9, %eax
je 0x3425
cmpl $0x20, %eax
je 0x3425
incq %r15
movsbl %al, %esi
movq %r13, %rdi
callq 0x253a
testb %al, %al
jne 0x33ff
jmp 0x346e
xorl %r14d, %r14d
movl $0x0, %eax
cmpl %r12d, -0x54(%rbp)
jne 0x3436
movl -0x58(%rbp), %eax
movl %eax, %ebx
testl %eax, %eax
je 0x3471
movzbl (%r15), %eax
cmpl $0x20, %eax
je 0x344a
cmpl $0x9, %eax
jne 0x344f
incq %r15
jmp 0x343c
movsbl %al, %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x346e
movq %r15, %rdi
callq 0x2200
movl %eax, -0x2c(%rbp)
cmpl %r12d, %eax
setbe %r14b
jmp 0x3471
xorl %r14d, %r14d
testb %r14b, %r14b
movl %ebx, %r15d
je 0x34b7
movq %r13, %rdi
movl %r12d, %esi
callq 0x3a48
movq -0x38(%rbp), %rbx
movq %r13, %rdi
movq %rbx, %rsi
movq -0x40(%rbp), %rdx
movl %r15d, %ecx
callq 0x27e4
movl -0x2c(%rbp), %esi
shlq $0x5, %rsi
addq -0x58(%rbp), %rsi
movq %rbx, %rdi
callq 0x3274
movq %r13, %rdi
callq 0x3a80
jmp 0x34c7
leaq 0x2ebe(%rip), %rdi      # 0x637c
callq 0x21f0
movq -0x38(%rbp), %rbx
testb %r14b, %r14b
je 0x339f
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x34e2
callq 0x2140
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3501
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x3a80
jmp 0x3504
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x3516
callq 0x2140
movq %rbx, %rdi
callq 0x2250