// File: /workspace/github_cpp_makefile_star2_O2/sc0ty[P]CODExtract/src/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    cout << endl << "  COD Extractor - created by sc0ty 2011 - http://sc0ty.pl";
    if (argc < 2)
    {
        cout << endl << endl << "use:" << endl;
        cout << "  codextract <file.cod> <file-2.cod> ... <file-n.cod>" << endl << endl;
        return 0;
    }

    CODFile cod;

    for (int i=1; i<argc; i++)
    {
        try
        {
            // load file and show filename
            cout << endl << endl << "  File \"" << argv[i] << "\"";
            cod.LoadFile(argv[i]);

            // load parent file and show filename
            if (cod.LoadParent())
            {
                cout << ", parent file \"" << cod.getFileName() << "\"";
            }

            // show info
            cout << endl << endl;
            ShowCODInfo(&cod);
            SaveIcon(&cod);
        }

        catch (const char *ex)
        {
            cout << endl << endl << "\tError: " << ex;
            cout << " (" << cod.getFileName() << ")" << endl;
        }

        cod.Close();
    }

    cout << endl;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movl %edi, %r15d
movq 0x3b2b(%rip), %rdi      # 0x5fd8
callq 0x20f0
leaq 0x1b4b(%rip), %rsi      # 0x4004
movq %rax, %rdi
callq 0x2190
cmpl $0x1, %r15d
jg 0x2519
movq 0x3b0a(%rip), %rbx      # 0x5fd8
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
leaq 0x1b59(%rip), %rsi      # 0x403e
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x1b47(%rip), %rsi      # 0x4043
movq %rbx, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
jmp 0x26dd
leaq -0xb8(%rbp), %r14
movq %r14, %rdi
callq 0x2bbc
movl %r15d, %eax
movq %rax, -0x30(%rbp)
pushq $0x1
popq %r12
cmpq %r12, -0x30(%rbp)
je 0x26c5
movq 0x3a94(%rip), %rdi      # 0x5fd8
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
leaq 0x1b1e(%rip), %rsi      # 0x4079
callq 0x2190
movq (%rbx,%r12,8), %rsi
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
leaq 0x1b0a(%rip), %rsi      # 0x4080
callq 0x2190
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
callq 0x2cba
movq %r14, %rdi
callq 0x2f22
testb %al, %al
je 0x25db
movq 0x3a3e(%rip), %rdi      # 0x5fd8
leaq 0x1ae1(%rip), %rsi      # 0x4082
callq 0x2190
movq %rax, %r13
leaq -0x50(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3210
movq %r13, %rdi
movq %r15, %rsi
callq 0x2170
movq %rax, %rdi
leaq 0x1ab3(%rip), %rsi      # 0x4080
callq 0x2190
leaq -0x50(%rbp), %rdi
callq 0x20d0
movq 0x39f6(%rip), %rdi      # 0x5fd8
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
movq %r14, %rdi
callq 0x2724
movq %r14, %rdi
callq 0x2a42
movq %r14, %rdi
callq 0x2c32
incq %r12
jmp 0x2533
jmp 0x2622
movq %rdx, %r13
movq %rax, %r15
leaq -0x50(%rbp), %rdi
callq 0x20d0
jmp 0x2628
movq %rdx, %r13
movq %rax, %r15
cmpl $0x1, %r13d
jne 0x2710
movq %r15, %rdi
callq 0x20b0
movq %rax, %r15
movq 0x3994(%rip), %rdi      # 0x5fd8
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
leaq 0x1a37(%rip), %rsi      # 0x4092
callq 0x2190
movq %rax, %rdi
movq %r15, %rsi
callq 0x2190
movq 0x3966(%rip), %rdi      # 0x5fd8
leaq 0x1a22(%rip), %rsi      # 0x409b
callq 0x2190
movq %rax, %r13
leaq -0x50(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3210
movq %r13, %rdi
movq %r15, %rsi
callq 0x2170
movq %rax, %rdi
leaq 0x1af7(%rip), %rsi      # 0x419c
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq -0x50(%rbp), %rdi
callq 0x20d0
callq 0x22c0
jmp 0x25ff
movq 0x390c(%rip), %rdi      # 0x5fd8
callq 0x20f0
leaq -0xb8(%rbp), %rdi
callq 0x2bfe
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq -0x50(%rbp), %rdi
callq 0x20d0
jmp 0x2704
jmp 0x2701
movq %rax, %r15
callq 0x22c0
jmp 0x2710
jmp 0x270d
movq %rax, %r15
leaq -0xb8(%rbp), %rdi
callq 0x2bfe
movq %r15, %rdi
callq 0x22f0