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


x86 assembly (clang, -O0):
<v_snoiseF>:
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    -0x28(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <snoise1@plt>
movaps %xmm0,%xmm1
movss  0xeb2(%rip),%xmm0
addss  %xmm1,%xmm0
movss  0xea2(%rip),%xmm1
mulss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe92(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <snoise1@plt>
movaps %xmm0,%xmm1
movss  0xe6e(%rip),%xmm0
addss  %xmm1,%xmm0
movss  0xe5e(%rip),%xmm1
mulss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe45(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <snoise1@plt>
movaps %xmm0,%xmm1
movss  0xe29(%rip),%xmm0
addss  %xmm1,%xmm0
movss  0xe19(%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_snoiseF>:
push   %r14
push   %rbx
push   %rax
mov    (%rdx),%r14
mov    0x8(%rdx),%rbx
movss  (%rbx),%xmm0
call   1030 <snoise1@plt>
addss  0xed4(%rip),%xmm0
mulss  0xed0(%rip),%xmm0
movss  %xmm0,(%r14)
movss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xebf(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <snoise1@plt>
addss  0xea6(%rip),%xmm0
mulss  0xea2(%rip),%xmm0
movss  %xmm0,0x4(%r14)
movss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe98(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <snoise1@plt>
addss  0xe77(%rip),%xmm0
mulss  0xe73(%rip),%xmm0
movss  %xmm0,0x8(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @v_snoiseF(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 = load float, float* %8
%10 = tail call float @snoise1(float %9)
%11 = fadd float %10, 1.000000e+00
%12 = fmul float %11, 5.000000e-01
store float %12, float* %5
%13 = load float, float* %8
%14 = fpext float %13 to double
%15 = fadd double %14, 1.934000e+01
%16 = fptrunc double %15 to float
%17 = tail call float @snoise1(float %16)
%18 = fadd float %17, 1.000000e+00
%19 = fmul float %18, 5.000000e-01
%20 = getelementptr inbounds float, float* %5, i64 1
store float %19, float* %20
%21 = load float, float* %8
%22 = fpext float %21 to double
%23 = fadd double %22, 5.470000e+00
%24 = fptrunc double %23 to float
%25 = tail call float @snoise1(float %24)
%26 = fadd float %25, 1.000000e+00
%27 = fmul float %26, 5.000000e-01
%28 = getelementptr inbounds float, float* %5, i64 2
store float %27, float* %28
ret i32 0
}