#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 worleyP_FFF(void *initdata, int argc, void **argv) {
  float *P = (float *)argv[1];
  float *f1 = (float *)argv[2];
  float *f2 = (float *)argv[3];
  float *id1 = (float *)argv[4];
  double at[3];
  at[0] = (double)P[0];
  at[1] = (double)P[1];
  at[2] = (double)P[2];
  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):
<worleyP_FFF>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%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    -0x20(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x2,%esi
lea    -0x60(%rbp),%rdx
lea    -0x90(%rbp),%rcx
lea    -0xa0(%rbp),%r8
call   1030 <Worley@plt>
movsd  -0x60(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x58(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0xa0(%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,-0xa8(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0xa4(%rbp)
ff
js     1219 <worleyP_FFF+0x109>
movss  -0xa8(%rbp),%xmm0
ff
movss  %xmm0,-0xa4(%rbp)
ff
movss  -0xa4(%rbp),%xmm0
ff
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worleyP_FFF>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    0x8(%rdx),%rax
mov    0x10(%rdx),%rbx
mov    0x18(%rdx),%r15
mov    0x20(%rdx),%r14
cvtps2pd (%rax),%xmm0
movaps %xmm0,0x20(%rsp)
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,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     118c <worleyP_FFF+0x7c>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
jmp    11a4 <worleyP_FFF+0x94>
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 @worleyP_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 [3 x double]
%12 = alloca [2 x double]
%13 = alloca [2 x [3 x double]]
%14 = alloca [2 x i64]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%15 = load i8**, i8*** %6
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = bitcast i8* %17 to float*
store float* %18, float** %7
%19 = load i8**, i8*** %6
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = bitcast i8* %21 to float*
store float* %22, float** %8
%23 = load i8**, i8*** %6
%24 = getelementptr inbounds i8*, i8** %23, i64 3
%25 = load i8*, i8** %24
%26 = bitcast i8* %25 to float*
store float* %26, float** %9
%27 = load i8**, i8*** %6
%28 = getelementptr inbounds i8*, i8** %27, i64 4
%29 = load i8*, i8** %28
%30 = bitcast i8* %29 to float*
store float* %30, float** %10
%31 = load float*, float** %7
%32 = getelementptr inbounds float, float* %31, i64 0
%33 = load float, float* %32
%34 = fpext float %33 to double
%35 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
store double %34, double* %35
%36 = load float*, float** %7
%37 = getelementptr inbounds float, float* %36, i64 1
%38 = load float, float* %37
%39 = fpext float %38 to double
%40 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 1
store double %39, double* %40
%41 = load float*, float** %7
%42 = getelementptr inbounds float, float* %41, i64 2
%43 = load float, float* %42
%44 = fpext float %43 to double
%45 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 2
store double %44, double* %45
%46 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%47 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%48 = getelementptr inbounds [2 x [3 x double]], [2 x [3 x double]]* %13, i64 0, i64 0
%49 = bitcast [3 x double]* %48 to double**
%50 = getelementptr inbounds [2 x i64], [2 x i64]* %14, i64 0, i64 0
%51 = call i32 @Worley(double* %46, i32 2, double* %47, double** %49, i64* %50)
%52 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%53 = load double, double* %52
%54 = fptrunc double %53 to float
%55 = load float*, float** %8
store float %54, float* %55
%56 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 1
%57 = load double, double* %56
%58 = fptrunc double %57 to float
%59 = load float*, float** %9
store float %58, float* %59
%60 = getelementptr inbounds [2 x i64], [2 x i64]* %14, i64 0, i64 0
%61 = load i64, i64* %60
%62 = uitofp i64 %61 to float
%63 = load float*, float** %10
store float %62, float* %63
ret i32 0
}

LLVM IR (-O2):
define i32 @worleyP_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 = bitcast [3 x double]* %4 to i8*
%21 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%22 = bitcast float* %10 to <2 x float>*
%23 = load <2 x float>, <2 x float>* %22
%24 = fpext <2 x float> %23 to <2 x double>
%25 = bitcast [3 x double]* %4 to <2 x double>*
store <2 x double> %24, <2 x double>* %25
%26 = getelementptr inbounds float, float* %10, i64 2
%27 = load float, float* %26
%28 = fpext float %27 to double
%29 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
store double %28, double* %29
%30 = bitcast [2 x double]* %5 to i8*
%31 = bitcast [2 x [3 x double]]* %6 to i8*
%32 = bitcast [2 x i64]* %7 to i8*
%33 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%34 = bitcast [2 x [3 x double]]* %6 to double**
%35 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%36 = call i32 @Worley(double* %21, i32 2, double* %33, double** %34, i64* %35)
%37 = load double, double* %33
%38 = fptrunc double %37 to float
store float %38, float* %13
%39 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
%40 = load double, double* %39
%41 = fptrunc double %40 to float
store float %41, float* %16
%42 = load i64, i64* %35
%43 = uitofp i64 %42 to float
store float %43, float* %19
ret i32 0
}