#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 const sqrt(double const);
void Fbaseball(double t, const double X[], double R[]) {
  const double k = 0.002;
  const double g = 32.0;
  const double x_temp = X[1] * X[1] + X[3] * X[3];
  R[0] = X[1];
  R[1] = -k * X[1] * sqrt(x_temp);
  R[2] = X[3];
  R[3] = -k * X[3] * sqrt(x_temp) - g;
}


x86 assembly (clang, -O0):
<Fbaseball>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xeeb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe7b(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe34(%rip),%xmm0
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe04(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fbaseball>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  0x8(%rdi),%xmm2
movsd  0x18(%rdi),%xmm1
mulsd  %xmm1,%xmm1
movsd  %xmm2,(%rsi)
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  0x8(%rdi),%xmm4
mulsd  0xebc(%rip),%xmm4
xorps  %xmm1,%xmm1
sqrtsd %xmm2,%xmm1
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
movapd %xmm1,%xmm0
jae    1188 <Fbaseball+0x78>
movapd %xmm2,%xmm0
movsd  %xmm1,(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm4
xorpd  %xmm3,%xmm3
movsd  0x10(%rsp),%xmm2
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm4
movsd  %xmm4,0x8(%r14)
movsd  0x18(%rbx),%xmm0
movsd  %xmm0,0x10(%r14)
movsd  0x18(%rbx),%xmm0
mulsd  0xe56(%rip),%xmm0
ucomisd %xmm3,%xmm2
jae    11c7 <Fbaseball+0xb7>
movsd  %xmm0,(%rsp)
movapd %xmm2,%xmm0
call   1030 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe35(%rip),%xmm0
movsd  %xmm0,0x18(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @Fbaseball(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
store double 2.000000e-03, double* %7
store double 3.200000e+01, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %5
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 3
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 3
%21 = load double, double* %20
%22 = fmul double %18, %21
%23 = call double @llvm.fmuladd.f64(double %12, double %15, double %22)
store double %23, double* %9
%24 = load double*, double** %5
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = load double*, double** %6
%28 = getelementptr inbounds double, double* %27, i64 0
store double %26, double* %28
%29 = load double*, double** %5
%30 = getelementptr inbounds double, double* %29, i64 1
%31 = load double, double* %30
%32 = fmul double -2.000000e-03, %31
%33 = load double, double* %9
%34 = call double @sqrt(double %33)
%35 = fmul double %32, %34
%36 = load double*, double** %6
%37 = getelementptr inbounds double, double* %36, i64 1
store double %35, double* %37
%38 = load double*, double** %5
%39 = getelementptr inbounds double, double* %38, i64 3
%40 = load double, double* %39
%41 = load double*, double** %6
%42 = getelementptr inbounds double, double* %41, i64 2
store double %40, double* %42
%43 = load double*, double** %5
%44 = getelementptr inbounds double, double* %43, i64 3
%45 = load double, double* %44
%46 = fmul double -2.000000e-03, %45
%47 = load double, double* %9
%48 = call double @sqrt(double %47)
%49 = call double @llvm.fmuladd.f64(double %46, double %48, double -3.200000e+01)
%50 = load double*, double** %6
%51 = getelementptr inbounds double, double* %50, i64 3
store double %49, double* %51
ret void
}

LLVM IR (-O2):
define void @Fbaseball(double %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 3
%7 = load double, double* %6
%8 = fmul double %7, %7
%9 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %8)
store double %5, double* %2
%10 = load double, double* %4
%11 = fmul double %10, -2.000000e-03
%12 = tail call double @sqrt(double %9)
%13 = fmul double %11, %12
%14 = getelementptr inbounds double, double* %2, i64 1
store double %13, double* %14
%15 = load double, double* %6
%16 = getelementptr inbounds double, double* %2, i64 2
store double %15, double* %16
%17 = load double, double* %6
%18 = fmul double %17, -2.000000e-03
%19 = tail call double @sqrt(double %9)
%20 = tail call double @llvm.fmuladd.f64(double %18, double %19, double -3.200000e+01)
%21 = getelementptr inbounds double, double* %2, i64 3
store double %20, double* %21
ret void
}