#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 */
int /*<<< orphan*/ Worley(double *, int, double *, double **, unsigned long *);
int f_worleyFF(void *initdata, int argc, void **argv) {
  float *result = (float *)argv[0];
  float *x = (float *)argv[1];
  float *y = (float *)argv[2];
  double at[3];
  at[0] = *x;
  at[1] = *y;
  at[2] = 0.0;
  double F[2];
  double delta[2][3];
  unsigned long ID[2];
  Worley(at, 2, F, delta, ID);
  *result = (float)F[0];
  return 0;
}


x86 assembly (clang, -O0):
<f_worleyFF>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%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
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    -0x90(%rbp),%rcx
lea    -0xa0(%rbp),%r8
mov    $0x2,%esi
call   1030 <Worley@plt>
movsd  -0x60(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_worleyFF>:
push   %rbx
sub    $0x70,%rsp
mov    (%rdx),%rbx
mov    0x8(%rdx),%rax
mov    0x10(%rdx),%rcx
movss  (%rcx),%xmm0
movss  (%rax),%xmm1
unpcklps %xmm0,%xmm1
cvtps2pd %xmm1,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rdx
lea    0x40(%rsp),%rcx
lea    0x30(%rsp),%r8
mov    $0x2,%esi
call   1030 <Worley@plt>
movsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rbx)
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f_worleyFF(i8* nocapture readnone %0, i32 %1, i8** nocapture %2) {
%4 = alloca [3 x double]
%5 = alloca [2 x double]
%6 = alloca [2 x [3 x double]]
%7 = alloca [2 x i64]
%8 = bitcast i8** %2 to float**
%9 = load float*, float** %8
%10 = getelementptr inbounds i8*, i8** %2, i64 1
%11 = bitcast i8** %10 to float**
%12 = load float*, float** %11
%13 = getelementptr inbounds i8*, i8** %2, i64 2
%14 = bitcast i8** %13 to float**
%15 = load float*, float** %14
%16 = bitcast [3 x double]* %4 to i8*
%17 = load float, float* %12
%18 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%19 = load float, float* %15
%20 = insertelement <2 x float> poison, float %17, i64 0
%21 = insertelement <2 x float> %20, float %19, i64 1
%22 = fpext <2 x float> %21 to <2 x double>
%23 = bitcast [3 x double]* %4 to <2 x double>*
store <2 x double> %22, <2 x double>* %23
%24 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
store double 0.000000e+00, double* %24
%25 = bitcast [2 x double]* %5 to i8*
%26 = bitcast [2 x [3 x double]]* %6 to i8*
%27 = bitcast [2 x i64]* %7 to i8*
%28 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%29 = bitcast [2 x [3 x double]]* %6 to double**
%30 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%31 = call i32 @Worley(double* %18, i32 2, double* %28, double** %29, i64* %30)
%32 = load double, double* %28
%33 = fptrunc double %32 to float
store float %33, float* %9
ret i32 0
}