#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*/ fore(double **, int, int);
int forwardModel(int startEvent, int endEvent, double xLoc, double yLoc,
                 double zLoc, double *newXLoc, double *newYLoc,
                 double *newZLoc) {
  double points[10][4];
  int i, j;
  for (i = 0; i < 10; i++)
    for (j = 0; j < 4; j++)
      points[i][j] = 0.0;
  points[5][1] = xLoc;
  points[5][2] = yLoc;
  points[5][3] = zLoc;
  fore((double **)points, startEvent, endEvent);
  *newXLoc = points[5][1];
  *newYLoc = points[5][2];
  *newZLoc = points[5][3];
  return (1);
}


x86 assembly (clang, -O0):
<forwardModel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
movl   $0x0,-0x184(%rbp)
cmpl   $0xa,-0x184(%rbp)
jge    11bb <forwardModel+0xab>
movl   $0x0,-0x188(%rbp)
cmpl   $0x4,-0x188(%rbp)
jge    11a2 <forwardModel+0x92>
movslq -0x184(%rbp),%rcx
lea    -0x180(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x188(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x188(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x188(%rbp)
jmp    115d <forwardModel+0x4d>
jmp    11a7 <forwardModel+0x97>
mov    -0x184(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x184(%rbp)
jmp    1146 <forwardModel+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
lea    -0x180(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <fore@plt>
movsd  -0xd8(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xd0(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xc8(%rbp),%xmm0
ff
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    $0x1,%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forwardModel>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %esi,%ebp
mov    %edi,%ebx
lea    0x20(%rsp),%r13
mov    $0x140,%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0xc8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0xd0(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0xd8(%rsp)
mov    %r13,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <fore@plt>
movsd  0xc8(%rsp),%xmm0
movsd  %xmm0,(%r12)
movsd  0xd0(%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  0xd8(%rsp),%xmm0
movsd  %xmm0,(%r14)
mov    $0x1,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @forwardModel(i32 %0, i32 %1, double %2, double %3, double %4, double* %5, double* %6, double* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca [10 x [4 x double]]
%18 = alloca i32
%19 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double* %5, double** %14
store double* %6, double** %15
store double* %7, double** %16
store i32 0, i32* %18
br label %20
20: ; preds = %38, %8
%21 = load i32, i32* %18
%22 = icmp slt i32 %21, 10
br i1 %22, label %23, label %41
23: ; preds = %20
store i32 0, i32* %19
br label %24
24: ; preds = %34, %23
%25 = load i32, i32* %19
%26 = icmp slt i32 %25, 4
br i1 %26, label %27, label %37
27: ; preds = %24
%28 = load i32, i32* %18
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %17, i64 0, i64 %29
%31 = load i32, i32* %19
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [4 x double], [4 x double]* %30, i64 0, i64 %32
store double 0.000000e+00, double* %33
br label %34
34: ; preds = %27
%35 = load i32, i32* %19
%36 = add nsw i32 %35, 1
store i32 %36, i32* %19
br label %24
37: ; preds = %24
br label %38
38: ; preds = %37
%39 = load i32, i32* %18
%40 = add nsw i32 %39, 1
store i32 %40, i32* %18
br label %20
41: ; preds = %20
%42 = load double, double* %11
%43 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %17, i64 0, i64 5
%44 = getelementptr inbounds [4 x double], [4 x double]* %43, i64 0, i64 1
store double %42, double* %44
%45 = load double, double* %12
%46 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %17, i64 0, i64 5
%47 = getelementptr inbounds [4 x double], [4 x double]* %46, i64 0, i64 2
store double %45, double* %47
%48 = load double, double* %13
%49 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %17, i64 0, i64 5
%50 = getelementptr inbounds [4 x double], [4 x double]* %49, i64 0, i64 3
store double %48, double* %50
%51 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %17, i64 0, i64 0
%52 = bitcast [4 x double]* %51 to double**
%53 = load i32, i32* %9
%54 = load i32, i32* %10
%55 = call i32 @fore(double** %52, i32 %53, i32 %54)
%56 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %17, i64 0, i64 5
%57 = getelementptr inbounds [4 x double], [4 x double]* %56, i64 0, i64 1
%58 = load double, double* %57
%59 = load double*, double** %14
store double %58, double* %59
%60 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %17, i64 0, i64 5
%61 = getelementptr inbounds [4 x double], [4 x double]* %60, i64 0, i64 2
%62 = load double, double* %61
%63 = load double*, double** %15
store double %62, double* %63
%64 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %17, i64 0, i64 5
%65 = getelementptr inbounds [4 x double], [4 x double]* %64, i64 0, i64 3
%66 = load double, double* %65
%67 = load double*, double** %16
store double %66, double* %67
ret i32 1
}

LLVM IR (-O2):
define i32 @forwardModel(i32 %0, i32 %1, double %2, double %3, double %4, double* nocapture writeonly %5, double* nocapture writeonly %6, double* nocapture writeonly %7) {
%9 = alloca [10 x [4 x double]]
%10 = bitcast [10 x [4 x double]]* %9 to i8*
%11 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %9, i64 0, i64 5, i64 1
store double %2, double* %11
%12 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %9, i64 0, i64 5, i64 2
store double %3, double* %12
%13 = getelementptr inbounds [10 x [4 x double]], [10 x [4 x double]]* %9, i64 0, i64 5, i64 3
store double %4, double* %13
%14 = bitcast [10 x [4 x double]]* %9 to double**
%15 = call i32 @fore(double** %14, i32 %0, i32 %1)
%16 = load double, double* %11
store double %16, double* %5
%17 = load double, double* %12
store double %17, double* %6
%18 = load double, double* %13
store double %18, double* %7
ret i32 1
}