#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]);
  dydt[0] = y[2];
  dydt[1] = y[3];
  dydt[2] = -y[0] / (r * r * r);
  dydt[3] = -y[1] / (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),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%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,0x10(%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,0x18(%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),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113f <eom+0x2f>
sqrtsd %xmm0,%xmm0
jmp    1144 <eom+0x34>
call   1030 <sqrt@plt>
movsd  0x10(%rbx),%xmm1
movsd  %xmm1,(%r14)
movsd  0x18(%rbx),%xmm1
movsd  %xmm1,0x8(%r14)
movsd  (%rbx),%xmm1
movapd 0xe9b(%rip),%xmm2
xorpd  %xmm2,%xmm1
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
divsd  %xmm3,%xmm1
movsd  %xmm1,0x10(%r14)
movsd  0x8(%rbx),%xmm0
xorpd  %xmm2,%xmm0
divsd  %xmm3,%xmm0
movsd  %xmm0,0x18(%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 = call double @sqrt(double %23)
store double %24, double* %9
%25 = load double*, double** %6
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %7
%29 = getelementptr inbounds double, double* %28, i64 0
store double %27, double* %29
%30 = load double*, double** %6
%31 = getelementptr inbounds double, double* %30, i64 3
%32 = load double, double* %31
%33 = load double*, double** %7
%34 = getelementptr inbounds double, double* %33, i64 1
store double %32, double* %34
%35 = load double*, double** %6
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = fneg double %37
%39 = load double, double* %9
%40 = load double, double* %9
%41 = fmul double %39, %40
%42 = load double, double* %9
%43 = fmul double %41, %42
%44 = fdiv double %38, %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 1
%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
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 = tail call double @sqrt(double %9)
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
store double %12, double* %2
%13 = getelementptr inbounds double, double* %1, i64 3
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 1
store double %14, double* %15
%16 = load double, double* %1
%17 = fneg double %16
%18 = fmul double %10, %10
%19 = fmul double %10, %18
%20 = fdiv double %17, %19
%21 = getelementptr inbounds double, double* %2, i64 2
store double %20, double* %21
%22 = load double, double* %6
%23 = fneg double %22
%24 = fdiv double %23, %19
%25 = getelementptr inbounds double, double* %2, i64 3
store double %24, double* %25
ret i32 0
}