// File: /workspace/github_cpp_makefile_star2_O1/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 0x2240
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 0x2a34
testb %al, %al
je 0x2664
cmpb $0x1, 0x20(%rbx)
jne 0x2797
movq 0x89fb(%rip), %r14      # 0xafd0
leaq 0x4a28(%rip), %rsi      # 0x7004
movl $0x20, %edx
movq %r14, %rdi
callq 0x2280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4a05(%rip), %rsi      # 0x7025
leaq 0x4a08(%rip), %rdx      # 0x702f
movq %rsp, %rdi
callq 0x5320
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3138
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
addq %rdi, %rsi
callq 0x5440
testb %al, %al
jne 0x2632
movq (%rsp), %rdi
cmpq %r15, %rdi
jne 0x2998
jmp 0x29a5
movq 0x8965(%rip), %r14      # 0xafd0
leaq 0x4a1c(%rip), %rsi      # 0x708e
movl $0xd, %edx
movq %r14, %rdi
callq 0x2280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x49ef(%rip), %rsi      # 0x709c
movl $0x2a, %edx
movq %r14, %rdi
callq 0x2280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x49df(%rip), %rsi      # 0x70c7
movl $0x2e, %edx
movq %r14, %rdi
callq 0x2280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x49d3(%rip), %rsi      # 0x70f6
movl $0x33, %edx
movq %r14, %rdi
callq 0x2280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x49cc(%rip), %rsi      # 0x712a
movl $0x2e, %edx
movq %r14, %rdi
callq 0x2280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
jmp 0x29a5
cmpb $0x1, 0x23(%rbx)
jne 0x288e
movq 0x8828(%rip), %r14      # 0xafd0
leaq 0x4881(%rip), %rsi      # 0x7030
movl $0x15, %edx
movq %r14, %rdi
callq 0x2280
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2280
movq %rax, %r14
leaq 0x4a63(%rip), %rsi      # 0x7238
movl $0x1, %edx
movq %rax, %rdi
callq 0x2280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
movl $0x8, %edi
callq 0x2240
movq %rax, %r14
movq %rax, %rdi
callq 0x616c
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 0x53b0
movq %r14, %rdi
movq %r15, %rsi
callq 0x641e
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x2861
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2250
movq %r14, %rdi
callq 0x6210
movq %rax, %r15
movq %r14, %rdi
callq 0x623a
cmpq %rax, %r15
je 0x2912
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3138
addq $0x20, %r15
jmp 0x286c
cmpb $0x1, 0x21(%rbx)
jne 0x2924
movq 0x8731(%rip), %r14      # 0xafd0
leaq 0x47a0(%rip), %rsi      # 0x7046
movl $0x2b, %edx
movq %r14, %rdi
callq 0x2280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4954(%rip), %rdx      # 0x723e
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x5320
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3138
movq (%rsp), %rdi
cmpq %r14, %rdi
jne 0x2998
jmp 0x29a5
movq %r14, %rdi
callq 0x61e6
movl $0x8, %esi
movq %r14, %rdi
jmp 0x29a0
movq 0x86a5(%rip), %r14      # 0xafd0
leaq 0x4740(%rip), %rsi      # 0x7072
movl $0x1b, %edx
movq %r14, %rdi
callq 0x2280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
xorl %edi, %edi
callq 0x2210
movl %eax, %edi
callq 0x2220
movq %rsp, %r14
movq %r14, %rdi
callq 0x4030
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3138
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29a5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x4d7c
movl $0x38, %esi
movq %rbx, %rdi
callq 0x2250
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 0x2a1e
jmp 0x2a2b
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2a1e
jmp 0x2a2b
jmp 0x2a0d
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x2a2b
movq 0x30(%rsp), %rsi
jmp 0x2a23
movq %rax, %rbx
movl $0x8, %esi
movq %r14, %rdi
jmp 0x2a26
movq %rax, %rbx
jmp 0x2a2b
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2a2b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x2370
nop