#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, int *entity_map, int ***z) {
  int d_9;
  double *tmpSP7;
  int n_3;
  int m_75;
  int dvv_loop_var_1;
  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) || (entity_map[d_9 - 1] == -1)) {
      sample_Delta(post_theta[d_9 - 1], tmpSP7, 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    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     1347 <resample_post_theta+0x207>
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11cc <resample_post_theta+0x8c>
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    119d <resample_post_theta+0x5d>
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     12cb <resample_post_theta+0x18b>
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     12b8 <resample_post_theta+0x178>
mov    -0x38(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xda6(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
mov    0x18(%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  0xd60(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    121c <resample_post_theta+0xdc>
jmp    12bd <resample_post_theta+0x17d>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11fc <resample_post_theta+0xbc>
cmpq   $0x0,0x10(%rbp)
je     12ed <resample_post_theta+0x1ad>
mov    0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    130f <resample_post_theta+0x1cf>
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    1334 <resample_post_theta+0x1f4>
mov    -0x28(%rbp),%rax
mov    0x10(%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    1339 <resample_post_theta+0x1f9>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    118a <resample_post_theta+0x4a>
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    $0x48,%rsp
mov    %r9,0x10(%rsp)
mov    %r8,0x20(%rsp)
mov    %rcx,0x40(%rsp)
mov    %rdx,0x28(%rsp)
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x88(%rsp),%r12
mov    0x80(%rsp),%rax
mov    %rax,0x38(%rsp)
lea    0x8(,%rbx,8),%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    %rbp,(%rsp)
test   %ebp,%ebp
jle    138a <resample_post_theta+0x23a>
cvtsi2sd %ebx,%xmm0
xorpd  %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
movslq %ebx,%r13
mov    %ebx,%eax
shl    $0x3,%rax
mov    %rax,0x18(%rsp)
mov    (%rsp),%rax
add    $0x1,%eax
mov    %rax,(%rsp)
mov    $0x1,%r15d
movsd  0xe21(%rip),%xmm1
mov    %rbx,0x8(%rsp)
jmp    121f <resample_post_theta+0xcf>
cs nopw 0x0(%rax,%rax,1)
mov    0x20(%rsp),%rax
mov    -0x8(%rax,%r15,8),%rdi
mov    %r14,%rsi
mov    0x8(%rsp),%rbx
mov    %ebx,%edx
call   1060 <sample_Delta@plt>
movsd  0xdef(%rip),%xmm1
add    $0x1,%r15
cmp    (%rsp),%r15
je     138a <resample_post_theta+0x23a>
test   %ebx,%ebx
jle    123a <resample_post_theta+0xea>
mov    %r14,%rdi
xor    %esi,%esi
mov    0x18(%rsp),%rdx
call   1050 <memset@plt>
movsd  0xdc6(%rip),%xmm1
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,(%r14,%r13,8)
mov    0x40(%rsp),%rax
mov    -0x4(%rax,%r15,4),%eax
test   %eax,%eax
jle    1350 <resample_post_theta+0x200>
mov    0x28(%rsp),%rcx
mov    -0x8(%rcx,%r15,8),%r8
add    $0x1,%rax
mov    $0x1,%edx
jmp    127d <resample_post_theta+0x12d>
nopl   (%rax)
add    $0x1,%rdx
cmp    %rax,%rdx
je     1350 <resample_post_theta+0x200>
mov    -0x4(%r8,%rdx,4),%ebp
test   %ebp,%ebp
jle    1270 <resample_post_theta+0x120>
mov    -0x8(%r12,%r15,8),%rsi
mov    -0x8(%rsi,%rdx,8),%rdi
mov    $0x1,%ebx
cmp    $0x1,%ebp
je     130f <resample_post_theta+0x1bf>
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    12b0 <resample_post_theta+0x160>
test   $0x1,%bpl
je     1270 <resample_post_theta+0x120>
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    1270 <resample_post_theta+0x120>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x38(%rsp),%rax
test   %rax,%rax
je     11f0 <resample_post_theta+0xa0>
movslq -0x4(%rax,%r15,4),%rax
cmp    $0xffffffffffffffff,%rax
je     11f0 <resample_post_theta+0xa0>
mov    0x10(%rsp),%rcx
mov    (%rcx,%rax,8),%rdi
mov    %r14,%rsi
mov    0x8(%rsp),%rbx
mov    %ebx,%edx
call   1040 <add_dst@plt>
jmp    1209 <resample_post_theta+0xb9>
mov    %r14,%rdi
add    $0x48,%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, i32* %6, i32*** %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32**
%12 = alloca i32*
%13 = alloca double**
%14 = alloca double**
%15 = alloca i32*
%16 = alloca i32***
%17 = alloca i32
%18 = alloca double*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32** %2, i32*** %11
store i32* %3, i32** %12
store double** %4, double*** %13
store double** %5, double*** %14
store i32* %6, i32** %15
store i32*** %7, i32**** %16
%22 = load i32, i32* %10
%23 = add nsw i32 %22, 1
%24 = add nsw i32 1, %23
%25 = sub nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = mul i64 8, %26
%28 = trunc i64 %27 to i32
%29 = call i64 @malloc(i32 %28)
%30 = inttoptr i64 %29 to double*
store double* %30, double** %18
store i32 1, i32* %17
br label %31
31: ; preds = %159, %8
%32 = load i32, i32* %17
%33 = load i32, i32* %9
%34 = icmp sle i32 %32, %33
br i1 %34, label %35, label %162
35: ; preds = %31
store i32 1, i32* %21
br label %36
36: ; preds = %46, %35
%37 = load i32, i32* %21
%38 = load i32, i32* %10
%39 = icmp sle i32 %37, %38
br i1 %39, label %40, label %49
40: ; preds = %36
%41 = load double*, double** %18
%42 = load i32, i32* %21
%43 = sub nsw i32 %42, 1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %41, i64 %44
store double 0.000000e+00, double* %45
br label %46
46: ; preds = %40
%47 = load i32, i32* %21
%48 = add nsw i32 %47, 1
store i32 %48, i32* %21
br label %36
49: ; preds = %36
%50 = load i32, i32* %10
%51 = add nsw i32 1, %50
%52 = sub nsw i32 %51, 1
%53 = sitofp i32 %52 to double
%54 = fmul double 0.000000e+00, %53
%55 = load double*, double** %18
%56 = load i32, i32* %10
%57 = add nsw i32 %56, 1
%58 = sub nsw i32 %57, 1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %55, i64 %59
store double %54, double* %60
store i32 1, i32* %19
br label %61
61: ; preds = %120, %49
%62 = load i32, i32* %19
%63 = load i32*, i32** %12
%64 = load i32, i32* %17
%65 = sub nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i32, i32* %63, i64 %66
%68 = load i32, i32* %67
%69 = icmp sle i32 %62, %68
br i1 %69, label %70, label %123
70: ; preds = %61
store i32 1, i32* %20
br label %71
71: ; preds = %116, %70
%72 = load i32, i32* %20
%73 = load i32**, i32*** %11
%74 = load i32, i32* %17
%75 = sub nsw i32 %74, 1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i32*, i32** %73, i64 %76
%78 = load i32*, i32** %77
%79 = load i32, i32* %19
%80 = sub nsw i32 %79, 1
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i32, i32* %78, i64 %81
%83 = load i32, i32* %82
%84 = icmp sle i32 %72, %83
br i1 %84, label %85, label %119
85: ; preds = %71
%86 = load double*, double** %18
%87 = load i32, i32* %10
%88 = add nsw i32 %87, 1
%89 = sub nsw i32 %88, 1
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %86, i64 %90
%92 = load double, double* %91
%93 = fadd double %92, 1.000000e+00
store double %93, double* %91
%94 = load double*, double** %18
%95 = load i32***, i32**** %16
%96 = load i32, i32* %17
%97 = sub nsw i32 %96, 1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i32**, i32*** %95, i64 %98
%100 = load i32**, i32*** %99
%101 = load i32, i32* %19
%102 = sub nsw i32 %101, 1
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i32*, i32** %100, i64 %103
%105 = load i32*, i32** %104
%106 = load i32, i32* %20
%107 = sub nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i32, i32* %105, i64 %108
%110 = load i32, i32* %109
%111 = sub nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %94, i64 %112
%114 = load double, double* %113
%115 = fadd double %114, 1.000000e+00
store double %115, double* %113
br label %116
116: ; preds = %85
%117 = load i32, i32* %20
%118 = add nsw i32 %117, 1
store i32 %118, i32* %20
br label %71
119: ; preds = %71
br label %120
120: ; preds = %119
%121 = load i32, i32* %19
%122 = add nsw i32 %121, 1
store i32 %122, i32* %19
br label %61
123: ; preds = %61
%124 = load i32*, i32** %15
%125 = icmp eq i32* %124, null
br i1 %125, label %134, label %126
126: ; preds = %123
%127 = load i32*, i32** %15
%128 = load i32, i32* %17
%129 = sub nsw i32 %128, 1
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i32, i32* %127, i64 %130
%132 = load i32, i32* %131
%133 = icmp eq i32 %132, -1
br i1 %133, label %134, label %144
134: ; preds = %126, %123
%135 = load double**, double*** %13
%136 = load i32, i32* %17
%137 = sub nsw i32 %136, 1
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double*, double** %135, i64 %138
%140 = load double*, double** %139
%141 = load double*, double** %18
%142 = load i32, i32* %10
%143 = call i32 @sample_Delta(double* %140, double* %141, i32 %142)
br label %158
144: ; preds = %126
%145 = load double**, double*** %14
%146 = load i32*, i32** %15
%147 = load i32, i32* %17
%148 = sub nsw i32 %147, 1
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i32, i32* %146, i64 %149
%151 = load i32, i32* %150
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double*, double** %145, i64 %152
%154 = load double*, double** %153
%155 = load double*, double** %18
%156 = load i32, i32* %10
%157 = call i32 @add_dst(double* %154, double* %155, i32 %156)
br label %158
158: ; preds = %144, %134
br label %159
159: ; preds = %158
%160 = load i32, i32* %17
%161 = add nsw i32 %160, 1
store i32 %161, i32* %17
br label %31
162: ; preds = %31
%163 = load double*, double** %18
%164 = call i32 @free(double* %163)
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, i32* %6, i32*** nocapture %7) {
%9 = shl i32 %1, 3
%10 = add i32 %9, 8
%11 = tail call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to double*
%13 = inttoptr i64 %11 to i8*
%14 = icmp slt i32 %0, 1
br i1 %14, label %114, label %15
15: ; preds = %8
%16 = icmp slt i32 %1, 1
%17 = sitofp i32 %1 to double
%18 = fmul double %17, 0.000000e+00
%19 = sext i32 %1 to i64
%20 = getelementptr inbounds double, double* %12, i64 %19
%21 = icmp eq i32* %6, null
%22 = zext i32 %1 to i64
%23 = shl nuw nsw i64 %22, 3
%24 = add nuw i32 %0, 1
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %15, %111
%27 = phi i64 [ 1, %15 ], [ %112, %111 ]
br i1 %16, label %29, label %28
28: ; preds = %26
br label %29
29: ; preds = %28, %26
store double %18, double* %20
%30 = add nsw i64 %27, -1
%31 = getelementptr inbounds i32, i32* %3, i64 %30
%32 = load i32, i32* %31
%33 = icmp slt i32 %32, 1
br i1 %33, label %97, label %34
34: ; preds = %29
%35 = getelementptr inbounds i32*, i32** %2, i64 %30
%36 = load i32*, i32** %35
%37 = getelementptr inbounds i32**, i32*** %7, i64 %30
%38 = add nuw i32 %32, 1
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %34, %94
%41 = phi i64 [ 1, %34 ], [ %95, %94 ]
%42 = add nsw i64 %41, -1
%43 = getelementptr inbounds i32, i32* %36, i64 %42
%44 = load i32, i32* %43
%45 = icmp slt i32 %44, 1
br i1 %45, label %94, label %46
46: ; preds = %40
%47 = load i32**, i32*** %37
%48 = getelementptr inbounds i32*, i32** %47, i64 %42
%49 = load i32*, i32** %48
%50 = zext i32 %44 to i64
%51 = and i64 %50, 1
%52 = icmp eq i32 %44, 1
br i1 %52, label %80, label %53
53: ; preds = %46
%54 = and i64 %50, 4294967294
br label %55
55: ; preds = %55, %53
%56 = phi i64 [ 1, %53 ], [ %77, %55 ]
%57 = phi i64 [ 0, %53 ], [ %78, %55 ]
%58 = load double, double* %20
%59 = fadd double %58, 1.000000e+00
store double %59, double* %20
%60 = add nsw i64 %56, -1
%61 = getelementptr inbounds i32, i32* %49, i64 %60
%62 = load i32, i32* %61
%63 = add nsw i32 %62, -1
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %12, i64 %64
%66 = load double, double* %65
%67 = fadd double %66, 1.000000e+00
store double %67, double* %65
%68 = load double, double* %20
%69 = fadd double %68, 1.000000e+00
store double %69, double* %20
%70 = getelementptr inbounds i32, i32* %49, i64 %56
%71 = load i32, i32* %70
%72 = add nsw i32 %71, -1
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %12, i64 %73
%75 = load double, double* %74
%76 = fadd double %75, 1.000000e+00
store double %76, double* %74
%77 = add nuw nsw i64 %56, 2
%78 = add i64 %57, 2
%79 = icmp eq i64 %78, %54
br i1 %79, label %80, label %55
80: ; preds = %55, %46
%81 = phi i64 [ 1, %46 ], [ %77, %55 ]
%82 = icmp eq i64 %51, 0
br i1 %82, label %94, label %83
83: ; preds = %80
%84 = load double, double* %20
%85 = fadd double %84, 1.000000e+00
store double %85, double* %20
%86 = add nsw i64 %81, -1
%87 = getelementptr inbounds i32, i32* %49, i64 %86
%88 = load i32, i32* %87
%89 = add nsw i32 %88, -1
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %12, i64 %90
%92 = load double, double* %91
%93 = fadd double %92, 1.000000e+00
store double %93, double* %91
br label %94
94: ; preds = %83, %80, %40
%95 = add nuw nsw i64 %41, 1
%96 = icmp eq i64 %95, %39
br i1 %96, label %97, label %40
97: ; preds = %94, %29
br i1 %21, label %102, label %98
98: ; preds = %97
%99 = getelementptr inbounds i32, i32* %6, i64 %30
%100 = load i32, i32* %99
%101 = icmp eq i32 %100, -1
br i1 %101, label %102, label %106
102: ; preds = %98, %97
%103 = getelementptr inbounds double*, double** %4, i64 %30
%104 = load double*, double** %103
%105 = tail call i32 @sample_Delta(double* %104, double* %12, i32 %1)
br label %111
106: ; preds = %98
%107 = sext i32 %100 to i64
%108 = getelementptr inbounds double*, double** %5, i64 %107
%109 = load double*, double** %108
%110 = tail call i32 @add_dst(double* %109, double* %12, i32 %1)
br label %111
111: ; preds = %102, %106
%112 = add nuw nsw i64 %27, 1
%113 = icmp eq i64 %112, %25
br i1 %113, label %114, label %26
114: ; preds = %111, %8
%115 = tail call i32 @free(double* %12)
ret void
}