#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 */
size_t FindNonZero(int *, int);
int /*<<< orphan*/ PerturbLambda(double *, double, double *, int **, int, int);
double log(double);
int sumint(int *, int);
void getInitialGuess(double *x0, double *lambda, double *G, int **AT, int **A,
                     int numSS, int numTotal, double PerturbScale,
                     unsigned long rand_seed) {
  int i, j;
  double MaxLogx;
  double LambdaVal;
  double NewLambdaVal;
  double tG;
  MaxLogx = 1.0;
  LambdaVal = (MaxLogx + G[0]) / sumint(AT[0], numSS);
  for (j = 1; j < numTotal; j++) {
    NewLambdaVal = (MaxLogx + G[j]) / sumint(AT[j], numSS);
    if (NewLambdaVal < LambdaVal) {
      LambdaVal = NewLambdaVal;
    }
  }
  for (i = 0; i < numSS; i++) {
    lambda[i] = LambdaVal;
  }
  if (rand_seed != 0) {
    PerturbLambda(lambda, PerturbScale, G, AT, numSS, numTotal);
  }
  for (i = 0; i < numSS; i++) {
    if (sumint(A[i], numTotal) == 1) {
      tG = G[FindNonZero(A[i], numTotal)];
      lambda[i] = log(x0[i]) + tG;
    }
  }
}


x86 assembly (clang, -O0):
<getInitialGuess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movsd  %xmm0,-0x38(%rbp)
movsd  0xe89(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x2c(%rbp),%esi
call   1040 <sumint@plt>
movsd  -0x68(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1230 <getInitialGuess+0xf0>
movsd  -0x48(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x2c(%rbp),%esi
call   1040 <sumint@plt>
movsd  -0x70(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    121d <getInitialGuess+0xdd>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1222 <getInitialGuess+0xe2>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11b6 <getInitialGuess+0x76>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1263 <getInitialGuess+0x123>
movsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1237 <getInitialGuess+0xf7>
cmpq   $0x0,0x18(%rbp)
je     128b <getInitialGuess+0x14b>
mov    -0x10(%rbp),%rdi
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    0x10(%rbp),%r8d
call   1050 <PerturbLambda@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    131f <getInitialGuess+0x1df>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x10(%rbp),%esi
call   1040 <sumint@plt>
cmp    $0x1,%eax
jne    130c <getInitialGuess+0x1cc>
mov    -0x18(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x10(%rbp),%esi
call   1030 <FindNonZero@plt>
mov    %rax,%rcx
mov    -0x78(%rbp),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1060 <log@plt>
addsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1311 <getInitialGuess+0x1d1>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1292 <getInitialGuess+0x152>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInitialGuess>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movsd  %xmm0,0x18(%rsp)
mov    %r9d,%r15d
mov    %r8,0x20(%rsp)
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,0x28(%rsp)
mov    0x80(%rsp),%r13d
movsd  (%rdx),%xmm0
addsd  0xe82(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    (%rcx),%rdi
mov    %r9d,%esi
call   1040 <sumint@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
cmp    $0x2,%r13d
jl     120c <getInitialGuess+0xcc>
mov    %r13d,%ebp
mov    %r13d,%r13d
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm0,0x8(%rsp)
movsd  (%r12,%rbp,8),%xmm0
addsd  0xe2c(%rip),%xmm0
movapd %xmm0,0x30(%rsp)
mov    (%r14,%rbp,8),%rdi
mov    %r15d,%esi
call   1040 <sumint@plt>
movapd 0x30(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  %xmm0,%xmm1
minsd  0x8(%rsp),%xmm1
add    $0x1,%rbp
movapd %xmm1,%xmm0
cmp    %rbp,%r13
jne    11c0 <getInitialGuess+0x80>
jmp    1210 <getInitialGuess+0xd0>
movapd %xmm0,%xmm1
mov    %r12,0x10(%rsp)
mov    0x88(%rsp),%r8
mov    %r15d,%r13d
test   %r15d,%r15d
mov    %r15d,%ebp
mov    0x20(%rsp),%r15
jle    134e <getInitialGuess+0x20e>
cmp    $0x4,%ebp
jae    123d <getInitialGuess+0xfd>
xor    %ecx,%ecx
jmp    1340 <getInitialGuess+0x200>
mov    %r13d,%ecx
and    $0xfffffffc,%ecx
movapd %xmm1,%xmm0
unpcklpd %xmm1,%xmm0
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%eax
and    $0x7,%eax
cmp    $0x1c,%rdi
jae    126c <getInitialGuess+0x12c>
xor    %edi,%edi
jmp    1305 <getInitialGuess+0x1c5>
and    $0xfffffffffffffff8,%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd %xmm0,(%rbx,%rdi,8)
movupd %xmm0,0x10(%rbx,%rdi,8)
movupd %xmm0,0x20(%rbx,%rdi,8)
movupd %xmm0,0x30(%rbx,%rdi,8)
movupd %xmm0,0x40(%rbx,%rdi,8)
movupd %xmm0,0x50(%rbx,%rdi,8)
movupd %xmm0,0x60(%rbx,%rdi,8)
movupd %xmm0,0x70(%rbx,%rdi,8)
movupd %xmm0,0x80(%rbx,%rdi,8)
movupd %xmm0,0x90(%rbx,%rdi,8)
movupd %xmm0,0xa0(%rbx,%rdi,8)
movupd %xmm0,0xb0(%rbx,%rdi,8)
movupd %xmm0,0xc0(%rbx,%rdi,8)
movupd %xmm0,0xd0(%rbx,%rdi,8)
movupd %xmm0,0xe0(%rbx,%rdi,8)
movupd %xmm0,0xf0(%rbx,%rdi,8)
add    $0x20,%rdi
add    $0xfffffffffffffff8,%rsi
jne    1280 <getInitialGuess+0x140>
test   %rax,%rax
je     1334 <getInitialGuess+0x1f4>
lea    (%rbx,%rdi,8),%rsi
add    $0x10,%rsi
shl    $0x5,%rax
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movupd %xmm0,-0x10(%rsi,%rdi,1)
movupd %xmm0,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rax
jne    1320 <getInitialGuess+0x1e0>
cmp    %r13,%rcx
je     134e <getInitialGuess+0x20e>
nopl   0x0(%rax)
movsd  %xmm1,(%rbx,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%r13
jne    1340 <getInitialGuess+0x200>
test   %r8,%r8
je     1373 <getInitialGuess+0x233>
mov    %rbx,%rdi
movsd  0x18(%rsp),%xmm0
mov    0x10(%rsp),%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    0x80(%rsp),%r8d
call   1050 <PerturbLambda@plt>
test   %ebp,%ebp
mov    0x28(%rsp),%r12
jle    13d6 <getInitialGuess+0x296>
xor    %ebp,%ebp
jmp    1389 <getInitialGuess+0x249>
add    $0x1,%rbp
cmp    %rbp,%r13
je     13d6 <getInitialGuess+0x296>
mov    (%r15,%rbp,8),%rdi
mov    0x80(%rsp),%esi
call   1040 <sumint@plt>
cmp    $0x1,%eax
jne    1380 <getInitialGuess+0x240>
mov    (%r15,%rbp,8),%rdi
mov    0x80(%rsp),%esi
call   1030 <FindNonZero@plt>
mov    0x10(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r12,%rbp,8),%xmm0
call   1060 <log@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
jmp    1380 <getInitialGuess+0x240>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @getInitialGuess(double* %0, double* %1, double* %2, i32** %3, i32** %4, i32 %5, i32 %6, double %7, i64 %8) {
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32**
%14 = alloca i32**
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
%18 = alloca i64
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
store double* %0, double** %10
store double* %1, double** %11
store double* %2, double** %12
store i32** %3, i32*** %13
store i32** %4, i32*** %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store double %7, double* %17
store i64 %8, i64* %18
store double 1.000000e+00, double* %21
%25 = load double, double* %21
%26 = load double*, double** %12
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = fadd double %25, %28
%30 = load i32**, i32*** %13
%31 = getelementptr inbounds i32*, i32** %30, i64 0
%32 = load i32*, i32** %31
%33 = load i32, i32* %15
%34 = call i32 @sumint(i32* %32, i32 %33)
%35 = sitofp i32 %34 to double
%36 = fdiv double %29, %35
store double %36, double* %22
store i32 1, i32* %20
br label %37
37: ; preds = %64, %9
%38 = load i32, i32* %20
%39 = load i32, i32* %16
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %67
41: ; preds = %37
%42 = load double, double* %21
%43 = load double*, double** %12
%44 = load i32, i32* %20
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
%47 = load double, double* %46
%48 = fadd double %42, %47
%49 = load i32**, i32*** %13
%50 = load i32, i32* %20
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32*, i32** %49, i64 %51
%53 = load i32*, i32** %52
%54 = load i32, i32* %15
%55 = call i32 @sumint(i32* %53, i32 %54)
%56 = sitofp i32 %55 to double
%57 = fdiv double %48, %56
store double %57, double* %23
%58 = load double, double* %23
%59 = load double, double* %22
%60 = fcmp olt double %58, %59
br i1 %60, label %61, label %63
61: ; preds = %41
%62 = load double, double* %23
store double %62, double* %22
br label %63
63: ; preds = %61, %41
br label %64
64: ; preds = %63
%65 = load i32, i32* %20
%66 = add nsw i32 %65, 1
store i32 %66, i32* %20
br label %37
67: ; preds = %37
store i32 0, i32* %19
br label %68
68: ; preds = %78, %67
%69 = load i32, i32* %19
%70 = load i32, i32* %15
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %81
72: ; preds = %68
%73 = load double, double* %22
%74 = load double*, double** %11
%75 = load i32, i32* %19
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %74, i64 %76
store double %73, double* %77
br label %78
78: ; preds = %72
%79 = load i32, i32* %19
%80 = add nsw i32 %79, 1
store i32 %80, i32* %19
br label %68
81: ; preds = %68
%82 = load i64, i64* %18
%83 = icmp ne i64 %82, 0
br i1 %83, label %84, label %92
84: ; preds = %81
%85 = load double*, double** %11
%86 = load double, double* %17
%87 = load double*, double** %12
%88 = load i32**, i32*** %13
%89 = load i32, i32* %15
%90 = load i32, i32* %16
%91 = call i32 @PerturbLambda(double* %85, double %86, double* %87, i32** %88, i32 %89, i32 %90)
br label %92
92: ; preds = %84, %81
store i32 0, i32* %19
br label %93
93: ; preds = %130, %92
%94 = load i32, i32* %19
%95 = load i32, i32* %15
%96 = icmp slt i32 %94, %95
br i1 %96, label %97, label %133
97: ; preds = %93
%98 = load i32**, i32*** %14
%99 = load i32, i32* %19
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i32*, i32** %98, i64 %100
%102 = load i32*, i32** %101
%103 = load i32, i32* %16
%104 = call i32 @sumint(i32* %102, i32 %103)
%105 = icmp eq i32 %104, 1
br i1 %105, label %106, label %129
106: ; preds = %97
%107 = load double*, double** %12
%108 = load i32**, i32*** %14
%109 = load i32, i32* %19
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i32*, i32** %108, i64 %110
%112 = load i32*, i32** %111
%113 = load i32, i32* %16
%114 = call i64 @FindNonZero(i32* %112, i32 %113)
%115 = getelementptr inbounds double, double* %107, i64 %114
%116 = load double, double* %115
store double %116, double* %24
%117 = load double*, double** %10
%118 = load i32, i32* %19
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %117, i64 %119
%121 = load double, double* %120
%122 = call double @log(double %121)
%123 = load double, double* %24
%124 = fadd double %122, %123
%125 = load double*, double** %11
%126 = load i32, i32* %19
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %125, i64 %127
store double %124, double* %128
br label %129
129: ; preds = %106, %97
br label %130
130: ; preds = %129
%131 = load i32, i32* %19
%132 = add nsw i32 %131, 1
store i32 %132, i32* %19
br label %93
133: ; preds = %93
ret void
}

LLVM IR (-O2):
define void @getInitialGuess(double* nocapture %0, double* %1, double* %2, i32** %3, i32** nocapture %4, i32 %5, i32 %6, double %7, i64 %8) {
%10 = load double, double* %2
%11 = fadd double %10, 1.000000e+00
%12 = load i32*, i32** %3
%13 = tail call i32 @sumint(i32* %12, i32 %5)
%14 = sitofp i32 %13 to double
%15 = fdiv double %11, %14
%16 = icmp sgt i32 %6, 1
br i1 %16, label %17, label %19
17: ; preds = %9
%18 = zext i32 %6 to i64
br label %100
19: ; preds = %100, %9
%20 = phi double [ %15, %9 ], [ %112, %100 ]
%21 = icmp sgt i32 %5, 0
br i1 %21, label %22, label %120
22: ; preds = %19
%23 = zext i32 %5 to i64
%24 = icmp ult i32 %5, 4
br i1 %24, label %98, label %25
25: ; preds = %22
%26 = and i64 %23, 4294967292
%27 = insertelement <2 x double> poison, double %20, i64 0
%28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer
%29 = insertelement <2 x double> poison, double %20, i64 0
%30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> zeroinitializer
%31 = add nsw i64 %26, -4
%32 = lshr exact i64 %31, 2
%33 = add nuw nsw i64 %32, 1
%34 = and i64 %33, 7
%35 = icmp ult i64 %31, 28
br i1 %35, label %83, label %36
36: ; preds = %25
%37 = and i64 %33, 9223372036854775800
br label %38
38: ; preds = %38, %36
%39 = phi i64 [ 0, %36 ], [ %80, %38 ]
%40 = phi i64 [ 0, %36 ], [ %81, %38 ]
%41 = getelementptr inbounds double, double* %1, i64 %39
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> %28, <2 x double>* %42
%43 = getelementptr inbounds double, double* %41, i64 2
%44 = bitcast double* %43 to <2 x double>*
store <2 x double> %30, <2 x double>* %44
%45 = or i64 %39, 4
%46 = getelementptr inbounds double, double* %1, i64 %45
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> %28, <2 x double>* %47
%48 = getelementptr inbounds double, double* %46, i64 2
%49 = bitcast double* %48 to <2 x double>*
store <2 x double> %30, <2 x double>* %49
%50 = or i64 %39, 8
%51 = getelementptr inbounds double, double* %1, i64 %50
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> %28, <2 x double>* %52
%53 = getelementptr inbounds double, double* %51, i64 2
%54 = bitcast double* %53 to <2 x double>*
store <2 x double> %30, <2 x double>* %54
%55 = or i64 %39, 12
%56 = getelementptr inbounds double, double* %1, i64 %55
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %28, <2 x double>* %57
%58 = getelementptr inbounds double, double* %56, i64 2
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> %30, <2 x double>* %59
%60 = or i64 %39, 16
%61 = getelementptr inbounds double, double* %1, i64 %60
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> %28, <2 x double>* %62
%63 = getelementptr inbounds double, double* %61, i64 2
%64 = bitcast double* %63 to <2 x double>*
store <2 x double> %30, <2 x double>* %64
%65 = or i64 %39, 20
%66 = getelementptr inbounds double, double* %1, i64 %65
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> %28, <2 x double>* %67
%68 = getelementptr inbounds double, double* %66, i64 2
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> %30, <2 x double>* %69
%70 = or i64 %39, 24
%71 = getelementptr inbounds double, double* %1, i64 %70
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> %28, <2 x double>* %72
%73 = getelementptr inbounds double, double* %71, i64 2
%74 = bitcast double* %73 to <2 x double>*
store <2 x double> %30, <2 x double>* %74
%75 = or i64 %39, 28
%76 = getelementptr inbounds double, double* %1, i64 %75
%77 = bitcast double* %76 to <2 x double>*
store <2 x double> %28, <2 x double>* %77
%78 = getelementptr inbounds double, double* %76, i64 2
%79 = bitcast double* %78 to <2 x double>*
store <2 x double> %30, <2 x double>* %79
%80 = add nuw i64 %39, 32
%81 = add i64 %40, 8
%82 = icmp eq i64 %81, %37
br i1 %82, label %83, label %38
83: ; preds = %38, %25
%84 = phi i64 [ 0, %25 ], [ %80, %38 ]
%85 = icmp eq i64 %34, 0
br i1 %85, label %96, label %86
86: ; preds = %83, %86
%87 = phi i64 [ %93, %86 ], [ %84, %83 ]
%88 = phi i64 [ %94, %86 ], [ 0, %83 ]
%89 = getelementptr inbounds double, double* %1, i64 %87
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> %28, <2 x double>* %90
%91 = getelementptr inbounds double, double* %89, i64 2
%92 = bitcast double* %91 to <2 x double>*
store <2 x double> %30, <2 x double>* %92
%93 = add nuw i64 %87, 4
%94 = add i64 %88, 1
%95 = icmp eq i64 %94, %34
br i1 %95, label %96, label %86
96: ; preds = %86, %83
%97 = icmp eq i64 %26, %23
br i1 %97, label %120, label %98
98: ; preds = %22, %96
%99 = phi i64 [ 0, %22 ], [ %26, %96 ]
br label %115
100: ; preds = %17, %100
%101 = phi i64 [ 1, %17 ], [ %113, %100 ]
%102 = phi double [ %15, %17 ], [ %112, %100 ]
%103 = getelementptr inbounds double, double* %2, i64 %101
%104 = load double, double* %103
%105 = fadd double %104, 1.000000e+00
%106 = getelementptr inbounds i32*, i32** %3, i64 %101
%107 = load i32*, i32** %106
%108 = tail call i32 @sumint(i32* %107, i32 %5)
%109 = sitofp i32 %108 to double
%110 = fdiv double %105, %109
%111 = fcmp olt double %110, %102
%112 = select i1 %111, double %110, double %102
%113 = add nuw nsw i64 %101, 1
%114 = icmp eq i64 %113, %18
br i1 %114, label %19, label %100
115: ; preds = %98, %115
%116 = phi i64 [ %118, %115 ], [ %99, %98 ]
%117 = getelementptr inbounds double, double* %1, i64 %116
store double %20, double* %117
%118 = add nuw nsw i64 %116, 1
%119 = icmp eq i64 %118, %23
br i1 %119, label %120, label %115
120: ; preds = %115, %96, %19
%121 = icmp eq i64 %8, 0
br i1 %121, label %124, label %122
122: ; preds = %120
%123 = tail call i32 @PerturbLambda(double* %1, double %7, double* %2, i32** %3, i32 %5, i32 %6)
br label %124
124: ; preds = %122, %120
br i1 %21, label %125, label %146
125: ; preds = %124
%126 = zext i32 %5 to i64
br label %127
127: ; preds = %125, %143
%128 = phi i64 [ 0, %125 ], [ %144, %143 ]
%129 = getelementptr inbounds i32*, i32** %4, i64 %128
%130 = load i32*, i32** %129
%131 = tail call i32 @sumint(i32* %130, i32 %6)
%132 = icmp eq i32 %131, 1
br i1 %132, label %133, label %143
133: ; preds = %127
%134 = load i32*, i32** %129
%135 = tail call i64 @FindNonZero(i32* %134, i32 %6)
%136 = getelementptr inbounds double, double* %2, i64 %135
%137 = load double, double* %136
%138 = getelementptr inbounds double, double* %0, i64 %128
%139 = load double, double* %138
%140 = tail call double @log(double %139)
%141 = fadd double %137, %140
%142 = getelementptr inbounds double, double* %1, i64 %128
store double %141, double* %142
br label %143
143: ; preds = %127, %133
%144 = add nuw nsw i64 %128, 1
%145 = icmp eq i64 %144, %126
br i1 %145, label %146, label %127
146: ; preds = %143, %124
ret void
}