// File: /workspace/github_cpp_makefile_star2_O3/tkaczenko[P]asteroids-clone/src/Ship.cpp
// Function: Ship::fire()
void Ship::fire()
{
    SDL_Point p = baseFormula(coefArr[0][0], coefArr[0][1], coefArr[0][2], coefArr[0][3]);

    float vX = velocity[0] + 500 * cosA;
    float vY = velocity[1] + 500 * sinA;

    std::stringstream ss;
    ss << bulletNum;
    std::string name = "bullet" + ss.str();

    Bullet sp = {p, vX, vY, BULLET, bulletNum};

    bullets.insert(std::pair<std::string, Bullet>(name, sp));
    bulletNum++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq (%rax), %rax
cvtsi2ssl (%rax), %xmm0
movss %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x4(%rax), %xmm0
movss %xmm0, -0x2c(%rbp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x10(%rdi), %xmm0
movss %xmm0, -0x34(%rbp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x8(%rax), %xmm0
movss %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
cvtsi2ssl 0xc(%rax), %xmm0
movss %xmm0, -0x3c(%rbp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x14(%rdi), %xmm0
movss %xmm0, -0x44(%rbp)
movss 0x24(%rdi), %xmm1
movss 0x28(%rdi), %xmm2
movss 0xa30(%rip), %xmm0      # 0x5138
movss %xmm1, -0x30(%rbp)
mulss %xmm0, %xmm1
addss 0x1c(%rdi), %xmm1
movss %xmm1, -0x50(%rbp)
movss %xmm2, -0x38(%rbp)
mulss %xmm2, %xmm0
addss 0x20(%rdi), %xmm0
movss %xmm0, -0x4c(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x21d0
leaq -0x288(%rbp), %rdi
movl 0x8c(%rbx), %esi
callq 0x23a0
leaq -0x280(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x2360
leaq 0x9fa(%rip), %rcx       # 0x5160
leaq -0x110(%rbp), %rdi
movl $0x6, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x22f0
movss -0x38(%rbp), %xmm2
movss -0x2c(%rbp), %xmm1
mulss %xmm2, %xmm1
movss -0x40(%rbp), %xmm0
movss -0x30(%rbp), %xmm3
mulss %xmm3, %xmm0
subss %xmm1, %xmm0
addss -0x34(%rbp), %xmm0
cvttss2si %xmm0, %ecx
movss -0x3c(%rbp), %xmm1
mulss %xmm3, %xmm1
movss -0x48(%rbp), %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
addss -0x44(%rbp), %xmm0
cvttss2si %xmm0, %r15d
shlq $0x20, %r15
leaq -0x60(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rsi
movq %rax, %rdx
addq $0x10, %rdx
cmpq %rdx, %rsi
je 0x47ee
movq %rsi, -0x70(%rbp)
movq (%rdx), %rsi
movq %rsi, -0x60(%rbp)
jmp 0x47f6
movups (%rdx), %xmm0
movups %xmm0, (%r12)
orq %rcx, %r15
leaq 0x8c(%rbx), %r14
movq 0x8(%rax), %rcx
movq %rcx, -0x68(%rbp)
movq %rdx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x100(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x482c
callq 0x2290
leaq -0x110(%rbp), %r8
movl $0x25c, (%r8)           # imm = 0x25C
leaq -0xb0(%rbp), %rdi
leaq -0x50(%rbp), %rdx
leaq -0x4c(%rbp), %rcx
movq %r15, %rsi
movq %r14, %r9
callq 0x2c4c
leaq -0x110(%rbp), %rdi
movq %r13, (%rdi)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
callq 0x36fa
movl -0x88(%rbp), %eax
leaq -0x110(%rbp), %rsi
movl %eax, 0x48(%rsi)
movups -0xa8(%rbp), %xmm0
movups -0x98(%rbp), %xmm1
movups %xmm1, 0x38(%rsi)
movups %xmm0, 0x28(%rsi)
leaq 0x3405(%rip), %rax      # 0x7ca0
addq $0x10, %rax
movq %rax, 0x20(%rsi)
movups -0x84(%rbp), %xmm0
movups %xmm0, 0x4c(%rsi)
movb -0x74(%rbp), %al
movb %al, 0x5c(%rsi)
addq $0x40, %rbx
movq %rbx, %rdi
callq 0x4a2a
leaq -0xf0(%rbp), %rbx
movq %rbx, %rdi
callq 0x2caa
movq -0x20(%rbx), %rdi
cmpq %r13, %rdi
je 0x48dd
callq 0x2290
incl (%r14)
leaq -0xb0(%rbp), %rdi
callq 0x2caa
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x48fa
callq 0x2290
movq 0x36bf(%rip), %rsi      # 0x7fc0
leaq -0x298(%rbp), %rdi
callq 0x21f0
leaq -0x218(%rbp), %rdi
callq 0x2130
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x49a2
jmp 0x493f
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x2caa
jmp 0x4950
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
jne 0x496e
jmp 0x497a
movq %rax, %rbx
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x497a
callq 0x2290
jmp 0x497a
jmp 0x4977
movq %rax, %rbx
movq 0x363f(%rip), %rsi      # 0x7fc0
leaq -0x298(%rbp), %rdi
callq 0x21f0
leaq -0x218(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x23b0
nop