// File: /workspace/github_cpp_makefile_star2_O2/chrischute[P]are-you-the-one/src/ayto.cpp
// Function: runAreYouTheOne(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, AreYouTheOneSettings const*)
void runAreYouTheOne(const Pm& answer, const AytoSettings* settings)
{
    TbSet* tbGuessesAlreadyMade = new TbSet(); // Queries submitted in truth booth.
    PmSet* pmGuessesAlreadyMade = new PmSet(); // Queries submitted in perfect matching.
    PmSet* possibleAnswers = new PmSet();      // Remaining possibilities for answer.
    possibleAnswers->populateAll();

    if (!settings->_isInteractiveMode) {
        if (settings->_isPrintNumbersMode) {
            cout << "Answer: " << getPrintableNumbers(answer) << endl;
        } else {
            cout << "Answer:" << endl
                 << getPrintableNames(answer, settings->_femaleNames, settings->_maleNames)
                 << endl;
        }
    }

    while (true) {
        // Submit a single Tb to the Truth Booth.
        cout << "End of Week " << (tbGuessesAlreadyMade->size() + 1) << endl;
        Tb nextTbGuess = getNextTruthBoothGuess(possibleAnswers, tbGuessesAlreadyMade);
        tbGuessesAlreadyMade->add(nextTbGuess);
        bool isPairCorrect;
        if (settings->_isInteractiveMode) {
            string userInput;
            do {
                if (settings->_isPrintNumbersMode) {
                    cout << "Question: Is there a '" << nextTbGuess.charAtIndex
                         << "' in position " << nextTbGuess.index
                         << " (indexed starting with 0)? [yes/no]" << endl;
                } else {
                    cout << "Question: Are " << settings->_femaleNames->at(nextTbGuess.index)
                         << " and " << settings->_maleNames->at(nextTbGuess.charAtIndex)
                         << " matched together? [yes/no]" << endl;
                }
                cin >> userInput;
                isPairCorrect = userInput[0] == 'y' || userInput[0] == 'Y';
            } while (userInput[0] != 'y' && userInput[0] != 'n' &&
                     userInput[0] != 'Y' && userInput[0] != 'N');
        } else {
            isPairCorrect = nextTbGuess.isContainedIn(answer);
        }
        possibleAnswers->filter(nextTbGuess, isPairCorrect);
        if (settings->_isVerboseMode) {
            cout << "  * Truth Booth: " << flush;
            if (settings->_isPrintNumbersMode) {
                cout << getPrintableNumbers(nextTbGuess.toString()) << endl;
            } else {
                cout << getPrintableNames(nextTbGuess,
                                          settings->_femaleNames,
                                          settings->_maleNames)
                     << endl;
            }
            cout << "  > Feedback: " << (isPairCorrect ? "Yes" : "No") << endl;
            cout << "    Now " << possibleAnswers->size() << " remaining." << endl;
        }

        // Submit a full PM as the Perfect Matching.
        Pm nextPmGuess = getNextPerfectMatchingGuess(possibleAnswers, pmGuessesAlreadyMade);
        pmGuessesAlreadyMade->add(nextPmGuess);
        int numCorrect;
        if (settings->_isInteractiveMode) {
            do {
                if (settings->_isPrintNumbersMode) {
                    cout << "Question: How many of the following "
                         << "are in the correct spot?" << endl;
                    cout << getPrintableNumbers(nextPmGuess) << endl;
                } else {
                    cout << "Question: How many of the following "
                         << "matches are correct?" << endl;
                    cout << getPrintableNames(nextPmGuess,
                                              settings->_femaleNames,
                                              settings->_maleNames)
                         << endl;
                }
                cin >> numCorrect;
            } while (numCorrect < 0 || numCorrect > PERM_LENGTH);
        } else {
            numCorrect = numInCommon(nextPmGuess, answer);
        }

        possibleAnswers->filter(nextPmGuess, numCorrect);
        if (settings->_isVerboseMode) {
            cout << "  * Perfect Matching: " << flush;
            if (settings->_isPrintNumbersMode) {
                cout << getPrintableNumbers(nextPmGuess) << endl;
            } else {
                cout << endl << getPrintableNames(nextPmGuess,
                                                  settings->_femaleNames,
                                                  settings->_maleNames)
                     << endl;
            }
            cout << "  > Feedback: " << numCorrect << " correct" << endl;
            cout << "    Now " << possibleAnswers->size() << " remaining." << endl;
        }
        if (numCorrect == PERM_LENGTH) {
            break;
        }
        if (settings->_isInteractiveMode && possibleAnswers->size() == 0) {
            cout << "Sorry, that's not a possible combination of responses."
                 << endl << "Please try again." << endl;
            break;
        }
    }

    // Print a summary of the game, the guesses made in each week.
    cout << "Results:" << endl;
    for (unsigned int i = 0; i < tbGuessesAlreadyMade->size(); ++i) {
        int intWidth = (tbGuessesAlreadyMade->size() < 10 ? 1 : 2);
        cout << "[Week " << setw(intWidth) << (i + 1) << "] ";
        if (settings->_isPrintNumbersMode) {
            cout << getPrintableNumbers(tbGuessesAlreadyMade->get(i).toString())
                 << ", "
                 << getPrintableNumbers(pmGuessesAlreadyMade->get(i))
                 << endl;
        } else {
            cout << getPrintableNames(tbGuessesAlreadyMade->get(i),
                                      settings->_femaleNames,
                                      settings->_maleNames)
                 << endl
                 << getPrintableNames(pmGuessesAlreadyMade->get(i),
                                      settings->_femaleNames,
                                      settings->_maleNames)
                 << endl;
        }
    }

    delete tbGuessesAlreadyMade;
    delete pmGuessesAlreadyMade;
    delete possibleAnswers;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
movq %rdi, 0x30(%rsp)
pushq $0x8
popq %rdi
callq 0x2250
movq %rax, %r12
movq %rax, %rdi
callq 0x6128
pushq $0x8
popq %rdi
callq 0x2250
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x5834
pushq $0x8
popq %rdi
callq 0x2250
movq %rax, %r13
movq %rax, %rdi
callq 0x5834
movq %r13, %rdi
callq 0x5a0a
cmpb $0x0, 0x21(%r15)
jne 0x2d6e
cmpb $0x1, 0x22(%r15)
jne 0x2d19
movq 0x92ed(%rip), %rdi      # 0xbfd0
leaq 0x454f(%rip), %rsi      # 0x7239
callq 0x2240
movq %rax, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq 0x30(%rsp), %rsi
callq 0x3f38
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
jmp 0x2d64
movq 0x92b0(%rip), %rdi      # 0xbfd0
leaq 0x451b(%rip), %rsi      # 0x7242
callq 0x2240
movq %rax, %rdi
callq 0x2100
movq %rax, %rbx
movq 0x28(%r15), %rdx
movq 0x30(%r15), %rcx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq 0x30(%rsp), %rsi
callq 0x3d57
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
leaq 0x10(%rsp), %rdi
callq 0x20e0
movq %r13, 0x38(%rsp)
movq %r12, 0x80(%rsp)
movq 0x924e(%rip), %r13      # 0xbfd0
leaq 0x10(%rsp), %r12
leaq 0x40(%rsp), %rbx
movq %r13, %rdi
leaq 0x44b4(%rip), %rsi      # 0x724a
callq 0x2240
movq %rax, %r14
movq 0x80(%rsp), %rbp
movq %rbp, %rdi
callq 0x6198
leaq 0x1(%rax), %rsi
movq %r14, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x2100
movq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x3a32
movl %eax, 0x60(%rsp)
shrq $0x20, %rax
movb %al, 0x64(%rsp)
movq %rbp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x6162
cmpb $0x1, 0x21(%r15)
jne 0x2f11
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movq 0x38(%rsp), %rbp
cmpb $0x1, 0x22(%r15)
jne 0x2e54
movq %r13, %rdi
leaq 0x4439(%rip), %rsi      # 0x7257
callq 0x2240
movsbl 0x64(%rsp), %esi
movq %rax, %rdi
callq 0x2290
movq %rax, %rdi
leaq 0x4434(%rip), %rsi      # 0x726e
callq 0x2240
movl 0x60(%rsp), %esi
movq %rax, %rdi
callq 0x2370
leaq 0x442b(%rip), %rsi      # 0x727d
jmp 0x2eb1
movq %r13, %rdi
leaq 0x4444(%rip), %rsi      # 0x72a2
callq 0x2240
movq %rax, %r14
movq 0x28(%r15), %rdi
leaq 0x60(%rsp), %rsi
callq 0x44ac
movq %r14, %rdi
movq %rax, %rsi
callq 0x2200
movq %rax, %rdi
leaq 0x4428(%rip), %rsi      # 0x72b1
callq 0x2240
movq %rax, %r14
movq 0x30(%r15), %rdi
leaq 0x64(%rsp), %rsi
callq 0x44e4
movq %r14, %rdi
movq %rax, %rsi
callq 0x2200
leaq 0x4406(%rip), %rsi      # 0x72b7
movq %rax, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2100
movq 0x9118(%rip), %rdi      # 0xbfe0
movq %r12, %rsi
callq 0x22a0
movq 0x10(%rsp), %rax
movb (%rax), %cl
addb $-0x4e, %cl
cmpb $0x2b, %cl
ja 0x2e0d
movzbl %cl, %eax
movabsq $0x80100000801, %rdx    # imm = 0x80100000801
btq %rax, %rdx
jae 0x2e0d
movabsq $0xffefffffffe, %r14    # imm = 0xFFEFFFFFFFE
shrq %cl, %r14
movq %r12, %rdi
callq 0x20e0
jmp 0x2f2e
movslq 0x60(%rsp), %rax
movq 0x30(%rsp), %rcx
movq (%rcx), %rcx
movb (%rcx,%rax), %al
cmpb 0x64(%rsp), %al
sete %r14b
movq 0x38(%rsp), %rbp
movzbl %r14b, %edx
andl $0x1, %edx
movq %rbp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x597a
cmpb $0x1, 0x24(%r15)
jne 0x3067
movq %r13, %rdi
leaq 0x437c(%rip), %rsi      # 0x72d3
callq 0x2240
movq %rax, %rdi
callq 0x2170
cmpb $0x1, 0x22(%r15)
jne 0x2fc6
movl 0x60(%rsp), %eax
movl 0x64(%rsp), %ecx
addl $0x30, %eax
leaq 0x50(%rsp), %rdx
movq %rdx, 0x40(%rsp)
shll $0x8, %ecx
movzbl %al, %eax
orl %ecx, %eax
movw %ax, 0x50(%rsp)
movq $0x2, 0x48(%rsp)
movb $0x0, 0x52(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3f38
movq %r13, %rdi
movq %r12, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
movq %r12, %rdi
callq 0x20e0
movq %rbx, %rdi
jmp 0x2ff1
movq 0x28(%r15), %rdx
movq 0x30(%r15), %rcx
movq %r12, %rdi
leaq 0x60(%rsp), %rsi
callq 0x3e6d
movq %r13, %rdi
movq %r12, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
movq %r12, %rdi
callq 0x20e0
movq %r13, %rdi
leaq 0x42e5(%rip), %rsi      # 0x72e5
callq 0x2240
testb $0x1, %r14b
leaq 0x42e8(%rip), %rsi      # 0x72f8
leaq 0x42dd(%rip), %rcx      # 0x72f4
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2100
movq %r13, %rdi
leaq 0x42c6(%rip), %rsi      # 0x72fb
callq 0x2240
movq %rax, %r14
movq %rbp, %rdi
callq 0x5b24
movq %r14, %rdi
movq %rax, %rsi
callq 0x2160
movq %rax, %rdi
leaq 0x42aa(%rip), %rsi      # 0x7304
callq 0x2240
movq %rax, %rdi
callq 0x2100
movq %r12, %rdi
movq %rbp, %rsi
movq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0x3602
movq %r14, %rdi
movq %r12, %rsi
callq 0x58c2
cmpb $0x1, 0x21(%r15)
jne 0x3151
cmpb $0x1, 0x22(%r15)
jne 0x30dd
movq %r13, %rdi
leaq 0x426f(%rip), %rsi      # 0x7310
callq 0x2240
movq %rax, %rdi
leaq 0x4285(%rip), %rsi      # 0x7335
callq 0x2240
movq %rax, %rdi
callq 0x2100
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3f38
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
jmp 0x3129
movq %r13, %rdi
leaq 0x4229(%rip), %rsi      # 0x7310
callq 0x2240
movq %rax, %rdi
leaq 0x4258(%rip), %rsi      # 0x734e
callq 0x2240
movq %rax, %rdi
callq 0x2100
movq 0x28(%r15), %rdx
movq 0x30(%r15), %rcx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3d57
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x20e0
movq 0x8ea8(%rip), %rdi      # 0xbfe0
leaq 0x4(%rsp), %rsi
callq 0x2130
movl 0x4(%rsp), %eax
cmpl $0xa, %eax
ja 0x3090
jmp 0x3162
movq %r12, %rdi
movq 0x30(%rsp), %rsi
callq 0x57fc
movl %eax, 0x4(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x58fc
cmpb $0x1, 0x24(%r15)
jne 0x325f
movq %r13, %rdi
leaq 0x41df(%rip), %rsi      # 0x7363
callq 0x2240
movq %rax, %rdi
callq 0x2170
cmpb $0x1, 0x22(%r15)
jne 0x31b8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3f38
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
jmp 0x31e9
movq %r13, %rdi
callq 0x2100
movq %rax, %r14
movq 0x28(%r15), %rdx
movq 0x30(%r15), %rcx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3d57
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x20e0
movq %r13, %rdi
leaq 0x40ea(%rip), %rsi      # 0x72e5
callq 0x2240
movl 0x4(%rsp), %esi
movq %rax, %rdi
callq 0x2370
movq %rax, %rdi
leaq 0x4164(%rip), %rsi      # 0x737a
callq 0x2240
movq %rax, %rdi
callq 0x2100
movq %r13, %rdi
leaq 0x40ce(%rip), %rsi      # 0x72fb
callq 0x2240
movq %rax, %r14
movq %rbp, %rdi
callq 0x5b24
movq %r14, %rdi
movq %rax, %rsi
callq 0x2160
movq %rax, %rdi
leaq 0x40b2(%rip), %rsi      # 0x7304
callq 0x2240
movq %rax, %rdi
callq 0x2100
cmpl $0xa, 0x4(%rsp)
je 0x32b9
cmpb $0x1, 0x21(%r15)
jne 0x327a
movq %rbp, %rdi
callq 0x5b24
testq %rax, %rax
je 0x3287
movq %r12, %rdi
callq 0x20e0
jmp 0x2d8c
movq 0x8d42(%rip), %rdi      # 0xbfd0
leaq 0x40ee(%rip), %rsi      # 0x7383
callq 0x2240
movq %rax, %rdi
callq 0x2100
leaq 0x4111(%rip), %rsi      # 0x73ba
movq %rax, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2100
leaq 0x10(%rsp), %rdi
callq 0x20e0
movq 0x8d06(%rip), %rdi      # 0xbfd0
leaq 0x40fb(%rip), %rsi      # 0x73cc
callq 0x2240
movq %rax, %rdi
callq 0x2100
xorl %r13d, %r13d
leaq 0x40(%rsp), %rbp
movl %r13d, %r14d
movq 0x80(%rsp), %r12
movq %r12, %rdi
callq 0x6198
cmpq %r14, %rax
jbe 0x34a7
movq %rbp, %rbx
movq %r12, %rdi
callq 0x6198
movq %rax, %r14
movq 0x8cb9(%rip), %rbp      # 0xbfd0
movq %rbp, %rdi
leaq 0x40b4(%rip), %rsi      # 0x73d5
callq 0x2240
cmpq $0xa, %r14
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
pushq $0x2
popq %rdx
sbbq $0x0, %rdx
movq %rdx, 0x10(%rax,%rcx)
movq %r12, %r14
leal 0x1(%r13), %r12d
movq %rax, %rdi
movq %r12, %rsi
callq 0x2160
movq %rax, %rdi
leaq 0x4083(%rip), %rsi      # 0x73dc
callq 0x2240
cmpb $0x1, 0x22(%r15)
jne 0x341e
movq %r14, %rdi
movl %r13d, %esi
callq 0x618c
movl (%rax), %ecx
movl 0x4(%rax), %eax
addl $0x30, %ecx
leaq 0x50(%rsp), %rdx
movq %rdx, 0x40(%rsp)
shll $0x8, %eax
movzbl %cl, %ecx
orl %eax, %ecx
movw %cx, 0x50(%rsp)
movq $0x2, 0x48(%rsp)
movb $0x0, 0x52(%rsp)
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rbp
movq %rbx, %rsi
callq 0x3f38
movq 0x8c15(%rip), %rdi      # 0xbfd0
movq %r14, %rsi
callq 0x2200
movq %rax, %rdi
leaq 0x3e69(%rip), %rsi      # 0x7236
callq 0x2240
movq %rax, %r14
movq 0x8(%rsp), %rdi
movl %r13d, %esi
callq 0x5a00
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3f38
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
leaq 0x60(%rsp), %rdi
callq 0x20e0
leaq 0x10(%rsp), %rdi
callq 0x20e0
movq %rbp, %rdi
jmp 0x349a
movq %r14, %rdi
movl %r13d, %esi
callq 0x618c
movq 0x28(%r15), %rdx
movq 0x30(%r15), %rcx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x3e6d
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
movq %rax, %r14
movq 0x8(%rsp), %rdi
movl %r13d, %esi
callq 0x5a00
movq %rbx, %rbp
movq 0x28(%r15), %rdx
movq 0x30(%r15), %rcx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3d57
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x2100
movq %rbp, %rdi
callq 0x20e0
leaq 0x10(%rsp), %rdi
callq 0x20e0
movl %r12d, %r13d
jmp 0x32e6
movq %r12, %rdi
callq 0x6144
pushq $0x8
popq %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2260
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x58a4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2260
movq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0x58a4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2260
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x358c
jmp 0x358c
movq %rax, %rbx
pushq $0x8
popq %rsi
movq %r13, %rdi
jmp 0x352a
movq %rax, %rbx
pushq $0x8
popq %rsi
movq 0x8(%rsp), %rdi
jmp 0x352a
movq %rax, %rbx
pushq $0x8
popq %rsi
movq %r12, %rdi
callq 0x2260
jmp 0x3599
jmp 0x358c
jmp 0x358c
jmp 0x358c
jmp 0x3541
jmp 0x357b
jmp 0x357b
jmp 0x355f
jmp 0x358c
movq %rax, %rbx
jmp 0x356c
jmp 0x358c
jmp 0x357b
jmp 0x358c
jmp 0x358c
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x20e0
jmp 0x3562
jmp 0x355f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20e0
leaq 0x40(%rsp), %rdi
jmp 0x3594
jmp 0x358c
jmp 0x358c
jmp 0x358c
jmp 0x357b
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x20e0
jmp 0x358f
jmp 0x358c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2380