LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::OnRender()
void Game::OnRender()
	{
		glClearColor(0.1f, 0.1f, 0.15f, 1.0f);
		glClear(GL_COLOR_BUFFER_BIT);

		// Render player
		//
		if (m_player)
			m_player->Render();

		for (std::list< Asteroids::Entity* >::iterator it = m_entities.begin(); it != m_entities.end(); ++it)
		{
			if ((*it)->CouldCollide())
				(*it)->Render();
		}

		SDL_GL_SwapWindow(m_mainWindow);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movss 0x2436(%rip), %xmm0     # 0x6038
movss 0x2432(%rip), %xmm2     # 0x603c
movss 0x242e(%rip), %xmm3     # 0x6040
movaps %xmm0, %xmm1
callq 0x30b0
movl $0x4000, %edi           # imm = 0x4000
callq 0x3200
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x3c33
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x90(%rbx), %r14
movq 0x90(%rbx), %r15
cmpq %r14, %r15
je 0x3c5b
movq 0x10(%r15), %rdi
cmpl $0x0, 0x1c(%rdi)
jne 0x3c56
movq (%rdi), %rax
callq *0x10(%rax)
movq (%r15), %r15
jmp 0x3c41
movq 0x40(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3140
nop
// File: /workspace/github_c_makefile_star2_O3/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::OnInit()
bool Game::OnInit()
	{
		// Init the external dependencies
		//
		bool success = SDLInit() && GlewInit();
		if (!success)
		{
			m_state = GameState::INIT_FAILED;
			return false;
		}

		// Setup the viewport
		//
		SetupViewport();

		// Change game state
		//
		m_state = GameState::INIT_SUCCESSFUL;

		return true;
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3ca4
movl $0x1, %ebp
testb %al, %al
je 0x3c98
callq 0x3db2
testb %al, %al
je 0x3c98
movq %rbx, %rdi
callq 0x3e56
movb $0x1, %al
movl $0x2, %ebp
jmp 0x3c9a
xorl %eax, %eax
movl %ebp, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::SDLInit()
bool Game::SDLInit()
	{
		// Initialize SDL's Video subsystem
		//
		if (SDL_Init(SDL_INIT_EVERYTHING) < 0)
		{
			std::cerr << "Failed to init SDL" << std::endl;
			return false;
		}

		SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
		SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);

		Uint32 flags =  SDL_WINDOW_OPENGL     | 
						SDL_WINDOW_SHOWN      | 
						SDL_WINDOW_RESIZABLE;

		m_mainWindow = SDL_CreateWindow(
			m_title.c_str(),
			SDL_WINDOWPOS_CENTERED,
			SDL_WINDOWPOS_CENTERED,
			m_width,
			m_height,
			flags
		);

		if (!m_mainWindow)
		{
			std::cerr << "Failed to create window!" << std::endl;
			SDL_Quit();
			return false;
		}

		m_context = SDL_GL_CreateContext(m_mainWindow);
		SDL_GL_MakeCurrent(m_mainWindow, m_context);

		// Make double buffer interval synced with vertical scanline refresh
		SDL_GL_SetSwapInterval(0);

		return true;
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0xf231, %edi           # imm = 0xF231
callq 0x3370
testl %eax, %eax
js 0x3d23
movl $0x5, %edi
movl $0x1, %esi
callq 0x3310
movl $0x6, %edi
movl $0x18, %esi
callq 0x3310
movq 0x20(%rbx), %rdi
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %r8d
movl $0x2fff0000, %esi       # imm = 0x2FFF0000
movl $0x2fff0000, %edx       # imm = 0x2FFF0000
movl $0x26, %r9d
callq 0x3180
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x3d67
movq %rax, %rdi
callq 0x3260
movq %rax, 0x48(%rbx)
movq 0x40(%rbx), %rdi
movq %rax, %rsi
callq 0x3270
xorl %edi, %edi
callq 0x31d0
movb $0x1, %al
jmp 0x3db0
movq 0x52c6(%rip), %rbx      # 0x8ff0
leaq 0x2360(%rip), %rsi      # 0x6091
movl $0x12, %edx
movq %rbx, %rdi
callq 0x32d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x31e0
movq %rax, %rdi
callq 0x31a0
jmp 0x3dae
movq 0x5282(%rip), %rbx      # 0x8ff0
leaq 0x232f(%rip), %rsi      # 0x60a4
movl $0x18, %edx
movq %rbx, %rdi
callq 0x32d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x31e0
movq %rax, %rdi
callq 0x31a0
callq 0x3130
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3360
movl %eax, %ebx
testl %eax, %eax
je 0x3e4b
movq 0x5223(%rip), %r14      # 0x8ff0
leaq 0x22e9(%rip), %rsi      # 0x60bd
movl $0x7, %edx
movq %r14, %rdi
callq 0x32d0
movl %ebx, %edi
callq 0x30f0
testq %rax, %rax
je 0x3e0c
movq %rax, %r15
movq %rax, %rdi
callq 0x3160
movq 0x51f1(%rip), %rdi      # 0x8ff0
movq %r15, %rsi
movq %rax, %rdx
callq 0x32d0
jmp 0x3e24
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x3340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3320
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_O3/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 0x21b4(%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 0x216d(%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 0x2183(%rip), %xmm4     # 0x6050
movsd 0x2183(%rip), %xmm5     # 0x6058
callq 0x3100
movl $0x1700, %edi           # imm = 0x1700
addq $0x28, %rsp
jmp 0x3090
// File: /workspace/github_c_makefile_star2_O3/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
testq %rsi, %rsi
je 0x3f8a
movq %rdi, %rbx
leaq 0x4c77(%rip), %rax      # 0x8bd8
leaq 0x4e00(%rip), %rdx      # 0x8d68
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x32c0
testq %rax, %rax
je 0x3f8a
movq %rax, %r14
movq %rax, %rdi
callq 0x5be0
cmpl $0x2, %eax
jne 0x3f92
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x5be0
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 0x389e
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x3fec
movq 0x10(%rax), %rdx
movl 0x1c(%rdx), %edx
decl %edx
cmpl $0x2, %edx
jb 0x3fec
movq (%rax), %rax
jmp 0x3fd4
cmpq %rcx, %rax
je 0x3ffa
movq 0x10(%rax), %rsi
jmp 0x3ffc
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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), %rax
movq 0x90(%rdi), %r14
cmpq %rax, %r14
je 0x402b
cmpq %r13, 0x10(%r14)
je 0x402b
movq (%r14), %r14
jmp 0x401b
leaq 0x60(%rdi), %rbx
movq 0x60(%rdi), %r15
cmpq %rbx, %r15
je 0x4043
cmpq %r13, 0x10(%r15)
je 0x4043
movq (%r15), %r15
jmp 0x4033
leaq 0x78(%rdi), %rbp
movq 0x78(%rdi), %r12
cmpq %rbp, %r12
movq %rdi, 0x8(%rsp)
je 0x4065
cmpq %r13, 0x10(%r12)
je 0x4065
movq (%r12), %r12
cmpq %rbp, %r12
jne 0x4055
movq %rax, 0x10(%rsp)
movl $0x28, %esi
movq %r13, %rdi
callq 0x30a0
movq 0x8(%rsp), %rsi
cmpq %r13, 0x58(%rsi)
jne 0x408a
movq $0x0, 0x58(%rsi)
movq 0xa0(%rsi), %rax
testq %rax, %rax
sete %cl
cmpq 0x10(%rsp), %r14
sete %dl
orb %cl, %dl
jne 0x40c7
decq %rax
movq %rax, 0xa0(%rsi)
movq %r14, %rdi
callq 0x32b0
movl $0x18, %esi
movq %r14, %rdi
callq 0x30a0
movq 0x8(%rsp), %rsi
movq 0x70(%rsi), %rax
testq %rax, %rax
sete %cl
cmpq %rbx, %r15
sete %dl
orb %cl, %dl
jne 0x40fc
decq %rax
movq %rax, 0x70(%rsi)
movq %r15, %rdi
callq 0x32b0
movl $0x18, %esi
movq %r15, %rdi
callq 0x30a0
movq 0x8(%rsp), %rsi
movq 0x88(%rsi), %rax
testq %rax, %rax
sete %cl
cmpq %rbp, %r12
sete %dl
orb %cl, %dl
jne 0x4140
decq %rax
movq %rax, 0x88(%rsi)
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
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x4247
movq %rdi, %rbx
leaq 0x78(%rdi), %r12
movq 0x10(%r15), %rsi
cmpl $0x0, 0x1c(%rsi)
jne 0x41e3
movq 0x58(%rbx), %rdi
cmpl $0x0, 0x1c(%rdi)
je 0x41ed
movq (%r15), %r15
cmpq %r14, %r15
jne 0x41cf
jmp 0x4247
callq 0x44f4
testb %al, %al
je 0x4202
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x3f4e
movq (%r12), %r13
cmpq %r12, %r13
je 0x41e3
movq 0x10(%r13), %rsi
cmpl $0x0, 0x1c(%rsi)
jne 0x4241
movq 0x10(%r15), %rdi
cmpl $0x0, 0x1c(%rdi)
jne 0x4241
callq 0x44f4
testb %al, %al
je 0x4241
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4150
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x3f4e
movq (%r13), %r13
jmp 0x4206
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x4309
cmpl $0x2a, %eax
jg 0x431d
cmpl $0x1a, %eax
je 0x433b
cmpl $0x29, %eax
jne 0x431c
movq (%rdi), %rax
jmpq *0xa8(%rax)
cmpl $0x4, %eax
je 0x4333
cmpl $0x7, %eax
je 0x4351
cmpl $0x15, %eax
je 0x4252
retq
cmpl $0x2b, %eax
je 0x4343
cmpl $0x2c, %eax
jne 0x431c
cmpq $0x0, 0x58(%rdi)
je 0x431c
jmp 0x3ee8
movb $0x0, 0x4ea4(%rip)      # 0x91de
retq
movb $0x0, 0x4e9b(%rip)      # 0x91dd
retq
movq 0x58(%rdi), %rdi
testq %rdi, %rdi
je 0x431c
jmp 0x45ac
movb $0x0, 0x4e87(%rip)      # 0x91df
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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
mulss 0x14(%rdi), %xmm0
addss 0xc(%rdi), %xmm0
cvtsi2ss %esi, %xmm4
movss 0x1b9e(%rip), %xmm3     # 0x6020
cvtsi2ss %edx, %xmm1
mulss %xmm3, %xmm4
mulss %xmm3, %xmm1
movaps 0x1b7b(%rip), %xmm3     # 0x6010
movaps %xmm4, %xmm5
xorps %xmm3, %xmm5
xorps %xmm1, %xmm3
ucomiss %xmm2, %xmm5
jbe 0x44b0
subss %xmm2, %xmm5
subss %xmm5, %xmm4
movaps %xmm4, %xmm2
jmp 0x44bd
ucomiss %xmm4, %xmm2
jbe 0x44bd
subss %xmm4, %xmm2
subss %xmm4, %xmm2
movss %xmm2, 0x8(%rdi)
ucomiss %xmm0, %xmm3
jbe 0x44d4
subss %xmm0, %xmm3
subss %xmm3, %xmm1
movaps %xmm1, %xmm0
jmp 0x44e1
ucomiss %xmm1, %xmm0
jbe 0x44e1
subss %xmm1, %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0xc(%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x4434
leaq 0x46a8(%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 0x45ac
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%r15), %rdi
testq %rdi, %rdi
je 0x45a3
movq 0x38(%rbx), %rsi
subq %rdi, %rsi
callq 0x30a0
movq %r14, %rdi
callq 0x3230
nop
// File: /workspace/github_c_makefile_star2_O3/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:
movsd 0x10(%rdi), %xmm1
movaps %xmm1, %xmm2
mulps %xmm1, %xmm2
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
movaps %xmm1, %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
xorps %xmm2, %xmm2
sqrtss %xmm3, %xmm2
andps 0xf6a(%rip), %xmm2      # 0x61b0
xorl %eax, %eax
ucomiss 0xf45(%rip), %xmm2      # 0x6194
seta %al
pshufd $0x0, %xmm2, %xmm3      # xmm3 = xmm2[0,0,0,0]
movaps %xmm1, %xmm4
divps %xmm3, %xmm4
mulps 0xf5c(%rip), %xmm4      # 0x61c0
movd %eax, %xmm3
pshufd $0x50, %xmm3, %xmm3     # xmm3 = xmm3[0,0,1,1]
pslld $0x1f, %xmm3
psrad $0x1f, %xmm3
andps %xmm3, %xmm4
andnps %xmm1, %xmm3
orps %xmm4, %xmm3
movss %xmm2, 0x48(%rdi)
mulps 0xf14(%rip), %xmm3      # 0x61a0
movlps %xmm3, 0x10(%rdi)
jmp 0x445e
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xd7f(%rip), %xmm3      # 0x6040
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x3280
movl $0x2, %edi
callq 0x3300
movq 0x28(%rbx), %r14
cmpq 0x30(%rbx), %r14
je 0x52f6
movss (%r14), %xmm0
movss 0x4(%r14), %xmm1
callq 0x31c0
addq $0x8, %r14
jmp 0x52da
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x32a0
// File: /workspace/github_c_makefile_star2_O3/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 0xe6f(%rip), %xmm1      # 0x6188
movq 0x28(%rdi), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
mulss 0xe5c(%rip), %xmm1      # 0x618c
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 0x5914
movss 0xde4(%rip), %xmm0      # 0x6198
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 0x44e8
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movss 0x8(%rsp), %xmm0
movss 0x4(%rsp), %xmm1
callq 0x5814
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_O3/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 0x561b
cmpl $0x200, %eax            # imm = 0x200
jg 0x567a
cmpl $0x100, %eax            # imm = 0x100
je 0x56cb
cmpl $0x200, %eax            # imm = 0x200
jne 0x5721
addq $0x28, %rsp
jmp 0x5740
cmpl $0x400, %eax            # imm = 0x400
jg 0x56a8
cmpl $0x301, %eax            # imm = 0x301
je 0x56d8
cmpl $0x400, %eax            # imm = 0x400
jne 0x5721
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 0x571c
cmpl $0x201, %eax            # imm = 0x201
je 0x571c
cmpl $0x300, %eax            # imm = 0x300
jne 0x5721
movq (%rdi), %rax
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq *0x28(%rax)
jmp 0x571c
cmpl $0x401, %eax            # imm = 0x401
je 0x56f0
cmpl $0x402, %eax            # imm = 0x402
jne 0x5721
movb 0x10(%rsi), %al
decb %al
cmpb $0x2, %al
ja 0x571c
movzbl %al, %eax
leaq 0xb97(%rip), %rcx       # 0x6260
jmp 0x5703
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)
jmp 0x571c
movb 0x10(%rsi), %al
decb %al
cmpb $0x2, %al
ja 0x571c
movzbl %al, %eax
leaq 0xb45(%rip), %rcx       # 0x6248
movq (%rcx,%rax,8), %rcx
movl 0x14(%rsi), %eax
movl 0x18(%rsi), %edx
movq (%rdi), %rsi
movq (%rsi,%rcx), %rcx
movl %eax, %esi
addq $0x28, %rsp
jmpq *%rcx
addq $0x28, %rsp
retq
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_O3/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 0x8f3(%rip), %xmm0      # 0x6290
callq 0x3150
movl $0xb10, %edi            # imm = 0xB10
callq 0x31f0
xorl %edi, %edi
callq 0x3300
movss 0x8(%rbx), %xmm0
movss 0xc(%rbx), %xmm1
callq 0x31c0
popq %rbx
jmp 0x32a0
// File: /workspace/github_c_makefile_star2_O3/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 0x4434
leaq 0x336b(%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)
movsd 0x8aa(%rip), %xmm0      # 0x62b0
movsd %xmm0, 0x48(%rbx)
incl %ebp
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movl %ebp, 0x44(%rbx)
movss 0x8a1(%rip), %xmm1      # 0x62c0
divss %xmm0, %xmm1
movss 0x899(%rip), %xmm2      # 0x62c4
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 0x86c(%rip), %xmm0      # 0x62c8
addss %xmm0, %xmm0
mulss 0x864(%rip), %xmm0      # 0x62cc
movss %xmm0, 0x8(%rsp)
callq 0x32e0
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x5a6(%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 0x5814
movq %r14, %rdi
movq %r15, %rsi
callq 0x5452
incq %r12
cmpq $0x10, %r12
jne 0x5a4c
movss (%rsp), %xmm0
addss 0xc(%rsp), %xmm0
mulss 0x528(%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 0x5b21
movq 0x38(%rbx), %rsi
subq %rdi, %rsi
callq 0x30a0
movq %r15, %rdi
callq 0x3230
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x5ca1
leaq 0x28(%rbx), %rdi
xorl %esi, %esi
callq 0x31b0
cvtsi2sdq 0x18(%rbx), %xmm1
cvtsi2sdq 0x20(%rbx), %xmm0
movsd 0x633(%rip), %xmm2      # 0x62e8
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_O3/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 0x5c6(%rip), %rsi       # 0x6300
leaq 0x5c9(%rip), %rdx       # 0x630a
movq %rsp, %rdi
callq 0x5df0
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x470, %edx            # imm = 0x470
movl $0x280, %ecx            # imm = 0x280
callq 0x34ec
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5d74
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x30a0
movq %rbx, %rdi
callq 0x3c6a
testb %al, %al
je 0x5d95
movq %rbx, %rdi
callq 0x37ea
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %eax, %eax
jmp 0x5db2
movq 0x323c(%rip), %rdi      # 0x8fd8
leaq 0x568(%rip), %rsi       # 0x630b
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 0x5dda
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x30a0
jmp 0x5dda
movq %rax, %r14
movl $0xb0, %esi
movq %rbx, %rdi
callq 0x30a0
movq %r14, %rdi
callq 0x3230
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x5914
leaq 0x8e6f(%rip), %rdi      # 0xa0c0
xorl %esi, %esi
callq 0x5954
movq %rax, 0x8e59(%rip)      # 0xa0b8
testq %rax, %rax
jne 0x1277
leaq 0x5d99(%rip), %rdi      # 0x7004
leaq 0x5d9f(%rip), %rsi      # 0x7011
callq 0x4a0b
leaq 0x10(%rsp), %rbx
movl $0x8, %esi
movq %rbx, %rdi
callq 0x675c
leaq 0x8(%rsp), %r14
movl $0x8, %esi
movq %r14, %rdi
callq 0x675c
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 0x6dc4
cmpl $-0x1, %eax
jne 0x12fa
leaq 0x5d16(%rip), %rdi      # 0x7004
leaq 0x5d30(%rip), %rsi      # 0x7025
callq 0x4a0b
movl $0x1, %edi
callq 0x5090
cmpl $-0x1, %eax
jne 0x131c
leaq 0x5cf4(%rip), %rdi      # 0x7004
leaq 0x5d0e(%rip), %rsi      # 0x7025
callq 0x4a0b
xorl %edi, %edi
callq 0x4abf
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0x57e0
testl %eax, %eax
je 0x7661
cmpl $-0x1, %eax
je 0x76ae
addq $0x20, %rsp
popq %rbx
retq
movl 0xe1fd(%rip), %ecx      # 0x15864
leaq 0x7169(%rip), %rdx      # 0xe7d7
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 0x6fdd(%rip), %rdi      # 0xe676
leaq 0x6fd4(%rip), %rsi      # 0xe674
xorl %edx, %edx
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
jmp 0x5220
callq 0x55a0
movl (%rax), %edi
callq 0x5460
leaq 0x6f47(%rip), %rdi      # 0xe608
movq %rax, %rsi
xorl %eax, %eax
callq 0x5e86
// File: /workspace/github_c_makefile_star2_O3/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:
movl $0xc, %eax
testb $0x20, (%rdi)
jne 0x151b
movzwl 0x2(%rdi), %eax
movl %eax, %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
addq $0x10, %rcx
testw %ax, %ax
movl $0xc, %eax
cmovneq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rdi, %r13
leaq 0x8(%rsp), %r15
movl $0x210, %edx            # imm = 0x210
movq %r15, %rdi
movq %r13, %rsi
callq 0x10f0
movb (%r15), %al
movl $0x1, %r15d
cmpb $0x40, %al
jb 0x17ab
testb $0x20, %al
jne 0x171c
movzwl 0xa(%rsp), %eax
movl %eax, %r12d
rolw $0x8, %r12w
movzwl %r12w, %ecx
addq $0x10, %rcx
testw %ax, %ax
movl $0xc, %eax
cmovneq %rcx, %rax
cmpq (%rbx), %rax
jbe 0x172d
movl $0x7, %r15d
xorl %r12d, %r12d
jmp 0x17a8
xorl %r12d, %r12d
cmpq $0xc, (%rbx)
jae 0x172d
movl $0x7, %r15d
jmp 0x17a8
movzwl %r12w, %ebp
leaq 0x218(%rsp), %r12
movl $0x210, %edx            # imm = 0x210
movq %r12, %rdi
movq %r13, %rsi
callq 0x10f0
andb $-0x21, (%r12)
xorl %r15d, %r15d
xorl %edi, %edi
movq %r12, %rsi
movl $0x8, %edx
callq 0x1070
bswapl %eax
leaq 0x14(%rsp), %r12
movl %eax, -0x4(%r12)
xorl %edi, %edi
movq %r12, %rsi
movl %ebp, %edx
callq 0x1070
movq %rax, %r13
bswapl %r13d
movl %r13d, 0x200(%r12)
leaq 0xc(%rbp), %r12
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x10f0
testw %bp, %bp
je 0x17a8
movl %r13d, 0xc(%r14,%rbp)
leaq 0x10(%rbp), %r12
movq %r12, (%rbx)
movl %r15d, %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_O3/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 0x18a4
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_O3/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:
xorl %eax, %eax
testq %rsi, %rsi
cmovel %eax, %edx
movl $0x3, %eax
cmpl $0x200, %edx            # imm = 0x200
ja 0x191d
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x200, %eax            # imm = 0x200
subl %edx, %eax
leaq 0xc(%rdi), %r15
movzwl %dx, %r12d
addq %r12, %rdi
addq $0xc, %rdi
movzwl %ax, %edx
xorl %esi, %esi
callq 0x10c0
movl %r12d, %eax
rolw $0x8, %ax
movw %ax, 0x2(%r14)
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x10f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x1947
leaq 0x8(%rsp), %rdi
callq 0x12c5
addq $0x18, %rsp
retq
callq 0x1050
// File: /workspace/github_c_makefile_star2_O3/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 0x19ad
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 0x1920
movq %rsp, %rdx
movq %r14, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x461f(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x1160
movl $0x1, %edi
callq 0x1190
// File: /workspace/github_c_makefile_star2_O3/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 0x1a8b
movq %rdi, %rbx
callq 0x1681
decl %eax
cmpl $0x2, %eax
ja 0x1a94
movl %eax, %eax
leaq 0x1722(%rip), %rcx      # 0x31a4
movslq (%rcx,%rax,4), %r14
addq %rcx, %r14
jmp 0x1a9b
leaq 0x163e(%rip), %rbx      # 0x30d0
jmp 0x1b04
leaq 0x15bf(%rip), %r14      # 0x305a
movq %rbx, %rdi
callq 0x1688
movzbl %al, %ebp
movq %rbx, %rdi
callq 0x1690
movzbl %al, %r15d
movq %rbx, %rdi
callq 0x17f1
movzbl %al, %r12d
movq %rbx, %rdi
callq 0x17f5
movl %eax, %r13d
movq %rbx, %rdi
callq 0x151c
movzwl %ax, %r10d
leaq 0x4654(%rip), %rbx      # 0x6130
leaq 0x15fd(%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 0x1b16
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_O3/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 0x15d6(%rip), %r13      # 0x3112
movq 0x4495(%rip), %r14      # 0x5fd8
movl %ebp, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1150
cmpl $0x66, %eax
jne 0x1b5e
movq (%r14), %rax
movq %rax, (%r12)
jmp 0x1b43
cmpl $-0x1, %eax
jne 0x1ba5
movq 0x4466(%rip), %rcx      # 0x5fd0
movslq (%rcx), %rax
leal 0x2(%rax), %edx
cmpl %ebp, %edx
jne 0x1bbc
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 0x1bc4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3f, %eax
je 0x1baf
cmpl $0x68, %eax
jne 0x1bb7
movq %rbx, %rdi
callq 0x12fa
callq 0x1050
movq %rbx, %rdi
callq 0x1321
movq %rbx, %rdi
callq 0x135f
// File: /workspace/github_c_makefile_star2_O3/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 0x1c1d
movl %eax, %edi
callq 0x10a0
jmp 0x1c3b
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_O3/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 0x1cd0
movl %eax, %ebx
testq %r15, %r15
sete %al
testl %r12d, %r12d
setle %cl
orb %al, %cl
jne 0x1c9c
rolw $0x8, %r12w
movw %r12w, 0x2(%r15)
movl %ebx, %edi
movq %r15, %rsi
movl $0x1c, %edx
callq 0x1120
testl %eax, %eax
jne 0x1cd9
testq %r14, %r14
sete %al
testl %ebp, %ebp
setle %cl
orb %al, %cl
jne 0x1cea
rolw $0x8, %bp
movw %bp, 0x2(%r14)
movl %ebx, %edi
movq %r14, %rsi
movl $0x1c, %edx
callq 0x11a0
testl %eax, %eax
je 0x1cea
leaq 0x14a4(%rip), %rdi      # 0x3172
jmp 0x1ce0
leaq 0x148f(%rip), %rdi      # 0x3166
jmp 0x1ce0
leaq 0x148d(%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_O3/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 0x16a4
testl %eax, %eax
jne 0x1d3b
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 0x1438(%rip), %rdi      # 0x317a
xorl %eax, %eax
callq 0x194c
// File: /workspace/github_c_makefile_star2_O3/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 0x1e29
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, 0x47a2(%rip)      # 0x6530
je 0x1daa
movq 0x47b1(%rip), %rax      # 0x6548
cmpq %rax, %rcx
jne 0x1dc1
movq 0x47ad(%rip), %rsi      # 0x6550
cmpq %rsi, %rdx
jle 0x1dca
jmp 0x1dec
movq %rcx, 0x4787(%rip)      # 0x6538
movq %rdx, 0x4788(%rip)      # 0x6540
movb $0x1, 0x4771(%rip)      # 0x6530
jmp 0x1dec
jge 0x1dec
movq 0x4786(%rip), %rsi      # 0x6550
leaq 0x1(%rsi), %rdx
leaq -0xf423f(%rsi), %rcx
xorl %edi, %edi
cmpq $0xf423f, %rsi          # imm = 0xF423F
setge %dil
cmovgeq %rcx, %rdx
addq %rdi, %rax
movq %rax, %rcx
movq %rcx, 0x4755(%rip)      # 0x6548
movq %rdx, 0x4756(%rip)      # 0x6550
subl 0x4738(%rip), %ecx      # 0x6538
subq 0x4739(%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 0x1365(%rip), %rdi      # 0x3195
callq 0x19ee
// File: /workspace/github_c_makefile_star2_O3/sprt[P]lossless-transport/src/window.c
// Function: window_create
window_t *window_create(size_t size, size_t max_size, size_t max_seqnum) {
	if (size > max_size) {
		return NULL;
	}
	window_t *w = calloc(1, sizeof (window_t));
	if (w == NULL) {
		return NULL;
	}
	w->size = size;
	w->capacity = max_size;
	w->max_seqnum = max_seqnum; /* TODO: check valid */
	return w;
}

// Assembly:
cmpq %rsi, %rdi
jbe 0x1e58
xorl %eax, %eax
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x30, %esi
callq 0x10d0
testq %rax, %rax
je 0x1e87
movq %r15, 0x10(%rax)
movq %r14, 0x8(%rax)
movq %rbx, (%rax)
jmp 0x1e89
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq