#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*/ glbGetBGCenters(int, int, double *, double *);
double *glbGetBGFitRatePtr(int, int);
double *glbGetBinCentersListPtr(int);
int /*<<< orphan*/ glbGetEminEmax(int, double *, double *);
int /*<<< orphan*/ glbGetEnergyWindowBins(int, int, int *, int *);
int glbGetNumberOfBins(int);
double *glbGetRuleRatePtr(int, int);
double *glbGetSignalFitRatePtr(int, int);
scalar_t__ glb_likelihood(double, double);
scalar_t__ glb_prior(double, double, double);
double glbChiSpectrumTilt(int exp, int rule, int n_params, double *x,
                          double *errors, void *user_data) {
  int n_bins = glbGetNumberOfBins(exp);
  double *true_rates = glbGetRuleRatePtr(exp, rule);
  double *signal_fit_rates = glbGetSignalFitRatePtr(exp, rule);
  double *bg_fit_rates = glbGetBGFitRatePtr(exp, rule);
  double *bin_centers = glbGetBinCentersListPtr(exp);
  double signal_norm, signal_tilt;
  double bg_norm_center, bg_tilt_center;
  double bg_norm, bg_tilt;
  int ew_low, ew_high;
  double emin, emax, ecenter;
  double fit_rate, true_rate;
  double chi2 = 0.0;
  int i;
  glbGetEminEmax(exp, &emin, &emax);
  ecenter = 0.5 * (emax + emin);
  glbGetEnergyWindowBins(exp, rule, &ew_low, &ew_high);
  glbGetBGCenters(exp, rule, &bg_norm_center, &bg_tilt_center);
  signal_norm = 1.0 + x[0];
  signal_tilt = x[1] / (emax - emin);
  bg_norm = bg_norm_center * (1.0 + x[2]);
  bg_tilt = x[3] / (emax - emin);
  for (i = ew_low; i <= ew_high; i++) {
    fit_rate = signal_norm * signal_fit_rates[i] +
               signal_tilt * (bin_centers[i] - ecenter) * signal_fit_rates[i] +
               bg_norm * bg_fit_rates[i] +
               bg_tilt * (bin_centers[i] - ecenter) * bg_fit_rates[i];
    chi2 += glb_likelihood(true_rates[i], fit_rate);
  }
  chi2 += glb_prior(x[0], 0.0, errors[0]) + glb_prior(x[1], 0.0, errors[1]) +
          glb_prior(bg_norm, bg_norm_center, errors[2]) +
          glb_prior(bg_tilt, bg_tilt_center, errors[3]);
  return chi2;
}


x86 assembly (clang, -O0):
<glbChiSpectrumTilt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <glbGetNumberOfBins@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <glbGetRuleRatePtr@plt>
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1070 <glbGetSignalFitRatePtr@plt>
mov    %rax,-0x40(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   10b0 <glbGetBGFitRatePtr@plt>
mov    %rax,-0x48(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <glbGetBinCentersListPtr@plt>
mov    %rax,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x4(%rbp),%edi
lea    -0x90(%rbp),%rsi
lea    -0x98(%rbp),%rdx
call   1080 <glbGetEminEmax@plt>
movsd  -0x98(%rbp),%xmm1
ff
addsd  -0x90(%rbp),%xmm1
ff
movsd  0xdcb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x84(%rbp),%rdx
lea    -0x88(%rbp),%rcx
call   1050 <glbGetEnergyWindowBins@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x68(%rbp),%rdx
lea    -0x70(%rbp),%rcx
call   10c0 <glbGetBGCenters@plt>
mov    -0x18(%rbp),%rax
movsd  0xd7f(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x98(%rbp),%xmm1
ff
subsd  -0x90(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0xd43(%rip),%xmm1
addsd  0x10(%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x98(%rbp),%xmm1
ff
subsd  -0x90(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
cmp    -0x88(%rbp),%eax
jg     13fd <glbChiSpectrumTilt+0x25d>
movsd  -0x58(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x60(%rbp),%xmm1
mov    -0x50(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
subsd  -0xa0(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm1
mov    -0x40(%rbp),%rax
movslq -0xbc(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x78(%rbp),%xmm1
mov    -0x48(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
subsd  -0xa0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
mov    -0x48(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x38(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
call   1090 <glb_likelihood@plt>
cvtsi2sd %rax,%xmm0
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    12f9 <glbChiSpectrumTilt+0x159>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm2
xorps  %xmm1,%xmm1
call   10a0 <glb_prior@plt>
mov    %rax,-0xd8(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm2
xorps  %xmm1,%xmm1
call   10a0 <glb_prior@plt>
mov    %rax,%rcx
mov    -0xd8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xd0(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm2
call   10a0 <glb_prior@plt>
mov    %rax,%rcx
mov    -0xd0(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm2
call   10a0 <glb_prior@plt>
mov    %rax,%rcx
mov    -0xc8(%rbp),%rax
add    %rcx,%rax
cvtsi2sd %rax,%xmm0
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glbChiSpectrumTilt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r8,0x58(%rsp)
mov    %rcx,0x50(%rsp)
mov    %esi,%ebx
mov    %edi,%r15d
call   1040 <glbGetNumberOfBins@plt>
mov    %r15d,%edi
mov    %ebx,%esi
call   1060 <glbGetRuleRatePtr@plt>
mov    %rax,%r12
mov    %r15d,%edi
mov    %ebx,%esi
call   1070 <glbGetSignalFitRatePtr@plt>
mov    %rax,%r13
mov    %r15d,%edi
mov    %ebx,%esi
call   10b0 <glbGetBGFitRatePtr@plt>
mov    %rax,%r14
mov    %r15d,%edi
call   1030 <glbGetBinCentersListPtr@plt>
mov    %rax,%rbp
lea    0x40(%rsp),%rsi
lea    0x38(%rsp),%rdx
mov    %r15d,%edi
call   1080 <glbGetEminEmax@plt>
movsd  0x38(%rsp),%xmm0
addsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0x24(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %r15d,%edi
mov    %ebx,%esi
call   1050 <glbGetEnergyWindowBins@plt>
lea    0x48(%rsp),%rdx
lea    0x70(%rsp),%rcx
mov    %r15d,%edi
mov    0x50(%rsp),%r15
mov    %ebx,%esi
call   10c0 <glbGetBGCenters@plt>
movsd  (%r15),%xmm3
movsd  0xdb6(%rip),%xmm1
movsd  0x38(%rsp),%xmm0
subsd  0x40(%rsp),%xmm0
movsd  0x10(%r15),%xmm2
addsd  %xmm1,%xmm2
mulsd  0x48(%rsp),%xmm2
movsd  %xmm2,0x28(%rsp)
movsd  0x18(%r15),%xmm4
divsd  %xmm0,%xmm4
movslq 0x24(%rsp),%rbx
cmp    0xc(%rsp),%ebx
movsd  %xmm4,0x30(%rsp)
jle    129e <glbChiSpectrumTilt+0xfe>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
jmp    1377 <glbChiSpectrumTilt+0x1d7>
movsd  0x18(%rsp),%xmm2
mulsd  0xd54(%rip),%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0x8(%r15),%xmm2
addsd  %xmm1,%xmm3
divsd  %xmm0,%xmm2
movsd  %xmm2,0x60(%rsp)
add    $0xffffffffffffffff,%rbx
xorpd  %xmm1,%xmm1
movsd  %xmm3,0x68(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm1,0x10(%rsp)
movsd  0x8(%r13,%rbx,8),%xmm0
movsd  0x8(%rbp,%rbx,8),%xmm1
subsd  0x18(%rsp),%xmm1
movsd  0x60(%rsp),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  0x8(%r14,%rbx,8),%xmm2
movsd  0x28(%rsp),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm4,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  0x8(%r12,%rbx,8),%xmm0
call   1090 <glb_likelihood@plt>
movsd  0x68(%rsp),%xmm3
movsd  0x10(%rsp),%xmm1
movsd  0x30(%rsp),%xmm4
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  %xmm0,%xmm1
movslq 0xc(%rsp),%rax
add    $0x1,%rbx
cmp    %rax,%rbx
jl     12e0 <glbChiSpectrumTilt+0x140>
movsd  %xmm1,0x10(%rsp)
movsd  (%r15),%xmm3
mov    0x58(%rsp),%r14
movsd  (%r14),%xmm2
xorpd  %xmm1,%xmm1
movapd %xmm3,%xmm0
call   10a0 <glb_prior@plt>
mov    %rax,%rbx
movsd  0x8(%r15),%xmm0
movsd  0x8(%r14),%xmm2
xorpd  %xmm1,%xmm1
call   10a0 <glb_prior@plt>
mov    %rax,%rbp
add    %rbx,%rbp
movsd  0x48(%rsp),%xmm1
movsd  0x10(%r14),%xmm2
movsd  0x28(%rsp),%xmm0
call   10a0 <glb_prior@plt>
mov    %rax,%rbx
add    %rbp,%rbx
movsd  0x70(%rsp),%xmm1
movsd  0x18(%r14),%xmm2
movsd  0x30(%rsp),%xmm0
call   10a0 <glb_prior@plt>
add    %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define double @glbChiSpectrumTilt(i32 %0, i32 %1, i32 %2, double* nocapture %3, double* nocapture %4, i8* nocapture readnone %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = tail call i32 @glbGetNumberOfBins(i32 %0)
%14 = tail call double* @glbGetRuleRatePtr(i32 %0, i32 %1)
%15 = tail call double* @glbGetSignalFitRatePtr(i32 %0, i32 %1)
%16 = tail call double* @glbGetBGFitRatePtr(i32 %0, i32 %1)
%17 = tail call double* @glbGetBinCentersListPtr(i32 %0)
%18 = bitcast double* %7 to i8*
%19 = bitcast double* %8 to i8*
%20 = bitcast i32* %9 to i8*
%21 = bitcast i32* %10 to i8*
%22 = bitcast double* %11 to i8*
%23 = bitcast double* %12 to i8*
%24 = call i32 @glbGetEminEmax(i32 %0, double* %11, double* %12)
%25 = load double, double* %12
%26 = load double, double* %11
%27 = fadd double %25, %26
%28 = fmul double %27, 5.000000e-01
%29 = call i32 @glbGetEnergyWindowBins(i32 %0, i32 %1, i32* %9, i32* %10)
%30 = call i32 @glbGetBGCenters(i32 %0, i32 %1, double* %7, double* %8)
%31 = load double, double* %3
%32 = fadd double %31, 1.000000e+00
%33 = getelementptr inbounds double, double* %3, i64 1
%34 = load double, double* %33
%35 = load double, double* %12
%36 = load double, double* %11
%37 = fsub double %35, %36
%38 = fdiv double %34, %37
%39 = load double, double* %7
%40 = getelementptr inbounds double, double* %3, i64 2
%41 = load double, double* %40
%42 = fadd double %41, 1.000000e+00
%43 = fmul double %39, %42
%44 = getelementptr inbounds double, double* %3, i64 3
%45 = load double, double* %44
%46 = fdiv double %45, %37
%47 = load i32, i32* %9
%48 = load i32, i32* %10
%49 = icmp sgt i32 %47, %48
br i1 %49, label %79, label %50
50: ; preds = %6
%51 = sext i32 %47 to i64
br label %52
52: ; preds = %50, %52
%53 = phi i64 [ %51, %50 ], [ %73, %52 ]
%54 = phi double [ 0.000000e+00, %50 ], [ %72, %52 ]
%55 = getelementptr inbounds double, double* %15, i64 %53
%56 = load double, double* %55
%57 = getelementptr inbounds double, double* %17, i64 %53
%58 = load double, double* %57
%59 = fsub double %58, %28
%60 = fmul double %38, %59
%61 = fmul double %56, %60
%62 = call double @llvm.fmuladd.f64(double %32, double %56, double %61)
%63 = getelementptr inbounds double, double* %16, i64 %53
%64 = load double, double* %63
%65 = call double @llvm.fmuladd.f64(double %43, double %64, double %62)
%66 = fmul double %46, %59
%67 = call double @llvm.fmuladd.f64(double %66, double %64, double %65)
%68 = getelementptr inbounds double, double* %14, i64 %53
%69 = load double, double* %68
%70 = call i64 @glb_likelihood(double %69, double %67)
%71 = sitofp i64 %70 to double
%72 = fadd double %54, %71
%73 = add nsw i64 %53, 1
%74 = load i32, i32* %10
%75 = sext i32 %74 to i64
%76 = icmp slt i64 %53, %75
br i1 %76, label %52, label %77
77: ; preds = %52
%78 = load double, double* %3
br label %79
79: ; preds = %77, %6
%80 = phi double [ %31, %6 ], [ %78, %77 ]
%81 = phi double [ 0.000000e+00, %6 ], [ %72, %77 ]
%82 = load double, double* %4
%83 = call i64 @glb_prior(double %80, double 0.000000e+00, double %82)
%84 = load double, double* %33
%85 = getelementptr inbounds double, double* %4, i64 1
%86 = load double, double* %85
%87 = call i64 @glb_prior(double %84, double 0.000000e+00, double %86)
%88 = add nsw i64 %87, %83
%89 = load double, double* %7
%90 = getelementptr inbounds double, double* %4, i64 2
%91 = load double, double* %90
%92 = call i64 @glb_prior(double %43, double %89, double %91)
%93 = add nsw i64 %88, %92
%94 = load double, double* %8
%95 = getelementptr inbounds double, double* %4, i64 3
%96 = load double, double* %95
%97 = call i64 @glb_prior(double %46, double %94, double %96)
%98 = add nsw i64 %93, %97
%99 = sitofp i64 %98 to double
%100 = fadd double %81, %99
ret double %100
}