#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 */
scalar_t__ ceil(double);
double hat(double);
int maxi(int /*<<< orphan*/, int);
int /*<<< orphan*/ mini(int, int);
double sq(double);
void fe_SigmaB1_at(double *S, double *y, int N, double dt, int L) {
  int n = 1 << (L - 1);
  int K = 1;
  int d = 2 * n - 1 + K;
  int t;
  int i, j;
  double yn;
  for (t = 0; t < N; t++) {
    yn = y[t] * (double)n;
    i = maxi(mini(((int)ceil(yn)), n), 1);
    j = maxi(mini(((int)ceil(yn - 0.5)), n - 1), 1);
    S[(2 * i - 2) * d + 2 * i - 2] += sq(hat(yn - i + 1)) * dt;
    S[(2 * j - 1) * d + 2 * j - 1] += sq(hat(yn - j + 0.5)) * dt;
    S[(2 * i - 2) * d + 2 * j - 1] = S[(2 * j - 1) * d + 2 * i - 2] +=
        hat(yn - i + 1) * hat(yn - j + 0.5) * dt;
    S[(d - 1) * d + 2 * j - 1] = S[(2 * j - 1) * d + d - 1] +=
        hat(yn - j + 0.5) * dt;
    S[(d - 1) * d + 2 * i - 2] = S[(2 * i - 2) * d + d - 1] +=
        hat(yn - i + 1) * dt;
  }
  S[d * d - 1] = N * dt;
}


x86 assembly (clang, -O0):
<fe_SigmaB1_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1461 <fe_SigmaB1_at+0x311>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %eax,%edi
mov    -0x28(%rbp),%esi
call   1040 <mini@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1070 <maxi@plt>
mov    %eax,-0x38(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xe19(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,%edi
mov    -0x28(%rbp),%esi
sub    $0x1,%esi
call   1040 <mini@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1070 <maxi@plt>
mov    %eax,-0x3c(%rbp)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xdd6(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <hat@plt>
call   1060 <sq@plt>
movsd  -0x20(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x2,%ecx
imul   -0x30(%rbp),%ecx
mov    -0x38(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd84(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <hat@plt>
call   1060 <sq@plt>
movsd  -0x20(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
imul   -0x30(%rbp),%ecx
mov    -0x3c(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd22(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <hat@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd06(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <hat@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
imul   -0x30(%rbp),%ecx
mov    -0x38(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x2,%ecx
imul   -0x30(%rbp),%ecx
mov    -0x3c(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xc81(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <hat@plt>
movsd  -0x20(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
imul   -0x30(%rbp),%ecx
add    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x30(%rbp),%ecx
mov    -0x3c(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xc08(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <hat@plt>
movsd  -0x20(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x2,%ecx
imul   -0x30(%rbp),%ecx
add    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x30(%rbp),%ecx
mov    -0x38(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1198 <fe_SigmaB1_at+0x48>
cvtsi2sdl -0x14(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fe_SigmaB1_at>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
add    $0xff,%cl
mov    $0x1,%eax
shl    %cl,%eax
movapd %xmm0,%xmm1
mov    %rdi,%rbx
mov    %rax,0x30(%rsp)
add    %eax,%eax
mov    %rax,0x20(%rsp)
mov    %edx,0x1c(%rsp)
test   %edx,%edx
jle    13a7 <fe_SigmaB1_at+0x257>
mov    0x30(%rsp),%rcx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,0x50(%rsp)
mov    0x20(%rsp),%rax
lea    -0x1(%rax),%edx
add    $0xffffffff,%ecx
mov    %ecx,0x28(%rsp)
mov    %edx,0x2c(%rsp)
mov    %edx,%ecx
imul   %eax,%ecx
mov    %rcx,0x48(%rsp)
mov    0x1c(%rsp),%eax
mov    %rax,0x40(%rsp)
xor    %eax,%eax
movsd  %xmm1,0x10(%rsp)
mov    %rsi,0x58(%rsp)
nopl   0x0(%rax)
mov    %rax,0x70(%rsp)
movsd  (%rsi,%rax,8),%xmm0
mulsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <ceil@plt>
mov    %eax,%edi
mov    0x30(%rsp),%rsi
call   1040 <mini@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1070 <maxi@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
addsd  0xded(%rip),%xmm0
call   1030 <ceil@plt>
mov    %eax,%edi
mov    0x28(%rsp),%esi
call   1040 <mini@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1070 <maxi@plt>
mov    %eax,%r15d
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
addsd  0xdbd(%rip),%xmm0
movsd  %xmm0,0x38(%rsp)
call   1050 <hat@plt>
call   1060 <sq@plt>
mov    %rbp,0x68(%rsp)
lea    -0x2(%rbp,%rbp,1),%r13d
mov    0x20(%rsp),%rax
imul   %eax,%r13d
mov    %rax,%r14
lea    -0x2(%r13,%rbp,2),%eax
cltq
mulsd  0x10(%rsp),%xmm0
addsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
xorps  %xmm1,%xmm1
cvtsi2sd %r15d,%xmm1
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
addsd  0xd6e(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1050 <hat@plt>
call   1060 <sq@plt>
mov    %r15d,%r12d
add    %r15d,%r12d
lea    (%r15,%r15,1),%ebp
add    $0xffffffff,%ebp
imul   %r14d,%ebp
lea    -0x1(%rbp,%r15,2),%eax
cltq
mulsd  0x10(%rsp),%xmm0
addsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x38(%rsp),%xmm0
call   1050 <hat@plt>
movsd  %xmm0,0x60(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <hat@plt>
mulsd  0x60(%rsp),%xmm0
mov    0x68(%rsp),%r14
lea    -0x2(%rbp,%r14,2),%eax
cltq
mulsd  0x10(%rsp),%xmm0
addsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
lea    -0x1(%r13,%r15,2),%eax
cltq
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x8(%rsp),%xmm0
call   1050 <hat@plt>
imul   0x20(%rsp),%r12d
movslq %r12d,%rax
mulsd  0x10(%rsp),%xmm0
addsd  -0x8(%rbx,%rax,8),%xmm0
movsd  %xmm0,-0x8(%rbx,%rax,8)
mov    0x48(%rsp),%rbp
lea    -0x1(%rbp,%r15,2),%eax
cltq
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x38(%rsp),%xmm0
call   1050 <hat@plt>
mov    0x58(%rsp),%rsi
movsd  0x10(%rsp),%xmm1
add    0x2c(%rsp),%r13d
movslq %r13d,%rax
mulsd  %xmm1,%xmm0
addsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
lea    -0x2(%rbp,%r14,2),%eax
cltq
movsd  %xmm0,(%rbx,%rax,8)
mov    0x70(%rsp),%rax
add    $0x1,%rax
cmp    %rax,0x40(%rsp)
jne    11d0 <fe_SigmaB1_at+0x80>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x1c(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mov    0x20(%rsp),%rax
imul   %eax,%eax
cltq
movsd  %xmm0,-0x8(%rbx,%rax,8)
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @fe_SigmaB1_at(double* %0, double* %1, i32 %2, double %3, i32 %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store double %3, double* %9
store i32 %4, i32* %10
%18 = load i32, i32* %10
%19 = sub nsw i32 %18, 1
%20 = shl i32 1, %19
store i32 %20, i32* %11
store i32 1, i32* %12
%21 = load i32, i32* %11
%22 = mul nsw i32 2, %21
%23 = sub nsw i32 %22, 1
%24 = load i32, i32* %12
%25 = add nsw i32 %23, %24
store i32 %25, i32* %13
store i32 0, i32* %14
br label %26
26: ; preds = %199, %5
%27 = load i32, i32* %14
%28 = load i32, i32* %8
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %202
30: ; preds = %26
%31 = load double*, double** %7
%32 = load i32, i32* %14
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = load i32, i32* %11
%37 = sitofp i32 %36 to double
%38 = fmul double %35, %37
store double %38, double* %17
%39 = load double, double* %17
%40 = call i64 @ceil(double %39)
%41 = trunc i64 %40 to i32
%42 = load i32, i32* %11
%43 = call i32 @mini(i32 %41, i32 %42)
%44 = call i32 @maxi(i32 %43, i32 1)
store i32 %44, i32* %15
%45 = load double, double* %17
%46 = fsub double %45, 5.000000e-01
%47 = call i64 @ceil(double %46)
%48 = trunc i64 %47 to i32
%49 = load i32, i32* %11
%50 = sub nsw i32 %49, 1
%51 = call i32 @mini(i32 %48, i32 %50)
%52 = call i32 @maxi(i32 %51, i32 1)
store i32 %52, i32* %16
%53 = load double, double* %17
%54 = load i32, i32* %15
%55 = sitofp i32 %54 to double
%56 = fsub double %53, %55
%57 = fadd double %56, 1.000000e+00
%58 = call double @hat(double %57)
%59 = call double @sq(double %58)
%60 = load double, double* %9
%61 = load double*, double** %6
%62 = load i32, i32* %15
%63 = mul nsw i32 2, %62
%64 = sub nsw i32 %63, 2
%65 = load i32, i32* %13
%66 = mul nsw i32 %64, %65
%67 = load i32, i32* %15
%68 = mul nsw i32 2, %67
%69 = add nsw i32 %66, %68
%70 = sub nsw i32 %69, 2
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %61, i64 %71
%73 = load double, double* %72
%74 = call double @llvm.fmuladd.f64(double %59, double %60, double %73)
store double %74, double* %72
%75 = load double, double* %17
%76 = load i32, i32* %16
%77 = sitofp i32 %76 to double
%78 = fsub double %75, %77
%79 = fadd double %78, 5.000000e-01
%80 = call double @hat(double %79)
%81 = call double @sq(double %80)
%82 = load double, double* %9
%83 = load double*, double** %6
%84 = load i32, i32* %16
%85 = mul nsw i32 2, %84
%86 = sub nsw i32 %85, 1
%87 = load i32, i32* %13
%88 = mul nsw i32 %86, %87
%89 = load i32, i32* %16
%90 = mul nsw i32 2, %89
%91 = add nsw i32 %88, %90
%92 = sub nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %83, i64 %93
%95 = load double, double* %94
%96 = call double @llvm.fmuladd.f64(double %81, double %82, double %95)
store double %96, double* %94
%97 = load double, double* %17
%98 = load i32, i32* %15
%99 = sitofp i32 %98 to double
%100 = fsub double %97, %99
%101 = fadd double %100, 1.000000e+00
%102 = call double @hat(double %101)
%103 = load double, double* %17
%104 = load i32, i32* %16
%105 = sitofp i32 %104 to double
%106 = fsub double %103, %105
%107 = fadd double %106, 5.000000e-01
%108 = call double @hat(double %107)
%109 = fmul double %102, %108
%110 = load double, double* %9
%111 = load double*, double** %6
%112 = load i32, i32* %16
%113 = mul nsw i32 2, %112
%114 = sub nsw i32 %113, 1
%115 = load i32, i32* %13
%116 = mul nsw i32 %114, %115
%117 = load i32, i32* %15
%118 = mul nsw i32 2, %117
%119 = add nsw i32 %116, %118
%120 = sub nsw i32 %119, 2
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds double, double* %111, i64 %121
%123 = load double, double* %122
%124 = call double @llvm.fmuladd.f64(double %109, double %110, double %123)
store double %124, double* %122
%125 = load double*, double** %6
%126 = load i32, i32* %15
%127 = mul nsw i32 2, %126
%128 = sub nsw i32 %127, 2
%129 = load i32, i32* %13
%130 = mul nsw i32 %128, %129
%131 = load i32, i32* %16
%132 = mul nsw i32 2, %131
%133 = add nsw i32 %130, %132
%134 = sub nsw i32 %133, 1
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %125, i64 %135
store double %124, double* %136
%137 = load double, double* %17
%138 = load i32, i32* %16
%139 = sitofp i32 %138 to double
%140 = fsub double %137, %139
%141 = fadd double %140, 5.000000e-01
%142 = call double @hat(double %141)
%143 = load double, double* %9
%144 = load double*, double** %6
%145 = load i32, i32* %16
%146 = mul nsw i32 2, %145
%147 = sub nsw i32 %146, 1
%148 = load i32, i32* %13
%149 = mul nsw i32 %147, %148
%150 = load i32, i32* %13
%151 = add nsw i32 %149, %150
%152 = sub nsw i32 %151, 1
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %144, i64 %153
%155 = load double, double* %154
%156 = call double @llvm.fmuladd.f64(double %142, double %143, double %155)
store double %156, double* %154
%157 = load double*, double** %6
%158 = load i32, i32* %13
%159 = sub nsw i32 %158, 1
%160 = load i32, i32* %13
%161 = mul nsw i32 %159, %160
%162 = load i32, i32* %16
%163 = mul nsw i32 2, %162
%164 = add nsw i32 %161, %163
%165 = sub nsw i32 %164, 1
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds double, double* %157, i64 %166
store double %156, double* %167
%168 = load double, double* %17
%169 = load i32, i32* %15
%170 = sitofp i32 %169 to double
%171 = fsub double %168, %170
%172 = fadd double %171, 1.000000e+00
%173 = call double @hat(double %172)
%174 = load double, double* %9
%175 = load double*, double** %6
%176 = load i32, i32* %15
%177 = mul nsw i32 2, %176
%178 = sub nsw i32 %177, 2
%179 = load i32, i32* %13
%180 = mul nsw i32 %178, %179
%181 = load i32, i32* %13
%182 = add nsw i32 %180, %181
%183 = sub nsw i32 %182, 1
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %175, i64 %184
%186 = load double, double* %185
%187 = call double @llvm.fmuladd.f64(double %173, double %174, double %186)
store double %187, double* %185
%188 = load double*, double** %6
%189 = load i32, i32* %13
%190 = sub nsw i32 %189, 1
%191 = load i32, i32* %13
%192 = mul nsw i32 %190, %191
%193 = load i32, i32* %15
%194 = mul nsw i32 2, %193
%195 = add nsw i32 %192, %194
%196 = sub nsw i32 %195, 2
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds double, double* %188, i64 %197
store double %187, double* %198
br label %199
199: ; preds = %30
%200 = load i32, i32* %14
%201 = add nsw i32 %200, 1
store i32 %201, i32* %14
br label %26
202: ; preds = %26
%203 = load i32, i32* %8
%204 = sitofp i32 %203 to double
%205 = load double, double* %9
%206 = fmul double %204, %205
%207 = load double*, double** %6
%208 = load i32, i32* %13
%209 = load i32, i32* %13
%210 = mul nsw i32 %208, %209
%211 = sub nsw i32 %210, 1
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds double, double* %207, i64 %212
store double %206, double* %213
ret void
}

LLVM IR (-O2):
define void @fe_SigmaB1_at(double* nocapture %0, double* nocapture %1, i32 %2, double %3, i32 %4) {
%6 = add nsw i32 %4, -1
%7 = shl nuw i32 1, %6
%8 = shl nsw i32 %7, 1
%9 = icmp sgt i32 %2, 0
br i1 %9, label %10, label %88
10: ; preds = %5
%11 = add i32 %8, -1
%12 = sitofp i32 %7 to double
%13 = add nsw i32 %7, -1
%14 = mul nsw i32 %11, %8
%15 = zext i32 %2 to i64
br label %16
16: ; preds = %10, %16
%17 = phi i64 [ 0, %10 ], [ %86, %16 ]
%18 = getelementptr inbounds double, double* %1, i64 %17
%19 = load double, double* %18
%20 = fmul double %19, %12
%21 = tail call i64 @ceil(double %20)
%22 = trunc i64 %21 to i32
%23 = tail call i32 @mini(i32 %22, i32 %7)
%24 = tail call i32 @maxi(i32 %23, i32 1)
%25 = fadd double %20, -5.000000e-01
%26 = tail call i64 @ceil(double %25)
%27 = trunc i64 %26 to i32
%28 = tail call i32 @mini(i32 %27, i32 %13)
%29 = tail call i32 @maxi(i32 %28, i32 1)
%30 = sitofp i32 %24 to double
%31 = fsub double %20, %30
%32 = fadd double %31, 1.000000e+00
%33 = tail call double @hat(double %32)
%34 = tail call double @sq(double %33)
%35 = shl nsw i32 %24, 1
%36 = add i32 %35, -2
%37 = mul nsw i32 %36, %8
%38 = add i32 %36, %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %0, i64 %39
%41 = load double, double* %40
%42 = tail call double @llvm.fmuladd.f64(double %34, double %3, double %41)
store double %42, double* %40
%43 = sitofp i32 %29 to double
%44 = fsub double %20, %43
%45 = fadd double %44, 5.000000e-01
%46 = tail call double @hat(double %45)
%47 = tail call double @sq(double %46)
%48 = shl nsw i32 %29, 1
%49 = add i32 %48, -1
%50 = mul nsw i32 %49, %8
%51 = add i32 %49, %50
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %0, i64 %52
%54 = load double, double* %53
%55 = tail call double @llvm.fmuladd.f64(double %47, double %3, double %54)
store double %55, double* %53
%56 = tail call double @hat(double %32)
%57 = tail call double @hat(double %45)
%58 = fmul double %56, %57
%59 = add i32 %36, %50
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %0, i64 %60
%62 = load double, double* %61
%63 = tail call double @llvm.fmuladd.f64(double %58, double %3, double %62)
store double %63, double* %61
%64 = add i32 %49, %37
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %0, i64 %65
store double %63, double* %66
%67 = tail call double @hat(double %45)
%68 = mul i32 %48, %8
%69 = add nsw i32 %68, -1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %0, i64 %70
%72 = load double, double* %71
%73 = tail call double @llvm.fmuladd.f64(double %67, double %3, double %72)
store double %73, double* %71
%74 = add i32 %49, %14
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %0, i64 %75
store double %73, double* %76
%77 = tail call double @hat(double %32)
%78 = add i32 %11, %37
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %0, i64 %79
%81 = load double, double* %80
%82 = tail call double @llvm.fmuladd.f64(double %77, double %3, double %81)
store double %82, double* %80
%83 = add i32 %36, %14
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %0, i64 %84
store double %82, double* %85
%86 = add nuw nsw i64 %17, 1
%87 = icmp eq i64 %86, %15
br i1 %87, label %88, label %16
88: ; preds = %16, %5
%89 = sitofp i32 %2 to double
%90 = fmul double %89, %3
%91 = mul nsw i32 %8, %8
%92 = add nsw i32 %91, -1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %0, i64 %93
store double %90, double* %94
ret void
}