// File: /workspace/github_c_makefile_star2_O0/rroa[P]PUCMM_2D_Asteroids/Asteroids/Asteroid.cpp
// Function: Asteroids::Asteroid::Asteroid(Asteroids::Asteroid::AsteroidSize::Size)
Asteroid::Asteroid(AsteroidSize::Size size)
		: m_size(size)
		, m_angle(0.0f)
		, m_rotation(120)
	{
		m_sizeFactor = (int)size + 1;

		// Calculating the MIN/MAX size of the asteroid based on the size enum value
		//
		float min = MIN_SIZE / m_sizeFactor;
		float max = MAX_SIZE / m_sizeFactor;

		//type = ASTEROID_PLAYERTYPE;

		for (size_t i = 0; i < NUM_POINTS; ++i)
		{
			const float radians = (i / (float)NUM_POINTS) * 2.0f * PI;
			// TODO: RR: Move this to a rand in range function
			const float randDist = min + (max - min) * (rand() / (float)RAND_MAX);

			m_points.push_back(Engine::Vector2(sinf(radians) * randDist, cosf(radians) * randDist));
		}

		m_radius = (min + max) * 0.5f;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x6f30
movq -0x48(%rbp), %rdi
leaq 0x6b51(%rip), %rax      # 0x10d38
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x28, %rdi
movq %rdi, -0x50(%rbp)
callq 0x8b80
movq -0x48(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x40(%rax)
xorps %xmm0, %xmm0
movss %xmm0, 0x48(%rax)
movss 0x109b(%rip), %xmm0     # 0xb2b0
movss %xmm0, 0x4c(%rax)
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, 0x44(%rax)
cvtsi2ssl 0x44(%rax), %xmm1
movss 0x109c(%rip), %xmm0     # 0xb2cc
divss %xmm1, %xmm0
movss %xmm0, -0x10(%rbp)
cvtsi2ssl 0x44(%rax), %xmm1
movss 0x1082(%rip), %xmm0     # 0xb2c8
divss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x10, -0x20(%rbp)
jae 0xa38a
movq -0x20(%rbp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x58(%rbp)
testq %rax, %rax
movss %xmm0, -0x54(%rbp)
js 0xa29b
movss -0x58(%rbp), %xmm0
movss %xmm0, -0x54(%rbp)
movss -0x54(%rbp), %xmm0
movss 0x1028(%rip), %xmm1     # 0xb2d0
mulss %xmm1, %xmm0
addss %xmm0, %xmm0
movss 0x101c(%rip), %xmm1     # 0xb2d4
mulss %xmm1, %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x10(%rbp), %xmm1
movss %xmm1, -0x6c(%rbp)
movss -0x14(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x70(%rbp)
callq 0x3380
movss -0x70(%rbp), %xmm0
movss -0x6c(%rbp), %xmm1
movl %eax, %ecx
movq -0x48(%rbp), %rax
cvtsi2ss %ecx, %xmm2
movss 0xfde(%rip), %xmm3      # 0xb2d8
mulss %xmm3, %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x28(%rbp)
addq $0x28, %rax
movq %rax, -0x68(%rbp)
movss -0x24(%rbp), %xmm0
callq 0x3050
movss -0x28(%rbp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x5c(%rbp)
movss -0x24(%rbp), %xmm0
callq 0x3290
movaps %xmm0, %xmm1
movss -0x5c(%rbp), %xmm0
movss -0x28(%rbp), %xmm2
mulss %xmm2, %xmm1
leaq -0x30(%rbp), %rdi
callq 0x9ba0
jmp 0xa351
movq -0x68(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x8bc0
jmp 0xa360
jmp 0xa362
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xa257
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x5d30
jmp 0xa3af
movq -0x48(%rbp), %rax
movss -0x10(%rbp), %xmm0
addss -0x14(%rbp), %xmm0
movss 0xc64(%rip), %xmm1      # 0xb004
mulss %xmm1, %xmm0
movss %xmm0, 0x20(%rax)
addq $0x70, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3270
nopl (%rax,%rax)