#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 worleyFF_FFF(void *initdata, int argc, void **argv) {
  float *x = (float *)argv[1];
  float *y = (float *)argv[2];
  float *f1 = (float *)argv[3];
  float *f2 = (float *)argv[4];
  float *id1 = (float *)argv[5];
  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);
  *f1 = (float)F[0];
  *f2 = (float)F[1];
  *id1 = (float)ID[0];
  return 0;
}


x86 assembly (clang, -O0):
<worleyFF_FFF>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movq   $0x0,-0x50(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x2,%esi
lea    -0x70(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
lea    -0xb0(%rbp),%r8
call   1030 <Worley@plt>
movsd  -0x70(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x68(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0xb0(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0xb8(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0xb4(%rbp)
ff
js     121a <worleyFF_FFF+0x10a>
movss  -0xb8(%rbp),%xmm0
ff
movss  %xmm0,-0xb4(%rbp)
ff
movss  -0xb4(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
movss  %xmm0,(%rax)
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worleyFF_FFF>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    0x8(%rdx),%rax
mov    0x10(%rdx),%rcx
mov    0x18(%rdx),%rbx
mov    0x20(%rdx),%r15
mov    0x28(%rdx),%r14
movss  (%rcx),%xmm0
movss  (%rax),%xmm1
unpcklps %xmm0,%xmm1
cvtps2pd %xmm1,%xmm0
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x30(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rdx
lea    0x40(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    $0x2,%esi
call   1030 <Worley@plt>
movsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r15)
mov    0x10(%rsp),%rax
test   %rax,%rax
js     1195 <worleyFF_FFF+0x85>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
jmp    11ad <worleyFF_FFF+0x9d>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm0
movss  %xmm0,(%r14)
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @worleyFF_FFF(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 float*
%11 = alloca float*
%12 = alloca [3 x double]
%13 = alloca [2 x double]
%14 = alloca [2 x [3 x double]]
%15 = alloca [2 x i64]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%16 = load i8**, i8*** %6
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = bitcast i8* %18 to float*
store float* %19, float** %7
%20 = load i8**, i8*** %6
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = bitcast i8* %22 to float*
store float* %23, float** %8
%24 = load i8**, i8*** %6
%25 = getelementptr inbounds i8*, i8** %24, i64 3
%26 = load i8*, i8** %25
%27 = bitcast i8* %26 to float*
store float* %27, float** %9
%28 = load i8**, i8*** %6
%29 = getelementptr inbounds i8*, i8** %28, i64 4
%30 = load i8*, i8** %29
%31 = bitcast i8* %30 to float*
store float* %31, float** %10
%32 = load i8**, i8*** %6
%33 = getelementptr inbounds i8*, i8** %32, i64 5
%34 = load i8*, i8** %33
%35 = bitcast i8* %34 to float*
store float* %35, float** %11
%36 = load float*, float** %7
%37 = load float, float* %36
%38 = fpext float %37 to double
%39 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
store double %38, double* %39
%40 = load float*, float** %8
%41 = load float, float* %40
%42 = fpext float %41 to double
%43 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 1
store double %42, double* %43
%44 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 2
store double 0.000000e+00, double* %44
%45 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
%46 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%47 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* %14, i64 0, i64 0
%48 = bitcast [3 x double]* %47 to double**
%49 = getelementptr inbounds [2 x i64], [2 x i64]* %15, i64 0, i64 0
%50 = call i32 @Worley(double* %45, i32 2, double* %46, double** %48, i64* %49)
%51 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%52 = load double, double* %51
%53 = fptrunc double %52 to float
%54 = load float*, float** %9
store float %53, float* %54
%55 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 1
%56 = load double, double* %55
%57 = fptrunc double %56 to float
%58 = load float*, float** %10
store float %57, float* %58
%59 = getelementptr inbounds [2 x i64], [2 x i64]* %15, i64 0, i64 0
%60 = load i64, i64* %59
%61 = uitofp i64 %60 to float
%62 = load float*, float** %11
store float %61, float* %62
ret i32 0
}

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