// File: /workspace/github_cpp_makefile_star2_O2/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
cmpl $0x1, %edi
jg 0x2ed6
movq 0x41d5(%rip), %r14      # 0x6fd8
leaq 0x11fa(%rip), %rsi      # 0x4004
movq %r14, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x2130
leaq 0x11e0(%rip), %rsi      # 0x400c
movq %rax, %rdi
callq 0x2130
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2130
leaq 0x11e8(%rip), %rsi      # 0x402e
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x2130
leaq 0x11d6(%rip), %rsi      # 0x403e
movq %rax, %rdi
callq 0x2130
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2130
leaq 0x11de(%rip), %rsi      # 0x4060
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x2130
leaq 0x11c3(%rip), %rsi      # 0x4067
movq %rax, %rdi
callq 0x2130
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2130
leaq 0x11cb(%rip), %rsi      # 0x4089
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
pushq $-0x1
popq %rax
jmp 0x3110
movl %edi, %r15d
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
andq $0x0, -0x40(%rbp)
leaq 0x11a7(%rip), %rsi      # 0x4093
leaq -0x70(%rbp), %rdi
leaq -0x258(%rbp), %rdx
callq 0x31ac
pushq $0x1
popq %r12
movl $0x0, -0x30(%rbp)
leaq -0x258(%rbp), %r13
cmpl %r15d, %r12d
jge 0x2f91
movslq %r12d, %r14
movq (%rbx,%r14,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x2f54
cmpb $0x6c, 0x1(%rsi)
jne 0x2f48
cmpb $0x0, 0x2(%rsi)
jne 0x2f48
movq 0x8(%rbx,%r14,8), %rsi
leaq -0x70(%rbp), %rdi
callq 0x2220
incl %r12d
incq %r14
movq (%rbx,%r14,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x2f54
cmpb $0x72, 0x1(%rsi)
jne 0x2f54
cmpb $0x0, 0x2(%rsi)
je 0x2f7c
movq %r13, %rdi
leaq -0xd0(%rbp), %rdx
callq 0x31ac
leaq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x3332
movq %r13, %rdi
callq 0x2090
incl %r12d
jmp 0x2f0e
movslq %r12d, %rax
incl %r12d
movq 0x8(%rbx,%rax,8), %rdi
callq 0x21a0
movl %eax, -0x30(%rbp)
jmp 0x2f77
cmpl $0x0, -0x30(%rbp)
je 0x300b
leaq -0x50(%rbp), %rdi
callq 0x31e8
leaq -0x240(%rbp), %r12
xorl %r13d, %r13d
movl -0x30(%rbp), %r14d
testl %r14d, %r14d
cmovlel %r13d, %r14d
leaq -0x258(%rbp), %rbx
leaq -0xd0(%rbp), %r15
cmpl %r13d, %r14d
je 0x300b
movq %rbx, %rdi
callq 0x20c0
leaq -0x248(%rbp), %rdi
movl %r13d, %esi
callq 0x21e0
movq %r15, %rdi
movq %r12, %rsi
callq 0x21c0
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x3332
movq %r15, %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x20e0
incl %r13d
jmp 0x2fc3
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2170
leaq -0x90(%rbp), %rdi
callq 0x3d18
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x2090
testq %rbx, %rbx
je 0x30e1
movq %rbx, -0x30(%rbp)
xorl %r15d, %r15d
leaq -0x258(%rbp), %r14
xorl %r12d, %r12d
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r12, %rax
jbe 0x30fc
addq %r15, %rsi
movq 0x3f66(%rip), %rdi      # 0x6fd8
callq 0x2120
movq %rax, %rdi
leaq 0xf88(%rip), %rsi       # 0x4009
callq 0x2130
movq %rax, %rbx
movq -0x50(%rbp), %rsi
addq %r15, %rsi
leaq -0xb0(%rbp), %r13
movq %r13, %rdi
callq 0x2170
movq -0x30(%rbp), %rsi
movq (%rsi), %rax
movq %r14, %rdi
movq %r13, %rdx
callq *(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2120
movq %rax, %rdi
callq 0x20a0
movq %r14, %rdi
callq 0x2090
leaq -0xb0(%rbp), %rdi
callq 0x2090
incq %r12
addq $0x20, %r15
jmp 0x3050
movq 0x3ef0(%rip), %rdi      # 0x6fd8
leaq 0xfac(%rip), %rsi       # 0x409b
callq 0x2130
movq %rax, %rdi
callq 0x20a0
leaq -0x70(%rbp), %rdi
callq 0x2090
leaq -0x50(%rbp), %rdi
callq 0x31f6
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
jmp 0x3188
movq %rax, %rbx
jmp 0x319b
jmp 0x318f
jmp 0x318f
jmp 0x318f
movq %rax, %rbx
jmp 0x3181
jmp 0x318f
jmp 0x3142
movq %rax, %rbx
jmp 0x3156
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x2090
leaq -0x258(%rbp), %rdi
callq 0x20e0
jmp 0x3192
movq %rax, %rbx
leaq -0x258(%rbp), %rdi
jmp 0x3188
jmp 0x318f
movq %rax, %rbx
leaq -0x258(%rbp), %rdi
callq 0x2090
leaq -0xb0(%rbp), %rdi
callq 0x2090
jmp 0x3192
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2090
leaq -0x50(%rbp), %rdi
callq 0x31f6
movq %rbx, %rdi
callq 0x21f0