// File: /workspace/github_cpp_makefile_star2_O1/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 0x1e9bc(%rip), %rdi     # 0x28380
callq 0xbc96
movabsq $-0x70a3d70a3d70a3d7, %rax # imm = 0x8F5C28F5C28F5C29
imulq 0x1f4e5(%rip), %rax     # 0x28ec0
rorq $0x2, %rax
movabsq $0x28f5c28f5c28f5d, %rcx # imm = 0x28F5C28F5C28F5D
cmpq %rcx, %rax
jae 0xa117
movq 0x1eeff(%rip), %rax     # 0x288f8
leaq 0x1eef8(%rip), %rdi     # 0x288f8
callq *0x10(%rax)
testb %al, %al
jne 0xa120
movq 0x1ed56(%rip), %rax     # 0x28768
leaq 0x1ed4f(%rip), %rdi     # 0x28768
callq *0x10(%rax)
movb %al, 0x1f7f6(%rip)      # 0x29218
callq 0x61c0
movl %eax, %ebx
callq 0xbdd2
movb %al, 0x17(%rsp)
callq 0x15ec5
leaq 0x14dff(%rip), %rdi     # 0x1e83d
movl %eax, %esi
xorl %eax, %eax
callq 0x6050
testl %ebx, %ebx
leaq 0x14e2b(%rip), %r12     # 0x1e87b
leaq 0x14e28(%rip), %r14     # 0x1e87f
movq %r14, %rsi
cmoveq %r12, %rsi
leaq 0x14df8(%rip), %rdi     # 0x1e85d
xorl %eax, %eax
callq 0x6050
cmpb $0x0, 0x17(%rsp)
movq %r14, %rsi
cmovneq %r12, %rsi
leaq 0x14e04(%rip), %rdi     # 0x1e883
xorl %eax, %eax
callq 0x6050
movq 0x1ec13(%rip), %rax     # 0x286a0
leaq 0x1ec0c(%rip), %rdi     # 0x286a0
callq *0x10(%rax)
testb %al, %al
movq %r14, %rsi
cmoveq %r12, %rsi
leaq 0x14dfa(%rip), %rdi     # 0x1e8a1
xorl %eax, %eax
callq 0x6050
callq 0x80b2
movl %eax, %ebx
andl $0x2, %eax
movl %eax, %ecx
shrl %ecx
testl %eax, %eax
movb %cl, 0x1e8b4(%rip)      # 0x28378
movq %r14, %r15
cmovneq %r12, %r15
leaq 0x14ded(%rip), %rdi     # 0x1e8bf
movq %r15, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x14dfa(%rip), %rdi     # 0x1e8dd
movq %r15, %rsi
xorl %eax, %eax
callq 0x6050
testb $0x4, %bl
movq %r14, %rsi
cmovneq %r12, %rsi
leaq 0x14dfd(%rip), %rdi     # 0x1e8fb
xorl %eax, %eax
callq 0x6050
testb $0x8, %bl
movq %r14, %rsi
cmovneq %r12, %rsi
leaq 0x14e03(%rip), %rdi     # 0x1e919
xorl %eax, %eax
callq 0x6050
cmpl $0x20, %ebx
movq %r12, %rsi
cmovbq %r14, %rsi
leaq 0x14e09(%rip), %rdi     # 0x1e937
xorl %eax, %eax
callq 0x6050
testb $0x10, %bl
cmovneq %r12, %r14
leaq 0x14e12(%rip), %rdi     # 0x1e955
movq %r14, %rsi
xorl %eax, %eax
callq 0x6050
callq 0xbdfc
movq %rax, %xmm0
punpckldq 0x144d1(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x144d9(%rip), %xmm0    # 0x1e040
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x144ed(%rip), %xmm1    # 0x1e068
movapd %xmm1, 0xb0(%rsp)
movq 0x1ea4d(%rip), %rax     # 0x285d8
leaq 0x1ea46(%rip), %rdi     # 0x285d8
callq *0x10(%rax)
movzbl %al, %edi
callq 0x165a7
leaq 0x14dcf(%rip), %rdi     # 0x1e973
movaps 0xb0(%rsp), %xmm0
movq %rax, %rsi
movb $0x1, %al
callq 0x6050
leaq 0x18(%rsp), %rdi
callq 0x9642
leaq 0x30(%rsp), %rdi
callq 0x15f8a
leaq 0x40(%rsp), %r14
movq -0x10(%r14), %rsi
leaq 0x14db3(%rip), %rdi     # 0x1e98d
xorl %eax, %eax
callq 0x6050
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x9bef
callq 0x6320
movq 0x20(%rsp), %r14
subq 0x18(%rsp), %r14
leaq 0x168(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x14db1(%rip), %rsi     # 0x1e9bd
leaq 0x14dac(%rip), %rdx     # 0x1e9bf
leaq 0x158(%rsp), %rdi
callq 0xe0a8
leaq 0x30(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x158(%rsp), %rdx
callq 0xa2a7
sarq $0x2, %r14
movq 0x30(%rsp), %rdx
leaq 0x14d5c(%rip), %rdi     # 0x1e9a3
movq %r14, %rsi
xorl %eax, %eax
callq 0x6050
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x9c65
callq 0x6320
movq 0x158(%rsp), %rdi
cmpq %r15, %rdi
je 0x9c77
callq 0x6320
movq 0x1ed42(%rip), %rax     # 0x289c0
leaq 0x1ed3b(%rip), %rdi     # 0x289c0
callq *0x10(%rax)
testb %al, %al
jne 0x9d91
leaq 0x120(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xaf46
leaq 0x30(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x9786
movq 0x18(%rsp), %rdi
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
testq %rdi, %rdi
je 0x9ce8
callq 0x6320
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x9cf7
callq 0x6320
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x9d09
callq 0x6320
movq 0x20(%rsp), %r14
subq 0x18(%rsp), %r14
leaq 0x148(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x14c97(%rip), %rsi     # 0x1e9bd
leaq 0x14c92(%rip), %rdx     # 0x1e9bf
leaq 0x138(%rsp), %rdi
callq 0xe0a8
leaq 0x30(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x138(%rsp), %rdx
callq 0xa2a7
sarq $0x2, %r14
movq 0x30(%rsp), %rdx
leaq 0x14c5f(%rip), %rdi     # 0x1e9c0
movq %r14, %rsi
xorl %eax, %eax
callq 0x6050
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x9d7f
callq 0x6320
movq 0x138(%rsp), %rdi
cmpq %r15, %rdi
je 0x9d91
callq 0x6320
movq 0x1ecf0(%rip), %rax     # 0x28a88
leaq 0x1ece9(%rip), %rdi     # 0x28a88
callq *0x10(%rax)
testb $0x8, %bl
jne 0x9daf
testb %al, %al
jne 0xa12a
movq 0x1f10a(%rip), %rax     # 0x28ec0
movq %rax, 0xc8(%rsp)
cmpb $0x1, 0x1e5b3(%rip)     # 0x28378
jne 0x9dcc
callq 0x1dd29
leaq 0x108(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xaf46
leaq 0xd0(%rsp), %rdi
leaq 0x108(%rsp), %rdx
movl %ebx, %esi
callq 0x8d16
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x9e07
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 0xa0a9
leaq 0x30(%rsp), %r13
leaq 0x88(%rsp), %rbp
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r15
je 0x9eb7
movq 0x48(%rbx), %rax
subq 0x40(%rbx), %rax
sarq $0x5, %rax
cmpq %rax, %r15
je 0x9eb7
movzbl 0x17(%rsp), %esi
leaq 0x90(%rsp), %rdi
callq 0x8dbd
movq 0x90(%rsp), %r14
movq 0x98(%rsp), %r15
cmpq %r14, %r15
je 0x9eb7
movq %r14, %r12
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x9ea6
callq 0x6320
addq $0x20, %r12
cmpq %r15, %r12
jne 0x9e97
movq %r14, 0x98(%rsp)
movq 0x48(%rbx), %r15
movq 0x40(%rbx), %rax
subq %rax, %r15
je 0xa0f8
cmpb $0x1, 0x1f349(%rip)     # 0x29218
jne 0x9f03
movq %r13, %rdi
movq %rbx, %rsi
callq 0xbe66
movq 0x30(%rsp), %rsi
leaq 0x14b24(%rip), %rdi     # 0x1ea0c
xorl %eax, %eax
callq 0x6050
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x9f03
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 0x12d40
movq 0x40(%rbx), %r14
movq 0x48(%rbx), %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)
movq 0x48(%rbx), %r12
cmpq %r12, %r14
je 0x9ff0
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 0x17(%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 0xbed8
addq $0x20, %r14
jmp 0x9f5e
movq %rbx, 0x88(%rsp)
leaq 0x90(%rsp), %rdi
movq %rbp, %rsi
callq 0xbf52
movq 0x40(%rsp), %rbp
movq 0x60(%rsp), %r12
cmpq %r12, %rbp
je 0xa07e
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 0xa055
movl $0x9, %ecx
movq %rsi, %rdi
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
addq $0x48, -0x10(%rax)
jmp 0xa061
addq $-0x18, %rax
movq %rax, %rdi
callq 0x15708
subq $-0x80, %rbp
cmpq %r14, %rbp
jne 0xa079
movq 0x8(%r13), %rbp
addq $0x8, %r13
leaq 0x200(%rbp), %r14
cmpq %r12, %rbp
jne 0xa021
sarq $0x5, %r15
leaq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0xbf7e
addq $0x58, %rbx
cmpq 0xb0(%rsp), %rbx
leaq 0x88(%rsp), %rbp
jne 0x9e52
movzbl 0x17(%rsp), %esi
leaq 0x90(%rsp), %rdi
callq 0x8dbd
leaq 0x90(%rsp), %rdi
callq 0xbfc8
leaq 0xd0(%rsp), %rdi
callq 0xadb6
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xa0e4
callq 0x6320
xorl %eax, %eax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x148db(%rip), %rdi     # 0x1e9da
leaq 0x14572(%rip), %rsi     # 0x1e678
leaq 0x148e8(%rip), %rcx     # 0x1e9f5
movl $0x355, %edx            # imm = 0x355
callq 0x6210
leaq 0x15917(%rip), %rdi     # 0x1fa35
jmp 0xa131
callq 0x9552
jmp 0xa1da
leaq 0x158cc(%rip), %rdi     # 0x1f9fd
callq 0x6500
movl $0x1, %edi
callq 0x63e0
jmp 0xa19c
movq %rax, %rbx
movq 0x138(%rsp), %rdi
jmp 0xa187
jmp 0xa19c
movq %rax, %rbx
movq 0x120(%rsp), %rdi
jmp 0xa170
jmp 0xa19c
jmp 0xa262
movq %rax, %rbx
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
jne 0xa190
jmp 0xa290
jmp 0xa19c
movq %rax, %rbx
movq 0x158(%rsp), %rdi
cmpq %r15, %rdi
je 0xa290
callq 0x6320
jmp 0xa290
jmp 0xa19c
movq %rax, %rbx
jmp 0xa290
movq %rax, %rbx
cmpl $0x2, %edx
jne 0xa1e1
movq %rbx, %rdi
callq 0x6110
leaq 0x1e1c5(%rip), %rsi     # 0x28380
leaq 0x30(%rsp), %rdi
callq 0xbd3e
leaq 0x30(%rsp), %rbx
movq (%rbx), %rdi
callq 0x6500
movq %rbx, %rdi
callq 0x6130
xorl %edi, %edi
callq 0x63e0
cmpl $0x1, %edx
jne 0xa29f
movq %rbx, %rdi
callq 0x6110
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0x1460c(%rip), %rdi     # 0x1e80e
movq %rax, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x1e16d(%rip), %rsi     # 0x28380
leaq 0x30(%rsp), %rdi
callq 0xbd3e
leaq 0x30(%rsp), %rbx
movq (%rbx), %rsi
leaq 0x14605(%rip), %rdi     # 0x1e831
xorl %eax, %eax
callq 0x6050
movq %rbx, %rdi
callq 0x6130
jmp 0xa136
movq %rax, %rbx
callq 0x6580
jmp 0xa29f
movq %rax, %rbx
callq 0x6580
jmp 0xa29f
movq %rax, %rdi
callq 0xbdc6
jmp 0xa262
jmp 0xa262
jmp 0xa269
movq %rax, %rbx
jmp 0xa276
jmp 0xa269
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xbf7e
leaq 0x90(%rsp), %rdi
callq 0xbfc8
leaq 0xd0(%rsp), %rdi
callq 0xadb6
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xa29f
callq 0x6320
movq %rbx, %rdi
callq 0x65f0