// File: /workspace/github_cpp_makefile_star2_O3/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 0x456f(%rip), %rsi      # 0xc9d6
leaq 0x4578(%rip), %rdx      # 0xc9e6
movq %rsp, %rdi
callq 0x5b3e
leaq -0x32e9(%rip), %rax     # 0x5194
movq %rsp, %rsi
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x58(%rsp), %rdi
callq 0x9fc4
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x84ac
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x4535(%rip), %rsi      # 0xc9ee
leaq 0x4538(%rip), %rdx      # 0xc9f8
callq 0x5b3e
leaq -0x3306(%rip), %rax     # 0x51c6
movq %rsp, %rsi
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x58(%rsp), %rdi
callq 0x9fc4
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x84fb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x44df(%rip), %rsi      # 0xc9e7
leaq 0x44e9(%rip), %rdx      # 0xc9f8
callq 0x5b3e
leaq -0x32e5(%rip), %rax     # 0x5236
movq %rsp, %rsi
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x58(%rsp), %rdi
callq 0x9fc4
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x854a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x44a9(%rip), %rsi      # 0xca00
leaq 0x44a9(%rip), %rdx      # 0xca07
callq 0x5b3e
leaq -0x31c0(%rip), %rax     # 0x53aa
movq %rsp, %rsi
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x58(%rsp), %rdi
callq 0x9fc4
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x8599
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x4453(%rip), %rsi      # 0xc9f9
leaq 0x445a(%rip), %rdx      # 0xca07
callq 0x5b3e
leaq -0x319f(%rip), %rax     # 0x541a
movq %rsp, %rsi
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x58(%rsp), %rdi
callq 0x9fc4
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x85e8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movups 0x3d69(%rip), %xmm0     # 0xc358
movq %rsp, %rsi
movaps %xmm0, 0x20(%rsi)
movups 0x3d4b(%rip), %xmm0     # 0xc348
movaps %xmm0, 0x10(%rsi)
movupd 0x3d2f(%rip), %xmm0     # 0xc338
movapd %xmm0, (%rsi)
leaq 0x38(%rsp), %rdi
leaq 0x37(%rsp), %rcx
movl $0x6, %edx
callq 0x93b4
testb %bl, %bl
jne 0x86cd
movq $0x5f5e100, (%rsp)      # imm = 0x5F5E100
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rax
cmpq %rax, %rsi
je 0x8652
movq $0x5f5e100, (%rsi)      # imm = 0x5F5E100
addq $0x8, %rsi
movq %rsi, 0x40(%rsp)
jmp 0x8669
leaq 0x38(%rsp), %rdi
movq %rsp, %rdx
callq 0x5a1e
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rax
movq $0x3b9aca00, (%rsp)     # imm = 0x3B9ACA00
cmpq %rax, %rsi
je 0x8688
movq $0x3b9aca00, (%rsi)     # imm = 0x3B9ACA00
addq $0x8, %rsi
movq %rsi, 0x40(%rsp)
jmp 0x869f
leaq 0x38(%rsp), %rdi
movq %rsp, %rdx
callq 0x5a1e
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rax
movabsq $0x183870714, %rcx      # imm = 0x183870714
movq %rcx, (%rsp)
cmpq %rax, %rsi
je 0x86c0
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x40(%rsp)
jmp 0x86cd
leaq 0x38(%rsp), %rdi
movq %rsp, %rdx
callq 0x5a1e
movq 0x98dc(%rip), %rbx      # 0x11fb0
leaq 0x432d(%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 0x98aa(%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 0x897a
movl $0xffffff4f, %ebp       # imm = 0xFFFFFF4F
movq %r13, (%rsp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x9548
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 0x429e(%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 0x4272(%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 0x4227(%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 0x41fa(%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 0x41d1(%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 0x41a5(%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 0x4176(%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 0x894b
movq (%r12), %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x8d6b
addq $0x8, %r12
jmp 0x892d
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x8961
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq %r15, %rdi
callq 0x4200
movq %rax, %r15
leaq 0x60(%rsp), %rax
cmpq %rax, %r15
jne 0x8738
callq 0x43b0
movq %rax, %rbx
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq 0x9610(%rip), %rdi      # 0x11fb0
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq %rax, %r14
leaq 0x40c2(%rip), %rsi      # 0xca79
movl $0x17, %edx
movq %rax, %rdi
callq 0x4340
subq 0x50(%rsp), %rbx
cvtsi2sd %rbx, %xmm0
divsd 0x3992(%rip), %xmm0     # 0xc368
divsd 0x3992(%rip), %xmm0     # 0xc370
movq %r14, %rdi
callq 0x4440
movq %rax, %rbx
leaq 0x40a1(%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 0x8a3b
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x42f0
leaq 0x58(%rsp), %rdi
callq 0x95de
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8a8e
jmp 0x8a8e
jmp 0x8a8e
jmp 0x8a85
jmp 0x8a6f
jmp 0x8a85
jmp 0x8a6f
jmp 0x8a85
jmp 0x8a6f
jmp 0x8a85
jmp 0x8a6f
jmp 0x8a85
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x8ac5
movq 0x10(%rsp), %rsi
incq %rsi
jmp 0x8ac0
movq %rax, %rbx
jmp 0x8ac5
jmp 0x8a8e
jmp 0x8a8e
movq %rax, %rbx
jmp 0x8aae
jmp 0x8a95
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x8aae
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42f0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x8ac5
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x42f0
leaq 0x58(%rsp), %rdi
callq 0x95de
movq %rbx, %rdi
callq 0x44c0