// File: /workspace/github_cpp_makefile_star2_O1/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 0x68e0
movl %eax, %edi
xorl %esi, %esi
callq 0x387e
movq 0x58(%rbx), %rdi
callq 0x9a42
leal 0x1(%rax), %r15d
movq 0x58(%rbx), %rdi
callq 0x9a42
shrq $0x20, %rax
leal 0x1(%rax), %esi
movl %r15d, %edi
callq 0x38fc
leaq -0x300(%rbp), %r15
movq %r15, %rdi
movq %r14, -0x40(%rbp)
movq %r14, %rsi
callq 0x9bf2
movq (%r15), %rsi
leaq 0x7ecc(%rip), %rdi      # 0xc1bb
xorl %eax, %eax
callq 0x3060
movq (%r15), %rdi
leaq -0x2f0(%rbp), %rax
cmpq %rax, %rdi
je 0x430a
callq 0x3240
movq 0x58(%rbx), %rdi
callq 0x9a42
leal 0x1(%rax), %r15d
movq 0x58(%rbx), %rdi
callq 0x9a42
shrq $0x20, %rax
leal 0x3(%rax), %esi
movl %r15d, %edi
callq 0x38fc
leaq 0x7da5(%rip), %rdi      # 0xc0db
xorl %eax, %eax
callq 0x3060
movq 0x58(%rbx), %rdi
callq 0x9a42
leal 0x1(%rax), %r15d
movq 0x58(%rbx), %rdi
callq 0x9a42
shrq $0x20, %rax
leal 0x4(%rax), %esi
movl %r15d, %edi
callq 0x38fc
leaq 0x7d7a(%rip), %rdi      # 0xc0e3
xorl %eax, %eax
callq 0x3060
callq 0x4d7e
cmpb $0x1, 0x31(%rax)
jne 0x4453
leaq 0x7d65(%rip), %rsi      # 0xc0eb
leaq -0x300(%rbp), %r15
movq %r15, %rdi
movl $0x1, %edx
callq 0x32b0
callq 0x30d0
cltq
imulq $-0x6db6db6d, %rax, %rcx # imm = 0x92492493
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x2, %ecx
addl %edx, %ecx
leal (,%rcx,8), %edx
subl %edx, %ecx
leal (%rax,%rcx), %esi
incl %esi
movq %r15, %rdi
callq 0x3420
movq %rax, %r15
leaq 0x7cf5(%rip), %rsi      # 0xc0cd
movl $0x1, %edx
movq %rax, %rdi
callq 0x32d0
callq 0x30d0
movslq %eax, %rsi
imulq $0x66666667, %rsi, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
shll $0x4, %eax
leal (%rax,%rax,4), %eax
subl %eax, %esi
movq %r15, %rdi
callq 0x3420
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3180
leaq -0x300(%rbp), %rdi
callq 0x3330
leaq -0x300(%rbp), %rdi
callq 0x3350
movl $0x41, %edi
movl $0x1, %esi
callq 0x3946
leaq -0x70(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x7c86(%rip), %rsi      # 0xc0f8
leaq 0x7c86(%rip), %rdx      # 0xc0ff
leaq -0x80(%rbp), %rdi
callq 0x5744
movq 0x58(%rbx), %rdi
callq 0x9a42
movq %rax, %r15
movq 0x58(%rbx), %rdi
callq 0x9a42
movabsq $-0x100000000, %r13     # imm = 0xFFFFFFFF00000000
incl %r15d
andq %r13, %rax
orq %rax, %r15
movabsq $0x300000000, %rsi      # imm = 0x300000000
addq %r15, %rsi
leaq -0x80(%rbp), %rdi
callq 0x509e
movss %xmm0, -0x30(%rbp)
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x44d3
callq 0x3240
leaq -0xf0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x7c1b(%rip), %rsi      # 0xc100
leaq 0x7c1c(%rip), %rdx      # 0xc108
leaq -0x100(%rbp), %r15
movq %r15, %rdi
callq 0x5744
movq %r15, %rdi
callq 0x39ae
movq -0x100(%rbp), %rdi
cmpq %r14, %rdi
je 0x4514
callq 0x3240
movq 0x58(%rbx), %rdi
callq 0x9a42
movq %rax, %r15
leaq -0xd0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x7bb1(%rip), %rsi      # 0xc0e3
leaq 0x7bb1(%rip), %rdx      # 0xc0ea
leaq -0xe0(%rbp), %r12
movq %r12, %rdi
callq 0x5744
movq %r12, %rdi
callq 0x6d4e
movl %eax, %r12d
movq 0x58(%rbx), %rdi
callq 0x9a42
leal (%r15,%r12), %edi
incl %edi
shrq $0x20, %rax
addl $0x4, %eax
movl %eax, %esi
callq 0x38fc
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
je 0x4581
callq 0x3240
leaq -0x50(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x7b67(%rip), %rsi      # 0xc0f8
leaq 0x7b67(%rip), %rdx      # 0xc0ff
leaq -0x60(%rbp), %rdi
callq 0x5744
movq 0x58(%rbx), %rdi
callq 0x9a42
movq %rax, %r15
movq 0x58(%rbx), %rdi
callq 0x9a42
incl %r15d
andq %r13, %rax
movabsq $0x400000000, %rcx      # imm = 0x400000000
addq %rax, %rcx
orq %rcx, %r15
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
callq 0x509e
movss %xmm0, -0x2c(%rbp)
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x45eb
callq 0x3240
leaq 0xcc88(%rip), %rax      # 0x1127a
cmpb $0x0, (%rax)
jne 0x468f
leaq 0x7b07(%rip), %rsi      # 0xc109
leaq -0x300(%rbp), %r15
movq %r15, %rdi
movl $0x1, %edx
callq 0x32b0
xorps %xmm0, %xmm0
cvtss2sd -0x30(%rbp), %xmm0
movq %r15, %rdi
callq 0x33c0
movq %rax, %r15
leaq 0x7a9d(%rip), %rsi      # 0xc0cd
movl $0x1, %edx
movq %rax, %rdi
callq 0x32d0
xorps %xmm0, %xmm0
cvtss2sd -0x2c(%rbp), %xmm0
movq %r15, %rdi
callq 0x33c0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3180
leaq -0x300(%rbp), %rdi
callq 0x3330
leaq -0x300(%rbp), %rdi
callq 0x3350
callq 0x4d7e
movq %rax, %r15
leaq -0xb0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x7a6b(%rip), %rsi      # 0xc114
leaq 0x7a69(%rip), %rdx      # 0xc119
leaq -0xc0(%rbp), %r12
movq %r12, %rdi
callq 0x5744
movq %r15, %rdi
movq %r12, %rsi
movss -0x30(%rbp), %xmm0
callq 0x9c98
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x46e0
callq 0x3240
callq 0x4d7e
movq %rax, %r15
leaq -0x90(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x7a20(%rip), %rsi      # 0xc11a
leaq 0x7a1e(%rip), %rdx      # 0xc11f
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
callq 0x5744
movq %r15, %rdi
movq %r12, %rsi
movss -0x2c(%rbp), %xmm0
callq 0x9c98
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x4731
callq 0x3240
movss -0x30(%rbp), %xmm0
ucomiss 0x7947(%rip), %xmm0     # 0xc084
jne 0x4757
jp 0x4757
movss -0x2c(%rbp), %xmm0
ucomiss 0x7937(%rip), %xmm0     # 0xc084
jne 0x4757
jp 0x4757
movb $0x1, 0x30(%rbx)
jmp 0x47d1
movl $0x88, %edi
callq 0x3270
movq %rax, %r15
movq -0x40(%rbp), %rdi
callq 0x9a42
xorps %xmm0, %xmm0
cmpb $0x0, -0x38(%rbp)
je 0x477e
movsd 0x7912(%rip), %xmm0     # 0xc090
cvtss2sd -0x2c(%rbp), %xmm1
mulsd 0x790d(%rip), %xmm1     # 0xc098
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
andps 0x7903(%rip), %xmm0     # 0xc0a0
movss -0x30(%rbp), %xmm1
minss 0x78de(%rip), %xmm1     # 0xc088
movq 0x38(%rbx), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x4fc0
movq %r15, 0x50(%rbx)
movq %r15, %rdi
callq 0x8c86
movq 0x50(%rbx), %rsi
movq %rbx, %rdi
callq 0x98f2
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
jmp 0x4846
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
jmp 0x4833
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
jmp 0x4833
movq %rax, %rbx
movq -0x100(%rbp), %rdi
jmp 0x4833
movq %rax, %rbx
leaq -0x300(%rbp), %rdi
callq 0x3350
jmp 0x485c
movq %rax, %rbx
movq -0x60(%rbp), %rdi
jmp 0x4841
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
jne 0x4846
jmp 0x485c
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x485c
callq 0x3240
jmp 0x485c
movq %rax, %rbx
leaq -0x300(%rbp), %rdi
callq 0x3350
movq %rbx, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x3ad6