#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);
int /*<<< orphan*/ printf(char *, ...);
double sq(double);
void fe_SigmaB2_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;
  printf("L: %i\n", L);
  printf("n: %i\n", n);
  printf("d: %i\n", d);
  printf("N: %i\n", N);
  printf("dt: %f\n", dt);
  double a, b, c;
  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);
    a = sq(hat(yn - i + 1)) * dt;
    b = sq(hat(yn - j + 0.5)) * dt;
    c = hat(yn - i + 1) * hat(yn - j + 0.5) * dt;
    if (t < 10)
      printf("%5.3f(%i, %i), %5.6f %5.6f %5.6f \n", yn, i, j, a, b, c);
    S[(2 * i - 2) * d + 2 * i - 2] += a;
    S[(2 * j - 1) * d + 2 * j - 1] += b;
    S[(2 * i - 2) * d + 2 * j - 1] = S[(2 * j - 1) * d + 2 * i - 2] += c;
    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;
  for (i = 0; i < d * d; i++) {
    printf(" %10.3f", S[i]);
    if (i % d == d - 1)
      printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<fe_SigmaB2_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%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)
mov    -0x24(%rbp),%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe3b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1500 <fe_SigmaB2_at+0x3a0>
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   1050 <mini@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1080 <maxi@plt>
mov    %eax,-0x38(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xdaa(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,%edi
mov    -0x28(%rbp),%esi
sub    $0x1,%esi
call   1050 <mini@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1080 <maxi@plt>
mov    %eax,-0x3c(%rbp)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd77(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1060 <hat@plt>
call   1070 <sq@plt>
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd41(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1060 <hat@plt>
call   1070 <sq@plt>
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd1b(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1060 <hat@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xcef(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1060 <hat@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1362 <fe_SigmaB2_at+0x202>
movsd  -0x48(%rbp),%xmm0
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
lea    0xcd9(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
movsd  -0x50(%rbp),%xmm0
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
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
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
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
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
addsd  (%rax,%rcx,8),%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  0xbda(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1060 <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  0xb71(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1060 <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    11ff <fe_SigmaB2_at+0x9f>
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)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x30(%rbp),%ecx
imul   -0x30(%rbp),%ecx
cmp    %ecx,%eax
jge    158a <fe_SigmaB2_at+0x42a>
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xb0a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%eax
cltd
idivl  -0x30(%rbp)
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
cmp    %eax,%edx
jne    1577 <fe_SigmaB2_at+0x417>
lea    0xae5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    157c <fe_SigmaB2_at+0x41c>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1527 <fe_SigmaB2_at+0x3c7>
lea    0xac4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fe_SigmaB2_at>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %ecx,%eax
lea    -0x1(%rax),%ecx
mov    $0x1,%ebp
shl    %cl,%ebp
movsd  %xmm0,0x18(%rsp)
mov    %edx,%r15d
mov    %rsi,0x78(%rsp)
mov    %rdi,0x28(%rsp)
lea    0x0(%rbp,%rbp,1),%ebx
lea    -0x1(%rbp,%rbp,1),%ecx
mov    %ecx,0x20(%rsp)
lea    0xe65(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe5c(%rip),%rdi
mov    %rbp,0x38(%rsp)
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe4e(%rip),%rdi
mov    %ebx,0xc(%rsp)
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe41(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe37(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r15d,0x24(%rsp)
test   %r15d,%r15d
jle    14b7 <fe_SigmaB2_at+0x347>
mov    0x38(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x70(%rsp)
add    $0xffffffff,%eax
mov    %eax,0x34(%rsp)
mov    0x20(%rsp),%eax
imul   0xc(%rsp),%eax
mov    %rax,0x68(%rsp)
mov    0x24(%rsp),%eax
mov    %rax,0x60(%rsp)
xor    %ebx,%ebx
mov    0xc(%rsp),%r15d
jmp    136a <fe_SigmaB2_at+0x1fa>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%r14,%r14,1),%ebp
add    $0xfffffffe,%ebp
imul   %r15d,%ebp
lea    -0x2(%rbp,%r14,2),%eax
cltq
mov    %r14,%rdx
mov    %r14,0x88(%rsp)
mov    0x28(%rsp),%r14
movsd  0x48(%rsp),%xmm0
addsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
mov    %r12d,%r13d
add    %r12d,%r13d
lea    (%r12,%r12,1),%eax
add    $0xffffffff,%eax
imul   %r15d,%eax
lea    (%rax,%r12,2),%ecx
add    $0xffffffff,%ecx
movslq %ecx,%rcx
movsd  0x40(%rsp),%xmm0
addsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
lea    -0x2(%rax,%rdx,2),%eax
cltq
addsd  (%r14,%rax,8),%xmm3
movsd  %xmm3,(%r14,%rax,8)
lea    -0x1(%rbp,%r12,2),%eax
cltq
movsd  %xmm3,(%r14,%rax,8)
movsd  0x50(%rsp),%xmm0
call   1070 <hat@plt>
imul   %r15d,%r13d
movslq %r13d,%rax
mulsd  0x18(%rsp),%xmm0
addsd  -0x8(%r14,%rax,8),%xmm0
movsd  %xmm0,-0x8(%r14,%rax,8)
mov    0x68(%rsp),%rbx
lea    -0x1(%rbx,%r12,2),%eax
cltq
movsd  %xmm0,(%r14,%rax,8)
movsd  0x58(%rsp),%xmm0
call   1070 <hat@plt>
add    0x20(%rsp),%ebp
movslq %ebp,%rax
mulsd  0x18(%rsp),%xmm0
addsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
mov    0x88(%rsp),%rax
lea    -0x2(%rbx,%rax,2),%eax
cltq
movsd  %xmm0,(%r14,%rax,8)
mov    0x90(%rsp),%rax
add    $0x1,%rax
cmp    %rax,0x60(%rsp)
mov    %rax,%rbx
je     14b7 <fe_SigmaB2_at+0x347>
mov    %rbx,0x90(%rsp)
mov    0x78(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm0
mulsd  0x70(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1040 <ceil@plt>
mov    %eax,%edi
mov    0x38(%rsp),%rsi
call   1060 <mini@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1090 <maxi@plt>
mov    %eax,%r14d
movsd  0x10(%rsp),%xmm0
addsd  0xc4a(%rip),%xmm0
call   1040 <ceil@plt>
mov    %eax,%edi
mov    0x34(%rsp),%esi
call   1060 <mini@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1090 <maxi@plt>
mov    %eax,%r12d
cvtsi2sd %r14d,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
addsd  0xc1c(%rip),%xmm0
movsd  %xmm0,0x58(%rsp)
call   1070 <hat@plt>
call   1080 <sq@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
addsd  0xbee(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
call   1070 <hat@plt>
call   1080 <sq@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x58(%rsp),%xmm0
call   1070 <hat@plt>
movsd  %xmm0,0x80(%rsp)
movsd  0x50(%rsp),%xmm0
call   1070 <hat@plt>
movapd %xmm0,%xmm3
mulsd  0x80(%rsp),%xmm3
mulsd  0x18(%rsp),%xmm3
cmp    $0x9,%rbx
ja     1260 <fe_SigmaB2_at+0xf0>
lea    0xbbb(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    %r14d,%esi
mov    %r12d,%edx
movsd  0x48(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
movsd  %xmm3,0x10(%rsp)
movsd  0x10(%rsp),%xmm3
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0x10(%rsp),%xmm3
jmp    1260 <fe_SigmaB2_at+0xf0>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x24(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
mov    0xc(%rsp),%eax
imul   %eax,%eax
mov    %eax,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    0x28(%rsp),%rdx
movsd  %xmm0,(%rdx,%rcx,8)
jae    14fc <fe_SigmaB2_at+0x38c>
mov    $0xa,%edi
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
mov    %eax,%r15d
xor    %ebp,%ebp
lea    0xb57(%rip),%rbx
jmp    1519 <fe_SigmaB2_at+0x3a9>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r15
je     14e1 <fe_SigmaB2_at+0x371>
mov    0x28(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %ebp,%eax
cltd
idivl  0xc(%rsp)
cmp    0x20(%rsp),%edx
jne    1510 <fe_SigmaB2_at+0x3a0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1510 <fe_SigmaB2_at+0x3a0>

LLVM IR (-O0):
@.str = [7 x i8] c"L: %i\0A\00"
@.str.1 = [7 x i8] c"n: %i\0A\00"
@.str.2 = [7 x i8] c"d: %i\0A\00"
@.str.3 = [7 x i8] c"N: %i\0A\00"
@.str.4 = [8 x i8] c"dt: %f\0A\00"
@.str.5 = [35 x i8] c"%5.3f(%i, %i), %5.6f %5.6f %5.6f \0A\00"
@.str.6 = [8 x i8] c" %10.3f\00"
@.str.7 = [2 x i8] c"\0A\00"
define void @fe_SigmaB2_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
%18 = alloca double
%19 = alloca double
%20 = 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
%21 = load i32, i32* %10
%22 = sub nsw i32 %21, 1
%23 = shl i32 1, %22
store i32 %23, i32* %11
store i32 1, i32* %12
%24 = load i32, i32* %11
%25 = mul nsw i32 2, %24
%26 = sub nsw i32 %25, 1
%27 = load i32, i32* %12
%28 = add nsw i32 %26, %27
store i32 %28, i32* %13
%29 = load i32, i32* %10
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %11
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %13
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %8
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = load double, double* %9
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %37)
store i32 0, i32* %14
br label %39
39: ; preds = %229, %5
%40 = load i32, i32* %14
%41 = load i32, i32* %8
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %232
43: ; preds = %39
%44 = load double*, double** %7
%45 = load i32, i32* %14
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load double, double* %47
%49 = load i32, i32* %11
%50 = sitofp i32 %49 to double
%51 = fmul double %48, %50
store double %51, double* %17
%52 = load double, double* %17
%53 = call i64 @ceil(double %52)
%54 = trunc i64 %53 to i32
%55 = load i32, i32* %11
%56 = call i32 @mini(i32 %54, i32 %55)
%57 = call i32 @maxi(i32 %56, i32 1)
store i32 %57, i32* %15
%58 = load double, double* %17
%59 = fsub double %58, 5.000000e-01
%60 = call i64 @ceil(double %59)
%61 = trunc i64 %60 to i32
%62 = load i32, i32* %11
%63 = sub nsw i32 %62, 1
%64 = call i32 @mini(i32 %61, i32 %63)
%65 = call i32 @maxi(i32 %64, i32 1)
store i32 %65, i32* %16
%66 = load double, double* %17
%67 = load i32, i32* %15
%68 = sitofp i32 %67 to double
%69 = fsub double %66, %68
%70 = fadd double %69, 1.000000e+00
%71 = call double @hat(double %70)
%72 = call double @sq(double %71)
%73 = load double, double* %9
%74 = fmul double %72, %73
store double %74, double* %18
%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 = fmul double %81, %82
store double %83, double* %19
%84 = load double, double* %17
%85 = load i32, i32* %15
%86 = sitofp i32 %85 to double
%87 = fsub double %84, %86
%88 = fadd double %87, 1.000000e+00
%89 = call double @hat(double %88)
%90 = load double, double* %17
%91 = load i32, i32* %16
%92 = sitofp i32 %91 to double
%93 = fsub double %90, %92
%94 = fadd double %93, 5.000000e-01
%95 = call double @hat(double %94)
%96 = fmul double %89, %95
%97 = load double, double* %9
%98 = fmul double %96, %97
store double %98, double* %20
%99 = load i32, i32* %14
%100 = icmp slt i32 %99, 10
br i1 %100, label %101, label %109
101: ; preds = %43
%102 = load double, double* %17
%103 = load i32, i32* %15
%104 = load i32, i32* %16
%105 = load double, double* %18
%106 = load double, double* %19
%107 = load double, double* %20
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), double %102, i32 %103, i32 %104, double %105, double %106, double %107)
br label %109
109: ; preds = %101, %43
%110 = load double, double* %18
%111 = load double*, double** %6
%112 = load i32, i32* %15
%113 = mul nsw i32 2, %112
%114 = sub nsw i32 %113, 2
%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 = fadd double %123, %110
store double %124, double* %122
%125 = load double, double* %19
%126 = load double*, double** %6
%127 = load i32, i32* %16
%128 = mul nsw i32 2, %127
%129 = sub nsw i32 %128, 1
%130 = load i32, i32* %13
%131 = mul nsw i32 %129, %130
%132 = load i32, i32* %16
%133 = mul nsw i32 2, %132
%134 = add nsw i32 %131, %133
%135 = sub nsw i32 %134, 1
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds double, double* %126, i64 %136
%138 = load double, double* %137
%139 = fadd double %138, %125
store double %139, double* %137
%140 = load double, double* %20
%141 = load double*, double** %6
%142 = load i32, i32* %16
%143 = mul nsw i32 2, %142
%144 = sub nsw i32 %143, 1
%145 = load i32, i32* %13
%146 = mul nsw i32 %144, %145
%147 = load i32, i32* %15
%148 = mul nsw i32 2, %147
%149 = add nsw i32 %146, %148
%150 = sub nsw i32 %149, 2
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double, double* %141, i64 %151
%153 = load double, double* %152
%154 = fadd double %153, %140
store double %154, double* %152
%155 = load double*, double** %6
%156 = load i32, i32* %15
%157 = mul nsw i32 2, %156
%158 = sub nsw i32 %157, 2
%159 = load i32, i32* %13
%160 = mul nsw i32 %158, %159
%161 = load i32, i32* %16
%162 = mul nsw i32 2, %161
%163 = add nsw i32 %160, %162
%164 = sub nsw i32 %163, 1
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double, double* %155, i64 %165
store double %154, double* %166
%167 = load double, double* %17
%168 = load i32, i32* %16
%169 = sitofp i32 %168 to double
%170 = fsub double %167, %169
%171 = fadd double %170, 5.000000e-01
%172 = call double @hat(double %171)
%173 = load double, double* %9
%174 = load double*, double** %6
%175 = load i32, i32* %16
%176 = mul nsw i32 2, %175
%177 = sub nsw i32 %176, 1
%178 = load i32, i32* %13
%179 = mul nsw i32 %177, %178
%180 = load i32, i32* %13
%181 = add nsw i32 %179, %180
%182 = sub nsw i32 %181, 1
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds double, double* %174, i64 %183
%185 = load double, double* %184
%186 = call double @llvm.fmuladd.f64(double %172, double %173, double %185)
store double %186, double* %184
%187 = load double*, double** %6
%188 = load i32, i32* %13
%189 = sub nsw i32 %188, 1
%190 = load i32, i32* %13
%191 = mul nsw i32 %189, %190
%192 = load i32, i32* %16
%193 = mul nsw i32 2, %192
%194 = add nsw i32 %191, %193
%195 = sub nsw i32 %194, 1
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds double, double* %187, i64 %196
store double %186, double* %197
%198 = load double, double* %17
%199 = load i32, i32* %15
%200 = sitofp i32 %199 to double
%201 = fsub double %198, %200
%202 = fadd double %201, 1.000000e+00
%203 = call double @hat(double %202)
%204 = load double, double* %9
%205 = load double*, double** %6
%206 = load i32, i32* %15
%207 = mul nsw i32 2, %206
%208 = sub nsw i32 %207, 2
%209 = load i32, i32* %13
%210 = mul nsw i32 %208, %209
%211 = load i32, i32* %13
%212 = add nsw i32 %210, %211
%213 = sub nsw i32 %212, 1
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds double, double* %205, i64 %214
%216 = load double, double* %215
%217 = call double @llvm.fmuladd.f64(double %203, double %204, double %216)
store double %217, double* %215
%218 = load double*, double** %6
%219 = load i32, i32* %13
%220 = sub nsw i32 %219, 1
%221 = load i32, i32* %13
%222 = mul nsw i32 %220, %221
%223 = load i32, i32* %15
%224 = mul nsw i32 2, %223
%225 = add nsw i32 %222, %224
%226 = sub nsw i32 %225, 2
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double, double* %218, i64 %227
store double %217, double* %228
br label %229
229: ; preds = %109
%230 = load i32, i32* %14
%231 = add nsw i32 %230, 1
store i32 %231, i32* %14
br label %39
232: ; preds = %39
%233 = load i32, i32* %8
%234 = sitofp i32 %233 to double
%235 = load double, double* %9
%236 = fmul double %234, %235
%237 = load double*, double** %6
%238 = load i32, i32* %13
%239 = load i32, i32* %13
%240 = mul nsw i32 %238, %239
%241 = sub nsw i32 %240, 1
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds double, double* %237, i64 %242
store double %236, double* %243
store i32 0, i32* %15
br label %244
244: ; preds = %266, %232
%245 = load i32, i32* %15
%246 = load i32, i32* %13
%247 = load i32, i32* %13
%248 = mul nsw i32 %246, %247
%249 = icmp slt i32 %245, %248
br i1 %249, label %250, label %269
250: ; preds = %244
%251 = load double*, double** %6
%252 = load i32, i32* %15
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds double, double* %251, i64 %253
%255 = load double, double* %254
%256 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), double %255)
%257 = load i32, i32* %15
%258 = load i32, i32* %13
%259 = srem i32 %257, %258
%260 = load i32, i32* %13
%261 = sub nsw i32 %260, 1
%262 = icmp eq i32 %259, %261
br i1 %262, label %263, label %265
263: ; preds = %250
%264 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %265
265: ; preds = %263, %250
br label %266
266: ; preds = %265
%267 = load i32, i32* %15
%268 = add nsw i32 %267, 1
store i32 %268, i32* %15
br label %244
269: ; preds = %244
%270 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"L: %i\0A\00"
@.str.1 = [7 x i8] c"n: %i\0A\00"
@.str.2 = [7 x i8] c"d: %i\0A\00"
@.str.3 = [7 x i8] c"N: %i\0A\00"
@.str.4 = [8 x i8] c"dt: %f\0A\00"
@.str.5 = [35 x i8] c"%5.3f(%i, %i), %5.6f %5.6f %5.6f \0A\00"
@.str.6 = [8 x i8] c" %10.3f\00"
define void @fe_SigmaB2_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 = add i32 %8, -1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %2)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %3)
%15 = icmp sgt i32 %2, 0
br i1 %15, label %16, label %100
16: ; preds = %5
%17 = sitofp i32 %7 to double
%18 = add nsw i32 %7, -1
%19 = mul nsw i32 %9, %8
%20 = zext i32 %2 to i64
br label %21
21: ; preds = %16, %54
%22 = phi i64 [ 0, %16 ], [ %98, %54 ]
%23 = getelementptr inbounds double, double* %1, i64 %22
%24 = load double, double* %23
%25 = fmul double %24, %17
%26 = tail call i64 @ceil(double %25)
%27 = trunc i64 %26 to i32
%28 = tail call i32 @mini(i32 %27, i32 %7)
%29 = tail call i32 @maxi(i32 %28, i32 1)
%30 = fadd double %25, -5.000000e-01
%31 = tail call i64 @ceil(double %30)
%32 = trunc i64 %31 to i32
%33 = tail call i32 @mini(i32 %32, i32 %18)
%34 = tail call i32 @maxi(i32 %33, i32 1)
%35 = sitofp i32 %29 to double
%36 = fsub double %25, %35
%37 = fadd double %36, 1.000000e+00
%38 = tail call double @hat(double %37)
%39 = tail call double @sq(double %38)
%40 = fmul double %39, %3
%41 = sitofp i32 %34 to double
%42 = fsub double %25, %41
%43 = fadd double %42, 5.000000e-01
%44 = tail call double @hat(double %43)
%45 = tail call double @sq(double %44)
%46 = fmul double %45, %3
%47 = tail call double @hat(double %37)
%48 = tail call double @hat(double %43)
%49 = fmul double %47, %48
%50 = fmul double %49, %3
%51 = icmp ult i64 %22, 10
br i1 %51, label %52, label %54
52: ; preds = %21
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), double %25, i32 %29, i32 %34, double %40, double %46, double %50)
br label %54
54: ; preds = %52, %21
%55 = shl nsw i32 %29, 1
%56 = add i32 %55, -2
%57 = mul nsw i32 %56, %8
%58 = add i32 %56, %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %0, i64 %59
%61 = load double, double* %60
%62 = fadd double %40, %61
store double %62, double* %60
%63 = shl nsw i32 %34, 1
%64 = add i32 %63, -1
%65 = mul nsw i32 %64, %8
%66 = add i32 %64, %65
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %0, i64 %67
%69 = load double, double* %68
%70 = fadd double %46, %69
store double %70, double* %68
%71 = add i32 %56, %65
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %0, i64 %72
%74 = load double, double* %73
%75 = fadd double %50, %74
store double %75, double* %73
%76 = add i32 %64, %57
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %0, i64 %77
store double %75, double* %78
%79 = tail call double @hat(double %43)
%80 = mul i32 %63, %8
%81 = add nsw i32 %80, -1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %0, i64 %82
%84 = load double, double* %83
%85 = tail call double @llvm.fmuladd.f64(double %79, double %3, double %84)
store double %85, double* %83
%86 = add i32 %64, %19
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %0, i64 %87
store double %85, double* %88
%89 = tail call double @hat(double %37)
%90 = add i32 %9, %57
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %0, i64 %91
%93 = load double, double* %92
%94 = tail call double @llvm.fmuladd.f64(double %89, double %3, double %93)
store double %94, double* %92
%95 = add i32 %56, %19
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %0, i64 %96
store double %94, double* %97
%98 = add nuw nsw i64 %22, 1
%99 = icmp eq i64 %98, %20
br i1 %99, label %100, label %21
100: ; preds = %54, %5
%101 = sitofp i32 %2 to double
%102 = fmul double %101, %3
%103 = mul nsw i32 %8, %8
%104 = add nsw i32 %103, -1
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %0, i64 %105
store double %102, double* %106
%107 = icmp eq i32 %103, 0
br i1 %107, label %123, label %108
108: ; preds = %100
%109 = zext i32 %103 to i64
br label %110
110: ; preds = %108, %120
%111 = phi i64 [ 0, %108 ], [ %121, %120 ]
%112 = getelementptr inbounds double, double* %0, i64 %111
%113 = load double, double* %112
%114 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), double %113)
%115 = trunc i64 %111 to i32
%116 = srem i32 %115, %8
%117 = icmp eq i32 %116, %9
br i1 %117, label %118, label %120
118: ; preds = %110
%119 = tail call i32 @putchar(i32 10)
br label %120
120: ; preds = %110, %118
%121 = add nuw nsw i64 %111, 1
%122 = icmp eq i64 %121, %109
br i1 %122, label %123, label %110
123: ; preds = %120, %100
%124 = tail call i32 @putchar(i32 10)
ret void
}