// File: /workspace/github_cpp_makefile_star2_O3/travisdowns[P]avx-turbo/avx-turbo.cpp
// Function: main
int main(int argc, char** argv) {

    try {
        parser.ParseCLI(argc, argv);
        if (arg_iters.Get() % 100 != 0) {
            printf("ITERS must be a multiple of 100\n");
            exit(EXIT_FAILURE);
        }
    } catch (args::Help& help) {
        printf("%s\n", parser.Help().c_str());
        exit(EXIT_SUCCESS);
    } catch (const args::ParseError& e) {
        printf("ERROR while parsing arguments: %s\n", e.what());
        printf("\nUsage:\n%s\n", parser.Help().c_str());
        exit(EXIT_FAILURE);
    }

    if (arg_list) {
        list_tests();
        exit(EXIT_SUCCESS);
    }

    verbose = arg_verbose;
    bool is_root = (geteuid() == 0);
    bool use_aperf = aperf_ghz::is_supported();
    printf("CPUID highest leaf    : [%2xh]\n", cpuid_highest_leaf());
    printf("Running as root       : [%s]\n", is_root     ? "YES" : "NO ");
    printf("MSR reads supported   : [%s]\n", use_aperf   ? "YES" : "NO ");
    printf("CPU pinning enabled   : [%s]\n", !arg_no_pin ? "YES" : "NO ");

    ISA isas_supported = get_isas();
    zeroupper_allowed = isas_supported & AVX2;
    printf("CPU supports zeroupper: [%s]\n", zeroupper_allowed         ? "YES" : "NO ");
    printf("CPU supports AVX2     : [%s]\n", isas_supported & AVX2     ? "YES" : "NO ");
    printf("CPU supports AVX-512F : [%s]\n", isas_supported & AVX512F  ? "YES" : "NO ");
    printf("CPU supports AVX-512VL: [%s]\n", isas_supported & AVX512VL ? "YES" : "NO ");
    printf("CPU supports AVX-512BW: [%s]\n", isas_supported & AVX512BW ? "YES" : "NO ");
    printf("CPU supports AVX-512CD: [%s]\n", isas_supported & AVX512CD ? "YES" : "NO ");
    printf("tsc_freq = %.1f MHz (%s)\n", RdtscClock::tsc_freq() / 1000000.0, get_tsc_cal_info(arg_force_tsc_cal));
    std::vector<int> cpus = get_cpus();
    printf("CPU brand string: %s\n", get_brand_string().c_str());
    printf("%lu available CPUs: [%s]\n", cpus.size(), join(cpus, ", ").c_str());
    if (!arg_hyperthreads) {
        cpus = filter_cpus(cpus);
        printf("%lu physical cores: [%s]\n", cpus.size(), join(cpus, ", ").c_str());
    }

    if (arg_dirty && !(isas_supported & AVX512VL)) {
        printf("ERROR: --dirty-upper only supported on AVX-512 hardware\n");
        exit(EXIT_FAILURE);
    }

    auto iters = arg_iters.Get();
    zeroupper();
    auto specs = filter_tests(isas_supported, cpus);

    size_t last_thread_count = -1u;
    std::vector<result_holder> results_list;
    for (auto& spec : specs) {
        // if we changed the number of threads, spit out the accumulated output
        if (last_thread_count != -1u && last_thread_count != spec.count()) {
            // time to print results
            report_results(results_list, use_aperf);
            results_list.clear();
        }
        last_thread_count = spec.count();

        assert(!spec.thread_funcs.empty());
        if (verbose) printf("Running test spec: %s\n", spec.to_string().c_str());

        // run
        std::deque<test_thread> threads;
        hot_barrier start{spec.count()}, stop{spec.count()};
        for (auto& test : spec.thread_funcs) {
            threads.emplace_back(threads.size(), start, stop, &test, iters, use_aperf);
        }

        results_list.emplace_back(&spec);
        for (auto& t : threads) {
            t.thread.join();
            results_list.back().results.push_back(t.res);
        }
    }

    report_results(results_list, use_aperf);

    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rsi, %rdx
movl %edi, %esi
leaq 0x1ea0a(%rip), %rdi     # 0x28380
callq 0xbbc6
movabsq $-0x70a3d70a3d70a3d7, %rax # imm = 0x8F5C28F5C28F5C29
imulq 0x1f533(%rip), %rax     # 0x28ec0
rorq $0x2, %rax
movabsq $0x28f5c28f5c28f5d, %rcx # imm = 0x28F5C28F5C28F5D
cmpq %rcx, %rax
jae 0xa0d6
movq 0x1ef4d(%rip), %rax     # 0x288f8
leaq 0x1ef46(%rip), %rdi     # 0x288f8
callq *0x10(%rax)
testb %al, %al
jne 0xa0df
movq 0x1eda4(%rip), %rax     # 0x28768
leaq 0x1ed9d(%rip), %rdi     # 0x28768
callq *0x10(%rax)
movb %al, 0x1f844(%rip)      # 0x29218
callq 0x61c0
movl %eax, %ebx
callq 0xbcfa
movl %eax, %ebp
movb %al, 0xf(%rsp)
callq 0x15c33
leaq 0x14e5b(%rip), %rdi     # 0x1e84d
movl %eax, %esi
xorl %eax, %eax
callq 0x6050
testl %ebx, %ebx
leaq 0x14e87(%rip), %r12     # 0x1e88b
leaq 0x14e84(%rip), %r14     # 0x1e88f
movq %r14, %rsi
cmoveq %r12, %rsi
leaq 0x14e54(%rip), %rdi     # 0x1e86d
xorl %eax, %eax
callq 0x6050
testb %bpl, %bpl
movq %r14, %rsi
cmovneq %r12, %rsi
leaq 0x14e62(%rip), %rdi     # 0x1e893
xorl %eax, %eax
callq 0x6050
movq 0x1ec61(%rip), %rax     # 0x286a0
leaq 0x1ec5a(%rip), %rdi     # 0x286a0
callq *0x10(%rax)
testb %al, %al
movq %r14, %rsi
cmoveq %r12, %rsi
leaq 0x14e58(%rip), %rdi     # 0x1e8b1
xorl %eax, %eax
callq 0x6050
callq 0x80b2
movl %eax, %ebx
andl $0x2, %eax
movl %eax, %ecx
shrl %ecx
testl %eax, %eax
movb %cl, 0x1e902(%rip)      # 0x28378
movq %r14, %r15
cmovneq %r12, %r15
leaq 0x14e4b(%rip), %rdi     # 0x1e8cf
movq %r15, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x14e58(%rip), %rdi     # 0x1e8ed
movq %r15, %rsi
xorl %eax, %eax
callq 0x6050
testb $0x4, %bl
movq %r14, %rsi
cmovneq %r12, %rsi
leaq 0x14e5b(%rip), %rdi     # 0x1e90b
xorl %eax, %eax
callq 0x6050
testb $0x8, %bl
movq %r14, %rsi
cmovneq %r12, %rsi
leaq 0x14e61(%rip), %rdi     # 0x1e929
xorl %eax, %eax
callq 0x6050
cmpl $0x20, %ebx
movq %r12, %rsi
cmovbq %r14, %rsi
leaq 0x14e67(%rip), %rdi     # 0x1e947
xorl %eax, %eax
callq 0x6050
testb $0x10, %bl
cmovneq %r12, %r14
leaq 0x14e70(%rip), %rdi     # 0x1e965
movq %r14, %rsi
xorl %eax, %eax
callq 0x6050
callq 0xbd24
movq %rax, %xmm0
punpckldq 0x1451f(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x14527(%rip), %xmm0    # 0x1e040
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x1454b(%rip), %xmm1    # 0x1e078
movapd %xmm1, 0xb0(%rsp)
movq 0x1ea9b(%rip), %rax     # 0x285d8
leaq 0x1ea94(%rip), %rdi     # 0x285d8
callq *0x10(%rax)
movzbl %al, %edi
callq 0x16325
leaq 0x14e2d(%rip), %rdi     # 0x1e983
movaps 0xb0(%rsp), %xmm0
movq %rax, %rsi
movb $0x1, %al
callq 0x6050
leaq 0x10(%rsp), %rdi
callq 0x95fb
leaq 0x30(%rsp), %rdi
callq 0x15cf8
leaq 0x40(%rsp), %r14
movq -0x10(%r14), %rsi
leaq 0x14e11(%rip), %rdi     # 0x1e99d
xorl %eax, %eax
callq 0x6050
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x9ba1
callq 0x6320
movq 0x18(%rsp), %r14
subq 0x10(%rsp), %r14
leaq 0x168(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x14e0f(%rip), %rsi     # 0x1e9cd
leaq 0x14e0a(%rip), %rdx     # 0x1e9cf
leaq 0x158(%rsp), %rdi
callq 0xdf70
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x158(%rsp), %rcx
callq 0xa266
sarq $0x2, %r14
movq 0x30(%rsp), %rdx
leaq 0x14db5(%rip), %rdi     # 0x1e9b3
movq %r14, %rsi
xorl %eax, %eax
callq 0x6050
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x9c1c
callq 0x6320
movq 0x158(%rsp), %rdi
cmpq %r15, %rdi
je 0x9c2e
callq 0x6320
movq 0x1ed8b(%rip), %rax     # 0x289c0
leaq 0x1ed84(%rip), %rdi     # 0x289c0
callq *0x10(%rax)
testb %al, %al
jne 0x9d4d
leaq 0x120(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xaefc
leaq 0x30(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x973f
movq 0x10(%rsp), %rdi
movaps 0x30(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
testq %rdi, %rdi
je 0x9cae
callq 0x6320
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x9cae
callq 0x6320
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x9cc0
callq 0x6320
movq 0x18(%rsp), %r14
subq 0x10(%rsp), %r14
leaq 0x148(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x14cf0(%rip), %rsi     # 0x1e9cd
leaq 0x14ceb(%rip), %rdx     # 0x1e9cf
leaq 0x138(%rsp), %rdi
callq 0xdf70
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x30(%rsp), %rdi
leaq 0x138(%rsp), %rcx
callq 0xa266
sarq $0x2, %r14
movq 0x30(%rsp), %rdx
leaq 0x14cb3(%rip), %rdi     # 0x1e9d0
movq %r14, %rsi
xorl %eax, %eax
callq 0x6050
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x9d3b
callq 0x6320
movq 0x138(%rsp), %rdi
cmpq %r15, %rdi
je 0x9d4d
callq 0x6320
movq 0x1ed34(%rip), %rax     # 0x28a88
leaq 0x1ed2d(%rip), %rdi     # 0x28a88
callq *0x10(%rax)
testb $0x8, %bl
jne 0x9d6b
testb %al, %al
jne 0xa0e9
movq 0x1f14e(%rip), %rax     # 0x28ec0
movq %rax, 0xc8(%rsp)
cmpb $0x1, 0x1e5f7(%rip)     # 0x28378
jne 0x9d88
callq 0x1da69
leaq 0x108(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xaefc
leaq 0xd0(%rsp), %rdi
leaq 0x108(%rsp), %rdx
movl %ebx, %esi
callq 0x8c9a
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x9dc3
callq 0x6320
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
movq 0xd0(%rsp), %rbx
movq 0xd8(%rsp), %rax
movq %rax, 0xb0(%rsp)
cmpq %rax, %rbx
je 0xa068
leaq 0x30(%rsp), %r13
leaq 0x88(%rsp), %rbp
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r15
je 0x9e73
movq 0x48(%rbx), %rax
subq 0x40(%rbx), %rax
sarq $0x5, %rax
cmpq %rax, %r15
je 0x9e73
movzbl 0xf(%rsp), %esi
leaq 0x90(%rsp), %rdi
callq 0x8d41
movq 0x90(%rsp), %r14
movq 0x98(%rsp), %r15
cmpq %r14, %r15
je 0x9e73
movq %r14, %r12
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x9e62
callq 0x6320
addq $0x20, %r12
cmpq %r15, %r12
jne 0x9e53
movq %r14, 0x98(%rsp)
movq 0x48(%rbx), %r15
movq 0x40(%rbx), %rax
subq %rax, %r15
je 0xa0b7
cmpb $0x1, 0x1f38d(%rip)     # 0x29218
jne 0x9ebf
movq %r13, %rdi
movq %rbx, %rsi
callq 0xbd8e
movq 0x30(%rsp), %rsi
leaq 0x14b78(%rip), %rdi     # 0x1ea1c
xorl %eax, %eax
callq 0x6050
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x9ebf
callq 0x6320
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x12afa
movq 0x40(%rbx), %r14
movq 0x48(%rbx), %r12
movq %r12, %rax
subq %r14, %rax
sarq $0x5, %rax
movq %rax, 0xf8(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x100(%rsp)
movq %rax, 0xe8(%rsp)
movq %rcx, 0xf0(%rsp)
cmpq %r14, %r12
je 0x9faf
movq 0x78(%rsp), %rax
movq %rax, %rcx
subq 0x58(%rsp), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
movq 0x50(%rsp), %rax
movq 0x60(%rsp), %rdx
subq 0x68(%rsp), %rdx
sarq $0x7, %rdx
leaq (%rdx,%rcx,4), %rcx
subq 0x40(%rsp), %rax
sarq $0x7, %rax
addq %rcx, %rax
movq %rax, 0x88(%rsp)
movq %r14, 0xc0(%rsp)
leaq 0xf(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movq %rbp, %rsi
leaq 0xf8(%rsp), %rdx
leaq 0xe8(%rsp), %rcx
leaq 0xc0(%rsp), %r8
leaq 0xc8(%rsp), %r9
callq 0xbe00
addq $0x20, %r14
cmpq %r12, %r14
jne 0x9f22
movq %rbx, 0x88(%rsp)
leaq 0x90(%rsp), %rdi
movq %rbp, %rsi
callq 0xbe74
movq 0x40(%rsp), %rbp
movq 0x60(%rsp), %r12
cmpq %r12, %rbp
je 0xa03d
movq 0x50(%rsp), %r14
movq 0x58(%rsp), %r13
leaq 0x78(%rbp), %rdi
callq 0x65c0
movq 0x98(%rsp), %rax
leaq 0x18(%rbp), %rdx
movq -0x10(%rax), %rsi
cmpq -0x8(%rax), %rsi
je 0xa014
movl $0x9, %ecx
movq %rsi, %rdi
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
addq $0x48, -0x10(%rax)
jmp 0xa020
addq $-0x18, %rax
movq %rax, %rdi
callq 0x1547c
subq $-0x80, %rbp
cmpq %r14, %rbp
jne 0xa038
movq 0x8(%r13), %rbp
addq $0x8, %r13
leaq 0x200(%rbp), %r14
cmpq %r12, %rbp
jne 0x9fe0
sarq $0x5, %r15
leaq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0xbea0
addq $0x58, %rbx
cmpq 0xb0(%rsp), %rbx
leaq 0x88(%rsp), %rbp
jne 0x9e0e
movzbl 0xf(%rsp), %esi
leaq 0x90(%rsp), %rdi
callq 0x8d41
leaq 0x90(%rsp), %rdi
callq 0xbeea
leaq 0xd0(%rsp), %rdi
callq 0xad6c
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa0a3
callq 0x6320
xorl %eax, %eax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1492c(%rip), %rdi     # 0x1e9ea
leaq 0x145c3(%rip), %rsi     # 0x1e688
leaq 0x14939(%rip), %rcx     # 0x1ea05
movl $0x355, %edx            # imm = 0x355
callq 0x6210
leaq 0x15968(%rip), %rdi     # 0x1fa45
jmp 0xa0f0
callq 0x950b
jmp 0xa199
leaq 0x1591d(%rip), %rdi     # 0x1fa0d
callq 0x6500
movl $0x1, %edi
callq 0x63e0
jmp 0xa15b
movq %rax, %rbx
movq 0x138(%rsp), %rdi
jmp 0xa146
jmp 0xa15b
movq %rax, %rbx
movq 0x120(%rsp), %rdi
jmp 0xa12f
jmp 0xa15b
jmp 0xa221
movq %rax, %rbx
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
jne 0xa14f
jmp 0xa24f
jmp 0xa15b
movq %rax, %rbx
movq 0x158(%rsp), %rdi
cmpq %r15, %rdi
je 0xa24f
callq 0x6320
jmp 0xa24f
jmp 0xa15b
movq %rax, %rbx
jmp 0xa24f
movq %rax, %rbx
cmpl $0x2, %edx
jne 0xa1a0
movq %rbx, %rdi
callq 0x6110
leaq 0x1e206(%rip), %rsi     # 0x28380
leaq 0x30(%rsp), %rdi
callq 0xbc66
leaq 0x30(%rsp), %rbx
movq (%rbx), %rdi
callq 0x6500
movq %rbx, %rdi
callq 0x6130
xorl %edi, %edi
callq 0x63e0
cmpl $0x1, %edx
jne 0xa25e
movq %rbx, %rdi
callq 0x6110
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0x1465d(%rip), %rdi     # 0x1e81e
movq %rax, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x1e1ae(%rip), %rsi     # 0x28380
leaq 0x30(%rsp), %rdi
callq 0xbc66
leaq 0x30(%rsp), %rbx
movq (%rbx), %rsi
leaq 0x14656(%rip), %rdi     # 0x1e841
xorl %eax, %eax
callq 0x6050
movq %rbx, %rdi
callq 0x6130
jmp 0xa0f5
movq %rax, %rbx
callq 0x6580
jmp 0xa25e
movq %rax, %rbx
callq 0x6580
jmp 0xa25e
movq %rax, %rdi
callq 0xbcee
jmp 0xa221
jmp 0xa221
jmp 0xa228
movq %rax, %rbx
jmp 0xa235
jmp 0xa228
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xbea0
leaq 0x90(%rsp), %rdi
callq 0xbeea
leaq 0xd0(%rsp), %rdi
callq 0xad6c
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa25e
callq 0x6320
movq %rbx, %rdi
callq 0x65f0