// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movl %edi, %ebp
movl $0x38, %edi
callq 0x2230
movq %rax, %rbx
addq $0x10, %rax
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movl $0x0, 0x20(%rbx)
movb $0x1, 0x24(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x2a24
testb %al, %al
je 0x2654
cmpb $0x1, 0x20(%rbx)
jne 0x2787
movq 0x8a0b(%rip), %r14      # 0xafd0
leaq 0x4a38(%rip), %rsi      # 0x7004
movl $0x20, %edx
movq %r14, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4a15(%rip), %rsi      # 0x7025
leaq 0x4a18(%rip), %rdx      # 0x702f
movq %rsp, %rdi
callq 0x5256
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3072
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
addq %rdi, %rsi
callq 0x5381
testb %al, %al
jne 0x2622
movq (%rsp), %rdi
cmpq %r15, %rdi
jne 0x2988
jmp 0x2995
movq 0x8975(%rip), %r14      # 0xafd0
leaq 0x4a2c(%rip), %rsi      # 0x708e
movl $0xd, %edx
movq %r14, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
leaq 0x49ff(%rip), %rsi      # 0x709c
movl $0x2a, %edx
movq %r14, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
leaq 0x49ef(%rip), %rsi      # 0x70c7
movl $0x2e, %edx
movq %r14, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
leaq 0x49e3(%rip), %rsi      # 0x70f6
movl $0x33, %edx
movq %r14, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
leaq 0x49dc(%rip), %rsi      # 0x712a
movl $0x2e, %edx
movq %r14, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
jmp 0x2995
cmpb $0x1, 0x23(%rbx)
jne 0x287e
movq 0x8838(%rip), %r14      # 0xafd0
leaq 0x4891(%rip), %rsi      # 0x7030
movl $0x15, %edx
movq %r14, %rdi
callq 0x2270
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2270
movq %rax, %r14
leaq 0x4a64(%rip), %rsi      # 0x7229
movl $0x1, %edx
movq %rax, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
movl $0x8, %edi
callq 0x2230
movq %rax, %r14
movq %rax, %rdi
callq 0x6070
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x52ec
movq %r14, %rdi
movq %r15, %rsi
callq 0x6318
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x2851
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2240
movq %r14, %rdi
callq 0x6112
movq %rax, %r15
movq %r14, %rdi
callq 0x613c
cmpq %rax, %r15
je 0x2902
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3072
addq $0x20, %r15
jmp 0x285c
cmpb $0x1, 0x21(%rbx)
jne 0x2914
movq 0x8741(%rip), %r14      # 0xafd0
leaq 0x47b0(%rip), %rsi      # 0x7046
movl $0x2b, %edx
movq %r14, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4955(%rip), %rdx      # 0x722f
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x5256
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3072
movq (%rsp), %rdi
cmpq %r14, %rdi
jne 0x2988
jmp 0x2995
movq %r14, %rdi
callq 0x60ea
movl $0x8, %esi
movq %r14, %rdi
jmp 0x2990
movq 0x86b5(%rip), %r14      # 0xafd0
leaq 0x4750(%rip), %rsi      # 0x7072
movl $0x1b, %edx
movq %r14, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
xorl %edi, %edi
callq 0x2200
movl %eax, %edi
callq 0x2210
movq %rsp, %r14
movq %r14, %rdi
callq 0x3f7d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3072
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2995
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2240
movq %rbx, %rdi
callq 0x4cdc
movl $0x38, %esi
movq %rbx, %rdi
callq 0x2240
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
jne 0x2a0e
jmp 0x2a1b
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2a0e
jmp 0x2a1b
jmp 0x29fd
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x2a1b
movq 0x30(%rsp), %rsi
jmp 0x2a13
movq %rax, %rbx
movl $0x8, %esi
movq %r14, %rdi
jmp 0x2a16
movq %rax, %rbx
jmp 0x2a1b
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2a1b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2240
movq %rbx, %rdi
callq 0x2360
nop