// File: /workspace/github_cpp_makefile_star2_O1/chuckwolber[P]Cube/order/cli.cpp
// Function: doAlgBench(bool)
void doAlgBench(bool lite) {
    /* operator<() is already defined in Algorithm for different purposes. */
    std::map<std::string, RedundancyEvaluator> algEvals;
    algEvals.insert(std::pair<std::string, RedundancyEvaluator>("all redundancies",  &Algorithm::isRedundant));
    algEvals.insert(std::pair<std::string, RedundancyEvaluator>("inversions",        &Algorithm::hasInversion));
    algEvals.insert(std::pair<std::string, RedundancyEvaluator>("hidden inversions", &Algorithm::hasHiddenInversion));
    algEvals.insert(std::pair<std::string, RedundancyEvaluator>("triples",           &Algorithm::hasTriple));
    algEvals.insert(std::pair<std::string, RedundancyEvaluator>("hidden triples",    &Algorithm::hasHiddenTriple));

    /**
     * @brief The last test simulates the number of algorithms required to find
     * order 11 (the hardest order to find). Since it is not a multiple of 10,
     * it is simpler to manually build a list.
     */
    std::vector<unsigned long long int> algs{ 100,
                                              1000,
                                              10000,
                                              100000,
                                              1000000,
                                              10000000 };
    if (!lite) {
        algs.push_back(100000000);
        algs.push_back(1000000000);
        algs.push_back(DEFAULT_ALG_MAX);
    }

    std::cout << "Performing algorithm reduce benchmarks..." << std::endl;
    auto start = std::chrono::steady_clock::now();
    for (auto evaluator : algEvals) {
        std::cout << std::endl << "* Benchmarking " << evaluator.first << "..." << std::endl;
        std::cout << std::setw(COLUMN_WIDTH) << std::left << "Time (ms)" 
                  << std::setw(COLUMN_WIDTH) << std::left << "Starting Size"
                  << std::setw(COLUMN_WIDTH) << std::left << "Tally Size"
                  << std::setw(COLUMN_WIDTH) << std::left << "Savings"
                  << std::setw(COLUMN_WIDTH) << std::left << "Rate ms/Alg"
                  << std::endl;
        for (auto numAlgs : algs)
            doAlgReduce(numAlgs, evaluator.second);
    }
    auto end = std::chrono::steady_clock::now();
    auto elapsed = std::chrono::duration<double, std::milli>(end - start).count();
    std::cout << std::endl << "Benchmark completed in " << elapsed / 1000 << " seconds." << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edi, %ebx
leaq 0x60(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x4321(%rip), %rsi      # 0xc9d6
leaq 0x432a(%rip), %rdx      # 0xc9e6
movq %rsp, %rdi
callq 0x5ccc
leaq -0x350b(%rip), %rax     # 0x51c0
movq %rsp, %rsi
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x58(%rsp), %rdi
callq 0xa238
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x86fa
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x42e7(%rip), %rsi      # 0xc9ee
leaq 0x42ea(%rip), %rdx      # 0xc9f8
callq 0x5ccc
leaq -0x3528(%rip), %rax     # 0x51f2
movq %rsp, %rsi
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x58(%rsp), %rdi
callq 0xa238
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x8749
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x4291(%rip), %rsi      # 0xc9e7
leaq 0x429b(%rip), %rdx      # 0xc9f8
callq 0x5ccc
leaq -0x34f3(%rip), %rax     # 0x5276
movq %rsp, %rsi
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x58(%rsp), %rdi
callq 0xa238
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x8798
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x425b(%rip), %rsi      # 0xca00
leaq 0x425b(%rip), %rdx      # 0xca07
callq 0x5ccc
leaq -0x334c(%rip), %rax     # 0x546c
movq %rsp, %rsi
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x58(%rsp), %rdi
callq 0xa238
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x87e7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x4205(%rip), %rsi      # 0xc9f9
leaq 0x420c(%rip), %rdx      # 0xca07
callq 0x5ccc
leaq -0x3327(%rip), %rax     # 0x54e0
movq %rsp, %rsi
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x58(%rsp), %rdi
callq 0xa238
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x8836
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movups 0x3b1b(%rip), %xmm0     # 0xc358
movq %rsp, %rsi
movaps %xmm0, 0x20(%rsi)
movups 0x3afd(%rip), %xmm0     # 0xc348
movaps %xmm0, 0x10(%rsi)
movupd 0x3ae1(%rip), %xmm0     # 0xc338
movapd %xmm0, (%rsi)
leaq 0x38(%rsp), %rdi
leaq 0x37(%rsp), %rcx
movl $0x6, %edx
callq 0x9604
testb %bl, %bl
jne 0x8912
movq $0x5f5e100, (%rsp)      # imm = 0x5F5E100
movq 0x40(%rsp), %rsi
cmpq 0x48(%rsp), %rsi
je 0x889d
movq $0x5f5e100, (%rsi)      # imm = 0x5F5E100
addq $0x8, %rsi
movq %rsi, 0x40(%rsp)
jmp 0x88aa
leaq 0x38(%rsp), %rdi
movq %rsp, %rdx
callq 0x5bac
movq $0x3b9aca00, (%rsp)     # imm = 0x3B9ACA00
movq 0x40(%rsp), %rsi
cmpq 0x48(%rsp), %rsi
je 0x88d0
movq $0x3b9aca00, (%rsi)     # imm = 0x3B9ACA00
addq $0x8, %rsi
movq %rsi, 0x40(%rsp)
jmp 0x88dd
leaq 0x38(%rsp), %rdi
movq %rsp, %rdx
callq 0x5bac
movabsq $0x183870714, %rax      # imm = 0x183870714
movq %rax, (%rsp)
movq 0x40(%rsp), %rsi
cmpq 0x48(%rsp), %rsi
je 0x8905
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x40(%rsp)
jmp 0x8912
leaq 0x38(%rsp), %rdi
movq %rsp, %rdx
callq 0x5bac
movq 0x9697(%rip), %rbx      # 0x11fb0
leaq 0x40e8(%rip), %rsi      # 0xca08
movl $0x29, %edx
movq %rbx, %rdi
callq 0x4340
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq 0x9665(%rip), %r14      # 0x11fb0
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
callq 0x43b0
movq %rax, 0x50(%rsp)
movq 0x70(%rsp), %r15
leaq 0x60(%rsp), %rax
cmpq %rax, %r15
je 0x8bbf
movl $0xffffff4f, %ebp       # imm = 0xFFFFFF4F
movq %r13, (%rsp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x978e
movupd 0x40(%r15), %xmm0
movupd %xmm0, 0x20(%rsp)
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq %rax, %r12
movl $0xf, %edx
movq %rax, %rdi
leaq 0x4059(%rip), %rsi      # 0xca32
callq 0x4340
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rdi
callq 0x4340
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
leaq 0x402d(%rip), %rsi      # 0xca2e
callq 0x4340
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r14,%rax)
movl $0x9, %edx
movq %r14, %rdi
leaq 0x3fe2(%rip), %rsi      # 0xca42
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r14,%rax)
movl $0xd, %edx
movq %r14, %rdi
leaq 0x3fb5(%rip), %rsi      # 0xca4c
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r14,%rax)
movl $0xa, %edx
movq %r14, %rdi
leaq 0x3f8c(%rip), %rsi      # 0xca5a
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r14,%rax)
movl $0x7, %edx
movq %r14, %rdi
leaq 0x3f60(%rip), %rsi      # 0xca65
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0x14, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r14,%rax)
movl $0xb, %edx
movq %r14, %rdi
leaq 0x3f31(%rip), %rsi      # 0xca6d
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x38(%rsp), %r12
movq 0x40(%rsp), %rbx
cmpq %rbx, %r12
je 0x8b90
movq (%r12), %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x8fb0
addq $0x8, %r12
jmp 0x8b72
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x8ba6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %r15, %rdi
callq 0x4200
movq %rax, %r15
leaq 0x60(%rsp), %rax
cmpq %rax, %r15
jne 0x897d
callq 0x43b0
movq %rax, %rbx
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq 0x93cb(%rip), %rdi      # 0x11fb0
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq %rax, %r14
leaq 0x3e7d(%rip), %rsi      # 0xca79
movl $0x17, %edx
movq %rax, %rdi
callq 0x4340
subq 0x50(%rsp), %rbx
cvtsi2sd %rbx, %xmm0
divsd 0x374d(%rip), %xmm0     # 0xc368
divsd 0x374d(%rip), %xmm0     # 0xc370
movq %r14, %rdi
callq 0x4440
movq %rax, %rbx
leaq 0x3e5c(%rip), %rsi      # 0xca91
movl $0x9, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x8c80
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x42f0
leaq 0x58(%rsp), %rdi
callq 0x981e
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8cd3
jmp 0x8cd3
jmp 0x8cd3
jmp 0x8cca
jmp 0x8cb4
jmp 0x8cca
jmp 0x8cb4
jmp 0x8cca
jmp 0x8cb4
jmp 0x8cca
jmp 0x8cb4
jmp 0x8cca
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x8d0a
movq 0x10(%rsp), %rsi
incq %rsi
jmp 0x8d05
movq %rax, %rbx
jmp 0x8d0a
jmp 0x8cd3
jmp 0x8cd3
movq %rax, %rbx
jmp 0x8cf3
jmp 0x8cda
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x8cf3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x8d0a
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x42f0
leaq 0x58(%rsp), %rdi
callq 0x981e
movq %rbx, %rdi
callq 0x44c0