// File: /workspace/github_cpp_makefile_star2_O2/kelwinfc[P]ci4721-Fernandez-Gyomrey/src/main.cpp
// Function: main
int main (int argc,char **argv)
{
    main_args args;
    main_read_args(argc, argv, stdin, args);

    logger = new llog();
    AST *ast = main_ast_create(args);
    
    string_table* strings = main_ast_check(ast);
    
    if (args.to_separate_archives) {
        main_redirect_stdout("bla.types");
    }
    types.dump(cout);
    cout << "-------------------------------------------------------" << endl << endl;
    if (args.to_separate_archives) {
        main_redirect_stdout("bla.strings");
    }
    strings->dump(cout);
    cout << "-------------------------------------------------------" << endl << endl;
    
    if (args.ast) {
        if (args.to_separate_archives) {
            main_redirect_stdout("bla.ast");
        }
        ast->dump(cout, 0);

        if (!args.to_separate_archives) {
            cout << "-------------------------------------------------------" << endl << endl;
        }
    }
    
    if ( logger->exists_registered_error() ){
        logger->dump(cerr);
        cerr << "-------------------------------------------------------" << endl << endl;
        cerr << "Epic fail!" << endl;
        abort();
        return 1;
    }
    
    Tac* tac = main_tac_create(args, ast);

    main_tac_optimize(tac);

    main_tac_dump(args, tac);

    Spim* spim = main_spim_create(tac);

    main_spim_dump(spim);

    main_redirect_stdout();
    cout << "Like a boss!" << endl;

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x17abe(%rip), %rax     # 0x37fb8
movq (%rax), %rdx
leaq 0x8(%rsp), %rcx
callq 0x20733
movl $0x1c0, %edi            # imm = 0x1C0
callq 0x62d0
movq %rax, %rbx
movq %rax, %rdi
callq 0x15f08
movq %rbx, 0x17edd(%rip)     # 0x38400
movq 0x8(%rsp), %rbx
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x20996
movq %rax, %r14
movq %rax, %rdi
callq 0x20a0b
movq %rax, %r15
btl $0x8, %ebx
jb 0x20580
leaq 0x17eb8(%rip), %rdi     # 0x38408
movq 0x17a69(%rip), %r12     # 0x37fc0
movq %r12, %rsi
callq 0x15a56
leaq 0x8573(%rip), %rsi      # 0x28ad9
movq %r12, %rdi
callq 0x62b0
movq %rax, %rdi
callq 0x6130
movq %rax, %rdi
callq 0x6130
jmp 0x205cd
leaq 0x8548(%rip), %rdi      # 0x28acf
callq 0x20a85
leaq 0x17e75(%rip), %rdi     # 0x38408
movq 0x17a26(%rip), %r12     # 0x37fc0
movq %r12, %rsi
callq 0x15a56
leaq 0x8530(%rip), %rsi      # 0x28ad9
movq %r12, %rdi
callq 0x62b0
movq %rax, %rdi
callq 0x6130
movq %rax, %rdi
callq 0x6130
leaq 0x8549(%rip), %rdi      # 0x28b11
callq 0x20a85
movq 0x179ec(%rip), %r12     # 0x37fc0
movq %r15, %rdi
movq %r12, %rsi
callq 0x1ac98
leaq 0x84f3(%rip), %rsi      # 0x28ad9
movq %r12, %rdi
callq 0x62b0
movq %rax, %rdi
callq 0x6130
movq %rax, %rdi
callq 0x6130
btl $0x10, %ebx
jae 0x2065c
btl $0x8, %ebx
jb 0x2063f
movq (%r14), %rax
movq 0x179ac(%rip), %r15     # 0x37fc0
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq *(%rax)
leaq 0x84b4(%rip), %rsi      # 0x28ad9
movq %r15, %rdi
callq 0x62b0
movq %rax, %rdi
callq 0x6130
movq %rax, %rdi
callq 0x6130
jmp 0x2065c
leaq 0x84d7(%rip), %rdi      # 0x28b1d
callq 0x20a85
movq (%r14), %rax
movq 0x1796b(%rip), %rsi     # 0x37fc0
movq %r14, %rdi
xorl %edx, %edx
callq *(%rax)
movq 0x17d9d(%rip), %rdi     # 0x38400
callq 0x16288
testb %al, %al
jne 0x206ca
movq %rbx, %rdi
movq %r14, %rdx
callq 0x20bce
movq %rax, %r14
movq %rax, %rdi
callq 0x20c56
movq %rbx, %rdi
callq 0x20c68
movq %r14, %rdi
callq 0x2141e
movq %rax, %rdi
callq 0x20d16
xorl %edi, %edi
callq 0x20a85
movq 0x17918(%rip), %rdi     # 0x37fc0
leaq 0x8481(%rip), %rsi      # 0x28b30
callq 0x62b0
movq %rax, %rdi
callq 0x6130
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x17d2f(%rip), %rdi     # 0x38400
movq 0x17918(%rip), %rbx     # 0x37ff0
movq %rbx, %rsi
callq 0x1628c
leaq 0x83f2(%rip), %rsi      # 0x28ad9
movq %rbx, %rdi
callq 0x62b0
movq %rax, %rdi
callq 0x6130
movq %rax, %rdi
callq 0x6130
leaq 0x841f(%rip), %rsi      # 0x28b25
movq %rbx, %rdi
callq 0x62b0
movq %rax, %rdi
callq 0x6130
callq 0x6190
movq %rax, %r14
movl $0x1c0, %esi            # imm = 0x1C0
movq %rbx, %rdi
callq 0x62e0
movq %r14, %rdi
callq 0x6530