#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);
void mmslipstance(unsigned n, double t, double *Y, double *p, double *f) {
  double l, F, Fx, Fy;
  double xr = Y[0] - p[0];
  l = sqrt(xr * xr + Y[1] * Y[1]);
  F = 20000. * (1. - l);
  Fx = xr / l * F;
  Fy = Y[1] / l * F;
  f[0] = Y[2];
  f[1] = Y[3];
  f[2] = Fx / 80.;
  f[3] = Fy / 80. - 9.81;
}


x86 assembly (clang, -O0):
<mmslipstance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xea1(%rip),%xmm1
subsd  -0x30(%rbp),%xmm1
movsd  0xe8c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x50(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x40(%rbp),%xmm0
movsd  0xe1f(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x48(%rbp),%xmm0
movsd  0xe05(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdf1(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmslipstance>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsi,%rbx
movsd  (%rsi),%xmm4
movsd  0x8(%rsi),%xmm1
subsd  (%rdx),%xmm4
mulsd  %xmm1,%xmm1
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1147 <mmslipstance+0x37>
sqrtsd %xmm0,%xmm0
jmp    1156 <mmslipstance+0x46>
movsd  %xmm4,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm4
movsd  0xea2(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe9e(%rip),%xmm1
divsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm4
movsd  0x8(%rbx),%xmm2
movsd  0x10(%rbx),%xmm3
divsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm3,(%r14)
movsd  0x18(%rbx),%xmm0
movsd  %xmm0,0x8(%r14)
movsd  0xe74(%rip),%xmm0
divsd  %xmm0,%xmm4
movsd  %xmm4,0x10(%r14)
divsd  %xmm0,%xmm2
addsd  0xe66(%rip),%xmm2
movsd  %xmm2,0x18(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mmslipstance(i32 %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store i32 %0, i32* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%16 = load double*, double** %8
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = load double*, double** %9
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = fsub double %18, %21
store double %22, double* %15
%23 = load double, double* %15
%24 = load double, double* %15
%25 = load double*, double** %8
%26 = getelementptr inbounds double, double* %25, i64 1
%27 = load double, double* %26
%28 = load double*, double** %8
%29 = getelementptr inbounds double, double* %28, i64 1
%30 = load double, double* %29
%31 = fmul double %27, %30
%32 = call double @llvm.fmuladd.f64(double %23, double %24, double %31)
%33 = call double @sqrt(double %32)
store double %33, double* %11
%34 = load double, double* %11
%35 = fsub double 1.000000e+00, %34
%36 = fmul double 2.000000e+04, %35
store double %36, double* %12
%37 = load double, double* %15
%38 = load double, double* %11
%39 = fdiv double %37, %38
%40 = load double, double* %12
%41 = fmul double %39, %40
store double %41, double* %13
%42 = load double*, double** %8
%43 = getelementptr inbounds double, double* %42, i64 1
%44 = load double, double* %43
%45 = load double, double* %11
%46 = fdiv double %44, %45
%47 = load double, double* %12
%48 = fmul double %46, %47
store double %48, double* %14
%49 = load double*, double** %8
%50 = getelementptr inbounds double, double* %49, i64 2
%51 = load double, double* %50
%52 = load double*, double** %10
%53 = getelementptr inbounds double, double* %52, i64 0
store double %51, double* %53
%54 = load double*, double** %8
%55 = getelementptr inbounds double, double* %54, i64 3
%56 = load double, double* %55
%57 = load double*, double** %10
%58 = getelementptr inbounds double, double* %57, i64 1
store double %56, double* %58
%59 = load double, double* %13
%60 = fdiv double %59, 8.000000e+01
%61 = load double*, double** %10
%62 = getelementptr inbounds double, double* %61, i64 2
store double %60, double* %62
%63 = load double, double* %14
%64 = fdiv double %63, 8.000000e+01
%65 = fsub double %64, 9.810000e+00
%66 = load double*, double** %10
%67 = getelementptr inbounds double, double* %66, i64 3
store double %65, double* %67
ret void
}

LLVM IR (-O2):
define void @mmslipstance(i32 %0, double %1, double* nocapture %2, double* nocapture %3, double* nocapture writeonly %4) {
%6 = load double, double* %2
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fmul double %10, %10
%12 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %11)
%13 = tail call double @sqrt(double %12)
%14 = fsub double 1.000000e+00, %13
%15 = fmul double %14, 2.000000e+04
%16 = fdiv double %8, %13
%17 = fmul double %16, %15
%18 = load double, double* %9
%19 = fdiv double %18, %13
%20 = fmul double %19, %15
%21 = getelementptr inbounds double, double* %2, i64 2
%22 = load double, double* %21
store double %22, double* %4
%23 = getelementptr inbounds double, double* %2, i64 3
%24 = load double, double* %23
%25 = getelementptr inbounds double, double* %4, i64 1
store double %24, double* %25
%26 = fdiv double %17, 8.000000e+01
%27 = getelementptr inbounds double, double* %4, i64 2
store double %26, double* %27
%28 = fdiv double %20, 8.000000e+01
%29 = fadd double %28, -9.810000e+00
%30 = getelementptr inbounds double, double* %4, i64 3
store double %29, double* %30
ret void
}