// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/Game.cpp
// Function: main
int main(int argc, char const *argv[])
{
    signal(SIGINT, signal_handler);

    // default args
    float game_time = 0.05;
    int rain = 1;
    DebugView::shared_view()->show = false;
    bool skip = false;

    // handle args from terminal input
    for (int i = 1; i < argc; ++i)
    {
        if (std::string(argv[i]) == "--skip")
        {
            skip = true;
        }
        else if (std::string(argv[i]) == "--noaudio")
        {
            ConsoleTools::audio = false;
        }
        else if (std::string(argv[i]) == "--debug")
        {
            DebugView::shared_view()->show = true;
        }
        else if (std::string(argv[i]) == "--norain")
        {
            rain = 0;
        }
        else if (std::string(argv[i]) == "--replay")
        {
            ConsoleTools::replay = true;
        }
        else if (std::string(argv[i]) == "--gametime")
        {
            if (++i > argc)
            {
                break;
            }
            std::stringstream ss;
            ss << argv[i];
            ss >> game_time;
        }
        else if (std::string(argv[i]) == "--help")
        {
            std::ifstream helpfile("help.txt");
            ConsoleTools::set_fcolor(ConsoleTools::green);
            printf("\n%s\n", std::string(std::istreambuf_iterator<char>(helpfile),
                                        std::istreambuf_iterator<char>()).c_str());
            ConsoleTools::end_color();
            std::exit(0);
        }
    }

    // start
    Game game(skip, game_time, rain);
    game.run();

    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
movl %edi, -0x38(%rbp)
leaq -0x3b(%rip), %rsi       # 0x9408
pushq $0x2
popq %rdi
callq 0x3320
leaq -0x34(%rbp), %rax
movl $0x3d4ccccd, (%rax)     # imm = 0x3D4CCCCD
callq 0x4aac
movb $0x0, 0x31(%rax)
pushq $0x1
popq %r14
movl $0x0, -0x30(%rbp)
leaq -0x260(%rbp), %r13
movl %r14d, -0x2c(%rbp)
cmpl -0x38(%rbp), %r14d
jge 0x9646
movslq %r14d, %r12
movq (%rbx,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3120
movq %r13, %rdi
leaq 0x1e7d(%rip), %rsi      # 0xb318
callq 0x5f62
movl %eax, %r15d
movq %r13, %rdi
callq 0x3340
testb %r15b, %r15b
je 0x94ba
movb $0x1, %al
movl %eax, -0x30(%rbp)
jmp 0x963e
movq (%rbx,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3120
movq %r13, %rdi
leaq 0x1e4b(%rip), %rsi      # 0xb31f
callq 0x5f62
movl %eax, %r15d
movq %r13, %rdi
callq 0x3340
testb %r15b, %r15b
je 0x94f8
leaq 0x7d98(%rip), %rax      # 0x11288
movb $0x0, (%rax)
jmp 0x963e
movq (%rbx,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3120
movq %r13, %rdi
leaq 0x1e17(%rip), %rsi      # 0xb329
callq 0x5f62
movl %eax, %r15d
movq %r13, %rdi
callq 0x3340
testb %r15b, %r15b
je 0x9535
callq 0x4aac
movb $0x1, 0x31(%rax)
jmp 0x963e
movq (%rbx,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3120
movq %r13, %rdi
leaq 0x1de2(%rip), %rsi      # 0xb331
callq 0x5f62
movl %eax, %r15d
movq %r13, %rdi
callq 0x3340
testb %r15b, %r15b
je 0x9570
movl $0x0, -0x2c(%rbp)
jmp 0x963e
movq (%rbx,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3120
movq %r13, %rdi
leaq 0x1db0(%rip), %rsi      # 0xb33a
callq 0x5f62
movl %eax, %r15d
movq %r13, %rdi
callq 0x3340
testb %r15b, %r15b
je 0x95ae
leaq 0x7cf4(%rip), %rax      # 0x1129a
movb $0x1, (%rax)
jmp 0x963e
movq (%rbx,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3120
movq %r13, %rdi
leaq 0x1d7b(%rip), %rsi      # 0xb343
callq 0x5f62
movl %eax, %r15d
movq %r13, %rdi
callq 0x3340
testb %r15b, %r15b
je 0x960f
movq %r13, %rdi
callq 0x31d0
movq 0x8(%rbx,%r12,8), %rsi
leaq -0x250(%rbp), %rdi
callq 0x32c0
movq %r13, %rdi
leaq -0x34(%rbp), %rsi
callq 0x34e0
incl %r14d
movq %r13, %rdi
callq 0x3200
jmp 0x963e
movq (%rbx,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3120
movq %r13, %rdi
leaq 0x1d25(%rip), %rsi      # 0xb34e
callq 0x5f62
movl %eax, %r15d
movq %r13, %rdi
callq 0x3340
testb %r15b, %r15b
jne 0x968d
incl %r14d
jmp 0x9474
movss -0x34(%rbp), %xmm0
movzbl -0x30(%rbp), %esi
andl $0x1, %esi
leaq -0x260(%rbp), %rdi
movl -0x2c(%rbp), %edx
callq 0x97d8
leaq -0x238(%rbp), %rdi
callq 0x80a8
leaq -0x260(%rbp), %rdi
callq 0x9b60
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1cc1(%rip), %rsi      # 0xb355
leaq -0x260(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3480
pushq $0x20
popq %rdi
callq 0x386e
movq -0x260(%rbp), %rax
movq -0x18(%rax), %rax
movq -0x178(%rbp,%rax), %rsi
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x58(%rbp), %rdi
pushq $-0x1
popq %rdx
xorl %ecx, %ecx
movl %edx, %r8d
callq 0xa0aa
leaq -0x58(%rbp), %rbx
movq (%rbx), %rsi
leaq 0x1c79(%rip), %rdi      # 0xb35e
xorl %eax, %eax
callq 0x3050
movq %rbx, %rdi
callq 0x3340
callq 0x38b4
xorl %edi, %edi
callq 0x3330
jmp 0x9702
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x30c0
jmp 0x97cf
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x3340
jmp 0x97cf
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x3340
jmp 0x97cf
jmp 0x97cc
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x3200
jmp 0x97cf
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x9b60
jmp 0x97cf
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x3340
jmp 0x97cf
jmp 0x97cc
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x3340
jmp 0x97cf
jmp 0x97cc
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x3340
jmp 0x97cf
jmp 0x97cc
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x3340
jmp 0x97cf
jmp 0x97cc
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x3340
jmp 0x97cf
jmp 0x97cc
movq %rax, %rdi
callq 0x3aae
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3450
nop