#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 */
typedef int K;

/* Variables and functions */
int /*<<< orphan*/ add_dst(double *, double *, int);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sample_Delta(double *, double *, int);
void resample_post_theta(int D, int K, int **M, int *N, double **post_theta,
                         double **post_theta_train, double *global_topic_counts,
                         int *entity_map, int ***z) {
  int d_9;
  double *tmpSP7;
  int n_3;
  int m_75;
  int dvv_loop_var_1;
  int i;
  tmpSP7 = (double *)malloc(sizeof(double) * (1 + ((K) + (1)) - (1)));
  for (d_9 = 1; d_9 <= D; d_9++) {
    for (dvv_loop_var_1 = 1; dvv_loop_var_1 <= K; dvv_loop_var_1++) {
      tmpSP7[dvv_loop_var_1 - 1] = 0.0;
    }
    tmpSP7[(K) + (1) - 1] = (0.0) * (((1) + (K)) - (1));
    for (n_3 = 1; n_3 <= N[d_9 - 1]; n_3++) {
      for (m_75 = 1; m_75 <= M[d_9 - 1][n_3 - 1]; m_75++) {
        tmpSP7[(K) + (1) - 1] += 1.0;
        tmpSP7[z[d_9 - 1][n_3 - 1][m_75 - 1] - 1] += 1.0;
      }
    }
    if (entity_map == NULL) {
      sample_Delta(post_theta[d_9 - 1], tmpSP7, K);
    } else if (entity_map[d_9 - 1] == -1) {
      sample_Delta(post_theta[d_9 - 1], tmpSP7, K);
      add_dst(post_theta[d_9 - 1], global_topic_counts, K);
    } else {
      add_dst(post_theta_train[entity_map[d_9 - 1]], tmpSP7, K);
    }
  }
  free(tmpSP7);
}


x86 assembly (clang, -O0):
<resample_post_theta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
add    $0x1,%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     138f <resample_post_theta+0x24f>
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11d0 <resample_post_theta+0x90>
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11a1 <resample_post_theta+0x61>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
xorps  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    -0x2c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     12cf <resample_post_theta+0x18f>
movl   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x2c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x3c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     12bc <resample_post_theta+0x17c>
mov    -0x38(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xda2(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
mov    0x20(%rbp),%rcx
mov    -0x2c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x3c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x40(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xd5c(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1220 <resample_post_theta+0xe0>
jmp    12c1 <resample_post_theta+0x181>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1200 <resample_post_theta+0xc0>
cmpq   $0x0,0x18(%rbp)
jne    12fc <resample_post_theta+0x1bc>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1050 <sample_Delta@plt>
jmp    137c <resample_post_theta+0x23c>
mov    0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    1352 <resample_post_theta+0x212>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1050 <sample_Delta@plt>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1040 <add_dst@plt>
jmp    1377 <resample_post_theta+0x237>
mov    -0x28(%rbp),%rax
mov    0x18(%rbp),%rcx
mov    -0x2c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movslq (%rcx,%rdx,4),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1040 <add_dst@plt>
jmp    137c <resample_post_theta+0x23c>
jmp    1381 <resample_post_theta+0x241>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    118e <resample_post_theta+0x4e>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resample_post_theta>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,0x18(%rsp)
mov    %rcx,0x50(%rsp)
mov    %rdx,0x38(%rsp)
mov    %esi,%ebp
mov    %edi,%ebx
mov    0xa0(%rsp),%r12
mov    0x98(%rsp),%rax
mov    %rax,0x48(%rsp)
mov    0x90(%rsp),%rax
mov    %rax,0x20(%rsp)
lea    0x8(,%rbp,8),%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    %rbx,0x10(%rsp)
test   %ebx,%ebx
jle    13bf <resample_post_theta+0x26f>
cvtsi2sd %ebp,%xmm0
xorpd  %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x40(%rsp)
movslq %ebp,%r13
mov    %ebp,%eax
shl    $0x3,%rax
mov    %rax,0x30(%rsp)
mov    0x10(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x10(%rsp)
mov    $0x1,%r15d
movsd  0xe11(%rip),%xmm1
mov    %rbp,0x8(%rsp)
jmp    1230 <resample_post_theta+0xe0>
cs nopw 0x0(%rax,%rax,1)
mov    0x18(%rsp),%rax
mov    -0x8(%rax,%r15,8),%rdi
mov    %r14,%rsi
mov    0x8(%rsp),%rbp
mov    %ebp,%edx
call   1060 <sample_Delta@plt>
movsd  0xddf(%rip),%xmm1
add    $0x1,%r15
cmp    0x10(%rsp),%r15
je     13bf <resample_post_theta+0x26f>
test   %ebp,%ebp
jle    124b <resample_post_theta+0xfb>
mov    %r14,%rdi
xor    %esi,%esi
mov    0x30(%rsp),%rdx
call   1050 <memset@plt>
movsd  0xdb5(%rip),%xmm1
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,(%r14,%r13,8)
mov    0x50(%rsp),%rax
mov    -0x4(%rax,%r15,4),%eax
test   %eax,%eax
jle    1360 <resample_post_theta+0x210>
mov    0x38(%rsp),%rcx
mov    -0x8(%rcx,%r15,8),%r8
add    $0x1,%rax
mov    $0x1,%edx
jmp    128d <resample_post_theta+0x13d>
xchg   %ax,%ax
add    $0x1,%rdx
cmp    %rax,%rdx
je     1360 <resample_post_theta+0x210>
mov    -0x4(%r8,%rdx,4),%ebp
test   %ebp,%ebp
jle    1280 <resample_post_theta+0x130>
mov    -0x8(%r12,%r15,8),%rsi
mov    -0x8(%rsi,%rdx,8),%rdi
mov    $0x1,%ebx
cmp    $0x1,%ebp
je     131f <resample_post_theta+0x1cf>
mov    %ebp,%esi
and    $0xfffffffe,%esi
neg    %rsi
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%r13,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r14,%r13,8)
movslq -0x4(%rdi,%rbx,4),%rcx
movsd  -0x8(%r14,%rcx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%r14,%rcx,8)
movsd  (%r14,%r13,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r14,%r13,8)
movslq (%rdi,%rbx,4),%rcx
movsd  -0x8(%r14,%rcx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%r14,%rcx,8)
lea    (%rsi,%rbx,1),%rcx
add    $0x2,%rcx
add    $0x2,%rbx
cmp    $0x1,%rcx
jne    12c0 <resample_post_theta+0x170>
test   $0x1,%bpl
je     1280 <resample_post_theta+0x130>
movsd  (%r14,%r13,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r14,%r13,8)
movslq -0x4(%rdi,%rbx,4),%rcx
movsd  -0x8(%r14,%rcx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%r14,%rcx,8)
jmp    1280 <resample_post_theta+0x130>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x48(%rsp),%rax
test   %rax,%rax
je     1200 <resample_post_theta+0xb0>
movslq -0x4(%rax,%r15,4),%rax
cmp    $0xffffffffffffffff,%rax
je     1390 <resample_post_theta+0x240>
mov    0x28(%rsp),%rcx
mov    (%rcx,%rax,8),%rdi
mov    %r14,%rsi
mov    0x8(%rsp),%rbp
jmp    13b3 <resample_post_theta+0x263>
nopl   0x0(%rax)
mov    0x18(%rsp),%rbx
mov    -0x8(%rbx,%r15,8),%rdi
mov    %r14,%rsi
mov    0x8(%rsp),%rbp
mov    %ebp,%edx
call   1060 <sample_Delta@plt>
mov    -0x8(%rbx,%r15,8),%rdi
mov    0x20(%rsp),%rsi
mov    %ebp,%edx
call   1040 <add_dst@plt>
jmp    1219 <resample_post_theta+0xc9>
mov    %r14,%rdi
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @resample_post_theta(i32 %0, i32 %1, i32** nocapture %2, i32* nocapture %3, double** nocapture %4, double** nocapture %5, double* %6, i32* %7, i32*** nocapture %8) {
%10 = shl i32 %1, 3
%11 = add i32 %10, 8
%12 = tail call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to double*
%14 = inttoptr i64 %12 to i8*
%15 = icmp slt i32 %0, 1
br i1 %15, label %121, label %16
16: ; preds = %9
%17 = icmp slt i32 %1, 1
%18 = sitofp i32 %1 to double
%19 = fmul double %18, 0.000000e+00
%20 = sext i32 %1 to i64
%21 = getelementptr inbounds double, double* %13, i64 %20
%22 = icmp eq i32* %7, null
%23 = zext i32 %1 to i64
%24 = shl nuw nsw i64 %23, 3
%25 = add nuw i32 %0, 1
%26 = zext i32 %25 to i64
br label %27
27: ; preds = %16, %118
%28 = phi i64 [ 1, %16 ], [ %119, %118 ]
br i1 %17, label %30, label %29
29: ; preds = %27
br label %30
30: ; preds = %29, %27
store double %19, double* %21
%31 = add nsw i64 %28, -1
%32 = getelementptr inbounds i32, i32* %3, i64 %31
%33 = load i32, i32* %32
%34 = icmp slt i32 %33, 1
br i1 %34, label %98, label %35
35: ; preds = %30
%36 = getelementptr inbounds i32*, i32** %2, i64 %31
%37 = load i32*, i32** %36
%38 = getelementptr inbounds i32**, i32*** %8, i64 %31
%39 = add nuw i32 %33, 1
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %35, %95
%42 = phi i64 [ 1, %35 ], [ %96, %95 ]
%43 = add nsw i64 %42, -1
%44 = getelementptr inbounds i32, i32* %37, i64 %43
%45 = load i32, i32* %44
%46 = icmp slt i32 %45, 1
br i1 %46, label %95, label %47
47: ; preds = %41
%48 = load i32**, i32*** %38
%49 = getelementptr inbounds i32*, i32** %48, i64 %43
%50 = load i32*, i32** %49
%51 = zext i32 %45 to i64
%52 = and i64 %51, 1
%53 = icmp eq i32 %45, 1
br i1 %53, label %81, label %54
54: ; preds = %47
%55 = and i64 %51, 4294967294
br label %56
56: ; preds = %56, %54
%57 = phi i64 [ 1, %54 ], [ %78, %56 ]
%58 = phi i64 [ 0, %54 ], [ %79, %56 ]
%59 = load double, double* %21
%60 = fadd double %59, 1.000000e+00
store double %60, double* %21
%61 = add nsw i64 %57, -1
%62 = getelementptr inbounds i32, i32* %50, i64 %61
%63 = load i32, i32* %62
%64 = add nsw i32 %63, -1
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %13, i64 %65
%67 = load double, double* %66
%68 = fadd double %67, 1.000000e+00
store double %68, double* %66
%69 = load double, double* %21
%70 = fadd double %69, 1.000000e+00
store double %70, double* %21
%71 = getelementptr inbounds i32, i32* %50, i64 %57
%72 = load i32, i32* %71
%73 = add nsw i32 %72, -1
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %13, i64 %74
%76 = load double, double* %75
%77 = fadd double %76, 1.000000e+00
store double %77, double* %75
%78 = add nuw nsw i64 %57, 2
%79 = add i64 %58, 2
%80 = icmp eq i64 %79, %55
br i1 %80, label %81, label %56
81: ; preds = %56, %47
%82 = phi i64 [ 1, %47 ], [ %78, %56 ]
%83 = icmp eq i64 %52, 0
br i1 %83, label %95, label %84
84: ; preds = %81
%85 = load double, double* %21
%86 = fadd double %85, 1.000000e+00
store double %86, double* %21
%87 = add nsw i64 %82, -1
%88 = getelementptr inbounds i32, i32* %50, i64 %87
%89 = load i32, i32* %88
%90 = add nsw i32 %89, -1
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %13, i64 %91
%93 = load double, double* %92
%94 = fadd double %93, 1.000000e+00
store double %94, double* %92
br label %95
95: ; preds = %84, %81, %41
%96 = add nuw nsw i64 %42, 1
%97 = icmp eq i64 %96, %40
br i1 %97, label %98, label %41
98: ; preds = %95, %30
br i1 %22, label %99, label %103
99: ; preds = %98
%100 = getelementptr inbounds double*, double** %4, i64 %31
%101 = load double*, double** %100
%102 = tail call i32 @sample_Delta(double* %101, double* %13, i32 %1)
br label %118
103: ; preds = %98
%104 = getelementptr inbounds i32, i32* %7, i64 %31
%105 = load i32, i32* %104
%106 = icmp eq i32 %105, -1
br i1 %106, label %107, label %113
107: ; preds = %103
%108 = getelementptr inbounds double*, double** %4, i64 %31
%109 = load double*, double** %108
%110 = tail call i32 @sample_Delta(double* %109, double* %13, i32 %1)
%111 = load double*, double** %108
%112 = tail call i32 @add_dst(double* %111, double* %6, i32 %1)
br label %118
113: ; preds = %103
%114 = sext i32 %105 to i64
%115 = getelementptr inbounds double*, double** %5, i64 %114
%116 = load double*, double** %115
%117 = tail call i32 @add_dst(double* %116, double* %13, i32 %1)
br label %118
118: ; preds = %99, %113, %107
%119 = add nuw nsw i64 %28, 1
%120 = icmp eq i64 %119, %26
br i1 %120, label %121, label %27
121: ; preds = %118, %9
%122 = tail call i32 @free(double* %13)
ret void
}