#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 hat(double);
void fe_mu(double *mu, double *y, int N, int L) {
  int n = 1 << (L - 1);
  int t;
  int i;
  for (i = 1; i < n - 1; i++) {
    mu[2 * i - 2] = mu[2 * i - 1] = 0.;
    for (t = 0; t < N - 1; t++) {
      mu[2 * i - 2] += hat(y[t] * n - i + 1) * (y[t + 1] - y[t]);
      mu[2 * i - 1] += hat(y[t] * n - i + .5) * (y[t + 1] - y[t]);
    }
  }
  mu[2 * n - 2] = 0.;
  for (t = 0; t < N - 1; t++)
    mu[2 * n - 2] += hat(y[t] * n - n + 1) * (y[t + 1] - y[t]);
}


x86 assembly (clang, -O0):
<fe_mu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12c7 <fe_mu+0x1b7>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12b4 <fe_mu+0x1a4>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm2
cvtsi2sdl -0x24(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe2c(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <hat@plt>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm2
cvtsi2sdl -0x24(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xdac(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <hat@plt>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1185 <fe_mu+0x75>
jmp    12b9 <fe_mu+0x1a9>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113d <fe_mu+0x2d>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    138d <fe_mu+0x27d>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm2
cvtsi2sdl -0x1c(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xccb(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <hat@plt>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12e6 <fe_mu+0x1d6>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fe_mu>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
add    $0xff,%cl
mov    $0x1,%eax
shl    %cl,%eax
mov    %rsi,%rbx
mov    %rdi,%r14
cvtsi2sd %eax,%xmm1
cmp    $0x2,%eax
movapd %xmm1,0x20(%rsp)
jle    1263 <fe_mu+0x153>
mov    %rax,0x30(%rsp)
add    $0xffffffff,%eax
mov    %rax,0x38(%rsp)
lea    -0x1(%rdx),%r13d
mov    $0x1,%eax
movsd  0xec1(%rip),%xmm2
mov    %rdx,0x40(%rsp)
jmp    1189 <fe_mu+0x79>
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%rsp),%rax
add    $0x1,%rax
cmp    0x38(%rsp),%rax
mov    0x40(%rsp),%rdx
je     1269 <fe_mu+0x159>
mov    %rax,0x8(%rsp)
shl    $0x4,%rax
xorpd  %xmm0,%xmm0
movupd %xmm0,-0x10(%rax,%r14,1)
cmp    $0x2,%edx
jl     1170 <fe_mu+0x60>
mov    0x8(%rsp),%rax
lea    (%rax,%rax,1),%r15
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorpd  0xe46(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rbx,%rbp,8),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x10(%rsp),%xmm0
addsd  %xmm2,%xmm0
call   1030 <hat@plt>
lea    0x1(%rbp),%r12
movsd  0x8(%rbx,%rbp,8),%xmm1
subsd  (%rbx,%rbp,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  -0x10(%r14,%r15,8),%xmm1
movsd  %xmm1,-0x10(%r14,%r15,8)
movsd  (%rbx,%rbp,8),%xmm0
mulsd  0x20(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
addsd  0xe06(%rip),%xmm0
call   1030 <hat@plt>
movsd  0xdf1(%rip),%xmm2
movsd  0x8(%rbx,%rbp,8),%xmm1
subsd  (%rbx,%rbp,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  -0x8(%r14,%r15,8),%xmm1
movsd  %xmm1,-0x8(%r14,%r15,8)
movapd 0x20(%rsp),%xmm1
mov    %r12,%rbp
cmp    %r12,%r13
jne    11d0 <fe_mu+0xc0>
jmp    1170 <fe_mu+0x60>
lea    -0x1(%rdx),%r13d
jmp    126e <fe_mu+0x15e>
mov    0x30(%rsp),%rax
add    %eax,%eax
movslq %eax,%r12
movq   $0x0,-0x10(%r14,%r12,8)
cmp    $0x2,%edx
jl     12e9 <fe_mu+0x1d9>
add    $0xfffffffffffffffe,%r12
movapd 0xd73(%rip),%xmm0
xorpd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
mov    %r13d,%r15d
xor    %ebp,%ebp
nopl   0x0(%rax)
movsd  (%rbx,%rbp,8),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x10(%rsp),%xmm0
addsd  0xd69(%rip),%xmm0
call   1030 <hat@plt>
movsd  0x8(%rbx,%rbp,8),%xmm1
subsd  (%rbx,%rbp,8),%xmm1
lea    0x1(%rbp),%rax
mulsd  %xmm0,%xmm1
addsd  (%r14,%r12,8),%xmm1
movsd  %xmm1,(%r14,%r12,8)
movapd 0x20(%rsp),%xmm1
mov    %rax,%rbp
cmp    %rax,%r15
jne    12a0 <fe_mu+0x190>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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