#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 /*<<< orphan*/ memcpy(double *, double *, int);
void HoltWinters(double *x, int *xl, double *alpha, double *beta, double *gamma,
                 int *start_time, int *seasonal, int *period, double *a,
                 double *b, double *s, double *SSE, double *level,
                 double *trend, double *season) {
  double res = 0, xhat = 0, stmp = 0;
  int i, i0, s0;
  level[0] = *a;
  if (*beta > 0)
    trend[0] = *b;
  if (*gamma > 0)
    memcpy(season, s, *period * sizeof(double));
  for (i = *start_time - 1; i < *xl; i++) {
    i0 = i - *start_time + 2;
    s0 = i0 + *period - 1;
    xhat = level[i0 - 1] + (*beta > 0 ? trend[i0 - 1] : 0);
    stmp = *gamma > 0 ? season[s0 - *period] : (*seasonal != 1);
    if (*seasonal == 1)
      xhat += stmp;
    else
      xhat *= stmp;
    res = x[i] - xhat;
    *SSE += res * res;
    if (*seasonal == 1)
      level[i0] = *alpha * (x[i] - stmp) +
                  (1 - *alpha) * (level[i0 - 1] + trend[i0 - 1]);
    else
      level[i0] = *alpha * (x[i] / stmp) +
                  (1 - *alpha) * (level[i0 - 1] + trend[i0 - 1]);
    if (*beta > 0)
      trend[i0] =
          *beta * (level[i0] - level[i0 - 1]) + (1 - *beta) * trend[i0 - 1];
    if (*gamma > 0) {
      if (*seasonal == 1)
        season[s0] = *gamma * (x[i] - level[i0]) + (1 - *gamma) * stmp;
      else
        season[s0] = *gamma * (x[i] / level[i0]) + (1 - *gamma) * stmp;
    }
  }
}


x86 assembly (clang, -O0):
<HoltWinters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
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)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11a1 <HoltWinters+0x91>
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11d0 <HoltWinters+0xc0>
mov    0x50(%rbp),%rdi
mov    0x30(%rbp),%rsi
mov    0x18(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    1556 <HoltWinters+0x446>
mov    -0x4c(%rbp),%eax
mov    -0x30(%rbp),%rcx
sub    (%rcx),%eax
add    $0x2,%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    0x18(%rbp),%rcx
add    (%rcx),%eax
sub    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    0x40(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1251 <HoltWinters+0x141>
mov    0x48(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    125e <HoltWinters+0x14e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    125e <HoltWinters+0x14e>
movsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12a5 <HoltWinters+0x195>
mov    0x50(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    0x18(%rbp),%rdx
sub    (%rdx),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    12bd <HoltWinters+0x1ad>
mov    0x10(%rbp),%rax
cmpl   $0x1,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    12e8 <HoltWinters+0x1d8>
movsd  -0x48(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    12f7 <HoltWinters+0x1e7>
movsd  -0x48(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    0x38(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    13a5 <HoltWinters+0x295>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
subsd  -0x48(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movsd  0xca1(%rip),%xmm1
subsd  (%rax),%xmm1
mov    0x40(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    0x48(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    140c <HoltWinters+0x2fc>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
divsd  -0x48(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movsd  0xc35(%rip),%xmm1
subsd  (%rax),%xmm1
mov    0x40(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    0x48(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    147f <HoltWinters+0x36f>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x40(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
movsd  0xbac(%rip),%xmm1
subsd  (%rax),%xmm1
mov    0x48(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x48(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1543 <HoltWinters+0x433>
mov    0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    14f2 <HoltWinters+0x3e2>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movsd  0xb31(%rip),%xmm1
subsd  (%rax),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x50(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    153e <HoltWinters+0x42e>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movsd  0xae0(%rip),%xmm1
subsd  (%rax),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x50(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1543 <HoltWinters+0x433>
jmp    1548 <HoltWinters+0x438>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11dc <HoltWinters+0xcc>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HoltWinters>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r13
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%rcx
mov    0x88(%rsp),%rsi
mov    0x80(%rsp),%rdx
mov    0x60(%rsp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,(%rdx)
movsd  (%rbx),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    1165 <HoltWinters+0x55>
mov    0x68(%rsp),%rax
movsd  (%rax),%xmm1
movsd  %xmm1,(%rsi)
mov    0x90(%rsp),%r12
mov    0x58(%rsp),%rbp
movsd  (%r14),%xmm1
ucomisd %xmm0,%xmm1
jbe    11b4 <HoltWinters+0xa4>
mov    0x70(%rsp),%rsi
mov    0x0(%rbp),%edx
shl    $0x3,%edx
mov    %rdi,0x10(%rsp)
mov    %r12,%rdi
mov    %rcx,0x8(%rsp)
call   1030 <memcpy@plt>
mov    0x8(%rsp),%rcx
mov    0x10(%rsp),%rdi
mov    0x88(%rsp),%rsi
mov    0x80(%rsp),%rdx
movslq 0x0(%r13),%rax
mov    (%rcx),%r11d
cmp    %r11d,%eax
jle    11cf <HoltWinters+0xbf>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x78(%rsp),%r9
mov    0x50(%rsp),%r8
lea    -0x1(%rax),%ecx
mov    0x0(%rbp),%r10d
movslq %ecx,%rcx
lea    (%rdi,%rcx,8),%rdi
sub    %rax,%rcx
lea    (%rsi,%rcx,8),%rbp
add    $0x8,%rbp
lea    (%rdx,%rcx,8),%rdx
add    $0x10,%rdx
sub    %eax,%r11d
add    $0x1,%r11d
xor    %ecx,%ecx
xorpd  %xmm0,%xmm0
movsd  0xdf1(%rip),%xmm1
jmp    124e <HoltWinters+0x13e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
divsd  %xmm5,%xmm4
movapd %xmm1,%xmm5
subsd  %xmm3,%xmm5
mulsd  %xmm5,%xmm2
mulsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
movslq %esi,%rax
movsd  %xmm4,(%r12,%rax,8)
add    $0x1,%rcx
cmp    %ecx,%r11d
je     11c0 <HoltWinters+0xb0>
movsd  (%rbx),%xmm2
ucomisd %xmm0,%xmm2
xorpd  %xmm3,%xmm3
jbe    1262 <HoltWinters+0x152>
movsd  0x0(%rbp,%rcx,8),%xmm3
movsd  (%r14),%xmm2
ucomisd %xmm0,%xmm2
jbe    1280 <HoltWinters+0x170>
movslq %ecx,%rax
movsd  (%r12,%rax,8),%xmm2
mov    (%r8),%eax
jmp    1290 <HoltWinters+0x180>
nopl   0x0(%rax,%rax,1)
mov    (%r8),%eax
movapd %xmm1,%xmm2
cmp    $0x1,%eax
jne    1290 <HoltWinters+0x180>
xorpd  %xmm2,%xmm2
lea    (%r10,%rcx,1),%rsi
addsd  -0x8(%rdx,%rcx,8),%xmm3
cmp    $0x1,%eax
je     12b0 <HoltWinters+0x1a0>
mulsd  %xmm2,%xmm3
jmp    12b4 <HoltWinters+0x1a4>
cs nopw 0x0(%rax,%rax,1)
nop
addsd  %xmm2,%xmm3
movsd  (%rdi,%rcx,8),%xmm4
subsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm4
addsd  (%r9),%xmm4
movsd  %xmm4,(%r9)
movsd  (%rdi,%rcx,8),%xmm3
jne    12e0 <HoltWinters+0x1d0>
subsd  %xmm2,%xmm3
jmp    12e4 <HoltWinters+0x1d4>
nopl   0x0(%rax,%rax,1)
divsd  %xmm2,%xmm3
movsd  (%r15),%xmm5
movsd  -0x8(%rdx,%rcx,8),%xmm4
movapd %xmm1,%xmm6
subsd  %xmm5,%xmm6
movsd  0x0(%rbp,%rcx,8),%xmm7
addsd  %xmm4,%xmm7
mulsd  %xmm6,%xmm7
mulsd  %xmm5,%xmm3
addsd  %xmm7,%xmm3
movsd  %xmm3,(%rdx,%rcx,8)
movsd  (%rbx),%xmm5
ucomisd %xmm0,%xmm5
jbe    133c <HoltWinters+0x22c>
movapd %xmm1,%xmm6
subsd  %xmm5,%xmm6
mulsd  0x0(%rbp,%rcx,8),%xmm6
subsd  %xmm4,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm6,%xmm3
movsd  %xmm3,0x8(%rbp,%rcx,8)
movsd  (%r14),%xmm3
ucomisd %xmm0,%xmm3
jbe    1241 <HoltWinters+0x131>
movsd  (%rdi,%rcx,8),%xmm4
movsd  (%rdx,%rcx,8),%xmm5
cmp    $0x1,%eax
jne    1220 <HoltWinters+0x110>
subsd  %xmm5,%xmm4
jmp    1224 <HoltWinters+0x114>

LLVM IR (-O0):
define void @HoltWinters(double* %0, i32* %1, double* %2, double* %3, double* %4, i32* %5, i32* %6, i32* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14) {
%16 = alloca double*
%17 = alloca i32*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i32*
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca double*
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
store double* %0, double** %16
store i32* %1, i32** %17
store double* %2, double** %18
store double* %3, double** %19
store double* %4, double** %20
store i32* %5, i32** %21
store i32* %6, i32** %22
store i32* %7, i32** %23
store double* %8, double** %24
store double* %9, double** %25
store double* %10, double** %26
store double* %11, double** %27
store double* %12, double** %28
store double* %13, double** %29
store double* %14, double** %30
store double 0.000000e+00, double* %31
store double 0.000000e+00, double* %32
store double 0.000000e+00, double* %33
%37 = load double*, double** %24
%38 = load double, double* %37
%39 = load double*, double** %28
%40 = getelementptr inbounds double, double* %39, i64 0
store double %38, double* %40
%41 = load double*, double** %19
%42 = load double, double* %41
%43 = fcmp ogt double %42, 0.000000e+00
br i1 %43, label %44, label %49
44: ; preds = %15
%45 = load double*, double** %25
%46 = load double, double* %45
%47 = load double*, double** %29
%48 = getelementptr inbounds double, double* %47, i64 0
store double %46, double* %48
br label %49
49: ; preds = %44, %15
%50 = load double*, double** %20
%51 = load double, double* %50
%52 = fcmp ogt double %51, 0.000000e+00
br i1 %52, label %53, label %62
53: ; preds = %49
%54 = load double*, double** %30
%55 = load double*, double** %26
%56 = load i32*, i32** %23
%57 = load i32, i32* %56
%58 = sext i32 %57 to i64
%59 = mul i64 %58, 8
%60 = trunc i64 %59 to i32
%61 = call i32 @memcpy(double* %54, double* %55, i32 %60)
br label %62
62: ; preds = %53, %49
%63 = load i32*, i32** %21
%64 = load i32, i32* %63
%65 = sub nsw i32 %64, 1
store i32 %65, i32* %34
br label %66
66: ; preds = %305, %62
%67 = load i32, i32* %34
%68 = load i32*, i32** %17
%69 = load i32, i32* %68
%70 = icmp slt i32 %67, %69
br i1 %70, label %71, label %308
71: ; preds = %66
%72 = load i32, i32* %34
%73 = load i32*, i32** %21
%74 = load i32, i32* %73
%75 = sub nsw i32 %72, %74
%76 = add nsw i32 %75, 2
store i32 %76, i32* %35
%77 = load i32, i32* %35
%78 = load i32*, i32** %23
%79 = load i32, i32* %78
%80 = add nsw i32 %77, %79
%81 = sub nsw i32 %80, 1
store i32 %81, i32* %36
%82 = load double*, double** %28
%83 = load i32, i32* %35
%84 = sub nsw i32 %83, 1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %82, i64 %85
%87 = load double, double* %86
%88 = load double*, double** %19
%89 = load double, double* %88
%90 = fcmp ogt double %89, 0.000000e+00
br i1 %90, label %91, label %98
91: ; preds = %71
%92 = load double*, double** %29
%93 = load i32, i32* %35
%94 = sub nsw i32 %93, 1
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %92, i64 %95
%97 = load double, double* %96
br label %99
98: ; preds = %71
br label %99
99: ; preds = %98, %91
%100 = phi double [ %97, %91 ], [ 0.000000e+00, %98 ]
%101 = fadd double %87, %100
store double %101, double* %32
%102 = load double*, double** %20
%103 = load double, double* %102
%104 = fcmp ogt double %103, 0.000000e+00
br i1 %104, label %105, label %114
105: ; preds = %99
%106 = load double*, double** %30
%107 = load i32, i32* %36
%108 = load i32*, i32** %23
%109 = load i32, i32* %108
%110 = sub nsw i32 %107, %109
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds double, double* %106, i64 %111
%113 = load double, double* %112
br label %120
114: ; preds = %99
%115 = load i32*, i32** %22
%116 = load i32, i32* %115
%117 = icmp ne i32 %116, 1
%118 = zext i1 %117 to i32
%119 = sitofp i32 %118 to double
br label %120
120: ; preds = %114, %105
%121 = phi double [ %113, %105 ], [ %119, %114 ]
store double %121, double* %33
%122 = load i32*, i32** %22
%123 = load i32, i32* %122
%124 = icmp eq i32 %123, 1
br i1 %124, label %125, label %129
125: ; preds = %120
%126 = load double, double* %33
%127 = load double, double* %32
%128 = fadd double %127, %126
store double %128, double* %32
br label %133
129: ; preds = %120
%130 = load double, double* %33
%131 = load double, double* %32
%132 = fmul double %131, %130
store double %132, double* %32
br label %133
133: ; preds = %129, %125
%134 = load double*, double** %16
%135 = load i32, i32* %34
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds double, double* %134, i64 %136
%138 = load double, double* %137
%139 = load double, double* %32
%140 = fsub double %138, %139
store double %140, double* %31
%141 = load double, double* %31
%142 = load double, double* %31
%143 = load double*, double** %27
%144 = load double, double* %143
%145 = call double @llvm.fmuladd.f64(double %141, double %142, double %144)
store double %145, double* %143
%146 = load i32*, i32** %22
%147 = load i32, i32* %146
%148 = icmp eq i32 %147, 1
br i1 %148, label %149, label %181
149: ; preds = %133
%150 = load double*, double** %18
%151 = load double, double* %150
%152 = load double*, double** %16
%153 = load i32, i32* %34
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %152, i64 %154
%156 = load double, double* %155
%157 = load double, double* %33
%158 = fsub double %156, %157
%159 = load double*, double** %18
%160 = load double, double* %159
%161 = fsub double 1.000000e+00, %160
%162 = load double*, double** %28
%163 = load i32, i32* %35
%164 = sub nsw i32 %163, 1
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double, double* %162, i64 %165
%167 = load double, double* %166
%168 = load double*, double** %29
%169 = load i32, i32* %35
%170 = sub nsw i32 %169, 1
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds double, double* %168, i64 %171
%173 = load double, double* %172
%174 = fadd double %167, %173
%175 = fmul double %161, %174
%176 = call double @llvm.fmuladd.f64(double %151, double %158, double %175)
%177 = load double*, double** %28
%178 = load i32, i32* %35
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds double, double* %177, i64 %179
store double %176, double* %180
br label %213
181: ; preds = %133
%182 = load double*, double** %18
%183 = load double, double* %182
%184 = load double*, double** %16
%185 = load i32, i32* %34
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %184, i64 %186
%188 = load double, double* %187
%189 = load double, double* %33
%190 = fdiv double %188, %189
%191 = load double*, double** %18
%192 = load double, double* %191
%193 = fsub double 1.000000e+00, %192
%194 = load double*, double** %28
%195 = load i32, i32* %35
%196 = sub nsw i32 %195, 1
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds double, double* %194, i64 %197
%199 = load double, double* %198
%200 = load double*, double** %29
%201 = load i32, i32* %35
%202 = sub nsw i32 %201, 1
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds double, double* %200, i64 %203
%205 = load double, double* %204
%206 = fadd double %199, %205
%207 = fmul double %193, %206
%208 = call double @llvm.fmuladd.f64(double %183, double %190, double %207)
%209 = load double*, double** %28
%210 = load i32, i32* %35
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds double, double* %209, i64 %211
store double %208, double* %212
br label %213
213: ; preds = %181, %149
%214 = load double*, double** %19
%215 = load double, double* %214
%216 = fcmp ogt double %215, 0.000000e+00
br i1 %216, label %217, label %247
217: ; preds = %213
%218 = load double*, double** %19
%219 = load double, double* %218
%220 = load double*, double** %28
%221 = load i32, i32* %35
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds double, double* %220, i64 %222
%224 = load double, double* %223
%225 = load double*, double** %28
%226 = load i32, i32* %35
%227 = sub nsw i32 %226, 1
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds double, double* %225, i64 %228
%230 = load double, double* %229
%231 = fsub double %224, %230
%232 = load double*, double** %19
%233 = load double, double* %232
%234 = fsub double 1.000000e+00, %233
%235 = load double*, double** %29
%236 = load i32, i32* %35
%237 = sub nsw i32 %236, 1
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds double, double* %235, i64 %238
%240 = load double, double* %239
%241 = fmul double %234, %240
%242 = call double @llvm.fmuladd.f64(double %219, double %231, double %241)
%243 = load double*, double** %29
%244 = load i32, i32* %35
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds double, double* %243, i64 %245
store double %242, double* %246
br label %247
247: ; preds = %217, %213
%248 = load double*, double** %20
%249 = load double, double* %248
%250 = fcmp ogt double %249, 0.000000e+00
br i1 %250, label %251, label %304
251: ; preds = %247
%252 = load i32*, i32** %22
%253 = load i32, i32* %252
%254 = icmp eq i32 %253, 1
br i1 %254, label %255, label %279
255: ; preds = %251
%256 = load double*, double** %20
%257 = load double, double* %256
%258 = load double*, double** %16
%259 = load i32, i32* %34
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds double, double* %258, i64 %260
%262 = load double, double* %261
%263 = load double*, double** %28
%264 = load i32, i32* %35
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds double, double* %263, i64 %265
%267 = load double, double* %266
%268 = fsub double %262, %267
%269 = load double*, double** %20
%270 = load double, double* %269
%271 = fsub double 1.000000e+00, %270
%272 = load double, double* %33
%273 = fmul double %271, %272
%274 = call double @llvm.fmuladd.f64(double %257, double %268, double %273)
%275 = load double*, double** %30
%276 = load i32, i32* %36
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds double, double* %275, i64 %277
store double %274, double* %278
br label %303
279: ; preds = %251
%280 = load double*, double** %20
%281 = load double, double* %280
%282 = load double*, double** %16
%283 = load i32, i32* %34
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds double, double* %282, i64 %284
%286 = load double, double* %285
%287 = load double*, double** %28
%288 = load i32, i32* %35
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds double, double* %287, i64 %289
%291 = load double, double* %290
%292 = fdiv double %286, %291
%293 = load double*, double** %20
%294 = load double, double* %293
%295 = fsub double 1.000000e+00, %294
%296 = load double, double* %33
%297 = fmul double %295, %296
%298 = call double @llvm.fmuladd.f64(double %281, double %292, double %297)
%299 = load double*, double** %30
%300 = load i32, i32* %36
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds double, double* %299, i64 %301
store double %298, double* %302
br label %303
303: ; preds = %279, %255
br label %304
304: ; preds = %303, %247
br label %305
305: ; preds = %304
%306 = load i32, i32* %34
%307 = add nsw i32 %306, 1
store i32 %307, i32* %34
br label %66
308: ; preds = %66
ret void
}

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