// File: /workspace/github_cpp_makefile_star2_O1/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, %r13
movl %edi, %r12d
movq 0x4b1b(%rip), %rbx      # 0x6fd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
leaq 0x2b19(%rip), %rsi      # 0x5004
movl $0x39, %edx
movq %rax, %rdi
callq 0x2200
cmpl $0x1, %r12d
jg 0x25fb
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq %rax, %r14
leaq 0x2ae1(%rip), %rsi      # 0x503e
movl $0x4, %edx
movq %rax, %rdi
callq 0x2200
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
leaq 0x2aab(%rip), %rsi      # 0x5043
movl $0x35, %edx
movq %rbx, %rdi
callq 0x2200
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
jmp 0x2908
leaq -0xc0(%rbp), %rdi
callq 0x30b0
movl %r12d, %eax
movq %rax, -0x58(%rbp)
movl $0x1, %r14d
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq %rax, %r12
movl $0x8, %edx
movq %rax, %rdi
leaq 0x2a02(%rip), %rsi      # 0x5079
callq 0x2200
movq %r13, %r15
movq (%r13,%r14,8), %r13
testq %r13, %r13
je 0x26a4
movq %r13, %rdi
callq 0x20f0
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %r15, %r13
callq 0x2200
jmp 0x26c2
movq (%r12), %rax
movq -0x18(%rax), %rax
movq %r12, %rdi
addq %rax, %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
movq %r15, %r13
callq 0x22f0
movl $0x1, %edx
movq %r12, %rdi
leaq 0x29af(%rip), %rsi      # 0x5080
callq 0x2200
movq (%r13,%r14,8), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x31e8
leaq -0xc0(%rbp), %rdi
callq 0x34a0
testb %al, %al
je 0x2758
movl $0xf, %edx
movq %rbx, %rdi
leaq 0x297c(%rip), %rsi      # 0x5082
callq 0x2200
leaq -0x48(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x38c4
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x2200
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2946(%rip), %rsi      # 0x5080
callq 0x2200
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2758
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
leaq -0xc0(%rbp), %rdi
callq 0x2964
leaq -0xc0(%rbp), %rdi
callq 0x2e7f
leaq -0xc0(%rbp), %rdi
callq 0x315c
incq %r14
cmpq %r14, -0x58(%rbp)
jne 0x2614
jmp 0x28d1
movq %rdx, %r12
movq %rax, -0x50(%rbp)
jmp 0x2808
movq %rdx, %r12
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2808
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21c0
movq %r15, %r13
movq -0x50(%rbp), %rdi
jmp 0x2817
movq %rdx, %r12
movq %rax, %rdi
cmpl $0x1, %r12d
jne 0x291c
callq 0x20e0
movq %rax, %r15
movq %rbx, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2100
movq %rax, %r12
movl $0x8, %edx
movq %rax, %rdi
leaq 0x2847(%rip), %rsi      # 0x5092
callq 0x2200
movq %r12, %rdi
movq %r15, %rsi
callq 0x21a0
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x2831(%rip), %rsi      # 0x509b
callq 0x2200
leaq -0x48(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x38c4
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x2200
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x28fb(%rip), %rsi      # 0x519c
callq 0x2200
movq %r12, %rdi
callq 0x2100
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x28c7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21c0
callq 0x22d0
jmp 0x27c1
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x46e9(%rip), %rdi      # 0x6fd8
callq 0x2040
movq %rax, %rdi
callq 0x2140
leaq -0xc0(%rbp), %rdi
callq 0x30f0
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
jmp 0x2950
jmp 0x2941
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2944
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2944
movq %rax, %rbx
callq 0x22d0
jmp 0x2950
jmp 0x294d
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x2310