#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 log(int);
double pow(double, double);
void model_(int *CurSet, int *NoOfParams, int *NoOfDerived,
            int *TotalDataValues, int *MaxNoOfDataValues, int *NoOfDataCols,
            int *NoOfAdirissaCols, int *NoOfModelVectors, double Params[],
            double Derived[], double Adirissa[], double Signal[]) {
  int CurEntry, time_index, Cp_index, emax_index;
  double ke0, time, time_previous, thalf_effect, nHill, q, dt, emax, e0;
  double ec50, Cp, Ce, Cp_previous, Ce_previous;
  ke0 = Params[0];
  nHill = Params[1];
  q = Params[2];
  thalf_effect = log(2) / ke0;
  Derived[0] = thalf_effect;
  ec50 = pow(10.0, q);
  Derived[1] = ec50;
  for (CurEntry = 0; CurEntry < *TotalDataValues; CurEntry++) {
    if (CurEntry == 0) {
      time_index = 0;
      Cp_index = 1;
      time = Adirissa[time_index];
      Cp = Adirissa[Cp_index];
      Ce = 0.0;
    } else {
      time_previous = time;
      Cp_previous = Cp;
      Ce_previous = Ce;
      time_index += *NoOfAdirissaCols;
      time = Adirissa[time_index];
      dt = time - time_previous;
      Cp_index += *NoOfAdirissaCols;
      Cp = Adirissa[Cp_index];
      Ce = Ce_previous + dt * ke0 * (Cp_previous - Ce_previous);
    }
    emax_index = CurEntry;
    Signal[emax_index] = pow(Ce, nHill) / (pow(Ce, nHill) + pow(ec50, nHill));
  }
  return;
}


x86 assembly (clang, -O0):
<model_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm1
movsd  0xe4e(%rip),%xmm0
call   1040 <pow@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mov    0x28(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jge    1361 <model_+0x241>
cmpl   $0x0,-0x34(%rbp)
jne    1235 <model_+0x115>
movl   $0x0,-0x38(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    12df <model_+0x1bf>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
mov    0x10(%rbp),%rax
mov    (%rax),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    0x10(%rbp),%rax
mov    (%rax),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0x78(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm2
ff
subsd  -0xb0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x34(%rbp),%eax
mov    %eax,-0x40(%rbp)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm1
call   1040 <pow@plt>
movsd  -0xc0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xb8(%rbp),%xmm0
ff
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    0x38(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11d7 <model_+0xb7>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<model_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rcx,%r15
mov    0x98(%rsp),%rbx
mov    0x90(%rsp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
divsd  0x38(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0xe83(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,0x30(%rsp)
movsd  %xmm0,0x8(%rbx)
cmpl   $0x0,(%r15)
jle    12ff <model_+0x1df>
mov    0xa8(%rsp),%r12
mov    0xa0(%rsp),%r13
movsd  0x0(%r13),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%r13),%xmm0
movsd  %xmm0,0x40(%rsp)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <pow@plt>
movsd  0x28(%rsp),%xmm1
addsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%r12)
cmpl   $0x2,(%r15)
jl     12ff <model_+0x1df>
mov    $0x1,%ebp
xor    %ebx,%ebx
mov    $0x1,%r14d
nopw   0x0(%rax,%rax,1)
mov    0x80(%rsp),%rax
mov    (%rax),%eax
add    %eax,%ebx
movslq %ebx,%rcx
movsd  0x0(%r13,%rcx,8),%xmm0
movsd  %xmm0,0x28(%rsp)
subsd  %xmm1,%xmm0
add    %eax,%ebp
movslq %ebp,%rax
mulsd  0x38(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
movsd  0x0(%r13,%rax,8),%xmm0
movsd  %xmm0,0x40(%rsp)
movapd %xmm2,%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <pow@plt>
addsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r12,%r14,8)
add    $0x1,%r14
movslq (%r15),%rax
movsd  0x28(%rsp),%xmm1
cmp    %rax,%r14
jl     1240 <model_+0x120>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @model_(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, double* %8, double* %9, double* %10, double* %11) {
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca double*
%22 = alloca double*
%23 = alloca double*
%24 = alloca double*
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
%42 = alloca double
store i32* %0, i32** %13
store i32* %1, i32** %14
store i32* %2, i32** %15
store i32* %3, i32** %16
store i32* %4, i32** %17
store i32* %5, i32** %18
store i32* %6, i32** %19
store i32* %7, i32** %20
store double* %8, double** %21
store double* %9, double** %22
store double* %10, double** %23
store double* %11, double** %24
%43 = load double*, double** %21
%44 = getelementptr inbounds double, double* %43, i64 0
%45 = load double, double* %44
store double %45, double* %29
%46 = load double*, double** %21
%47 = getelementptr inbounds double, double* %46, i64 1
%48 = load double, double* %47
store double %48, double* %33
%49 = load double*, double** %21
%50 = getelementptr inbounds double, double* %49, i64 2
%51 = load double, double* %50
store double %51, double* %34
%52 = call double @log(i32 2)
%53 = load double, double* %29
%54 = fdiv double %52, %53
store double %54, double* %32
%55 = load double, double* %32
%56 = load double*, double** %22
%57 = getelementptr inbounds double, double* %56, i64 0
store double %55, double* %57
%58 = load double, double* %34
%59 = call double @pow(double 1.000000e+01, double %58)
store double %59, double* %38
%60 = load double, double* %38
%61 = load double*, double** %22
%62 = getelementptr inbounds double, double* %61, i64 1
store double %60, double* %62
store i32 0, i32* %25
br label %63
63: ; preds = %132, %12
%64 = load i32, i32* %25
%65 = load i32*, i32** %16
%66 = load i32, i32* %65
%67 = icmp slt i32 %64, %66
br i1 %67, label %68, label %135
68: ; preds = %63
%69 = load i32, i32* %25
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %82
71: ; preds = %68
store i32 0, i32* %26
store i32 1, i32* %27
%72 = load double*, double** %23
%73 = load i32, i32* %26
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %72, i64 %74
%76 = load double, double* %75
store double %76, double* %30
%77 = load double*, double** %23
%78 = load i32, i32* %27
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %77, i64 %79
%81 = load double, double* %80
store double %81, double* %39
store double 0.000000e+00, double* %40
br label %115
82: ; preds = %68
%83 = load double, double* %30
store double %83, double* %31
%84 = load double, double* %39
store double %84, double* %41
%85 = load double, double* %40
store double %85, double* %42
%86 = load i32*, i32** %19
%87 = load i32, i32* %86
%88 = load i32, i32* %26
%89 = add nsw i32 %88, %87
store i32 %89, i32* %26
%90 = load double*, double** %23
%91 = load i32, i32* %26
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double, double* %90, i64 %92
%94 = load double, double* %93
store double %94, double* %30
%95 = load double, double* %30
%96 = load double, double* %31
%97 = fsub double %95, %96
store double %97, double* %35
%98 = load i32*, i32** %19
%99 = load i32, i32* %98
%100 = load i32, i32* %27
%101 = add nsw i32 %100, %99
store i32 %101, i32* %27
%102 = load double*, double** %23
%103 = load i32, i32* %27
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %102, i64 %104
%106 = load double, double* %105
store double %106, double* %39
%107 = load double, double* %42
%108 = load double, double* %35
%109 = load double, double* %29
%110 = fmul double %108, %109
%111 = load double, double* %41
%112 = load double, double* %42
%113 = fsub double %111, %112
%114 = call double @llvm.fmuladd.f64(double %110, double %113, double %107)
store double %114, double* %40
br label %115
115: ; preds = %82, %71
%116 = load i32, i32* %25
store i32 %116, i32* %28
%117 = load double, double* %40
%118 = load double, double* %33
%119 = call double @pow(double %117, double %118)
%120 = load double, double* %40
%121 = load double, double* %33
%122 = call double @pow(double %120, double %121)
%123 = load double, double* %38
%124 = load double, double* %33
%125 = call double @pow(double %123, double %124)
%126 = fadd double %122, %125
%127 = fdiv double %119, %126
%128 = load double*, double** %24
%129 = load i32, i32* %28
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %128, i64 %130
store double %127, double* %131
br label %132
132: ; preds = %115
%133 = load i32, i32* %25
%134 = add nsw i32 %133, 1
store i32 %134, i32* %25
br label %63
135: ; preds = %63
ret void
}

LLVM IR (-O2):
define void @model_(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture %3, i32* nocapture readnone %4, i32* nocapture readnone %5, i32* nocapture %6, i32* nocapture readnone %7, double* nocapture %8, double* nocapture writeonly %9, double* nocapture %10, double* nocapture writeonly %11) {
%13 = load double, double* %8
%14 = getelementptr inbounds double, double* %8, i64 1
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %8, i64 2
%17 = load double, double* %16
%18 = tail call double @log(i32 2)
%19 = fdiv double %18, %13
store double %19, double* %9
%20 = tail call double @pow(double 1.000000e+01, double %17)
%21 = getelementptr inbounds double, double* %9, i64 1
store double %20, double* %21
%22 = load i32, i32* %3
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %65
24: ; preds = %12
%25 = getelementptr inbounds double, double* %10, i64 1
%26 = load double, double* %10
%27 = load double, double* %25
%28 = tail call double @pow(double 0.000000e+00, double %15)
%29 = tail call double @pow(double 0.000000e+00, double %15)
%30 = tail call double @pow(double %20, double %15)
%31 = fadd double %29, %30
%32 = fdiv double %28, %31
store double %32, double* %11
%33 = load i32, i32* %3
%34 = icmp sgt i32 %33, 1
br i1 %34, label %35, label %65
35: ; preds = %24, %35
%36 = phi i64 [ %61, %35 ], [ 1, %24 ]
%37 = phi i32 [ %43, %35 ], [ 0, %24 ]
%38 = phi double [ %53, %35 ], [ 0.000000e+00, %24 ]
%39 = phi double [ %54, %35 ], [ %27, %24 ]
%40 = phi i32 [ %48, %35 ], [ 1, %24 ]
%41 = phi double [ %46, %35 ], [ %26, %24 ]
%42 = load i32, i32* %6
%43 = add nsw i32 %42, %37
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %10, i64 %44
%46 = load double, double* %45
%47 = fsub double %46, %41
%48 = add nsw i32 %42, %40
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %10, i64 %49
%51 = fmul double %13, %47
%52 = fsub double %39, %38
%53 = tail call double @llvm.fmuladd.f64(double %51, double %52, double %38)
%54 = load double, double* %50
%55 = tail call double @pow(double %53, double %15)
%56 = tail call double @pow(double %53, double %15)
%57 = tail call double @pow(double %20, double %15)
%58 = fadd double %56, %57
%59 = fdiv double %55, %58
%60 = getelementptr inbounds double, double* %11, i64 %36
store double %59, double* %60
%61 = add nuw nsw i64 %36, 1
%62 = load i32, i32* %3
%63 = sext i32 %62 to i64
%64 = icmp slt i64 %61, %63
br i1 %64, label %35, label %65
65: ; preds = %35, %24, %12
ret void
}