void inconsistency_calculation_alt(const double *Z, double *R, int n, int d) {
  int *curNode;
  int ndid, lid, rid, i, k;
  unsigned char *lvisited, *rvisited;
  const double *Zrow;
  double *Rrow;
  double levelSum, levelStdSum;
  int levelCnt;
  const int bff = (((((double)(n)) / (double)(sizeof(unsigned char) * 8)) ==
                            ((double)(((n)) / ((sizeof(unsigned char) * 8))))
                        ? (((n)) / ((sizeof(unsigned char) * 8)))
                        : (((n)) / ((sizeof(unsigned char) * 8)) + 1)));
  k = 0;
  curNode = (int *)malloc(n * sizeof(int));
  lvisited = (unsigned char *)malloc(bff);
  rvisited = (unsigned char *)malloc(bff);
  for (i = 0; i < n - 1; i++) {
    k = 0;
    levelSum = 0.0;
    levelCnt = 0;
    levelStdSum = 0.0;
    bzero(lvisited, bff);
    bzero(rvisited, bff);
    curNode[0] = i;
    for (k = 0; k >= 0;) {
      ndid = curNode[k];
      Zrow = Z + ((ndid)*4);
      lid = (int)Zrow[0];
      rid = (int)Zrow[1];
      if (k < d - 1) {
        if (lid >= n && !(((lvisited)[(ndid) / (sizeof(unsigned char) * 8)] >>
                           (((sizeof(unsigned char) * 8) - 1) -
                            ((ndid) % (sizeof(unsigned char) * 8)))) &
                          0x1)) {
          ((lvisited)[(ndid) / (sizeof(unsigned char) * 8)] |=
           ((0x1) << (((sizeof(unsigned char) * 8) - 1) -
                      ((ndid) % (sizeof(unsigned char) * 8)))));
          k++;
          curNode[k] = lid - n;
          continue;
        }
        if (rid >= n && !(((rvisited)[(ndid) / (sizeof(unsigned char) * 8)] >>
                           (((sizeof(unsigned char) * 8) - 1) -
                            ((ndid) % (sizeof(unsigned char) * 8)))) &
                          0x1)) {
          ((rvisited)[(ndid) / (sizeof(unsigned char) * 8)] |=
           ((0x1) << (((sizeof(unsigned char) * 8) - 1) -
                      ((ndid) % (sizeof(unsigned char) * 8)))));
          k++;
          curNode[k] = rid - n;
          continue;
        }
      }
      levelCnt++;
      levelSum += Zrow[2];
      levelStdSum += Zrow[2] * Zrow[2];
      k--;
    }
    Rrow = R + (4 * i);
    Rrow[2] = (double)levelCnt;
    Rrow[0] = levelSum / levelCnt;
    if (levelCnt < 2) {
      Rrow[1] = (levelStdSum - (levelSum * levelSum)) / levelCnt;
    } else {
      Rrow[1] =
          (levelStdSum - ((levelSum * levelSum) / levelCnt)) / (levelCnt - 1);
    }
    Rrow[1] = sqrt(((0 > Rrow[1]) ? (0) : (Rrow[1])));
    if (Rrow[1] > 0) {
      Rrow[3] = (Zrow[2] - Rrow[0]) / Rrow[1];
    }
  }
  free(curNode);
  free(lvisited);
  free(rvisited);
}


x86 assembly (clang, -O0):
<inconsistency_calculation_alt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movslq -0x14(%rbp),%rax
mov    %eax,%ecx
cvtsi2sd %ecx,%xmm0
movsd  0xe95(%rip),%xmm1
divsd  %xmm1,%xmm0
shr    $0x3,%rax
cvtsi2sd %rax,%xmm1
ucomisd %xmm1,%xmm0
jne    1199 <inconsistency_calculation_alt+0x59>
jp     1199 <inconsistency_calculation_alt+0x59>
movslq -0x14(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x78(%rbp)
jmp    11a9 <inconsistency_calculation_alt+0x69>
movslq -0x14(%rbp),%rax
shr    $0x3,%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %eax,-0x70(%rbp)
movl   $0x0,-0x34(%rbp)
movslq -0x14(%rbp),%rdi
shl    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0x70(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x70(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1549 <inconsistency_calculation_alt+0x409>
movl   $0x0,-0x34(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x6c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x40(%rbp),%rdi
movslq -0x70(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x48(%rbp),%rdi
movslq -0x70(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jl     13ff <inconsistency_calculation_alt+0x2bf>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
cvttsd2si (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x50(%rbp),%rax
cvttsd2si 0x8(%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13b1 <inconsistency_calculation_alt+0x271>
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1325 <inconsistency_calculation_alt+0x1e5>
mov    -0x40(%rbp),%rax
movslq -0x24(%rbp),%rcx
shr    $0x3,%rcx
movzbl (%rax,%rcx,1),%eax
movslq -0x24(%rbp),%rdx
and    $0x7,%rdx
mov    $0x7,%ecx
sub    %rdx,%rcx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1325 <inconsistency_calculation_alt+0x1e5>
movslq -0x24(%rbp),%rcx
and    $0x7,%rcx
mov    $0x7,%eax
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x40(%rbp),%rax
movslq -0x24(%rbp),%rcx
shr    $0x3,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%edx
sub    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1246 <inconsistency_calculation_alt+0x106>
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     13ac <inconsistency_calculation_alt+0x26c>
mov    -0x48(%rbp),%rax
movslq -0x24(%rbp),%rcx
shr    $0x3,%rcx
movzbl (%rax,%rcx,1),%eax
movslq -0x24(%rbp),%rdx
and    $0x7,%rdx
mov    $0x7,%ecx
sub    %rdx,%rcx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    13ac <inconsistency_calculation_alt+0x26c>
movslq -0x24(%rbp),%rcx
and    $0x7,%rcx
mov    $0x7,%eax
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x48(%rbp),%rax
movslq -0x24(%rbp),%rcx
shr    $0x3,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%edx
sub    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1246 <inconsistency_calculation_alt+0x106>
jmp    13b1 <inconsistency_calculation_alt+0x271>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%rax
movsd  0x10(%rax),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x50(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x50(%rbp),%rax
movsd  0x10(%rax),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    1246 <inconsistency_calculation_alt+0x106>
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
cvtsi2sdl -0x6c(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x60(%rbp),%xmm0
cvtsi2sdl -0x6c(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x2,-0x6c(%rbp)
jge    148a <inconsistency_calculation_alt+0x34a>
movsd  -0x68(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x6c(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,0x8(%rax)
jmp    14bd <inconsistency_calculation_alt+0x37d>
movsd  -0x68(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
cvtsi2sdl -0x6c(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x6c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x58(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd 0x8(%rax),%xmm0
jbe    14dc <inconsistency_calculation_alt+0x39c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    14ea <inconsistency_calculation_alt+0x3aa>
mov    -0x58(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
call   1060 <sqrt@plt>
mov    -0x58(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x58(%rbp),%rax
movsd  0x8(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1536 <inconsistency_calculation_alt+0x3f6>
mov    -0x50(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x58(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x58(%rbp),%rax
divsd  0x8(%rax),%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,0x18(%rax)
jmp    153b <inconsistency_calculation_alt+0x3fb>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11e9 <inconsistency_calculation_alt+0xa9>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inconsistency_calculation_alt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %ecx,0x4(%rsp)
mov    %edx,%r12d
mov    %rsi,0x10(%rsp)
mov    %rdi,0x30(%rsp)
cvtsi2sd %edx,%xmm0
mulsd  0xe95(%rip),%xmm0
movslq %edx,%rbp
mov    %rbp,%rbx
shr    $0x3,%rbx
cvtsi2sd %rbx,%xmm1
cmpneqsd %xmm0,%xmm1
movq   %xmm1,%rax
sub    %eax,%ebx
lea    0x0(,%rbp,4),%rdi
call   1050 <malloc@plt>
mov    %rax,%r15
movslq %ebx,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %rbx,0x28(%rsp)
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
cmp    $0x2,%ebp
jl     13cd <inconsistency_calculation_alt+0x28d>
lea    -0x1(%r12),%eax
mov    %rax,0x20(%rsp)
addl   $0xffffffff,0x4(%rsp)
xor    %ebp,%ebp
jmp    11f4 <inconsistency_calculation_alt+0xb4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x18(%rsp),%rbp
add    $0x1,%rbp
cmp    0x20(%rsp),%rbp
je     13cd <inconsistency_calculation_alt+0x28d>
mov    0x8(%rsp),%rdi
xor    %esi,%esi
mov    0x28(%rsp),%rbx
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %rbp,%rax
mov    %rbp,0x18(%rsp)
mov    %ebp,(%r15)
xor    %eax,%eax
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
xor    %esi,%esi
mov    0x4(%rsp),%r10d
mov    0x30(%rsp),%r11
jmp    1263 <inconsistency_calculation_alt+0x123>
nopl   0x0(%rax,%rax,1)
lea    0x1(%r8),%eax
movsd  0x10(%r13),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm1
lea    -0x1(%rsi),%ecx
test   %esi,%esi
mov    %ecx,%esi
jle    1320 <inconsistency_calculation_alt+0x1e0>
mov    %eax,%r8d
mov    %esi,%eax
movslq (%r15,%rax,4),%rax
mov    %rax,%r13
shl    $0x5,%r13
add    %r11,%r13
jmp    129b <inconsistency_calculation_alt+0x15b>
add    0x8(%rsp),%rdi
nopl   (%rax)
or     %bpl,%bl
mov    %bl,(%rdi)
add    $0x1,%esi
sub    %r12d,%edx
mov    %edx,(%r15,%rsi,4)
movslq %edx,%r13
shl    $0x5,%r13
add    %r11,%r13
mov    %edx,%eax
cmp    %r10d,%esi
jge    1240 <inconsistency_calculation_alt+0x100>
cvttsd2si 0x0(%r13),%edx
cvttsd2si 0x8(%r13),%r9d
cltq
cmp    %r12d,%edx
jl     12da <inconsistency_calculation_alt+0x19a>
mov    %rax,%rdi
mov    %eax,%ecx
not    %cl
and    $0x7,%cl
mov    $0x1,%ebx
shl    %cl,%ebx
shr    $0x3,%rdi
mov    0x8(%rsp),%rbp
movzbl 0x0(%rbp,%rdi,1),%ebp
movzbl %cl,%ecx
bt     %ecx,%ebp
jae    1278 <inconsistency_calculation_alt+0x138>
cmp    %r12d,%r9d
jl     1240 <inconsistency_calculation_alt+0x100>
mov    %rax,%rdi
not    %al
and    $0x7,%al
mov    $0x1,%ebx
mov    %eax,%ecx
shl    %cl,%ebx
shr    $0x3,%rdi
movzbl (%r14,%rdi,1),%ebp
movzbl %al,%eax
bt     %eax,%ebp
jb     1240 <inconsistency_calculation_alt+0x100>
add    %r14,%rdi
mov    %r9d,%edx
jmp    1280 <inconsistency_calculation_alt+0x140>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x18(%rsp),%rcx
lea    0x0(,%rcx,4),%ebx
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
mov    0x10(%rsp),%rax
movsd  %xmm2,0x10(%rax,%rbx,8)
movapd %xmm0,%xmm3
divsd  %xmm2,%xmm3
movsd  %xmm3,(%rax,%rbx,8)
mulsd  %xmm0,%xmm0
test   %r8d,%r8d
je     1370 <inconsistency_calculation_alt+0x230>
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %r8d,%xmm0
divsd  %xmm0,%xmm1
jmp    1378 <inconsistency_calculation_alt+0x238>
nopw   0x0(%rax,%rax,1)
subsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
xorpd  %xmm0,%xmm0
maxsd  %xmm1,%xmm0
ucomisd 0xc80(%rip),%xmm0
jb     1390 <inconsistency_calculation_alt+0x250>
sqrtsd %xmm0,%xmm0
jmp    1395 <inconsistency_calculation_alt+0x255>
call   1060 <sqrt@plt>
mov    0x10(%rsp),%rax
movsd  %xmm0,0x8(%rax,%rbx,8)
ucomisd 0xc60(%rip),%xmm0
jbe    11e0 <inconsistency_calculation_alt+0xa0>
movsd  0x10(%r13),%xmm1
mov    0x10(%rsp),%rax
subsd  (%rax,%rbx,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rax,%rbx,8)
jmp    11e0 <inconsistency_calculation_alt+0xa0>
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @inconsistency_calculation_alt(double* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double
%20 = alloca double
%21 = alloca i32
%22 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%23 = load i32, i32* %7
%24 = sitofp i32 %23 to double
%25 = fdiv double %24, 8.000000e+00
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = udiv i64 %27, 8
%29 = uitofp i64 %28 to double
%30 = fcmp oeq double %25, %29
br i1 %30, label %31, label %35
31: ; preds = %4
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = udiv i64 %33, 8
br label %40
35: ; preds = %4
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = udiv i64 %37, 8
%39 = add i64 %38, 1
br label %40
40: ; preds = %35, %31
%41 = phi i64 [ %34, %31 ], [ %39, %35 ]
%42 = trunc i64 %41 to i32
store i32 %42, i32* %22
store i32 0, i32* %14
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = mul i64 %44, 4
%46 = call i8* @malloc(i64 %45)
%47 = bitcast i8* %46 to i32*
store i32* %47, i32** %9
%48 = load i32, i32* %22
%49 = sext i32 %48 to i64
%50 = call i8* @malloc(i64 %49)
store i8* %50, i8** %15
%51 = load i32, i32* %22
%52 = sext i32 %51 to i64
%53 = call i8* @malloc(i64 %52)
store i8* %53, i8** %16
store i32 0, i32* %13
br label %54
54: ; preds = %282, %40
%55 = load i32, i32* %13
%56 = load i32, i32* %7
%57 = sub nsw i32 %56, 1
%58 = icmp slt i32 %55, %57
br i1 %58, label %59, label %285
59: ; preds = %54
store i32 0, i32* %14
store double 0.000000e+00, double* %19
store i32 0, i32* %21
store double 0.000000e+00, double* %20
%60 = load i8*, i8** %15
%61 = load i32, i32* %22
%62 = sext i32 %61 to i64
%63 = load i8*, i8** %16
%64 = load i32, i32* %22
%65 = sext i32 %64 to i64
%66 = load i32, i32* %13
%67 = load i32*, i32** %9
%68 = getelementptr inbounds i32, i32* %67, i64 0
store i32 %66, i32* %68
store i32 0, i32* %14
br label %69
69: ; preds = %186, %160, %115, %59
%70 = load i32, i32* %14
%71 = icmp sge i32 %70, 0
br i1 %71, label %72, label %204
72: ; preds = %69
%73 = load i32*, i32** %9
%74 = load i32, i32* %14
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i32, i32* %73, i64 %75
%77 = load i32, i32* %76
store i32 %77, i32* %10
%78 = load double*, double** %5
%79 = load i32, i32* %10
%80 = mul nsw i32 %79, 4
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %78, i64 %81
store double* %82, double** %17
%83 = load double*, double** %17
%84 = getelementptr inbounds double, double* %83, i64 0
%85 = load double, double* %84
%86 = fptosi double %85 to i32
store i32 %86, i32* %11
%87 = load double*, double** %17
%88 = getelementptr inbounds double, double* %87, i64 1
%89 = load double, double* %88
%90 = fptosi double %89 to i32
store i32 %90, i32* %12
%91 = load i32, i32* %14
%92 = load i32, i32* %8
%93 = sub nsw i32 %92, 1
%94 = icmp slt i32 %91, %93
br i1 %94, label %95, label %186
95: ; preds = %72
%96 = load i32, i32* %11
%97 = load i32, i32* %7
%98 = icmp sge i32 %96, %97
br i1 %98, label %99, label %140
99: ; preds = %95
%100 = load i8*, i8** %15
%101 = load i32, i32* %10
%102 = sext i32 %101 to i64
%103 = udiv i64 %102, 8
%104 = getelementptr inbounds i8, i8* %100, i64 %103
%105 = load i8, i8* %104
%106 = zext i8 %105 to i32
%107 = load i32, i32* %10
%108 = sext i32 %107 to i64
%109 = urem i64 %108, 8
%110 = sub i64 7, %109
%111 = trunc i64 %110 to i32
%112 = ashr i32 %106, %111
%113 = and i32 %112, 1
%114 = icmp ne i32 %113, 0
br i1 %114, label %140, label %115
115: ; preds = %99
%116 = load i32, i32* %10
%117 = sext i32 %116 to i64
%118 = urem i64 %117, 8
%119 = sub i64 7, %118
%120 = trunc i64 %119 to i32
%121 = shl i32 1, %120
%122 = load i8*, i8** %15
%123 = load i32, i32* %10
%124 = sext i32 %123 to i64
%125 = udiv i64 %124, 8
%126 = getelementptr inbounds i8, i8* %122, i64 %125
%127 = load i8, i8* %126
%128 = zext i8 %127 to i32
%129 = or i32 %128, %121
%130 = trunc i32 %129 to i8
store i8 %130, i8* %126
%131 = load i32, i32* %14
%132 = add nsw i32 %131, 1
store i32 %132, i32* %14
%133 = load i32, i32* %11
%134 = load i32, i32* %7
%135 = sub nsw i32 %133, %134
%136 = load i32*, i32** %9
%137 = load i32, i32* %14
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i32, i32* %136, i64 %138
store i32 %135, i32* %139
br label %69
140: ; preds = %99, %95
%141 = load i32, i32* %12
%142 = load i32, i32* %7
%143 = icmp sge i32 %141, %142
br i1 %143, label %144, label %185
144: ; preds = %140
%145 = load i8*, i8** %16
%146 = load i32, i32* %10
%147 = sext i32 %146 to i64
%148 = udiv i64 %147, 8
%149 = getelementptr inbounds i8, i8* %145, i64 %148
%150 = load i8, i8* %149
%151 = zext i8 %150 to i32
%152 = load i32, i32* %10
%153 = sext i32 %152 to i64
%154 = urem i64 %153, 8
%155 = sub i64 7, %154
%156 = trunc i64 %155 to i32
%157 = ashr i32 %151, %156
%158 = and i32 %157, 1
%159 = icmp ne i32 %158, 0
br i1 %159, label %185, label %160
160: ; preds = %144
%161 = load i32, i32* %10
%162 = sext i32 %161 to i64
%163 = urem i64 %162, 8
%164 = sub i64 7, %163
%165 = trunc i64 %164 to i32
%166 = shl i32 1, %165
%167 = load i8*, i8** %16
%168 = load i32, i32* %10
%169 = sext i32 %168 to i64
%170 = udiv i64 %169, 8
%171 = getelementptr inbounds i8, i8* %167, i64 %170
%172 = load i8, i8* %171
%173 = zext i8 %172 to i32
%174 = or i32 %173, %166
%175 = trunc i32 %174 to i8
store i8 %175, i8* %171
%176 = load i32, i32* %14
%177 = add nsw i32 %176, 1
store i32 %177, i32* %14
%178 = load i32, i32* %12
%179 = load i32, i32* %7
%180 = sub nsw i32 %178, %179
%181 = load i32*, i32** %9
%182 = load i32, i32* %14
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i32, i32* %181, i64 %183
store i32 %180, i32* %184
br label %69
185: ; preds = %144, %140
br label %186
186: ; preds = %185, %72
%187 = load i32, i32* %21
%188 = add nsw i32 %187, 1
store i32 %188, i32* %21
%189 = load double*, double** %17
%190 = getelementptr inbounds double, double* %189, i64 2
%191 = load double, double* %190
%192 = load double, double* %19
%193 = fadd double %192, %191
store double %193, double* %19
%194 = load double*, double** %17
%195 = getelementptr inbounds double, double* %194, i64 2
%196 = load double, double* %195
%197 = load double*, double** %17
%198 = getelementptr inbounds double, double* %197, i64 2
%199 = load double, double* %198
%200 = load double, double* %20
%201 = call double @llvm.fmuladd.f64(double %196, double %199, double %200)
store double %201, double* %20
%202 = load i32, i32* %14
%203 = add nsw i32 %202, -1
store i32 %203, i32* %14
br label %69
204: ; preds = %69
%205 = load double*, double** %6
%206 = load i32, i32* %13
%207 = mul nsw i32 4, %206
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds double, double* %205, i64 %208
store double* %209, double** %18
%210 = load i32, i32* %21
%211 = sitofp i32 %210 to double
%212 = load double*, double** %18
%213 = getelementptr inbounds double, double* %212, i64 2
store double %211, double* %213
%214 = load double, double* %19
%215 = load i32, i32* %21
%216 = sitofp i32 %215 to double
%217 = fdiv double %214, %216
%218 = load double*, double** %18
%219 = getelementptr inbounds double, double* %218, i64 0
store double %217, double* %219
%220 = load i32, i32* %21
%221 = icmp slt i32 %220, 2
br i1 %221, label %222, label %233
222: ; preds = %204
%223 = load double, double* %20
%224 = load double, double* %19
%225 = load double, double* %19
%226 = fneg double %224
%227 = call double @llvm.fmuladd.f64(double %226, double %225, double %223)
%228 = load i32, i32* %21
%229 = sitofp i32 %228 to double
%230 = fdiv double %227, %229
%231 = load double*, double** %18
%232 = getelementptr inbounds double, double* %231, i64 1
store double %230, double* %232
br label %248
233: ; preds = %204
%234 = load double, double* %20
%235 = load double, double* %19
%236 = load double, double* %19
%237 = fmul double %235, %236
%238 = load i32, i32* %21
%239 = sitofp i32 %238 to double
%240 = fdiv double %237, %239
%241 = fsub double %234, %240
%242 = load i32, i32* %21
%243 = sub nsw i32 %242, 1
%244 = sitofp i32 %243 to double
%245 = fdiv double %241, %244
%246 = load double*, double** %18
%247 = getelementptr inbounds double, double* %246, i64 1
store double %245, double* %247
br label %248
248: ; preds = %233, %222
%249 = load double*, double** %18
%250 = getelementptr inbounds double, double* %249, i64 1
%251 = load double, double* %250
%252 = fcmp ogt double 0.000000e+00, %251
br i1 %252, label %253, label %254
253: ; preds = %248
br label %258
254: ; preds = %248
%255 = load double*, double** %18
%256 = getelementptr inbounds double, double* %255, i64 1
%257 = load double, double* %256
br label %258
258: ; preds = %254, %253
%259 = phi double [ 0.000000e+00, %253 ], [ %257, %254 ]
%260 = call double @sqrt(double %259)
%261 = load double*, double** %18
%262 = getelementptr inbounds double, double* %261, i64 1
store double %260, double* %262
%263 = load double*, double** %18
%264 = getelementptr inbounds double, double* %263, i64 1
%265 = load double, double* %264
%266 = fcmp ogt double %265, 0.000000e+00
br i1 %266, label %267, label %281
267: ; preds = %258
%268 = load double*, double** %17
%269 = getelementptr inbounds double, double* %268, i64 2
%270 = load double, double* %269
%271 = load double*, double** %18
%272 = getelementptr inbounds double, double* %271, i64 0
%273 = load double, double* %272
%274 = fsub double %270, %273
%275 = load double*, double** %18
%276 = getelementptr inbounds double, double* %275, i64 1
%277 = load double, double* %276
%278 = fdiv double %274, %277
%279 = load double*, double** %18
%280 = getelementptr inbounds double, double* %279, i64 3
store double %278, double* %280
br label %281
281: ; preds = %267, %258
br label %282
282: ; preds = %281
%283 = load i32, i32* %13
%284 = add nsw i32 %283, 1
store i32 %284, i32* %13
br label %54
285: ; preds = %54
%286 = load i32*, i32** %9
%287 = bitcast i32* %286 to i8*
%288 = load i8*, i8** %15
%289 = load i8*, i8** %16
ret void
}

LLVM IR (-O2):
define void @inconsistency_calculation_alt(double* nocapture %0, double* nocapture %1, i32 %2, i32 %3) {
%5 = sitofp i32 %2 to double
%6 = fmul double %5, 1.250000e-01
%7 = sext i32 %2 to i64
%8 = lshr i64 %7, 3
%9 = uitofp i64 %8 to double
%10 = fcmp une double %6, %9
%11 = zext i1 %10 to i64
%12 = add nuw nsw i64 %8, %11
%13 = shl nsw i64 %7, 2
%14 = tail call i8* @malloc(i64 %13)
%15 = bitcast i8* %14 to i32*
%16 = shl i64 %12, 32
%17 = ashr exact i64 %16, 32
%18 = tail call i8* @malloc(i64 %17)
%19 = tail call i8* @malloc(i64 %17)
%20 = icmp sgt i32 %2, 1
br i1 %20, label %21, label %137
21: ; preds = %4
%22 = add nsw i32 %2, -1
%23 = add nsw i32 %3, -1
%24 = zext i32 %22 to i64
br label %25
25: ; preds = %21, %134
%26 = phi i64 [ 0, %21 ], [ %135, %134 ]
tail call void @llvm.memset.p0i8.i64(i8* align 1 %18, i8 0, i64 %17, i1 false)
tail call void @llvm.memset.p0i8.i64(i8* align 1 %19, i8 0, i64 %17, i1 false)
%27 = trunc i64 %26 to i32
store i32 %27, i32* %15
br label %28
28: ; preds = %25, %92
%29 = phi i32 [ 0, %25 ], [ %95, %92 ]
%30 = phi double [ 0.000000e+00, %25 ], [ %99, %92 ]
%31 = phi double [ 0.000000e+00, %25 ], [ %98, %92 ]
%32 = phi i32 [ 0, %25 ], [ %100, %92 ]
%33 = zext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %15, i64 %33
%35 = load i32, i32* %34
%36 = shl nsw i32 %35, 2
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %0, i64 %37
%39 = icmp slt i32 %32, %23
br i1 %39, label %40, label %92
40: ; preds = %28, %61
%41 = phi double* [ %77, %61 ], [ %38, %28 ]
%42 = phi i32 [ %74, %61 ], [ %35, %28 ]
%43 = phi i32 [ %68, %61 ], [ %32, %28 ]
%44 = load double, double* %41
%45 = fptosi double %44 to i32
%46 = getelementptr inbounds double, double* %41, i64 1
%47 = load double, double* %46
%48 = fptosi double %47 to i32
%49 = icmp slt i32 %45, %2
br i1 %49, label %79, label %50
50: ; preds = %40
%51 = sext i32 %42 to i64
%52 = lshr i64 %51, 3
%53 = getelementptr inbounds i8, i8* %18, i64 %52
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = and i32 %42, 7
%57 = xor i32 %56, 7
%58 = shl nuw i32 1, %57
%59 = and i32 %58, %55
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %79
61: ; preds = %50, %81
%62 = phi i32 [ %89, %81 ], [ %58, %50 ]
%63 = phi i8 [ %85, %81 ], [ %54, %50 ]
%64 = phi i8* [ %84, %81 ], [ %53, %50 ]
%65 = phi i32 [ %48, %81 ], [ %45, %50 ]
%66 = trunc i32 %62 to i8
%67 = or i8 %63, %66
store i8 %67, i8* %64
%68 = add nuw nsw i32 %43, 1
%69 = sub nsw i32 %65, %2
%70 = zext i32 %68 to i64
%71 = getelementptr inbounds i32, i32* %15, i64 %70
store i32 %69, i32* %71
%72 = zext i32 %68 to i64
%73 = getelementptr inbounds i32, i32* %15, i64 %72
%74 = load i32, i32* %73
%75 = shl nsw i32 %74, 2
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %0, i64 %76
%78 = icmp slt i32 %68, %23
br i1 %78, label %40, label %92
79: ; preds = %50, %40
%80 = icmp slt i32 %48, %2
br i1 %80, label %92, label %81
81: ; preds = %79
%82 = sext i32 %42 to i64
%83 = lshr i64 %82, 3
%84 = getelementptr inbounds i8, i8* %19, i64 %83
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = and i32 %42, 7
%88 = xor i32 %87, 7
%89 = shl nuw i32 1, %88
%90 = and i32 %89, %86
%91 = icmp eq i32 %90, 0
br i1 %91, label %61, label %92
92: ; preds = %61, %81, %79, %28
%93 = phi i32 [ %32, %28 ], [ %68, %61 ], [ %43, %81 ], [ %43, %79 ]
%94 = phi double* [ %38, %28 ], [ %77, %61 ], [ %41, %81 ], [ %41, %79 ]
%95 = add nuw nsw i32 %29, 1
%96 = getelementptr inbounds double, double* %94, i64 2
%97 = load double, double* %96
%98 = fadd double %31, %97
%99 = tail call double @llvm.fmuladd.f64(double %97, double %97, double %30)
%100 = add nsw i32 %93, -1
%101 = icmp sgt i32 %93, 0
br i1 %101, label %28, label %102
102: ; preds = %92
%103 = shl i64 %26, 2
%104 = and i64 %103, 4294967292
%105 = getelementptr inbounds double, double* %1, i64 %104
%106 = sitofp i32 %95 to double
%107 = getelementptr inbounds double, double* %105, i64 2
store double %106, double* %107
%108 = fdiv double %98, %106
store double %108, double* %105
%109 = icmp eq i32 %29, 0
br i1 %109, label %110, label %114
110: ; preds = %102
%111 = fneg double %98
%112 = tail call double @llvm.fmuladd.f64(double %111, double %98, double %99)
%113 = fdiv double %112, %106
br label %120
114: ; preds = %102
%115 = fmul double %98, %98
%116 = fdiv double %115, %106
%117 = fsub double %99, %116
%118 = sitofp i32 %29 to double
%119 = fdiv double %117, %118
br label %120
120: ; preds = %114, %110
%121 = phi double [ %113, %110 ], [ %119, %114 ]
%122 = getelementptr inbounds double, double* %105, i64 1
%123 = fcmp olt double %121, 0.000000e+00
%124 = select i1 %123, double 0.000000e+00, double %121
%125 = tail call double @sqrt(double %124)
store double %125, double* %122
%126 = fcmp ogt double %125, 0.000000e+00
br i1 %126, label %127, label %134
127: ; preds = %120
%128 = getelementptr inbounds double, double* %94, i64 2
%129 = load double, double* %128
%130 = load double, double* %105
%131 = fsub double %129, %130
%132 = fdiv double %131, %125
%133 = getelementptr inbounds double, double* %105, i64 3
store double %132, double* %133
br label %134
134: ; preds = %120, %127
%135 = add nuw nsw i64 %26, 1
%136 = icmp eq i64 %135, %24
br i1 %136, label %137, label %25
137: ; preds = %134, %4
tail call void @free(i8* %14)
tail call void @free(i8* %18)
tail call void @free(i8* %19)
ret void
}