// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movl %edi, %ebx
leaq -0x3a(%rip), %rsi       # 0xa130
movl $0x2, %edi
callq 0x32e0
movl $0x3d4ccccd, -0x34(%rbp) # imm = 0x3D4CCCCD
callq 0x4d7e
movb $0x0, 0x31(%rax)
movl %ebx, -0x38(%rbp)
cmpl $0x2, %ebx
jl 0xa43c
movl $0x1, %ebx
movl $0x0, -0x30(%rbp)
leaq -0x260(%rbp), %r13
movl $0x1, -0x2c(%rbp)
movslq %ebx, %r12
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x2189(%rip), %rsi      # 0xc350
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa1e7
callq 0x3240
testl %r15d, %r15d
je 0xa387
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x214d(%rip), %rsi      # 0xc357
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa22a
callq 0x3240
testl %r15d, %r15d
je 0xa391
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x2114(%rip), %rsi      # 0xc361
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa26d
callq 0x3240
testl %r15d, %r15d
je 0xa3a0
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x20d9(%rip), %rsi      # 0xc369
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa2b0
callq 0x3240
testl %r15d, %r15d
je 0xa3ab
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x209f(%rip), %rsi      # 0xc372
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa2f3
callq 0x3240
testl %r15d, %r15d
je 0xa3b4
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x2065(%rip), %rsi      # 0xc37b
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa336
callq 0x3240
testl %r15d, %r15d
je 0xa3c0
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x202d(%rip), %rsi      # 0xc386
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa379
callq 0x3240
testl %r15d, %r15d
jne 0xa429
jmp 0xa486
movb $0x1, %al
movl %eax, -0x30(%rbp)
jmp 0xa429
leaq 0x6ed0(%rip), %rax      # 0x11268
movb $0x0, (%rax)
jmp 0xa429
callq 0x4d7e
movb $0x1, 0x31(%rax)
jmp 0xa429
movl $0x0, -0x2c(%rbp)
jmp 0xa429
leaq 0x6ebf(%rip), %rax      # 0x1127a
movb $0x1, (%rax)
jmp 0xa429
movq %r13, %rdi
callq 0x31a0
movq 0x8(%r14,%r12,8), %r15
testq %r15, %r15
je 0xa3ee
movq %r15, %rdi
callq 0x3130
leaq -0x250(%rbp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x32d0
jmp 0xa413
movq -0x250(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x250(%rbp), %rcx
leaq (%rcx,%rax), %rdi
movl -0x230(%rbp,%rax), %esi
orl $0x1, %esi
callq 0x3410
movq %r13, %rdi
leaq -0x34(%rbp), %rsi
callq 0x34a0
incl %ebx
movq %r13, %rdi
callq 0x31d0
incl %ebx
cmpl -0x38(%rbp), %ebx
jl 0xa1aa
movl -0x30(%rbp), %eax
movl -0x2c(%rbp), %edx
jmp 0xa443
movl $0x1, %edx
xorl %eax, %eax
movss -0x34(%rbp), %xmm0
movzbl %al, %esi
andl $0x1, %esi
leaq -0x260(%rbp), %rdi
callq 0xa582
leaq -0x238(%rbp), %rdi
callq 0x8b68
leaq -0x260(%rbp), %rdi
callq 0xa9fc
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f00(%rip), %rsi      # 0xc38d
leaq -0x260(%rbp), %rdi
movl $0x8, %edx
callq 0x3470
movl $0x20, %edi
callq 0x3852
movq -0x260(%rbp), %rax
movq -0x18(%rax), %rax
movq -0x178(%rbp,%rax), %rsi
leaq -0x48(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq -0x58(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0xb01e
movq -0x58(%rbp), %rsi
leaq 0x1eb2(%rip), %rdi      # 0xc396
xorl %eax, %eax
callq 0x3060
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa4f9
callq 0x3240
callq 0x3898
xorl %edi, %edi
callq 0x32f0
jmp 0xa507
movq %rax, %r14
leaq -0x260(%rbp), %rdi
callq 0x30c0
jmp 0xa57a
jmp 0xa55f
jmp 0xa55a
movq %rax, %r14
leaq -0x260(%rbp), %rdi
callq 0xa9fc
jmp 0xa57a
movq %rax, %r14
leaq -0x260(%rbp), %rdi
callq 0x31d0
jmp 0xa57a
movq %rax, %rdi
callq 0x3ad6
jmp 0xa55f
jmp 0xa55a
jmp 0xa55f
jmp 0xa55a
jmp 0xa55a
jmp 0xa55f
jmp 0xa55f
jmp 0xa55a
jmp 0xa55a
jmp 0xa55f
movq %rax, %r14
jmp 0xa57a
movq %rax, %r14
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa57a
callq 0x3240
movq %r14, %rdi
callq 0x3440