LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::GlewInit()
bool Game::GlewInit()
	{
		GLenum err = glewInit();
		if (GLEW_OK != err)
		{
			std::cerr << "Error: " << glewGetErrorString(err) << std::endl;
			return false;
		}

		return true;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x3370
movl %eax, %ebx
testl %eax, %eax
je 0x3e5f
movq 0x520f(%rip), %r14      # 0x8ff0
leaq 0x22d5(%rip), %rsi      # 0x60bd
movl $0x7, %edx
movq %r14, %rdi
callq 0x32d0
movl %ebx, %edi
callq 0x30f0
testq %rax, %rax
je 0x3e20
movq %rax, %r15
movq %rax, %rdi
callq 0x3160
movq 0x51dd(%rip), %rdi      # 0x8ff0
movq %r15, %rsi
movq %rax, %rdx
callq 0x32d0
jmp 0x3e38
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x3350
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3330
movsbl %al, %esi
movq %r14, %rdi
callq 0x31e0
movq %rax, %rdi
callq 0x31a0
testl %ebx, %ebx
sete %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::SetupViewport()
void Game::SetupViewport()
	{
		// Defining ortho values
		//
		float halfWidth = m_width * 0.5f;
		float halfHeight = m_height * 0.5f;

		// Set viewport to match window
		//
		glViewport(0, 0, m_width, m_height);

		// Set Mode to GL_PROJECTION
		//
		glMatrixMode(GL_PROJECTION);
		glLoadIdentity();

		// Set projection MATRIX to ORTHO
		//
		glOrtho(-halfWidth, halfWidth, -halfHeight, halfHeight, -1, 1);

		// Setting Mode to GL_MODELVIEW
		//
		glMatrixMode(GL_MODELVIEW);
	}

// Assembly:
subq $0x28, %rsp
movl 0x8(%rdi), %edx
cvtsi2ss %edx, %xmm1
movl 0xc(%rdi), %ecx
movss 0x21a0(%rip), %xmm0     # 0x6020
mulss %xmm0, %xmm1
movaps %xmm1, (%rsp)
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
mulss %xmm0, %xmm1
movaps %xmm1, 0x10(%rsp)
xorl %edi, %edi
xorl %esi, %esi
callq 0x3170
movl $0x1701, %edi           # imm = 0x1701
callq 0x3090
callq 0x30e0
movaps 0x2159(%rip), %xmm2     # 0x6010
movaps (%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
xorps %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
movaps 0x10(%rsp), %xmm3
xorps %xmm3, %xmm2
cvtss2sd %xmm2, %xmm2
cvtss2sd %xmm3, %xmm3
movsd 0x216f(%rip), %xmm4     # 0x6050
movsd 0x216f(%rip), %xmm5     # 0x6058
callq 0x3100
movl $0x1700, %edi           # imm = 0x1700
addq $0x28, %rsp
jmp 0x3090
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::CreateDebris(Asteroids::Entity*)
void Game::CreateDebris(Asteroids::Entity* entity)
	{
		auto currentAsteroid = dynamic_cast < Asteroids::Asteroid* >(entity);
		if (currentAsteroid != nullptr
			&& currentAsteroid->GetSize() != Asteroids::Asteroid::AsteroidSize::SMALL)
		{
			auto newSize = 
				(currentAsteroid->GetSize() == Asteroids::Asteroid::AsteroidSize::BIG) ? 
					Asteroids::Asteroid::AsteroidSize::MEDIUM : 
					Asteroids::Asteroid::AsteroidSize::SMALL;

			CreateAsteroid(newSize, 2, currentAsteroid->GetX(), currentAsteroid->GetY());
		}
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x3f8e
leaq 0x4c63(%rip), %rax      # 0x8bd8
leaq 0x4dec(%rip), %rdx      # 0x8d68
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x32c0
movq %rax, %r14
jmp 0x3f91
xorl %r14d, %r14d
testq %r14, %r14
je 0x3fa3
movq %r14, %rdi
callq 0x5ca0
cmpl $0x2, %eax
jne 0x3fab
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x5ca0
cmpl $0x1, %eax
movl $0x2, %esi
sbbl $0x0, %esi
movss 0x8(%r14), %xmm0
movss 0xc(%r14), %xmm1
movq %rbx, %rdi
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x38ae
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::CleanEntities()
void Game::CleanEntities()
	{
		auto iter = std::find_if(m_entities.begin(), m_entities.end(),
			[&](Asteroids::Entity* actor) { return actor->IsColliding() || actor->IsDisappearing(); });
		if (iter != m_entities.end())
		{
			DestroyEntity(*iter);
		}
	}

// Assembly:
leaq 0x90(%rdi), %rcx
movq 0x90(%rdi), %rax
cmpq %rcx, %rax
je 0x4004
movq 0x10(%rax), %rdx
movl 0x1c(%rdx), %edx
decl %edx
cmpl $0x2, %edx
jb 0x4004
movq (%rax), %rax
jmp 0x3fec
cmpq %rcx, %rax
je 0x4012
movq 0x10(%rax), %rsi
jmp 0x4014
retq
nop
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::DestroyEntity(Asteroids::Entity*)
void Game::DestroyEntity(Asteroids::Entity* entity)
	{		
		// Retrieve actor from m_actors list
		//
		auto actorsResult = std::find(m_entities.begin(), m_entities.end(), entity);

		// Retrieve actor from m_asteroids list
		//
		auto asteroidsResult = std::find(m_asteroids.begin(), m_asteroids.end(), entity);

		// Retrieve actor from m_bullets list
		//
		auto bulletsResult = std::find(m_bullets.begin(), m_bullets.end(), entity);

		// Removing the allocated pointer
		//
		delete entity;

		if (m_player == entity)
		{
			//return;
			m_player = nullptr;
		}


		// Deleting actor iterator from lists
		//
		if (m_entities.size() > 0 && actorsResult != m_entities.end())
		{
			m_entities.erase(actorsResult);
		}

		if (m_asteroids.size() > 0 && asteroidsResult != m_asteroids.end())
		{
			m_asteroids.erase(asteroidsResult);
		}

		if (m_bullets.size() > 0 && bulletsResult != m_bullets.end())
		{
			m_bullets.erase(bulletsResult);
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r13
leaq 0x90(%rdi), %rdx
movq 0x90(%rdi), %r14
cmpq %rdx, %r14
je 0x4043
cmpq %r13, 0x10(%r14)
je 0x4043
movq (%r14), %r14
jmp 0x4033
leaq 0x60(%rdi), %rbx
movq 0x60(%rdi), %r15
cmpq %rbx, %r15
je 0x405b
cmpq %r13, 0x10(%r15)
je 0x405b
movq (%r15), %r15
jmp 0x404b
leaq 0x78(%rdi), %rbp
movq 0x78(%rdi), %r12
cmpq %rbp, %r12
je 0x4075
cmpq %r13, 0x10(%r12)
je 0x4075
movq (%r12), %r12
jmp 0x4063
testq %r13, %r13
movq %rdi, 0x8(%rsp)
je 0x409b
movl $0x28, %esi
movq %r13, %rdi
movq %rdx, 0x10(%rsp)
callq 0x30a0
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rdi
cmpq %r13, 0x58(%rdi)
jne 0x40a9
movq $0x0, 0x58(%rdi)
movq 0xa0(%rdi), %rax
testq %rax, %rax
sete %cl
cmpq %rdx, %r14
sete %dl
orb %cl, %dl
jne 0x40e4
decq %rax
movq %rax, 0xa0(%rdi)
movq %r14, %rdi
callq 0x32b0
movl $0x18, %esi
movq %r14, %rdi
callq 0x30a0
movq 0x8(%rsp), %rdi
movq 0x70(%rdi), %rax
testq %rax, %rax
sete %cl
cmpq %rbx, %r15
sete %dl
orb %cl, %dl
jne 0x4119
decq %rax
movq %rax, 0x70(%rdi)
movq %r15, %rdi
callq 0x32b0
movl $0x18, %esi
movq %r15, %rdi
callq 0x30a0
movq 0x8(%rsp), %rdi
movq 0x88(%rdi), %rax
testq %rax, %rax
sete %cl
cmpq %rbp, %r12
sete %dl
orb %cl, %dl
jne 0x415d
decq %rax
movq %rax, 0x88(%rdi)
movq %r12, %rdi
callq 0x32b0
movl $0x18, %esi
movq %r12, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30a0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::CheckCollision()
void Game::CheckCollision()
	{
		for (std::list< Asteroids::Asteroid* >::iterator asteroid = m_asteroids.begin(); asteroid != m_asteroids.end(); ++asteroid)
		{
			if ((*asteroid)->CouldCollide() && m_player->CouldCollide())
			{
				if (m_player->DetectCollision((*asteroid)))
				{
					CreateDebris((*asteroid));
				}

				for (std::list< Asteroids::Bullet* >::iterator bullet = m_bullets.begin(); bullet != m_bullets.end(); ++bullet)
				{
					if ((*bullet)->CouldCollide() && (*asteroid)->CouldCollide())
					{
						if ((*asteroid)->DetectCollision((*bullet)))
						{
							UpdateScore(10);
							CreateDebris((*asteroid));
						}
					}
				}
			}
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x60(%rdi), %r14
movq 0x60(%rdi), %r15
cmpq %r14, %r15
je 0x4263
movq %rdi, %rbx
leaq 0x78(%rdi), %r12
movq 0x10(%r15), %rsi
cmpl $0x0, 0x1c(%rsi)
jne 0x41ff
movq 0x58(%rbx), %rdi
cmpl $0x0, 0x1c(%rdi)
je 0x4209
movq (%r15), %r15
cmpq %r14, %r15
jne 0x41eb
jmp 0x4263
callq 0x4516
testb %al, %al
je 0x421e
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x3f62
movq (%r12), %r13
cmpq %r12, %r13
je 0x41ff
movq 0x10(%r13), %rsi
cmpl $0x0, 0x1c(%rsi)
jne 0x425d
movq 0x10(%r15), %rdi
cmpl $0x0, 0x1c(%rdi)
jne 0x425d
callq 0x4516
testb %al, %al
je 0x425d
movq %rbx, %rdi
movl $0xa, %esi
callq 0x416c
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x3f62
movq (%r13), %r13
jmp 0x4222
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::OnKeyUp(SDL_KeyboardEvent)
void Game::OnKeyUp(SDL_KeyboardEvent keyBoardEvent)
	{
		switch (keyBoardEvent.keysym.scancode)
		{
		case SDL_SCANCODE_W:
			up = false;
			break;
		case SDL_SCANCODE_A:
			left = false;
			break;
		case SDL_SCANCODE_D:
			right = false;
			break;
		case SDL_SCANCODE_R:
			RespawnPlayer();
			break;
		case SDL_SCANCODE_TAB:
			if (m_player)
			{
				m_player->ChangeShip();
			}
			break;
		case SDL_SCANCODE_SPACE:
			//
			if (m_player)
			{
				CreateBullet();
			}
			break;
		case SDL_SCANCODE_ESCAPE:
			OnExit();
			break;
		default:
			//DO NOTHING
			break;
		}
	}

// Assembly:
movl 0x18(%rsp), %eax
cmpl $0x19, %eax
jle 0x4325
cmpl $0x2a, %eax
jg 0x4339
cmpl $0x1a, %eax
je 0x4357
cmpl $0x29, %eax
jne 0x4338
movq (%rdi), %rax
jmpq *0xa8(%rax)
cmpl $0x4, %eax
je 0x434f
cmpl $0x7, %eax
je 0x436d
cmpl $0x15, %eax
je 0x426e
retq
cmpl $0x2b, %eax
je 0x435f
cmpl $0x2c, %eax
jne 0x4338
cmpq $0x0, 0x58(%rdi)
je 0x4338
jmp 0x3efc
movb $0x0, 0x4e90(%rip)      # 0x91e6
retq
movb $0x0, 0x4e87(%rip)      # 0x91e5
retq
movq 0x58(%rdi), %rdi
testq %rdi, %rdi
je 0x4338
jmp 0x45cc
movb $0x0, 0x4e73(%rip)      # 0x91e7
retq
nop
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Entity.cpp
// Function: Asteroids::Entity::Update(float, int, int)
void Entity::Update(float deltaTime, int worldWidth, int worldHeight)
	{
		m_position.x += m_velocity.x * static_cast<float>(deltaTime);
		m_position.y += m_velocity.y * static_cast<float>(deltaTime);

		float halfWidth = (worldWidth / 2.0f);
		float halfHeight = (worldHeight / 2.0f);

		float worldMinX = -halfWidth;
		float worldMaxX =  halfWidth;

		float worldMinY = -halfHeight;
		float worldMaxY =  halfHeight;

		m_position.x = wrap(m_position.x, worldMinX, worldMaxX);
		m_position.y = wrap(m_position.y, worldMinY, worldMaxY);
	}

// Assembly:
movss 0x10(%rdi), %xmm2
mulss %xmm0, %xmm2
addss 0x8(%rdi), %xmm2
movss %xmm2, 0x8(%rdi)
mulss 0x14(%rdi), %xmm0
addss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
cvtsi2ss %esi, %xmm4
movss 0x1b7c(%rip), %xmm3     # 0x6020
cvtsi2ss %edx, %xmm1
mulss %xmm3, %xmm4
mulss %xmm3, %xmm1
movaps 0x1b59(%rip), %xmm3     # 0x6010
movaps %xmm4, %xmm5
xorps %xmm3, %xmm5
xorps %xmm1, %xmm3
ucomiss %xmm2, %xmm5
jbe 0x44d2
subss %xmm2, %xmm5
subss %xmm5, %xmm4
movaps %xmm4, %xmm2
jmp 0x44df
ucomiss %xmm4, %xmm2
jbe 0x44df
subss %xmm4, %xmm2
subss %xmm4, %xmm2
movss %xmm2, 0x8(%rdi)
ucomiss %xmm0, %xmm3
jbe 0x44f6
subss %xmm0, %xmm3
subss %xmm3, %xmm1
movaps %xmm1, %xmm0
jmp 0x4503
ucomiss %xmm1, %xmm0
jbe 0x4503
subss %xmm1, %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0xc(%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Player.cpp
// Function: Asteroids::Player::Player()
Player::Player()
		: m_angle(0.0f)
		, m_rotation(250)
		, m_currentShip(-1)
	{
		m_mass = 0.5f;
		m_radius = 10.0f;

		// Set model render vertices (default ship)
		//
		ChangeShip();
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x444c
leaq 0x4688(%rip), %rax      # 0x8bf8
movq %rax, (%rbx)
leaq 0x28(%rbx), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x34(%rbx)
movl $0x437a0000, 0x44(%rbx) # imm = 0x437A0000
movl $0xffffffff, 0x4c(%rbx) # imm = 0xFFFFFFFF
movl $0x3f000000, 0x18(%rbx) # imm = 0x3F000000
movl $0x41200000, 0x20(%rbx) # imm = 0x41200000
movq %rbx, %rdi
callq 0x45cc
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%r15), %rdi
testq %rdi, %rdi
je 0x45c3
movq 0x38(%rbx), %rsi
subq %rdi, %rsi
callq 0x30a0
movq %r14, %rdi
callq 0x3230
nop
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Player.cpp
// Function: Asteroids::Player::Update(float, int, int)
void Player::Update(float deltaTime, int worldWidth, int worldHeight)
	{
		float speed = 
			fabs(sqrtf(m_velocity.x * m_velocity.x + m_velocity.y * m_velocity.y));

		if (speed > MAX_VELOCITY)
		{
			m_velocity.x = (m_velocity.x / speed) * MAX_VELOCITY;
			m_velocity.y = (m_velocity.y / speed) * MAX_VELOCITY;
		}

		m_currentSpeed = speed;

		ApplyDrag();

		Entity::Update(deltaTime, worldWidth, worldHeight);
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movl %esi, %ebp
movaps %xmm0, %xmm4
movq %rdi, %r14
movss 0x10(%rdi), %xmm0
movss 0x14(%rdi), %xmm1
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x5284
sqrtss %xmm0, %xmm0
jmp 0x5295
movss %xmm4, 0xc(%rsp)
callq 0x32f0
movss 0xc(%rsp), %xmm4
andps 0xf04(%rip), %xmm0      # 0x61a0
ucomiss 0xef5(%rip), %xmm0      # 0x6198
jbe 0x52d5
movss 0x10(%r14), %xmm1
movss 0x14(%r14), %xmm2
divss %xmm0, %xmm1
movss 0xedb(%rip), %xmm3      # 0x6198
mulss %xmm3, %xmm1
movss %xmm1, 0x10(%r14)
divss %xmm0, %xmm2
mulss %xmm3, %xmm2
movss %xmm2, 0x14(%r14)
movss %xmm0, 0x48(%r14)
movss 0xea5(%rip), %xmm0      # 0x6188
movss 0x10(%r14), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, 0x10(%r14)
mulss 0x14(%r14), %xmm0
movss %xmm0, 0x14(%r14)
movq %r14, %rdi
movaps %xmm4, %xmm0
movl %ebp, %esi
movl %ebx, %edx
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4476
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Player.cpp
// Function: Asteroids::Player::Render()
void Player::Render()
	{
		glLoadIdentity();
		glTranslatef(m_position.x, m_position.y, 0.0f);
		glRotatef(m_angle, 0.0f, 0.0f, 1.0f);

		glBegin(GL_LINE_LOOP);
		
		std::vector<Engine::Vector2>::iterator it = m_points.begin();
		for ( ;it != m_points.end(); ++it)
		{
			glVertex2f((*it).x, (*it).y);
		}
		
		glEnd();
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x30e0
movss 0x8(%rbx), %xmm0
movss 0xc(%rbx), %xmm1
xorps %xmm2, %xmm2
callq 0x3120
movss 0x40(%rbx), %xmm0
movss 0xcff(%rip), %xmm3      # 0x6040
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x3280
movl $0x2, %edi
callq 0x3310
movq 0x28(%rbx), %r14
cmpq 0x30(%rbx), %r14
je 0x5376
movss (%r14), %xmm0
movss 0x4(%r14), %xmm1
callq 0x31c0
addq $0x8, %r14
jmp 0x535a
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x32a0
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Player.cpp
// Function: Asteroids::Player::Shoot()
Asteroids::Bullet* Player::Shoot()
	{
		float shootingAngle = m_angle + ANGLE_OFFSET;
		float bulletX = m_points[1].x * cosf(shootingAngle * ( PI / 180 ));
		float bulletY = m_points[1].y * sinf(shootingAngle * ( PI / 180 ));

		float vx = (m_currentSpeed + BULLET_SPEED) * cosf(shootingAngle * (PI / 180));
		float vy = (m_currentSpeed + BULLET_SPEED) * sinf(shootingAngle * (PI / 180));

		Bullet* bullet = new Bullet();

		bullet->Teleport(m_position.x + bulletX, m_position.y + bulletY);
		bullet->ApplyImpulse(Engine::Vector2(vx, vy));

		return bullet;
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movss 0x40(%rdi), %xmm1
addss 0xdf3(%rip), %xmm1      # 0x618c
movq 0x28(%rdi), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
mulss 0xde0(%rip), %xmm1      # 0x6190
movss %xmm1, (%rsp)
movaps %xmm1, %xmm0
callq 0x3250
movss %xmm0, 0x14(%rsp)
movq 0x28(%rbx), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movss (%rsp), %xmm0
callq 0x3040
movss %xmm0, 0x10(%rsp)
movss 0x48(%rbx), %xmm0
movss %xmm0, 0x8(%rsp)
movss (%rsp), %xmm0
callq 0x3250
movss %xmm0, 0xc(%rsp)
movss 0x48(%rbx), %xmm0
movss %xmm0, 0x4(%rsp)
movss (%rsp), %xmm0
callq 0x3040
movss %xmm0, (%rsp)
movl $0x30, %edi
callq 0x30c0
movq %rax, %r14
movq %rax, %rdi
callq 0x59c8
movss 0xd68(%rip), %xmm0      # 0x619c
movss 0x4(%rsp), %xmm1
addss %xmm0, %xmm1
mulss (%rsp), %xmm1
movss %xmm1, 0x4(%rsp)
movss 0x8(%rsp), %xmm1
addss %xmm0, %xmm1
mulss 0xc(%rsp), %xmm1
movss %xmm1, 0x8(%rsp)
movss 0x18(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
movss 0x1c(%rsp), %xmm0
mulss 0x14(%rsp), %xmm0
addss 0x8(%rbx), %xmm0
addss 0xc(%rbx), %xmm1
movq %r14, %rdi
callq 0x450a
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movss 0x8(%rsp), %xmm0
movss 0x4(%rsp), %xmm1
callq 0x584c
movsd (%rbx), %xmm0
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movl $0x30, %esi
movq %r14, %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x3230
nop
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/SDLEvent.cpp
// Function: Engine::SDLEvent::OnEvent(SDL_Event*)
void SDLEvent::OnEvent(SDL_Event* event)
	{
		switch (event->type)
		{
		case SDL_WINDOWEVENT:
			HandleWindowEvents(event);
			break;
		case SDL_KEYDOWN:
			OnKeyDown(event->key);
			break;
		case SDL_KEYUP:
			OnKeyUp(event->key);
			break;
		case SDL_MOUSEMOTION:
			OnMouseMove(event->motion.x,
				event->motion.y,
				event->motion.xrel,
				event->motion.yrel,
				(event->motion.state & SDL_BUTTON(SDL_BUTTON_LEFT)) != 0,
				(event->motion.state & SDL_BUTTON(SDL_BUTTON_RIGHT)) != 0,
				(event->motion.state & SDL_BUTTON(SDL_BUTTON_MIDDLE)) != 0);
			break;
		case SDL_MOUSEBUTTONDOWN:
			HandleMouseButtonDownEvents(event);
			break;
		case SDL_MOUSEBUTTONUP:
			HandleMouseButtonUpEvents(event);
			break;
		case SDL_QUIT:
			OnExit();
			break;
		case SDL_SYSWMEVENT:
			//Ignore
			break;
		default:
			OnUser(event->user.type, event->user.code, event->user.data1, event->user.data2);
			break;
		}
	}

// Assembly:
subq $0x28, %rsp
movl (%rsi), %eax
cmpl $0x300, %eax            # imm = 0x300
jg 0x5693
cmpl $0x200, %eax            # imm = 0x200
jg 0x56eb
cmpl $0x100, %eax            # imm = 0x100
je 0x5728
cmpl $0x200, %eax            # imm = 0x200
jne 0x5759
addq $0x28, %rsp
jmp 0x5778
cmpl $0x400, %eax            # imm = 0x400
jg 0x5711
cmpl $0x301, %eax            # imm = 0x301
je 0x5735
cmpl $0x400, %eax            # imm = 0x400
jne 0x5759
movl 0x10(%rsi), %r10d
movl 0x14(%rsi), %eax
movl 0x18(%rsi), %edx
movl 0x1c(%rsi), %ecx
movl 0x20(%rsi), %r8d
movl %r10d, %r9d
andl $0x1, %r9d
movl %r10d, %esi
andl $0x4, %esi
shrl $0x2, %esi
andl $0x2, %r10d
shrl %r10d
movq (%rdi), %r11
movl %r10d, 0x8(%rsp)
movl %esi, (%rsp)
movl %eax, %esi
callq *0x48(%r11)
jmp 0x574b
cmpl $0x201, %eax            # imm = 0x201
je 0x574b
cmpl $0x300, %eax            # imm = 0x300
jne 0x5759
movq (%rdi), %rax
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq *0x28(%rax)
jmp 0x574b
cmpl $0x401, %eax            # imm = 0x401
je 0x5750
cmpl $0x402, %eax            # imm = 0x402
jne 0x5759
addq $0x28, %rsp
jmp 0x5810
movq (%rdi), %rax
addq $0x28, %rsp
jmpq *0xa8(%rax)
movq (%rdi), %rax
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq *0x30(%rax)
addq $0x28, %rsp
retq
addq $0x28, %rsp
jmp 0x57e6
movl 0xc(%rsi), %edx
movq 0x10(%rsi), %rcx
movq 0x18(%rsi), %r8
movq (%rdi), %rsi
movq 0xb0(%rsi), %r9
movzbl %al, %esi
addq $0x28, %rsp
jmpq *%r9
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/Bullet.cpp
// Function: Asteroids::Bullet::Render()
void Bullet::Render()
	{
		glLoadIdentity();

		glPointSize(2.0f);

		glEnable(GL_POINT_SMOOTH);

		glBegin(GL_POINTS);

			glVertex2f(m_position.x, m_position.y);

		glEnd();
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x30e0
movss 0x7fb(%rip), %xmm0      # 0x6258
callq 0x3150
movl $0xb10, %edi            # imm = 0xB10
callq 0x31f0
xorl %edi, %edi
callq 0x3310
movss 0x8(%rbx), %xmm0
movss 0xc(%rbx), %xmm1
callq 0x31c0
popq %rbx
jmp 0x32a0
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x444c
leaq 0x32ab(%rip), %rax      # 0x8d50
movq %rax, (%rbx)
leaq 0x28(%rbx), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movq $0x0, 0x38(%rbx)
movl %ebp, 0x40(%rbx)
movabsq $0x42f0000000000000, %rax # imm = 0x42F0000000000000
movq %rax, 0x48(%rbx)
incl %ebp
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movl %ebp, 0x44(%rbx)
movss 0x790(%rip), %xmm1      # 0x6270
divss %xmm0, %xmm1
movss 0x788(%rip), %xmm2      # 0x6274
divss %xmm0, %xmm2
movss %xmm2, 0xc(%rsp)
movss %xmm1, (%rsp)
subss %xmm1, %xmm2
movss %xmm2, 0x10(%rsp)
xorl %r12d, %r12d
leaq 0x18(%rsp), %r15
xorps %xmm0, %xmm0
cvtsi2ss %r12, %xmm0
mulss 0x75b(%rip), %xmm0      # 0x6278
addss %xmm0, %xmm0
mulss 0x753(%rip), %xmm0      # 0x627c
movss %xmm0, 0x8(%rsp)
callq 0x32e0
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x4e5(%rip), %xmm0      # 0x6028
mulss 0x10(%rsp), %xmm0
addss (%rsp), %xmm0
movss %xmm0, 0x4(%rsp)
movss 0x8(%rsp), %xmm0
callq 0x3040
mulss 0x4(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x8(%rsp), %xmm0
callq 0x3250
movss 0x4(%rsp), %xmm1
mulss %xmm0, %xmm1
movq %r15, %rdi
movss 0x14(%rsp), %xmm0
callq 0x584c
movq %r14, %rdi
movq %r15, %rsi
callq 0x54d2
incq %r12
cmpq $0x10, %r12
jne 0x5b0d
movss (%rsp), %xmm0
addss 0xc(%rsp), %xmm0
mulss 0x467(%rip), %xmm0      # 0x6020
movss %xmm0, 0x20(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x5be2
movq 0x38(%rbx), %rsi
subq %rdi, %rsi
callq 0x30a0
movq %r15, %rdi
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/TimeManager.cpp
// Function: Engine::TimeManager::GetElapsedTimeInMicroseconds()
double TimeManager::GetElapsedTimeInMicroseconds()
	{
#ifdef WIN32
		if (!m_stopped)
		{
			::QueryPerformanceCounter(&m_endCount);
		}

		m_startTimeInMicroSeconds = m_startCount.QuadPart * (1000000.0 / m_frequency.QuadPart);
		m_endTimeInMicroSeconds = m_endCount.QuadPart * (1000000.0 / m_frequency.QuadPart);
#else
		if (!m_stopped)
		{
			gettimeofday(&m_endCount, NULL);
		}

		m_startTimeInMicroSeconds = (m_startCount.tv_sec * 1000000.0) + m_startCount.tv_usec;
		m_endTimeInMicroSeconds = (m_endCount.tv_sec * 1000000.0) + m_endCount.tv_usec;
#endif

		return m_endTimeInMicroSeconds - m_startTimeInMicroSeconds;
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x10(%rdi)
jne 0x5d61
leaq 0x28(%rbx), %rdi
xorl %esi, %esi
callq 0x31b0
cvtsi2sdq 0x18(%rbx), %xmm1
cvtsi2sdq 0x20(%rbx), %xmm0
movsd 0x523(%rip), %xmm2      # 0x6298
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
xorps %xmm0, %xmm0
cvtsi2sdq 0x28(%rbx), %xmm0
cvtsi2sdq 0x30(%rbx), %xmm3
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
movsd %xmm0, 0x8(%rbx)
subsd %xmm1, %xmm0
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/rroa[P]PUCMM_2D_Asteroids/Asteroids/main.cpp
// Function: main
int main(int argc, char* argv[])
{
#if _MSC_VER && _DEBUG
	// https://msdn.microsoft.com/en-us/library/x98tx3cf.aspx
	// This will help you detect leaks when using Visual C++
	// Uncomment this line to start getting reports!
	assert(_CrtCheckMemory());
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif

	// Create Game Object
	//
	Engine::Game* game = new Engine::Game("Asteroids!", WIDTH, HEIGHT);

	// Initialize game
	//
	if(!game->OnInit())
	{
		std::cout << "Game Init error!\n";
		return -1;
	}

	// Execute game
	//
	game->OnExecute();

	// Delete game object
	//
	delete game;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl $0xb0, %edi
callq 0x30c0
movq %rax, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4b6(%rip), %rsi       # 0x62b0
leaq 0x4b9(%rip), %rdx       # 0x62ba
movq %rsp, %rdi
callq 0x5eb0
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x470, %edx            # imm = 0x470
movl $0x280, %ecx            # imm = 0x280
callq 0x34fc
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5e34
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x30a0
movq %rbx, %rdi
callq 0x3c7a
testb %al, %al
je 0x5e55
movq %rbx, %rdi
callq 0x37fa
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %eax, %eax
jmp 0x5e72
movq 0x317c(%rip), %rdi      # 0x8fd8
leaq 0x458(%rip), %rsi       # 0x62bb
movl $0x11, %edx
callq 0x32d0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5e9a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x30a0
jmp 0x5e9a
movq %rax, %r14
movl $0xb0, %esi
movq %rbx, %rdi
callq 0x30a0
movq %r14, %rdi
callq 0x3230
nop
// File: /workspace/github_c_makefile_star2_O1/janmojzis[P]mcencrypt/_randreplace.c
// Function: main
int main(int argc, char **argv) {

    unsigned long long a;
    unsigned long long b;

    limits();

    input = memreadall(&inputlen, 0);
    if (!input) die_temp(NAME, "read message failed");

    randombytes(&a, sizeof a);
    randombytes(&b, sizeof b);

    input[a % inputlen] += 1 + (b % 255);

    if (writeall(1, input, inputlen) == -1) die_temp(NAME, "write message failed");
    if (fsyncfd(1) == -1) die_temp(NAME, "write message failed");

    die(0);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
callq 0x5600
leaq 0x8e6f(%rip), %rdi      # 0xa0c0
xorl %esi, %esi
callq 0x5640
movq %rax, 0x8e59(%rip)      # 0xa0b8
testq %rax, %rax
jne 0x1277
leaq 0x5d99(%rip), %rdi      # 0x7004
leaq 0x5d9f(%rip), %rsi      # 0x7011
callq 0x4760
leaq 0x10(%rsp), %rbx
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6350
leaq 0x8(%rsp), %r14
movl $0x8, %esi
movq %r14, %rdi
callq 0x6350
movq (%r14), %rcx
movabsq $-0x7f7f7f7f7f7f7f7f, %rdx # imm = 0x8080808080808081
movq %rcx, %rax
mulq %rdx
movq %rdx, %rdi
shrl $0x7, %edi
movq 0x8dfd(%rip), %rsi      # 0xa0b8
movq (%rbx), %rax
xorl %edx, %edx
divq 0x8df9(%rip)            # 0xa0c0
addl %edi, %ecx
addb (%rsi,%rdx), %cl
incb %cl
movb %cl, (%rsi,%rdx)
movq 0x8de8(%rip), %rdx      # 0xa0c0
movl $0x1, %edi
callq 0x69fc
cmpl $-0x1, %eax
jne 0x12fa
leaq 0x5d16(%rip), %rdi      # 0x7004
leaq 0x5d30(%rip), %rsi      # 0x7025
callq 0x4760
movl $0x1, %edi
callq 0x4d40
cmpl $-0x1, %eax
jne 0x131c
leaq 0x5cf4(%rip), %rdi      # 0x7004
leaq 0x5d0e(%rip), %rsi      # 0x7025
callq 0x4760
xorl %edi, %edi
callq 0x4814
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/motet-a[P]libforks/tests/stop_server_only.c
// Function: main
int main() {
  libforks_ServerConn conn;
  check(libforks_start(&conn) == libforks_OK);

  int socket_fd;
  int child_pid;

  check(libforks_fork(
    conn,
    &child_pid, // pid_ptr
    &socket_fd, // socket_fd_ptr
    NULL, // exit_fd_ptr
    child_main
  ) == libforks_OK);

  check(libforks_stop_server_only(conn) == libforks_OK);

  // The child process is now daemonized and still running.
  // Try to communicate with it.

  check(write(socket_fd, "a", 1) == 1);
  char c;
  check(read(socket_fd, &c, 1) == 1);
  check(c == 'b');

  while (true) {
    if (kill(child_pid, 0) == -1) {
      check(errno == ESRCH);
      break;
    }
  }

  return 0;
}

// Assembly:
subq $0x18, %rsp
leaq 0x10(%rsp), %rdi
callq 0x184f
testl %eax, %eax
jne 0x13ad
movq 0x10(%rsp), %rdi
leaq 0x121(%rip), %r8        # 0x144f
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x22a3
testl %eax, %eax
jne 0x13be
movq 0x10(%rsp), %rdi
callq 0x23c3
testl %eax, %eax
jne 0x13cf
movl 0x8(%rsp), %edi
leaq 0x1d64(%rip), %rsi      # 0x30c0
movl $0x1, %edx
callq 0x1080
cmpq $0x1, %rax
jne 0x13e0
movl 0x8(%rsp), %edi
leaq 0x7(%rsp), %rsi
movl $0x1, %edx
callq 0x10f0
cmpq $0x1, %rax
jne 0x13f1
cmpb $0x62, 0x7(%rsp)
jne 0x1402
movl 0xc(%rsp), %edi
xorl %esi, %esi
callq 0x1150
cmpl $-0x1, %eax
jne 0x138c
callq 0x1050
cmpl $0x3, (%rax)
jne 0x1413
xorl %eax, %eax
addq $0x18, %rsp
retq
leaq 0x1c50(%rip), %rdi      # 0x3004
movl $0xd, %esi
callq 0x1424
leaq 0x1c7d(%rip), %rdi      # 0x3042
movl $0x18, %esi
callq 0x1424
leaq 0x1cbb(%rip), %rdi      # 0x3091
movl $0x1a, %esi
callq 0x1424
leaq 0x1cdb(%rip), %rdi      # 0x30c2
movl $0x1f, %esi
callq 0x1424
leaq 0x1ce8(%rip), %rdi      # 0x30e0
movl $0x21, %esi
callq 0x1424
leaq 0x1cf3(%rip), %rdi      # 0x30fc
movl $0x22, %esi
callq 0x1424
leaq 0x1ceb(%rip), %rdi      # 0x3105
movl $0x26, %esi
callq 0x1424
// File: /workspace/github_c_makefile_star2_O1/motet-a[P]libforks/tests/stop_server_only.c
// Function: child_main
static void child_main(libforks_ServerConn conn, int socket_fd) {
  check(libforks_free_conn(conn) == libforks_OK);
  char c;
  check(read(socket_fd, &c, 1) == 1);
  check(c == 'a');
  check(write(socket_fd, "b", 1) == 1);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
callq 0x248b
testl %eax, %eax
jne 0x149c
leaq 0xf(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %edi
callq 0x10f0
cmpq $0x1, %rax
jne 0x14ad
cmpb $0x61, 0xf(%rsp)
jne 0x14be
leaq 0x1cdd(%rip), %rsi      # 0x3161
movl $0x1, %edx
movl %ebx, %edi
callq 0x1080
cmpq $0x1, %rax
jne 0x14cf
addq $0x10, %rsp
popq %rbx
retq
leaq 0x1c8d(%rip), %rdi      # 0x3130
movl $0x4, %esi
callq 0x1424
leaq 0x1c2c(%rip), %rdi      # 0x30e0
movl $0x6, %esi
callq 0x1424
leaq 0x1c93(%rip), %rdi      # 0x3158
movl $0x7, %esi
callq 0x1424
leaq 0x1c8d(%rip), %rdi      # 0x3163
movl $0x8, %esi
callq 0x1424
// File: /workspace/github_c_makefile_star2_O1/ninewise[P]st/st.c
// Function: newterm
void
newterm(const Arg* a)
{
	switch (fork()) {
	case -1:
		die("fork failed: %s\n", strerror(errno));
		break;
	case 0:
		chdir(getcwd_by_pid(pid));
		execlp("st", "./st", NULL);
		break;
	}
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
callq 0x57f0
testl %eax, %eax
je 0x7546
cmpl $-0x1, %eax
je 0x7593
addq $0x20, %rsp
popq %rbx
retq
movl 0xe318(%rip), %ecx      # 0x15864
leaq 0x7256(%rip), %rdx      # 0xe7a9
movq %rsp, %rbx
movl $0x20, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x50c0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x53d0
movq %rax, %rdi
callq 0x5060
leaq 0x70ca(%rip), %rdi      # 0xe648
leaq 0x70c1(%rip), %rsi      # 0xe646
xorl %edx, %edx
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
jmp 0x5220
callq 0x55a0
movl (%rax), %edi
callq 0x5460
leaq 0x7034(%rip), %rdi      # 0xe5da
movq %rax, %rsi
xorl %eax, %eax
callq 0x5e96
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/util.c
// Function: log_msg
void log_msg(const char *fmt, ...) {
	print_time();
	va_list args;
	va_start(args, fmt);
	vfprintf(stderr, fmt, args);
	va_end(args);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x1271
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
callq 0x190c
movq %rsp, %rdx
movq %r14, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x4d5b(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x1160
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_compute_crc1
uint32_t pkt_compute_crc1(const pkt_t *pkt) {
	// Copy the packet and set the TR of that copy
	pkt_t p = *pkt;
	p.tr = 0;
	return crc32(0, (unsigned char *) &p, HEADER_SIZE - sizeof (pkt->crc1));
}

// Assembly:
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, %rsi
movq %rsp, %rbx
movl $0x210, %edx            # imm = 0x210
movq %rbx, %rdi
callq 0x10f0
andb $-0x21, (%rbx)
xorl %edi, %edi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x1070
addq $0x210, %rsp            # imm = 0x210
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_get_total_size
size_t pkt_get_total_size(const pkt_t *pkt) {
	size_t payload_size = pkt_get_length(pkt) * sizeof (*pkt->payload);
	size_t total_size = HEADER_SIZE + payload_size;
	if (payload_size > 0) {
		total_size += sizeof (pkt->crc2);
	}
	return total_size;
}

// Assembly:
testb $0x20, (%rdi)
jne 0x1503
movzwl 0x2(%rdi), %eax
rolw $0x8, %ax
jmp 0x1505
xorl %eax, %eax
movzwl %ax, %eax
leaq 0x10(%rax), %rcx
testw %ax, %ax
movl $0xc, %eax
cmovneq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_encode
pkt_status_code pkt_encode(const pkt_t *pkt, char *buf, size_t *len) {
	pkt_t p = *pkt;

	if (pkt_get_type(&p) == 0) {
		return E_TYPE;
	} else if (pkt_get_total_size(&p) > *len) {
		*len = 0;
		return E_NOMEM;
	}

	size_t payload_size = pkt_get_length(&p) * sizeof (*p.payload);
	pkt_set_crc1(&p, pkt_compute_crc1(&p));
	pkt_set_crc2(&p, pkt_compute_crc2(&p, payload_size));

	size_t written = 0;
	memcpy(buf + written, &p, HEADER_SIZE + payload_size);
	written += HEADER_SIZE + payload_size;

	if (payload_size > 0) {
		memcpy(buf + written, &p.crc2, sizeof (p.crc2));
		written += sizeof (p.crc2);
	}

	*len = written;
	return PKT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x8(%rsp), %r14
movl $0x210, %edx            # imm = 0x210
movq %r14, %rdi
movq %r12, %rsi
callq 0x10f0
movb (%r14), %al
movl $0x1, %r14d
cmpb $0x40, %al
jb 0x178e
movzwl 0xa(%rsp), %ecx
rolw $0x8, %cx
xorl %r14d, %r14d
testb $0x20, %al
cmovnel %r14d, %ecx
movzwl %cx, %ecx
leaq 0x10(%rcx), %rdx
testw %cx, %cx
movl $0xc, %ecx
cmovneq %rdx, %rcx
cmpq (%rbx), %rcx
jbe 0x1702
movl $0x7, %r14d
xorl %r12d, %r12d
jmp 0x178b
leaq 0x14(%rsp), %rcx
movzwl -0xa(%rcx), %ecx
rolw $0x8, %cx
testb $0x20, %al
cmovnel %r14d, %ecx
movzwl %cx, %r13d
leaq 0x218(%rsp), %rbp
movl $0x210, %edx            # imm = 0x210
movq %rbp, %rdi
movq %r12, %rsi
callq 0x10f0
andb $-0x21, (%rbp)
xorl %edi, %edi
movq %rbp, %rsi
movl $0x8, %edx
callq 0x1070
bswapl %eax
leaq 0x14(%rsp), %rsi
movl %eax, -0x4(%rsi)
xorl %edi, %edi
movq %rsi, %r12
movl %r13d, %edx
callq 0x1070
movq %rax, %rbp
bswapl %ebp
movl %ebp, 0x200(%r12)
leaq 0xc(%r13), %r12
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x10f0
testw %r13w, %r13w
je 0x178b
movl %ebp, 0xc(%r15,%r13)
leaq 0x10(%r13), %r12
movq %r12, (%rbx)
movl %r14d, %eax
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_set_length
pkt_status_code pkt_set_length(pkt_t *pkt, const uint16_t length) {
	if (length > MAX_PAYLOAD_SIZE) {
		return E_LENGTH;
	}

	// Maintain the invariant that unused slots are zeroed out
	uint16_t unused = (MAX_PAYLOAD_SIZE - length) * sizeof (*pkt->payload);
	memset(pkt->payload + length, 0, unused);

	pkt->length = htons(length);
	return PKT_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl $0x3, %ebp
cmpl $0x200, %esi            # imm = 0x200
ja 0x188c
movq %rdi, %rbx
movl $0x200, %eax            # imm = 0x200
subl %esi, %eax
movzwl %si, %r14d
addq %r14, %rdi
addq $0xc, %rdi
movzwl %ax, %edx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x10c0
rolw $0x8, %r14w
movw %r14w, 0x2(%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_set_payload
pkt_status_code pkt_set_payload(pkt_t *pkt, const char *data, const uint16_t length) {
	uint16_t actual = length;
	if (data == NULL) {
		actual = 0;
	}

	pkt_status_code code = pkt_set_length(pkt, actual);
	if (code != PKT_OK) {
		return code;
	}

	memcpy(pkt->payload, data, actual);
	return PKT_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
xorl %eax, %eax
testq %rsi, %rsi
cmovel %eax, %edx
movq %rdi, %r14
movl $0x3, %eax
movzwl %dx, %r15d
cmpl $0x200, %edx            # imm = 0x200
ja 0x18e7
movl $0x200, %eax            # imm = 0x200
subl %r15d, %eax
leaq (%r14,%r15), %rdi
addq $0xc, %rdi
movzwl %ax, %edx
xorl %esi, %esi
callq 0x10c0
movl %r15d, %eax
rolw $0x8, %ax
movw %ax, 0x2(%r14)
xorl %eax, %eax
cmpl $0x200, %r15d           # imm = 0x200
ja 0x1904
addq $0xc, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x10f0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/util.c
// Function: print_time
void print_time(void) {
	struct timespec tp;
	if (clock_gettime(CLOCK_MONOTONIC, &tp) == -1) {
		abort();
	}
	double secs = tp.tv_sec + ((double) tp.tv_nsec) / 1000000000;
	fprintf(stderr, "[%7.3f] ", secs);
}

// Assembly:
subq $0x18, %rsp
leaq 0x8(%rsp), %rsi
movl $0x1, %edi
callq 0x1080
cmpl $-0x1, %eax
je 0x1933
leaq 0x8(%rsp), %rdi
callq 0x12c5
addq $0x18, %rsp
retq
callq 0x1050
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/util.c
// Function: exit_msg
void exit_msg(const char *fmt, ...) {
	print_time();
	va_list args;
	va_start(args, fmt);
	vfprintf(stderr, fmt, args);
	va_end(args);
	exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x1999
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
callq 0x190c
movq %rsp, %rdx
movq %r14, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x4633(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x1160
movl $0x1, %edi
callq 0x1190
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/util.c
// Function: pkt_repr
char *pkt_repr(pkt_t *pkt) {
	if (pkt == NULL) {
		return "(nil)";
	}

	char *type;
	switch (pkt_get_type(pkt)) {
		case PTYPE_ACK:  type = "ACK";     break;
		case PTYPE_DATA: type = "DATA";    break;
		case PTYPE_NACK: type = "NACK";    break;
		default:         type = "UNKNOWN";
	}

	int len = sprintf(pkt_fmt_buf, "{Type=%s, TR=%d, Win=%d, Seq=%d, Time=%d, Len=%d}",
		type, pkt_get_tr(pkt), pkt_get_window(pkt), pkt_get_seqnum(pkt),
		pkt_get_timestamp(pkt), pkt_get_length(pkt));
	if (len < 0) {
		abort();
	}

	return pkt_fmt_buf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1a77
movq %rdi, %rbx
callq 0x1667
decl %eax
cmpl $0x2, %eax
ja 0x1a80
movl %eax, %eax
leaq 0x1736(%rip), %rcx      # 0x31a4
movslq (%rcx,%rax,4), %r14
addq %rcx, %r14
jmp 0x1a87
leaq 0x1652(%rip), %rbx      # 0x30d0
jmp 0x1af0
leaq 0x15d3(%rip), %r14      # 0x305a
movq %rbx, %rdi
callq 0x166e
movzbl %al, %ebp
movq %rbx, %rdi
callq 0x1676
movzbl %al, %r15d
movq %rbx, %rdi
callq 0x17d4
movzbl %al, %r12d
movq %rbx, %rdi
callq 0x17d8
movl %eax, %r13d
movq %rbx, %rdi
callq 0x1519
movzwl %ax, %r10d
leaq 0x4668(%rip), %rbx      # 0x6130
leaq 0x1611(%rip), %rsi      # 0x30e0
movq %rbx, %rdi
movq %r14, %rdx
movl %ebp, %ecx
movl %r15d, %r8d
movl %r12d, %r9d
xorl %eax, %eax
pushq %r10
pushq %r13
callq 0x1180
addq $0x10, %rsp
testl %eax, %eax
js 0x1b02
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1050
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/util.c
// Function: parse_args
void parse_args(int argc, char **argv,
                char **hostname, uint16_t *port, char **filename) {
	int c;
	while ((c = getopt(argc, argv, "f:h")) != -1) {
		switch (c) {
		case 'f':
			*filename = optarg;
			break;
		case 'h':
		case '?':
			exit_usage(argv);
			break;
		default:
			abort(); // unreachable
		}
	}

	if (optind + 2 != argc) {
		fprintf(stderr, "%s: wrong number of arguments\n", argv[0]);
		exit_usage(argv);
	}

	*hostname = argv[optind++];
	*port = atoi(argv[optind]);

	if (*port == 0 || *port >> 16) {
		fprintf(stderr, "%s: port must be an integer between 1 and 65535\n", argv[0]);
		exit_usage(argv);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, (%rsp)
movq %rdx, %r15
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x15ea(%rip), %r13      # 0x3112
movq 0x44a9(%rip), %r14      # 0x5fd8
movl %ebp, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1150
cmpl $0x66, %eax
jne 0x1b4a
movq (%r14), %rax
movq %rax, (%r12)
jmp 0x1b2f
cmpl $-0x1, %eax
jne 0x1b91
movq 0x447a(%rip), %rcx      # 0x5fd0
movslq (%rcx), %rax
leal 0x2(%rax), %edx
cmpl %ebp, %edx
jne 0x1ba8
leal 0x1(%rax), %edx
movl %edx, (%rcx)
movq (%rbx,%rax,8), %rcx
movq %rcx, (%r15)
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1170
movq (%rsp), %rcx
movw %ax, (%rcx)
testw %ax, %ax
je 0x1bb0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3f, %eax
je 0x1b9b
cmpl $0x68, %eax
jne 0x1ba3
movq %rbx, %rdi
callq 0x12fa
callq 0x1050
movq %rbx, %rdi
callq 0x1321
movq %rbx, %rdi
callq 0x135f
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/util.c
// Function: real_address
const char *real_address(const char *address, struct sockaddr_in6 *rval) {
	struct addrinfo hint = {0};
	hint.ai_family = AF_INET6;
	hint.ai_socktype = SOCK_DGRAM;
	hint.ai_protocol = IPPROTO_UDP;

	struct addrinfo info;
	struct addrinfo *infoptr = &info;
	int err = getaddrinfo(address, NULL, &hint, &infoptr);
	if (err != 0) {
		return gai_strerror(err);
	}

	struct sockaddr_in6 *addr = (struct sockaddr_in6 *) infoptr->ai_addr;
	*rval = *addr;

	freeaddrinfo(infoptr);
	return NULL;
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
movq %rsi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movabsq $0x20000000a, %rax      # imm = 0x20000000A
movq %rax, 0x4(%rdx)
movl $0x11, 0xc(%rdx)
leaq 0x40(%rsp), %rax
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
xorl %esi, %esi
callq 0x11c0
testl %eax, %eax
je 0x1c09
movl %eax, %edi
callq 0x10a0
jmp 0x1c27
movq 0x8(%rsp), %rdi
movq 0x18(%rdi), %rax
movups (%rax), %xmm0
movups 0xc(%rax), %xmm1
movups %xmm1, 0xc(%rbx)
movups %xmm0, (%rbx)
callq 0x11e0
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/util.c
// Function: create_socket
int create_socket(struct sockaddr_in6 *source_addr, int src_port,
                  struct sockaddr_in6 *dest_addr, int dst_port) {
	int sockfd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
	if (sockfd == -1) {
		log_perror("socket");
		return -1;
	}

	if (source_addr != NULL && src_port > 0) {
		source_addr->sin6_port = htons(src_port);
		if (bind(sockfd, (struct sockaddr *) source_addr, sizeof (*source_addr)) != 0) {
			log_perror("bind");
			return -1;
		}
	}

	if (dest_addr != NULL && dst_port > 0) {
		dest_addr->sin6_port = htons(dst_port);
		if (connect(sockfd, (struct sockaddr *) dest_addr, sizeof (*dest_addr)) != 0) {
			log_perror("connect");
			return -1;
		}
	}

	return sockfd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %r15
movl $0xa, %edi
movl $0x2, %esi
movl $0x11, %edx
callq 0x11f0
cmpl $-0x1, %eax
je 0x1cbc
movl %eax, %ebx
testq %r15, %r15
sete %al
testl %r12d, %r12d
setle %cl
orb %al, %cl
jne 0x1c88
rolw $0x8, %r12w
movw %r12w, 0x2(%r15)
movl %ebx, %edi
movq %r15, %rsi
movl $0x1c, %edx
callq 0x1120
testl %eax, %eax
jne 0x1cc5
testq %r14, %r14
sete %al
testl %ebp, %ebp
setle %cl
orb %al, %cl
jne 0x1cd6
rolw $0x8, %bp
movw %bp, 0x2(%r14)
movl %ebx, %edi
movq %r14, %rsi
movl $0x1c, %edx
callq 0x11a0
testl %eax, %eax
je 0x1cd6
leaq 0x14b8(%rip), %rdi      # 0x3172
jmp 0x1ccc
leaq 0x14a3(%rip), %rdi      # 0x3166
jmp 0x1ccc
leaq 0x14a1(%rip), %rdi      # 0x316d
callq 0x139d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/util.c
// Function: send_packet
int send_packet(int sockfd, pkt_t *pkt) {
	char buf[MAX_PACKET_SIZE];
	size_t len = MAX_PACKET_SIZE;
	if (pkt_encode(pkt, buf, &len) != PKT_OK) {
		exit_msg("Error encoding packet: %d\n");
	}
	return send(sockfd, buf, len, 0);
}

// Assembly:
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rsi, %rax
movl %edi, %ebx
leaq 0x8(%rsp), %rdx
movq $0x210, (%rdx)          # imm = 0x210
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x168a
testl %eax, %eax
jne 0x1d27
movq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rsi
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x1090
addq $0x220, %rsp            # imm = 0x220
popq %rbx
retq
leaq 0x144c(%rip), %rdi      # 0x317a
xorl %eax, %eax
callq 0x1938
// File: /workspace/github_c_makefile_star2_O1/sprt[P]lossless-transport/src/util.c
// Function: get_monotime
uint32_t get_monotime(void) {
	static bool first_call = true; /* whether this is the first call */
	static struct timeval first; /* unnormalized value returned by the first call */
	static struct timeval last; /* unnormalized value returned by the last call */

	struct timespec now_tp;
	if (clock_gettime(CLOCK_MONOTONIC, &now_tp) == -1) {
		exit_perror("clock_gettime");
	}

	/* Convert the timespec to a timeval */
	struct timeval now;
	now.tv_sec = now_tp.tv_sec;
	now.tv_usec = now_tp.tv_nsec / 1000;

	if (first_call) {
		/* Remember the value of the first call to normalize to 0 later */
		first = now;
		first_call = false;
	} else if (timercmp(&now, &last, <) || !timercmp(&now, &last, !=)) {
		/* Increment if not strictly greater than the last time returned */

		struct timeval us;
		us.tv_sec = 0;
		us.tv_usec = 1;

		struct timeval res;
		timeradd(&last, &us, &res);
		now = res;
	}

	/* Save the time we're returning for later calls */
	last = now;

	/* Normalize to start at 0 */
	struct timeval res;
	timersub(&now, &first, &res);
	now = res;

	/* Convert to microseconds */
	return now.tv_sec * 1000000 + now.tv_usec;
}

// Assembly:
subq $0x18, %rsp
leaq 0x8(%rsp), %rsi
movl $0x1, %edi
callq 0x1080
cmpl $-0x1, %eax
je 0x1e1c
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x10(%rsp)
movq 0x8(%rsp), %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
cmpb $0x0, 0x47b6(%rip)      # 0x6530
je 0x1dca
movq 0x47c5(%rip), %rax      # 0x6548
cmpq %rax, %rcx
jne 0x1d8f
cmpq 0x47c1(%rip), %rdx      # 0x6550
jl 0x1d9f
cmpq %rax, %rcx
jne 0x1ddf
cmpq 0x47b3(%rip), %rdx      # 0x6550
jne 0x1ddf
movq 0x47aa(%rip), %rcx      # 0x6550
leaq 0x1(%rcx), %rdx
leaq -0xf423f(%rcx), %rsi
xorl %edi, %edi
cmpq $0xf423f, %rcx          # imm = 0xF423F
setge %dil
cmovgeq %rsi, %rdx
addq %rdi, %rax
movq %rax, %rcx
jmp 0x1ddf
movq %rcx, 0x4767(%rip)      # 0x6538
movq %rdx, 0x4768(%rip)      # 0x6540
movb $0x1, 0x4751(%rip)      # 0x6530
movq %rcx, 0x4762(%rip)      # 0x6548
movq %rdx, 0x4763(%rip)      # 0x6550
subl 0x4745(%rip), %ecx      # 0x6538
subq 0x4746(%rip), %rdx      # 0x6540
leal 0xf4240(%rdx), %eax
movq %rdx, %rsi
sarq $0x3f, %rsi
addl %ecx, %esi
imull $0xf4240, %esi, %ecx    # imm = 0xF4240
testq %rdx, %rdx
cmovnsl %edx, %eax
addl %ecx, %eax
addq $0x18, %rsp
retq
leaq 0x1372(%rip), %rdi      # 0x3195
callq 0x19da