// File: /workspace/github_cpp_makefile_star2_O1/danishansari[P]NumberToText/test/testConvertor.cpp
// Function: main
int main(int argc, char*argv[])
{
    if (argc < 2)
    {
        cout << "usage: " << endl;
        cout << argv[0] << "-l <language(def=english)>\t e.g. " << argv[0] << " -l english 123" << endl;
        cout << argv[0] << "-r <range(any number)>    \t e.g  " << argv[0] << " -r 99" << endl;
        cout << argv[0] << "1 2 3 4 ...               \t e.g. " << argv[0] << " 1 99 156"<< endl;

        return -1;
    }

    vector<string> numbersVec;

    string lang = "english";

    int range = 0;
    
    for (int i = 1; i < argc; i++)
    {
        if (strcmp(argv[i], "-l") == 0)
            lang = argv[++i];
        if (strcmp(argv[i], "-r") == 0)
            range = atoi(argv[++i]);
        else
            numbersVec.push_back(string(argv[i]));
    }

    if (range)
    {
        numbersVec.clear();

        for (int i = 0; i < range; i++)
        {
            stringstream ss;
            ss << i;

            numbersVec.push_back(ss.str());
        }
    }

    NumToText* convertor = NumToText::getConvertor(lang);

    if (convertor)
    {
        for (int i = 0; i < numbersVec.size(); i++)
            cout << numbersVec[i] << ": " << convertor->convert(numbersVec[i]) << endl;
    }
    else
        cout << "could not convert!!" << endl;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rsi, %rbx
movl %edi, -0x54(%rbp)
cmpl $0x1, %edi
jg 0x33d8
movq 0x3c66(%rip), %r14      # 0x6fd8
leaq 0x1c8b(%rip), %rsi      # 0x5004
movl $0x7, %edx
movq %r14, %rdi
callq 0x2150
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq (%rbx), %r15
testq %r15, %r15
je 0x3730
movq %r15, %rdi
callq 0x2090
movq 0x3c10(%rip), %rdi      # 0x6fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x2150
jmp 0x3748
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1c9d(%rip), %rsi      # 0x5093
leaq 0x1c9d(%rip), %rdx      # 0x509a
leaq -0x78(%rbp), %rdi
callq 0x3c56
movq $0x0, -0x30(%rbp)
movl $0x1, %r14d
leaq -0x260(%rbp), %r15
movslq %r14d, %r12
movq (%rbx,%r12,8), %rdi
leaq 0x1c72(%rip), %rsi      # 0x509b
callq 0x2160
testl %eax, %eax
jne 0x345a
movq 0x8(%rbx,%r12,8), %r12
movq -0x70(%rbp), %r13
movq %r12, %rdi
callq 0x2090
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x2190
incl %r14d
movslq %r14d, %r13
movq (%rbx,%r13,8), %r12
movq %r12, %rdi
leaq 0x1c33(%rip), %rsi      # 0x509e
callq 0x2160
testl %eax, %eax
je 0x34b6
movq %r15, %rdi
movq %r12, %rsi
leaq -0xb8(%rbp), %rdx
callq 0x3b14
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x3cf0
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0x34c8
movq -0x250(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x34c8
leal 0x1(%r13), %r14d
movq 0x8(%rbx,%r13,8), %rdi
callq 0x21a0
movq %rax, -0x30(%rbp)
incl %r14d
cmpl -0x54(%rbp), %r14d
jl 0x341b
cmpl $0x0, -0x30(%rbp)
je 0x35b1
movq -0x50(%rbp), %rbx
movq -0x48(%rbp), %r14
cmpq %rbx, %r14
je 0x3518
leaq 0x10(%rbx), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x3504
movq (%r15), %rsi
incq %rsi
callq 0x2140
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x34f0
movq %rbx, -0x48(%rbp)
cmpl $0x0, -0x30(%rbp)
jle 0x35b1
xorl %r15d, %r15d
leaq -0x260(%rbp), %r13
leaq -0xb8(%rbp), %rbx
leaq -0x50(%rbp), %r14
movq 0x3a82(%rip), %r12      # 0x6fc0
movq %r13, %rdi
callq 0x20c0
leaq -0x250(%rbp), %rdi
movl %r15d, %esi
callq 0x21f0
movq %rbx, %rdi
leaq -0x248(%rbp), %rsi
callq 0x21c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3cf0
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x3591
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2140
movq %r13, %rdi
movq %r12, %rsi
callq 0x20e0
leaq -0x1e0(%rbp), %rdi
callq 0x2070
incl %r15d
cmpl %r15d, -0x30(%rbp)
jne 0x353e
leaq -0xc8(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd8(%rbp), %rdi
callq 0x3bbc
leaq -0xd8(%rbp), %rdi
callq 0x4838
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r14, %rdi
je 0x35fd
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2140
testq %rbx, %rbx
je 0x397d
movq -0x50(%rbp), %rax
cmpq %rax, -0x48(%rbp)
je 0x39c3
movl $0x8, %r13d
xorl %r15d, %r15d
leaq -0x98(%rbp), %r12
movq -0x8(%rax,%r13), %rsi
movq (%rax,%r13), %rdx
movq 0x39a4(%rip), %rdi      # 0x6fd8
callq 0x2150
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x19be(%rip), %rsi      # 0x5009
callq 0x2150
movq -0x50(%rbp), %rax
leaq -0x88(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movq -0x8(%rax,%r13), %rsi
movq (%rax,%r13), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3bbc
movq (%rbx), %rax
leaq -0x260(%rbp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq *(%rax)
movq -0x260(%rbp), %rsi
movq -0x258(%rbp), %rdx
movq %r14, %rdi
callq 0x2150
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0x36ea
movq -0x250(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x370c
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2140
incq %r15
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r13
cmpq %r15, %rcx
ja 0x3624
jmp 0x39c3
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21e0
movq 0x3889(%rip), %r14      # 0x6fd8
leaq 0x18b6(%rip), %rsi      # 0x500c
movl $0x21, %edx
movq %r14, %rdi
callq 0x2150
movq (%rbx), %r15
testq %r15, %r15
je 0x3787
movq %r15, %rdi
callq 0x2090
movq 0x385e(%rip), %rdi      # 0x6fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x2150
jmp 0x379f
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21e0
leaq 0x1888(%rip), %rsi      # 0x502e
movl $0xf, %edx
movq %r14, %rdi
callq 0x2150
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq (%rbx), %r15
testq %r15, %r15
je 0x37fe
movq %r15, %rdi
callq 0x2090
movq 0x37e7(%rip), %rdi      # 0x6fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x2150
jmp 0x3816
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21e0
movq 0x37bb(%rip), %r14      # 0x6fd8
leaq 0x181a(%rip), %rsi      # 0x503e
movl $0x21, %edx
movq %r14, %rdi
callq 0x2150
movq (%rbx), %r15
testq %r15, %r15
je 0x3855
movq %r15, %rdi
callq 0x2090
movq 0x3790(%rip), %rdi      # 0x6fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x2150
jmp 0x386d
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21e0
leaq 0x17ec(%rip), %rsi      # 0x5060
movl $0x6, %edx
movq %r14, %rdi
callq 0x2150
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq (%rbx), %r15
testq %r15, %r15
je 0x38cc
movq %r15, %rdi
callq 0x2090
movq 0x3719(%rip), %rdi      # 0x6fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x2150
jmp 0x38e4
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21e0
movq 0x36ed(%rip), %r14      # 0x6fd8
leaq 0x1775(%rip), %rsi      # 0x5067
movl $0x21, %edx
movq %r14, %rdi
callq 0x2150
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x3923
movq %rbx, %rdi
callq 0x2090
movq 0x36c2(%rip), %rdi      # 0x6fd8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2150
jmp 0x393b
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21e0
leaq 0x1747(%rip), %rsi      # 0x5089
movl $0x9, %edx
movq %r14, %rdi
callq 0x2150
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x39e7
movq 0x3654(%rip), %rbx      # 0x6fd8
leaq 0x1716(%rip), %rsi      # 0x50a1
movl $0x13, %edx
movq %rbx, %rdi
callq 0x2150
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq 0x3622(%rip), %rdi      # 0x6fd8
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x39dc
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2140
leaq -0x50(%rbp), %rdi
callq 0x3b52
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r14, %rdi
je 0x3aea
movq -0xc8(%rbp), %rsi
jmp 0x3ae2
movq %rax, %rbx
jmp 0x3b03
jmp 0x3a9e
jmp 0x3a9e
jmp 0x3a9e
movq %rax, %rbx
jmp 0x3ac8
jmp 0x3a9e
jmp 0x3a32
movq %rax, %rbx
jmp 0x3a5c
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x3a5c
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x355d(%rip), %rsi      # 0x6fc0
leaq -0x260(%rbp), %rdi
callq 0x20e0
leaq -0x1e0(%rbp), %rdi
callq 0x2070
jmp 0x3aea
movq %rax, %rbx
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0x3aea
movq -0x250(%rbp), %rsi
jmp 0x3ae2
jmp 0x3a9e
movq %rax, %rbx
jmp 0x3aea
movq %rax, %rbx
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0x3ac8
movq -0x250(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x3aea
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x3b03
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2140
leaq -0x50(%rbp), %rdi
callq 0x3b52
movq %rbx, %rdi
callq 0x2200