// File: Jacobious52[P]Tanks/EndView.cpp
// Function: EndView::_init()
void EndView::_init()
{
    _position = Point<int>::zero();
    _size = ConsoleTools::get_terminal_size();

    // game over text
    Sprite *game_over_text = new Sprite(TextureTools::get_texture("gameover"));
    game_over_text->set_position(Point<int>(get_size().x/2 - game_over_text->get_size().x/4 + 6, 2));
    game_over_text->set_size(Point<int>(game_over_text->get_size().x, game_over_text->get_size().y));
    game_over_text->set_fcolor(ConsoleTools::magneta);
    add_child(game_over_text);

    // winner name text
    Sprite *winner_text = new Sprite(_winner + " Wins!");
    winner_text->set_position(Point<int>(_size.x/2 - StringTools::string_width(_winner + " Wins!")/2, (_size.y/2)-1));
    winner_text->set_fcolor(ConsoleTools::magneta);
    winner_text->set_bcolor(ConsoleTools::white);
    add_child(winner_text);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x118(%rbp)
callq 0x7110
movq %rax, %rcx
movq -0x118(%rbp), %rax
movq %rcx, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, 0x18(%rax)
callq 0x4cb0
movq %rax, %rcx
movq -0x118(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq %rcx, 0x20(%rax)
movl $0x60, %edi
callq 0x43a0
movq %rax, -0x110(%rbp)
movb $0x1, -0x75(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x45f0
movq -0x108(%rbp), %rdx
leaq 0xa0ac(%rip), %rsi      # 0x141af
leaq -0x60(%rbp), %rdi
callq 0x4490
jmp 0xa10e
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xd2a0
jmp 0xa11d
movq -0x110(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x72a0
jmp 0xa12f
movb $0x0, -0x75(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x4200
jmp 0xa13e
leaq -0x60(%rbp), %rdi
callq 0x4200
jmp 0xa149
leaq -0x61(%rbp), %rdi
callq 0x4400
movq -0x110(%rbp), %rax
movq -0x118(%rbp), %rdi
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x138(%rbp)
callq 0x106a0
movq %rax, -0x88(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, -0x13c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x106a0
movl -0x13c(%rbp), %esi
movq %rax, -0x90(%rbp)
movl -0x90(%rbp), %eax
movl %eax, %ecx
addl $0x3, %ecx
testl %eax, %eax
cmovsl %ecx, %eax
sarl $0x2, %eax
subl %eax, %esi
addl $0x6, %esi
leaq -0x80(%rbp), %rdi
movl $0x2, %edx
callq 0x4ed0
movq -0x138(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x10680
movq -0x20(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x106a0
movq %rax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, -0x12c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x106a0
movl -0x12c(%rbp), %esi
movq %rax, -0xa8(%rbp)
movl -0xa4(%rbp), %edx
leaq -0x98(%rbp), %rdi
callq 0x4ed0
movq -0x128(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x106c0
movq -0x20(%rbp), %rdi
movl $0x23, %esi
callq 0xa670
movq -0x118(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x10420
movl $0x60, %edi
callq 0x43a0
movq -0x118(%rbp), %rsi
movq %rax, -0x120(%rbp)
movb $0x1, -0xd1(%rbp)
addq $0x38, %rsi
leaq 0x9f36(%rip), %rdx      # 0x141b8
leaq -0xd0(%rbp), %rdi
callq 0x4ef0
jmp 0xa290
movq -0x120(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x72a0
jmp 0xa2a5
movb $0x0, -0xd1(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x4200
jmp 0xa2ba
movq -0x118(%rbp), %rsi
movq -0x120(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x158(%rbp)
movl 0x20(%rsi), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, -0x14c(%rbp)
addq $0x38, %rsi
leaq 0x9ebe(%rip), %rdx      # 0x141b8
leaq -0x100(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x4ef0
movq -0x148(%rbp), %rdi
callq 0xaeb0
movl %eax, -0x140(%rbp)
jmp 0xa321
movq -0x118(%rbp), %rax
movl -0x14c(%rbp), %esi
movl -0x140(%rbp), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %ecx
sarl %ecx
subl %ecx, %esi
movl 0x24(%rax), %edx
movl %edx, %eax
shrl $0x1f, %eax
addl %eax, %edx
sarl %edx
decl %edx
leaq -0xdc(%rbp), %rdi
callq 0x4ed0
jmp 0xa35b
movq -0x158(%rbp), %rdi
movq -0xdc(%rbp), %rsi
callq 0x10680
jmp 0xa370
leaq -0x100(%rbp), %rdi
callq 0x4200
movq -0xb0(%rbp), %rdi
movl $0x23, %esi
callq 0xa670
movq -0xb0(%rbp), %rdi
movl $0x25, %esi
callq 0xa6b0
movq -0x118(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x10420
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xa3fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xa3ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x4200
jmp 0xa3ed
jmp 0xa3ef
leaq -0x60(%rbp), %rdi
callq 0x4200
jmp 0xa3fa
jmp 0xa3fc
leaq -0x61(%rbp), %rdi
callq 0x4400
testb $0x1, -0x75(%rbp)
jne 0xa40d
jmp 0xa419
movq -0x110(%rbp), %rdi
callq 0x4360
jmp 0xa47a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xa445
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x4200
jmp 0xa443
jmp 0xa445
testb $0x1, -0xd1(%rbp)
jne 0xa450
jmp 0xa45c
movq -0x120(%rbp), %rdi
callq 0x4360
jmp 0xa47a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x4200
jmp 0xa478
jmp 0xa47a
movq -0x70(%rbp), %rdi
callq 0x45e0
movq %rax, %rdi
callq 0x4ec0
nopl (%rax,%rax)