// File: /workspace/github_cpp_makefile_star2_O3/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       # 0xa140
movl $0x2, %edi
callq 0x32d0
movl $0x3d4ccccd, -0x34(%rbp) # imm = 0x3D4CCCCD
callq 0x4d8a
movb $0x0, 0x31(%rax)
movl %ebx, -0x38(%rbp)
cmpl $0x2, %ebx
jl 0xa451
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 0x2175(%rip), %rsi      # 0xc34c
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa1f7
callq 0x3230
testl %r15d, %r15d
je 0xa397
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x2139(%rip), %rsi      # 0xc353
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa23a
callq 0x3230
testl %r15d, %r15d
je 0xa3a1
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x2100(%rip), %rsi      # 0xc35d
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa27d
callq 0x3230
testl %r15d, %r15d
je 0xa3b0
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x20c5(%rip), %rsi      # 0xc365
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa2c0
callq 0x3230
testl %r15d, %r15d
je 0xa3bb
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x208b(%rip), %rsi      # 0xc36e
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa303
callq 0x3230
testl %r15d, %r15d
je 0xa3c4
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x2051(%rip), %rsi      # 0xc377
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa346
callq 0x3230
testl %r15d, %r15d
je 0xa3d0
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3110
movq %r13, %rdi
leaq 0x2019(%rip), %rsi      # 0xc382
callq 0x30f0
movl %eax, %r15d
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa389
callq 0x3230
testl %r15d, %r15d
jne 0xa439
jmp 0xa49e
movb $0x1, %al
movl %eax, -0x30(%rbp)
jmp 0xa439
leaq 0x6eb8(%rip), %rax      # 0x11260
movb $0x0, (%rax)
jmp 0xa439
callq 0x4d8a
movb $0x1, 0x31(%rax)
jmp 0xa439
movl $0x0, -0x2c(%rbp)
jmp 0xa439
leaq 0x6ea7(%rip), %rax      # 0x11272
movb $0x1, (%rax)
jmp 0xa439
movq %r13, %rdi
callq 0x31a0
movq 0x8(%r14,%r12,8), %r15
testq %r15, %r15
je 0xa3fe
movq %r15, %rdi
callq 0x3130
leaq -0x250(%rbp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x32c0
jmp 0xa423
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 0x3400
movq %r13, %rdi
leaq -0x34(%rbp), %rsi
callq 0x3490
incl %ebx
movq %r13, %rdi
callq 0x31d0
incl %ebx
cmpl -0x38(%rbp), %ebx
jl 0xa1ba
movss -0x34(%rbp), %xmm0
movl -0x30(%rbp), %eax
movl -0x2c(%rbp), %edx
jmp 0xa460
movl $0x1, %edx
movss 0x1eea(%rip), %xmm0     # 0xc348
xorl %eax, %eax
movzbl %al, %esi
andl $0x1, %esi
leaq -0x260(%rbp), %rdi
callq 0xa59a
leaq -0x238(%rbp), %rdi
callq 0x8b74
leaq -0x260(%rbp), %rdi
callq 0xaa14
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ee4(%rip), %rsi      # 0xc389
leaq -0x260(%rbp), %rdi
movl $0x8, %edx
callq 0x3460
movl $0x20, %edi
callq 0x3842
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 0xb02c
movq -0x58(%rbp), %rsi
leaq 0x1e96(%rip), %rdi      # 0xc392
xorl %eax, %eax
callq 0x3060
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa511
callq 0x3230
callq 0x3888
xorl %edi, %edi
callq 0x32e0
jmp 0xa51f
movq %rax, %r14
leaq -0x260(%rbp), %rdi
callq 0x30c0
jmp 0xa592
jmp 0xa577
jmp 0xa572
movq %rax, %r14
leaq -0x260(%rbp), %rdi
callq 0xaa14
jmp 0xa592
movq %rax, %r14
leaq -0x260(%rbp), %rdi
callq 0x31d0
jmp 0xa592
movq %rax, %rdi
callq 0x3ac6
jmp 0xa577
jmp 0xa572
jmp 0xa577
jmp 0xa572
jmp 0xa572
jmp 0xa577
jmp 0xa577
jmp 0xa572
jmp 0xa572
jmp 0xa577
movq %rax, %r14
jmp 0xa592
movq %rax, %r14
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xa592
callq 0x3230
movq %r14, %rdi
callq 0x3430