// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/GameView.cpp
// Function: GameView::update(int)
void GameView::update(int t)
{
    // bullet needs firing
    DebugView::shared_view()->watch("terrain count", _terrain->get_children()->get_count());

    View::update(t);

    // check if bullet is inside tank1
    if (_bullet->get_position().x >= _tank1->get_position().x
        && _bullet->get_position().x <= _tank1->get_position().x + _tank1->get_size().x
        && _bullet->get_position().y > _tank1->get_position().y
        && _bullet->get_position().y <= _tank1->get_position().y + _tank1->get_size().y)
    {
        _winner = _tank2->get_name();
        ConsoleTools::play_music("boom.wav");
        _should_remove_from_parent = true;
        return;
    }
    // check if bullet is inside tank2
    else if (_bullet->get_position().x >= _tank2->get_position().x
        && _bullet->get_position().x <= _tank2->get_position().x + _tank2->get_size().x
        && _bullet->get_position().y > _tank2->get_position().y
        && _bullet->get_position().y <= _tank2->get_position().y + _tank2->get_size().y)
    {
        _winner = _tank1->get_name();
        ConsoleTools::play_music("boom.wav");
        _should_remove_from_parent = true;
        return;
    }
    // bullet has hit. next turn
    if (_bullet->get_launched() == false || _bullet->should_remove_from_parent() == true)
    {
        _terrain->shuffle_wind_speed();
        DebugView::shared_view()->watch("wind speed", _terrain->get_wind_speed());
        draw();
       _get_input();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x4aac
movq %rax, %r15
leaq 0x6acb(%rip), %rsi      # 0xb0f0
leaq -0xb8(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x3120
movq 0x38(%rbx), %rdi
callq 0x8c28
movq 0x8(%rax), %rax
testq %rax, %rax
js 0x464e
cvtsi2ss %rax, %xmm0
jmp 0x4663
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
leaq -0xb8(%rbp), %rsi
movq %r15, %rdi
callq 0x8f84
leaq -0xb8(%rbp), %rdi
callq 0x3340
movq %rbx, %rdi
movl %r14d, %esi
callq 0x8c7c
movq 0x50(%rbx), %rdi
callq 0x8d1a
movq %rax, %r14
movq 0x40(%rbx), %rdi
callq 0x8d1a
cmpl %eax, %r14d
jl 0x472b
movq 0x50(%rbx), %rdi
callq 0x8d1a
movq %rax, %r14
movq 0x40(%rbx), %rdi
callq 0x8d1a
movq %rax, %r15
movq 0x40(%rbx), %rdi
callq 0x8d2e
addl %r15d, %eax
cmpl %r14d, %eax
jl 0x472b
movq 0x50(%rbx), %rdi
callq 0x8d1a
movq %rax, %r14
shrq $0x20, %r14
movq 0x40(%rbx), %rdi
callq 0x8d1a
shrq $0x20, %rax
cmpl %eax, %r14d
jle 0x472b
movq 0x50(%rbx), %rdi
callq 0x8d1a
movq %rax, %r14
shrq $0x20, %r14
movq 0x40(%rbx), %rdi
callq 0x8d1a
movq %rax, %r15
shrq $0x20, %r15
movq 0x40(%rbx), %rdi
callq 0x8d2e
shrq $0x20, %rax
addl %r15d, %eax
cmpl %r14d, %eax
jge 0x4849
movq 0x50(%rbx), %rdi
callq 0x8d1a
movq %rax, %r14
movq 0x48(%rbx), %rdi
callq 0x8d1a
cmpl %eax, %r14d
jl 0x47cd
movq 0x50(%rbx), %rdi
callq 0x8d1a
movq %rax, %r14
movq 0x48(%rbx), %rdi
callq 0x8d1a
movq %rax, %r15
movq 0x48(%rbx), %rdi
callq 0x8d2e
addl %r15d, %eax
cmpl %r14d, %eax
jl 0x47cd
movq 0x50(%rbx), %rdi
callq 0x8d1a
movq %rax, %r14
shrq $0x20, %r14
movq 0x48(%rbx), %rdi
callq 0x8d1a
shrq $0x20, %rax
cmpl %eax, %r14d
jle 0x47cd
movq 0x50(%rbx), %rdi
callq 0x8d1a
movq %rax, %r14
shrq $0x20, %r14
movq 0x48(%rbx), %rdi
callq 0x8d1a
movq %rax, %r15
shrq $0x20, %r15
movq 0x48(%rbx), %rdi
callq 0x8d2e
shrq $0x20, %rax
addl %r15d, %eax
cmpl %r14d, %eax
jge 0x489f
movq 0x50(%rbx), %rdi
callq 0x8216
testb %al, %al
je 0x47e7
movq 0x50(%rbx), %rdi
callq 0x8ce2
testb %al, %al
je 0x483b
movq 0x38(%rbx), %rdi
callq 0x72a0
callq 0x4aac
movq %rax, %r14
leaq 0x6908(%rip), %rsi      # 0xb107
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x3120
movq 0x38(%rbx), %rdi
callq 0x7630
leaq -0x58(%rbp), %rsi
movq %r14, %rdi
callq 0x8f84
leaq -0x58(%rbp), %rdi
callq 0x3340
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x40de
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%rbx), %rsi
leaq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x8ee2
leaq 0x68(%rbx), %rdi
movq %r14, %rsi
callq 0x3180
leaq -0x38(%rbp), %rdi
callq 0x3340
leaq 0x6889(%rip), %rsi      # 0xb0fe
leaq -0x98(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x3120
leaq -0x98(%rbp), %rdi
callq 0x39be
leaq -0x98(%rbp), %rdi
callq 0x3340
jmp 0x48ea
movq 0x40(%rbx), %rsi
leaq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x8ee2
leaq 0x68(%rbx), %rdi
movq %r14, %rsi
callq 0x3180
leaq -0x38(%rbp), %rdi
callq 0x3340
leaq 0x6833(%rip), %rsi      # 0xb0fe
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x3120
leaq -0x78(%rbp), %rdi
callq 0x39be
leaq -0x78(%rbp), %rdi
callq 0x3340
movb $0x1, 0x30(%rbx)
jmp 0x483b
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3340
jmp 0x4956
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x3340
jmp 0x4956
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x3340
jmp 0x4956
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x3340
jmp 0x4956
jmp 0x4942
jmp 0x4942
jmp 0x4942
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x3340
jmp 0x4956
movq %rax, %rbx
jmp 0x4956
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x3340
movq %rbx, %rdi
callq 0x3450
movq %rax, %rdi
callq 0x3aae