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


x86 assembly (clang, -O0):
<test_Noise2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <Noise2D@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe94(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <Noise2D@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe4b(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <Noise2D@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
movsd  0xdf2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xddd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <Noise2D@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
lea    0xdb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_Noise2D>:
push   %rbx
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1040 <Noise2D@plt>
movaps %xmm0,%xmm2
lea    0xee2(%rip),%rbx
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xeb4(%rip),%xmm1
xorps  %xmm0,%xmm0
call   1040 <Noise2D@plt>
movaps %xmm0,%xmm2
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
movsd  0xe9b(%rip),%xmm1
call   1030 <printf@plt>
xorps  %xmm1,%xmm1
movsd  0xe8b(%rip),%xmm0
call   1040 <Noise2D@plt>
movaps %xmm0,%xmm2
xorps  %xmm1,%xmm1
mov    %rbx,%rdi
movsd  0xe75(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xe70(%rip),%xmm0
movsd  0xe70(%rip),%xmm1
call   1040 <Noise2D@plt>
movaps %xmm0,%xmm2
mov    %rbx,%rdi
movsd  0xe55(%rip),%xmm0
movsd  0xe55(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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