#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 noise2(float, float);
int v_inoiseFF(void *initdata, int argc, void **argv) {
  float *result = (float *)argv[0];
  float *x = (float *)argv[1];
  float *y = (float *)argv[2];
  result[0] = (1.0f + noise2(*x, *y)) * 0.5f;
  result[1] = (1.0f + noise2(*x + 19.34, *y + 7.66)) * 0.5f;
  result[2] = (1.0f + noise2(*x + 5.47, *y + 17.85)) * 0.5f;
  return 0;
}


x86 assembly (clang, -O0):
<v_inoiseFF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm1
call   1030 <noise2@plt>
movaps %xmm0,%xmm1
movss  0xe9e(%rip),%xmm0
addss  %xmm1,%xmm0
movss  0xe8e(%rip),%xmm1
mulss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe6a(%rip),%xmm2
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
call   1030 <noise2@plt>
movaps %xmm0,%xmm1
movss  0xe3e(%rip),%xmm0
addss  %xmm1,%xmm0
movss  0xe2e(%rip),%xmm1
mulss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe1d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xdf9(%rip),%xmm2
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
call   1030 <noise2@plt>
movaps %xmm0,%xmm1
movss  0xddd(%rip),%xmm0
addss  %xmm1,%xmm0
movss  0xdcd(%rip),%xmm1
mulss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x8(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_inoiseFF>:
push   %r15
push   %r14
push   %rbx
mov    (%rdx),%r14
mov    0x8(%rdx),%rbx
mov    0x10(%rdx),%r15
movss  (%rbx),%xmm0
movss  (%r15),%xmm1
call   1030 <noise2@plt>
addss  0xeca(%rip),%xmm0
mulss  0xec6(%rip),%xmm0
movss  %xmm0,(%r14)
movss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xeb5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  (%r15),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0xea8(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
call   1030 <noise2@plt>
addss  0xe87(%rip),%xmm0
mulss  0xe83(%rip),%xmm0
movss  %xmm0,0x4(%r14)
movss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe81(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  (%r15),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0xe74(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
call   1030 <noise2@plt>
addss  0xe43(%rip),%xmm0
mulss  0xe3f(%rip),%xmm0
movss  %xmm0,0x8(%r14)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @v_inoiseFF(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%10 = load i8**, i8*** %6
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = bitcast i8* %12 to float*
store float* %13, float** %7
%14 = load i8**, i8*** %6
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = bitcast i8* %16 to float*
store float* %17, float** %8
%18 = load i8**, i8*** %6
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = bitcast i8* %20 to float*
store float* %21, float** %9
%22 = load float*, float** %8
%23 = load float, float* %22
%24 = load float*, float** %9
%25 = load float, float* %24
%26 = call float @noise2(float %23, float %25)
%27 = fadd float 1.000000e+00, %26
%28 = fmul float %27, 5.000000e-01
%29 = load float*, float** %7
%30 = getelementptr inbounds float, float* %29, i64 0
store float %28, float* %30
%31 = load float*, float** %8
%32 = load float, float* %31
%33 = fpext float %32 to double
%34 = fadd double %33, 1.934000e+01
%35 = fptrunc double %34 to float
%36 = load float*, float** %9
%37 = load float, float* %36
%38 = fpext float %37 to double
%39 = fadd double %38, 7.660000e+00
%40 = fptrunc double %39 to float
%41 = call float @noise2(float %35, float %40)
%42 = fadd float 1.000000e+00, %41
%43 = fmul float %42, 5.000000e-01
%44 = load float*, float** %7
%45 = getelementptr inbounds float, float* %44, i64 1
store float %43, float* %45
%46 = load float*, float** %8
%47 = load float, float* %46
%48 = fpext float %47 to double
%49 = fadd double %48, 5.470000e+00
%50 = fptrunc double %49 to float
%51 = load float*, float** %9
%52 = load float, float* %51
%53 = fpext float %52 to double
%54 = fadd double %53, 1.785000e+01
%55 = fptrunc double %54 to float
%56 = call float @noise2(float %50, float %55)
%57 = fadd float 1.000000e+00, %56
%58 = fmul float %57, 5.000000e-01
%59 = load float*, float** %7
%60 = getelementptr inbounds float, float* %59, i64 2
store float %58, float* %60
ret i32 0
}

LLVM IR (-O2):
define i32 @v_inoiseFF(i8* nocapture readnone %0, i32 %1, i8** nocapture %2) {
%4 = bitcast i8** %2 to float**
%5 = load float*, float** %4
%6 = getelementptr inbounds i8*, i8** %2, i64 1
%7 = bitcast i8** %6 to float**
%8 = load float*, float** %7
%9 = getelementptr inbounds i8*, i8** %2, i64 2
%10 = bitcast i8** %9 to float**
%11 = load float*, float** %10
%12 = load float, float* %8
%13 = load float, float* %11
%14 = tail call float @noise2(float %12, float %13)
%15 = fadd float %14, 1.000000e+00
%16 = fmul float %15, 5.000000e-01
store float %16, float* %5
%17 = load float, float* %8
%18 = fpext float %17 to double
%19 = fadd double %18, 1.934000e+01
%20 = fptrunc double %19 to float
%21 = load float, float* %11
%22 = fpext float %21 to double
%23 = fadd double %22, 7.660000e+00
%24 = fptrunc double %23 to float
%25 = tail call float @noise2(float %20, float %24)
%26 = fadd float %25, 1.000000e+00
%27 = fmul float %26, 5.000000e-01
%28 = getelementptr inbounds float, float* %5, i64 1
store float %27, float* %28
%29 = load float, float* %8
%30 = fpext float %29 to double
%31 = fadd double %30, 5.470000e+00
%32 = fptrunc double %31 to float
%33 = load float, float* %11
%34 = fpext float %33 to double
%35 = fadd double %34, 1.785000e+01
%36 = fptrunc double %35 to float
%37 = tail call float @noise2(float %32, float %36)
%38 = fadd float %37, 1.000000e+00
%39 = fmul float %38, 5.000000e-01
%40 = getelementptr inbounds float, float* %5, i64 2
store float %39, float* %40
ret i32 0
}