LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/skeeto[P]flappy/sqlite3.c
// Function: pcache1Create
static sqlite3_pcache *pcache1Create(int szPage, int szExtra, int bPurgeable){
  PCache1 *pCache;      /* The newly created page cache */
  PGroup *pGroup;       /* The group the new page cache will belong to */
  int sz;               /* Bytes of memory required to allocate the new cache */

  /*
  ** The separateCache variable is true if each PCache has its own private
  ** PGroup.  In other words, separateCache is true for mode (1) where no
  ** mutexing is required.
  **
  **   *  Always use a unified cache (mode-2) if ENABLE_MEMORY_MANAGEMENT
  **
  **   *  Always use a unified cache in single-threaded applications
  **
  **   *  Otherwise (if multi-threaded and ENABLE_MEMORY_MANAGEMENT is off)
  **      use separate caches (mode-1)
  */
#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || SQLITE_THREADSAFE==0
  const int separateCache = 0;
#else
  int separateCache = sqlite3GlobalConfig.bCoreMutex>0;
#endif

  assert( (szPage & (szPage-1))==0 && szPage>=512 && szPage<=65536 );
  assert( szExtra < 300 );

  sz = sizeof(PCache1) + sizeof(PGroup)*separateCache;
  pCache = (PCache1 *)sqlite3MallocZero(sz);
  if( pCache ){
    if( separateCache ){
      pGroup = (PGroup*)&pCache[1];
      pGroup->mxPinned = 10;
    }else{
      pGroup = &pcache1.grp;
    }
    pCache->pGroup = pGroup;
    pCache->szPage = szPage;
    pCache->szExtra = szExtra;
    pCache->bPurgeable = (bPurgeable ? 1 : 0);
    if( bPurgeable ){
      pCache->nMin = 10;
      pcache1EnterMutex(pGroup);
      pGroup->nMinPage += pCache->nMin;
      pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage;
      pcache1LeaveMutex(pGroup);
    }
  }
  return (sqlite3_pcache *)pCache;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %r15d
movl 0x1e32f(%rip), %r13d    # 0x89294
testl %r13d, %r13d
movl $0x60, %eax
movl $0x38, %r12d
cmovgl %eax, %r12d
movl %r12d, %edi
callq 0xa35e
movq %rax, %rbx
testq %rax, %rax
je 0x6b00c
movl %r12d, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7180
testl %r13d, %r13d
jle 0x6afad
movq %rbx, %r12
addq $0x38, %r12
movl $0xa, 0x48(%rbx)
jmp 0x6afb4
leaq 0x1ff8c(%rip), %r12     # 0x8af40
movq %r12, (%rbx)
movl %r15d, 0x8(%rbx)
movl %r14d, 0xc(%rbx)
xorl %eax, %eax
testl %ebp, %ebp
setne %al
movl %eax, 0x10(%rbx)
je 0x6b00c
movl $0xa, 0x14(%rbx)
movq (%r12), %rdi
testq %rdi, %rdi
je 0x6afe1
callq *0x1e337(%rip)          # 0x89318
movl 0xc(%r12), %eax
addl 0x14(%rbx), %eax
movl %eax, 0xc(%r12)
movl 0x8(%r12), %ecx
subl %eax, %ecx
addl $0xa, %ecx
movl %ecx, 0x10(%r12)
movq (%r12), %rdi
testq %rdi, %rdi
je 0x6b00c
callq *0x1e31c(%rip)          # 0x89328
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/skeeto[P]flappy/sqlite3.c
// Function: pcache1Pagecount
static int pcache1Pagecount(sqlite3_pcache *p){
  int n;
  PCache1 *pCache = (PCache1*)p;
  pcache1EnterMutex(pCache->pGroup);
  n = pCache->nPage;
  pcache1LeaveMutex(pCache->pGroup);
  return n;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6b0a7
callq *0x1e271(%rip)          # 0x89318
movl 0x28(%rbx), %ebp
movq (%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6b0bb
callq *0x1e26d(%rip)          # 0x89328
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/skeeto[P]flappy/sqlite3.c
// Function: pcache1Rekey
static void pcache1Rekey(
  sqlite3_pcache *p,
  sqlite3_pcache_page *pPg,
  unsigned int iOld,
  unsigned int iNew
){
  PCache1 *pCache = (PCache1 *)p;
  PgHdr1 *pPage = (PgHdr1 *)pPg;
  PgHdr1 **pp;
  unsigned int h; 
  assert( pPage->iKey==iOld );
  assert( pPage->pCache==pCache );

  pcache1EnterMutex(pCache->pGroup);

  h = iOld%pCache->nHash;
  pp = &pCache->apHash[h];
  while( (*pp)!=pPage ){
    pp = &(*pp)->pNext;
  }
  *pp = pPage->pNext;

  h = iNew%pCache->nHash;
  pPage->iKey = iNew;
  pPage->pNext = pCache->apHash[h];
  pCache->apHash[h] = pPage;
  if( iNew>pCache->iMaxKey ){
    pCache->iMaxKey = iNew;
  }

  pcache1LeaveMutex(pCache->pGroup);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6b4f9
callq *0x1de1f(%rip)          # 0x89318
movl 0x2c(%r14), %ecx
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
shlq $0x3, %rdx
addq 0x30(%r14), %rdx
movq %rdx, %rax
movq (%rdx), %rsi
leaq 0x18(%rsi), %rdx
cmpq %r15, %rsi
jne 0x6b50b
movq 0x18(%r15), %rdx
movq %rdx, (%rax)
movl %ebx, %eax
xorl %edx, %edx
divl %ecx
movl %ebx, 0x10(%r15)
movq 0x30(%r14), %rax
movq (%rax,%rdx,8), %rcx
movq %rcx, 0x18(%r15)
movq %r15, (%rax,%rdx,8)
cmpl %ebx, 0x20(%r14)
jae 0x6b545
movl %ebx, 0x20(%r14)
movq (%r14), %rax
movq (%rax), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0x6b560
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x1ddc8(%rip)          # 0x89328
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/skeeto[P]flappy/sqlite3.c
// Function: pcache1Truncate
static void pcache1Truncate(sqlite3_pcache *p, unsigned int iLimit){
  PCache1 *pCache = (PCache1 *)p;
  pcache1EnterMutex(pCache->pGroup);
  if( iLimit<=pCache->iMaxKey ){
    pcache1TruncateUnsafe(pCache, iLimit);
    pCache->iMaxKey = iLimit-1;
  }
  pcache1LeaveMutex(pCache->pGroup);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6b580
callq *0x1dd98(%rip)          # 0x89318
cmpl %ebp, 0x20(%rbx)
jb 0x6b594
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6b75b
decl %ebp
movl %ebp, 0x20(%rbx)
movq (%rbx), %rax
movq (%rax), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0x6b5ab
popq %rbx
popq %rbp
jmpq *0x1dd7d(%rip)          # 0x89328
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/main.c
// Function: updateWindow
void
updateWindow()
{
	glXSwapBuffers(dpy, window);
	while(XPending(dpy)) {
		XEvent xev;
		XNextEvent(dpy, &xev);
		switch(xev.type) {
		case ClientMessage:
			if(xev.xclient.data.l[0] == wmDeleteWindow)
				running = 0;
			break;
		case ConfigureNotify:
			if(windowWidth != xev.xconfigure.width || windowHeight != xev.xconfigure.height) {
				windowWidth = xev.xconfigure.width;
				windowHeight = xev.xconfigure.height;

				resizeRenderingSystem(windowWidth, windowHeight);
			}
			break;

		case KeyPress:
			processKeyState(&xev, 1);
			break;
		case KeyRelease:
			processKeyState(&xev, 0);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xc8, %rsp
movq 0x8ef8(%rip), %rdi      # 0xb5a0
movq 0x8f21(%rip), %rsi      # 0xb5d0
callq 0x21d0
movq 0x8ee5(%rip), %rdi      # 0xb5a0
callq 0x22a0
testl %eax, %eax
je 0x2773
leaq -0xc8(%rbp), %rbx
movq 0x8eca(%rip), %rdi      # 0xb5a0
movq %rbx, %rsi
callq 0x2200
movl -0xc8(%rbp), %eax
cmpl $0x15, %eax
jg 0x26fa
cmpl $0x2, %eax
je 0x271d
cmpl $0x3, %eax
jne 0x275f
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x2725
cmpl $0x16, %eax
je 0x272c
cmpl $0x21, %eax
jne 0x275f
movq -0x90(%rbp), %rax
cmpq 0x8eae(%rip), %rax      # 0xb5c0
jne 0x275f
movb $0x0, 0x8ec5(%rip)      # 0xb5e0
jmp 0x275f
movq %rbx, %rdi
movl $0x1, %esi
callq 0x277d
jmp 0x275f
movl -0x90(%rbp), %edi
cmpl %edi, 0x8e90(%rip)      # 0xb5c8
jne 0x2748
movl 0x8e8c(%rip), %eax      # 0xb5cc
cmpl -0x8c(%rbp), %eax
je 0x275f
movl %edi, 0x8e7a(%rip)      # 0xb5c8
movl -0x8c(%rbp), %esi
movl %esi, 0x8e72(%rip)      # 0xb5cc
callq 0x519b
movq 0x8e3a(%rip), %rdi      # 0xb5a0
callq 0x22a0
testl %eax, %eax
jne 0x26cf
addq $0xc8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/main.c
// Function: processKeyState
void
processKeyState(XEvent *xev, unsigned char state)
{
	if(XLookupKeysym(&xev->xkey, 0) == XK_Left)   keyLeft = state;
	if(XLookupKeysym(&xev->xkey, 0) == XK_Right)  keyRight = state;
	if(XLookupKeysym(&xev->xkey, 0) == XK_Up)     keyUp = state;
	if(XLookupKeysym(&xev->xkey, 0) == XK_Down)   keyDown = state;
	if(XLookupKeysym(&xev->xkey, 0) == XK_w)      keyFront = state;
	if(XLookupKeysym(&xev->xkey, 0) == XK_s)      keyBack = state;
	if(XLookupKeysym(&xev->xkey, 0) == XK_space)  keySpace = state;
	if(XLookupKeysym(&xev->xkey, 0) == XK_Shift_L) keyShift = state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
xorl %esi, %esi
callq 0x2030
cmpq $0xff51, %rax           # imm = 0xFF51
jne 0x27a0
movb %r14b, 0x8e41(%rip)     # 0xb5e1
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
cmpq $0xff53, %rax           # imm = 0xFF53
jne 0x27b9
movb %r14b, 0x8e29(%rip)     # 0xb5e2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
cmpq $0xff52, %rax           # imm = 0xFF52
jne 0x27d2
movb %r14b, 0x8e11(%rip)     # 0xb5e3
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
cmpq $0xff54, %rax           # imm = 0xFF54
jne 0x27eb
movb %r14b, 0x8df9(%rip)     # 0xb5e4
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
cmpq $0x77, %rax
jne 0x2802
movb %r14b, 0x8de3(%rip)     # 0xb5e5
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
cmpq $0x73, %rax
jne 0x2819
movb %r14b, 0x8dcd(%rip)     # 0xb5e6
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
cmpq $0x20, %rax
jne 0x2830
movb %r14b, 0x8db7(%rip)     # 0xb5e7
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/main.c
// Function: terminateWindow
void
terminateWindow()
{
	glXMakeCurrent(dpy, None, None);
	glXDestroyContext(dpy, glContext);
	XDestroyWindow(dpy, window);
	XCloseDisplay(dpy);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8d57(%rip), %rdi      # 0xb5a0
xorl %esi, %esi
xorl %edx, %edx
callq 0x2040
movq 0x8d47(%rip), %rdi      # 0xb5a0
movq 0x8d78(%rip), %rsi      # 0xb5d8
callq 0x2140
movq 0x8d34(%rip), %rdi      # 0xb5a0
movq 0x8d5d(%rip), %rsi      # 0xb5d0
callq 0x21b0
movq 0x8d21(%rip), %rdi      # 0xb5a0
popq %rbp
jmp 0x21c0
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/main.c
// Function: main
int
main(int argc, char *argv[])
{
	initWindow();
	startClock();
	initRenderingSystem();

	createWorld(32, 4, 32);

	running = 1;

	while(running) {
		double startProcess, endProcess;
		startProcess = getCurrentTimeNano();
		
		processCamera(1.0/60.0, 5.0/60.0);
		
		setCamera(cameraEye, cameraNormal, cameraLook);
		render(cameraPosition[0], cameraPosition[1], cameraPosition[2]);
		
		updateWindow();

		endProcess = getCurrentTimeNano();
		sleepNanosec((1.0 / FRAMES_PER_SEC) - (endProcess - startProcess));
	}
	terminateWindow();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x23bc
xorl %eax, %eax
callq 0x4b48
xorl %eax, %eax
callq 0x4dd0
movl $0x20, %edi
movl $0x4, %esi
movl $0x20, %edx
callq 0x68bf
movb $0x1, 0x8946(%rip)      # 0xb5e0
leaq 0x89a7(%rip), %rbx      # 0xb648
leaq 0x8554(%rip), %r14      # 0xb1fc
leaq 0x89a5(%rip), %r15      # 0xb654
xorl %eax, %eax
callq 0x4b77
movsd %xmm0, -0x20(%rbp)
movss 0x4361(%rip), %xmm0     # 0x7024
movss 0x435d(%rip), %xmm1     # 0x7028
callq 0x2885
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5b6f
movss 0x850a(%rip), %xmm0     # 0xb1f0
movss 0x8506(%rip), %xmm1     # 0xb1f4
movss 0x8502(%rip), %xmm2     # 0xb1f8
callq 0x5910
callq 0x2695
xorl %eax, %eax
callq 0x4b77
movsd -0x20(%rbp), %xmm1
subsd %xmm0, %xmm1
addsd 0x42f8(%rip), %xmm1     # 0x7010
movapd %xmm1, %xmm0
callq 0x4bc0
cmpb $0x0, 0x88b8(%rip)      # 0xb5e0
jne 0x2caf
callq 0x283e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/glutil.c
// Function: loadShader
unsigned int
loadShader(const char *path, unsigned int type)
{
	char *fileData;
	int   size;

	FILE *fp = fopen(path, "r");
	if(!fp) {
		printf("Could not open the shader %s\n", path);
		return -1;
	}
	fseek(fp, 0, SEEK_END);
	size = ftell(fp);
	fseek(fp, 0, SEEK_SET);
	fileData = malloc(size);
	fread(fileData, 1, size, fp);
	fclose(fp);

	unsigned int shader = glCreateShader(type);
	glShaderSource(shader, 1, (const char* const*)&fileData, &size);
	glCompileShader(shader);
	
	int cmp;
	glGetShaderiv(shader, GL_COMPILE_STATUS, &cmp);
	if(!cmp) 
	{
		glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &cmp);
		char* data = malloc(cmp);
		glGetShaderInfoLog(shader, cmp, &cmp, data);
		printf("Shader compilation failure! Shader path: %s\nLog: %s\n", path, data);
		free(data);
	}
	
	free(fileData);
	return shader;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x455c(%rip), %rsi      # 0x72b6
callq 0x2120
testq %rax, %rax
je 0x2e73
movq %rax, %r15
movq %rbx, -0x38(%rbp)
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x20b0
movq %r15, %rdi
callq 0x2070
leaq -0x44(%rbp), %r12
movl %eax, (%r12)
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x20b0
movslq (%r12), %r13
movq %r13, %rdi
callq 0x2110
leaq -0x40(%rbp), %rbx
movq %rax, (%rbx)
movl $0x1, %esi
movq %rax, %rdi
movq %r13, %rdx
movq %r15, %rcx
callq 0x2230
movq %r15, %rdi
callq 0x2260
leaq 0x8a81(%rip), %rax      # 0xb850
movl %r14d, %edi
callq *(%rax)
movl %eax, %r14d
leaq 0x8ff2(%rip), %rax      # 0xbdd0
movl %r14d, %edi
movl $0x1, %esi
movq %rbx, %rdx
movq %r12, %rcx
callq *(%rax)
leaq 0x89eb(%rip), %rax      # 0xb7e0
movl %r14d, %edi
callq *(%rax)
leaq 0x8d3f(%rip), %r15      # 0xbb40
leaq -0x2c(%rbp), %rbx
movl %r14d, %edi
movl $0x8b81, %esi           # imm = 0x8B81
movq %rbx, %rdx
callq *(%r15)
cmpl $0x0, (%rbx)
jne 0x2e68
movl %r14d, %edi
movl $0x8b84, %esi           # imm = 0x8B84
movq %rbx, %rdx
callq *(%r15)
movl (%rbx), %eax
movslq %eax, %r15
movq %r15, %rdi
callq 0x2110
movq %rax, %r12
leaq 0x8cf3(%rip), %rax      # 0xbb30
movl %r14d, %edi
movl %r15d, %esi
movq %rbx, %rdx
movq %r12, %rcx
callq *(%rax)
leaq 0x4339(%rip), %rdi      # 0x718b
movq -0x38(%rbp), %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2060
movq %r12, %rdi
callq 0x2190
movq -0x40(%rbp), %rdi
callq 0x2190
jmp 0x2e8a
leaq 0x42f3(%rip), %rdi      # 0x716d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2060
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/glutil.c
// Function: createProgram
unsigned int
createProgram(unsigned int shaders[])
{
	unsigned int* shaderPtr = shaders;
	unsigned int program = glCreateProgram();

	while(*shaderPtr) {
		glAttachShader(program, *shaderPtr);
		shaderPtr++;
	}

	glLinkProgram(program);
	shaderPtr = shaders;

	while(*shaderPtr) {
		glDetachShader(program, *shaderPtr);
		shaderPtr++;
	}

	return program;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x8997(%rip), %rax      # 0xb848
callq *(%rax)
movl %eax, %r14d
movl (%rbx), %esi
testl %esi, %esi
je 0x2ed9
leaq 0x4(%rbx), %r15
leaq 0x87d9(%rip), %r12      # 0xb6a0
movl %r14d, %edi
callq *(%r12)
movl (%r15), %esi
addq $0x4, %r15
testl %esi, %esi
jne 0x2ec7
leaq 0x8d90(%rip), %rax      # 0xbc70
movl %r14d, %edi
callq *(%rax)
movl (%rbx), %esi
testl %esi, %esi
je 0x2f06
addq $0x4, %rbx
leaq 0x89d2(%rip), %r15      # 0xb8c8
movl %r14d, %edi
callq *(%r15)
movl (%rbx), %esi
addq $0x4, %rbx
testl %esi, %esi
jne 0x2ef6
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/glutil.c
// Function: loadTextureFarbfeld
unsigned int
loadTextureFarbfeld(const char *path)
{
	unsigned int w, h;
	unsigned short *imageData = getFarbfeldImageData(path, &w, &h);
	if((intptr_t)imageData < 0) {
		return -2;
	}

	unsigned int texture;
	glGenTextures(1, &texture); 
	glBindTexture(GL_TEXTURE_2D, texture);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, w, h, 0, GL_RGBA, GL_UNSIGNED_SHORT, imageData);
	glBindTexture(GL_TEXTURE_2D, 0);
	
	free(imageData);
	return texture;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq -0x28(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0x4ca7
movq %rax, %rbx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testq %rbx, %rbx
js 0x2fda
leaq 0x8aa2(%rip), %rax      # 0xb9e8
leaq -0x2c(%rbp), %r14
movl $0x1, %edi
movq %r14, %rsi
callq *(%rax)
leaq 0x87ad(%rip), %r15      # 0xb708
movl (%r14), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq *(%r15)
leaq 0x8f2b(%rip), %r12      # 0xbe98
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2801, %esi           # imm = 0x2801
movl $0x2600, %edx           # imm = 0x2600
callq *(%r12)
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2800, %esi           # imm = 0x2800
movl $0x2600, %edx           # imm = 0x2600
callq *(%r12)
leaq 0x8ebe(%rip), %rax      # 0xbe58
movl -0x28(%rbp), %ecx
movl -0x24(%rbp), %r8d
subq $0x8, %rsp
movl $0xde1, %edi            # imm = 0xDE1
xorl %esi, %esi
movl $0x8058, %edx           # imm = 0x8058
xorl %r9d, %r9d
pushq %rbx
pushq $0x1403                 # imm = 0x1403
pushq $0x1908                 # imm = 0x1908
callq *(%rax)
addq $0x20, %rsp
movl $0xde1, %edi            # imm = 0xDE1
xorl %esi, %esi
callq *(%r15)
movq %rbx, %rdi
callq 0x2190
movl (%r14), %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/util.c
// Function: sleepNanosec
void
sleepNanosec(double time)
{
	struct timespec sleepTime;
	struct timespec sleptTime;

	sleepTime.tv_sec  = (unsigned long long)floor(time);
	sleepTime.tv_nsec = (time - sleepTime.tv_sec) * 1000000000.0;

	nanosleep(&sleepTime, &sleptTime);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movsd %xmm0, -0x8(%rbp)
callq 0x2270
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x3fda(%rip), %xmm0     # 0x8bc0
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
leaq -0x28(%rbp), %rdi
movsd -0x8(%rbp), %xmm1
subsd %xmm0, %xmm1
mulsd 0x3faa(%rip), %xmm1     # 0x8bb8
movq %rdx, (%rdi)
cvttsd2si %xmm1, %rax
movq %rax, 0x8(%rdi)
leaq -0x18(%rbp), %rsi
callq 0x2240
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/util.c
// Function: getFarbfeldImageData
unsigned short *
getFarbfeldImageData(const char *path, unsigned int *wi, unsigned int *hi)
{
	char header[9];
	unsigned int w, h;
	unsigned short *imageData;
	
	FILE *fp = fopen(path, "r");
	if(!fp) {
		printf("Could not open the image: %s\n", path);
		return (unsigned short*)-1;
	}

	fread(header, 8, 1, fp);

	fread(&w, sizeof(w), 1, fp);
	fread(&h, sizeof(h), 1, fp);

	w = bigEndianToHost32(w);
	h = bigEndianToHost32(h);

	imageData = malloc(4 * w * h * sizeof(short));
	fread(imageData, 1, sizeof(short) * w * h * 4, fp);
	
	for(unsigned int i = 0; i < w * h * 4; i++) {
		imageData[i] = bigEndianToHost16(imageData[i]);
	}
	*wi = w;
	*hi = h;
	fclose(fp);
	return imageData;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
leaq 0x25ee(%rip), %rsi      # 0x72b6
callq 0x2120
testq %rax, %rax
je 0x4da3
movq %rax, %r15
movq %r14, -0x30(%rbp)
movq %rbx, -0x38(%rbp)
leaq -0x49(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x2230
leaq -0x40(%rbp), %r12
movl $0x4, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r15, %rcx
callq 0x2230
leaq -0x3c(%rbp), %r13
movl $0x4, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %r15, %rcx
callq 0x2230
movl (%r12), %ebx
bswapl %ebx
movl %ebx, (%r12)
movl (%r13), %r14d
bswapl %r14d
movl %r14d, (%r13)
movl %ebx, %r13d
imull %r14d, %r13d
shll $0x2, %r13d
leaq (,%r13,2), %rdi
callq 0x2110
movq %rax, %r12
movq %r14, %rdx
imulq %rbx, %rdx
shlq $0x3, %rdx
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rcx
callq 0x2230
testl %r13d, %r13d
je 0x4d8c
movl %r13d, %eax
xorl %ecx, %ecx
rolw $0x8, (%r12,%rcx,2)
incq %rcx
cmpq %rcx, %rax
jne 0x4d7e
movq -0x30(%rbp), %rax
movl %ebx, (%rax)
movq -0x38(%rbp), %rax
movl %r14d, (%rax)
movq %r15, %rdi
callq 0x2260
jmp 0x4dbb
leaq 0x3e3b(%rip), %rdi      # 0x8be5
movq %r12, %rsi
xorl %eax, %eax
callq 0x2060
movq $-0x1, %r12
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/rendering.c
// Function: resizeRenderingSystem
void
resizeRenderingSystem(int w, int h)
{
	printf("Resizing to %dx%d (aspect: %f\n", w, h, (float)w/h);
	mat4x4_perspective(projectionMatrix, TO_RADIANS(70.0), (float)w/h, 0.01, 1000.0);
	glUseProgram(cubeRenderingShader);
	glUniformMatrix4fv(cubeUniformProjectionLocation, 1, GL_FALSE, &projectionMatrix[0][0]);
	glUseProgram(0);

	glViewport(0, 0, w, h);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
cvtsi2ss %edi, %xmm1
movl %esi, %r14d
cvtsi2ss %esi, %xmm0
divss %xmm0, %xmm1
movss %xmm1, -0x24(%rbp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x3df3(%rip), %rdi      # 0x8fc1
movl %ebx, %esi
movl %r14d, %edx
movb $0x1, %al
callq 0x2060
movss 0x3a5e(%rip), %xmm0     # 0x8c40
divss -0x24(%rbp), %xmm0
movss %xmm0, 0x70b1(%rip)     # 0xc2a0
leaq 0x70aa(%rip), %r15      # 0xc2a0
xorps %xmm0, %xmm0
movups %xmm0, 0x70a4(%rip)     # 0xc2a4
movl $0x3fb6cd8e, 0x70aa(%rip) # imm = 0x3FB6CD8E
movups %xmm0, 0x70a7(%rip)     # 0xc2b8
movsd 0x3a07(%rip), %xmm0     # 0x8c20
movups %xmm0, 0x70a8(%rip)     # 0xc2c8
movl $0xbca3d776, %eax       # imm = 0xBCA3D776
movq %rax, 0x70ac(%rip)      # 0xc2d8
leaq 0x6dad(%rip), %r12      # 0xbfe0
movl 0x7047(%rip), %edi      # 0xc280
callq *(%r12)
leaq 0x6d7c(%rip), %rax      # 0xbfc0
movl 0x7042(%rip), %edi      # 0xc28c
movl $0x1, %esi
xorl %edx, %edx
movq %r15, %rcx
callq *(%rax)
xorl %edi, %edi
callq *(%r12)
leaq 0x6fd5(%rip), %rax      # 0xc238
movq (%rax), %rax
xorl %edi, %edi
xorl %esi, %esi
movl %ebx, %edx
movl %r14d, %ecx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/rendering.c
// Function: generateChunkModelAroundPos
void 
generateChunkModelAroundPos(int x, int y, int z, unsigned int distance)
{
	int chunks = distance;
	x = x / WORLD_CHUNK_SIZE;
	y = y / WORLD_CHUNK_SIZE;
	z = z / WORLD_CHUNK_SIZE;

	for(int xc = x - chunks; xc < x + chunks; xc++) {
		for(int yc = y - chunks; yc < y + chunks; yc++) {
			for(int zc = z - chunks; zc < z + chunks; zc++) {
				const WorldChunk* chunk = getWorldChunk(xc, yc, zc);
				if(chunk == NULL) 
					continue;
				generateChunkModel(xc, yc, zc);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leal 0xf(%rdi), %r8d
testl %edi, %edi
cmovnsl %edi, %r8d
sarl $0x4, %r8d
movl %r8d, %r14d
subl %ecx, %r14d
addl %ecx, %r8d
movl %r8d, -0x34(%rbp)
cmpl %r8d, %r14d
jge 0x5901
movl %ecx, %eax
leal 0xf(%rdx), %ecx
testl %edx, %edx
cmovnsl %edx, %ecx
sarl $0x4, %ecx
leal 0xf(%rsi), %edx
testl %esi, %esi
cmovnsl %esi, %edx
sarl $0x4, %edx
movl %edx, %esi
subl %eax, %esi
movl %esi, -0x30(%rbp)
addl %eax, %edx
movl %edx, -0x2c(%rbp)
movl %ecx, %r13d
subl %eax, %r13d
addl %eax, %ecx
movl %ecx, -0x38(%rbp)
addl %eax, %eax
movl %eax, -0x3c(%rbp)
movl -0x30(%rbp), %eax
movl %eax, %r15d
cmpl -0x2c(%rbp), %eax
jge 0x58f8
movl -0x3c(%rbp), %ebx
movl %r13d, %r12d
cmpl -0x38(%rbp), %r13d
jge 0x58ef
movl %r14d, %edi
movl %r15d, %esi
movl %r12d, %edx
callq 0x6b07
testq %rax, %rax
je 0x58e8
movl %r14d, %edi
movl %r15d, %esi
movl %r12d, %edx
callq 0x527d
incl %r12d
decl %ebx
jne 0x58c7
incl %r15d
cmpl -0x2c(%rbp), %r15d
jne 0x58bb
incl %r14d
cmpl -0x34(%rbp), %r14d
jne 0x58b0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/rendering.c
// Function: isChunkInsideRenderBoundry
unsigned char 
isChunkInsideRenderBoundry(ChunkBufferData* bData, int x, int y, int z, int bDistance)
{
	x = x / WORLD_CHUNK_SIZE;
	y = y / WORLD_CHUNK_SIZE;
	z = z / WORLD_CHUNK_SIZE;

	int xd = abs((int)bData->xOffset - x);
	int yd = abs((int)bData->yOffset - y);
	int zd = abs((int)bData->zOffset - z);
	
	return xd < bDistance && yd < bDistance && zd < bDistance;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leal 0xf(%rsi), %eax
testl %esi, %esi
cmovnsl %esi, %eax
sarl $0x4, %eax
leal 0xf(%rcx), %esi
testl %ecx, %ecx
cmovnsl %ecx, %esi
sarl $0x4, %esi
movl 0xc(%rdi), %ecx
subl %eax, %ecx
movl 0x14(%rdi), %r9d
movl %ecx, %r10d
negl %r10d
cmovsl %ecx, %r10d
subl %esi, %r9d
movl %r9d, %eax
negl %eax
cmovsl %r9d, %eax
cmpl %r8d, %r10d
jge 0x5b6b
leal 0xf(%rdx), %ecx
testl %edx, %edx
cmovnsl %edx, %ecx
sarl $0x4, %ecx
movl 0x10(%rdi), %edx
subl %ecx, %edx
movl %edx, %ecx
negl %ecx
cmovsl %edx, %ecx
cmpl %r8d, %ecx
jge 0x5b6b
cmpl %r8d, %eax
setl %al
jmp 0x5b6d
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/./stb_perlin.h
// Function: stb_perlin_ridge_noise3
float stb_perlin_ridge_noise3(float x, float y, float z, float lacunarity, float gain, float offset, int octaves)
{
   int i;
   float frequency = 1.0f;
   float prev = 1.0f;
   float amplitude = 0.5f;
   float sum = 0.0f;

   for (i = 0; i < octaves; i++) {
      float r = stb_perlin_noise3_internal(x*frequency,y*frequency,z*frequency,0,0,0,(unsigned char)i);
      r = offset - (float) fabs(r);
      r = r*r;
      sum += r*amplitude*prev;
      prev = r;
      frequency *= lacunarity;
      amplitude *= gain;
   }
   return sum;
}

// Assembly:
testl %edi, %edi
jle 0x62f7
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %edi, %ebx
movaps %xmm2, %xmm6
movaps %xmm1, %xmm2
movaps %xmm0, %xmm1
movss 0xe06(%rip), %xmm9      # 0x7018
movss 0x2dd5(%rip), %xmm8     # 0x8ff0
xorps %xmm0, %xmm0
xorl %r14d, %r14d
movaps %xmm9, %xmm7
movss %xmm5, -0x2c(%rbp)
movss %xmm4, -0x28(%rbp)
movss %xmm3, -0x24(%rbp)
movss %xmm6, -0x20(%rbp)
movss %xmm2, -0x1c(%rbp)
movss %xmm1, -0x18(%rbp)
movss %xmm9, -0x30(%rbp)
movss %xmm7, -0x34(%rbp)
movss %xmm8, -0x38(%rbp)
movss %xmm0, -0x14(%rbp)
movaps %xmm7, %xmm0
mulss %xmm1, %xmm0
movaps %xmm7, %xmm1
mulss %xmm2, %xmm1
movaps %xmm7, %xmm2
mulss %xmm6, %xmm2
movzbl %r14b, %ecx
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5e54
movss -0x38(%rbp), %xmm8
movss -0x1c(%rbp), %xmm2
movss -0x20(%rbp), %xmm6
movss -0x24(%rbp), %xmm3
movss -0x28(%rbp), %xmm4
movss -0x2c(%rbp), %xmm1
andps 0x2d5d(%rip), %xmm0     # 0x9000
subss %xmm0, %xmm1
mulss %xmm1, %xmm1
movaps %xmm8, %xmm0
mulss %xmm1, %xmm0
mulss -0x30(%rbp), %xmm0
movss -0x14(%rbp), %xmm7
addss %xmm0, %xmm7
movss %xmm7, -0x14(%rbp)
movss -0x34(%rbp), %xmm7
movss -0x14(%rbp), %xmm0
mulss %xmm3, %xmm7
mulss %xmm4, %xmm8
incl %r14d
movaps %xmm1, %xmm9
movss -0x18(%rbp), %xmm1
cmpl %r14d, %ebx
jne 0x6243
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/./stb_perlin.h
// Function: stb_perlin_fbm_noise3
float stb_perlin_fbm_noise3(float x, float y, float z, float lacunarity, float gain, int octaves)
{
   int i;
   float frequency = 1.0f;
   float amplitude = 1.0f;
   float sum = 0.0f;
   
   for (i = 0; i < octaves; i++) {
      sum += stb_perlin_noise3_internal(x*frequency,y*frequency,z*frequency,0,0,0,(unsigned char)i)*amplitude;
      frequency *= lacunarity;
      amplitude *= gain;
   }
   return sum;
}

// Assembly:
testl %edi, %edi
jle 0x63c9
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
movaps %xmm2, %xmm5
movaps %xmm1, %xmm2
movaps %xmm0, %xmm1
xorl %r14d, %r14d
movss 0xcf4(%rip), %xmm7      # 0x7018
xorps %xmm0, %xmm0
movaps %xmm7, %xmm6
movss %xmm4, -0x28(%rbp)
movss %xmm3, -0x24(%rbp)
movss %xmm5, -0x20(%rbp)
movss %xmm2, -0x1c(%rbp)
movss %xmm1, -0x18(%rbp)
movss %xmm6, -0x2c(%rbp)
movss %xmm7, -0x30(%rbp)
movss %xmm0, -0x14(%rbp)
movaps %xmm6, %xmm0
mulss %xmm1, %xmm0
movaps %xmm6, %xmm1
mulss %xmm2, %xmm1
movaps %xmm6, %xmm2
mulss %xmm5, %xmm2
movzbl %r14b, %ecx
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5e54
movss -0x30(%rbp), %xmm7
movss -0x18(%rbp), %xmm1
movss -0x1c(%rbp), %xmm2
movss -0x20(%rbp), %xmm5
movss -0x24(%rbp), %xmm3
movss -0x28(%rbp), %xmm4
mulss %xmm7, %xmm0
movss -0x14(%rbp), %xmm6
addss %xmm0, %xmm6
movss %xmm6, -0x14(%rbp)
movss -0x2c(%rbp), %xmm6
movss -0x14(%rbp), %xmm0
mulss %xmm3, %xmm6
mulss %xmm4, %xmm7
incl %r14d
cmpl %r14d, %ebx
jne 0x6343
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/./stb_perlin.h
// Function: stb_perlin_turbulence_noise3
float stb_perlin_turbulence_noise3(float x, float y, float z, float lacunarity, float gain, int octaves)
{
   int i;
   float frequency = 1.0f;
   float amplitude = 1.0f;
   float sum = 0.0f;
   
   for (i = 0; i < octaves; i++) {
      float r = stb_perlin_noise3_internal(x*frequency,y*frequency,z*frequency,0,0,0,(unsigned char)i)*amplitude;
      sum += (float) fabs(r);
      frequency *= lacunarity;
      amplitude *= gain;
   }
   return sum;
}

// Assembly:
testl %edi, %edi
jle 0x64a6
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
movaps %xmm2, %xmm5
movaps %xmm1, %xmm2
movaps %xmm0, %xmm1
movss 0xc25(%rip), %xmm7      # 0x7018
xorps %xmm0, %xmm0
xorl %r14d, %r14d
movaps %xmm7, %xmm6
movss %xmm4, -0x28(%rbp)
movss %xmm3, -0x24(%rbp)
movss %xmm5, -0x20(%rbp)
movss %xmm2, -0x1c(%rbp)
movss %xmm1, -0x18(%rbp)
movss %xmm6, -0x2c(%rbp)
movss %xmm7, -0x30(%rbp)
movss %xmm0, -0x14(%rbp)
movaps %xmm6, %xmm0
mulss %xmm1, %xmm0
movaps %xmm6, %xmm1
mulss %xmm2, %xmm1
movaps %xmm6, %xmm2
mulss %xmm5, %xmm2
movzbl %r14b, %ecx
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5e54
movss -0x30(%rbp), %xmm7
movss -0x18(%rbp), %xmm1
movss -0x1c(%rbp), %xmm2
movss -0x20(%rbp), %xmm5
movss -0x24(%rbp), %xmm3
movss -0x28(%rbp), %xmm4
mulss %xmm7, %xmm0
andps 0x2b8f(%rip), %xmm0     # 0x9000
movss -0x14(%rbp), %xmm6
addss %xmm0, %xmm6
movss %xmm6, -0x14(%rbp)
movss -0x2c(%rbp), %xmm6
movss -0x14(%rbp), %xmm0
mulss %xmm3, %xmm6
mulss %xmm4, %xmm7
incl %r14d
cmpl %r14d, %ebx
jne 0x6415
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/world.c
// Function: createWorld
void
createWorld(unsigned int w, unsigned int h, unsigned int d)
{
	world.width  = w;
	world.height = h;
	world.depth  = d;
	world.seed    = getTimeNanoseconds();
	
	world.cachedChunks = malloc(sizeof(WorldChunk) * w * h * d);
	
	for(unsigned int i = 0; i < w * h * d; i++) {
		unsigned int x = i % w;
		unsigned int y = (i / w) % h;
		unsigned int z = i / (w * h);

		world.cachedChunks[i].xOffset = x;
		world.cachedChunks[i].yOffset = y;
		world.cachedChunks[i].zOffset = z;
		
		generateChunk(&world.cachedChunks[i], x, y, z, world.seed);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r12d
movl %esi, %ebx
movl %edi, %r14d
movl %edi, 0x76a5(%rip)      # 0xdf80
movl %esi, 0x76a3(%rip)      # 0xdf84
movl %edx, 0x76a1(%rip)      # 0xdf88
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x4c29
movq %rax, 0x7698(%rip)      # 0xdf90
movl %r14d, %eax
movl %ebx, %ecx
imulq %rax, %rcx
movl %r12d, %eax
imulq %rcx, %rax
imulq $0x4010, %rax, %rdi     # imm = 0x4010
callq 0x2110
movq %rax, 0x767d(%rip)      # 0xdf98
movl %ebx, %r13d
imull %r14d, %r13d
imull %r13d, %r12d
testl %r12d, %r12d
je 0x6997
movl %ebx, %ecx
movl %r12d, %eax
imulq $0x4010, %rax, %rax     # imm = 0x4010
movq %rax, -0x30(%rbp)
xorl %ebx, %ebx
movl %r15d, %eax
xorl %edx, %edx
divl %r14d
movl %edx, %esi
xorl %edx, %edx
divl %ecx
movl %r14d, %r12d
movl %ecx, %r14d
movl %edx, %ecx
movl %r15d, %eax
xorl %edx, %edx
divl %r13d
movq 0x7636(%rip), %rdx      # 0xdf98
leaq (%rdx,%rbx), %rdi
movl %esi, (%rdx,%rbx)
movl %ecx, 0x4(%rdx,%rbx)
movl %eax, 0x8(%rdx,%rbx)
movl 0x7618(%rip), %r8d      # 0xdf90
movl %ecx, %edx
movl %eax, %ecx
callq 0x69a6
movl %r14d, %ecx
movl %r12d, %r14d
addq $0x4010, %rbx           # imm = 0x4010
incl %r15d
cmpq %rbx, -0x30(%rbp)
jne 0x693d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/world.c
// Function: generateChunk
void
generateChunk(WorldChunk *chunk, unsigned int xc, unsigned int yc, unsigned int zc, unsigned int seed)
{
	for(int i = 0; i < WORLD_CHUNK_NBLOCKS; i++) {
		int xb = (i % WORLD_CHUNK_SIZE);
		int yb = (i / WORLD_CHUNK_SIZE) % WORLD_CHUNK_SIZE;
		int zb = (i / (WORLD_CHUNK_SIZE * WORLD_CHUNK_SIZE));

		float height = stb_perlin_noise3_seed((float)(xb + xc * WORLD_CHUNK_SIZE) / WORLD_CHUNK_SIZE, 
				0, 
				(float)(zb + zc * WORLD_CHUNK_SIZE) / WORLD_CHUNK_SIZE,
				0, 0, 0, seed) * 4.0 + 16;

		int heightInt = floor(height * height) / 16;

		if(yb + yc * WORLD_CHUNK_SIZE == heightInt) 
			chunk->blocks[xb][yb][zb] = 1;
		else if(yb + yc * WORLD_CHUNK_SIZE > heightInt - 4 && yb + yc * WORLD_CHUNK_SIZE < heightInt)
			chunk->blocks[xb][yb][zb] = 2;
		else if(yb + yc * WORLD_CHUNK_SIZE <= heightInt - 4)
			chunk->blocks[xb][yb][zb] = 3;
		else
			chunk->blocks[xb][yb][zb] = 0;

		if (yb + yc * WORLD_CHUNK_SIZE <= heightInt) {
			chunk->numBlocks++;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
shll $0x4, %esi
movl %esi, -0x34(%rbp)
shll $0x4, %ecx
movq %rcx, -0x48(%rbp)
shll $0x4, %edx
movl %edx, -0x38(%rbp)
movq %rdi, -0x40(%rbp)
leaq 0xc(%rdi), %rax
movq %rax, -0x30(%rbp)
xorl %r12d, %r12d
movzbl %r8b, %r13d
movl %r12d, %r14d
andl $0xf, %r14d
movl %r12d, %ebx
shrl $0x4, %ebx
andl $0xf, %ebx
movl %r14d, %eax
orl -0x34(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movl %r12d, %r15d
shrl $0x8, %r15d
movss 0x25ea(%rip), %xmm1     # 0x8ff4
mulss %xmm1, %xmm0
movq -0x48(%rbp), %rax
addl %r15d, %eax
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
mulss %xmm1, %xmm2
xorps %xmm1, %xmm1
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
movl %r13d, %ecx
callq 0x5e54
cvtss2sd %xmm0, %xmm0
mulsd 0x25d2(%rip), %xmm0     # 0x9010
addsd 0x25d2(%rip), %xmm0     # 0x9018
cvtsd2ss %xmm0, %xmm0
mulss %xmm0, %xmm0
callq 0x21e0
cvtss2sd %xmm0, %xmm0
mulsd 0x25c1(%rip), %xmm0     # 0x9020
cvttsd2si %xmm0, %eax
movl %ebx, %ecx
orl -0x38(%rbp), %ecx
movl %r15d, %edx
cmpl %eax, %ecx
jne 0x6a86
shll $0xa, %r14d
addq -0x30(%rbp), %r14
shll $0x6, %ebx
addq %r14, %rbx
movl $0x1, (%rbx,%rdx,4)
jmp 0x6ada
leal -0x4(%rax), %r8d
movl %r14d, %edi
movl %ebx, %esi
cmpl %eax, %ecx
jae 0x6aae
cmpl %r8d, %ecx
jbe 0x6aae
shll $0xa, %edi
addq -0x30(%rbp), %rdi
shll $0x6, %esi
addq %rdi, %rsi
movl $0x2, (%rsi,%rdx,4)
jmp 0x6ada
shll $0xa, %edi
cmpl %r8d, %ecx
jbe 0x6ac9
addq -0x30(%rbp), %rdi
shll $0x6, %esi
addq %rdi, %rsi
movl $0x0, (%rsi,%rdx,4)
jmp 0x6ada
addq -0x30(%rbp), %rdi
shll $0x6, %esi
addq %rdi, %rsi
movl $0x3, (%rsi,%rdx,4)
cmpl %eax, %ecx
ja 0x6ae8
movq -0x40(%rbp), %rax
incl 0x400c(%rax)
incl %r12d
cmpl $0x1000, %r12d          # imm = 0x1000
jne 0x69dd
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/world.c
// Function: getWorldBlock
unsigned int
getWorldBlock(int xB, int yB, int zB)
{
	const WorldChunk* chunk = getWorldChunk(xB / WORLD_CHUNK_SIZE, yB / WORLD_CHUNK_SIZE, zB / WORLD_CHUNK_SIZE);
	if(chunk == NULL)
		return 0;
	return chunk->blocks[xB % WORLD_CHUNK_SIZE][yB % WORLD_CHUNK_SIZE][zB % WORLD_CHUNK_SIZE];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movl %edi, %r15d
leal 0xf(%r15), %r12d
testl %edi, %edi
cmovnsl %edi, %r12d
movl %r12d, %edi
sarl $0x4, %edi
leal 0xf(%r14), %r13d
testl %esi, %esi
cmovnsl %esi, %r13d
movl %r13d, %esi
sarl $0x4, %esi
leal 0xf(%rdx), %ebx
testl %edx, %edx
movq %rdx, -0x30(%rbp)
cmovnsl %edx, %ebx
movl %ebx, %edx
sarl $0x4, %edx
callq 0x6b07
testq %rax, %rax
je 0x6be4
andl $-0x10, %r12d
subl %r12d, %r15d
andl $-0x10, %r13d
subl %r13d, %r14d
andl $-0x10, %ebx
movq -0x30(%rbp), %rdx
subl %ebx, %edx
movslq %r15d, %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq %r14d, %rcx
movslq %edx, %rdx
shlq $0x6, %rcx
addq %rax, %rcx
movl 0xc(%rcx,%rdx,4), %eax
jmp 0x6be6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/aabb.c
// Function: checkCollision
AABBCollisionBit
checkCollision(const AABBCollisor *a, const AABBCollisor *b)
{
	AABBCollisionBit xState = a->x + a->w >= b->x && b->x + b->w >= a->x;
	AABBCollisionBit yState = a->y + a->h >= b->y && b->y + b->h >= a->y;
	AABBCollisionBit zState = a->z + a->d >= b->z && b->z + b->d >= a->z;

	return xState && yState && zState;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movss (%rdi), %xmm0
movss 0xc(%rdi), %xmm2
addss %xmm0, %xmm2
movss (%rsi), %xmm1
ucomiss %xmm1, %xmm2
jae 0x6c16
xorl %ecx, %ecx
jmp 0x6c21
addss 0xc(%rsi), %xmm1
ucomiss %xmm0, %xmm1
setae %cl
movss 0x4(%rdi), %xmm0
movss 0x10(%rdi), %xmm2
addss %xmm0, %xmm2
movss 0x4(%rsi), %xmm1
ucomiss %xmm1, %xmm2
jae 0x6c3d
xorl %edx, %edx
jmp 0x6c48
addss 0x10(%rsi), %xmm1
ucomiss %xmm0, %xmm1
setae %dl
movss 0x8(%rdi), %xmm0
movss 0x14(%rdi), %xmm2
addss %xmm0, %xmm2
movss 0x8(%rsi), %xmm1
xorl %eax, %eax
ucomiss %xmm1, %xmm2
movl $0x0, %edi
jb 0x6c73
addss 0x14(%rsi), %xmm1
ucomiss %xmm0, %xmm1
setae %dil
movzbl %dil, %esi
testb %dl, %cl
cmovnel %esi, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/k0n10pl4tr[P]minimal_crafter/aabb.c
// Function: checkCollisionWorld
AABBCollisionBit
checkCollisionWorld(const AABBCollisor* a)
{
	int xInt = (int)a->x;
	int yInt = (int)a->y;
	int zInt = (int)a->z;
	
	int wInt = (int)a->w;
	int hInt = (int)a->h;
	int dInt = (int)a->d;

	union {
		struct {
			unsigned int topLeftBackBlock;   
			unsigned int topRightBackBlock;
			unsigned int topLeftFrontBlock;    
			unsigned int topRightFrontBlock;   
			unsigned int bottomLeftBackBlock;  
			unsigned int bottomRightBackBlock; 
			unsigned int bottomLeftFrontBlock;
			unsigned int bottomRightFrontBlock;
		};
		unsigned int data[8];
	} blocks;

	blocks.topLeftBackBlock      = getWorldBlock(xInt, yInt + hInt, zInt);
	blocks.topRightBackBlock     = getWorldBlock(xInt + wInt, yInt + hInt, zInt);
	blocks.topLeftFrontBlock     = getWorldBlock(xInt, yInt + hInt, zInt + dInt);
	blocks.topRightFrontBlock    = getWorldBlock(xInt + wInt, yInt + hInt, zInt + dInt);
	blocks.bottomLeftBackBlock   = getWorldBlock(xInt, yInt, zInt);
	blocks.bottomRightBackBlock  = getWorldBlock(xInt + wInt, yInt, zInt);
	blocks.bottomLeftFrontBlock  = getWorldBlock(xInt, yInt, zInt + dInt);
	blocks.bottomRightFrontBlock = getWorldBlock(xInt + wInt, yInt, zInt + dInt);

	for(unsigned int i = 0; i < 8; i++) {
		if(blocks.data[i] != 0)
			return 1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cvttss2si (%rdi), %r12d
cvttss2si 0x4(%rdi), %eax
movl %eax, -0x2c(%rbp)
cvttss2si 0x8(%rdi), %r13d
cvttss2si 0xc(%rdi), %r14d
cvttss2si 0x10(%rdi), %ebx
cvttss2si 0x14(%rdi), %r15d
addl %eax, %ebx
movl %r12d, %edi
movl %ebx, %esi
movl %r13d, %edx
callq 0x6b61
movl %eax, -0x4c(%rbp)
addl %r12d, %r14d
movl %r14d, %edi
movl %ebx, %esi
movl %r13d, %edx
callq 0x6b61
movl %eax, -0x48(%rbp)
addl %r13d, %r15d
movl %r12d, %edi
movl %ebx, %esi
movl %r15d, %edx
callq 0x6b61
movl %eax, -0x44(%rbp)
movl %r14d, %edi
movl %ebx, %esi
movl %r15d, %edx
callq 0x6b61
movl %eax, -0x40(%rbp)
movl %r12d, %edi
movl -0x2c(%rbp), %ebx
movl %ebx, %esi
movl %r13d, %edx
callq 0x6b61
movl %eax, -0x3c(%rbp)
movl %r14d, %edi
movl %ebx, %esi
movl %r13d, %edx
callq 0x6b61
movl %eax, -0x38(%rbp)
movl %r12d, %edi
movl %ebx, %esi
movl %r15d, %edx
callq 0x6b61
movl %eax, -0x34(%rbp)
movl %r14d, %edi
movl %ebx, %esi
movl %r15d, %edx
callq 0x6b61
movl %eax, -0x30(%rbp)
movb $0x1, %al
cmpl $0x0, -0x4c(%rbp)
jne 0x6d63
xorl %ecx, %ecx
movq %rcx, %rax
cmpq $0x7, %rcx
je 0x6d5c
leaq 0x1(%rax), %rcx
cmpl $0x0, -0x48(%rbp,%rax,4)
je 0x6d48
cmpq $0x7, %rax
setb %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.4/primes.c
// Function: compute_prime
void* compute_prime (void* arg)
{
	int candidate = 2;
	int n = *((int*) arg);
	while (1) {
		int factor;
		int is_prime = 1;
		/* Test primality by successive division. */
		for (factor = 2; factor < candidate; ++factor)
			if (candidate % factor == 0) {
				is_prime = 0;
				break;
			}
			/* Is this the prime number we’re looking for? */
		if (is_prime) {
			if (--n == 0) //retornar el numero primo deseado como el return del thread
				return (void*) candidate;
		}
		++candidate;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %edi
movl $0x2, %ecx
cmpl $0x3, %ecx
jl 0x1185
movl $0x2, %r8d
movl %ecx, %eax
xorl %edx, %edx
divl %r8d
testl %edx, %edx
je 0x1189
incl %r8d
cmpl %r8d, %ecx
jne 0x1172
decl %edi
je 0x118f
incl %ecx
movb $0x1, %al
jmp 0x1196
movslq %ecx, %rsi
xorl %edi, %edi
xorl %eax, %eax
testb %al, %al
jne 0x1167
movq %rsi, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.4/primes.c
// Function: main
int main ()
{
	pthread_t thread;
	int which_prime = 100, n = 30, i;
	int prime;
	/* Start the computing thread, up to the 5,000th prime number. */
	pthread_create (&thread, NULL, &compute_prime, &which_prime);
	/* Do some other work here... */
  //Hacer otro trabajo mientras el otro hilo realiza el suyo
  //Por ejemplo calcular el fibonacci de un numero
	int fibonacci[n + 1];
  //Definicion de los caso base
	fibonacci[1] = 1;
	fibonacci[2] = 1;
  //calculo del enesimo fibonacci en este caso 100
	for(i = 3; i <= n; ++i){
		fibonacci[i] = fibonacci[i - 1] + fibonacci[i - 2];
	}

	printf("Fibonacci de %d es : %d\n", n, fibonacci[n]);

	/* Wait for the prime number thread to complete, and get the result.*/
	pthread_join (thread, (void*) &prime);
	/* Print the largest prime it computed. */
	printf("El %dth numero primo es %d.\n", which_prime, prime);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
leaq -0x14(%rbp), %rcx
movl $0x64, (%rcx)
leaq -0x62(%rip), %rdx       # 0x115c
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x1040
movq %rsp, %r14
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, -0x9c(%rbp)
movl $0x3, %eax
movl $0x1, %ecx
addl -0xa8(%rbp,%rax,4), %ecx
movl %ecx, -0xa0(%rbp,%rax,4)
incq %rax
cmpq $0x1f, %rax
jne 0x11e7
movl -0x28(%rbp), %edx
leaq 0xdfc(%rip), %rdi       # 0x2004
movl $0x1e, %esi
xorl %eax, %eax
callq 0x1030
movq -0x20(%rbp), %rdi
leaq -0x24(%rbp), %rbx
movq %rbx, %rsi
callq 0x1050
movl -0x14(%rbp), %esi
movl (%rbx), %edx
leaq 0xded(%rip), %rdi       # 0x201d
xorl %eax, %eax
callq 0x1030
movq %r14, %rsp
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aes128n8t8silcv2/ref/silc.c
// Function: ae_init
int ae_init(ae_cxt* cxt, const byte* userkey, int keylen)
{
	if(keylen != CRYPTO_KEYBYTES){
		return KEY_ERROR;
	}
	cxt->userkey = (byte*)userkey;
	cxt->pt_ekey = &(cxt->ekey);
	AES_set_encrypt_key(userkey, keylen*8, cxt->pt_ekey); /* set the encryption key */
	cxt->klen = keylen;

	return SUCCESS;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x10, %edx
jne 0x31f2
pushq %rbx
movq %rdi, %rbx
movq %rsi, 0x120(%rdi)
leaq 0x20(%rdi), %rdx
movq %rdx, 0x118(%rdi)
movq %rsi, %rdi
movl $0x80, %esi
callq 0x1090
movl $0x10, 0x128(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/mmcco[P]sljit/test_src/sljitMain.c
// Function: devel
void devel(void)
{
	executable_code code;
	struct sljit_compiler *compiler;
	long buf[4] = {5, 12, 0, 0};

	if ((compiler = sljit_create_compiler()) == NULL)
		errx(-1, "out of memory");

#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
	sljit_compiler_verbose(compiler, stdout);
#endif
	sljit_emit_enter(compiler, 0, 1, 4, 5, 4, 0, 2 * sizeof(long));

	sljit_emit_return(compiler, SLJIT_MOV, SLJIT_RETURN_REG, 0);

	code.code = sljit_generate_code(compiler);
	sljit_free_compiler(compiler);

	printf("Code at: %p\n", (void*)SLJIT_FUNC_OFFSET(code.code));

	printf("Function returned with %ld\n", (long)code.func((long*)buf));
	printf("buf[0] = %ld\n", (long)buf[0]);
	printf("buf[1] = %ld\n", (long)buf[1]);
	printf("buf[2] = %ld\n", (long)buf[2]);
	printf("buf[3] = %ld\n", (long)buf[3]);
	sljit_free_code(code.code);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movaps 0x1ddd6(%rip), %xmm0    # 0x20020
movaps %xmm0, 0x10(%rsp)
movaps 0x1ddba(%rip), %xmm0    # 0x20010
movaps %xmm0, (%rsp)
callq 0x14841
testq %rax, %rax
je 0x234d
movq %rax, %r14
movq 0x25d6e(%rip), %rax     # 0x27fe0
movq (%rax), %rsi
movq %r14, %rdi
callq 0x14a36
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x4, %ecx
movl $0x5, %r8d
movl $0x4, %r9d
pushq $0x10
pushq $0x0
callq 0x14f00
addq $0x10, %rsp
movq %r14, %rdi
movl $0x20, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x15509
movq %r14, %rdi
callq 0x14a43
movq %rax, %rbx
movq %r14, %rdi
callq 0x14931
leaq 0x1dd6b(%rip), %rdi     # 0x2003e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2080
movq %rsp, %r14
movq %r14, %rdi
callq *%rbx
leaq 0x1dd5f(%rip), %rdi     # 0x2004b
movq %rax, %rsi
xorl %eax, %eax
callq 0x2080
movq (%r14), %rsi
leaq 0x1dd67(%rip), %rdi     # 0x20067
xorl %eax, %eax
callq 0x2080
movq 0x8(%r14), %rsi
leaq 0x1dd63(%rip), %rdi     # 0x20075
xorl %eax, %eax
callq 0x2080
movq 0x10(%r14), %rsi
leaq 0x1dd5f(%rip), %rdi     # 0x20083
xorl %eax, %eax
callq 0x2080
movq 0x18(%r14), %rsi
leaq 0x1dd5b(%rip), %rdi     # 0x20091
xorl %eax, %eax
callq 0x2080
movq %rbx, %rdi
callq 0x14979
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x1dcdc(%rip), %rsi     # 0x20030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x2070
// File: /workspace/github_c_makefile_star2_O1/mmcco[P]sljit/test_src/sljitTest.c
// Function: cond_set
static void cond_set(struct sljit_compiler *compiler, int dst, long dstw, int type)
{
	/* Testing both sljit_emit_op_flags and sljit_emit_jump. */
	struct sljit_jump* jump;
	struct sljit_label* label;

	sljit_emit_op_flags(compiler, SLJIT_MOV, dst, dstw, SLJIT_UNUSED, 0, type);
	jump = sljit_emit_jump(compiler, type);
	sljit_emit_op2(compiler, SLJIT_ADD | SLJIT_KEEP_FLAGS, dst, dstw, dst, dstw, SLJIT_IMM, 2);
	label = sljit_emit_label(compiler);
	sljit_set_label(jump, label);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
subq $0x8, %rsp
movl $0x20, %esi
movl %ebp, %edx
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r14
callq 0x1d33f
addq $0x10, %rsp
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1cc6a
movq %rax, %r14
movq %rbx, %rdi
movl $0x4060, %esi           # imm = 0x4060
movl %ebp, %edx
movq %r15, %rcx
movl %ebp, %r8d
movq %r15, %r9
pushq $0x2
pushq $0x40
callq 0x18025
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x1cb7d
movq %r14, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1497e