// File: /workspace/github_c_makefile_star2_O0/k0n10pl4tr[P]minimal_crafter/rendering.c
// Function: render
void
render(float camX, float camY, float camZ)
{
	generateChunkModelAroundPos(camX, camY, camZ, NUM_CHUNKS_RENDER);
	glEnable(GL_DEPTH_TEST);
	glEnable(GL_CULL_FACE);

	glUseProgram(cubeRenderingShader);
	glClearColor(0.2, 0.3, 0.7, 1.0);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	
	glUniformMatrix4fv(cubeUniformViewLocation, 1, GL_FALSE, &viewMatrix[0][0]);
	for(unsigned int i = 0; i < NUM_CHUNK_CACHED; i++) {
		if(chunkCached[i].canDraw && isChunkInsideRenderBoundry(&chunkCached[i], camX, camY, camZ, 4)) {
			glUniformMatrix4fv(cubeUniformModelLocation, 1, GL_FALSE, &modelMatrix[0][0]);

			glActiveTexture(GL_TEXTURE0);
			glBindTexture(GL_TEXTURE_2D, cubeTerrainTexture);	
			glBindVertexArray(chunkCached[i].vao);
			glDrawArrays(GL_TRIANGLES, 0, chunkCached[i].faces * 6);
			glBindVertexArray(0);
			glBindTexture(GL_TEXTURE_2D, 0);
		}
	}

	glUseProgram(0);
	glDisable(GL_DEPTH_TEST);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movss %xmm0, -0x4(%rbp)
movss %xmm1, -0x8(%rbp)
movss %xmm2, -0xc(%rbp)
cvttss2si -0x4(%rbp), %edi
cvttss2si -0x8(%rbp), %esi
cvttss2si -0xc(%rbp), %edx
movl $0x4, %ecx
callq 0x6df0
movl $0xb71, %edi            # imm = 0xB71
leaq 0x6efc(%rip), %rax      # 0xde08
callq *(%rax)
movl $0xb44, %edi            # imm = 0xB44
leaq 0x6eee(%rip), %rax      # 0xde08
callq *(%rax)
leaq 0x758d(%rip), %rax      # 0xe4b0
movq (%rax), %rax
movl 0x7824(%rip), %edi      # 0xe750
callq *%rax
movss 0x3d76(%rip), %xmm0     # 0xacac
movss 0x3d72(%rip), %xmm1     # 0xacb0
movss 0x3d6e(%rip), %xmm2     # 0xacb4
movss 0x3d56(%rip), %xmm3     # 0xaca4
leaq 0x6d0b(%rip), %rax      # 0xdc60
callq *(%rax)
movl $0x4100, %edi           # imm = 0x4100
leaq 0x6cd5(%rip), %rax      # 0xdc38
callq *(%rax)
leaq 0x7524(%rip), %rax      # 0xe490
movq (%rax), %rax
movl 0x77ef(%rip), %edi      # 0xe764
movl $0x1, %esi
xorl %edx, %edx
leaq 0x786d(%rip), %rcx      # 0xe7f0
callq *%rax
movl $0x0, -0x10(%rbp)
cmpl $0x100, -0x10(%rbp)     # imm = 0x100
jae 0x70ab
movl -0x10(%rbp), %eax
movl %eax, %ecx
leaq 0x789b(%rip), %rax      # 0xe840
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movzbl 0x18(%rax), %eax
cmpl $0x0, %eax
je 0x709b
movl -0x10(%rbp), %eax
leaq 0x787d(%rip), %rdi      # 0xe840
imulq $0x1c, %rax, %rax
addq %rax, %rdi
cvttss2si -0x4(%rbp), %esi
cvttss2si -0x8(%rbp), %edx
cvttss2si -0xc(%rbp), %ecx
movl $0x4, %r8d
callq 0x70d0
movzbl %al, %eax
cmpl $0x0, %eax
je 0x709b
leaq 0x7499(%rip), %rax      # 0xe490
movq (%rax), %rax
movl 0x7760(%rip), %edi      # 0xe760
movl $0x1, %esi
xorl %edx, %edx
leaq 0x77a2(%rip), %rcx      # 0xe7b0
callq *%rax
movl $0x84c0, %edi           # imm = 0x84C0
leaq 0x6b4c(%rip), %rax      # 0xdb68
callq *(%rax)
leaq 0x6bb3(%rip), %rax      # 0xdbd8
movq (%rax), %rax
movl 0x7806(%rip), %esi      # 0xe834
movl $0xde1, %edi            # imm = 0xDE1
callq *%rax
leaq 0x6ba4(%rip), %rax      # 0xdbe0
movq (%rax), %rax
movl -0x10(%rbp), %ecx
movl %ecx, %edx
leaq 0x77f5(%rip), %rcx      # 0xe840
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl (%rcx), %edi
callq *%rax
leaq 0x6d5b(%rip), %rax      # 0xddb8
movq (%rax), %rax
movl -0x10(%rbp), %ecx
movl %ecx, %edx
leaq 0x77d4(%rip), %rcx      # 0xe840
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
imull $0x6, 0x8(%rcx), %edx
movl $0x4, %edi
xorl %esi, %esi
callq *%rax
xorl %edi, %edi
leaq 0x6b57(%rip), %rax      # 0xdbe0
callq *(%rax)
movl $0xde1, %edi            # imm = 0xDE1
xorl %esi, %esi
leaq 0x6b3f(%rip), %rax      # 0xdbd8
callq *(%rax)
jmp 0x709d
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x6f8c
xorl %edi, %edi
leaq 0x73fc(%rip), %rax      # 0xe4b0
callq *(%rax)
movl $0xb71, %edi            # imm = 0xB71
leaq 0x6cde(%rip), %rax      # 0xdda0
callq *(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)