#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 */
float Interpolate(float, float, float);
float SmoothedNoise_SIMD(float, float);
float floor(float);
float InterpolatedNoise_1_SIMD(float x, float y) {
  float integer_X, integer_Y, fractional_X, fractional_Y;
  float v1, v2, v3, v4, i1, i2;
  integer_X = floor(x);
  fractional_X = x - integer_X;
  integer_Y = floor(y);
  fractional_Y = y - integer_Y;
  v1 = SmoothedNoise_SIMD(integer_X, integer_Y);
  v2 = SmoothedNoise_SIMD(integer_X + 1, integer_Y);
  v3 = SmoothedNoise_SIMD(integer_X, integer_Y + 1);
  v4 = SmoothedNoise_SIMD(integer_X + 1, integer_Y + 1);
  i1 = Interpolate(v1, v2, fractional_X);
  i2 = Interpolate(v3, v4, fractional_X);
  return Interpolate(i1, i2, fractional_Y);
}


x86 assembly (clang, -O0):
<InterpolatedNoise_1_SIMD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <floor@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <floor@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <SmoothedNoise_SIMD@plt>
movss  %xmm0,-0x1c(%rbp)
movss  0xe66(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <SmoothedNoise_SIMD@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe45(%rip),%xmm1
addss  -0x10(%rbp),%xmm1
call   1030 <SmoothedNoise_SIMD@plt>
movss  %xmm0,-0x24(%rbp)
movss  0xe2e(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xe21(%rip),%xmm1
addss  -0x10(%rbp),%xmm1
call   1030 <SmoothedNoise_SIMD@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1040 <Interpolate@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x24(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1040 <Interpolate@plt>
movss  %xmm0,-0x30(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  -0x30(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1040 <Interpolate@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InterpolatedNoise_1_SIMD>:
sub    $0x28,%rsp
movss  %xmm1,0x18(%rsp)
movss  %xmm0,0x14(%rsp)
call   1040 <floorf@plt>
movaps %xmm0,%xmm1
movss  %xmm0,0x10(%rsp)
movss  0x14(%rsp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x14(%rsp)
movss  0x18(%rsp),%xmm0
call   1040 <floorf@plt>
movaps %xmm0,%xmm1
movss  %xmm0,0xc(%rsp)
movss  0x18(%rsp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <SmoothedNoise_SIMD@plt>
movss  %xmm0,0x1c(%rsp)
movss  0x10(%rsp),%xmm0
addss  0xe5f(%rip),%xmm0
movss  %xmm0,0x20(%rsp)
movss  0xc(%rsp),%xmm1
call   1030 <SmoothedNoise_SIMD@plt>
movss  %xmm0,0x24(%rsp)
movss  0xc(%rsp),%xmm1
addss  0xe3a(%rip),%xmm1
movss  %xmm1,0xc(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <SmoothedNoise_SIMD@plt>
movss  %xmm0,0x10(%rsp)
movss  0x20(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1030 <SmoothedNoise_SIMD@plt>
movss  %xmm0,0xc(%rsp)
movss  0x1c(%rsp),%xmm0
movss  0x24(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
call   1050 <Interpolate@plt>
movss  %xmm0,0x1c(%rsp)
movss  0x10(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
call   1050 <Interpolate@plt>
movaps %xmm0,%xmm1
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm2
add    $0x28,%rsp
jmp    1050 <Interpolate@plt>

LLVM IR (-O0):
define float @InterpolatedNoise_1_SIMD(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store float %0, float* %3
store float %1, float* %4
%15 = load float, float* %3
%16 = call float @floor(float %15)
store float %16, float* %5
%17 = load float, float* %3
%18 = load float, float* %5
%19 = fsub float %17, %18
store float %19, float* %7
%20 = load float, float* %4
%21 = call float @floor(float %20)
store float %21, float* %6
%22 = load float, float* %4
%23 = load float, float* %6
%24 = fsub float %22, %23
store float %24, float* %8
%25 = load float, float* %5
%26 = load float, float* %6
%27 = call float @SmoothedNoise_SIMD(float %25, float %26)
store float %27, float* %9
%28 = load float, float* %5
%29 = fadd float %28, 1.000000e+00
%30 = load float, float* %6
%31 = call float @SmoothedNoise_SIMD(float %29, float %30)
store float %31, float* %10
%32 = load float, float* %5
%33 = load float, float* %6
%34 = fadd float %33, 1.000000e+00
%35 = call float @SmoothedNoise_SIMD(float %32, float %34)
store float %35, float* %11
%36 = load float, float* %5
%37 = fadd float %36, 1.000000e+00
%38 = load float, float* %6
%39 = fadd float %38, 1.000000e+00
%40 = call float @SmoothedNoise_SIMD(float %37, float %39)
store float %40, float* %12
%41 = load float, float* %9
%42 = load float, float* %10
%43 = load float, float* %7
%44 = call float @Interpolate(float %41, float %42, float %43)
store float %44, float* %13
%45 = load float, float* %11
%46 = load float, float* %12
%47 = load float, float* %7
%48 = call float @Interpolate(float %45, float %46, float %47)
store float %48, float* %14
%49 = load float, float* %13
%50 = load float, float* %14
%51 = load float, float* %8
%52 = call float @Interpolate(float %49, float %50, float %51)
ret float %52
}

LLVM IR (-O2):
define float @InterpolatedNoise_1_SIMD(float %0, float %1) {
%3 = tail call float @llvm.floor.f32(float %0)
%4 = fsub float %0, %3
%5 = tail call float @llvm.floor.f32(float %1)
%6 = fsub float %1, %5
%7 = tail call float @SmoothedNoise_SIMD(float %3, float %5)
%8 = fadd float %3, 1.000000e+00
%9 = tail call float @SmoothedNoise_SIMD(float %8, float %5)
%10 = fadd float %5, 1.000000e+00
%11 = tail call float @SmoothedNoise_SIMD(float %3, float %10)
%12 = tail call float @SmoothedNoise_SIMD(float %8, float %10)
%13 = tail call float @Interpolate(float %7, float %9, float %4)
%14 = tail call float @Interpolate(float %11, float %12, float %4)
%15 = tail call float @Interpolate(float %13, float %14, float %6)
ret float %15
}