#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*/ time_t;

/* Variables and functions */
double *calcposvel(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double, double, ...);
double sqrt(double);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  time_t t = time(NULL);
  double *result = calcposvel(t);
  int index = 0;
  int planeti;
  if (result) {
    system("cls");
    fprintf(stdout, "julian date %15.8lf, %15.8lf\n", result[index],
            result[index + 1]);
    index += 2;
    for (planeti = 0; planeti < 17; ++planeti) {
      fprintf(stdout,
              "object %d: %15.8lf, %15.8lf, %15.8lf, \n\t%15.8lf, %15.8lf, "
              "%15.8lf\n",
              planeti, result[index + 0], result[index + 1], result[index + 2],
              result[index + 3], result[index + 4], result[index + 5]);
      fprintf(stdout, "\t dist,speed: %15.8lf, %15.8lf\n",
              sqrt(result[index + 0] * result[index + 0] +
                   result[index + 1] * result[index + 1] +
                   result[index + 2] * result[index + 2]),
              sqrt(result[index + 3] * result[index + 3] +
                   result[index + 4] * result[index + 4] +
                   result[index + 5] * result[index + 5]));
      index += 6;
    }
    return 0;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <calcposvel@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     13c3 <main+0x273>
lea    0xe69(%rip),%rdi
call   1030 <system@plt>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xe39(%rip),%rsi
mov    $0x2,%al
call   1050 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x11,-0x28(%rbp)
jge    13b7 <main+0x267>
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
cvtsi2sdl -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm4
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm5
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm6
lea    0xdb5(%rip),%rsi
mov    $0x7,%al
call   1050 <fprintf@plt>
mov    0x2d65(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
mov    -0x34(%rbp),%edi
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
lea    0xccc(%rip),%rsi
mov    $0x2,%al
call   1050 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11e2 <main+0x92>
movl   $0x0,-0x4(%rbp)
jmp    13ca <main+0x27a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <calcposvel@plt>
test   %rax,%rax
je     12cc <main+0x17c>
mov    %rax,%rbx
lea    0xe91(%rip),%rdi
call   1030 <system@plt>
mov    0x2e55(%rip),%r12
mov    (%r12),%edi
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
lea    0xe75(%rip),%rsi
mov    $0x2,%al
call   1050 <fprintf@plt>
mov    $0x38,%ebp
lea    0xe80(%rip),%r14
lea    0xebc(%rip),%r15
xorpd  %xmm0,%xmm0
jmp    1204 <main+0xb4>
nop
movsd  %xmm2,0x8(%rsp)
call   1070 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
movapd %xmm0,%xmm1
mov    %r13d,%edi
mov    %r15,%rsi
movapd %xmm2,%xmm0
mov    $0x2,%al
call   1050 <fprintf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0xe0c(%rip),%xmm0
add    $0x30,%rbp
cmp    $0x368,%ebp
je     12c8 <main+0x178>
mov    (%r12),%edi
movsd  -0x28(%rbx,%rbp,1),%xmm1
movsd  -0x20(%rbx,%rbp,1),%xmm2
movsd  -0x18(%rbx,%rbp,1),%xmm3
movsd  -0x10(%rbx,%rbp,1),%xmm4
movsd  -0x8(%rbx,%rbp,1),%xmm5
movsd  (%rbx,%rbp,1),%xmm6
mov    %r14,%rsi
movsd  %xmm0,0x10(%rsp)
mov    $0x7,%al
call   1050 <fprintf@plt>
mov    (%r12),%r13d
movsd  -0x28(%rbx,%rbp,1),%xmm1
movsd  -0x20(%rbx,%rbp,1),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbx,%rbp,1),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xd9b(%rip),%xmm0
jb     1280 <main+0x130>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
jmp    1289 <main+0x139>
nopl   0x0(%rax,%rax,1)
call   1070 <sqrt@plt>
movapd %xmm0,%xmm2
movsd  -0x10(%rbx,%rbp,1),%xmm1
movsd  -0x8(%rbx,%rbp,1),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  (%rbx,%rbp,1),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xd52(%rip),%xmm0
jb     11c0 <main+0x70>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    11d5 <main+0x85>
xor    %eax,%eax
jmp    12d1 <main+0x181>
mov    $0xffffffff,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@stdout = global i32 0
@.str.1 = [30 x i8] c"julian date %15.8lf, %15.8lf\0A\00"
@.str.2 = [67 x i8] c"object %d: %15.8lf, %15.8lf, %15.8lf, \0A\09%15.8lf, %15.8lf, %15.8lf\0A\00"
@.str.3 = [32 x i8] c"\09 dist,speed: %15.8lf, %15.8lf\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 i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @time(i32* null)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call double* @calcposvel(i32 %11)
store double* %12, double** %7
store i32 0, i32* %8
%13 = load double*, double** %7
%14 = icmp ne double* %13, null
br i1 %14, label %15, label %164
15: ; preds = %2
%16 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @stdout
%18 = load double*, double** %7
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
%22 = load double, double* %21
%23 = load double*, double** %7
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %23, i64 %26
%28 = load double, double* %27
%29 = call i32 (i32, i8*, double, double, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), double %22, double %28)
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 2
store i32 %31, i32* %8
store i32 0, i32* %9
br label %32
32: ; preds = %160, %15
%33 = load i32, i32* %9
%34 = icmp slt i32 %33, 17
br i1 %34, label %35, label %163
35: ; preds = %32
%36 = load i32, i32* @stdout
%37 = load i32, i32* %9
%38 = sitofp i32 %37 to double
%39 = load double*, double** %7
%40 = load i32, i32* %8
%41 = add nsw i32 %40, 0
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %39, i64 %42
%44 = load double, double* %43
%45 = load double*, double** %7
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %45, i64 %48
%50 = load double, double* %49
%51 = load double*, double** %7
%52 = load i32, i32* %8
%53 = add nsw i32 %52, 2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %51, i64 %54
%56 = load double, double* %55
%57 = load double*, double** %7
%58 = load i32, i32* %8
%59 = add nsw i32 %58, 3
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %57, i64 %60
%62 = load double, double* %61
%63 = load double*, double** %7
%64 = load i32, i32* %8
%65 = add nsw i32 %64, 4
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %63, i64 %66
%68 = load double, double* %67
%69 = load double*, double** %7
%70 = load i32, i32* %8
%71 = add nsw i32 %70, 5
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %69, i64 %72
%74 = load double, double* %73
%75 = call i32 (i32, i8*, double, double, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), double %38, double %44, double %50, double %56, double %62, double %68, double %74)
%76 = load i32, i32* @stdout
%77 = load double*, double** %7
%78 = load i32, i32* %8
%79 = add nsw i32 %78, 0
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %77, i64 %80
%82 = load double, double* %81
%83 = load double*, double** %7
%84 = load i32, i32* %8
%85 = add nsw i32 %84, 0
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %83, i64 %86
%88 = load double, double* %87
%89 = load double*, double** %7
%90 = load i32, i32* %8
%91 = add nsw i32 %90, 1
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double, double* %89, i64 %92
%94 = load double, double* %93
%95 = load double*, double** %7
%96 = load i32, i32* %8
%97 = add nsw i32 %96, 1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %95, i64 %98
%100 = load double, double* %99
%101 = fmul double %94, %100
%102 = call double @llvm.fmuladd.f64(double %82, double %88, double %101)
%103 = load double*, double** %7
%104 = load i32, i32* %8
%105 = add nsw i32 %104, 2
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %103, i64 %106
%108 = load double, double* %107
%109 = load double*, double** %7
%110 = load i32, i32* %8
%111 = add nsw i32 %110, 2
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %109, i64 %112
%114 = load double, double* %113
%115 = call double @llvm.fmuladd.f64(double %108, double %114, double %102)
%116 = call double @sqrt(double %115)
%117 = load double*, double** %7
%118 = load i32, i32* %8
%119 = add nsw i32 %118, 3
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %117, i64 %120
%122 = load double, double* %121
%123 = load double*, double** %7
%124 = load i32, i32* %8
%125 = add nsw i32 %124, 3
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %123, i64 %126
%128 = load double, double* %127
%129 = load double*, double** %7
%130 = load i32, i32* %8
%131 = add nsw i32 %130, 4
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double, double* %129, i64 %132
%134 = load double, double* %133
%135 = load double*, double** %7
%136 = load i32, i32* %8
%137 = add nsw i32 %136, 4
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %135, i64 %138
%140 = load double, double* %139
%141 = fmul double %134, %140
%142 = call double @llvm.fmuladd.f64(double %122, double %128, double %141)
%143 = load double*, double** %7
%144 = load i32, i32* %8
%145 = add nsw i32 %144, 5
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %143, i64 %146
%148 = load double, double* %147
%149 = load double*, double** %7
%150 = load i32, i32* %8
%151 = add nsw i32 %150, 5
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %149, i64 %152
%154 = load double, double* %153
%155 = call double @llvm.fmuladd.f64(double %148, double %154, double %142)
%156 = call double @sqrt(double %155)
%157 = call i32 (i32, i8*, double, double, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), double %116, double %156)
%158 = load i32, i32* %8
%159 = add nsw i32 %158, 6
store i32 %159, i32* %8
br label %160
160: ; preds = %35
%161 = load i32, i32* %9
%162 = add nsw i32 %161, 1
store i32 %162, i32* %9
br label %32
163: ; preds = %32
store i32 0, i32* %3
br label %165
164: ; preds = %2
store i32 -1, i32* %3
br label %165
165: ; preds = %164, %163
%166 = load i32, i32* %3
ret i32 %166
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@stdout = global i32 0
@.str.1 = [30 x i8] c"julian date %15.8lf, %15.8lf\0A\00"
@.str.2 = [67 x i8] c"object %d: %15.8lf, %15.8lf, %15.8lf, \0A\09%15.8lf, %15.8lf, %15.8lf\0A\00"
@.str.3 = [32 x i8] c"\09 dist,speed: %15.8lf, %15.8lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call double* @calcposvel(i32 %3)
%5 = icmp eq double* %4, null
br i1 %5, label %55, label %6
6: ; preds = %2
%7 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = load double, double* %4
%10 = getelementptr inbounds double, double* %4, i64 1
%11 = load double, double* %10
%12 = tail call i32 (i32, i8*, double, double, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), double %9, double %11)
br label %13
13: ; preds = %6, %13
%14 = phi i64 [ 2, %6 ], [ %52, %13 ]
%15 = phi i32 [ 0, %6 ], [ %53, %13 ]
%16 = load i32, i32* @stdout
%17 = sitofp i32 %15 to double
%18 = getelementptr inbounds double, double* %4, i64 %14
%19 = load double, double* %18
%20 = or i64 %14, 1
%21 = getelementptr inbounds double, double* %4, i64 %20
%22 = load double, double* %21
%23 = add nuw nsw i64 %14, 2
%24 = getelementptr inbounds double, double* %4, i64 %23
%25 = load double, double* %24
%26 = add nuw nsw i64 %14, 3
%27 = getelementptr inbounds double, double* %4, i64 %26
%28 = load double, double* %27
%29 = add nuw nsw i64 %14, 4
%30 = getelementptr inbounds double, double* %4, i64 %29
%31 = load double, double* %30
%32 = add nuw nsw i64 %14, 5
%33 = getelementptr inbounds double, double* %4, i64 %32
%34 = load double, double* %33
%35 = tail call i32 (i32, i8*, double, double, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), double %17, double %19, double %22, double %25, double %28, double %31, double %34)
%36 = load i32, i32* @stdout
%37 = load double, double* %18
%38 = load double, double* %21
%39 = fmul double %38, %38
%40 = tail call double @llvm.fmuladd.f64(double %37, double %37, double %39)
%41 = load double, double* %24
%42 = tail call double @llvm.fmuladd.f64(double %41, double %41, double %40)
%43 = tail call double @sqrt(double %42)
%44 = load double, double* %27
%45 = load double, double* %30
%46 = fmul double %45, %45
%47 = tail call double @llvm.fmuladd.f64(double %44, double %44, double %46)
%48 = load double, double* %33
%49 = tail call double @llvm.fmuladd.f64(double %48, double %48, double %47)
%50 = tail call double @sqrt(double %49)
%51 = tail call i32 (i32, i8*, double, double, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), double %43, double %50)
%52 = add nuw nsw i64 %14, 6
%53 = add nuw nsw i32 %15, 1
%54 = icmp eq i32 %53, 17
br i1 %54, label %55, label %13
55: ; preds = %13, %2
%56 = phi i32 [ -1, %2 ], [ 0, %13 ]
ret i32 %56
}