// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movss %xmm0, -0x4(%rbp)
movss %xmm1, -0x8(%rbp)
cmpb $0x0, 0xb118(%rip)      # 0xdab1
je 0x29b4
movss -0x8(%rbp), %xmm1
movss 0xb114(%rip), %xmm0     # 0xdabc
subss %xmm1, %xmm0
movss %xmm0, 0xb108(%rip)     # 0xdabc
cmpb $0x0, 0xb0f7(%rip)      # 0xdab2
je 0x29d2
movss -0x8(%rbp), %xmm0
addss 0xb0f2(%rip), %xmm0     # 0xdabc
movss %xmm0, 0xb0ea(%rip)     # 0xdabc
cmpb $0x0, 0xb0da(%rip)      # 0xdab3
je 0x29f0
movss -0x8(%rbp), %xmm0
addss 0xa814(%rip), %xmm0     # 0xd1fc
movss %xmm0, 0xa80c(%rip)     # 0xd1fc
cmpb $0x0, 0xb0bd(%rip)      # 0xdab4
je 0x2a12
movss -0x8(%rbp), %xmm1
movss 0xa7f6(%rip), %xmm0     # 0xd1fc
subss %xmm1, %xmm0
movss %xmm0, 0xa7ea(%rip)     # 0xd1fc
cmpb $0x0, 0xb09c(%rip)      # 0xdab5
je 0x2a8f
movss 0xb099(%rip), %xmm0     # 0xdabc
cvtss2sd %xmm0, %xmm0
callq 0x2160
movss -0x4(%rbp), %xmm1
cvtss2sd %xmm1, %xmm2
movss 0xb083(%rip), %xmm1     # 0xdac0
cvtss2sd %xmm1, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xb06b(%rip)     # 0xdac0
movss 0xb05f(%rip), %xmm0     # 0xdabc
cvtss2sd %xmm0, %xmm0
callq 0x22a0
movss -0x4(%rbp), %xmm1
cvtss2sd %xmm1, %xmm2
movss 0xb051(%rip), %xmm1     # 0xdac8
cvtss2sd %xmm1, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xb039(%rip)     # 0xdac8
cmpb $0x0, 0xb020(%rip)      # 0xdab6
je 0x2b3e
movss 0xb018(%rip), %xmm0     # 0xdabc
cvtss2sd %xmm0, %xmm0
callq 0x2160
movss -0x4(%rbp), %xmm1
cvtss2sd %xmm1, %xmm2
movss 0xb002(%rip), %xmm1     # 0xdac0
cvtss2sd %xmm1, %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xafd3(%rip)     # 0xdac0
movss 0xafc7(%rip), %xmm0     # 0xdabc
cvtss2sd %xmm0, %xmm0
callq 0x22a0
movss -0x4(%rbp), %xmm1
cvtss2sd %xmm1, %xmm2
movss 0xafb9(%rip), %xmm1     # 0xdac8
cvtss2sd %xmm1, %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xaf8a(%rip)     # 0xdac8
movsbl 0xaf72(%rip), %eax      # 0xdab7
cmpl $0x0, %eax
je 0x2b84
cmpb $0x0, 0xaf7b(%rip)      # 0xdacc
jne 0x2b84
movss -0x4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0xaf60(%rip), %xmm1     # 0xdac4
cvtss2sd %xmm1, %xmm1
movsd 0x6518(%rip), %xmm2     # 0x9088
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xaf40(%rip)     # 0xdac4
movzbl 0xaf41(%rip), %eax      # 0xdacc
cmpl $0x0, %eax
je 0x2be6
movss 0xaf2c(%rip), %xmm0     # 0xdac4
cvtss2sd %xmm0, %xmm1
movsd 0x64ec(%rip), %xmm0     # 0x9090
ucomisd %xmm1, %xmm0
jbe 0x2be6
movss -0x4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0xaf09(%rip), %xmm1     # 0xdac4
cvtss2sd %xmm1, %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xaede(%rip)     # 0xdac4
leaq -0x14(%rbp), %rdi
leaq 0xa60f(%rip), %rsi      # 0xd200
leaq 0xaec8(%rip), %rdx      # 0xdac0
callq 0x2e10
movss -0x14(%rbp), %xmm0
movss %xmm0, 0xaec6(%rip)     # 0xdad0
movss 0xa5f2(%rip), %xmm0     # 0xd204
movss %xmm0, 0xaeba(%rip)     # 0xdad4
movss 0xa5e6(%rip), %xmm0     # 0xd208
movss %xmm0, 0xaeae(%rip)     # 0xdad8
movss 0xa5ce(%rip), %xmm0     # 0xd200
movss %xmm0, 0xaeae(%rip)     # 0xdae8
movss -0x10(%rbp), %xmm0
movss %xmm0, 0xaea5(%rip)     # 0xdaec
movss 0xa5b9(%rip), %xmm0     # 0xd208
movss %xmm0, 0xae99(%rip)     # 0xdaf0
movss 0xa5a1(%rip), %xmm0     # 0xd200
movss %xmm0, 0xae99(%rip)     # 0xdb00
movss 0xa595(%rip), %xmm0     # 0xd204
movss %xmm0, 0xae8d(%rip)     # 0xdb04
movss -0xc(%rbp), %xmm0
movss %xmm0, 0xae84(%rip)     # 0xdb08
leaq 0xae45(%rip), %rdi      # 0xdad0
callq 0x8d60
cmpb $0x0, %al
je 0x2c9f
xorps %xmm0, %xmm0
movss %xmm0, 0xae21(%rip)     # 0xdac0
leaq 0xae2a(%rip), %rdi      # 0xdad0
addq $0x18, %rdi
callq 0x8d60
cmpb $0x0, %al
je 0x2cc7
movb $0x0, 0xae12(%rip)      # 0xdacc
xorps %xmm0, %xmm0
movss %xmm0, 0xadff(%rip)     # 0xdac4
jmp 0x2cce
movb $0x1, 0xadfe(%rip)      # 0xdacc
leaq 0xadfb(%rip), %rdi      # 0xdad0
addq $0x30, %rdi
callq 0x8d60
cmpb $0x0, %al
je 0x2ced
xorps %xmm0, %xmm0
movss %xmm0, 0xaddb(%rip)     # 0xdac8
leaq 0xa50c(%rip), %rsi      # 0xd200
leaq 0xadc5(%rip), %rdx      # 0xdac0
movq %rsi, %rdi
callq 0x2e10
movss 0xa4f5(%rip), %xmm0     # 0xd200
movss %xmm0, 0xae05(%rip)     # 0xdb18
movss 0xa4e9(%rip), %xmm0     # 0xd204
addss 0xa4e9(%rip), %xmm0     # 0xd20c
movss %xmm0, 0xadf1(%rip)     # 0xdb1c
movss 0xa4d5(%rip), %xmm0     # 0xd208
movss %xmm0, 0xade5(%rip)     # 0xdb20
movss 0xadd5(%rip), %xmm0     # 0xdb18
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movss 0xad68(%rip), %xmm0     # 0xdabc
cvtss2sd %xmm0, %xmm0
callq 0x2160
movaps %xmm0, %xmm1
movsd -0x30(%rbp), %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xadaf(%rip)     # 0xdb24
movss 0xada3(%rip), %xmm0     # 0xdb20
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movss 0xad2e(%rip), %xmm0     # 0xdabc
cvtss2sd %xmm0, %xmm0
callq 0x22a0
movaps %xmm0, %xmm1
movsd -0x28(%rbp), %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xad7d(%rip)     # 0xdb2c
movss 0xad65(%rip), %xmm0     # 0xdb1c
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movss 0xa434(%rip), %xmm0     # 0xd1fc
cvtss2sd %xmm0, %xmm0
callq 0x2160
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xad3f(%rip)     # 0xdb28
leaq 0xacd0(%rip), %rsi      # 0xdac0
movss 0x62a8(%rip), %xmm0     # 0x90a0
movq %rsi, %rdi
callq 0x2e70
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)