#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 sin(double);
double bslipss_event_scan(double t, double *Y, int n, double *pars,
                          double *res) {
  if (pars[16] == 1.) {
    *res = -(Y[1] - pars[5] * sin(pars[3]));
  } else {
    *res = -(Y[1] - pars[4] * sin(pars[2]));
  }
}


x86 assembly (clang, -O0):
<bslipss_event_scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x80(%rax),%xmm0
movsd  0xec0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ca <bslipss_event_scan+0xba>
jp     11ca <bslipss_event_scan+0xba>
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm0
call   1030 <sin@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    123f <bslipss_event_scan+0x12f>
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1030 <sin@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bslipss_event_scan>:
push   %rbx
sub    $0x20,%rsp
mov    %rcx,%rbx
movsd  0xee0(%rip),%xmm0
cmpeqsd 0x80(%rdx),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
movsd  0x8(%rdi),%xmm0
movaps %xmm0,0x10(%rsp)
movsd  0x10(%rdx,%rax,8),%xmm0
movsd  0x20(%rdx,%rax,8),%xmm1
movsd  %xmm1,0x8(%rsp)
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movapd 0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorpd  0xea6(%rip),%xmm1
movlpd %xmm1,(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @bslipss_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*
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
%12 = load double*, double** %10
%13 = getelementptr inbounds double, double* %12, i64 16
%14 = load double, double* %13
%15 = fcmp oeq double %14, 1.000000e+00
br i1 %15, label %16, label %31
16: ; preds = %5
%17 = load double*, double** %8
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double*, double** %10
%21 = getelementptr inbounds double, double* %20, i64 5
%22 = load double, double* %21
%23 = load double*, double** %10
%24 = getelementptr inbounds double, double* %23, i64 3
%25 = load double, double* %24
%26 = call double @sin(double %25)
%27 = fneg double %22
%28 = call double @llvm.fmuladd.f64(double %27, double %26, double %19)
%29 = fneg double %28
%30 = load double*, double** %11
store double %29, double* %30
br label %46
31: ; preds = %5
%32 = load double*, double** %8
%33 = getelementptr inbounds double, double* %32, i64 1
%34 = load double, double* %33
%35 = load double*, double** %10
%36 = getelementptr inbounds double, double* %35, i64 4
%37 = load double, double* %36
%38 = load double*, double** %10
%39 = getelementptr inbounds double, double* %38, i64 2
%40 = load double, double* %39
%41 = call double @sin(double %40)
%42 = fneg double %37
%43 = call double @llvm.fmuladd.f64(double %42, double %41, double %34)
%44 = fneg double %43
%45 = load double*, double** %11
store double %44, double* %45
br label %46
46: ; preds = %31, %16
%47 = load double, double* %6
ret double %47
}

LLVM IR (-O2):
define double @bslipss_event_scan(double %0, double* nocapture %1, i32 %2, double* nocapture %3, double* nocapture writeonly %4) {
%6 = getelementptr inbounds double, double* %3, i64 16
%7 = load double, double* %6
%8 = fcmp oeq double %7, 1.000000e+00
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = select i1 %8, i64 5, i64 4
%12 = select i1 %8, i64 3, i64 2
%13 = getelementptr inbounds double, double* %3, i64 %11
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %3, i64 %12
%16 = load double, double* %15
%17 = tail call double @sin(double %16)
%18 = fneg double %14
%19 = tail call double @llvm.fmuladd.f64(double %18, double %17, double %10)
%20 = fneg double %19
store double %20, double* %4
ret double undef
}