// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/GameView.cpp
// Function: GameView::_get_input()
void GameView::_get_input()
{
    // choose tank depending on turn
    Tank *current_tank = (turn == false) ? _tank1 : _tank2;
    float angle_offset = (turn == false) ? 0: M_PI;
    turn = !turn;

    _input_box->draw();

    // draw tank name
    ConsoleTools::set_color(current_tank->get_fcolor(), ConsoleTools::endc);
    ConsoleTools::set_cursor(_input_box->get_position().x + 1, _input_box->get_position().y + 1);
    printf("%s", current_tank->get_name().c_str());

    // draw input text stuff
    ConsoleTools::set_cursor(_input_box->get_position().x + 1, _input_box->get_position().y + 3);
    printf("power: ");
    ConsoleTools::set_cursor(_input_box->get_position().x + 1, _input_box->get_position().y + 4);
    printf("angle: ");

    // write to input file
    if (DebugView::shared_view()->show == true)
    {
        std::ofstream file("computer.txt", std::ios::app);
        file << (rand() % 7) + 1 << " " << (rand() % 80) << std::endl;
        file.close();
    }

    // get power input
    ConsoleTools::move_cursor(ConsoleTools::up, 1);
    float p = ConsoleTools::get_input<float>("float! ",
        Point<int>(_input_box->get_position().x + 1, _input_box->get_position().y + 3));
    ConsoleTools::play_music("beep.wav");

    // get angle input
    ConsoleTools::set_cursor(_input_box->get_position().x + StringTools::string_width("angle: ") + 1, _input_box->get_position().y + 4);
    float a = ConsoleTools::get_input<float>("float! ",
        Point<int>(_input_box->get_position().x + 1, _input_box->get_position().y + 4));

    // write power and angle to replay file
    if (ConsoleTools::replay == false)
    {
        std::ofstream file("replay.txt", std::ios::app);
        file << p << " " << a << std::endl;
        file.close();
    }

    DebugView::shared_view()->watch("power", p);
    DebugView::shared_view()->watch("angle", a);

    if (a == -1 && p == -1)
    {
        _should_remove_from_parent = true;
        return;
    }

    // create new bulelt and fire
    // bullet already deleted by update loop
    _bullet = new Bullet(current_tank->get_position(), std::abs(angle_offset - a*(M_PI/180)), MIN(p, 10.0), _terrain);
    _bullet->fire();
    add_child(_bullet);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rdi, %rbx
movzbl 0x60(%rdi), %eax
movq 0x40(%rdi,%rax,8), %r14
movq %rax, -0x38(%rbp)
xorb $0x1, %al
movb %al, 0x60(%rdi)
movq 0x58(%rdi), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %r14, %rdi
callq 0x6370
movl %eax, %edi
xorl %esi, %esi
callq 0x389a
movq 0x58(%rbx), %rdi
callq 0x8d1a
leal 0x1(%rax), %r15d
movq 0x58(%rbx), %rdi
callq 0x8d1a
shrq $0x20, %rax
leal 0x1(%rax), %esi
movl %r15d, %edi
callq 0x390e
leaq -0x2f8(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x8ee2
movq (%r15), %rsi
leaq 0x7028(%rip), %rdi      # 0xb18b
xorl %eax, %eax
callq 0x3050
movq %r15, %rdi
callq 0x3340
movq 0x58(%rbx), %rdi
callq 0x8d1a
leal 0x1(%rax), %r15d
movq 0x58(%rbx), %rdi
callq 0x8d1a
shrq $0x20, %rax
leal 0x3(%rax), %esi
movl %r15d, %edi
callq 0x390e
leaq 0x6f0d(%rip), %rdi      # 0xb0ab
xorl %eax, %eax
callq 0x3050
movq 0x58(%rbx), %rdi
callq 0x8d1a
leal 0x1(%rax), %r15d
movq 0x58(%rbx), %rdi
callq 0x8d1a
shrq $0x20, %rax
leal 0x4(%rax), %esi
movl %r15d, %edi
callq 0x390e
leaq 0x6ee2(%rip), %rdi      # 0xb0b3
xorl %eax, %eax
callq 0x3050
callq 0x4aac
cmpb $0x1, 0x31(%rax)
jne 0x4259
leaq 0x6ed1(%rip), %rsi      # 0xb0bb
leaq -0x2f8(%rbp), %r15
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x3310
callq 0x30d0
pushq $0x7
popq %rcx
cltd
idivl %ecx
leal 0x1(%rdx), %esi
movq %r15, %rdi
callq 0x3440
leaq 0x6e84(%rip), %rsi      # 0xb09d
movq %rax, %rdi
callq 0x32c0
movq %rax, %r15
callq 0x30d0
pushq $0x50
popq %rcx
cltd
idivl %ecx
movq %r15, %rdi
movl %edx, %esi
callq 0x3440
movq %rax, %rdi
callq 0x3150
leaq -0x2f8(%rbp), %rdi
callq 0x3390
leaq -0x2f8(%rbp), %rdi
callq 0x33b0
pushq $0x41
popq %rdi
pushq $0x1
popq %rsi
callq 0x3958
leaq 0x6e5d(%rip), %rsi      # 0xb0c8
leaq -0xf8(%rbp), %rdi
leaq -0x2f8(%rbp), %rdx
callq 0x3120
movq 0x58(%rbx), %rdi
callq 0x8d1a
movq %rax, %r15
movq 0x58(%rbx), %rdi
callq 0x8d1a
movabsq $-0x100000000, %r13     # imm = 0xFFFFFFFF00000000
incl %r15d
andq %r13, %rax
orq %rax, %r15
movabsq $0x300000000, %rsi      # imm = 0x300000000
addq %r15, %rsi
leaq -0xf8(%rbp), %rdi
callq 0x4d52
movss %xmm0, -0x30(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x3340
leaq 0x6df9(%rip), %rsi      # 0xb0d0
leaq -0xd8(%rbp), %rdi
leaq -0x2f8(%rbp), %rdx
callq 0x3120
leaq -0xd8(%rbp), %rdi
callq 0x39be
leaq -0xd8(%rbp), %rdi
callq 0x3340
movq 0x58(%rbx), %rdi
callq 0x8d1a
movq %rax, %r15
leaq 0x6d9e(%rip), %rsi      # 0xb0b3
leaq -0xb8(%rbp), %rdi
leaq -0x2f8(%rbp), %rdx
callq 0x3120
leaq -0xb8(%rbp), %rdi
callq 0x6758
movl %eax, %r12d
movq 0x58(%rbx), %rdi
callq 0x8d1a
leal (%r15,%r12), %edi
incl %edi
shrq $0x20, %rax
addl $0x4, %eax
movl %eax, %esi
callq 0x390e
leaq -0xb8(%rbp), %rdi
callq 0x3340
leaq 0x6d61(%rip), %rsi      # 0xb0c8
leaq -0x98(%rbp), %rdi
leaq -0x2f8(%rbp), %rdx
callq 0x3120
movq 0x58(%rbx), %rdi
callq 0x8d1a
movq %rax, %r15
movq 0x58(%rbx), %rdi
callq 0x8d1a
incl %r15d
andq %r13, %rax
movabsq $0x400000000, %rcx      # imm = 0x400000000
addq %rax, %rcx
orq %rcx, %r15
leaq -0x98(%rbp), %rdi
movq %r15, %rsi
callq 0x4d52
movss %xmm0, -0x2c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3340
leaq 0xcece(%rip), %rax      # 0x1129a
cmpb $0x0, (%rax)
jne 0x4433
leaq 0x6d01(%rip), %rsi      # 0xb0d9
leaq -0x2f8(%rbp), %r15
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x3310
movq %r15, %rdi
movss -0x30(%rbp), %xmm0
callq 0x31f0
leaq 0x6c9f(%rip), %rsi      # 0xb09d
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
movss -0x2c(%rbp), %xmm0
callq 0x31f0
movq %rax, %rdi
callq 0x3150
leaq -0x2f8(%rbp), %rdi
callq 0x3390
leaq -0x2f8(%rbp), %rdi
callq 0x33b0
callq 0x4aac
movq %rax, %r15
leaq 0x6ca2(%rip), %rsi      # 0xb0e4
leaq -0x78(%rbp), %rdi
leaq -0x2f8(%rbp), %rdx
callq 0x3120
leaq -0x78(%rbp), %rsi
movq %r15, %rdi
movss -0x30(%rbp), %xmm0
callq 0x8f84
leaq -0x78(%rbp), %rdi
callq 0x3340
callq 0x4aac
movq %rax, %r15
leaq 0x6c6f(%rip), %rsi      # 0xb0ea
leaq -0x58(%rbp), %rdi
leaq -0x2f8(%rbp), %rdx
callq 0x3120
leaq -0x58(%rbp), %rsi
movq %r15, %rdi
movss -0x2c(%rbp), %xmm0
callq 0x8f84
leaq -0x58(%rbp), %rdi
callq 0x3340
movss -0x30(%rbp), %xmm0
ucomiss 0x6bab(%rip), %xmm0     # 0xb05c
jne 0x44cb
jp 0x44cb
movss -0x2c(%rbp), %xmm0
ucomiss 0x6b9b(%rip), %xmm0     # 0xb05c
jne 0x44cb
jp 0x44cb
movb $0x1, 0x30(%rbx)
jmp 0x4541
movl $0x88, %edi
callq 0x32d0
movq %rax, %r15
movq %r14, %rdi
callq 0x8d1a
xorps %xmm0, %xmm0
cmpb $0x0, -0x38(%rbp)
je 0x44f1
movsd 0x6b77(%rip), %xmm0     # 0xb068
cvtss2sd -0x2c(%rbp), %xmm1
mulsd 0x6b72(%rip), %xmm1     # 0xb070
addsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
andps 0x6b73(%rip), %xmm0     # 0xb080
movss -0x30(%rbp), %xmm1
minss 0x6b46(%rip), %xmm1     # 0xb060
movq 0x38(%rbx), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x4c92
movq %r15, 0x50(%rbx)
movq %r15, %rdi
callq 0x81ae
movq 0x50(%rbx), %rsi
movq %rbx, %rdi
callq 0x8c32
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x32a0
jmp 0x45ab
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x3340
jmp 0x45ab
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3340
jmp 0x45ab
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x3340
jmp 0x45ab
movq %rax, %rbx
leaq -0x2f8(%rbp), %rdi
callq 0x33b0
jmp 0x45ab
jmp 0x45a8
jmp 0x45a8
jmp 0x45a8
jmp 0x45a8
jmp 0x45a8
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3450
movq %rax, %rbx
leaq -0x2f8(%rbp), %rdi
callq 0x33b0
jmp 0x45ab
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x3340
jmp 0x45ab
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x3340
jmp 0x45ab
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x3340
jmp 0x45ab
movq %rax, %rdi
callq 0x3aae
nop