#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ floor(float);
float cellNoiseU(float x, float y, float z) {
  int xi = (int)(floor(x));
  int yi = (int)(floor(y));
  int zi = (int)(floor(z));
  unsigned int n = xi + yi * 1301 + zi * 314159;
  n ^= (n << 13);
  return ((float)(n * (n * n * 15731 + 789221) + 1376312589) / 4294967296.0f);
}


x86 assembly (clang, -O0):
<cellNoiseU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floor@plt>
mov    %eax,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <floor@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   $0x515,%ecx,%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%ecx
imul   $0x4cb2f,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
shl    $0xd,%ecx
xor    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
imul   %ecx,%ecx
imul   $0x3d73,%ecx,%ecx
add    $0xc0ae5,%ecx
imul   %ecx,%eax
add    $0x5208dd0d,%eax
cvtsi2ss %rax,%xmm0
movss  0xe60(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cellNoiseU>:
push   %r14
push   %rbx
push   %rax
movss  %xmm2,0x4(%rsp)
movss  %xmm1,(%rsp)
call   1030 <floor@plt>
mov    %rax,%r14
movss  (%rsp),%xmm0
call   1030 <floor@plt>
mov    %rax,%rbx
movss  0x4(%rsp),%xmm0
call   1030 <floor@plt>
imul   $0x515,%ebx,%ecx
add    %r14d,%ecx
imul   $0x4cb2f,%eax,%eax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0xd,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
imul   %ecx,%eax
imul   $0x3d73,%eax,%eax
add    $0xc0ae5,%eax
imul   %ecx,%eax
add    $0x5208dd0d,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mulss  0xe81(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float @cellNoiseU(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%11 = load float, float* %4
%12 = call i64 @floor(float %11)
%13 = trunc i64 %12 to i32
store i32 %13, i32* %7
%14 = load float, float* %5
%15 = call i64 @floor(float %14)
%16 = trunc i64 %15 to i32
store i32 %16, i32* %8
%17 = load float, float* %6
%18 = call i64 @floor(float %17)
%19 = trunc i64 %18 to i32
store i32 %19, i32* %9
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = mul nsw i32 %21, 1301
%23 = add nsw i32 %20, %22
%24 = load i32, i32* %9
%25 = mul nsw i32 %24, 314159
%26 = add nsw i32 %23, %25
store i32 %26, i32* %10
%27 = load i32, i32* %10
%28 = shl i32 %27, 13
%29 = load i32, i32* %10
%30 = xor i32 %29, %28
store i32 %30, i32* %10
%31 = load i32, i32* %10
%32 = load i32, i32* %10
%33 = load i32, i32* %10
%34 = mul i32 %32, %33
%35 = mul i32 %34, 15731
%36 = add i32 %35, 789221
%37 = mul i32 %31, %36
%38 = add i32 %37, 1376312589
%39 = uitofp i32 %38 to float
%40 = fdiv float %39, 0x41F0000000000000
ret float %40
}

LLVM IR (-O2):
define float @cellNoiseU(float %0, float %1, float %2) {
%4 = tail call i64 @floor(float %0)
%5 = trunc i64 %4 to i32
%6 = tail call i64 @floor(float %1)
%7 = trunc i64 %6 to i32
%8 = tail call i64 @floor(float %2)
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %7, 1301
%11 = add nsw i32 %10, %5
%12 = mul nsw i32 %9, 314159
%13 = add nsw i32 %11, %12
%14 = shl i32 %13, 13
%15 = xor i32 %14, %13
%16 = mul i32 %15, 15731
%17 = mul i32 %16, %15
%18 = add i32 %17, 789221
%19 = mul i32 %18, %15
%20 = add i32 %19, 1376312589
%21 = uitofp i32 %20 to float
%22 = fmul float %21, 0x3DF0000000000000
ret float %22
}