// File: /workspace/github_cpp_makefile_star2_O1/quiath[P]fast-atoi/main.cpp
// Function: void test<int (*)(char const*)>(unsigned long, int (*)(char const*), std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long long, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, unsigned long long>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void test(unsigned long rep, 
          F f, 
          const std::vector<std::string>& v, 
          Name2Time& best, 
          const std::string& name)
{
    try
    {
        const char* b = 0;

        myint r = 0;
        auto et0 = std::chrono::system_clock::now();
        std::clock_t t0 = std::clock();
        for (unsigned int i = 0; i < rep; ++i)
        {
            unsigned int ii = i % v.size();
            b = v[ii].c_str();
            r += f(b);
        }
        std::clock_t t = std::clock();
        auto et = std::chrono::system_clock::now() - et0;
        
        std::cout << name << ":" << std::setw(18) << r << "," <<
                     std::setw(10) << t - t0 << ", " << 
                     std::setw(10) << et.count() << std::endl;
        if (name.length() > 0)
        {
            std::string ename = "e." + name;
            std::string cname = "c." + name;
            auto bt = best[ename];
            if (bt == 0 || bt > et.count()) { best[ename] = et.count(); }
            bt = best[cname];
            if (bt == 0 || bt > t - t0) { best[cname] = t - t0; }
        }
    }
    catch(std::exception& exc)
    {
        std::cout << "ERROR" << std::endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r14
movq %rcx, (%rsp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
callq 0x2050
movq %rax, 0x8(%rsp)
callq 0x2140
movq %rax, 0x10(%rsp)
testq %r13, %r13
je 0x3e36
movl $0x1, %ebp
xorl %eax, %eax
xorl %ebx, %ebx
movq (%r15), %rcx
movq 0x8(%r15), %rsi
subq %rcx, %rsi
sarq $0x5, %rsi
xorl %edx, %edx
divq %rsi
shlq $0x5, %rdx
movq (%rcx,%rdx), %rdi
callq *%r12
cltq
addq %rax, %rbx
movl %ebp, %eax
incl %ebp
cmpq %r13, %rax
jb 0x3e08
jmp 0x3e38
xorl %ebx, %ebx
callq 0x2140
movq %rax, %r15
callq 0x2050
movq %rax, %r12
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x4172(%rip), %rdi      # 0x7fc8
callq 0x2250
movq %rax, %r13
leaq 0x1387(%rip), %rsi      # 0x51ec
movl $0x1, %edx
movq %rax, %rdi
callq 0x2250
movq (%r13), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%r13,%rax)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2200
movq %rax, %rbx
leaq 0x13e4(%rip), %rsi      # 0x527c
movl $0x1, %edx
movq %rax, %rdi
callq 0x2250
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xa, 0x10(%rbx,%rax)
subq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2200
movq %rax, %rbx
leaq 0x1439(%rip), %rsi      # 0x5308
movl $0x2, %edx
movq %rax, %rdi
callq 0x2250
subq 0x8(%rsp), %r12
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xa, 0x10(%rbx,%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2200
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
cmpq $0x0, 0x8(%r14)
movq (%rsp), %rbx
je 0x3fd3
leaq 0x13cf(%rip), %rsi      # 0x530b
leaq 0x38(%rsp), %rdi
movq %r14, %rdx
callq 0x3d0b
leaq 0x13be(%rip), %rsi      # 0x530e
leaq 0x18(%rsp), %rdi
movq %r14, %rdx
callq 0x3d0b
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x4bd4
movq (%rax), %rax
decq %rax
cmpq %r12, %rax
jb 0x3f85
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x4bd4
movq %r12, (%rax)
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x4bd4
movq (%rax), %rax
decq %rax
cmpq %r15, %rax
jb 0x3fad
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x4bd4
movq %r15, (%rax)
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fc0
callq 0x21f0
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fd3
callq 0x21f0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movq %rax, %rbx
jmp 0x4005
jmp 0x401c
movq %rdx, %r14
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4005
callq 0x21f0
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4022
callq 0x21f0
jmp 0x4022
jmp 0x401c
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x4066
movq %rbx, %rdi
callq 0x20e0
movq 0x3f91(%rip), %rdi      # 0x7fc8
leaq 0x12d3(%rip), %rsi      # 0x5311
movl $0x5, %edx
callq 0x2250
movq 0x3f79(%rip), %rdi      # 0x7fc8
callq 0x2100
callq 0x22b0
jmp 0x3fd3
movq %rax, %rbx
callq 0x22b0
movq %rbx, %rdi
callq 0x22d0
movq %rax, %rdi
callq 0x4322