// File: thuydx55[P]C-Number-to-Word/main.cpp
// Function: main
int main(int argc, char const *argv[])
{
    if ( argc != 2 ) // argc should be 2 for correct execution
        // We print argv[0] assuming it is the program name
        cout << "usage: "<< argv[0] <<" <number string>\n";
    else {
        string numStr = argv[1];

        Number num(numStr);
        if (!num.isValid()) {
            cout << "'" << numStr << "' is not a number!" << endl;
            return 1;
        }

        cout << num.getTextRepresentation() << endl;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x6515
movq 0xaaf2(%rip), %rdi      # 0x10fd8
leaq 0x5b17(%rip), %rsi      # 0xc004
callq 0x3180
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x3180
movq %rax, %rdi
leaq 0x5b01(%rip), %rsi      # 0xc00c
callq 0x3180
jmp 0x6725
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xc0(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x32e0
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x6750
jmp 0x654d
leaq -0x31(%rbp), %rdi
callq 0x31f0
leaq -0x88(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x30a0
jmp 0x6568
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x6aa0
jmp 0x657a
leaq -0x88(%rbp), %rdi
callq 0x3348
leaq -0x68(%rbp), %rdi
callq 0x6b20
movb %al, -0xc1(%rbp)
jmp 0x6597
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x667c
jmp 0x65a7
movq 0xaa2a(%rip), %rdi      # 0x10fd8
leaq 0x5a69(%rip), %rsi      # 0xc01e
callq 0x3180
movq %rax, -0xd0(%rbp)
jmp 0x65c3
movq -0xd0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3170
movq %rax, -0xd8(%rbp)
jmp 0x65dc
movq -0xd8(%rbp), %rdi
leaq 0x5a36(%rip), %rsi      # 0xc020
callq 0x3180
movq %rax, -0xe0(%rbp)
jmp 0x65f8
movq -0xe0(%rbp), %rdi
movq 0xa9ba(%rip), %rsi      # 0x10fc0
callq 0x31c0
jmp 0x660d
movl $0x1, -0x4(%rbp)
movl $0x1, -0x8c(%rbp)
jmp 0x66d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x31f0
jmp 0x6738
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x671a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3348
jmp 0x671a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6711
leaq -0xb0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
xorl %edx, %edx
callq 0x6bd0
jmp 0x6690
movq 0xa941(%rip), %rdi      # 0x10fd8
leaq -0xb0(%rbp), %rsi
callq 0x3170
movq %rax, -0xe8(%rbp)
jmp 0x66ac
movq -0xe8(%rbp), %rdi
movq 0xa906(%rip), %rsi      # 0x10fc0
callq 0x31c0
jmp 0x66c1
leaq -0xb0(%rbp), %rdi
callq 0x3348
movl $0x0, -0x8c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x6b00
leaq -0x30(%rbp), %rdi
callq 0x3348
movl -0x8c(%rbp), %eax
testl %eax, %eax
je 0x66f7
jmp 0x66f5
jmp 0x672c
jmp 0x6725
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x3348
leaq -0x68(%rbp), %rdi
callq 0x6b00
leaq -0x30(%rbp), %rdi
callq 0x3348
jmp 0x6738
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x32d0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)