LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/xtanitfy[P]Murphy/src/muti_tree.c
// Function: MTREE_forward
int MTREE_forward(MTREE_s *pTree,int (*callback)(void *usr,int idCurr,int *_idPrev,int _nIdPrev))
{
	MTREE_ITEM_s *pItemTmp = NULL;
	MTREE_ITEM_s *pRoot = pTree->root;
	int idPrev[MTREE_MAX_MUX];
	int nIdPrev = 0;

	/*syncPrev ��Ҫ��������*/
	//MTREEResetSyncNext(pTree);
	MTREEResetSyncPrev(pTree);
	
	QUEUE_reset(pTree->pQForward);

	CHECK_EXPR_RET(pRoot == NULL,-1);
	if (callback != NULL) {
		callback(pTree->usr,pRoot->valCurr,NULL,0);
	}
	
	//printf("curr:%d \n",pRoot->valCurr);
	for (int i = 0;i < pRoot->nNext;i++) {
		QUEUE_enqueue(pTree->pQForward,&pRoot->next[i]);
	}
	while(QUEUE_dequeue(pTree->pQForward,&pItemTmp) != QUEUE_EMPTY) {
		nIdPrev = 0;
		for (int i = 0;i < pItemTmp->nPrev;i++) {
			CHECK_EXPR_RET(pItemTmp->prev[i] == NULL,-1);
			idPrev[nIdPrev++] = pItemTmp->prev[i]->valCurr;
		}
		if (callback != NULL) {
			callback(pTree->usr,pItemTmp->valCurr,idPrev,nIdPrev);
		}
		for (int i = 0;i < pItemTmp->nNext;i++) {
			if (--pItemTmp->next[i]->syncPrev == 0) {
				QUEUE_enqueue(pTree->pQForward,&pItemTmp->next[i]);
			}
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
andq $0x0, 0x8(%rsp)
movq %rdi, %r14
movq 0x8(%rdi), %r12
leaq 0x80(%rdi), %rax
movq %rax, %rcx
movq (%rcx), %rcx
cmpq %rax, %rcx
je 0x1631
movl -0x8(%rcx), %edx
movl %edx, -0x4(%rcx)
jmp 0x1621
movq 0x18(%r14), %rdi
callq 0x1bfc
testq %r12, %r12
je 0x1725
testq %rbx, %rbx
je 0x1656
movq 0x70(%r14), %rdi
movl (%r12), %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq *%rbx
leaq 0x8(%r12), %r15
xorl %r13d, %r13d
movslq 0x48(%r12), %rax
cmpq %rax, %r13
jge 0x167d
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0x1b31
incq %r13
addq $0x8, %r15
jmp 0x165e
leaq 0x8(%rsp), %r12
xorl %r15d, %r15d
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0x1b9e
cmpl $-0x2, %eax
je 0x174a
movq 0x8(%rsp), %rax
xorl %ecx, %ecx
movslq 0x90(%rax), %rdx
cmpq %rdx, %rcx
jge 0x16c2
movq 0x50(%rax,%rcx,8), %rdx
testq %rdx, %rdx
je 0x1709
movl (%rdx), %edx
movl %edx, 0x10(%rsp,%rcx,4)
incq %rcx
jmp 0x16a1
testq %rbx, %rbx
je 0x16d4
movq 0x70(%r14), %rdi
movl (%rax), %esi
leaq 0x10(%rsp), %rdx
callq *%rbx
pushq $0x8
popq %rbp
xorl %r13d, %r13d
movq 0x8(%rsp), %rsi
movslq 0x48(%rsi), %rax
cmpq %rax, %r13
jge 0x1685
movq (%rsi,%rbp), %rax
decl 0x94(%rax)
jne 0x1700
addq %rbp, %rsi
movq 0x18(%r14), %rdi
callq 0x1b31
incq %r13
addq $0x8, %rbp
jmp 0x16da
leaq 0x9f0(%rip), %rdi       # 0x2100
leaq 0x9ff(%rip), %rsi       # 0x2116
leaq 0xa5c(%rip), %rdx       # 0x217a
movl $0xac, %ecx
jmp 0x173f
leaq 0x9d4(%rip), %rdi       # 0x2100
leaq 0x9e3(%rip), %rsi       # 0x2116
leaq 0xa40(%rip), %rdx       # 0x217a
movl $0xa0, %ecx
xorl %eax, %eax
callq 0x1030
pushq $-0x1
popq %r15
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xtanitfy[P]Murphy/src/muti_tree.c
// Function: MTREE_printByList
int MTREE_printByList(MTREE_s *pTree)
{
	CHECK_EXPR_RET(pTree == NULL,-1);

	MTREE_ITEM_s *pItem = NULL;
	pTree->nEnd = 0;

	printf("MTREE_printByList:\n");
	list_for_each_entry(pItem,&pTree->head,list,MTREE_ITEM_s) {
		printf("curr:%d\n",pItem->valCurr);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x17a6
movq %rdi, %rbx
andl $0x0, 0x68(%rdi)
leaq 0xa43(%rip), %rdi       # 0x21b9
callq 0x1080
subq $-0x80, %rbx
leaq 0x87e(%rip), %r14       # 0x2004
xorl %ebp, %ebp
movq %rbx, %r15
movq (%r15), %r15
cmpq %rbx, %r15
je 0x17ca
movl -0x98(%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1030
jmp 0x178b
leaq 0x953(%rip), %rdi       # 0x2100
leaq 0x962(%rip), %rsi       # 0x2116
leaq 0x9cd(%rip), %rdx       # 0x2188
movl $0xbd, %ecx
xorl %eax, %eax
callq 0x1030
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xtanitfy[P]Murphy/src/muti_tree.c
// Function: MTREE_getEndIds
int MTREE_getEndIds(MTREE_s *pTree,int *endId,int *n)
{
	CHECK_EXPR_RET(pTree == NULL,-1);
	CHECK_EXPR_RET(endId == NULL,-1);
	CHECK_EXPR_RET(n == NULL,-1);

	*n = 0;
	MTREE_ITEM_s *pItem = NULL;
	list_for_each_entry(pItem,&pTree->head,list,MTREE_ITEM_s) {
		if (pItem->nNext == 0) {
			endId[(*n)++] = pItem->valCurr;
		}
	}
	
	return 0;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x1815
testq %rsi, %rsi
je 0x1820
testq %rdx, %rdx
je 0x1827
andl $0x0, (%rdx)
subq $-0x80, %rdi
movq %rdi, %rax
movq (%rax), %rax
cmpq %rdi, %rax
je 0x181c
cmpl $0x0, -0x50(%rax)
jne 0x17f1
movl -0x98(%rax), %ecx
movslq (%rdx), %r8
leal 0x1(%r8), %r9d
movl %r9d, (%rdx)
movl %ecx, (%rsi,%r8,4)
jmp 0x17f1
movl $0xcc, %ecx
jmp 0x182c
xorl %eax, %eax
jmp 0x184b
movl $0xcd, %ecx
jmp 0x182c
movl $0xce, %ecx
leaq 0x8cd(%rip), %rdi       # 0x2100
leaq 0x8dc(%rip), %rsi       # 0x2116
leaq 0x959(%rip), %rdx       # 0x219a
xorl %eax, %eax
callq 0x1030
pushq $-0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/Enes1313[P]DataStructures/Test/main.c
// Function: main
int main(void)
{
	srand((unsigned int)time(NULL));

	testCircularBuffer();
	testDynamicArray();
	testLinkedList();
	testQueue();
	testStack();

	return EXIT_SUCCESS;
}

// Assembly:
pushq %rax
xorl %edi, %edi
callq 0x1080
movl %eax, %edi
callq 0x1060
callq 0x234c
callq 0x2738
callq 0x2a23
callq 0x2df0
callq 0x2bee
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/Enes1313[P]DataStructures/Test/main.c
// Function: testQueue
void testQueue()
{
	size_t i, x;
	eaDSQueue queue = NULL;

	if (NULL == (queue = eaDSQueueInit(intCreateAndCopy, free)))
	{
		puts("queue olusmadi!");
		return;
	}

	for(i = 0; i < 13; i++)
	{
		x = (unsigned int) rand() % 50;

		if(EXIT_SUCCESS == eaDSQueueEnqueue(queue, &x))
		{
			printf("Queue'e eleman eklendi : %d \n", (int)x);
		}
		else
		{
			puts("Queue'e eleman eklenemedi!");
		}
	}

	for(i = 0; !eaDSQueueIsEmpty(queue); i++)
	{
		void * data = eaDSQueueDequeue(queue);

		if(NULL != data)
		{
			printf("Queue'den %d. eleman alindi : %d\n", (int)i + 1, *(int *)data);
			free(data);
		}
		else
		{
			printf("Queue'den %d. eleman alma basarisiz\n", (int)i + 1);
		}
	}

	printf("Queue siliniyor.\n");
	eaDSQueueClear(queue);

	puts("********************************************");
	puts("Queue");
	puts("********************************************");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq -0x6e4(%rip), %rdi      # 0x271e
movq 0x31af(%rip), %rsi      # 0x5fb8
callq 0x1e68
testq %rax, %rax
je 0x2f08
movq %rax, %rbx
pushq $0xd
popq %r13
pushq $0x32
popq %rbp
movq %rsp, %r14
leaq 0x63e(%rip), %r15       # 0x3469
leaq 0x655(%rip), %r12       # 0x3487
subq $0x1, %r13
jb 0x2e6d
callq 0x10b0
xorl %edx, %edx
divl %ebp
movq %rdx, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
testl %eax, %eax
je 0x2e5e
movq %r12, %rdi
callq 0x1030
jmp 0x2e32
movl (%rsp), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1050
jmp 0x2e32
pushq $0x1
popq %rbp
leaq 0x64d(%rip), %r14       # 0x34c4
leaq 0x624(%rip), %r15       # 0x34a2
movq %rbx, %rdi
callq 0x1f2e
testl %eax, %eax
jne 0x2ec2
movq %rbx, %rdi
callq 0x1f38
testq %rax, %rax
je 0x2eb2
movq %rax, %r12
movl (%rax), %edx
movq %r15, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1050
movq %r12, %rdi
callq 0x10c0
jmp 0x2ebe
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1050
incl %ebp
jmp 0x2e7e
leaq 0x712(%rip), %rdi       # 0x35db
callq 0x1030
movq %rbx, %rdi
callq 0x1f1c
leaq 0x192(%rip), %rbx       # 0x306f
movq %rbx, %rdi
callq 0x1030
leaq 0x5fd(%rip), %rdi       # 0x34e9
callq 0x1030
movq %rbx, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x54a(%rip), %rdi       # 0x3459
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/attractivechaos[P]rb-eval/rb-map.cpp
// Function: test_int(int)
int test_int(int n)
{
	int i, cnt = 0;
	uint64_t x = 11;
	intmap_t *h = new intmap_t;

	for (i = 0; i < n; ++i) {
		unsigned y = x % (n>>1);
		x = kad_splitmix64(x);
		std::pair<intmap_t::iterator, bool> p = h->insert(std::pair<unsigned, int>(y, i));
		if (p.second == false) h->erase(p.first);
	}
	cnt = h->size();
	delete h;
	return cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebp
pushq $0x30
popq %rdi
callq 0x10a0
movq %rax, %rbx
addq $0x8, %rax
andl $0x0, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq %rax, 0x20(%rbx)
andq $0x0, 0x28(%rbx)
movl %ebp, %eax
sarl %eax
movslq %eax, %r12
xorl %r13d, %r13d
testl %ebp, %ebp
cmovlel %r13d, %ebp
pushq $0xb
popq %r15
movq %rsp, %r14
cmpl %r13d, %ebp
je 0x12e1
movq %r15, %rax
xorl %edx, %edx
divq %r12
movl %edx, (%rsp)
movl %r13d, 0x4(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x13aa
testb $0x1, %dl
jne 0x1295
movq %rbx, %rdi
movq %rax, %rsi
callq 0x152c
movabsq $-0x61c8864680b583eb, %rax # imm = 0x9E3779B97F4A7C15
addq %rax, %r15
movq %r15, %rax
shrq $0x1e, %rax
xorq %r15, %rax
movabsq $-0x40a7b892e31b1a47, %rcx # imm = 0xBF58476D1CE4E5B9
imulq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movabsq $-0x6b2fb644ecceee15, %rax # imm = 0x94D049BB133111EB
imulq %rax, %rcx
movq %rcx, %r15
shrq $0x1f, %r15
xorq %rcx, %r15
incl %r13d
jmp 0x1265
movl 0x28(%rbx), %ebp
movq %rbx, %rdi
callq 0x1352
pushq $0x30
popq %rsi
movq %rbx, %rdi
callq 0x10b0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_2/exercise_2_04/squeeze.c
// Function: squeeze
void squeeze(char str1[], char str2[])
{
  int i, j, k;
  for (k = 0; str2[k] != '\0'; ++k)
  {
    for (i = j = 0; str1[i] != '\0'; ++i)
    {
      if (str1[i] != str2[k])
      {
        str1[j++] = str1[i];
      }
    }

    str1[j] = '\0';
  }
}

// Assembly:
xorl %eax, %eax
cmpb $0x0, (%rsi,%rax)
je 0x11f9
xorl %edx, %edx
movq %rdi, %rcx
movb (%rcx), %r8b
movslq %edx, %r9
testb %r8b, %r8b
je 0x11ef
cmpb (%rsi,%rax), %r8b
je 0x11ea
leal 0x1(%r9), %edx
movb %r8b, (%rdi,%r9)
incq %rcx
jmp 0x11d1
movb $0x0, (%rdi,%r9)
incq %rax
jmp 0x11c6
retq
// File: /workspace/github_c_makefile_star2_O2/antonblanchard[P]will-it-scale/tests/eventfd1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	unsigned long long rbuf;
	unsigned long long wbuf;
	int fd = eventfd(0, 0);
	int ret;

	assert(fd >= 0);

	wbuf = 1;

	while (1) {
		do {
			ret = write(fd, &wbuf, sizeof(wbuf));
		} while (ret != sizeof(wbuf) && errno == EINTR);
		assert(ret == sizeof(wbuf));

		do {
			ret = read(fd, &rbuf, sizeof(rbuf));
		} while (ret != sizeof(rbuf) && errno == EINTR);
		assert(ret == sizeof(wbuf));

		(*iterations)++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %edi, %edi
xorl %esi, %esi
callq 0x1280
testl %eax, %eax
js 0x1c42
movl %eax, %ebp
movq %rsp, %r14
movq $0x1, (%r14)
pushq $0x8
popq %r15
leaq 0x8(%rsp), %r12
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x10d0
cmpl $0x8, %eax
jne 0x1c31
movl %ebp, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1170
cmpl $0x8, %eax
je 0x1c3d
callq 0x1070
cmpl $0x4, (%rax)
je 0x1c13
jmp 0x1c5b
callq 0x1070
cmpl $0x4, (%rax)
je 0x1c01
jmp 0x1c78
incq (%rbx)
jmp 0x1c01
leaq 0x62d(%rip), %rdi       # 0x2276
leaq 0x62e(%rip), %rsi       # 0x227e
leaq 0x638(%rip), %rcx       # 0x228f
pushq $0x11
jmp 0x1c72
leaq 0x660(%rip), %rdi       # 0x22c2
leaq 0x615(%rip), %rsi       # 0x227e
leaq 0x61f(%rip), %rcx       # 0x228f
pushq $0x1e
popq %rdx
callq 0x1130
leaq 0x643(%rip), %rdi       # 0x22c2
leaq 0x5f8(%rip), %rsi       # 0x227e
leaq 0x602(%rip), %rcx       # 0x228f
pushq $0x19
jmp 0x1c72
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ibperfser.c
// Function: main
int
main(int argc, char ** argv)
{
  if (argc < 6) {
    fprintf(stderr, "Usage: %s <ib-port> <host> <port> <depth> <max-unit>\n", argv[0]);
    exit(0);
  }

  struct ib_port * const port = ib_port_create(atoi(argv[1]));
  if (port == NULL) {
    fprintf(stderr, "ib_port_create() failed\n");
    exit(0);
  }

  const char * const host = argv[2];
  const int pn = atoi(argv[3]);
  const u64 depth = strtoull(argv[4], NULL, 10);
  const u64 unit = strtoull(argv[5], NULL, 10);

  struct worker_info wi;
  wi.port = port;
  wi.depth = depth;
  wi.unit = unit;
  struct server * const ser = server_create(host, pn, perf_worker, &wi);
  if (ser == NULL) {
    fprintf(stderr, "server_create() failed\n");
    exit(0);
  }

  server_wait(ser);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
cmpl $0x5, %edi
jle 0x68bd
movq 0x8(%rbx), %rdi
callq 0x63e0
movslq %eax, %rdi
callq 0x110d4
testq %rax, %rax
je 0x68da
movq %rax, %r14
movq 0x10(%rbx), %rax
movq %rax, -0x30(%rbp)
movq 0x18(%rbx), %rdi
callq 0x63e0
movl %eax, %r12d
movq 0x20(%rbx), %rdi
pushq $0xa
popq %r13
xorl %esi, %esi
movl %r13d, %edx
callq 0x6580
movq %rax, %r15
movq 0x28(%rbx), %rdi
xorl %esi, %esi
movl %r13d, %edx
callq 0x6580
leaq -0x48(%rbp), %rcx
movq %r14, (%rcx)
movq %r15, 0x8(%rcx)
movq %rax, 0x10(%rcx)
leaq 0x7f(%rip), %rdx        # 0x6912
movq -0x30(%rbp), %rdi
movl %r12d, %esi
callq 0xa493
testq %rax, %rax
je 0x68ef
movq %rax, %rdi
callq 0xa706
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x12724(%rip), %rax     # 0x18fe8
movq (%rax), %rdi
movq (%rbx), %rdx
leaq 0xb733(%rip), %rsi      # 0x12004
xorl %eax, %eax
callq 0x6600
jmp 0x690b
movq 0x12707(%rip), %rax     # 0x18fe8
movq (%rax), %rcx
leaq 0xb74f(%rip), %rdi      # 0x1203a
pushq $0x18
jmp 0x6902
movq 0x126f2(%rip), %rax     # 0x18fe8
movq (%rax), %rcx
leaq 0xb753(%rip), %rdi      # 0x12053
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
callq 0x65d0
xorl %edi, %edi
callq 0x6150
// File: /workspace/github_c_makefile_star2_O2/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::Game(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int)
Game::Game(const std::string& title, const int width, const int height)
		: m_title(title),
		m_width(width),
		m_height(height),
		m_nUpdates(0),
		m_score(0)
	{
		m_mainWindow = nullptr;
		m_state = GameState::UNINITIALIZED;
		m_player = new Asteroids::Player();
		m_entities.push_back(m_player);
		m_dimensions[0] = width;
		m_dimensions[1] = height;

		m_timer = new TimeManager;
		m_lastFrameTime = m_timer->GetElapsedTimeInSeconds();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
callq 0x4574
leaq 0x55ff(%rip), %rax      # 0x7ae0
movq %rax, (%rbx)
movl %r14d, 0x8(%rbx)
movl %ebp, 0xc(%rbx)
andq $0x0, 0x10(%rbx)
leaq 0x20(%rbx), %rdi
movq %rdi, 0x8(%rsp)
movq %r15, %rsi
callq 0x21c0
leaq 0x60(%rbx), %rax
movq %rax, 0x68(%rbx)
movq %rax, (%rsp)
movq %rax, 0x60(%rbx)
andq $0x0, 0x70(%rbx)
leaq 0x78(%rbx), %r12
movq %r12, 0x80(%rbx)
movq %r12, 0x78(%rbx)
andq $0x0, 0x88(%rbx)
leaq 0x90(%rbx), %r13
movq %r13, 0x98(%rbx)
movq %r13, 0x90(%rbx)
andq $0x0, 0xa0(%rbx)
andq $0x0, 0x40(%rbx)
andl $0x0, 0x50(%rbx)
pushq $0x50
popq %rdi
callq 0x20c0
movq %rax, %r15
movq %rax, %rdi
callq 0x350c
movq %r15, 0x58(%rbx)
leaq 0x10(%rsp), %rsi
movq %r15, (%rsi)
movq %r13, %rdi
callq 0x2fca
movl %r14d, 0x5c57(%rip)     # 0x81d8
movl %ebp, 0x5c55(%rip)      # 0x81dc
pushq $0x38
popq %rdi
callq 0x20c0
movq %rax, %rbp
movq %rax, %rdi
callq 0x4b80
movq %rbp, 0xa8(%rbx)
movq %rbp, %rdi
callq 0x4c1c
movsd %xmm0, 0x18(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x38
popq %rsi
movq %rbp, %rdi
jmp 0x25d3
jmp 0x25df
movq %rax, %r14
pushq $0x50
popq %rsi
movq %r15, %rdi
callq 0x20a0
jmp 0x25e2
movq %rax, %r14
jmp 0x2605
movq %rax, %r14
movq %r13, %rdi
callq 0x3088
movq %r12, %rdi
callq 0x30b2
movq (%rsp), %rdi
callq 0x30dc
movq 0x8(%rsp), %rdi
callq 0x2250
movq %rbx, %rdi
callq 0x4580
movq %r14, %rdi
callq 0x2230
nop
// File: /workspace/github_c_makefile_star2_O2/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::OnExecute()
void Game::OnExecute()
	{
		if (m_state != GameState::INIT_SUCCESSFUL)
		{
			std::cerr << "Game INIT was not successful." << std::endl;
			return;
		}

		m_state = GameState::RUNNING;
		CreateAsteroid(Asteroids::Asteroid::AsteroidSize::BIG, 1);

		SDL_Event event;
		while (m_state == GameState::RUNNING)
		{
			// Input polling
			//
			while (SDL_PollEvent(&event))
			{
				OnEvent(&event);
			}

			//
			OnUpdate();
			OnRender();
		}
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
cmpl $0x2, 0x50(%rdi)
jne 0x271a
movq %rdi, %rbx
movl $0x4, 0x50(%rdi)
pushq $0x1
popq %rdx
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorl %esi, %esi
callq 0x2744
movq %rsp, %r14
cmpl $0x4, 0x50(%rbx)
je 0x26fc
jmp 0x273c
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x10(%rax)
movq %r14, %rdi
callq 0x2330
testl %eax, %eax
jne 0x26f0
movq %rbx, %rdi
callq 0x28ea
movq %rbx, %rdi
callq 0x29f6
jmp 0x26e8
movq 0x58cf(%rip), %rdi      # 0x7ff0
leaq 0x2938(%rip), %rsi      # 0x5060
callq 0x2200
movq %rax, %rdi
addq $0x38, %rsp
popq %rbx
popq %r14
jmp 0x22f0
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::CreateAsteroid(Asteroids::Asteroid::AsteroidSize::Size, int, float, float)
void Game::CreateAsteroid(Asteroids::Asteroid::AsteroidSize::Size size, int amount, float x, float y)
	{
		for (int i = 0; i < amount; ++i)
		{
			Asteroids::Asteroid* pAsteroid = new Asteroids::Asteroid(size);
			m_entities.push_back(pAsteroid);
			m_asteroids.push_back(pAsteroid);

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

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

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x90(%rdi), %r15
addq $0x60, %r14
xorps %xmm2, %xmm2
movaps %xmm1, 0x30(%rsp)
cmpeqps %xmm2, %xmm1
movaps %xmm0, 0x20(%rsp)
cmpeqps %xmm0, %xmm2
andps %xmm1, %xmm2
movd %xmm2, %ebp
xorl %r12d, %r12d
testl %edx, %edx
cmovgl %edx, %r12d
subl $0x1, %r12d
jb 0x28c4
pushq $0x50
popq %rdi
callq 0x20c0
movq %rax, %r13
movq %rax, %rdi
movl %ebx, %esi
callq 0x4914
movq %r13, 0x8(%rsp)
movq %r13, (%rsp)
movq %r15, %rdi
movq %rsp, %rsi
callq 0x2fca
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2ff8
testb $0x1, %bpl
je 0x2854
callq 0x22e0
movl %eax, %r13d
andl $0x1, %r13d
callq 0x22e0
leal (,%r13,4), %ecx
leaq 0x59e7(%rip), %rdx      # 0x81d8
cvtsi2ssl (%rcx,%rdx), %xmm0
testb $0x1, %al
jne 0x2801
xorps 0x280f(%rip), %xmm0     # 0x5010
xorl $0x1, %r13d
movss 0x2813(%rip), %xmm2     # 0x5020
mulss %xmm2, %xmm0
shll $0x2, %r13d
leaq 0x59bc(%rip), %rax      # 0x81d8
cvtsi2ssl (%r13,%rax), %xmm1
movss %xmm0, (%rsp,%rcx)
movaps %xmm1, %xmm0
mulss 0x27f1(%rip), %xmm0     # 0x5024
mulss %xmm2, %xmm1
callq 0x3003
movss %xmm0, (%rsp,%r13)
movq 0x8(%rsp), %rdi
movss (%rsp), %xmm0
movss 0x4(%rsp), %xmm1
jmp 0x2863
movq 0x8(%rsp), %rdi
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
callq 0x34bc
movss 0x27b8(%rip), %xmm0     # 0x5028
movss 0x27b4(%rip), %xmm1     # 0x502c
callq 0x3003
movss %xmm0, 0x14(%rsp)
movss 0x279d(%rip), %xmm0     # 0x5028
movss 0x2799(%rip), %xmm1     # 0x502c
callq 0x3003
movaps %xmm0, %xmm1
movq 0x8(%rsp), %r13
leaq 0x18(%rsp), %rdi
movss 0x14(%rsp), %xmm0
callq 0x4762
movsd 0x18(%rsp), %xmm0
movq (%r13), %rax
movq %r13, %rdi
callq *(%rax)
jmp 0x2787
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x50
popq %rsi
movq %r13, %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2230
nop
// File: /workspace/github_c_makefile_star2_O2/rroa[P]PUCMM_2D_Asteroids/Asteroids/Game.cpp
// Function: Engine::Game::OnUpdate()
void Game::OnUpdate()
	{
		double startTime = m_timer->GetElapsedTimeInSeconds();

		// Updating the entities
		//
		std::list< Asteroids::Entity* >::iterator ait = m_entities.begin();
		while (ait != m_entities.end())
		{
			(*ait)->Update(DESIRED_FRAME_TIME, m_width, m_height);
			++ait;
		}

		if(m_player)
		{
			if (up)
				m_player->MoveUp();
			if (left)
				m_player->RotateLeft(DESIRED_FRAME_TIME);
			if (right)
				m_player->RotateRight(DESIRED_FRAME_TIME);

			m_player->Update(DESIRED_FRAME_TIME, m_width, m_height);

			// Checking collision between the entities
			//
			CheckCollision();

			// Checking for entities marked as collided or for deletion
			//
			CleanEntities();
		}

		double endTime = m_timer->GetElapsedTimeInSeconds();
		double nextTimeFrame = startTime + DESIRED_FRAME_TIME;

		while (endTime < nextTimeFrame)
		{
			// Spin lock
			endTime = m_timer->GetElapsedTimeInSeconds();
		}

		//double elapsedTime = endTime - startTime;        

		m_lastFrameTime = m_timer->GetElapsedTimeInSeconds();

		m_nUpdates++;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0xa8(%rdi), %rdi
callq 0x4c1c
movsd %xmm0, (%rsp)
leaq 0x90(%rbx), %r14
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x2933
movq 0x10(%r15), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq (%rdi), %rax
movss 0x2702(%rip), %xmm0     # 0x5030
callq *0x8(%rax)
jmp 0x2911
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x29a6
cmpb $0x1, 0x5892(%rip)      # 0x81d5
jne 0x294e
callq 0x4174
movq 0x58(%rbx), %rdi
cmpb $0x1, 0x5881(%rip)      # 0x81d6
jne 0x2968
movss 0x26d1(%rip), %xmm0     # 0x5030
callq 0x41ba
movq 0x58(%rbx), %rdi
cmpb $0x1, 0x5868(%rip)      # 0x81d7
jne 0x2982
movss 0x26b7(%rip), %xmm0     # 0x5030
callq 0x41a6
movq 0x58(%rbx), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq (%rdi), %rax
movss 0x269d(%rip), %xmm0     # 0x5030
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x2e34
movq %rbx, %rdi
callq 0x2ce4
movq 0xa8(%rbx), %rdi
callq 0x4c1c
movsd (%rsp), %xmm1
addsd 0x2689(%rip), %xmm1     # 0x5048
movsd %xmm1, (%rsp)
movsd %xmm0, 0x8(%rsp)
movq 0xa8(%rbx), %rdi
callq 0x4c1c
movsd (%rsp), %xmm1
ucomisd 0x8(%rsp), %xmm1
ja 0x29c4
movsd %xmm0, 0x18(%rbx)
incl 0x10(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x262e(%rip), %xmm0     # 0x5034
movss 0x262a(%rip), %xmm2     # 0x5038
movss 0x2626(%rip), %xmm3     # 0x503c
movaps %xmm0, %xmm1
callq 0x20b0
movl $0x4000, %edi           # imm = 0x4000
callq 0x21f0
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x2a37
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x90(%rbx), %r14
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x2a5b
movq 0x10(%r15), %rdi
cmpl $0x0, 0x1c(%rdi)
jne 0x2a41
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x2a41
movq 0x40(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2140
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x2aa0
pushq $0x1
popq %rbp
testb %al, %al
je 0x2a94
callq 0x2b54
testb %al, %al
je 0x2a94
movq %rbx, %rdi
callq 0x2ba0
movb $0x1, %al
pushq $0x2
popq %rbp
jmp 0x2a96
xorl %eax, %eax
movl %ebp, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2360
testl %eax, %eax
js 0x2b12
pushq $0x5
popq %rdi
pushq $0x1
popq %rsi
callq 0x2320
pushq $0x6
popq %rdi
pushq $0x18
popq %rsi
callq 0x2320
movq 0x20(%rbx), %rdi
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %r8d
pushq $0x26
popq %r9
movl $0x2fff0000, %esi       # imm = 0x2FFF0000
movl $0x2fff0000, %edx       # imm = 0x2FFF0000
callq 0x2180
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x2b2f
movq %rax, %rdi
callq 0x2270
movq %rax, 0x48(%rbx)
movq 0x40(%rbx), %rdi
movq %rax, %rsi
callq 0x2280
xorl %edi, %edi
callq 0x21d0
movb $0x1, %al
jmp 0x2b51
movq 0x54d7(%rip), %rdi      # 0x7ff0
leaq 0x2571(%rip), %rsi      # 0x5091
callq 0x2200
movq %rax, %rdi
callq 0x22f0
jmp 0x2b4f
movq 0x54ba(%rip), %rdi      # 0x7ff0
leaq 0x2567(%rip), %rsi      # 0x50a4
callq 0x2200
movq %rax, %rdi
callq 0x22f0
callq 0x2130
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
callq 0x2350
movl %eax, %ebx
testl %eax, %eax
je 0x2b93
movq 0x5486(%rip), %rdi      # 0x7ff0
leaq 0x254c(%rip), %rsi      # 0x50bd
callq 0x2200
movq %rax, %r14
movl %ebx, %edi
callq 0x20f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x2200
movq %rax, %rdi
callq 0x22f0
testl %ebx, %ebx
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x246a(%rip), %xmm0     # 0x5020
mulss %xmm0, %xmm1
movaps %xmm1, (%rsp)
cvtsi2ss %ecx, %xmm1
mulss %xmm0, %xmm1
movaps %xmm1, 0x10(%rsp)
xorl %edi, %edi
xorl %esi, %esi
callq 0x2170
movl $0x1701, %edi           # imm = 0x1701
callq 0x2090
callq 0x20e0
movaps 0x2426(%rip), %xmm2     # 0x5010
movaps (%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
xorps %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
movaps 0x10(%rsp), %xmm3
xorps %xmm3, %xmm2
cvtss2sd %xmm2, %xmm2
cvtss2sd %xmm3, %xmm3
movsd 0x243f(%rip), %xmm4     # 0x5050
movsd 0x243f(%rip), %xmm5     # 0x5058
callq 0x2100
movl $0x1700, %edi           # imm = 0x1700
addq $0x28, %rsp
jmp 0x2090
// File: /workspace/github_c_makefile_star2_O2/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 0x2cae
movq %rdi, %rbx
leaq 0x4f53(%rip), %rax      # 0x7bd8
leaq 0x50dc(%rip), %rdx      # 0x7d68
movq %rsi, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x22d0
testq %rax, %rax
je 0x2cae
movq %rax, %r14
movq %rax, %rdi
callq 0x4b12
cmpl $0x2, %eax
jne 0x2cb6
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x4b12
cmpl $0x1, %eax
pushq $0x2
popq %rdx
movl %edx, %esi
sbbl $0x0, %esi
movss 0x8(%r14), %xmm0
movss 0xc(%r14), %xmm1
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2744
// File: /workspace/github_c_makefile_star2_O2/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 %rcx, %rax
movq (%rax), %rax
cmpq %rcx, %rax
je 0x2d0d
movq 0x10(%rax), %rdx
movl 0x1c(%rdx), %edx
decl %edx
cmpl $0x1, %edx
ja 0x2cee
movq 0x10(%rax), %rsi
jmp 0x2d0e
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rdi, %rbx
leaq 0x10(%rsp), %r13
movq %rsi, (%r13)
leaq 0x90(%rdi), %rbp
movq 0x90(%rdi), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x336d
movq %rax, %r15
leaq 0x60(%rbx), %r12
movq 0x60(%rbx), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3384
movq %rax, (%rsp)
leaq 0x78(%rbx), %r14
movq 0x78(%rbx), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x339b
movq %rax, 0x8(%rsp)
movq (%r13), %rdi
pushq $0x28
popq %rsi
callq 0x20a0
movq 0x58(%rbx), %rax
cmpq (%r13), %rax
jne 0x2d8e
andq $0x0, 0x58(%rbx)
cmpq $0x0, 0xa0(%rbx)
setne %al
cmpq %rbp, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2db1
movq %rbp, %rdi
movq %r15, %rsi
callq 0x303e
cmpq $0x0, 0x70(%rbx)
setne %al
movq (%rsp), %rsi
cmpq %r12, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2dd2
movq %r12, %rdi
callq 0x304c
cmpq $0x0, 0x88(%rbx)
setne %al
movq 0x8(%rsp), %rsi
cmpq %r14, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2df7
movq %r14, %rdi
callq 0x305a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x60(%rdi), %r14
leaq 0x78(%rdi), %r15
pushq $0xa
popq %rbp
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0x2eba
movq 0x10(%r12), %rsi
cmpl $0x0, 0x1c(%rsi)
jne 0x2e50
movq 0x58(%rbx), %rdi
cmpl $0x0, 0x1c(%rdi)
jne 0x2e50
callq 0x34c8
movq %r15, %r13
testb %al, %al
je 0x2e87
movq 0x10(%r12), %rsi
movq %rbx, %rdi
callq 0x2c72
movq (%r13), %r13
cmpq %r15, %r13
je 0x2e50
movq 0x10(%r13), %rsi
cmpl $0x0, 0x1c(%rsi)
jne 0x2e87
movq 0x10(%r12), %rdi
cmpl $0x0, 0x1c(%rdi)
jne 0x2e87
callq 0x34c8
testb %al, %al
je 0x2e87
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2e06
jmp 0x2e7a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x1bca(%rip), %xmm3     # 0x5020
cvtsi2ss %edx, %xmm1
mulss %xmm3, %xmm4
mulss %xmm3, %xmm1
movaps 0x1ba7(%rip), %xmm3     # 0x5010
movaps %xmm4, %xmm5
xorps %xmm3, %xmm5
xorps %xmm1, %xmm3
ucomiss %xmm2, %xmm5
jbe 0x3484
subss %xmm2, %xmm5
subss %xmm5, %xmm4
movaps %xmm4, %xmm2
jmp 0x3491
ucomiss %xmm4, %xmm2
jbe 0x3491
subss %xmm4, %xmm2
subss %xmm4, %xmm2
movss %xmm2, 0x8(%rdi)
ucomiss %xmm0, %xmm3
jbe 0x34a8
subss %xmm0, %xmm3
subss %xmm3, %xmm1
movaps %xmm1, %xmm0
jmp 0x34b5
ucomiss %xmm1, %xmm0
jbe 0x34b5
subss %xmm1, %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0xc(%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x3408
leaq 0x46d9(%rip), %rax      # 0x7bf8
movq %rax, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r14)
movups %xmm0, 0x34(%r14)
movl $0x437a0000, 0x44(%r14) # imm = 0x437A0000
orl $-0x1, 0x4c(%r14)
leaq 0x28(%r14), %rbx
movl $0x3f000000, 0x18(%r14) # imm = 0x3F000000
movl $0x41200000, 0x20(%r14) # imm = 0x41200000
movq %r14, %rdi
callq 0x3574
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3106
movq %r14, %rdi
callq 0x2230
nop
// File: /workspace/github_c_makefile_star2_O2/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
sqrtss %xmm3, %xmm2
andps 0xf91(%rip), %xmm2      # 0x5180
xorl %eax, %eax
ucomiss 0xf70(%rip), %xmm2      # 0x5168
seta %al
pshufd $0x0, %xmm2, %xmm3      # xmm3 = xmm2[0,0,0,0]
movaps %xmm1, %xmm4
divps %xmm3, %xmm4
mulps 0xf83(%rip), %xmm4      # 0x5190
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 0xf3b(%rip), %xmm3      # 0x5170
movlps %xmm3, 0x10(%rdi)
jmp 0x3432
// File: /workspace/github_c_makefile_star2_O2/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 0x20e0
movss 0x8(%rbx), %xmm0
movss 0xc(%rbx), %xmm1
xorps %xmm2, %xmm2
callq 0x2120
movss 0x40(%rbx), %xmm0
movss 0xdd3(%rip), %xmm3      # 0x503c
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x2290
pushq $0x2
popq %rdi
callq 0x2310
movq 0x28(%rbx), %r14
cmpq 0x30(%rbx), %r14
je 0x429c
movss (%r14), %xmm0
movss 0x4(%r14), %xmm1
callq 0x21b0
addq $0x8, %r14
jmp 0x4280
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22b0
// File: /workspace/github_c_makefile_star2_O2/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 0xe9d(%rip), %xmm1      # 0x515c
movq 0x28(%rdi), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
mulss 0xe8a(%rip), %xmm1      # 0x5160
movss %xmm1, (%rsp)
movaps %xmm1, %xmm0
callq 0x2260
movss %xmm0, 0x14(%rsp)
movq 0x28(%rbx), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movss (%rsp), %xmm0
callq 0x2040
movss %xmm0, 0x10(%rsp)
movss 0x48(%rbx), %xmm0
movss %xmm0, 0x8(%rsp)
movss (%rsp), %xmm0
callq 0x2260
movss %xmm0, 0xc(%rsp)
movss 0x48(%rbx), %xmm0
movss %xmm0, 0x4(%rsp)
movss (%rsp), %xmm0
callq 0x2040
movss %xmm0, (%rsp)
pushq $0x30
popq %rdi
callq 0x20c0
movq %rax, %r14
movq %rax, %rdi
callq 0x4864
movss 0xe14(%rip), %xmm0      # 0x516c
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 0x34bc
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movss 0x8(%rsp), %xmm0
movss 0x4(%rsp), %xmm1
callq 0x4762
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
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2230
nop
// File: /workspace/github_c_makefile_star2_O2/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 $0x100, %eax            # imm = 0x100
je 0x4683
cmpl $0x402, %eax            # imm = 0x402
je 0x4640
cmpl $0x201, %eax            # imm = 0x201
je 0x467e
cmpl $0x300, %eax            # imm = 0x300
je 0x4668
cmpl $0x301, %eax            # imm = 0x301
je 0x45e1
cmpl $0x400, %eax            # imm = 0x400
je 0x4605
cmpl $0x401, %eax            # imm = 0x401
je 0x45fc
cmpl $0x200, %eax            # imm = 0x200
jne 0x4649
addq $0x28, %rsp
jmp 0x4690
movq (%rdi), %rax
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq *0x30(%rax)
jmp 0x467e
addq $0x28, %rsp
jmp 0x46fe
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 0x467e
addq $0x28, %rsp
jmp 0x4728
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
movq (%rdi), %rax
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq *0x28(%rax)
addq $0x28, %rsp
retq
movq (%rdi), %rax
addq $0x28, %rsp
jmpq *0xa8(%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x20e0
movss 0x977(%rip), %xmm0      # 0x5260
callq 0x2150
movl $0xb10, %edi            # imm = 0xB10
callq 0x21e0
xorl %edi, %edi
callq 0x2310
movss 0x8(%rbx), %xmm0
movss 0xc(%rbx), %xmm1
callq 0x21b0
popq %rbx
jmp 0x22b0
// File: /workspace/github_c_makefile_star2_O2/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 0x3408
leaq 0x341f(%rip), %rax      # 0x7d50
movq %rax, (%rbx)
leaq 0x28(%rbx), %r14
xorps %xmm0, %xmm0
andq $0x0, 0x38(%rbx)
movups %xmm0, 0x28(%rbx)
movl %ebp, 0x40(%rbx)
movsd 0x931(%rip), %xmm0      # 0x5280
movsd %xmm0, 0x48(%rbx)
incl %ebp
cvtsi2ss %ebp, %xmm0
movl %ebp, 0x44(%rbx)
movss 0x92b(%rip), %xmm1      # 0x5290
divss %xmm0, %xmm1
movss 0x923(%rip), %xmm2      # 0x5294
divss %xmm0, %xmm2
movss %xmm2, 0xc(%rsp)
movss %xmm1, (%rsp)
subss %xmm1, %xmm2
movss %xmm2, 0x10(%rsp)
xorl %r12d, %r12d
leaq 0x18(%rsp), %r15
cmpq $0x10, %r12
je 0x4a2a
cvtsi2ss %r12, %xmm0
mulss 0x8ef(%rip), %xmm0      # 0x5298
addss %xmm0, %xmm0
mulss 0x8e7(%rip), %xmm0      # 0x529c
movss %xmm0, 0x8(%rsp)
callq 0x22e0
cvtsi2ss %eax, %xmm0
mulss 0x674(%rip), %xmm0      # 0x5040
mulss 0x10(%rsp), %xmm0
addss (%rsp), %xmm0
movss %xmm0, 0x4(%rsp)
movss 0x8(%rsp), %xmm0
callq 0x2040
mulss 0x4(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x8(%rsp), %xmm0
callq 0x2260
movss 0x4(%rsp), %xmm1
mulss %xmm0, %xmm1
movq %r15, %rdi
movss 0x14(%rsp), %xmm0
callq 0x4762
movq %r14, %rdi
movq %r15, %rsi
callq 0x43f4
incq %r12
jmp 0x4992
movss (%rsp), %xmm0
addss 0xc(%rsp), %xmm0
mulss 0x5e3(%rip), %xmm0      # 0x5020
movss %xmm0, 0x20(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x3106
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_c_makefile_star2_O2/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 0x4bcd
leaq 0x28(%rbx), %rdi
xorl %esi, %esi
callq 0x21a0
cvtsi2sdq 0x18(%rbx), %xmm1
cvtsi2sdq 0x20(%rbx), %xmm0
movsd 0x6d7(%rip), %xmm2      # 0x52b8
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
cvtsi2sdq 0x28(%rbx), %xmm0
cvtsi2sdq 0x30(%rbx), %xmm3
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
movsd %xmm0, 0x8(%rbx)
subsd %xmm1, %xmm0
popq %rbx
retq