#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 */
double atof(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double, double,
                           double);
double *malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ velocidad(double, double, double *, double *, double *,
                             double *, double *, double *, double *, int);
int main(int argc, char **argv) {
  FILE *fp;
  double nE0 = atof(argv[1]);
  double nalpha = atof(argv[2]);
  char output1[512];
  char output2[512];
  char *line = "_";
  char *trayectoria = "trayectoria";
  char *dat = ".dat";
  char name[512] = "";
  strcat(name, trayectoria);
  strcat(name, line);
  strcat(name, argv[1]);
  strcat(name, line);
  strcat(name, argv[2]);
  strcat(name, dat);
  fp = fopen(name, "ab+");
  double *x;
  double *y;
  double *z;
  double *vx;
  double *vy;
  double *vz;
  double *t;
  double tmax = 100.0;
  double dt = 0.0001;
  int npoints = (int)(tmax / dt);
  x = malloc(npoints * sizeof(float));
  y = malloc(npoints * sizeof(float));
  z = malloc(npoints * sizeof(float));
  vx = malloc(npoints * sizeof(float));
  vy = malloc(npoints * sizeof(float));
  vz = malloc(npoints * sizeof(float));
  t = malloc(npoints * sizeof(float));
  velocidad(nE0, nalpha, x, y, z, t, vx, vy, vz, npoints);
  int counter;
  for (counter = 0; counter < npoints; counter++) {
    fprintf(fp, "%f %f %f %f\n", x[counter], y[counter], z[counter],
            t[counter]);
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x6b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
lea    0xe4c(%rip),%rax
mov    %rax,-0x438(%rbp)
lea    0xe40(%rip),%rax
mov    %rax,-0x440(%rbp)
lea    0xe3e(%rip),%rax
mov    %rax,-0x448(%rbp)
lea    -0x650(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
lea    -0x650(%rbp),%rdi
mov    -0x440(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0x650(%rbp),%rdi
mov    -0x438(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0x650(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   10a0 <strcat@plt>
lea    -0x650(%rbp),%rdi
mov    -0x438(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0x650(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   10a0 <strcat@plt>
lea    -0x650(%rbp),%rdi
mov    -0x448(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0x650(%rbp),%rdi
lea    0xda7(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
movsd  0xd7b(%rip),%xmm0
movsd  %xmm0,-0x690(%rbp)
ff
movsd  0xd63(%rip),%xmm0
movsd  %xmm0,-0x698(%rbp)
ff
movsd  -0x690(%rbp),%xmm0
ff
divsd  -0x698(%rbp),%xmm0
ff
cvttsd2si %xmm0,%eax
mov    %eax,-0x69c(%rbp)
movslq -0x69c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x658(%rbp)
movslq -0x69c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x660(%rbp)
movslq -0x69c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x668(%rbp)
movslq -0x69c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x670(%rbp)
movslq -0x69c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x678(%rbp)
movslq -0x69c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x680(%rbp)
movslq -0x69c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x688(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x658(%rbp),%rdi
mov    -0x660(%rbp),%rsi
mov    -0x668(%rbp),%rdx
mov    -0x688(%rbp),%rcx
mov    -0x670(%rbp),%r8
mov    -0x678(%rbp),%r9
mov    -0x680(%rbp),%r10
mov    -0x69c(%rbp),%eax
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1080 <velocidad@plt>
movl   $0x0,-0x6a0(%rbp)
mov    -0x6a0(%rbp),%eax
cmp    -0x69c(%rbp),%eax
jge    1448 <main+0x2c8>
mov    -0x18(%rbp),%rdi
mov    -0x658(%rbp),%rax
movslq -0x6a0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x660(%rbp),%rax
movslq -0x6a0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x668(%rbp),%rax
movslq -0x6a0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x688(%rbp),%rax
movslq -0x6a0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
lea    0xbf8(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x6a0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6a0(%rbp)
jmp    13c6 <main+0x246>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x6b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x238,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x28(%rsp)
mov    0x10(%rbx),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x20(%rsp)
lea    0x30(%rsp),%rbp
xor    %r14d,%r14d
mov    $0x200,%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe32(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
lea    0xe21(%rip),%r15
mov    %rbp,%rdi
mov    %r15,%rsi
call   10a0 <strcat@plt>
mov    0x8(%rbx),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   10a0 <strcat@plt>
mov    0x10(%rbx),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
lea    0xdfa(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
lea    0xdf0(%rip),%rsi
mov    %rbp,%rdi
call   1090 <fopen@plt>
mov    %rax,0x8(%rsp)
mov    $0x3d0900,%edi
call   1070 <malloc@plt>
mov    %rax,%r15
mov    $0x3d0900,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
mov    $0x3d0900,%edi
call   1070 <malloc@plt>
mov    %rax,%r13
mov    $0x3d0900,%edi
call   1070 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    $0x3d0900,%edi
call   1070 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    $0x3d0900,%edi
call   1070 <malloc@plt>
mov    %rax,%rbp
mov    $0x3d0900,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rax,%rcx
mov    0x18(%rsp),%r8
mov    0x10(%rsp),%r9
push   $0xf4240
push   %rbp
call   1080 <velocidad@plt>
add    $0x10,%rsp
lea    0xd50(%rip),%rbp
nopw   0x0(%rax,%rax,1)
movsd  (%r15,%r14,8),%xmm0
movsd  (%r12,%r14,8),%xmm1
movsd  0x0(%r13,%r14,8),%xmm2
movsd  (%rbx,%r14,8),%xmm3
mov    0x8(%rsp),%rdi
mov    %rbp,%rsi
call   1060 <fprintf@plt>
add    $0x1,%r14
cmp    $0xf4240,%r14
jne    12d0 <main+0x150>
mov    0x8(%rsp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x238,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"_\00"
@.str.1 = [12 x i8] c"trayectoria\00"
@.str.2 = [5 x i8] c".dat\00"
@.str.3 = [4 x i8] c"ab+\00"
@.str.4 = [13 x i8] c"%f %f %f %f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call double @atof(i8* %5)
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call double @atof(i8* %8)
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %4
%14 = call i32 @strcat(i8* %10, i8* %13)
%15 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %7
%17 = call i32 @strcat(i8* %10, i8* %16)
%18 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%20 = call double* @malloc(i32 4000000)
%21 = call double* @malloc(i32 4000000)
%22 = call double* @malloc(i32 4000000)
%23 = call double* @malloc(i32 4000000)
%24 = call double* @malloc(i32 4000000)
%25 = call double* @malloc(i32 4000000)
%26 = call double* @malloc(i32 4000000)
%27 = call i32 @velocidad(double %6, double %9, double* %20, double* %21, double* %22, double* %26, double* %23, double* %24, double* %25, i32 1000000)
br label %28
28: ; preds = %2, %28
%29 = phi i64 [ 0, %2 ], [ %39, %28 ]
%30 = getelementptr inbounds double, double* %20, i64 %29
%31 = load double, double* %30
%32 = getelementptr inbounds double, double* %21, i64 %29
%33 = load double, double* %32
%34 = getelementptr inbounds double, double* %22, i64 %29
%35 = load double, double* %34
%36 = getelementptr inbounds double, double* %26, i64 %29
%37 = load double, double* %36
%38 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %31, double %33, double %35, double %37)
%39 = add nuw nsw i64 %29, 1
%40 = icmp eq i64 %39, 1000000
br i1 %40, label %41, label %28
41: ; preds = %28
%42 = call i32 @fclose(i32* %19)
ret i32 0
}