#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 */
int exp(int);
double fabs(double);
void fp(long N, double T, double *Y, double *YP) {
  double m, v;
  if (Y[0] >= 0.) {
    m = 1.;
    v = 1.;
  } else {
    m = 1.;
    v = -1.;
  }
  Y[4] = v / m;
  m = 1.;
  v = fabs(Y[0]);
  Y[5] = v / m;
  m = 1.;
  v = -Y[0];
  YP[1] = v / m;
  if (Y[5] < 0.01) {
    m = 1.;
    v = 2452.41970901797979 * Y[0];
  } else {
    m = 1.;
    v = 5. * Y[4] * (exp(-10. * Y[5]) + 4.) + 0.001 * Y[0];
  }
  Y[3] = v / m;
  m = Y[8];
  v = Y[7] + Y[3];
  Y[2] = v / m;
  m = 1.;
  v = -Y[2];
  YP[0] = v / m;
}


x86 assembly (clang, -O0):
<fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115d <fp+0x4d>
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb5(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1177 <fp+0x67>
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe8e(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  0xe76(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0xe9a(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  0xe3e(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  0xdfe(%rip),%xmm0
ucomisd 0x28(%rax),%xmm0
jbe    1244 <fp+0x134>
movsd  0xde3(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xe02(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    12b3 <fp+0x1a3>
movsd  0xdbc(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xdd3(%rip),%xmm0
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xdb5(%rip),%xmm0
mulsd  0x28(%rax),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  -0x38(%rbp),%xmm0
cvtsi2sd %eax,%xmm2
movsd  0xd8e(%rip),%xmm1
addsd  %xmm1,%xmm2
mov    -0x18(%rbp),%rax
movsd  0xd76(%rip),%xmm1
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x18(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  0xd02(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
movsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setb   %al
lea    0xece(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm1
movsd  %xmm1,0x20(%rsi)
movapd 0xecc(%rip),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,0x28(%rsi)
xorpd  0xecb(%rip),%xmm0
movlpd %xmm0,0x8(%rdx)
movsd  0x28(%rsi),%xmm0
movsd  0xec9(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    117b <fp+0x6b>
movsd  (%rbx),%xmm0
mulsd  0xedf(%rip),%xmm0
jmp    11c2 <fp+0xb2>
movsd  0x20(%rbx),%xmm1
mulsd  0xeb0(%rip),%xmm1
movsd  %xmm1,(%rsp)
mulsd  0xeab(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0xe9b(%rip),%xmm1
mulsd  (%rsp),%xmm1
movsd  (%rbx),%xmm0
mulsd  0xe92(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rbx)
addsd  0x38(%rbx),%xmm0
divsd  0x40(%rbx),%xmm0
movsd  %xmm0,0x10(%rbx)
xorpd  0xe42(%rip),%xmm0
movlpd %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fp(i64 %0, double %1, double* %2, double* %3) {
%5 = alloca i64
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store i64 %0, i64* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%11 = load double*, double** %7
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = fcmp oge double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %4
store double 1.000000e+00, double* %9
store double 1.000000e+00, double* %10
br label %17
16: ; preds = %4
store double 1.000000e+00, double* %9
store double -1.000000e+00, double* %10
br label %17
17: ; preds = %16, %15
%18 = load double, double* %10
%19 = load double, double* %9
%20 = fdiv double %18, %19
%21 = load double*, double** %7
%22 = getelementptr inbounds double, double* %21, i64 4
store double %20, double* %22
store double 1.000000e+00, double* %9
%23 = load double*, double** %7
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = call double @llvm.fabs.f64(double %25)
store double %26, double* %10
%27 = load double, double* %10
%28 = load double, double* %9
%29 = fdiv double %27, %28
%30 = load double*, double** %7
%31 = getelementptr inbounds double, double* %30, i64 5
store double %29, double* %31
store double 1.000000e+00, double* %9
%32 = load double*, double** %7
%33 = getelementptr inbounds double, double* %32, i64 0
%34 = load double, double* %33
%35 = fneg double %34
store double %35, double* %10
%36 = load double, double* %10
%37 = load double, double* %9
%38 = fdiv double %36, %37
%39 = load double*, double** %8
%40 = getelementptr inbounds double, double* %39, i64 1
store double %38, double* %40
%41 = load double*, double** %7
%42 = getelementptr inbounds double, double* %41, i64 5
%43 = load double, double* %42
%44 = fcmp olt double %43, 1.000000e-02
br i1 %44, label %45, label %50
45: ; preds = %17
store double 1.000000e+00, double* %9
%46 = load double*, double** %7
%47 = getelementptr inbounds double, double* %46, i64 0
%48 = load double, double* %47
%49 = fmul double 0x40A328D6E419B41E, %48
store double %49, double* %10
br label %68
50: ; preds = %17
store double 1.000000e+00, double* %9
%51 = load double*, double** %7
%52 = getelementptr inbounds double, double* %51, i64 4
%53 = load double, double* %52
%54 = fmul double 5.000000e+00, %53
%55 = load double*, double** %7
%56 = getelementptr inbounds double, double* %55, i64 5
%57 = load double, double* %56
%58 = fmul double -1.000000e+01, %57
%59 = fptosi double %58 to i32
%60 = call i32 @exp(i32 %59)
%61 = sitofp i32 %60 to double
%62 = fadd double %61, 4.000000e+00
%63 = load double*, double** %7
%64 = getelementptr inbounds double, double* %63, i64 0
%65 = load double, double* %64
%66 = fmul double 1.000000e-03, %65
%67 = call double @llvm.fmuladd.f64(double %54, double %62, double %66)
store double %67, double* %10
br label %68
68: ; preds = %50, %45
%69 = load double, double* %10
%70 = load double, double* %9
%71 = fdiv double %69, %70
%72 = load double*, double** %7
%73 = getelementptr inbounds double, double* %72, i64 3
store double %71, double* %73
%74 = load double*, double** %7
%75 = getelementptr inbounds double, double* %74, i64 8
%76 = load double, double* %75
store double %76, double* %9
%77 = load double*, double** %7
%78 = getelementptr inbounds double, double* %77, i64 7
%79 = load double, double* %78
%80 = load double*, double** %7
%81 = getelementptr inbounds double, double* %80, i64 3
%82 = load double, double* %81
%83 = fadd double %79, %82
store double %83, double* %10
%84 = load double, double* %10
%85 = load double, double* %9
%86 = fdiv double %84, %85
%87 = load double*, double** %7
%88 = getelementptr inbounds double, double* %87, i64 2
store double %86, double* %88
store double 1.000000e+00, double* %9
%89 = load double*, double** %7
%90 = getelementptr inbounds double, double* %89, i64 2
%91 = load double, double* %90
%92 = fneg double %91
store double %92, double* %10
%93 = load double, double* %10
%94 = load double, double* %9
%95 = fdiv double %93, %94
%96 = load double*, double** %8
%97 = getelementptr inbounds double, double* %96, i64 0
store double %95, double* %97
ret void
}

LLVM IR (-O2):
define void @fp(i64 %0, double %1, double* nocapture %2, double* nocapture writeonly %3) {
%5 = load double, double* %2
%6 = fcmp ult double %5, 0.000000e+00
%7 = select i1 %6, double -1.000000e+00, double 1.000000e+00
%8 = getelementptr inbounds double, double* %2, i64 4
store double %7, double* %8
%9 = tail call double @llvm.fabs.f64(double %5)
%10 = getelementptr inbounds double, double* %2, i64 5
store double %9, double* %10
%11 = fneg double %5
%12 = getelementptr inbounds double, double* %3, i64 1
store double %11, double* %12
%13 = load double, double* %10
%14 = fcmp olt double %13, 1.000000e-02
br i1 %14, label %15, label %18
15: ; preds = %4
%16 = load double, double* %2
%17 = fmul double %16, 0x40A328D6E419B41E
br label %29
18: ; preds = %4
%19 = load double, double* %8
%20 = fmul double %19, 5.000000e+00
%21 = fmul double %13, -1.000000e+01
%22 = fptosi double %21 to i32
%23 = tail call i32 @exp(i32 %22)
%24 = sitofp i32 %23 to double
%25 = fadd double %24, 4.000000e+00
%26 = load double, double* %2
%27 = fmul double %26, 1.000000e-03
%28 = tail call double @llvm.fmuladd.f64(double %20, double %25, double %27)
br label %29
29: ; preds = %18, %15
%30 = phi double [ %17, %15 ], [ %28, %18 ]
%31 = getelementptr inbounds double, double* %2, i64 3
store double %30, double* %31
%32 = getelementptr inbounds double, double* %2, i64 8
%33 = load double, double* %32
%34 = getelementptr inbounds double, double* %2, i64 7
%35 = load double, double* %34
%36 = fadd double %30, %35
%37 = fdiv double %36, %33
%38 = getelementptr inbounds double, double* %2, i64 2
store double %37, double* %38
%39 = fneg double %37
store double %39, double* %3
ret void
}