// File: /workspace/github_cpp_makefile_star2_O1/Jacobious52[P]Tanks/GameView.cpp
// Function: GameView::_init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void GameView::_init(std::string name1, std::string name2)
{
    ConsoleTools::clear_screen();

    add_child(DebugView::shared_view());

    _position = Point<int>::zero();
    _size = ConsoleTools::get_terminal_size();

    // create tebrrain
    _terrain = new Terrain();
    add_child(_terrain);

    turn = false;

    // create tank 1
    int spawn_x = (rand() % 20) + 5;
    _tank1 = new Tank(name1, TextureTools::get_texture("tank1"), ConsoleTools::red);
    _tank1->set_position(Point<int>(spawn_x, _terrain->get_floor(spawn_x) - _tank1->get_size().y));
    add_child(_tank1);

    // create base for tank 1
    Sprite *base1 = new Sprite("        ");
    base1->set_position(_tank1->get_position() + Point<int>(-2, _tank1->get_size().y));
    base1->set_bcolor(ConsoleTools::white);
    base1->tag = TERRAIN_ROCK;
    _terrain->add_child(base1);

    // create tank 2
    spawn_x = (rand() % 20) + 5;
    _tank2 = new Tank(name2, TextureTools::get_texture("tank2"), ConsoleTools::blue);
    _tank2->set_position(Point<int>(get_size().x - spawn_x, _terrain->get_floor(get_size().x - spawn_x) - _tank2->get_size().y));
    add_child(_tank2);

    // create base for tank 2
    Sprite *base2 = new Sprite("        ");
    base2->set_position(_tank2->get_position() + Point<int>(-1, _tank2->get_size().y));
    base2->set_bcolor(ConsoleTools::white);
    base2->tag = TERRAIN_ROCK;
    _terrain->add_child(base2);

    // create box for input
    _input_box = new Sprite(TextureTools::get_texture("input"));
    _input_box->set_position(Point<int>(get_size().x/2 - _input_box->get_size().x/8, 3));
    _input_box->set_bcolor(ConsoleTools::endc);
    _input_box->set_fcolor(ConsoleTools::magneta);

    // create bullet, don't fire
    _bullet = new Bullet(_tank1->get_position(), 0, 0, _terrain);
    add_child(_bullet);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
callq 0x38d6
callq 0x4d7e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x98f2
movq $0x0, 0x18(%rbx)
callq 0x395e
movq %rax, 0x20(%rbx)
movl $0x38, %edi
callq 0x3270
movq %rax, %r14
movq %rax, %rdi
callq 0x4dc6
movq %r14, 0x38(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x98f2
movb $0x0, 0x60(%rbx)
callq 0x30d0
movl %eax, %r12d
movl $0x80, %edi
callq 0x3270
movq %rax, %r14
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x3b70
leaq -0x100(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x8406(%rip), %rsi      # 0xc0c0
leaq 0x8404(%rip), %rdx      # 0xc0c5
leaq -0x110(%rbp), %rdi
callq 0x5744
leaq -0x170(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x84aa
movq %r15, -0x30(%rbp)
leaq -0x70(%rbp), %rsi
leaq -0x170(%rbp), %rdx
movq %r14, %rdi
movl $0x1f, %ecx
callq 0x4e0c
movslq %r12d, %rax
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x23, %rax
addl %ecx, %eax
shll $0x2, %eax
leal (%rax,%rax,4), %r15d
negl %r15d
movq %r14, 0x40(%rbx)
leaq -0x160(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3d36
callq 0x3240
movq -0x110(%rbp), %rdi
cmpq %r13, %rdi
je 0x3d47
callq 0x3240
leal (%r12,%r15), %r14d
addl $0x5, %r14d
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3d61
callq 0x3240
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %r12
movl %r14d, %esi
callq 0x7cd2
movl %eax, %r13d
movq 0x40(%rbx), %rdi
callq 0x9a56
shrq $0x20, %rax
subl %eax, %r13d
shlq $0x20, %r13
movl %r14d, %esi
orq %r13, %rsi
movq %r12, %rdi
callq 0x9a4c
movq 0x40(%rbx), %rsi
movq %rbx, %rdi
callq 0x98f2
movl $0x60, %edi
callq 0x3270
movq %rax, %r14
leaq -0xe0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x8304(%rip), %rsi      # 0xc0c6
leaq 0x8305(%rip), %rdx      # 0xc0ce
leaq -0xf0(%rbp), %rdi
callq 0x5744
movq -0x30(%rbp), %r15
leaq -0xf0(%rbp), %rsi
movq %r14, %rdi
callq 0x4ee6
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x3df9
callq 0x3240
movabsq $-0x100000000, %r13     # imm = 0xFFFFFFFF00000000
movq 0x40(%rbx), %rdi
callq 0x9a42
movq %rax, %r12
movq 0x40(%rbx), %rdi
callq 0x9a56
andq %r13, %rax
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
leal (%r12,%rdx), %esi
addq %rax, %r12
andq %r13, %r12
orq %r12, %rsi
movq %r14, %rdi
callq 0x9a4c
movq %r14, %rdi
movl $0x25, %esi
callq 0x68fe
movl $0xb, 0x8(%r14)
movq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0x98f2
callq 0x30d0
movl %eax, %r12d
movl $0x80, %edi
callq 0x3270
movq %rax, %r14
leaq -0xc0(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %rdi
callq 0x3b70
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x8234(%rip), %rsi      # 0xc0cf
leaq 0x8232(%rip), %rdx      # 0xc0d4
leaq -0x50(%rbp), %rdi
callq 0x5744
leaq -0x150(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x84aa
movq %r13, %r15
leaq -0xd0(%rbp), %rsi
leaq -0x150(%rbp), %rdx
movq %r14, %rdi
movl $0x22, %ecx
callq 0x4e0c
movslq %r12d, %rax
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x23, %rax
addl %ecx, %eax
shll $0x2, %eax
leal (%rax,%rax,4), %r13d
negl %r13d
movq %r14, 0x48(%rbx)
leaq -0x140(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3f13
callq 0x3240
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3f25
callq 0x3240
addl %r12d, %r13d
addl $0x5, %r13d
movq -0xd0(%rbp), %rdi
cmpq %r15, %rdi
je 0x3f3d
callq 0x3240
movq 0x48(%rbx), %r14
movq %rbx, %rdi
callq 0x9a56
movq %rax, %r15
subl %r13d, %r15d
movq 0x38(%rbx), %r12
movq %rbx, %rdi
callq 0x9a56
subl %r13d, %eax
movq %r12, %rdi
movl %eax, %esi
callq 0x7cd2
movl %eax, %r12d
movq 0x48(%rbx), %rdi
callq 0x9a56
shrq $0x20, %rax
subl %eax, %r12d
shlq $0x20, %r12
orq %r12, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x9a4c
movq 0x48(%rbx), %rsi
movq %rbx, %rdi
callq 0x98f2
movl $0x60, %edi
callq 0x3270
movq %rax, %r14
leaq -0xa0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x810e(%rip), %rsi      # 0xc0c6
leaq 0x810f(%rip), %rdx      # 0xc0ce
leaq -0xb0(%rbp), %rdi
callq 0x5744
leaq -0xb0(%rbp), %rsi
movq %r14, %rdi
callq 0x4ee6
movabsq $-0x100000000, %r12     # imm = 0xFFFFFFFF00000000
movq -0xb0(%rbp), %rdi
cmpq %r15, %rdi
je 0x3ff5
callq 0x3240
movq 0x48(%rbx), %rdi
callq 0x9a42
movq %rax, %r15
movq 0x48(%rbx), %rdi
callq 0x9a56
andq %r12, %rax
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
leal (%rcx,%r15), %esi
incl %esi
addq %rax, %r15
andq %r12, %r15
orq %r15, %rsi
movq %r14, %rdi
callq 0x9a4c
movq %r14, %rdi
movl $0x25, %esi
callq 0x68fe
movl $0xb, 0x8(%r14)
movq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0x98f2
movl $0x60, %edi
callq 0x3270
movq %rax, %r14
leaq -0x80(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x806f(%rip), %rsi      # 0xc0d5
leaq 0x806d(%rip), %rdx      # 0xc0da
leaq -0x90(%rbp), %rdi
callq 0x5744
leaq -0x130(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x84aa
leaq -0x130(%rbp), %rsi
movq %r14, %rdi
callq 0x4ee6
movq %r14, 0x58(%rbx)
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40b4
callq 0x3240
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x40c5
callq 0x3240
movq 0x58(%rbx), %r14
movq %rbx, %rdi
callq 0x9a56
movl %eax, %r15d
shrl $0x1f, %r15d
addl %eax, %r15d
sarl %r15d
movq 0x58(%rbx), %rdi
callq 0x9a56
leal 0x7(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x3, %ecx
subl %ecx, %r15d
movabsq $0x300000000, %rsi      # imm = 0x300000000
orq %r15, %rsi
movq %r14, %rdi
callq 0x9a4c
movq 0x58(%rbx), %rdi
xorl %esi, %esi
callq 0x68fe
movq 0x58(%rbx), %rdi
movl $0x23, %esi
callq 0x68ea
movl $0x88, %edi
callq 0x3270
movq %rax, %r14
movq 0x40(%rbx), %rdi
callq 0x9a42
movq 0x38(%rbx), %rdx
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %r14, %rdi
movq %rax, %rsi
callq 0x4fc0
movq %r14, 0x50(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x98f2
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x418c
callq 0x3240
jmp 0x418c
movq %rax, %rbx
movq -0x90(%rbp), %rdi
jmp 0x41ec
jmp 0x4253
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
jmp 0x41ec
jmp 0x4253
movq %rax, %rbx
leaq -0x140(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41cb
callq 0x3240
jmp 0x41cb
movq %r13, %r15
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x41e5
callq 0x3240
jmp 0x41e5
movq %r13, %r15
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r15, %rdi
jne 0x4248
jmp 0x4256
jmp 0x4253
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
jne 0x4248
jmp 0x4256
jmp 0x4253
movq %rax, %rbx
leaq -0x160(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4225
callq 0x3240
jmp 0x4225
movq %rax, %rbx
movq -0x110(%rbp), %rdi
cmpq %r13, %rdi
je 0x423b
callq 0x3240
jmp 0x423b
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x4256
callq 0x3240
jmp 0x4256
jmp 0x4253
jmp 0x4253
movq %rax, %rbx
movq %r14, %rdi
callq 0x3240
movq %rbx, %rdi
callq 0x3440