#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ CondIni(double *, double *, double *, double *, double *,
                           double *, double *, double **);
int /*<<< orphan*/ Evoluciona(double *, double *, double *, double *, double *,
                              double *, double *, double, int);
int /*<<< orphan*/ TiempoUno(double *, double *, double *, double *, double *,
                             double *, double *, double);
double atof(char *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double, double,
                           ...);
scalar_t__ malloc(int);
char *strtok(char *, char const *);
int main(void) {
  FILE *datos;
  datos = fopen("coordinates.csv", "r");
  int len = 300;
  char ap[len];
  char *ep;
  const char *delimiter;
  delimiter = ",";
  double matrix[10][8];
  int i = 0, j = 0;
  while (fgets(ap, len, datos)) {
    j = 0;
    ep = strtok(ap, delimiter);
    while (ep != NULL) {
      if (j != 0) {
        matrix[i][j - 1] = atof(ep);
        ep = strtok(NULL, delimiter);
      }
      j += 1;
    }
    i += 1;
  }
  static double dt = 0.001;
  double *x = (double *)malloc(10 * 10000 * sizeof(double));
  double *y = (double *)malloc(10 * 10000 * sizeof(double));
  double *z = (double *)malloc(10 * 10000 * sizeof(double));
  double *vx = (double *)malloc(10 * 10000 * sizeof(double));
  double *vy = (double *)malloc(10 * 10000 * sizeof(double));
  double *vz = (double *)malloc(10 * 10000 * sizeof(double));
  double *m = (double *)malloc(10 * sizeof(double));
  double *times = (double *)malloc(10000 * sizeof(double));
  CondIni(m, x, y, z, vx, vy, vz, matrix);
  TiempoUno(m, x, y, z, vx, vy, vz, dt);
  times[0] = 0.0;
  times[1] = dt;
  for (int i = 2; i < 10000; i++) {
    times[i] = times[i - 1] + dt;
    Evoluciona(m, x, y, z, vx, vy, vz, dt, i);
  }
  FILE *fout;
  fout = fopen("Pos_Planetas.csv", "w");
  for (int j = 0; j < 10000; j++) {
    for (int i = 0; i < 10; i++) {
      if (i == 0) {
        fprintf(fout, "%lf,%lf,%lf,%lf,", times[j], x[i * 10000 + j],
                y[i * 10000 + j], z[i * 10000 + j]);
      } else if (i == 9) {
        fprintf(fout, "%lf,%lf,%lf\n", x[i * 10000 + j], y[i * 10000 + j],
                z[i * 10000 + j]);
      } else {
        fprintf(fout, "%lf,%lf,%lf,", x[i * 10000 + j], y[i * 10000 + j],
                z[i * 10000 + j]);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x330,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe57(%rip),%rdi
lea    0xe60(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x12c,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x328(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
lea    0xe44(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x2c4(%rbp)
movl   $0x0,-0x2c8(%rbp)
mov    -0x328(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     12c3 <main+0x133>
mov    -0x328(%rbp),%rdi
movl   $0x0,-0x2c8(%rbp)
mov    -0x38(%rbp),%rsi
call   1080 <strtok@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     12af <main+0x11f>
cmpl   $0x0,-0x2c8(%rbp)
je     129b <main+0x10b>
mov    -0x30(%rbp),%rdi
call   1030 <atof@plt>
movslq -0x2c4(%rbp),%rcx
lea    -0x2c0(%rbp),%rax
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x2c8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1080 <strtok@plt>
mov    %rax,-0x30(%rbp)
mov    -0x2c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c8(%rbp)
jmp    1243 <main+0xb3>
mov    -0x2c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c4(%rbp)
jmp    1208 <main+0x78>
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,-0x2d0(%rbp)
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,-0x2d8(%rbp)
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,-0x2e0(%rbp)
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,-0x2e8(%rbp)
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,-0x2f0(%rbp)
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,-0x2f8(%rbp)
mov    $0x50,%edi
call   1060 <malloc@plt>
mov    %rax,-0x300(%rbp)
mov    $0x13880,%edi
call   1060 <malloc@plt>
mov    %rax,-0x308(%rbp)
mov    -0x300(%rbp),%rdi
mov    -0x2d0(%rbp),%rsi
mov    -0x2d8(%rbp),%rdx
mov    -0x2e0(%rbp),%rcx
mov    -0x2e8(%rbp),%r8
mov    -0x2f0(%rbp),%r9
mov    -0x2f8(%rbp),%r10
lea    -0x2c0(%rbp),%rax
sub    $0x10,%rsp
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1090 <CondIni@plt>
add    $0x10,%rsp
mov    -0x300(%rbp),%rdi
mov    -0x2d0(%rbp),%rsi
mov    -0x2d8(%rbp),%rdx
mov    -0x2e0(%rbp),%rcx
mov    -0x2e8(%rbp),%r8
mov    -0x2f0(%rbp),%r9
mov    -0x2f8(%rbp),%rax
movsd  0x2c96(%rip),%xmm0
sub    $0x10,%rsp
mov    %rax,(%rsp)
call   10a0 <TiempoUno@plt>
add    $0x10,%rsp
mov    -0x308(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  0x2c6f(%rip),%xmm0
mov    -0x308(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movl   $0x2,-0x30c(%rbp)
cmpl   $0x2710,-0x30c(%rbp)
jge    14ba <main+0x32a>
mov    -0x308(%rbp),%rax
mov    -0x30c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  0x2c29(%rip),%xmm0
mov    -0x308(%rbp),%rax
movslq -0x30c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x300(%rbp),%rdi
mov    -0x2d0(%rbp),%rsi
mov    -0x2d8(%rbp),%rdx
mov    -0x2e0(%rbp),%rcx
mov    -0x2e8(%rbp),%r8
mov    -0x2f0(%rbp),%r9
mov    -0x2f8(%rbp),%r10
movsd  0x2bdd(%rip),%xmm0
mov    -0x30c(%rbp),%eax
sub    $0x10,%rsp
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   10b0 <Evoluciona@plt>
add    $0x10,%rsp
mov    -0x30c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30c(%rbp)
jmp    140f <main+0x27f>
lea    0xb51(%rip),%rdi
lea    0xb5b(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x318(%rbp)
movl   $0x0,-0x31c(%rbp)
cmpl   $0x2710,-0x31c(%rbp)
jge    16c9 <main+0x539>
movl   $0x0,-0x320(%rbp)
cmpl   $0xa,-0x320(%rbp)
jge    16b0 <main+0x520>
cmpl   $0x0,-0x320(%rbp)
jne    159c <main+0x40c>
mov    -0x318(%rbp),%rdi
mov    -0x308(%rbp),%rax
movslq -0x31c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x2d0(%rbp),%rax
imul   $0x2710,-0x320(%rbp),%ecx
add    -0x31c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x2d8(%rbp),%rax
imul   $0x2710,-0x320(%rbp),%ecx
add    -0x31c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x2e0(%rbp),%rax
imul   $0x2710,-0x320(%rbp),%ecx
add    -0x31c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
lea    0xa95(%rip),%rsi
mov    $0x4,%al
call   1050 <fprintf@plt>
jmp    1697 <main+0x507>
cmpl   $0x9,-0x320(%rbp)
jne    1620 <main+0x490>
mov    -0x318(%rbp),%rdi
mov    -0x2d0(%rbp),%rax
imul   $0x2710,-0x320(%rbp),%ecx
add    -0x31c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x2d8(%rbp),%rax
imul   $0x2710,-0x320(%rbp),%ecx
add    -0x31c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x2e0(%rbp),%rax
imul   $0x2710,-0x320(%rbp),%ecx
add    -0x31c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xa22(%rip),%rsi
mov    $0x3,%al
call   1050 <fprintf@plt>
jmp    1692 <main+0x502>
mov    -0x318(%rbp),%rdi
mov    -0x2d0(%rbp),%rax
imul   $0x2710,-0x320(%rbp),%ecx
add    -0x31c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x2d8(%rbp),%rax
imul   $0x2710,-0x320(%rbp),%ecx
add    -0x31c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x2e0(%rbp),%rax
imul   $0x2710,-0x320(%rbp),%ecx
add    -0x31c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0x99e(%rip),%rsi
mov    $0x3,%al
call   1050 <fprintf@plt>
jmp    1697 <main+0x507>
jmp    169c <main+0x50c>
mov    -0x320(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x320(%rbp)
jmp    14f8 <main+0x368>
jmp    16b5 <main+0x525>
mov    -0x31c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x31c(%rbp)
jmp    14de <main+0x34e>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3f8,%rsp
lea    0xe60(%rip),%rdi
lea    0xe69(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r14
lea    0x40(%rsp),%rdi
mov    $0x12c,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1241 <main+0xb1>
lea    0x170(%rsp),%r12
lea    0xe5f(%rip),%rbp
lea    0x40(%rsp),%r15
jmp    1209 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    $0x12c,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
add    $0x40,%r12
test   %rax,%rax
je     1241 <main+0xb1>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1080 <strtok@plt>
test   %rax,%rax
je     11f0 <main+0x60>
mov    %r12,%rbx
nopl   0x0(%rax)
mov    %rax,%rdi
call   1030 <atof@plt>
movsd  %xmm0,(%rbx)
xor    %edi,%edi
mov    %rbp,%rsi
call   1080 <strtok@plt>
add    $0x8,%rbx
test   %rax,%rax
jne    1220 <main+0x90>
jmp    11f0 <main+0x60>
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,%rbp
mov    %rax,0x18(%rsp)
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,0x38(%rsp)
mov    $0xc3500,%edi
call   1060 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    $0x50,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,0x10(%rsp)
mov    $0x13880,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
lea    0x170(%rsp),%rax
mov    %rbx,%rdi
mov    %r12,0x20(%rsp)
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %r15,0x30(%rsp)
mov    %r15,%rcx
mov    0x28(%rsp),%r13
mov    %r13,%r8
mov    0x38(%rsp),%rbp
mov    %rbp,%r9
push   %rax
mov    0x10(%rsp),%rbx
push   %rbx
call   1090 <CondIni@plt>
add    $0x8,%rsp
movsd  0xd01(%rip),%xmm0
mov    0x18(%rsp),%rdi
mov    %r12,%rsi
mov    0x20(%rsp),%r12
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r13,%r8
mov    %rbp,%r9
push   %rbx
call   10a0 <TiempoUno@plt>
add    $0x10,%rsp
xorpd  %xmm1,%xmm1
movsd  0xcd2(%rip),%xmm0
unpcklpd %xmm0,%xmm1
movupd %xmm1,(%r14)
movabs $0x3f60624dd2f1a9fc,%rax
62 60 3f
mov    %rax,0x10(%r14)
mov    0x10(%rsp),%rdi
mov    %rdi,%r15
mov    0x20(%rsp),%rsi
mov    %r12,%rdx
mov    0x30(%rsp),%rcx
mov    %r13,%r8
mov    %rbp,%rbx
mov    %rbp,%r9
push   $0x2
mov    0x10(%rsp),%rax
mov    %rax,%r12
push   %rax
call   10b0 <Evoluciona@plt>
add    $0x10,%rsp
mov    $0x3,%ebp
nopl   0x0(%rax)
movsd  -0x8(%r14,%rbp,8),%xmm1
movsd  0xc71(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rbp,8)
mov    %r15,%rdi
mov    0x20(%rsp),%rsi
mov    0x18(%rsp),%rdx
mov    0x30(%rsp),%rcx
mov    %r13,%r8
mov    %rbx,%r9
push   %rbp
push   %r12
call   10b0 <Evoluciona@plt>
add    $0x10,%rsp
add    $0x1,%rbp
cmp    $0x2710,%rbp
jne    1380 <main+0x1f0>
lea    0xc49(%rip),%rdi
lea    0xc53(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
xor    %r13d,%r13d
mov    0x30(%rsp),%rax
mov    0x20(%rsp),%rcx
mov    %rcx,0x10(%rsp)
mov    0x18(%rsp),%rcx
mov    %rcx,0x8(%rsp)
mov    %rax,%r15
mov    %rax,0x28(%rsp)
mov    %r14,%rax
mov    %r14,%rbp
jmp    1433 <main+0x2a3>
nopl   0x0(%rax)
add    $0x1,%r13
addq   $0x8,0x28(%rsp)
addq   $0x8,0x8(%rsp)
addq   $0x8,0x10(%rsp)
cmp    $0x2710,%r13
je     1507 <main+0x377>
xor    %r12d,%r12d
xor    %r14d,%r14d
jmp    1486 <main+0x2f6>
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rax
movsd  (%rax,%r12,1),%xmm0
mov    0x8(%rsp),%rax
movsd  (%rax,%r12,1),%xmm1
mov    0x28(%rsp),%rax
movsd  (%rax,%r12,1),%xmm2
mov    %rbx,%rdi
lea    0xbc6(%rip),%rsi
mov    $0x3,%al
call   1050 <fprintf@plt>
add    $0x1,%r14
add    $0x13880,%r12
cmp    $0xa,%r14
mov    %rbp,%rax
je     1410 <main+0x280>
cmp    $0x9,%r14d
je     14d0 <main+0x340>
test   %r14d,%r14d
jne    1440 <main+0x2b0>
movsd  (%rax,%r13,8),%xmm0
mov    0x20(%rsp),%rax
movsd  (%rax,%r13,8),%xmm1
mov    0x18(%rsp),%rax
movsd  (%rax,%r13,8),%xmm2
movsd  (%r15,%r13,8),%xmm3
mov    %rbx,%rdi
lea    0xb70(%rip),%rsi
mov    $0x4,%al
call   1050 <fprintf@plt>
jmp    1472 <main+0x2e2>
cs nopw 0x0(%rax,%rax,1)
mov    0x20(%rsp),%rax
movsd  0xafc80(%rax,%r13,8),%xmm0
mov    0x18(%rsp),%rax
movsd  0xafc80(%rax,%r13,8),%xmm1
movsd  0xafc80(%r15,%r13,8),%xmm2
mov    %rbx,%rdi
lea    0xb3c(%rip),%rsi
jmp    146b <main+0x2db>
xor    %eax,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"coordinates.csv\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c",\00"
@main.dt = internal global double 1.000000e-03
@.str.3 = [17 x i8] c"Pos_Planetas.csv\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [17 x i8] c"%lf,%lf,%lf,%lf,\00"
@.str.6 = [13 x i8] c"%lf,%lf,%lf\0A\00"
@.str.7 = [13 x i8] c"%lf,%lf,%lf,\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [10 x [8 x double]]
%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 double*
%18 = alloca double*
%19 = alloca i32
%20 = alloca i32*
%21 = alloca i32
%22 = alloca i32
store i32 0, i32* %1
%23 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %2
store i32 300, i32* %3
%24 = load i32, i32* %3
%25 = zext i32 %24 to i64
%26 = call i8* @llvm.stacksave()
store i8* %26, i8** %4
%27 = alloca i8, i64 %25
store i64 %25, i64* %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %7
store i32 0, i32* %9
store i32 0, i32* %10
br label %28
28: ; preds = %57, %0
%29 = load i32, i32* %3
%30 = load i32*, i32** %2
%31 = call i64 @fgets(i8* %27, i32 %29, i32* %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %60
33: ; preds = %28
store i32 0, i32* %10
%34 = load i8*, i8** %7
%35 = call i8* @strtok(i8* %27, i8* %34)
store i8* %35, i8** %6
br label %36
36: ; preds = %54, %33
%37 = load i8*, i8** %6
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %57
39: ; preds = %36
%40 = load i32, i32* %10
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %54
42: ; preds = %39
%43 = load i8*, i8** %6
%44 = call double @atof(i8* %43)
%45 = load i32, i32* %9
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [10 x [8 x double]], [10 x [8 x double]]* %8, i64 0, i64 %46
%48 = load i32, i32* %10
%49 = sub nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [8 x double], [8 x double]* %47, i64 0, i64 %50
store double %44, double* %51
%52 = load i8*, i8** %7
%53 = call i8* @strtok(i8* null, i8* %52)
store i8* %53, i8** %6
br label %54
54: ; preds = %42, %39
%55 = load i32, i32* %10
%56 = add nsw i32 %55, 1
store i32 %56, i32* %10
br label %36
57: ; preds = %36
%58 = load i32, i32* %9
%59 = add nsw i32 %58, 1
store i32 %59, i32* %9
br label %28
60: ; preds = %28
%61 = call i64 @malloc(i32 800000)
%62 = inttoptr i64 %61 to double*
store double* %62, double** %11
%63 = call i64 @malloc(i32 800000)
%64 = inttoptr i64 %63 to double*
store double* %64, double** %12
%65 = call i64 @malloc(i32 800000)
%66 = inttoptr i64 %65 to double*
store double* %66, double** %13
%67 = call i64 @malloc(i32 800000)
%68 = inttoptr i64 %67 to double*
store double* %68, double** %14
%69 = call i64 @malloc(i32 800000)
%70 = inttoptr i64 %69 to double*
store double* %70, double** %15
%71 = call i64 @malloc(i32 800000)
%72 = inttoptr i64 %71 to double*
store double* %72, double** %16
%73 = call i64 @malloc(i32 80)
%74 = inttoptr i64 %73 to double*
store double* %74, double** %17
%75 = call i64 @malloc(i32 80000)
%76 = inttoptr i64 %75 to double*
store double* %76, double** %18
%77 = load double*, double** %17
%78 = load double*, double** %11
%79 = load double*, double** %12
%80 = load double*, double** %13
%81 = load double*, double** %14
%82 = load double*, double** %15
%83 = load double*, double** %16
%84 = getelementptr inbounds [10 x [8 x double]], [10 x [8 x double]]* %8, i64 0, i64 0
%85 = bitcast [8 x double]* %84 to double**
%86 = call i32 @CondIni(double* %77, double* %78, double* %79, double* %80, double* %81, double* %82, double* %83, double** %85)
%87 = load double*, double** %17
%88 = load double*, double** %11
%89 = load double*, double** %12
%90 = load double*, double** %13
%91 = load double*, double** %14
%92 = load double*, double** %15
%93 = load double*, double** %16
%94 = load double, double* @main.dt
%95 = call i32 @TiempoUno(double* %87, double* %88, double* %89, double* %90, double* %91, double* %92, double* %93, double %94)
%96 = load double*, double** %18
%97 = getelementptr inbounds double, double* %96, i64 0
store double 0.000000e+00, double* %97
%98 = load double, double* @main.dt
%99 = load double*, double** %18
%100 = getelementptr inbounds double, double* %99, i64 1
store double %98, double* %100
store i32 2, i32* %19
br label %101
101: ; preds = %127, %60
%102 = load i32, i32* %19
%103 = icmp slt i32 %102, 10000
br i1 %103, label %104, label %130
104: ; preds = %101
%105 = load double*, double** %18
%106 = load i32, i32* %19
%107 = sub nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %105, i64 %108
%110 = load double, double* %109
%111 = load double, double* @main.dt
%112 = fadd double %110, %111
%113 = load double*, double** %18
%114 = load i32, i32* %19
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double, double* %113, i64 %115
store double %112, double* %116
%117 = load double*, double** %17
%118 = load double*, double** %11
%119 = load double*, double** %12
%120 = load double*, double** %13
%121 = load double*, double** %14
%122 = load double*, double** %15
%123 = load double*, double** %16
%124 = load double, double* @main.dt
%125 = load i32, i32* %19
%126 = call i32 @Evoluciona(double* %117, double* %118, double* %119, double* %120, double* %121, double* %122, double* %123, double %124, i32 %125)
br label %127
127: ; preds = %104
%128 = load i32, i32* %19
%129 = add nsw i32 %128, 1
store i32 %129, i32* %19
br label %101
130: ; preds = %101
%131 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %131, i32** %20
store i32 0, i32* %21
br label %132
132: ; preds = %237, %130
%133 = load i32, i32* %21
%134 = icmp slt i32 %133, 10000
br i1 %134, label %135, label %240
135: ; preds = %132
store i32 0, i32* %22
br label %136
136: ; preds = %233, %135
%137 = load i32, i32* %22
%138 = icmp slt i32 %137, 10
br i1 %138, label %139, label %236
139: ; preds = %136
%140 = load i32, i32* %22
%141 = icmp eq i32 %140, 0
br i1 %141, label %142, label %174
142: ; preds = %139
%143 = load i32*, i32** %20
%144 = load double*, double** %18
%145 = load i32, i32* %21
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %144, i64 %146
%148 = load double, double* %147
%149 = load double*, double** %11
%150 = load i32, i32* %22
%151 = mul nsw i32 %150, 10000
%152 = load i32, i32* %21
%153 = add nsw i32 %151, %152
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %149, i64 %154
%156 = load double, double* %155
%157 = load double*, double** %12
%158 = load i32, i32* %22
%159 = mul nsw i32 %158, 10000
%160 = load i32, i32* %21
%161 = add nsw i32 %159, %160
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds double, double* %157, i64 %162
%164 = load double, double* %163
%165 = load double*, double** %13
%166 = load i32, i32* %22
%167 = mul nsw i32 %166, 10000
%168 = load i32, i32* %21
%169 = add nsw i32 %167, %168
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds double, double* %165, i64 %170
%172 = load double, double* %171
%173 = call i32 (i32*, i8*, double, double, double, ...) @fprintf(i32* %143, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %148, double %156, double %164, double %172)
br label %232
174: ; preds = %139
%175 = load i32, i32* %22
%176 = icmp eq i32 %175, 9
br i1 %176, label %177, label %204
177: ; preds = %174
%178 = load i32*, i32** %20
%179 = load double*, double** %11
%180 = load i32, i32* %22
%181 = mul nsw i32 %180, 10000
%182 = load i32, i32* %21
%183 = add nsw i32 %181, %182
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %179, i64 %184
%186 = load double, double* %185
%187 = load double*, double** %12
%188 = load i32, i32* %22
%189 = mul nsw i32 %188, 10000
%190 = load i32, i32* %21
%191 = add nsw i32 %189, %190
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds double, double* %187, i64 %192
%194 = load double, double* %193
%195 = load double*, double** %13
%196 = load i32, i32* %22
%197 = mul nsw i32 %196, 10000
%198 = load i32, i32* %21
%199 = add nsw i32 %197, %198
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds double, double* %195, i64 %200
%202 = load double, double* %201
%203 = call i32 (i32*, i8*, double, double, double, ...) @fprintf(i32* %178, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), double %186, double %194, double %202)
br label %231
204: ; preds = %174
%205 = load i32*, i32** %20
%206 = load double*, double** %11
%207 = load i32, i32* %22
%208 = mul nsw i32 %207, 10000
%209 = load i32, i32* %21
%210 = add nsw i32 %208, %209
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds double, double* %206, i64 %211
%213 = load double, double* %212
%214 = load double*, double** %12
%215 = load i32, i32* %22
%216 = mul nsw i32 %215, 10000
%217 = load i32, i32* %21
%218 = add nsw i32 %216, %217
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds double, double* %214, i64 %219
%221 = load double, double* %220
%222 = load double*, double** %13
%223 = load i32, i32* %22
%224 = mul nsw i32 %223, 10000
%225 = load i32, i32* %21
%226 = add nsw i32 %224, %225
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double, double* %222, i64 %227
%229 = load double, double* %228
%230 = call i32 (i32*, i8*, double, double, double, ...) @fprintf(i32* %205, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), double %213, double %221, double %229)
br label %231
231: ; preds = %204, %177
br label %232
232: ; preds = %231, %142
br label %233
233: ; preds = %232
%234 = load i32, i32* %22
%235 = add nsw i32 %234, 1
store i32 %235, i32* %22
br label %136
236: ; preds = %136
br label %237
237: ; preds = %236
%238 = load i32, i32* %21
%239 = add nsw i32 %238, 1
store i32 %239, i32* %21
br label %132
240: ; preds = %132
%241 = load i8*, i8** %4
%242 = load i32, i32* %1
ret i32 %242
}

LLVM IR (-O2):
@.str = [16 x i8] c"coordinates.csv\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c",\00"
@.str.3 = [17 x i8] c"Pos_Planetas.csv\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [17 x i8] c"%lf,%lf,%lf,%lf,\00"
@.str.6 = [13 x i8] c"%lf,%lf,%lf\0A\00"
@.str.7 = [13 x i8] c"%lf,%lf,%lf,\00"
define i32 @main() {
%1 = alloca [10 x [8 x double]]
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = alloca [300 x i8]
%4 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%5 = bitcast [10 x [8 x double]]* %1 to i8*
%6 = call i64 @fgets(i8* %4, i32 300, i32* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %25, label %8
8: ; preds = %0, %21
%9 = phi i64 [ %22, %21 ], [ 0, %0 ]
%10 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %21, label %12
12: ; preds = %8, %12
%13 = phi i64 [ %19, %12 ], [ 1, %8 ]
%14 = phi i8* [ %18, %12 ], [ %10, %8 ]
%15 = call double @atof(i8* %14)
%16 = add nsw i64 %13, -1
%17 = getelementptr inbounds [10 x [8 x double]], [10 x [8 x double]]* %1, i64 0, i64 %9, i64 %16
store double %15, double* %17
%18 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = add nuw i64 %13, 1
%20 = icmp eq i8* %18, null
br i1 %20, label %21, label %12
21: ; preds = %12, %8
%22 = add nuw i64 %9, 1
%23 = call i64 @fgets(i8* %4, i32 300, i32* %2)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %8
25: ; preds = %21, %0
%26 = call i64 @malloc(i32 800000)
%27 = inttoptr i64 %26 to double*
%28 = call i64 @malloc(i32 800000)
%29 = inttoptr i64 %28 to double*
%30 = call i64 @malloc(i32 800000)
%31 = inttoptr i64 %30 to double*
%32 = call i64 @malloc(i32 800000)
%33 = inttoptr i64 %32 to double*
%34 = call i64 @malloc(i32 800000)
%35 = inttoptr i64 %34 to double*
%36 = call i64 @malloc(i32 800000)
%37 = inttoptr i64 %36 to double*
%38 = call i64 @malloc(i32 80)
%39 = inttoptr i64 %38 to double*
%40 = call i64 @malloc(i32 80000)
%41 = inttoptr i64 %40 to double*
%42 = bitcast [10 x [8 x double]]* %1 to double**
%43 = call i32 @CondIni(double* %39, double* %27, double* %29, double* %31, double* %33, double* %35, double* %37, double** %42)
%44 = call i32 @TiempoUno(double* %39, double* %27, double* %29, double* %31, double* %33, double* %35, double* %37, double 1.000000e-03)
%45 = inttoptr i64 %40 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e-03>, <2 x double>* %45
%46 = getelementptr inbounds double, double* %41, i64 2
store double 2.000000e-03, double* %46
%47 = call i32 @Evoluciona(double* %39, double* %27, double* %29, double* %31, double* %33, double* %35, double* %37, double 1.000000e-03, i32 2)
br label %50
48: ; preds = %50
%49 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %60
50: ; preds = %25, %50
%51 = phi i64 [ 3, %25 ], [ %58, %50 ]
%52 = phi double* [ %46, %25 ], [ %55, %50 ]
%53 = load double, double* %52
%54 = fadd double %53, 1.000000e-03
%55 = getelementptr inbounds double, double* %41, i64 %51
store double %54, double* %55
%56 = trunc i64 %51 to i32
%57 = call i32 @Evoluciona(double* %39, double* %27, double* %29, double* %31, double* %33, double* %35, double* %37, double 1.000000e-03, i32 %56)
%58 = add nuw nsw i64 %51, 1
%59 = icmp eq i64 %58, 10000
br i1 %59, label %48, label %50
60: ; preds = %48, %71
%61 = phi i64 [ 0, %48 ], [ %72, %71 ]
%62 = add nuw nsw i64 %61, 90000
%63 = getelementptr inbounds double, double* %27, i64 %62
%64 = getelementptr inbounds double, double* %29, i64 %62
%65 = getelementptr inbounds double, double* %31, i64 %62
%66 = getelementptr inbounds double, double* %41, i64 %61
%67 = getelementptr inbounds double, double* %27, i64 %61
%68 = getelementptr inbounds double, double* %29, i64 %61
%69 = getelementptr inbounds double, double* %31, i64 %61
br label %74
70: ; preds = %71
ret i32 0
71: ; preds = %98
%72 = add nuw nsw i64 %61, 1
%73 = icmp eq i64 %72, 10000
br i1 %73, label %70, label %60
74: ; preds = %60, %98
%75 = phi i64 [ 0, %60 ], [ %99, %98 ]
%76 = trunc i64 %75 to i32
switch i32 %76, label %88 [
i32 0, label %77
i32 9, label %83
]
77: ; preds = %74
%78 = load double, double* %66
%79 = load double, double* %67
%80 = load double, double* %68
%81 = load double, double* %69
%82 = call i32 (i32*, i8*, double, double, double, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %78, double %79, double %80, double %81)
br label %98
83: ; preds = %74
%84 = load double, double* %63
%85 = load double, double* %64
%86 = load double, double* %65
%87 = call i32 (i32*, i8*, double, double, double, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), double %84, double %85, double %86)
br label %98
88: ; preds = %74
%89 = mul nuw nsw i64 %75, 10000
%90 = add nuw nsw i64 %89, %61
%91 = getelementptr inbounds double, double* %27, i64 %90
%92 = load double, double* %91
%93 = getelementptr inbounds double, double* %29, i64 %90
%94 = load double, double* %93
%95 = getelementptr inbounds double, double* %31, i64 %90
%96 = load double, double* %95
%97 = call i32 (i32*, i8*, double, double, double, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), double %92, double %94, double %96)
br label %98
98: ; preds = %77, %88, %83
%99 = add nuw nsw i64 %75, 1
%100 = icmp eq i64 %99, 10
br i1 %100, label %71, label %74
}