#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);
double mmslipstance_event_scan(double t, double *Y, int n, double *pars,
                               double *res) {
  double l;
  double xr = Y[0] - pars[0];
  l = sqrt(xr * xr + Y[1] * Y[1]);
  *res = l - 1.;
}


x86 assembly (clang, -O0):
<mmslipstance_event_scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%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,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe84(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmslipstance_event_scan>:
push   %rbx
mov    %rcx,%rbx
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
subsd  (%rdx),%xmm0
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113d <mmslipstance_event_scan+0x2d>
sqrtsd %xmm0,%xmm0
jmp    1142 <mmslipstance_event_scan+0x32>
call   1030 <sqrt@plt>
addsd  0xeb6(%rip),%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define double @mmslipstance_event_scan(double %0, double* %1, i32 %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca double
%13 = alloca double
store double %0, double* %7
store double* %1, double** %8
store i32 %2, i32* %9
store double* %3, double** %10
store double* %4, double** %11
%14 = load double*, double** %8
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = load double*, double** %10
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = fsub double %16, %19
store double %20, double* %13
%21 = load double, double* %13
%22 = load double, double* %13
%23 = load double*, double** %8
%24 = getelementptr inbounds double, double* %23, i64 1
%25 = load double, double* %24
%26 = load double*, double** %8
%27 = getelementptr inbounds double, double* %26, i64 1
%28 = load double, double* %27
%29 = fmul double %25, %28
%30 = call double @llvm.fmuladd.f64(double %21, double %22, double %29)
%31 = call double @sqrt(double %30)
store double %31, double* %12
%32 = load double, double* %12
%33 = fsub double %32, 1.000000e+00
%34 = load double*, double** %11
store double %33, double* %34
%35 = load double, double* %6
ret double %35
}

LLVM IR (-O2):
define double @mmslipstance_event_scan(double %0, double* nocapture %1, i32 %2, double* nocapture %3, double* nocapture writeonly %4) {
%6 = load double, double* %1
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = getelementptr inbounds double, double* %1, 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 = fadd double %13, -1.000000e+00
store double %14, double* %4
ret double undef
}