// File: /workspace/github_c_makefile_star2_O3/k0n10pl4tr[P]minimal_crafter/main.c
// Function: processCamera
void
processCamera(float cameraMoveSpeed, float cameraRotateSpeed)
{
	if(keyLeft) cameraYaw -= cameraRotateSpeed;
	if(keyRight) cameraYaw += cameraRotateSpeed;
	if(keyUp) cameraPitch += cameraRotateSpeed;
	if(keyDown) cameraPitch -= cameraRotateSpeed;

	if(keyFront) { 
		velocity[0] += cos(cameraYaw) * cameraMoveSpeed;
		velocity[2] += sin(cameraYaw) * cameraMoveSpeed;
	}

	if(keyBack) { 
		velocity[0] -= cos(cameraYaw) * cameraMoveSpeed;
		velocity[2] -= sin(cameraYaw) * cameraMoveSpeed;
	}
	
	if(keySpace && !cameraFalling) 
		velocity[1] += cameraMoveSpeed * 50.0;
	
	if(cameraFalling && velocity[1] < 1.0)
		velocity[1] -= cameraMoveSpeed * 1.0;


	vec3 nextPosition;
	vec3_add(nextPosition, cameraPosition, velocity); 
	
	cameraCollisor[0].x = nextPosition[0];
	cameraCollisor[0].y = cameraPosition[1]; 
	cameraCollisor[0].z = cameraPosition[2];

	cameraCollisor[1].x = cameraPosition[0];
	cameraCollisor[1].y = nextPosition[1]; 
	cameraCollisor[1].z = cameraPosition[2];

	cameraCollisor[2].x = cameraPosition[0];
	cameraCollisor[2].y = cameraPosition[1]; 
	cameraCollisor[2].z = nextPosition[2];

	if(checkCollisionWorld(&cameraCollisor[0])) {
		velocity[0] = 0.0;
	}

	if(checkCollisionWorld(&cameraCollisor[1])) {
		cameraFalling = 0;
		velocity[1] = 0.0;
	} else {
		cameraFalling = 1;
	}

	if(checkCollisionWorld(&cameraCollisor[2])) {
		velocity[2] = 0.0;
	}
	
	vec3_add(cameraPosition, cameraPosition, velocity);
	
	cameraEye[0] = cameraPosition[0];
	cameraEye[1] = cameraPosition[1] + cameraHeight;
	cameraEye[2] = cameraPosition[2];
	
	cameraLook[0] = cameraEye[0] + cos(cameraYaw);
	cameraLook[2] = cameraEye[2] + sin(cameraYaw);
	cameraLook[1] = cameraEye[1] + cos(cameraPitch);

	vec3_scale(velocity, velocity, 0.9f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movss %xmm0, -0x18(%rbp)
cmpb $0x0, 0x8d4d(%rip)      # 0xb5e1
je 0x28aa
movss 0x8d4a(%rip), %xmm0     # 0xb5e8
subss %xmm1, %xmm0
movss %xmm0, 0x8d3e(%rip)     # 0xb5e8
cmpb $0x0, 0x8d31(%rip)      # 0xb5e2
je 0x28c7
movss 0x8d2d(%rip), %xmm0     # 0xb5e8
addss %xmm1, %xmm0
movss %xmm0, 0x8d21(%rip)     # 0xb5e8
cmpb $0x0, 0x8d15(%rip)      # 0xb5e3
je 0x28e4
movss 0x8914(%rip), %xmm0     # 0xb1ec
addss %xmm1, %xmm0
movss %xmm0, 0x8908(%rip)     # 0xb1ec
cmpb $0x0, 0x8cf9(%rip)      # 0xb5e4
je 0x2901
movss 0x88f7(%rip), %xmm0     # 0xb1ec
subss %xmm1, %xmm0
movss %xmm0, 0x88eb(%rip)     # 0xb1ec
cmpb $0x0, 0x8cdd(%rip)      # 0xb5e5
je 0x2973
xorps %xmm0, %xmm0
cvtss2sd 0x8cd3(%rip), %xmm0     # 0xb5e8
callq 0x2160
cvtss2sd -0x18(%rbp), %xmm2
movsd %xmm2, -0x20(%rbp)
xorps %xmm1, %xmm1
cvtss2sd 0x8cbd(%rip), %xmm1     # 0xb5ec
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8ca9(%rip)     # 0xb5ec
xorps %xmm0, %xmm0
cvtss2sd 0x8c9a(%rip), %xmm0     # 0xb5e8
callq 0x2290
xorps %xmm1, %xmm1
cvtss2sd 0x8c96(%rip), %xmm1     # 0xb5f4
mulsd -0x20(%rbp), %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8c81(%rip)     # 0xb5f4
cmpb $0x0, 0x8c6c(%rip)      # 0xb5e6
je 0x29ee
xorps %xmm0, %xmm0
cvtss2sd 0x8c61(%rip), %xmm0     # 0xb5e8
callq 0x2160
xorps %xmm2, %xmm2
cvtss2sd -0x18(%rbp), %xmm2
movsd %xmm2, -0x20(%rbp)
xorps %xmm1, %xmm1
cvtss2sd 0x8c48(%rip), %xmm1     # 0xb5ec
mulsd %xmm2, %xmm0
subsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x8c31(%rip)     # 0xb5ec
xorps %xmm0, %xmm0
cvtss2sd 0x8c22(%rip), %xmm0     # 0xb5e8
callq 0x2290
xorps %xmm1, %xmm1
cvtss2sd 0x8c1e(%rip), %xmm1     # 0xb5f4
mulsd -0x20(%rbp), %xmm0
subsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x8c06(%rip)     # 0xb5f4
cmpb $0x0, 0x8bf2(%rip)      # 0xb5e7
sete %cl
movb 0x8bfa(%rip), %al       # 0xb5f8
orb %al, %cl
testb $0x1, %cl
jne 0x2a30
xorps %xmm0, %xmm0
cvtss2sd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x8bd8(%rip), %xmm1     # 0xb5f0
mulsd 0x45e8(%rip), %xmm0     # 0x7008
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8bc0(%rip)     # 0xb5f0
testb $0x1, %al
je 0x2a56
movss 0x8bb4(%rip), %xmm0     # 0xb5f0
movss 0x45d4(%rip), %xmm1     # 0x7018
ucomiss %xmm0, %xmm1
jbe 0x2a56
subss -0x18(%rbp), %xmm0
movss %xmm0, 0x8b9a(%rip)     # 0xb5f0
xorl %eax, %eax
leaq 0x8791(%rip), %r14      # 0xb1f0
leaq 0x8b86(%rip), %rbx      # 0xb5ec
movss (%rax,%r14), %xmm0
addss (%rax,%rbx), %xmm0
movss %xmm0, -0x2c(%rbp,%rax)
addq $0x4, %rax
cmpq $0xc, %rax
jne 0x2a66
movss -0x2c(%rbp), %xmm0
movss -0x28(%rbp), %xmm1
movss %xmm0, 0x8b6d(%rip)     # 0xb600
leaq 0x8b66(%rip), %rdi      # 0xb600
movss 0x8752(%rip), %xmm0     # 0xb1f4
movss %xmm0, 0x8b5a(%rip)     # 0xb604
movss 0x8746(%rip), %xmm2     # 0xb1f8
movss %xmm2, 0x8b4e(%rip)     # 0xb608
movss 0x872e(%rip), %xmm3     # 0xb1f0
movss %xmm3, 0x8b4e(%rip)     # 0xb618
movss %xmm1, 0x8b4a(%rip)     # 0xb61c
movss %xmm2, 0x8b46(%rip)     # 0xb620
movss %xmm3, 0x8b4e(%rip)     # 0xb630
movss %xmm0, 0x8b4a(%rip)     # 0xb634
movss -0x24(%rbp), %xmm0
movss %xmm0, 0x8b41(%rip)     # 0xb638
callq 0x6c52
testb %al, %al
je 0x2b0a
movl $0x0, 0x8ae2(%rip)      # 0xb5ec
leaq 0x8b07(%rip), %rdi      # 0xb618
callq 0x6c52
testb %al, %al
je 0x2b24
movl $0x0, 0x8acc(%rip)      # 0xb5f0
testb %al, %al
sete 0x8acb(%rip)            # 0xb5f8
leaq 0x8afc(%rip), %rdi      # 0xb630
callq 0x6c52
testb %al, %al
je 0x2b47
movl $0x0, 0x8aad(%rip)      # 0xb5f4
xorl %eax, %eax
movss (%rax,%r14), %xmm0
addss (%rax,%rbx), %xmm0
movss %xmm0, (%rax,%r14)
addq $0x4, %rax
cmpq $0xc, %rax
jne 0x2b49
movss 0x8684(%rip), %xmm0     # 0xb1f0
movss %xmm0, 0x8ad4(%rip)     # 0xb648
movss 0x8678(%rip), %xmm1     # 0xb1f4
addss 0x4498(%rip), %xmm1     # 0x701c
movss %xmm1, 0x8ac0(%rip)     # 0xb64c
movss 0x8664(%rip), %xmm1     # 0xb1f8
movss %xmm1, 0x8ab4(%rip)     # 0xb650
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0x8a38(%rip), %xmm0     # 0xb5e8
callq 0x2160
addsd -0x18(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8a8e(%rip)     # 0xb654
xorps %xmm0, %xmm0
cvtss2sd 0x8a7f(%rip), %xmm0     # 0xb650
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0x8a07(%rip), %xmm0     # 0xb5e8
callq 0x2290
addsd -0x18(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8a65(%rip)     # 0xb65c
xorps %xmm0, %xmm0
cvtss2sd 0x8a4a(%rip), %xmm0     # 0xb64c
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
cvtss2sd 0x85da(%rip), %xmm0     # 0xb1ec
callq 0x2160
addsd -0x18(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8a30(%rip)     # 0xb658
xorl %eax, %eax
movss 0x43ee(%rip), %xmm0     # 0x7020
movss (%rax,%rbx), %xmm1
mulss %xmm0, %xmm1
movss %xmm1, (%rax,%rbx)
addq $0x4, %rax
cmpq $0xc, %rax
jne 0x2c32
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq