// File: /workspace/github_cpp_makefile_star2_O3/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 0x3e28
movl $0x1, %ebp
xorl %eax, %eax
xorl %ebx, %ebx
movq (%r15), %rcx
movq 0x8(%r15), %rsi
xorl %edx, %edx
subq %rcx, %rsi
sarq $0x5, %rsi
divq %rsi
shlq $0x5, %rdx
movq (%rcx,%rdx), %rdi
callq *%r12
cltq
addq %rax, %rbx
movl %ebp, %eax
incl %ebp
cmpq %r13, %rax
jb 0x3dfa
jmp 0x3e2a
xorl %ebx, %ebx
callq 0x2140
movq %rax, %r15
callq 0x2050
movq 0x8(%r14), %rdx
movq (%r14), %rsi
movq %rax, %r12
movq 0x4180(%rip), %rdi      # 0x7fc8
callq 0x2250
leaq 0x1398(%rip), %rsi      # 0x51ec
movl $0x1, %edx
movq %rax, %rdi
movq %rax, %r13
callq 0x2250
movq (%r13), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%r13,%rax)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2200
leaq 0x13f5(%rip), %rsi      # 0x527c
movl $0x1, %edx
movq %rax, %rdi
movq %rax, %rbx
callq 0x2250
movq (%rbx), %rax
subq 0x10(%rsp), %r15
movq -0x18(%rax), %rax
movq $0xa, 0x10(%rbx,%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2200
leaq 0x144a(%rip), %rsi      # 0x5308
movl $0x2, %edx
movq %rax, %rdi
movq %rax, %rbx
callq 0x2250
movq (%rbx), %rax
subq 0x8(%rsp), %r12
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 0x3fc5
leaq 0x13dd(%rip), %rsi      # 0x530b
leaq 0x38(%rsp), %rdi
movq %r14, %rdx
callq 0x3cfd
leaq 0x13cc(%rip), %rsi      # 0x530e
leaq 0x18(%rsp), %rdi
movq %r14, %rdx
callq 0x3cfd
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b8c
movq (%rax), %rax
decq %rax
cmpq %r12, %rax
jb 0x3f77
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b8c
movq %r12, (%rax)
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b8c
movq (%rax), %rax
decq %rax
cmpq %r15, %rax
jb 0x3f9f
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b8c
movq %r15, (%rax)
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fb2
callq 0x21f0
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fc5
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 0x3ff7
jmp 0x400e
leaq 0x28(%rsp), %rcx
movq %rdx, %r14
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x3ff7
callq 0x21f0
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4014
callq 0x21f0
jmp 0x4014
jmp 0x400e
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x4058
movq %rbx, %rdi
callq 0x20e0
movq 0x3f9f(%rip), %rdi      # 0x7fc8
leaq 0x12e1(%rip), %rsi      # 0x5311
movl $0x5, %edx
callq 0x2250
movq 0x3f87(%rip), %rdi      # 0x7fc8
callq 0x2100
callq 0x22b0
jmp 0x3fc5
movq %rax, %rbx
callq 0x22b0
movq %rbx, %rdi
callq 0x22d0
movq %rax, %rdi
callq 0x4314