#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 */
double dot(double const *, double const *, int);
double sqrt(double);
void deq(const double *x, double *xdot, const double *acc) {
  double a, b, c, r2 = dot(x, x, 3), r3 = r2 * sqrt(r2),
                  omg2 = ((7.292115E-5) * (7.292115E-5));
  if (r2 <= 0.0) {
    xdot[0] = xdot[1] = xdot[2] = xdot[3] = xdot[4] = xdot[5] = 0.0;
    return;
  }
  a = 1.5 * 1.0826257E-3 * 3.9860044E14 * ((6378136.0) * (6378136.0)) / r2 / r3;
  b = 5.0 * x[2] * x[2] / r2;
  c = -3.9860044E14 / r3 - a * (1.0 - b);
  xdot[0] = x[3];
  xdot[1] = x[4];
  xdot[2] = x[5];
  xdot[3] = (c + omg2) * x[0] + 2.0 * 7.292115E-5 * x[4] + acc[0];
  xdot[4] = (c + omg2) * x[1] - 2.0 * 7.292115E-5 * x[3] + acc[1];
  xdot[5] = (c - 2.0 * a) * x[2] + acc[2];
}


x86 assembly (clang, -O0):
<deq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3,%edx
call   1030 <dot@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe88(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x38(%rbp),%xmm0
jb     11d7 <deq+0xb7>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x28(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1350 <deq+0x230>
movsd  0xe49(%rip),%xmm0
divsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xe26(%rip),%xmm0
mulsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xdfe(%rip),%xmm1
divsd  -0x40(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xde4(%rip),%xmm2
subsd  -0x28(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x30(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0xd60(%rip),%xmm1
mulsd  0x20(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x30(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0xd23(%rip),%xmm1
mulsd  0x18(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
addsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x30(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x28(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deq>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdi,%rsi
mov    $0x3,%edx
call   1030 <dot@plt>
movapd %xmm0,%xmm5
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     117a <deq+0x5a>
xorps  %xmm0,%xmm0
sqrtsd %xmm5,%xmm0
ucomisd %xmm5,%xmm1
jb     1199 <deq+0x79>
xorpd  %xmm0,%xmm0
movupd %xmm0,0x10(%r15)
movupd %xmm0,(%r15)
movq   $0x0,0x20(%r15)
xorpd  %xmm2,%xmm2
jmp    1267 <deq+0x147>
movapd %xmm5,%xmm0
movsd  %xmm5,0x8(%rsp)
call   1040 <sqrt@plt>
xorpd  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm5
ucomisd %xmm5,%xmm1
jae    115a <deq+0x3a>
mulsd  %xmm5,%xmm0
movsd  0xe5b(%rip),%xmm1
divsd  %xmm5,%xmm1
divsd  %xmm0,%xmm1
movsd  0x10(%rbx),%xmm2
movsd  0x18(%rbx),%xmm3
movsd  0xe49(%rip),%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm4
divsd  %xmm5,%xmm4
movsd  0xe3d(%rip),%xmm2
addsd  0xe3d(%rip),%xmm4
divsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm4
subsd  %xmm4,%xmm2
movsd  %xmm3,(%r15)
movsd  0x20(%rbx),%xmm0
movsd  %xmm0,0x8(%r15)
movsd  0x28(%rbx),%xmm0
movsd  %xmm0,0x10(%r15)
movsd  0xe16(%rip),%xmm0
movsd  0x20(%rbx),%xmm3
mulsd  0xe11(%rip),%xmm3
addsd  %xmm2,%xmm0
movsd  (%rbx),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
addsd  (%r14),%xmm4
movsd  %xmm4,0x18(%r15)
movsd  0x18(%rbx),%xmm3
mulsd  0xdf1(%rip),%xmm3
mulsd  0x8(%rbx),%xmm0
addsd  %xmm3,%xmm0
addsd  0x8(%r14),%xmm0
movsd  %xmm0,0x20(%r15)
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm2
mulsd  0x10(%rbx),%xmm2
addsd  0x10(%r14),%xmm2
movsd  %xmm2,0x28(%r15)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @deq(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%13 = load double*, double** %4
%14 = load double*, double** %4
%15 = call double @dot(double* %13, double* %14, i32 3)
store double %15, double* %10
%16 = load double, double* %10
%17 = load double, double* %10
%18 = call double @sqrt(double %17)
%19 = fmul double %16, %18
store double %19, double* %11
store double 0x3E36D6A58867B448, double* %12
%20 = load double, double* %10
%21 = fcmp ole double %20, 0.000000e+00
br i1 %21, label %22, label %35
22: ; preds = %3
%23 = load double*, double** %5
%24 = getelementptr inbounds double, double* %23, i64 5
store double 0.000000e+00, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 4
store double 0.000000e+00, double* %26
%27 = load double*, double** %5
%28 = getelementptr inbounds double, double* %27, i64 3
store double 0.000000e+00, double* %28
%29 = load double*, double** %5
%30 = getelementptr inbounds double, double* %29, i64 2
store double 0.000000e+00, double* %30
%31 = load double*, double** %5
%32 = getelementptr inbounds double, double* %31, i64 1
store double 0.000000e+00, double* %32
%33 = load double*, double** %5
%34 = getelementptr inbounds double, double* %33, i64 0
store double 0.000000e+00, double* %34
br label %119
35: ; preds = %3
%36 = load double, double* %10
%37 = fdiv double 0x4535C828F70457CC, %36
%38 = load double, double* %11
%39 = fdiv double %37, %38
store double %39, double* %7
%40 = load double*, double** %4
%41 = getelementptr inbounds double, double* %40, i64 2
%42 = load double, double* %41
%43 = fmul double 5.000000e+00, %42
%44 = load double*, double** %4
%45 = getelementptr inbounds double, double* %44, i64 2
%46 = load double, double* %45
%47 = fmul double %43, %46
%48 = load double, double* %10
%49 = fdiv double %47, %48
store double %49, double* %8
%50 = load double, double* %11
%51 = fdiv double 0xC2F6A8665A22E000, %50
%52 = load double, double* %7
%53 = load double, double* %8
%54 = fsub double 1.000000e+00, %53
%55 = fneg double %52
%56 = call double @llvm.fmuladd.f64(double %55, double %54, double %51)
store double %56, double* %9
%57 = load double*, double** %4
%58 = getelementptr inbounds double, double* %57, i64 3
%59 = load double, double* %58
%60 = load double*, double** %5
%61 = getelementptr inbounds double, double* %60, i64 0
store double %59, double* %61
%62 = load double*, double** %4
%63 = getelementptr inbounds double, double* %62, i64 4
%64 = load double, double* %63
%65 = load double*, double** %5
%66 = getelementptr inbounds double, double* %65, i64 1
store double %64, double* %66
%67 = load double*, double** %4
%68 = getelementptr inbounds double, double* %67, i64 5
%69 = load double, double* %68
%70 = load double*, double** %5
%71 = getelementptr inbounds double, double* %70, i64 2
store double %69, double* %71
%72 = load double, double* %9
%73 = load double, double* %12
%74 = fadd double %72, %73
%75 = load double*, double** %4
%76 = getelementptr inbounds double, double* %75, i64 0
%77 = load double, double* %76
%78 = load double*, double** %4
%79 = getelementptr inbounds double, double* %78, i64 4
%80 = load double, double* %79
%81 = fmul double 0x3F231DA7D157DB65, %80
%82 = call double @llvm.fmuladd.f64(double %74, double %77, double %81)
%83 = load double*, double** %6
%84 = getelementptr inbounds double, double* %83, i64 0
%85 = load double, double* %84
%86 = fadd double %82, %85
%87 = load double*, double** %5
%88 = getelementptr inbounds double, double* %87, i64 3
store double %86, double* %88
%89 = load double, double* %9
%90 = load double, double* %12
%91 = fadd double %89, %90
%92 = load double*, double** %4
%93 = getelementptr inbounds double, double* %92, i64 1
%94 = load double, double* %93
%95 = load double*, double** %4
%96 = getelementptr inbounds double, double* %95, i64 3
%97 = load double, double* %96
%98 = fmul double 0x3F231DA7D157DB65, %97
%99 = fneg double %98
%100 = call double @llvm.fmuladd.f64(double %91, double %94, double %99)
%101 = load double*, double** %6
%102 = getelementptr inbounds double, double* %101, i64 1
%103 = load double, double* %102
%104 = fadd double %100, %103
%105 = load double*, double** %5
%106 = getelementptr inbounds double, double* %105, i64 4
store double %104, double* %106
%107 = load double, double* %9
%108 = load double, double* %7
%109 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %108, double %107)
%110 = load double*, double** %4
%111 = getelementptr inbounds double, double* %110, i64 2
%112 = load double, double* %111
%113 = load double*, double** %6
%114 = getelementptr inbounds double, double* %113, i64 2
%115 = load double, double* %114
%116 = call double @llvm.fmuladd.f64(double %109, double %112, double %115)
%117 = load double*, double** %5
%118 = getelementptr inbounds double, double* %117, i64 5
store double %116, double* %118
br label %119
119: ; preds = %35, %22
ret void
}

LLVM IR (-O2):
define void @deq(double* %0, double* nocapture writeonly %1, double* nocapture %2) {
%4 = tail call double @dot(double* %0, double* %0, i32 3)
%5 = tail call double @sqrt(double %4)
%6 = fmul double %4, %5
%7 = fcmp ugt double %4, 0.000000e+00
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = bitcast double* %1 to i8*
br label %52
10: ; preds = %3
%11 = fdiv double 0x4535C828F70457CC, %4
%12 = fdiv double %11, %6
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = fmul double %14, 5.000000e+00
%16 = fmul double %14, %15
%17 = fdiv double %16, %4
%18 = fdiv double 0xC2F6A8665A22E000, %6
%19 = fsub double 1.000000e+00, %17
%20 = fneg double %12
%21 = tail call double @llvm.fmuladd.f64(double %20, double %19, double %18)
%22 = getelementptr inbounds double, double* %0, i64 3
%23 = load double, double* %22
store double %23, double* %1
%24 = getelementptr inbounds double, double* %0, i64 4
%25 = load double, double* %24
%26 = getelementptr inbounds double, double* %1, i64 1
store double %25, double* %26
%27 = getelementptr inbounds double, double* %0, i64 5
%28 = load double, double* %27
%29 = getelementptr inbounds double, double* %1, i64 2
store double %28, double* %29
%30 = fadd double %21, 0x3E36D6A58867B448
%31 = load double, double* %0
%32 = load double, double* %24
%33 = fmul double %32, 0x3F231DA7D157DB65
%34 = tail call double @llvm.fmuladd.f64(double %30, double %31, double %33)
%35 = load double, double* %2
%36 = fadd double %35, %34
%37 = getelementptr inbounds double, double* %1, i64 3
store double %36, double* %37
%38 = getelementptr inbounds double, double* %0, i64 1
%39 = load double, double* %38
%40 = load double, double* %22
%41 = fmul double %40, 0xBF231DA7D157DB65
%42 = tail call double @llvm.fmuladd.f64(double %30, double %39, double %41)
%43 = getelementptr inbounds double, double* %2, i64 1
%44 = load double, double* %43
%45 = fadd double %44, %42
%46 = getelementptr inbounds double, double* %1, i64 4
store double %45, double* %46
%47 = tail call double @llvm.fmuladd.f64(double %12, double -2.000000e+00, double %21)
%48 = load double, double* %13
%49 = getelementptr inbounds double, double* %2, i64 2
%50 = load double, double* %49
%51 = tail call double @llvm.fmuladd.f64(double %47, double %48, double %50)
br label %52
52: ; preds = %10, %8
%53 = phi double [ %51, %10 ], [ 0.000000e+00, %8 ]
%54 = getelementptr inbounds double, double* %1, i64 5
store double %53, double* %54
ret void
}