// File: /workspace/github_cpp_makefile_star2_O2/chrischute[P]are-you-the-one/src/ayto.cpp
// Function: main
int main(int argc, char** argv) {
    AytoSettings* settings = new AytoSettings();

    if (settings->initializeFromArgs(argc, argv)) {
        if (settings->_isAllPermutationsMode) {
            cout << "Running on all possible answers." << endl;
            PerfectMatching answer = DIGITS;
            do {
                runAreYouTheOne(answer, settings);
            } while (next_permutation(answer.begin(), answer.end()));
        } else if (settings->_isReadFromFileMode) {
            cout << "Reading answers from " << settings->_fileToRead << "." << endl;
            PmSet *answers = new PmSet();
            answers->populateFromFile(settings->_fileToRead);
            for (PmSet::const_iterator answer = answers->begin();
                 answer != answers->end();
                 ++answer) {
                runAreYouTheOne(*answer, settings);
            }
            delete answers;
        } else if (settings->_isInteractiveMode) {
            cout << "Interactive mode. I think I'm going to win." << endl;
            runAreYouTheOne("", settings);
        } else {
            cout << "Running on a random answer." << endl;
            std::srand(unsigned(std::time(nullptr)));
            Pm answer = getRandomPerfectMatching();
            runAreYouTheOne(answer, settings);
        }
    } else {
        cout << "usage: ./ayto" << endl;
        cout << "\t[-a | -all]     * Run on all permutations" << endl;
        cout << "\t[-f <filename>] * Run on permutations in file" << endl;
        cout << "\t[-i]            * Interactive, user gives feedback" << endl;
        cout << "\t[-v]            * Verbose mode, more printing" << endl;
    }

    delete settings;

    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movl %edi, %ebp
pushq $0x38
popq %rdi
callq 0x2250
movq %rax, %rbx
movq %rax, %rdi
callq 0x4006
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x27a0
testb %al, %al
je 0x2575
cmpb $0x1, 0x20(%rbx)
jne 0x25f4
movq 0x9ab0(%rip), %rdi      # 0xbfd0
leaq 0x4add(%rip), %rsi      # 0x7004
callq 0x2240
movq %rax, %rdi
callq 0x2100
leaq 0x4aea(%rip), %rsi      # 0x7025
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x4034
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2c6e
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq %rdi, %rsi
callq 0x4767
testb %al, %al
jne 0x254f
jmp 0x2730
movq 0x9a54(%rip), %r14      # 0xbfd0
leaq 0x4b0b(%rip), %rsi      # 0x708e
movq %r14, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2100
leaq 0x4b02(%rip), %rsi      # 0x709c
movq %r14, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2100
leaq 0x4b16(%rip), %rsi      # 0x70c7
movq %r14, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2100
leaq 0x4b2e(%rip), %rsi      # 0x70f6
movq %r14, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2100
leaq 0x4b4b(%rip), %rsi      # 0x712a
movq %r14, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2100
jmp 0x273a
cmpb $0x1, 0x23(%rbx)
jne 0x2694
movq 0x99cb(%rip), %rdi      # 0xbfd0
leaq 0x4a24(%rip), %rsi      # 0x7030
callq 0x2240
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2200
leaq 0x4c06(%rip), %rsi      # 0x7229
movq %rax, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2100
pushq $0x8
popq %rdi
callq 0x2250
movq %rax, %r14
movq %rax, %rdi
callq 0x5834
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x22c0
movq %r14, %rdi
movq %r15, %rsi
callq 0x5a76
leaq 0x28(%rsp), %rdi
callq 0x20e0
movq %r14, %rdi
callq 0x58ca
movq %rax, %r15
movq %r14, %rdi
callq 0x58f4
cmpq %rax, %r15
je 0x26da
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2c6e
addq $0x20, %r15
jmp 0x2676
cmpb $0x1, 0x21(%rbx)
jne 0x26ef
movq 0x992f(%rip), %rdi      # 0xbfd0
leaq 0x499e(%rip), %rsi      # 0x7046
callq 0x2240
movq %rax, %rdi
callq 0x2100
leaq 0x4b73(%rip), %rsi      # 0x722f
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x4034
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x2c6e
jmp 0x2730
movq %r14, %rdi
callq 0x58a4
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x2260
jmp 0x273a
movq 0x98da(%rip), %rdi      # 0xbfd0
leaq 0x4975(%rip), %rsi      # 0x7072
callq 0x2240
movq %rax, %rdi
callq 0x2100
xorl %edi, %edi
callq 0x2220
movl %eax, %edi
callq 0x2230
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x35a1
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2c6e
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x4070
pushq $0x38
popq %rsi
movq %rbx, %rdi
callq 0x2260
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x278a
jmp 0x278a
jmp 0x2775
movq %rax, %r15
leaq 0x28(%rsp), %rdi
jmp 0x2792
movq %rax, %r15
pushq $0x8
popq %rsi
movq %r14, %rdi
jmp 0x2783
movq %rax, %r15
jmp 0x2797
movq %rax, %r15
pushq $0x38
popq %rsi
movq %rbx, %rdi
callq 0x2260
jmp 0x2797
movq %rax, %r15
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq %r15, %rdi
callq 0x2380
nop