#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*/ GetMarsSatCoor(float, int, double *, double *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int body;
  double jd2k;
  double start = -20000.0;
  double end = +20000.0;
  double step = 225.0;
  double xyzdot[3];
  double xyz[3];
  printf("{\n");
  for (body = 0; body < 2; body++) {
    printf("\t\"%d\": [\n", body);
    for (jd2k = start; jd2k < end; jd2k += step) {
      float jd = jd2k + 2451545.0;
      GetMarsSatCoor(jd, body, xyz, xyzdot);
      printf("\t\t[%.13f, %.13f, %.13f, %.13f, %.13f, %.13f, %.13f],\n", jd2k,
             xyz[0], xyz[1], xyz[2], xyzdot[0], xyzdot[1], xyzdot[2]);
    }
    printf("\t],\n");
  }
  printf("}\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1230 <main+0x110>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1214 <main+0xf4>
movsd  0xe6c(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x64(%rbp),%xmm0
mov    -0x8(%rbp),%edi
lea    -0x60(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1040 <GetMarsSatCoor@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
lea    0xe34(%rip),%rdi
mov    $0x7,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1190 <main+0x70>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116b <main+0x4b>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
lea    0xecb(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xea2(%rip),%xmm0
mov    $0xffffb0ff,%ebp
lea    0x10(%rsp),%r14
lea    0x30(%rsp),%r15
lea    0xeae(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xe74(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
xor    %edi,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <GetMarsSatCoor@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  0x30(%rsp),%xmm4
movsd  0x38(%rsp),%xmm5
movsd  0x40(%rsp),%xmm6
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x7,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe29(%rip),%xmm0
add    $0xe1,%ebp
cmp    $0x4d3f,%ebp
jl     1180 <main+0x50>
lea    0xe60(%rip),%rdi
call   1030 <puts@plt>
lea    0xe10(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xde4(%rip),%xmm0
mov    $0xffffb0ff,%ebp
lea    0x10(%rsp),%r14
lea    0x30(%rsp),%r15
lea    0xdf0(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xdb4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x1,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <GetMarsSatCoor@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  0x30(%rsp),%xmm4
movsd  0x38(%rsp),%xmm5
movsd  0x40(%rsp),%xmm6
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x7,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xd66(%rip),%xmm0
add    $0xe1,%ebp
cmp    $0x4d3f,%ebp
jl     1240 <main+0x110>
lea    0xd9d(%rip),%rdi
call   1030 <puts@plt>
lea    0xd8f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [10 x i8] c"\09\22%d\22: [\0A\00"
@.str.2 = [54 x i8] c"\09\09[%.13f, %.13f, %.13f, %.13f, %.13f, %.13f, %.13f],\0A\00"
@.str.3 = [5 x i8] c"\09],\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca [3 x double]
%8 = alloca [3 x double]
%9 = alloca float
store i32 0, i32* %1
store double -2.000000e+04, double* %4
store double 2.000000e+04, double* %5
store double 2.250000e+02, double* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %11
11: ; preds = %51, %0
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %54
14: ; preds = %11
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load double, double* %4
store double %17, double* %3
br label %18
18: ; preds = %45, %14
%19 = load double, double* %3
%20 = load double, double* %5
%21 = fcmp olt double %19, %20
br i1 %21, label %22, label %49
22: ; preds = %18
%23 = load double, double* %3
%24 = fadd double %23, 0x4142B42C80000000
%25 = fptrunc double %24 to float
store float %25, float* %9
%26 = load float, float* %9
%27 = load i32, i32* %2
%28 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%29 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%30 = call i32 @GetMarsSatCoor(float %26, i32 %27, double* %28, double* %29)
%31 = load double, double* %3
%32 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%33 = load double, double* %32
%34 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 1
%35 = load double, double* %34
%36 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 2
%37 = load double, double* %36
%38 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%39 = load double, double* %38
%40 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%41 = load double, double* %40
%42 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%43 = load double, double* %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), double %31, double %33, double %35, double %37, double %39, double %41, double %43)
br label %45
45: ; preds = %22
%46 = load double, double* %6
%47 = load double, double* %3
%48 = fadd double %47, %46
store double %48, double* %3
br label %18
49: ; preds = %18
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %49
%52 = load i32, i32* %2
%53 = add nsw i32 %52, 1
store i32 %53, i32* %2
br label %11
54: ; preds = %11
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"\09\22%d\22: [\0A\00"
@.str.2 = [54 x i8] c"\09\09[%.13f, %.13f, %.13f, %.13f, %.13f, %.13f, %.13f],\0A\00"
@str = [2 x i8] c"{\00"
@str.5 = [2 x i8] c"}\00"
@str.6 = [4 x i8] c"\09],\00"
define i32 @main() {
%1 = alloca [3 x double]
%2 = alloca [3 x double]
%3 = bitcast [3 x double]* %1 to i8*
%4 = bitcast [3 x double]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%7 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%8 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%9 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
%10 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%11 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %13
13: ; preds = %0, %13
%14 = phi i32 [ -20000, %0 ], [ %26, %13 ]
%15 = sitofp i32 %14 to double
%16 = fadd double %15, 0x4142B42C80000000
%17 = fptrunc double %16 to float
%18 = call i32 @GetMarsSatCoor(float %17, i32 0, double* %6, double* %7)
%19 = load double, double* %6
%20 = load double, double* %8
%21 = load double, double* %9
%22 = load double, double* %7
%23 = load double, double* %10
%24 = load double, double* %11
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), double %15, double %19, double %20, double %21, double %22, double %23, double %24)
%26 = add nsw i32 %14, 225
%27 = icmp slt i32 %14, 19775
br i1 %27, label %13, label %28
28: ; preds = %13
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %31
31: ; preds = %31, %28
%32 = phi i32 [ -20000, %28 ], [ %44, %31 ]
%33 = sitofp i32 %32 to double
%34 = fadd double %33, 0x4142B42C80000000
%35 = fptrunc double %34 to float
%36 = call i32 @GetMarsSatCoor(float %35, i32 1, double* %6, double* %7)
%37 = load double, double* %6
%38 = load double, double* %8
%39 = load double, double* %9
%40 = load double, double* %7
%41 = load double, double* %10
%42 = load double, double* %11
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), double %33, double %37, double %38, double %39, double %40, double %41, double %42)
%44 = add nsw i32 %32, 225
%45 = icmp slt i32 %32, 19775
br i1 %45, label %31, label %46
46: ; preds = %31
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0))
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}