// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movss %xmm0, -0x14(%rbp)
movss %xmm1, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x3bd1
movl $0x50, %edi
callq 0x30f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x78(%rbp)
movl -0xc(%rbp), %esi
callq 0xa1c0
jmp 0x39d8
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x90, %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rsi
callq 0x4bc0
movq -0x70(%rbp), %rdi
addq $0x60, %rdi
leaq -0x28(%rbp), %rsi
callq 0x4ca0
movss -0x14(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3b37
jp 0x3b37
movss -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3b37
jp 0x3b37
callq 0x3380
andl $0x1, %eax
movl %eax, -0x44(%rbp)
callq 0x3380
andl $0x1, %eax
movss 0x75b6(%rip), %xmm0     # 0xb00c
movss 0x75b2(%rip), %xmm1     # 0xb010
movss %xmm1, -0x80(%rbp)
cmpl $0x0, %eax
movss %xmm0, -0x7c(%rbp)
jne 0x3a77
movss -0x80(%rbp), %xmm0
movss %xmm0, -0x7c(%rbp)
movss -0x7c(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
andl $0x1, %eax
movl %eax, -0x4c(%rbp)
movss -0x48(%rbp), %xmm0
movslq -0x44(%rbp), %rcx
leaq 0xd7b3(%rip), %rax      # 0x11250
cvtsi2ssl (%rax,%rcx,4), %xmm1
mulss %xmm1, %xmm0
movss 0x7556(%rip), %xmm1     # 0xb004
mulss %xmm1, %xmm0
movslq -0x44(%rbp), %rax
movss %xmm0, -0x54(%rbp,%rax,4)
movslq -0x4c(%rbp), %rcx
leaq 0xd789(%rip), %rax      # 0x11250
cvtsi2ssl (%rax,%rcx,4), %xmm0
movss 0x7534(%rip), %xmm1     # 0xb008
mulss %xmm1, %xmm0
movslq -0x4c(%rbp), %rcx
leaq 0xd76d(%rip), %rax      # 0x11250
cvtsi2ssl (%rax,%rcx,4), %xmm1
movss 0x7514(%rip), %xmm2     # 0xb004
mulss %xmm2, %xmm1
callq 0x4ce0
movslq -0x4c(%rbp), %rax
movss %xmm0, -0x54(%rbp,%rax,4)
movq -0x28(%rbp), %rdi
movss -0x54(%rbp), %xmm0
movss -0x50(%rbp), %xmm1
callq 0x70a0
jmp 0x3b4a
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl $0x50, %esi
callq 0x30c0
jmp 0x3bda
movq -0x28(%rbp), %rdi
movss -0x14(%rbp), %xmm0
movss -0x18(%rbp), %xmm1
callq 0x70a0
movss 0x74c2(%rip), %xmm0     # 0xb014
movss %xmm0, -0x8c(%rbp)
movss 0x74b6(%rip), %xmm1     # 0xb018
movss %xmm1, -0x90(%rbp)
callq 0x4ce0
movss -0x90(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x8c(%rbp), %xmm0
movss %xmm2, -0x58(%rbp)
callq 0x4ce0
movss %xmm0, -0x5c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x88(%rbp)
movss -0x58(%rbp), %xmm0
movss -0x5c(%rbp), %xmm1
leaq -0x64(%rbp), %rdi
callq 0x9ba0
movq -0x88(%rbp), %rdi
movsd -0x64(%rbp), %xmm0
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x39ae
addq $0x90, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x3270
nopw %cs:(%rax,%rax)