#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 *);
int /*<<< orphan*/ glbGetBGFitRatePtr(int, int);
int /*<<< orphan*/ glbGetEminEmax(int, double *, double *);
int /*<<< orphan*/ glbGetEnergyWindowBins(int, int, int *, int *);
int glbGetNumberOfBins(int);
double *glbGetRuleRatePtr(int, int);
int /*<<< orphan*/ glbGetSignalFitRatePtr(int, int);
int /*<<< orphan*/ glbShiftEnergyScale(double, int /*<<< orphan*/, double *,
                                       int, double, double);
scalar_t__ glb_likelihood(double, double);
scalar_t__ glb_prior(double, double, double);
double glbChiSpectrumCalib(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[n_bins];
  double bg_fit_rates[n_bins];
  double signal_norm;
  double bg_norm_center, bg_tilt_center;
  double bg_norm, bg_tilt;
  int ew_low, ew_high;
  double emin, emax;
  double fit_rate, true_rate;
  double chi2 = 0.0;
  int i;
  glbGetEminEmax(exp, &emin, &emax);
  glbGetEnergyWindowBins(exp, rule, &ew_low, &ew_high);
  glbGetBGCenters(exp, rule, &bg_norm_center, &bg_tilt_center);
  signal_norm = 1.0 + x[0];
  bg_norm = bg_norm_center * (1.0 + x[2]);
  bg_tilt = bg_tilt_center + x[3];
  glbShiftEnergyScale(x[1], glbGetSignalFitRatePtr(exp, rule), signal_fit_rates,
                      n_bins, emin, emax);
  glbShiftEnergyScale(bg_tilt, glbGetBGFitRatePtr(exp, rule), bg_fit_rates,
                      n_bins, emin, emax);
  for (i = ew_low; i <= ew_high; i++) {
    fit_rate = signal_norm * signal_fit_rates[i] + bg_norm * 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):
<glbChiSpectrumCalib>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%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   1030 <glbGetNumberOfBins@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <glbGetRuleRatePtr@plt>
mov    %rax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xc8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xb8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x4(%rbp),%edi
lea    -0x88(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1070 <glbGetEminEmax@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x7c(%rbp),%rdx
lea    -0x80(%rbp),%rcx
call   1040 <glbGetEnergyWindowBins@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x60(%rbp),%rdx
lea    -0x68(%rbp),%rcx
call   10c0 <glbGetBGCenters@plt>
mov    -0x18(%rbp),%rax
movsd  0xd86(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0xd6c(%rip),%xmm1
addsd  0x10(%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x18(%rbp),%rax
addsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <glbGetSignalFitRatePtr@plt>
movsd  -0xd0(%rbp),%xmm0
ff
mov    -0xc8(%rbp),%rsi
mov    %eax,%edi
mov    -0x2c(%rbp),%edx
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
call   1090 <glbShiftEnergyScale@plt>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   10b0 <glbGetBGFitRatePtr@plt>
movsd  -0xc0(%rbp),%xmm0
ff
mov    -0xb8(%rbp),%rsi
mov    %eax,%edi
mov    -0x2c(%rbp),%edx
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
call   1090 <glbShiftEnergyScale@plt>
mov    -0x7c(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0xac(%rbp),%eax
cmp    -0x80(%rbp),%eax
jg     13d9 <glbChiSpectrumCalib+0x239>
mov    -0xb8(%rbp),%rax
mov    -0xc8(%rbp),%rcx
movsd  -0x58(%rbp),%xmm0
movslq -0xac(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm2
movsd  -0x70(%rbp),%xmm1
movslq -0xac(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x38(%rbp),%rax
movslq -0xac(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x98(%rbp),%xmm1
ff
call   1080 <glb_likelihood@plt>
cvtsi2sd %rax,%xmm0
addsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
jmp    1344 <glbChiSpectrumCalib+0x1a4>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm2
xorps  %xmm1,%xmm1
call   10a0 <glb_prior@plt>
mov    %rax,-0xe8(%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    -0xe8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xe0(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm2
call   10a0 <glb_prior@plt>
mov    %rax,%rcx
mov    -0xe0(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xd8(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm2
call   10a0 <glb_prior@plt>
mov    %rax,%rcx
mov    -0xd8(%rbp),%rax
add    %rcx,%rax
cvtsi2sd %rax,%xmm0
addsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glbChiSpectrumCalib>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r8,-0x88(%rbp)
mov    %rcx,-0x50(%rbp)
mov    %esi,%r14d
mov    %esi,-0x30(%rbp)
mov    %edi,%r15d
call   1030 <glbGetNumberOfBins@plt>
mov    %eax,%ebx
mov    %eax,-0x38(%rbp)
mov    %r15d,%edi
mov    %r14d,%esi
call   1050 <glbGetRuleRatePtr@plt>
mov    %rax,%r12
mov    %ebx,%eax
mov    %rsp,%r13
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    %rsp,%r14
sub    %rax,%r14
mov    %r14,%rsp
lea    -0x68(%rbp),%rsi
lea    -0x60(%rbp),%rdx
mov    %r15d,%edi
call   1070 <glbGetEminEmax@plt>
lea    -0x3c(%rbp),%rdx
lea    -0x34(%rbp),%rcx
mov    %r15d,%edi
mov    -0x30(%rbp),%ebx
mov    %ebx,%esi
call   1040 <glbGetEnergyWindowBins@plt>
lea    -0x78(%rbp),%rdx
lea    -0x70(%rbp),%rcx
mov    %r15d,%edi
mov    %ebx,%esi
call   10c0 <glbGetBGCenters@plt>
movsd  0xdc4(%rip),%xmm0
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,-0x90(%rbp)
ff
addsd  0x10(%rax),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x70(%rbp),%xmm0
addsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    %r15d,%edi
mov    %ebx,%esi
call   1060 <glbGetSignalFitRatePtr@plt>
movsd  -0x68(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm0
mov    %eax,%edi
mov    %r13,%rsi
mov    -0x38(%rbp),%ebx
mov    %ebx,%edx
call   1090 <glbShiftEnergyScale@plt>
mov    %r15d,%edi
mov    -0x30(%rbp),%esi
call   10b0 <glbGetBGFitRatePtr@plt>
movsd  -0x68(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm0
mov    %eax,%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1090 <glbShiftEnergyScale@plt>
movslq -0x3c(%rbp),%rbx
xorps  %xmm0,%xmm0
cmp    -0x34(%rbp),%ebx
jg     1338 <glbChiSpectrumCalib+0x198>
add    $0xffffffffffffffff,%rbx
xorps  %xmm0,%xmm0
nopl   0x0(%rax)
movsd  %xmm0,-0x30(%rbp)
movsd  0x8(%r14,%rbx,8),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0x8(%r13,%rbx,8),%xmm1
mulsd  -0x90(%rbp),%xmm1
ff
addsd  %xmm0,%xmm1
movsd  0x8(%r12,%rbx,8),%xmm0
call   1080 <glb_likelihood@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movslq -0x34(%rbp),%rax
add    $0x1,%rbx
cmp    %rax,%rbx
jl     12e0 <glbChiSpectrumCalib+0x140>
movsd  %xmm0,-0x30(%rbp)
mov    -0x50(%rbp),%rbx
movsd  (%rbx),%xmm0
mov    -0x88(%rbp),%r15
movsd  (%r15),%xmm2
xorpd  %xmm1,%xmm1
call   10a0 <glb_prior@plt>
mov    %rax,%r14
movsd  0x8(%rbx),%xmm0
movsd  0x8(%r15),%xmm2
xorpd  %xmm1,%xmm1
call   10a0 <glb_prior@plt>
mov    %rax,%rbx
add    %r14,%rbx
movsd  -0x78(%rbp),%xmm1
movsd  0x10(%r15),%xmm2
movsd  -0x58(%rbp),%xmm0
call   10a0 <glb_prior@plt>
mov    %rax,%r14
add    %rbx,%r14
movsd  -0x70(%rbp),%xmm1
movsd  0x18(%r15),%xmm2
movsd  -0x48(%rbp),%xmm0
call   10a0 <glb_prior@plt>
add    %r14,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  -0x30(%rbp),%xmm0
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define double @glbChiSpectrumCalib(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 = zext i32 %13 to i64
%16 = alloca double, i64 %15
%17 = alloca double, i64 %15
%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 = call i32 @glbGetEnergyWindowBins(i32 %0, i32 %1, i32* %9, i32* %10)
%26 = call i32 @glbGetBGCenters(i32 %0, i32 %1, double* %7, double* %8)
%27 = load double, double* %3
%28 = fadd double %27, 1.000000e+00
%29 = load double, double* %7
%30 = getelementptr inbounds double, double* %3, i64 2
%31 = load double, double* %30
%32 = fadd double %31, 1.000000e+00
%33 = fmul double %29, %32
%34 = load double, double* %8
%35 = getelementptr inbounds double, double* %3, i64 3
%36 = load double, double* %35
%37 = fadd double %34, %36
%38 = getelementptr inbounds double, double* %3, i64 1
%39 = load double, double* %38
%40 = call i32 @glbGetSignalFitRatePtr(i32 %0, i32 %1)
%41 = load double, double* %11
%42 = load double, double* %12
%43 = call i32 @glbShiftEnergyScale(double %39, i32 %40, double* %16, i32 %13, double %41, double %42)
%44 = call i32 @glbGetBGFitRatePtr(i32 %0, i32 %1)
%45 = load double, double* %11
%46 = load double, double* %12
%47 = call i32 @glbShiftEnergyScale(double %37, i32 %44, double* %17, i32 %13, double %45, double %46)
%48 = load i32, i32* %9
%49 = load i32, i32* %10
%50 = icmp sgt i32 %48, %49
br i1 %50, label %71, label %51
51: ; preds = %6
%52 = sext i32 %48 to i64
br label %53
53: ; preds = %51, %53
%54 = phi i64 [ %52, %51 ], [ %67, %53 ]
%55 = phi double [ 0.000000e+00, %51 ], [ %66, %53 ]
%56 = getelementptr inbounds double, double* %16, i64 %54
%57 = load double, double* %56
%58 = getelementptr inbounds double, double* %17, i64 %54
%59 = load double, double* %58
%60 = fmul double %33, %59
%61 = call double @llvm.fmuladd.f64(double %28, double %57, double %60)
%62 = getelementptr inbounds double, double* %14, i64 %54
%63 = load double, double* %62
%64 = call i64 @glb_likelihood(double %63, double %61)
%65 = sitofp i64 %64 to double
%66 = fadd double %55, %65
%67 = add nsw i64 %54, 1
%68 = load i32, i32* %10
%69 = sext i32 %68 to i64
%70 = icmp slt i64 %54, %69
br i1 %70, label %53, label %71
71: ; preds = %53, %6
%72 = phi double [ 0.000000e+00, %6 ], [ %66, %53 ]
%73 = load double, double* %3
%74 = load double, double* %4
%75 = call i64 @glb_prior(double %73, double 0.000000e+00, double %74)
%76 = load double, double* %38
%77 = getelementptr inbounds double, double* %4, i64 1
%78 = load double, double* %77
%79 = call i64 @glb_prior(double %76, double 0.000000e+00, double %78)
%80 = add nsw i64 %79, %75
%81 = load double, double* %7
%82 = getelementptr inbounds double, double* %4, i64 2
%83 = load double, double* %82
%84 = call i64 @glb_prior(double %33, double %81, double %83)
%85 = add nsw i64 %80, %84
%86 = load double, double* %8
%87 = getelementptr inbounds double, double* %4, i64 3
%88 = load double, double* %87
%89 = call i64 @glb_prior(double %37, double %86, double %88)
%90 = add nsw i64 %85, %89
%91 = sitofp i64 %90 to double
%92 = fadd double %72, %91
ret double %92
}