#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 */
double Noise3D(double, double, double);
int /*<<< orphan*/ printf(char *, double, double, double, double);
char *test_Noise3D() {
  double x = 0;
  double y = 0;
  double z = 0;
  printf("Noise3D(%f, %f, %f): %f\n", x, y, z, Noise3D(x, y, z));
  y = -10;
  z = -2;
  printf("Noise3D(%f, %f, %f): %f\n", x, y, z, Noise3D(x, y, z));
  x = -10;
  y = 0;
  z = 20;
  printf("Noise3D(%f, %f, %f): %f\n", x, y, z, Noise3D(x, y, z));
  x = 0.432;
  y = -0.2376;
  z = 128.234;
  printf("Noise3D(%f, %f, %f): %f\n", x, y, z, Noise3D(x, y, z));
  return 0;
}


x86 assembly (clang, -O0):
<test_Noise3D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <Noise3D@plt>
movsd  -0x78(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x68(%rbp),%xmm0
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe85(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe80(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <Noise3D@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x50(%rbp),%xmm0
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe1b(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xdfe(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <Noise3D@plt>
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x38(%rbp),%xmm0
lea    0xdc6(%rip),%rdi
call   1030 <printf@plt>
movsd  0xd99(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xd84(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xd6f(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <Noise3D@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x20(%rbp),%xmm0
lea    0xd4f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_Noise3D>:
push   %rbx
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1040 <Noise3D@plt>
movaps %xmm0,%xmm3
lea    0xef7(%rip),%rbx
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xeae(%rip),%xmm1
movsd  0xeae(%rip),%xmm2
xorps  %xmm0,%xmm0
call   1040 <Noise3D@plt>
movaps %xmm0,%xmm3
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
movsd  0xe8d(%rip),%xmm1
movsd  0xe8d(%rip),%xmm2
call   1030 <printf@plt>
movsd  0xe88(%rip),%xmm2
xorps  %xmm1,%xmm1
movsd  0xe6d(%rip),%xmm0
call   1040 <Noise3D@plt>
movaps %xmm0,%xmm3
xorps  %xmm1,%xmm1
mov    %rbx,%rdi
movsd  0xe57(%rip),%xmm0
movsd  0xe5f(%rip),%xmm2
call   1030 <printf@plt>
movsd  0xe5a(%rip),%xmm0
movsd  0xe5a(%rip),%xmm1
movsd  0xe5a(%rip),%xmm2
call   1040 <Noise3D@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0xe37(%rip),%xmm0
movsd  0xe37(%rip),%xmm1
movsd  0xe37(%rip),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Noise3D(%f, %f, %f): %f\0A\00"
define i8* @test_Noise3D() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 0.000000e+00, double* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %1
%5 = load double, double* %2
%6 = load double, double* %3
%7 = load double, double* %1
%8 = load double, double* %2
%9 = load double, double* %3
%10 = call double @Noise3D(double %7, double %8, double %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %4, double %5, double %6, double %10)
store double -1.000000e+01, double* %2
store double -2.000000e+00, double* %3
%12 = load double, double* %1
%13 = load double, double* %2
%14 = load double, double* %3
%15 = load double, double* %1
%16 = load double, double* %2
%17 = load double, double* %3
%18 = call double @Noise3D(double %15, double %16, double %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %12, double %13, double %14, double %18)
store double -1.000000e+01, double* %1
store double 0.000000e+00, double* %2
store double 2.000000e+01, double* %3
%20 = load double, double* %1
%21 = load double, double* %2
%22 = load double, double* %3
%23 = load double, double* %1
%24 = load double, double* %2
%25 = load double, double* %3
%26 = call double @Noise3D(double %23, double %24, double %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %20, double %21, double %22, double %26)
store double 4.320000e-01, double* %1
store double -2.376000e-01, double* %2
store double 1.282340e+02, double* %3
%28 = load double, double* %1
%29 = load double, double* %2
%30 = load double, double* %3
%31 = load double, double* %1
%32 = load double, double* %2
%33 = load double, double* %3
%34 = call double @Noise3D(double %31, double %32, double %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %28, double %29, double %30, double %34)
ret i8* null
}

LLVM IR (-O2):
@.str = [25 x i8] c"Noise3D(%f, %f, %f): %f\0A\00"
define noalias i8* @test_Noise3D() {
%1 = tail call double @Noise3D(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double %1)
%3 = tail call double @Noise3D(double 0.000000e+00, double -1.000000e+01, double -2.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double 0.000000e+00, double -1.000000e+01, double -2.000000e+00, double %3)
%5 = tail call double @Noise3D(double -1.000000e+01, double 0.000000e+00, double 2.000000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double -1.000000e+01, double 0.000000e+00, double 2.000000e+01, double %5)
%7 = tail call double @Noise3D(double 4.320000e-01, double -2.376000e-01, double 1.282340e+02)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double 4.320000e-01, double -2.376000e-01, double 1.282340e+02, double %7)
ret i8* null
}