#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*/ Distancia(double *, double *, double *, int, int, int);
double pow(int /*<<< orphan*/, int);
scalar_t__ strcmp(char *, char *);
double Accel(double *masas, double *posX, double *posY, double *posZ, int t,
             int p, char comp[]) {
  double a = 0;
  double r3 = 0;
  for (int i = 0; i < 10; i++) {
    if (i != p) {
      if (strcmp(comp, "x") == 0) {
        r3 = pow(Distancia(posX, posY, posZ, t, p, i), 3);
        a += 39.4784176043574344753379 * masas[i] *
             (posX[i * 10000 + t] - posX[p * 10000 + t]) / r3;
      }
      if (strcmp(comp, "y") == 0) {
        r3 = pow(Distancia(posX, posY, posZ, t, p, i), 3);
        a += 39.4784176043574344753379 * masas[i] *
             (posY[i * 10000 + t] - posY[p * 10000 + t]) / r3;
      }
      if (strcmp(comp, "z") == 0) {
        r3 = pow(Distancia(posX, posY, posZ, t, p, i), 3);
        a += 39.4784176043574344753379 * masas[i] *
             (posZ[i * 10000 + t] - posZ[p * 10000 + t]) / r3;
      }
    }
  }
  return a;
}


x86 assembly (clang, -O0):
<Accel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    136a <Accel+0x23a>
mov    -0x3c(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     1357 <Accel+0x227>
mov    0x10(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    121c <Accel+0xec>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
call   1040 <Distancia@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1050 <pow@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xe28(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x2710,-0x3c(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
imul   $0x2710,-0x28(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x38(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x10(%rbp),%rdi
lea    0xde3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    12b7 <Accel+0x187>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
call   1040 <Distancia@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1050 <pow@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xd8d(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
imul   $0x2710,-0x3c(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
imul   $0x2710,-0x28(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x38(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x10(%rbp),%rdi
lea    0xd4a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1352 <Accel+0x222>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
call   1040 <Distancia@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1050 <pow@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xcf2(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
imul   $0x2710,-0x3c(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
imul   $0x2710,-0x28(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x38(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1357 <Accel+0x227>
jmp    135c <Accel+0x22c>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    116b <Accel+0x3b>
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Accel>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rcx,%r12
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,0x18(%rsp)
imul   $0x2710,%r9d,%eax
add    %r8d,%eax
cltq
mov    %rax,0x10(%rsp)
mov    %r8d,0x8(%rsp)
movslq %r8d,%rax
mov    %r9d,0xc(%rsp)
mov    %r9d,%ecx
lea    (%r12,%rax,8),%rdx
mov    %rdx,0x30(%rsp)
lea    0x0(,%rax,8),%rdx
add    %rbp,%rdx
mov    %rdx,0x28(%rsp)
imul   $0x13880,%rcx,%r15
lea    (%rsi,%rax,8),%rax
mov    %rax,0x20(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
xor    %r13d,%r13d
xor    %r14d,%r14d
jmp    11c8 <Accel+0x98>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14
add    $0x13880,%r13
cmp    $0xc3500,%r13
je     1346 <Accel+0x216>
cmp    %r13,%r15
je     11b0 <Accel+0x80>
mov    0x70(%rsp),%rdi
lea    0xe2f(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1247 <Accel+0x117>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%r8d
mov    %r14d,%r9d
call   1040 <Distancia@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1050 <pow@plt>
mov    0x18(%rsp),%rax
movsd  (%rax,%r14,8),%xmm1
mov    0x20(%rsp),%rax
movsd  (%rax,%r13,1),%xmm2
mov    0x10(%rsp),%rax
subsd  (%rbx,%rax,8),%xmm2
mulsd  0xdcf(%rip),%xmm1
mulsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  (%rsp),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rsp)
mov    0x70(%rsp),%rdi
lea    0xdb7(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    12c2 <Accel+0x192>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%r8d
mov    %r14d,%r9d
call   1040 <Distancia@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1050 <pow@plt>
mov    0x18(%rsp),%rax
movsd  (%rax,%r14,8),%xmm1
mov    0x28(%rsp),%rax
movsd  (%rax,%r13,1),%xmm2
mov    0x10(%rsp),%rax
subsd  0x0(%rbp,%rax,8),%xmm2
mulsd  0xd54(%rip),%xmm1
mulsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  (%rsp),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rsp)
mov    0x70(%rsp),%rdi
lea    0xd3e(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11b0 <Accel+0x80>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%r8d
mov    %r14d,%r9d
call   1040 <Distancia@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1050 <pow@plt>
mov    0x18(%rsp),%rax
movsd  (%rax,%r14,8),%xmm1
mov    0x30(%rsp),%rax
movsd  (%rax,%r13,1),%xmm2
mov    0x10(%rsp),%rax
subsd  (%r12,%rax,8),%xmm2
mulsd  0xcd5(%rip),%xmm1
mulsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  (%rsp),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rsp)
jmp    11b0 <Accel+0x80>
movsd  (%rsp),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"x\00"
@.str.1 = [2 x i8] c"y\00"
@.str.2 = [2 x i8] c"z\00"
define double @Accel(double* %0, double* %1, double* %2, double* %3, i32 %4, i32 %5, i8* %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca double
%16 = alloca double
%17 = alloca i32
store double* %0, double** %8
store double* %1, double** %9
store double* %2, double** %10
store double* %3, double** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i8* %6, i8** %14
store double 0.000000e+00, double* %15
store double 0.000000e+00, double* %16
store i32 0, i32* %17
br label %18
18: ; preds = %150, %7
%19 = load i32, i32* %17
%20 = icmp slt i32 %19, 10
br i1 %20, label %21, label %153
21: ; preds = %18
%22 = load i32, i32* %17
%23 = load i32, i32* %13
%24 = icmp ne i32 %22, %23
br i1 %24, label %25, label %149
25: ; preds = %21
%26 = load i8*, i8** %14
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %66
29: ; preds = %25
%30 = load double*, double** %9
%31 = load double*, double** %10
%32 = load double*, double** %11
%33 = load i32, i32* %12
%34 = load i32, i32* %13
%35 = load i32, i32* %17
%36 = call i32 @Distancia(double* %30, double* %31, double* %32, i32 %33, i32 %34, i32 %35)
%37 = call double @pow(i32 %36, i32 3)
store double %37, double* %16
%38 = load double*, double** %8
%39 = load i32, i32* %17
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
%42 = load double, double* %41
%43 = fmul double 0x4043BD3CC9BE45DE, %42
%44 = load double*, double** %9
%45 = load i32, i32* %17
%46 = mul nsw i32 %45, 10000
%47 = load i32, i32* %12
%48 = add nsw i32 %46, %47
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %44, i64 %49
%51 = load double, double* %50
%52 = load double*, double** %9
%53 = load i32, i32* %13
%54 = mul nsw i32 %53, 10000
%55 = load i32, i32* %12
%56 = add nsw i32 %54, %55
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %52, i64 %57
%59 = load double, double* %58
%60 = fsub double %51, %59
%61 = fmul double %43, %60
%62 = load double, double* %16
%63 = fdiv double %61, %62
%64 = load double, double* %15
%65 = fadd double %64, %63
store double %65, double* %15
br label %66
66: ; preds = %29, %25
%67 = load i8*, i8** %14
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %107
70: ; preds = %66
%71 = load double*, double** %9
%72 = load double*, double** %10
%73 = load double*, double** %11
%74 = load i32, i32* %12
%75 = load i32, i32* %13
%76 = load i32, i32* %17
%77 = call i32 @Distancia(double* %71, double* %72, double* %73, i32 %74, i32 %75, i32 %76)
%78 = call double @pow(i32 %77, i32 3)
store double %78, double* %16
%79 = load double*, double** %8
%80 = load i32, i32* %17
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %79, i64 %81
%83 = load double, double* %82
%84 = fmul double 0x4043BD3CC9BE45DE, %83
%85 = load double*, double** %10
%86 = load i32, i32* %17
%87 = mul nsw i32 %86, 10000
%88 = load i32, i32* %12
%89 = add nsw i32 %87, %88
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %85, i64 %90
%92 = load double, double* %91
%93 = load double*, double** %10
%94 = load i32, i32* %13
%95 = mul nsw i32 %94, 10000
%96 = load i32, i32* %12
%97 = add nsw i32 %95, %96
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %93, i64 %98
%100 = load double, double* %99
%101 = fsub double %92, %100
%102 = fmul double %84, %101
%103 = load double, double* %16
%104 = fdiv double %102, %103
%105 = load double, double* %15
%106 = fadd double %105, %104
store double %106, double* %15
br label %107
107: ; preds = %70, %66
%108 = load i8*, i8** %14
%109 = call i64 @strcmp(i8* %108, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%110 = icmp eq i64 %109, 0
br i1 %110, label %111, label %148
111: ; preds = %107
%112 = load double*, double** %9
%113 = load double*, double** %10
%114 = load double*, double** %11
%115 = load i32, i32* %12
%116 = load i32, i32* %13
%117 = load i32, i32* %17
%118 = call i32 @Distancia(double* %112, double* %113, double* %114, i32 %115, i32 %116, i32 %117)
%119 = call double @pow(i32 %118, i32 3)
store double %119, double* %16
%120 = load double*, double** %8
%121 = load i32, i32* %17
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %120, i64 %122
%124 = load double, double* %123
%125 = fmul double 0x4043BD3CC9BE45DE, %124
%126 = load double*, double** %11
%127 = load i32, i32* %17
%128 = mul nsw i32 %127, 10000
%129 = load i32, i32* %12
%130 = add nsw i32 %128, %129
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds double, double* %126, i64 %131
%133 = load double, double* %132
%134 = load double*, double** %11
%135 = load i32, i32* %13
%136 = mul nsw i32 %135, 10000
%137 = load i32, i32* %12
%138 = add nsw i32 %136, %137
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %134, i64 %139
%141 = load double, double* %140
%142 = fsub double %133, %141
%143 = fmul double %125, %142
%144 = load double, double* %16
%145 = fdiv double %143, %144
%146 = load double, double* %15
%147 = fadd double %146, %145
store double %147, double* %15
br label %148
148: ; preds = %111, %107
br label %149
149: ; preds = %148, %21
br label %150
150: ; preds = %149
%151 = load i32, i32* %17
%152 = add nsw i32 %151, 1
store i32 %152, i32* %17
br label %18
153: ; preds = %18
%154 = load double, double* %15
ret double %154
}

LLVM IR (-O2):
@.str = [2 x i8] c"x\00"
@.str.1 = [2 x i8] c"y\00"
@.str.2 = [2 x i8] c"z\00"
define double @Accel(double* nocapture %0, double* %1, double* %2, double* %3, i32 %4, i32 %5, i8* %6) {
%8 = mul nsw i32 %5, 10000
%9 = add nsw i32 %8, %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %1, i64 %10
%12 = getelementptr inbounds double, double* %2, i64 %10
%13 = getelementptr inbounds double, double* %3, i64 %10
%14 = sext i32 %4 to i64
%15 = zext i32 %5 to i64
br label %17
16: ; preds = %80
ret double %81
17: ; preds = %7, %80
%18 = phi i64 [ 0, %7 ], [ %82, %80 ]
%19 = phi double [ 0.000000e+00, %7 ], [ %81, %80 ]
%20 = icmp eq i64 %18, %15
br i1 %20, label %80, label %21
21: ; preds = %17
%22 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %40
24: ; preds = %21
%25 = trunc i64 %18 to i32
%26 = tail call i32 @Distancia(double* %1, double* %2, double* %3, i32 %4, i32 %5, i32 %25)
%27 = tail call double @pow(i32 %26, i32 3)
%28 = getelementptr inbounds double, double* %0, i64 %18
%29 = load double, double* %28
%30 = fmul double %29, 0x4043BD3CC9BE45DE
%31 = mul nuw nsw i64 %18, 10000
%32 = add nsw i64 %31, %14
%33 = getelementptr inbounds double, double* %1, i64 %32
%34 = load double, double* %33
%35 = load double, double* %11
%36 = fsub double %34, %35
%37 = fmul double %30, %36
%38 = fdiv double %37, %27
%39 = fadd double %19, %38
br label %40
40: ; preds = %24, %21
%41 = phi double [ %39, %24 ], [ %19, %21 ]
%42 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %60
44: ; preds = %40
%45 = trunc i64 %18 to i32
%46 = tail call i32 @Distancia(double* %1, double* %2, double* %3, i32 %4, i32 %5, i32 %45)
%47 = tail call double @pow(i32 %46, i32 3)
%48 = getelementptr inbounds double, double* %0, i64 %18
%49 = load double, double* %48
%50 = fmul double %49, 0x4043BD3CC9BE45DE
%51 = mul nuw nsw i64 %18, 10000
%52 = add nsw i64 %51, %14
%53 = getelementptr inbounds double, double* %2, i64 %52
%54 = load double, double* %53
%55 = load double, double* %12
%56 = fsub double %54, %55
%57 = fmul double %50, %56
%58 = fdiv double %57, %47
%59 = fadd double %41, %58
br label %60
60: ; preds = %44, %40
%61 = phi double [ %59, %44 ], [ %41, %40 ]
%62 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %80
64: ; preds = %60
%65 = trunc i64 %18 to i32
%66 = tail call i32 @Distancia(double* %1, double* %2, double* %3, i32 %4, i32 %5, i32 %65)
%67 = tail call double @pow(i32 %66, i32 3)
%68 = getelementptr inbounds double, double* %0, i64 %18
%69 = load double, double* %68
%70 = fmul double %69, 0x4043BD3CC9BE45DE
%71 = mul nuw nsw i64 %18, 10000
%72 = add nsw i64 %71, %14
%73 = getelementptr inbounds double, double* %3, i64 %72
%74 = load double, double* %73
%75 = load double, double* %13
%76 = fsub double %74, %75
%77 = fmul double %70, %76
%78 = fdiv double %77, %67
%79 = fadd double %61, %78
br label %80
80: ; preds = %17, %64, %60
%81 = phi double [ %79, %64 ], [ %61, %60 ], [ %19, %17 ]
%82 = add nuw nsw i64 %18, 1
%83 = icmp eq i64 %82, 10
br i1 %83, label %16, label %17
}