#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 sqrt(double);
int eom(double t, double y[], double dydt[], void *params) {
  double r = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]);
  dydt[0] = y[3];
  dydt[1] = y[4];
  dydt[2] = y[5];
  dydt[3] = -y[0] / (r * r * r);
  dydt[4] = -y[1] / (r * r * r);
  dydt[5] = -y[2] / (r * r * r);
  return 0;
}


x86 assembly (clang, -O0):
<eom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x28(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eom>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     114c <eom+0x3c>
sqrtsd %xmm0,%xmm0
jmp    1151 <eom+0x41>
call   1030 <sqrt@plt>
movsd  0x18(%rbx),%xmm1
movsd  %xmm1,(%r14)
movsd  0x20(%rbx),%xmm1
movsd  %xmm1,0x8(%r14)
movsd  0x28(%rbx),%xmm1
movsd  %xmm1,0x10(%r14)
movsd  (%rbx),%xmm1
movapd 0xe83(%rip),%xmm2
xorpd  %xmm2,%xmm1
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
divsd  %xmm3,%xmm1
movsd  %xmm1,0x18(%r14)
movsd  0x8(%rbx),%xmm0
xorpd  %xmm2,%xmm0
divsd  %xmm3,%xmm0
movsd  %xmm0,0x20(%r14)
movsd  0x10(%rbx),%xmm0
xorpd  %xmm2,%xmm0
divsd  %xmm3,%xmm0
movsd  %xmm0,0x28(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @eom(double %0, double* %1, double* %2, i8* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca i8*
%9 = alloca double
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store i8* %3, i8** %8
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double*, double** %6
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fmul double %18, %21
%23 = call double @llvm.fmuladd.f64(double %12, double %15, double %22)
%24 = load double*, double** %6
%25 = getelementptr inbounds double, double* %24, i64 2
%26 = load double, double* %25
%27 = load double*, double** %6
%28 = getelementptr inbounds double, double* %27, i64 2
%29 = load double, double* %28
%30 = call double @llvm.fmuladd.f64(double %26, double %29, double %23)
%31 = call double @sqrt(double %30)
store double %31, double* %9
%32 = load double*, double** %6
%33 = getelementptr inbounds double, double* %32, i64 3
%34 = load double, double* %33
%35 = load double*, double** %7
%36 = getelementptr inbounds double, double* %35, i64 0
store double %34, double* %36
%37 = load double*, double** %6
%38 = getelementptr inbounds double, double* %37, i64 4
%39 = load double, double* %38
%40 = load double*, double** %7
%41 = getelementptr inbounds double, double* %40, i64 1
store double %39, double* %41
%42 = load double*, double** %6
%43 = getelementptr inbounds double, double* %42, i64 5
%44 = load double, double* %43
%45 = load double*, double** %7
%46 = getelementptr inbounds double, double* %45, i64 2
store double %44, double* %46
%47 = load double*, double** %6
%48 = getelementptr inbounds double, double* %47, i64 0
%49 = load double, double* %48
%50 = fneg double %49
%51 = load double, double* %9
%52 = load double, double* %9
%53 = fmul double %51, %52
%54 = load double, double* %9
%55 = fmul double %53, %54
%56 = fdiv double %50, %55
%57 = load double*, double** %7
%58 = getelementptr inbounds double, double* %57, i64 3
store double %56, double* %58
%59 = load double*, double** %6
%60 = getelementptr inbounds double, double* %59, i64 1
%61 = load double, double* %60
%62 = fneg double %61
%63 = load double, double* %9
%64 = load double, double* %9
%65 = fmul double %63, %64
%66 = load double, double* %9
%67 = fmul double %65, %66
%68 = fdiv double %62, %67
%69 = load double*, double** %7
%70 = getelementptr inbounds double, double* %69, i64 4
store double %68, double* %70
%71 = load double*, double** %6
%72 = getelementptr inbounds double, double* %71, i64 2
%73 = load double, double* %72
%74 = fneg double %73
%75 = load double, double* %9
%76 = load double, double* %9
%77 = fmul double %75, %76
%78 = load double, double* %9
%79 = fmul double %77, %78
%80 = fdiv double %74, %79
%81 = load double*, double** %7
%82 = getelementptr inbounds double, double* %81, i64 5
store double %80, double* %82
ret i32 0
}

LLVM IR (-O2):
define i32 @eom(double %0, double* nocapture %1, double* nocapture writeonly %2, i8* nocapture readnone %3) {
%5 = load double, double* %1
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %7
%9 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %8)
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %9)
%13 = tail call double @sqrt(double %12)
%14 = getelementptr inbounds double, double* %1, i64 3
%15 = load double, double* %14
store double %15, double* %2
%16 = getelementptr inbounds double, double* %1, i64 4
%17 = load double, double* %16
%18 = getelementptr inbounds double, double* %2, i64 1
store double %17, double* %18
%19 = getelementptr inbounds double, double* %1, i64 5
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %2, i64 2
store double %20, double* %21
%22 = load double, double* %1
%23 = fneg double %22
%24 = fmul double %13, %13
%25 = fmul double %13, %24
%26 = fdiv double %23, %25
%27 = getelementptr inbounds double, double* %2, i64 3
store double %26, double* %27
%28 = load double, double* %6
%29 = fneg double %28
%30 = fdiv double %29, %25
%31 = getelementptr inbounds double, double* %2, i64 4
store double %30, double* %31
%32 = load double, double* %10
%33 = fneg double %32
%34 = fdiv double %33, %25
%35 = getelementptr inbounds double, double* %2, i64 5
store double %34, double* %35
ret i32 0
}