// File: /workspace/github_cpp_makefile_star2_O2/quiath[P]fast-atoi/main.cpp
// Function: unit_test()
void unit_test()
{
    std::vector<myint (*)(const char *)> v = { atoisimple, fastatoi, fastatoiadd, fastatoiaddunr };
    std::vector<std::string> sv = { "0", " 1", " 2", "\t 3", "4x", "5%", 
                                    "  10  ", " 99.", "100", "12345", "999999",
                                    "-1", " -2x", "   +123456+", " -345", "\n\v8I",
                                    " fake", "values", " +", "    zero  "};
    for (auto pf : v)
    {
       for (const auto s: sv)
       {
           assert((*pf)(s.c_str()) == atoi(s.c_str()));
       }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
vmovups 0x57d4(%rip), %ymm0     # 0x7d80
leaq 0x50(%rsp), %rsi
leaq 0x38(%rsp), %rdi
vmovups %ymm0, (%rsi)
pushq $0x4
popq %rdx
leaq 0x20(%rsp), %rcx
vzeroupper
callq 0x345a
leaq 0x50(%rsp), %rbx
leaq 0x2a78(%rip), %rsi      # 0x504e
leaq 0x17(%rsp), %rdx
movq %rbx, %rdi
callq 0x20a0
leaq 0x70(%rsp), %r14
leaq 0x2a41(%rip), %rsi      # 0x5030
leaq 0x16(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x90(%rsp), %r14
leaq 0x2a28(%rip), %rsi      # 0x5033
leaq 0x15(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0xb0(%rsp), %r14
leaq 0x2a0f(%rip), %rsi      # 0x5036
leaq 0x14(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0xd0(%rsp), %r14
leaq 0x29f7(%rip), %rsi      # 0x503a
leaq 0x13(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0xf0(%rsp), %r14
leaq 0x29de(%rip), %rsi      # 0x503d
leaq 0x12(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x110(%rsp), %r14
leaq 0x29c5(%rip), %rsi      # 0x5040
leaq 0x11(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x130(%rsp), %r14
leaq 0x29b0(%rip), %rsi      # 0x5047
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x150(%rsp), %r14
leaq 0x2999(%rip), %rsi      # 0x504c
leaq 0xf(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x170(%rsp), %r14
leaq 0x2981(%rip), %rsi      # 0x5050
leaq 0xe(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x190(%rsp), %r14
leaq 0x296b(%rip), %rsi      # 0x5056
leaq 0xd(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x1b0(%rsp), %r14
leaq 0x2956(%rip), %rsi      # 0x505d
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x1d0(%rsp), %r14
leaq 0x293d(%rip), %rsi      # 0x5060
leaq 0xb(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x1f0(%rsp), %r14
leaq 0x2926(%rip), %rsi      # 0x5065
leaq 0xa(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x210(%rsp), %r14
leaq 0x2916(%rip), %rsi      # 0x5071
leaq 0x9(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x230(%rsp), %r14
leaq 0x2900(%rip), %rsi      # 0x5077
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x250(%rsp), %r14
leaq 0x28e9(%rip), %rsi      # 0x507c
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x270(%rsp), %r14
leaq 0x28d3(%rip), %rsi      # 0x5082
leaq 0x6(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x290(%rsp), %r14
leaq 0x2914(%rip), %rsi      # 0x50df
leaq 0x5(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x2b0(%rsp), %r14
leaq 0x28a2(%rip), %rsi      # 0x5089
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
callq 0x20a0
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
pushq $0x14
popq %rdx
leaq 0x3(%rsp), %rcx
callq 0x3492
movl $0x260, %ebx            # imm = 0x260
leaq 0x50(%rsp,%rbx), %rdi
callq 0x20d0
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x2810
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %r12
leaq 0x50(%rsp), %rbx
movq %rax, 0x18(%rsp)
cmpq 0x18(%rsp), %r12
je 0x288c
movq (%r12), %rbp
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %r13
cmpq %r13, %r14
je 0x2886
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2220
movq 0x50(%rsp), %rdi
callq *%rbp
movq 0x50(%rsp), %rdi
movq %rax, %r15
callq 0x22e0
cltq
cmpq %rax, %r15
jne 0x28b2
movq %rbx, %rdi
callq 0x20d0
addq $0x20, %r14
jmp 0x284d
addq $0x8, %r12
jmp 0x2838
leaq 0x20(%rsp), %rdi
callq 0x34ce
leaq 0x38(%rsp), %rdi
callq 0x3b80
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27db(%rip), %rdi      # 0x5094
leaq 0x27f8(%rip), %rsi      # 0x50b8
leaq 0x27fa(%rip), %rcx      # 0x50c1
movl $0xfc, %edx
callq 0x2110
movl $0x260, %r12d           # imm = 0x260
movq %rax, %r15
leaq 0x50(%rsp,%r12), %rdi
callq 0x20d0
addq $-0x20, %r12
cmpq $-0x20, %r12
jne 0x28da
movb $0x1, %al
jmp 0x291b
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
jmp 0x2916
movq %rax, %r15
xorl %eax, %eax
cmpq %r14, %rbx
sete %cl
testb %al, %al
jne 0x295d
testb %cl, %cl
jne 0x295d
addq $-0x20, %r14
movq %r14, %rdi
callq 0x20d0
cmpq %rbx, %r14
jne 0x2929
jmp 0x295d
movq %rax, %r15
jmp 0x295d
movq %rax, %r15
jmp 0x2953
leaq 0x50(%rsp), %rdi
movq %rax, %r15
callq 0x20d0
leaq 0x20(%rsp), %rdi
callq 0x34ce
leaq 0x38(%rsp), %rdi
callq 0x3b80
movq %r15, %rdi
callq 0x22a0