// File: Jacobious52[P]Tanks/Game.cpp
// Function: Game::timer_did_tick(Timer*, int)
void timer_did_tick(Timer *sender, int t)
    {
        tick_time++;

        std::cin.clear();

        // update
	    current_view->update(tick_time);

        // clear and draw
        ConsoleTools::end_color();
        ConsoleTools::clear_screen();
        current_view->draw();

        // Exit introview and goto gameview
        if (current_view == intro_view && current_view->should_remove_from_parent())
        {
            game_view = new GameView(intro_view->player1, intro_view->player2);
            game_view->tag = intro_view->tag;
            current_view = game_view;

            delete intro_view;
            intro_view = 0;

            ConsoleTools::end_color();
            ConsoleTools::clear_screen();
            current_view->draw();
            tick_time = 0;
        }
        // Exit gameview and goto endview
        if (current_view == game_view && current_view->should_remove_from_parent())
        {
            end_view = new EndView(game_view->get_winner());
            end_view->tag = game_view->tag;
            current_view = end_view;

            delete game_view;
            game_view = 0;

            ConsoleTools::end_color();
            ConsoleTools::clear_screen();
            current_view->draw();
            tick_time = 0;
        }
        // Exit endview and exit game
        if (current_view == end_view && current_view->should_remove_from_parent())
        {
            current_view = 0;
            delete end_view;
            end_view = 0;

            //end game loop
            timer.end();
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl 0x48(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x48(%rax)
movq 0x7f0f(%rip), %rax      # 0x1afe0
movq (%rax), %rax
movq 0x7f05(%rip), %rdi      # 0x1afe0
addq -0x18(%rax), %rdi
xorl %esi, %esi
callq 0x4580
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rdi
movl 0x48(%rax), %esi
movq (%rdi), %rax
callq *0x10(%rax)
callq 0x4b80
callq 0x4be0
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq -0xa0(%rbp), %rcx
movq 0x8(%rcx), %rax
cmpq 0x10(%rcx), %rax
jne 0x132a1
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x105d0
testb $0x1, %al
jne 0x13143
jmp 0x132a1
movl $0x88, %edi
callq 0x43a0
movq %rax, %rcx
movq -0xa0(%rbp), %rax
movq %rcx, -0xa8(%rbp)
movb $0x1, -0x69(%rbp)
movq 0x10(%rax), %rsi
addq $0x38, %rsi
leaq -0x38(%rbp), %rdi
callq 0x4190
jmp 0x13175
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rsi
addq $0x58, %rsi
leaq -0x68(%rbp), %rdi
callq 0x4190
jmp 0x1318f
movq -0xa8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x12f40
jmp 0x131a5
movq -0xa0(%rbp), %rax
movq -0xa8(%rbp), %rcx
movb $0x0, -0x69(%rbp)
movq %rcx, 0x18(%rax)
leaq -0x68(%rbp), %rdi
callq 0x4200
jmp 0x131c6
leaq -0x38(%rbp), %rdi
callq 0x4200
jmp 0x131d1
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rcx
movl 0x8(%rcx), %edx
movq 0x18(%rax), %rcx
movl %edx, 0x8(%rcx)
movq 0x18(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, %rax
je 0x1320c
movq -0xb0(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0xa0(%rbp), %rax
movq $0x0, 0x10(%rax)
callq 0x4b80
callq 0x4be0
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq -0xa0(%rbp), %rax
movl $0x0, 0x48(%rax)
jmp 0x132a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x13288
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1327b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4200
jmp 0x13279
jmp 0x1327b
leaq -0x38(%rbp), %rdi
callq 0x4200
jmp 0x13286
jmp 0x13288
testb $0x1, -0x69(%rbp)
jne 0x13290
jmp 0x1329c
movq -0xa8(%rbp), %rdi
callq 0x4360
jmp 0x1346c
movq -0xa0(%rbp), %rcx
movq 0x8(%rcx), %rax
cmpq 0x18(%rcx), %rax
jne 0x133f7
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x105d0
testb $0x1, %al
jne 0x132cf
jmp 0x133f7
movl $0x58, %edi
callq 0x43a0
movq %rax, %rcx
movq -0xa0(%rbp), %rax
movq %rcx, -0xb8(%rbp)
movb $0x1, -0x91(%rbp)
movq 0x18(%rax), %rsi
leaq -0x90(%rbp), %rdi
callq 0x7070
jmp 0x13303
movq -0xb8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x13500
jmp 0x13318
movq -0xa0(%rbp), %rax
movq -0xb8(%rbp), %rcx
movb $0x0, -0x91(%rbp)
movq %rcx, 0x20(%rax)
leaq -0x90(%rbp), %rdi
callq 0x4200
jmp 0x1333f
movq -0xa0(%rbp), %rax
movq 0x18(%rax), %rcx
movl 0x8(%rcx), %edx
movq 0x20(%rax), %rcx
movl %edx, 0x8(%rcx)
movq 0x20(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rax), %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, %rax
je 0x1337a
movq -0xc0(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0xa0(%rbp), %rax
movq $0x0, 0x18(%rax)
callq 0x4b80
callq 0x4be0
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq -0xa0(%rbp), %rax
movl $0x0, 0x48(%rax)
jmp 0x133f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x133de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x4200
jmp 0x133dc
jmp 0x133de
testb $0x1, -0x91(%rbp)
jne 0x133e9
jmp 0x133f5
movq -0xb8(%rbp), %rdi
callq 0x4360
jmp 0x1346c
movq -0xa0(%rbp), %rcx
movq 0x8(%rcx), %rax
cmpq 0x20(%rcx), %rax
jne 0x13463
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x105d0
testb $0x1, %al
jne 0x1341e
jmp 0x13463
movq -0xa0(%rbp), %rax
movq $0x0, 0x8(%rax)
movq 0x20(%rax), %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, %rax
je 0x1344b
movq -0xc8(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0xa0(%rbp), %rdi
movq $0x0, 0x20(%rdi)
addq $0x28, %rdi
callq 0xeb20
addq $0xd0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x45e0
movq %rax, %rdi
callq 0x4ec0
nopl (%rax)