// File: /workspace/github_c_makefile_star2_O3/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::CreateAsteroid(Asteroids::Asteroid::AsteroidSize::Size, int, float, float)
void Game::CreateAsteroid(Asteroids::Asteroid::AsteroidSize::Size size, int amount, float x, float y)
	{
		for (int i = 0; i < amount; ++i)
		{
			Asteroids::Asteroid* pAsteroid = new Asteroids::Asteroid(size);
			m_entities.push_back(pAsteroid);
			m_asteroids.push_back(pAsteroid);

			if (x == 0 && y == 0)
			{
				const int sideAxis = rand() & 1;
				const float sideDir = (rand() & 1) ? 1.0f : -1.0f;

				const int otherSideAxis = (sideAxis + 1) & 1;

				float point[2];
				point[sideAxis] = sideDir * m_dimensions[sideAxis] * 0.5f;
				point[otherSideAxis] = randInRange(m_dimensions[otherSideAxis] * -0.5f, m_dimensions[otherSideAxis] * 0.5f);

				pAsteroid->Teleport(point[0], point[1]);
			}
			else
			{
				pAsteroid->Teleport(x, y);
			}

			// Applying impulse to the asteroid
			//
			float x = randInRange(-150.0f, 150.0f);
			float y = randInRange(-150.0f, 150.0f);

			pAsteroid->ApplyImpulse(Engine::Vector2(x, y));
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
testl %edx, %edx
jle 0x3aad
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x90(%rdi), %r12
leaq 0x60(%rdi), %r15
xorps %xmm0, %xmm0
movaps 0x40(%rsp), %xmm1
cmpeqps %xmm0, %xmm1
cmpeqps 0x30(%rsp), %xmm0
andps %xmm1, %xmm0
movss %xmm0, 0x14(%rsp)
movq %rdi, 0x20(%rsp)
movl $0x50, %edi
callq 0x30c0
movq %rax, %r13
movq %rax, %rdi
movl %ebp, %esi
callq 0x59c8
movl $0x18, %edi
callq 0x30c0
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x30d0
incq 0xa0(%r14)
movl $0x18, %edi
callq 0x30c0
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x30d0
incq 0x70(%r14)
testb $0x1, 0x14(%rsp)
je 0x3a1a
movq %r15, %r14
movq %r12, %r15
movl %ebp, %r12d
callq 0x32e0
movl %eax, %ebp
andl $0x1, %ebp
callq 0x32e0
leal (,%rbp,4), %ecx
leaq 0x586b(%rip), %rdx      # 0x91e0
xorps %xmm0, %xmm0
cvtsi2ssl (%rcx,%rdx), %xmm0
testb $0x1, %al
jne 0x3988
xorps 0x2688(%rip), %xmm0     # 0x6010
xorl $0x1, %ebp
movss 0x268d(%rip), %xmm1     # 0x6020
mulss %xmm1, %xmm0
movss %xmm0, 0x18(%rsp,%rcx)
shll $0x2, %ebp
leaq 0x5839(%rip), %rax      # 0x91e0
cvtsi2ssl (%rbp,%rax), %xmm2
movaps %xmm2, %xmm0
mulss 0x266c(%rip), %xmm0     # 0x6024
movss %xmm0, 0xc(%rsp)
mulss %xmm1, %xmm2
subss %xmm0, %xmm2
movss %xmm2, 0x10(%rsp)
callq 0x32e0
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss 0x2648(%rip), %xmm1     # 0x6028
mulss %xmm1, %xmm0
mulss 0x10(%rsp), %xmm0
addss 0xc(%rsp), %xmm0
movss %xmm0, 0x18(%rsp,%rbp)
movss 0x18(%rsp), %xmm0
movss 0x1c(%rsp), %xmm1
movq %r13, %rdi
callq 0x44e8
movl %r12d, %ebp
movq %r15, %r12
movq %r14, %r15
movq 0x20(%rsp), %r14
jmp 0x3a2c
movq %r13, %rdi
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
callq 0x44e8
callq 0x32e0
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
movss 0x25e8(%rip), %xmm0     # 0x6028
mulss %xmm0, %xmm1
movss 0x25e0(%rip), %xmm0     # 0x602c
mulss %xmm0, %xmm1
movss 0x25d8(%rip), %xmm0     # 0x6030
addss %xmm0, %xmm1
movss %xmm1, 0xc(%rsp)
callq 0x32e0
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0x25b2(%rip), %xmm1     # 0x6028
mulss 0x25ae(%rip), %xmm1     # 0x602c
addss 0x25aa(%rip), %xmm1     # 0x6030
leaq 0x28(%rsp), %rdi
movss 0xc(%rsp), %xmm0
callq 0x5814
movsd 0x28(%rsp), %xmm0
movq (%r13), %rax
movq %r13, %rdi
callq *(%rax)
decl %ebx
jne 0x38f0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x50, %esi
movq %r13, %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x3230