#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 INFINITY;
double exp(double);
double const fabs(double);
int /*<<< orphan*/ free(double *);
double const log(double const);
double *malloc(int const);
double weighted_mean(double *, double const *, int const);
double ln_evaluate_lcv(const double *data, const double *weight, const int n,
                       const double bandwidth, const double threshold) {
  if (bandwidth <= 0) {
    return INFINITY;
  }
  double total_weight = 0;
  double *log_data = malloc(n * sizeof(double));
  double *result = malloc(n * sizeof(double));
  for (int i = 0; i < n; i++) {
    log_data[i] = log(data[i]) / bandwidth;
    total_weight += weight[i];
    result[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      double exponent = log_data[i] - log_data[j];
      if (fabs(exponent) < threshold || threshold <= 0) {
        exponent = exp(-0.5 * exponent * exponent);
        result[i] += weight[j] * exponent / data[i];
        result[j] += weight[i] * exponent / data[j];
      }
    }
  }
  for (int i = 0; i < n; i++) {
    result[i] =
        log(result[i] / (2.506628275 * bandwidth * (total_weight - weight[i])));
  }
  double lcv = -weighted_mean(result, weight, n);
  free(result);
  free(log_data);
  return lcv;
}


x86 assembly (clang, -O0):
<ln_evaluate_lcv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     11a0 <ln_evaluate_lcv+0x40>
mov    0x2e56(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13fe <ln_evaluate_lcv+0x29e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    123a <ln_evaluate_lcv+0xda>
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1080 <log@plt>
divsd  -0x28(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11d5 <ln_evaluate_lcv+0x75>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    134f <ln_evaluate_lcv+0x1ef>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    133c <ln_evaluate_lcv+0x1dc>
mov    -0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x54(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1050 <fabs@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     12ab <ln_evaluate_lcv+0x14b>
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     1329 <ln_evaluate_lcv+0x1c9>
movsd  0xd55(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x50(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x50(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x54(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    132e <ln_evaluate_lcv+0x1ce>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1256 <ln_evaluate_lcv+0xf6>
jmp    1341 <ln_evaluate_lcv+0x1e1>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1241 <ln_evaluate_lcv+0xe1>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13b6 <ln_evaluate_lcv+0x256>
mov    -0x48(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xc89(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1080 <log@plt>
mov    -0x48(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1356 <ln_evaluate_lcv+0x1f6>
mov    -0x48(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <weighted_mean@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_evaluate_lcv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jae    130f <ln_evaluate_lcv+0x1bf>
mov    %edx,%r14d
mov    %rsi,%r12
mov    %rdi,%r13
movsd  %xmm1,0x28(%rsp)
lea    0x0(,%r14,8),%ebx
mov    %ebx,%edi
movsd  %xmm0,(%rsp)
call   1050 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %ebx,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %r14d,%r14d
jle    1381 <ln_evaluate_lcv+0x231>
mov    %r14,0x20(%rsp)
mov    %r14d,%ecx
xorpd  %xmm2,%xmm2
xor    %ebp,%ebp
mov    0x8(%rsp),%r15
nopw   0x0(%rax,%rax,1)
movsd  %xmm2,0x10(%rsp)
movsd  0x0(%r13,%rbp,8),%xmm0
mov    %rcx,%r14
call   1070 <log@plt>
mov    %r14,%rcx
movsd  0x10(%rsp),%xmm2
divsd  (%rsp),%xmm0
movsd  %xmm0,(%r15,%rbp,8)
addsd  (%r12,%rbp,8),%xmm2
movq   $0x0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r14
jne    11c0 <ln_evaluate_lcv+0x70>
mov    0x20(%rsp),%r14
test   %r14d,%r14d
jle    1381 <ln_evaluate_lcv+0x231>
lea    -0x1(%rcx),%r14
xor    %r15d,%r15d
xorpd  %xmm4,%xmm4
mov    0x8(%rsp),%rax
movsd  0x28(%rsp),%xmm3
mov    %rcx,0x30(%rsp)
jmp    1243 <ln_evaluate_lcv+0xf3>
nopl   0x0(%rax,%rax,1)
mov    0x30(%rsp),%rcx
mov    0x38(%rsp),%r15
cmp    %rcx,%r15
je     131f <ln_evaluate_lcv+0x1cf>
lea    0x1(%r15),%rdx
mov    %rdx,0x38(%rsp)
cmp    %rcx,%rdx
jae    1230 <ln_evaluate_lcv+0xe0>
movsd  (%rax,%r15,8),%xmm5
mov    %r15,%rbp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm5,0x40(%rsp)
jmp    12e4 <ln_evaluate_lcv+0x194>
nopl   0x0(%rax,%rax,1)
movapd %xmm1,%xmm0
mulsd  0xda4(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1060 <exp@plt>
movsd  0x40(%rsp),%xmm5
xorpd  %xmm4,%xmm4
movsd  0x28(%rsp),%xmm3
movsd  0x10(%rsp),%xmm2
mov    0x8(%rsp),%rax
movsd  0x8(%r12,%rbp,8),%xmm1
mulsd  %xmm0,%xmm1
divsd  0x0(%r13,%r15,8),%xmm1
addsd  (%rbx,%r15,8),%xmm1
movsd  %xmm1,(%rbx,%r15,8)
mulsd  (%r12,%r15,8),%xmm0
divsd  0x8(%r13,%rbp,8),%xmm0
addsd  0x8(%rbx,%rbp,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r14
je     1230 <ln_evaluate_lcv+0xe0>
ucomisd %xmm3,%xmm4
movapd %xmm5,%xmm1
subsd  0x8(%rax,%rbp,8),%xmm1
jae    1270 <ln_evaluate_lcv+0x120>
movapd %xmm1,%xmm0
andpd  0xcfc(%rip),%xmm0
ucomisd %xmm0,%xmm3
jbe    12d7 <ln_evaluate_lcv+0x187>
jmp    1270 <ln_evaluate_lcv+0x120>
mov    0x2cd2(%rip),%rax
movsd  (%rax),%xmm0
jmp    13b4 <ln_evaluate_lcv+0x264>
mov    0x20(%rsp),%r14
test   %r14d,%r14d
jle    1381 <ln_evaluate_lcv+0x231>
mov    %rcx,%r15
movsd  (%rsp),%xmm0
mulsd  0xcef(%rip),%xmm0
movsd  %xmm0,(%rsp)
xor    %ebp,%ebp
movsd  %xmm2,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
movsd  (%rbx,%rbp,8),%xmm0
movapd %xmm2,%xmm1
subsd  (%r12,%rbp,8),%xmm1
mulsd  (%rsp),%xmm1
divsd  %xmm1,%xmm0
call   1070 <log@plt>
movsd  0x10(%rsp),%xmm2
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1350 <ln_evaluate_lcv+0x200>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1040 <weighted_mean@plt>
xorpd  0xc79(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
movaps 0x10(%rsp),%xmm0
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@INFINITY = global double 0.000000e+00
define double @ln_evaluate_lcv(double* nocapture %0, double* %1, i32 %2, double %3, double %4) {
%6 = fcmp ugt double %3, 0.000000e+00
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = load double, double* @INFINITY
br label %100
9: ; preds = %5
%10 = shl i32 %2, 3
%11 = tail call double* @malloc(i32 %10)
%12 = tail call double* @malloc(i32 %10)
%13 = icmp sgt i32 %2, 0
br i1 %13, label %14, label %83
14: ; preds = %9
%15 = zext i32 %2 to i64
br label %21
16: ; preds = %21
br i1 %13, label %17, label %83
17: ; preds = %16
%18 = fcmp ole double %4, 0.000000e+00
%19 = zext i32 %2 to i64
%20 = zext i32 %2 to i64
br label %42
21: ; preds = %14, %21
%22 = phi i64 [ 0, %14 ], [ %33, %21 ]
%23 = phi double [ 0.000000e+00, %14 ], [ %31, %21 ]
%24 = getelementptr inbounds double, double* %0, i64 %22
%25 = load double, double* %24
%26 = tail call double @log(double %25)
%27 = fdiv double %26, %3
%28 = getelementptr inbounds double, double* %11, i64 %22
store double %27, double* %28
%29 = getelementptr inbounds double, double* %1, i64 %22
%30 = load double, double* %29
%31 = fadd double %23, %30
%32 = getelementptr inbounds double, double* %12, i64 %22
store double 0.000000e+00, double* %32
%33 = add nuw nsw i64 %22, 1
%34 = icmp eq i64 %33, %15
br i1 %34, label %16, label %21
35: ; preds = %80, %42
%36 = add nuw nsw i64 %44, 1
%37 = icmp eq i64 %45, %20
br i1 %37, label %38, label %42
38: ; preds = %35
br i1 %13, label %39, label %83
39: ; preds = %38
%40 = fmul double %3, 0x40040D932002D4C7
%41 = zext i32 %2 to i64
br label %88
42: ; preds = %17, %35
%43 = phi i64 [ 0, %17 ], [ %45, %35 ]
%44 = phi i64 [ 1, %17 ], [ %36, %35 ]
%45 = add nuw nsw i64 %43, 1
%46 = icmp ult i64 %45, %19
br i1 %46, label %47, label %35
47: ; preds = %42
%48 = getelementptr inbounds double, double* %11, i64 %43
%49 = load double, double* %48
%50 = getelementptr inbounds double, double* %0, i64 %43
%51 = getelementptr inbounds double, double* %12, i64 %43
%52 = getelementptr inbounds double, double* %1, i64 %43
br label %53
53: ; preds = %47, %80
%54 = phi i64 [ %44, %47 ], [ %81, %80 ]
%55 = getelementptr inbounds double, double* %11, i64 %54
%56 = load double, double* %55
%57 = fsub double %49, %56
%58 = tail call double @llvm.fabs.f64(double %57)
%59 = fcmp olt double %58, %4
%60 = or i1 %18, %59
br i1 %60, label %61, label %80
61: ; preds = %53
%62 = fmul double %57, -5.000000e-01
%63 = fmul double %57, %62
%64 = tail call double @exp(double %63)
%65 = getelementptr inbounds double, double* %1, i64 %54
%66 = load double, double* %65
%67 = fmul double %64, %66
%68 = load double, double* %50
%69 = fdiv double %67, %68
%70 = load double, double* %51
%71 = fadd double %70, %69
store double %71, double* %51
%72 = load double, double* %52
%73 = fmul double %64, %72
%74 = getelementptr inbounds double, double* %0, i64 %54
%75 = load double, double* %74
%76 = fdiv double %73, %75
%77 = getelementptr inbounds double, double* %12, i64 %54
%78 = load double, double* %77
%79 = fadd double %78, %76
store double %79, double* %77
br label %80
80: ; preds = %53, %61
%81 = add nuw nsw i64 %54, 1
%82 = icmp eq i64 %81, %20
br i1 %82, label %35, label %53
83: ; preds = %88, %9, %16, %38
%84 = tail call double @weighted_mean(double* %12, double* %1, i32 %2)
%85 = fneg double %84
%86 = tail call i32 @free(double* %12)
%87 = tail call i32 @free(double* %11)
br label %100
88: ; preds = %39, %88
%89 = phi i64 [ 0, %39 ], [ %98, %88 ]
%90 = getelementptr inbounds double, double* %12, i64 %89
%91 = load double, double* %90
%92 = getelementptr inbounds double, double* %1, i64 %89
%93 = load double, double* %92
%94 = fsub double %31, %93
%95 = fmul double %40, %94
%96 = fdiv double %91, %95
%97 = tail call double @log(double %96)
store double %97, double* %90
%98 = add nuw nsw i64 %89, 1
%99 = icmp eq i64 %98, %41
br i1 %99, label %83, label %88
100: ; preds = %83, %7
%101 = phi double [ %8, %7 ], [ %85, %83 ]
ret double %101
}