// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movq %rcx, (%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
callq 0x2040
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
callq 0x2120
xorl %ebx, %ebx
movq %rax, 0x10(%rsp)
movl %ebp, %ebp
cmpq %r13, %rbp
jae 0x36b6
movq (%r14), %rcx
movq 0x8(%r14), %rsi
movq %rbp, %rax
xorl %edx, %edx
subq %rcx, %rsi
sarq $0x5, %rsi
divq %rsi
shlq $0x5, %rdx
movq (%rcx,%rdx), %rdi
callq *%r12
cltq
incl %ebp
addq %rax, %rbx
jmp 0x3685
callq 0x2120
movq %rax, %r14
callq 0x2040
movq %rax, %r12
movq 0x48fb(%rip), %rdi      # 0x7fc8
movq %r15, %rsi
callq 0x2190
leaq 0x1b10(%rip), %rsi      # 0x51ec
movq %rax, %rdi
callq 0x21c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x12, 0x10(%rax,%rcx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21b0
leaq 0x1b76(%rip), %rsi      # 0x527c
movq %rax, %rdi
callq 0x21c0
movq (%rax), %rcx
subq 0x10(%rsp), %r14
movq -0x18(%rcx), %rcx
movq $0xa, 0x10(%rax,%rcx)
movq %rax, %rdi
movq %r14, %rsi
callq 0x21b0
leaq 0x1ba9(%rip), %rsi      # 0x52de
movq %rax, %rdi
callq 0x21c0
movq (%rax), %rcx
subq 0x8(%rsp), %r12
movq -0x18(%rcx), %rcx
movq $0xa, 0x10(%rax,%rcx)
movq %rax, %rdi
movq %r12, %rsi
callq 0x21b0
movq %rax, %rdi
callq 0x20e0
cmpq $0x0, 0x8(%r15)
movq (%rsp), %rbx
je 0x3800
leaq 0x1b66(%rip), %rsi      # 0x52e1
leaq 0x38(%rsp), %rdi
movq %r15, %rdx
callq 0x3598
leaq 0x1b55(%rip), %rsi      # 0x52e4
leaq 0x18(%rsp), %rdi
movq %r15, %rdx
callq 0x3598
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x407a
movq (%rax), %rax
decq %rax
cmpq %r12, %rax
jb 0x37c4
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x407a
movq %r12, (%rax)
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x407a
movq (%rax), %rax
decq %rax
cmpq %r14, %rax
jb 0x37ec
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x407a
movq %r14, (%rax)
leaq 0x18(%rsp), %rdi
callq 0x20d0
leaq 0x38(%rsp), %rdi
callq 0x20d0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movq %rax, %rbx
jmp 0x3829
jmp 0x3837
leaq 0x18(%rsp), %rdi
movq %rdx, %r14
movq %rax, %rbx
callq 0x20d0
leaq 0x38(%rsp), %rdi
callq 0x20d0
jmp 0x383d
jmp 0x3837
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x3875
movq %rbx, %rdi
callq 0x20b0
movq 0x4776(%rip), %rdi      # 0x7fc8
leaq 0x1a8e(%rip), %rsi      # 0x52e7
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
callq 0x2280
jmp 0x3800
movq %rax, %rbx
callq 0x2280
movq %rbx, %rdi
callq 0x22a0
movq %rax, %rdi
callq 0x3ab9