int find_probabilities(double Pi[], double p[], double delta) {
  int k, l, m, k1, l1, m1, steps = 0;
  double p1[4], Epi[4], delta2, s[3], dist, dist1;
  s[0] = -0.5;
  s[1] = 0.0;
  s[2] = 0.5;
  delta2 = delta * delta;
  p[0] = Pi[0];
  p[2] = Pi[2];
  p[3] = Pi[3];
  p[1] = Pi[1] = 1.0 - p[0] - p[2] - p[3];
  Epi[0] = p[0] * (1.0 - 2.0 * p[3] * (p[0] + p[2]) / 3.0) /
           (1.0 - p[0] * p[3] * (p[0] + 2.0 * p[2]));
  Epi[2] = p[2] * (1.0 - 2.0 * p[3] * p[0] / 3.0) /
           (1.0 - p[0] * p[3] * (p[0] + 2.0 * p[2]));
  Epi[3] = p[3] * (1.0 - p[0] * (p[0] + 2.0 * p[2]) / 3.0) /
           (1.0 - p[0] * p[3] * (p[0] + 2.0 * p[2]));
  dist = (Epi[0] - Pi[0]) * (Epi[0] - Pi[0]);
  dist += (Epi[2] - Pi[2]) * (Epi[2] - Pi[2]);
  dist += (Epi[3] - Pi[3]) * (Epi[3] - Pi[3]);
  do {
    k1 = 1;
    l1 = 1;
    m1 = 1;
    for (k = 0; k < 3; ++k)
      for (l = 0; l < 3; ++l)
        for (m = 0; m < 3; ++m) {
          p1[0] = p[0] + s[k] * delta;
          p1[2] = p[2] + s[l] * delta;
          p1[3] = p[3] + s[m] * delta;
          if (p1[0] >= 0.0 && p1[2] >= 0.0 && p1[3] >= 0.0 &&
              p1[0] + p1[2] + p1[3] <= 1.0) {
            Epi[0] = p1[0] * (1.0 - 2.0 * p1[3] * (p1[0] + p1[2]) / 3.0) /
                     (1.0 - p1[0] * p1[3] * (p1[0] + 2.0 * p1[2]));
            Epi[2] = p1[2] * (1.0 - 2.0 * p1[3] * p1[0] / 3.0) /
                     (1.0 - p1[0] * p1[3] * (p1[0] + 2.0 * p1[2]));
            Epi[3] = p1[3] * (1.0 - p1[0] * (p1[0] + 2.0 * p1[2]) / 3.0) /
                     (1.0 - p1[0] * p1[3] * (p1[0] + 2.0 * p1[2]));
            dist1 = (Epi[0] - Pi[0]) * (Epi[0] - Pi[0]);
            dist1 += (Epi[2] - Pi[2]) * (Epi[2] - Pi[2]);
            dist1 += (Epi[3] - Pi[3]) * (Epi[3] - Pi[3]);
            if (dist1 < dist) {
              dist = dist1;
              k1 = k;
              l1 = l;
              m1 = m;
            }
          }
        }
    p[0] += s[k1] * delta;
    p[2] += s[l1] * delta;
    p[3] += s[m1] * delta;
    ++steps;
  } while (dist >= delta2);
  p[1] = 1.0 - p[0] - p[2] - p[3];
  Epi[1] = 1.0 - Epi[0] - Epi[2] - Epi[3];
  return (steps);
}


x86 assembly (clang, -O0):
<find_probabilities>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
movsd  0xefc(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe67(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0xe3b(%rip),%xmm2
mulsd  0x18(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm1
mulsd  %xmm1,%xmm2
movsd  0xe11(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xdfd(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xda8(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0xd96(%rip),%xmm2
mulsd  0x18(%rax),%xmm2
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm2
movsd  0xd79(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xd65(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xd10(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm2
movsd  0xcd5(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xcc1(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xc6c(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x80(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  -0x80(%rbp),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  -0x70(%rbp),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm2
movsd  -0xa8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x18(%rax),%xmm0
movsd  -0x68(%rbp),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x18(%rax),%xmm2
movsd  -0xa8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movl   $0x1,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    17dc <find_probabilities+0x6dc>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    17c9 <find_probabilities+0x6c9>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    17b6 <find_probabilities+0x6b6>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movslq -0x1c(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
movslq -0x20(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
movslq -0x24(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     17a3 <find_probabilities+0x6a3>
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     17a3 <find_probabilities+0x6a3>
movsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     17a3 <find_probabilities+0x6a3>
movsd  -0x60(%rbp),%xmm1
addsd  -0x50(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
movsd  0xac5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     17a3 <find_probabilities+0x6a3>
movsd  -0x60(%rbp),%xmm0
movsd  0xabe(%rip),%xmm2
mulsd  -0x48(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
addsd  -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm2
movsd  0xa9b(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xa87(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xa40(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xa36(%rip),%xmm2
mulsd  -0x48(%rbp),%xmm2
mulsd  -0x60(%rbp),%xmm2
movsd  0xa1c(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xa08(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0x9c1(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm2
movsd  0x994(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0x980(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0x939(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x80(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  -0x80(%rbp),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  -0x70(%rbp),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm2
movsd  -0xb0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x18(%rax),%xmm0
movsd  -0x68(%rbp),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x18(%rax),%xmm2
movsd  -0xb0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    179e <find_probabilities+0x69e>
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    17a3 <find_probabilities+0x6a3>
jmp    17a8 <find_probabilities+0x6a8>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    146d <find_probabilities+0x36d>
jmp    17bb <find_probabilities+0x6bb>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    145c <find_probabilities+0x35c>
jmp    17ce <find_probabilities+0x6ce>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    144b <find_probabilities+0x34b>
movslq -0x28(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x18(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movslq -0x2c(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x18(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
movslq -0x30(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x18(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd -0x88(%rbp),%xmm0
ff
jae    142f <find_probabilities+0x32f>
mov    -0x10(%rbp),%rax
movsd  0x783(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  0x75c(%rip),%xmm0
subsd  -0x80(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x34(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_probabilities>:
push   %r14
push   %rbx
movsd  0xef5(%rip),%xmm1
movaps %xmm1,-0x58(%rsp)
movabs $0x3fe0000000000000,%rax
mov    %rax,-0x48(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,-0x28(%rsp)
movsd  (%rdi),%xmm1
movsd  %xmm1,(%rsi)
movsd  0x10(%rdi),%xmm2
movsd  %xmm2,0x10(%rsi)
movsd  0x18(%rdi),%xmm5
movsd  %xmm5,0x18(%rsi)
movsd  0xeb7(%rip),%xmm3
movapd %xmm3,%xmm4
subsd  %xmm1,%xmm4
subsd  %xmm2,%xmm4
subsd  %xmm5,%xmm4
movsd  %xmm4,0x8(%rdi)
movsd  %xmm4,0x8(%rsi)
movsd  (%rsi),%xmm7
movupd 0x10(%rsi),%xmm6
movapd %xmm6,%xmm2
unpckhpd %xmm6,%xmm2
movsd  0xe8b(%rip),%xmm8
movapd %xmm6,%xmm1
addsd  %xmm6,%xmm1
addsd  %xmm7,%xmm1
movapd %xmm2,%xmm5
mulsd  %xmm7,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm7,%xmm1
divsd  %xmm8,%xmm1
movapd %xmm3,%xmm11
subsd  %xmm1,%xmm11
mulsd  %xmm2,%xmm11
addsd  %xmm2,%xmm2
movapd %xmm7,%xmm1
addsd  %xmm6,%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm8,%xmm1
movapd %xmm3,%xmm4
subsd  %xmm1,%xmm4
mulsd  %xmm7,%xmm4
movapd %xmm3,%xmm1
subsd  %xmm5,%xmm1
divsd  %xmm1,%xmm4
movsd  %xmm7,-0x60(%rsp)
mulsd  %xmm7,%xmm2
divsd  %xmm8,%xmm2
movapd %xmm3,%xmm5
subsd  %xmm2,%xmm5
mulsd  %xmm6,%xmm5
divsd  %xmm1,%xmm5
divsd  %xmm1,%xmm11
subsd  (%rdi),%xmm4
subsd  0x10(%rdi),%xmm5
mulsd  %xmm4,%xmm4
mulsd  %xmm5,%xmm5
subsd  0x18(%rdi),%xmm11
addsd  %xmm4,%xmm5
mulsd  %xmm11,%xmm11
addsd  %xmm5,%xmm11
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
movapd %xmm1,-0x38(%rsp)
xor    %eax,%eax
xorpd  %xmm7,%xmm7
jmp    12a2 <find_probabilities+0x1a2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %r10d,%rcx
movsd  -0x58(%rsp,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  -0x60(%rsp),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,-0x60(%rsp)
movsd  %xmm2,(%rsi)
movslq %r9d,%rcx
movslq %r8d,%rdx
movsd  -0x58(%rsp,%rcx,8),%xmm1
movhpd -0x58(%rsp,%rdx,8),%xmm1
mulpd  -0x38(%rsp),%xmm1
addpd  %xmm1,%xmm6
movupd %xmm6,0x10(%rsi)
add    $0x1,%eax
ucomisd -0x28(%rsp),%xmm11
jb     1463 <find_probabilities+0x363>
movapd %xmm6,%xmm14
unpckhpd %xmm6,%xmm14
mov    $0x1,%r10d
xor    %r11d,%r11d
mov    $0x1,%r9d
mov    $0x1,%r8d
movapd %xmm6,-0x18(%rsp)
jmp    12de <find_probabilities+0x1de>
nopl   0x0(%rax)
add    $0x1,%r11
cmp    $0x3,%r11
je     1250 <find_probabilities+0x150>
movsd  -0x58(%rsp,%r11,8),%xmm9
mulsd  %xmm0,%xmm9
addsd  -0x60(%rsp),%xmm9
movapd %xmm9,%xmm15
xorpd  0xd21(%rip),%xmm15
xor    %r14d,%r14d
jmp    1320 <find_probabilities+0x220>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r14
cmp    $0x3,%r14
movapd -0x18(%rsp),%xmm6
je     12d0 <find_probabilities+0x1d0>
ucomisd %xmm7,%xmm9
setb   %bl
movsd  -0x58(%rsp,%r14,8),%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm6,%xmm5
ucomisd %xmm7,%xmm5
setb   %cl
or     %bl,%cl
movapd %xmm9,%xmm4
addsd  %xmm5,%xmm4
movapd %xmm5,%xmm8
addsd  %xmm5,%xmm8
addsd  %xmm9,%xmm8
movapd %xmm9,%xmm13
mulsd  %xmm8,%xmm13
divsd  0xcad(%rip),%xmm13
addsd  %xmm3,%xmm13
xor    %ebx,%ebx
jmp    138a <find_probabilities+0x28a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    $0x3,%rbx
je     1310 <find_probabilities+0x210>
movsd  -0x58(%rsp,%rbx,8),%xmm6
mulsd  %xmm0,%xmm6
addsd  %xmm14,%xmm6
ucomisd %xmm7,%xmm6
setb   %dl
or     %cl,%dl
jne    1380 <find_probabilities+0x280>
movapd %xmm4,%xmm1
addsd  %xmm6,%xmm1
ucomisd %xmm1,%xmm3
jb     1380 <find_probabilities+0x280>
movapd %xmm6,%xmm12
addsd  %xmm6,%xmm12
movapd %xmm4,%xmm2
mulsd  %xmm12,%xmm2
movsd  0xc43(%rip),%xmm7
divsd  %xmm7,%xmm2
movapd %xmm3,%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm9,%xmm1
movapd %xmm6,%xmm2
mulsd  %xmm15,%xmm2
mulsd  %xmm8,%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm9,%xmm12
divsd  %xmm7,%xmm12
xorpd  %xmm7,%xmm7
movapd %xmm3,%xmm10
subsd  %xmm12,%xmm10
mulsd  %xmm5,%xmm10
divsd  %xmm2,%xmm10
mulsd  %xmm13,%xmm6
subsd  (%rdi),%xmm1
divsd  %xmm2,%xmm6
mulsd  %xmm1,%xmm1
subsd  0x10(%rdi),%xmm10
mulsd  %xmm10,%xmm10
addsd  %xmm1,%xmm10
subsd  0x18(%rdi),%xmm6
mulsd  %xmm6,%xmm6
addsd  %xmm10,%xmm6
ucomisd %xmm6,%xmm11
jbe    1380 <find_probabilities+0x280>
mov    %ebx,%r8d
mov    %r14d,%r9d
mov    %r11d,%r10d
movapd %xmm6,%xmm11
jmp    1380 <find_probabilities+0x280>
subsd  -0x60(%rsp),%xmm3
subsd  %xmm6,%xmm3
unpckhpd %xmm6,%xmm6
subsd  %xmm6,%xmm3
movsd  %xmm3,0x8(%rsi)
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @find_probabilities(double* %0, double* %1, double %2) {
%4 = alloca double*
%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 [4 x double]
%15 = alloca [4 x double]
%16 = alloca double
%17 = alloca [3 x double]
%18 = alloca double
%19 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double %2, double* %6
store i32 0, i32* %13
%20 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 0
store double -5.000000e-01, double* %20
%21 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 1
store double 0.000000e+00, double* %21
%22 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 2
store double 5.000000e-01, double* %22
%23 = load double, double* %6
%24 = load double, double* %6
%25 = fmul double %23, %24
store double %25, double* %16
%26 = load double*, double** %4
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = load double*, double** %5
%30 = getelementptr inbounds double, double* %29, i64 0
store double %28, double* %30
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 2
%33 = load double, double* %32
%34 = load double*, double** %5
%35 = getelementptr inbounds double, double* %34, i64 2
store double %33, double* %35
%36 = load double*, double** %4
%37 = getelementptr inbounds double, double* %36, i64 3
%38 = load double, double* %37
%39 = load double*, double** %5
%40 = getelementptr inbounds double, double* %39, i64 3
store double %38, double* %40
%41 = load double*, double** %5
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = fsub double 1.000000e+00, %43
%45 = load double*, double** %5
%46 = getelementptr inbounds double, double* %45, i64 2
%47 = load double, double* %46
%48 = fsub double %44, %47
%49 = load double*, double** %5
%50 = getelementptr inbounds double, double* %49, i64 3
%51 = load double, double* %50
%52 = fsub double %48, %51
%53 = load double*, double** %4
%54 = getelementptr inbounds double, double* %53, i64 1
store double %52, double* %54
%55 = load double*, double** %5
%56 = getelementptr inbounds double, double* %55, i64 1
store double %52, double* %56
%57 = load double*, double** %5
%58 = getelementptr inbounds double, double* %57, i64 0
%59 = load double, double* %58
%60 = load double*, double** %5
%61 = getelementptr inbounds double, double* %60, i64 3
%62 = load double, double* %61
%63 = fmul double 2.000000e+00, %62
%64 = load double*, double** %5
%65 = getelementptr inbounds double, double* %64, i64 0
%66 = load double, double* %65
%67 = load double*, double** %5
%68 = getelementptr inbounds double, double* %67, i64 2
%69 = load double, double* %68
%70 = fadd double %66, %69
%71 = fmul double %63, %70
%72 = fdiv double %71, 3.000000e+00
%73 = fsub double 1.000000e+00, %72
%74 = fmul double %59, %73
%75 = load double*, double** %5
%76 = getelementptr inbounds double, double* %75, i64 0
%77 = load double, double* %76
%78 = load double*, double** %5
%79 = getelementptr inbounds double, double* %78, i64 3
%80 = load double, double* %79
%81 = fmul double %77, %80
%82 = load double*, double** %5
%83 = getelementptr inbounds double, double* %82, i64 0
%84 = load double, double* %83
%85 = load double*, double** %5
%86 = getelementptr inbounds double, double* %85, i64 2
%87 = load double, double* %86
%88 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %87, double %84)
%89 = fneg double %81
%90 = call double @llvm.fmuladd.f64(double %89, double %88, double 1.000000e+00)
%91 = fdiv double %74, %90
%92 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
store double %91, double* %92
%93 = load double*, double** %5
%94 = getelementptr inbounds double, double* %93, i64 2
%95 = load double, double* %94
%96 = load double*, double** %5
%97 = getelementptr inbounds double, double* %96, i64 3
%98 = load double, double* %97
%99 = fmul double 2.000000e+00, %98
%100 = load double*, double** %5
%101 = getelementptr inbounds double, double* %100, i64 0
%102 = load double, double* %101
%103 = fmul double %99, %102
%104 = fdiv double %103, 3.000000e+00
%105 = fsub double 1.000000e+00, %104
%106 = fmul double %95, %105
%107 = load double*, double** %5
%108 = getelementptr inbounds double, double* %107, i64 0
%109 = load double, double* %108
%110 = load double*, double** %5
%111 = getelementptr inbounds double, double* %110, i64 3
%112 = load double, double* %111
%113 = fmul double %109, %112
%114 = load double*, double** %5
%115 = getelementptr inbounds double, double* %114, i64 0
%116 = load double, double* %115
%117 = load double*, double** %5
%118 = getelementptr inbounds double, double* %117, i64 2
%119 = load double, double* %118
%120 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %119, double %116)
%121 = fneg double %113
%122 = call double @llvm.fmuladd.f64(double %121, double %120, double 1.000000e+00)
%123 = fdiv double %106, %122
%124 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
store double %123, double* %124
%125 = load double*, double** %5
%126 = getelementptr inbounds double, double* %125, i64 3
%127 = load double, double* %126
%128 = load double*, double** %5
%129 = getelementptr inbounds double, double* %128, i64 0
%130 = load double, double* %129
%131 = load double*, double** %5
%132 = getelementptr inbounds double, double* %131, i64 0
%133 = load double, double* %132
%134 = load double*, double** %5
%135 = getelementptr inbounds double, double* %134, i64 2
%136 = load double, double* %135
%137 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %136, double %133)
%138 = fmul double %130, %137
%139 = fdiv double %138, 3.000000e+00
%140 = fsub double 1.000000e+00, %139
%141 = fmul double %127, %140
%142 = load double*, double** %5
%143 = getelementptr inbounds double, double* %142, i64 0
%144 = load double, double* %143
%145 = load double*, double** %5
%146 = getelementptr inbounds double, double* %145, i64 3
%147 = load double, double* %146
%148 = fmul double %144, %147
%149 = load double*, double** %5
%150 = getelementptr inbounds double, double* %149, i64 0
%151 = load double, double* %150
%152 = load double*, double** %5
%153 = getelementptr inbounds double, double* %152, i64 2
%154 = load double, double* %153
%155 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %154, double %151)
%156 = fneg double %148
%157 = call double @llvm.fmuladd.f64(double %156, double %155, double 1.000000e+00)
%158 = fdiv double %141, %157
%159 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
store double %158, double* %159
%160 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%161 = load double, double* %160
%162 = load double*, double** %4
%163 = getelementptr inbounds double, double* %162, i64 0
%164 = load double, double* %163
%165 = fsub double %161, %164
%166 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%167 = load double, double* %166
%168 = load double*, double** %4
%169 = getelementptr inbounds double, double* %168, i64 0
%170 = load double, double* %169
%171 = fsub double %167, %170
%172 = fmul double %165, %171
store double %172, double* %18
%173 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
%174 = load double, double* %173
%175 = load double*, double** %4
%176 = getelementptr inbounds double, double* %175, i64 2
%177 = load double, double* %176
%178 = fsub double %174, %177
%179 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
%180 = load double, double* %179
%181 = load double*, double** %4
%182 = getelementptr inbounds double, double* %181, i64 2
%183 = load double, double* %182
%184 = fsub double %180, %183
%185 = load double, double* %18
%186 = call double @llvm.fmuladd.f64(double %178, double %184, double %185)
store double %186, double* %18
%187 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
%188 = load double, double* %187
%189 = load double*, double** %4
%190 = getelementptr inbounds double, double* %189, i64 3
%191 = load double, double* %190
%192 = fsub double %188, %191
%193 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
%194 = load double, double* %193
%195 = load double*, double** %4
%196 = getelementptr inbounds double, double* %195, i64 3
%197 = load double, double* %196
%198 = fsub double %194, %197
%199 = load double, double* %18
%200 = call double @llvm.fmuladd.f64(double %192, double %198, double %199)
store double %200, double* %18
br label %201
201: ; preds = %438, %3
store i32 1, i32* %10
store i32 1, i32* %11
store i32 1, i32* %12
store i32 0, i32* %7
br label %202
202: ; preds = %405, %201
%203 = load i32, i32* %7
%204 = icmp slt i32 %203, 3
br i1 %204, label %205, label %408
205: ; preds = %202
store i32 0, i32* %8
br label %206
206: ; preds = %401, %205
%207 = load i32, i32* %8
%208 = icmp slt i32 %207, 3
br i1 %208, label %209, label %404
209: ; preds = %206
store i32 0, i32* %9
br label %210
210: ; preds = %397, %209
%211 = load i32, i32* %9
%212 = icmp slt i32 %211, 3
br i1 %212, label %213, label %400
213: ; preds = %210
%214 = load double*, double** %5
%215 = getelementptr inbounds double, double* %214, i64 0
%216 = load double, double* %215
%217 = load i32, i32* %7
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 %218
%220 = load double, double* %219
%221 = load double, double* %6
%222 = call double @llvm.fmuladd.f64(double %220, double %221, double %216)
%223 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
store double %222, double* %223
%224 = load double*, double** %5
%225 = getelementptr inbounds double, double* %224, i64 2
%226 = load double, double* %225
%227 = load i32, i32* %8
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 %228
%230 = load double, double* %229
%231 = load double, double* %6
%232 = call double @llvm.fmuladd.f64(double %230, double %231, double %226)
%233 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 2
store double %232, double* %233
%234 = load double*, double** %5
%235 = getelementptr inbounds double, double* %234, i64 3
%236 = load double, double* %235
%237 = load i32, i32* %9
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 %238
%240 = load double, double* %239
%241 = load double, double* %6
%242 = call double @llvm.fmuladd.f64(double %240, double %241, double %236)
%243 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 3
store double %242, double* %243
%244 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%245 = load double, double* %244
%246 = fcmp oge double %245, 0.000000e+00
br i1 %246, label %247, label %396
247: ; preds = %213
%248 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 2
%249 = load double, double* %248
%250 = fcmp oge double %249, 0.000000e+00
br i1 %250, label %251, label %396
251: ; preds = %247
%252 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 3
%253 = load double, double* %252
%254 = fcmp oge double %253, 0.000000e+00
br i1 %254, label %255, label %396
255: ; preds = %251
%256 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%257 = load double, double* %256
%258 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 2
%259 = load double, double* %258
%260 = fadd double %257, %259
%261 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 3
%262 = load double, double* %261
%263 = fadd double %260, %262
%264 = fcmp ole double %263, 1.000000e+00
br i1 %264, label %265, label %396
265: ; preds = %255
%266 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%267 = load double, double* %266
%268 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 3
%269 = load double, double* %268
%270 = fmul double 2.000000e+00, %269
%271 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%272 = load double, double* %271
%273 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 2
%274 = load double, double* %273
%275 = fadd double %272, %274
%276 = fmul double %270, %275
%277 = fdiv double %276, 3.000000e+00
%278 = fsub double 1.000000e+00, %277
%279 = fmul double %267, %278
%280 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%281 = load double, double* %280
%282 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 3
%283 = load double, double* %282
%284 = fmul double %281, %283
%285 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%286 = load double, double* %285
%287 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 2
%288 = load double, double* %287
%289 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %288, double %286)
%290 = fneg double %284
%291 = call double @llvm.fmuladd.f64(double %290, double %289, double 1.000000e+00)
%292 = fdiv double %279, %291
%293 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
store double %292, double* %293
%294 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 2
%295 = load double, double* %294
%296 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 3
%297 = load double, double* %296
%298 = fmul double 2.000000e+00, %297
%299 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%300 = load double, double* %299
%301 = fmul double %298, %300
%302 = fdiv double %301, 3.000000e+00
%303 = fsub double 1.000000e+00, %302
%304 = fmul double %295, %303
%305 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%306 = load double, double* %305
%307 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 3
%308 = load double, double* %307
%309 = fmul double %306, %308
%310 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%311 = load double, double* %310
%312 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 2
%313 = load double, double* %312
%314 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %313, double %311)
%315 = fneg double %309
%316 = call double @llvm.fmuladd.f64(double %315, double %314, double 1.000000e+00)
%317 = fdiv double %304, %316
%318 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
store double %317, double* %318
%319 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 3
%320 = load double, double* %319
%321 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%322 = load double, double* %321
%323 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%324 = load double, double* %323
%325 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 2
%326 = load double, double* %325
%327 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %326, double %324)
%328 = fmul double %322, %327
%329 = fdiv double %328, 3.000000e+00
%330 = fsub double 1.000000e+00, %329
%331 = fmul double %320, %330
%332 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%333 = load double, double* %332
%334 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 3
%335 = load double, double* %334
%336 = fmul double %333, %335
%337 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%338 = load double, double* %337
%339 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 2
%340 = load double, double* %339
%341 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %340, double %338)
%342 = fneg double %336
%343 = call double @llvm.fmuladd.f64(double %342, double %341, double 1.000000e+00)
%344 = fdiv double %331, %343
%345 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
store double %344, double* %345
%346 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%347 = load double, double* %346
%348 = load double*, double** %4
%349 = getelementptr inbounds double, double* %348, i64 0
%350 = load double, double* %349
%351 = fsub double %347, %350
%352 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%353 = load double, double* %352
%354 = load double*, double** %4
%355 = getelementptr inbounds double, double* %354, i64 0
%356 = load double, double* %355
%357 = fsub double %353, %356
%358 = fmul double %351, %357
store double %358, double* %19
%359 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
%360 = load double, double* %359
%361 = load double*, double** %4
%362 = getelementptr inbounds double, double* %361, i64 2
%363 = load double, double* %362
%364 = fsub double %360, %363
%365 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
%366 = load double, double* %365
%367 = load double*, double** %4
%368 = getelementptr inbounds double, double* %367, i64 2
%369 = load double, double* %368
%370 = fsub double %366, %369
%371 = load double, double* %19
%372 = call double @llvm.fmuladd.f64(double %364, double %370, double %371)
store double %372, double* %19
%373 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
%374 = load double, double* %373
%375 = load double*, double** %4
%376 = getelementptr inbounds double, double* %375, i64 3
%377 = load double, double* %376
%378 = fsub double %374, %377
%379 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
%380 = load double, double* %379
%381 = load double*, double** %4
%382 = getelementptr inbounds double, double* %381, i64 3
%383 = load double, double* %382
%384 = fsub double %380, %383
%385 = load double, double* %19
%386 = call double @llvm.fmuladd.f64(double %378, double %384, double %385)
store double %386, double* %19
%387 = load double, double* %19
%388 = load double, double* %18
%389 = fcmp olt double %387, %388
br i1 %389, label %390, label %395
390: ; preds = %265
%391 = load double, double* %19
store double %391, double* %18
%392 = load i32, i32* %7
store i32 %392, i32* %10
%393 = load i32, i32* %8
store i32 %393, i32* %11
%394 = load i32, i32* %9
store i32 %394, i32* %12
br label %395
395: ; preds = %390, %265
br label %396
396: ; preds = %395, %255, %251, %247, %213
br label %397
397: ; preds = %396
%398 = load i32, i32* %9
%399 = add nsw i32 %398, 1
store i32 %399, i32* %9
br label %210
400: ; preds = %210
br label %401
401: ; preds = %400
%402 = load i32, i32* %8
%403 = add nsw i32 %402, 1
store i32 %403, i32* %8
br label %206
404: ; preds = %206
br label %405
405: ; preds = %404
%406 = load i32, i32* %7
%407 = add nsw i32 %406, 1
store i32 %407, i32* %7
br label %202
408: ; preds = %202
%409 = load i32, i32* %10
%410 = sext i32 %409 to i64
%411 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 %410
%412 = load double, double* %411
%413 = load double, double* %6
%414 = load double*, double** %5
%415 = getelementptr inbounds double, double* %414, i64 0
%416 = load double, double* %415
%417 = call double @llvm.fmuladd.f64(double %412, double %413, double %416)
store double %417, double* %415
%418 = load i32, i32* %11
%419 = sext i32 %418 to i64
%420 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 %419
%421 = load double, double* %420
%422 = load double, double* %6
%423 = load double*, double** %5
%424 = getelementptr inbounds double, double* %423, i64 2
%425 = load double, double* %424
%426 = call double @llvm.fmuladd.f64(double %421, double %422, double %425)
store double %426, double* %424
%427 = load i32, i32* %12
%428 = sext i32 %427 to i64
%429 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 %428
%430 = load double, double* %429
%431 = load double, double* %6
%432 = load double*, double** %5
%433 = getelementptr inbounds double, double* %432, i64 3
%434 = load double, double* %433
%435 = call double @llvm.fmuladd.f64(double %430, double %431, double %434)
store double %435, double* %433
%436 = load i32, i32* %13
%437 = add nsw i32 %436, 1
store i32 %437, i32* %13
br label %438
438: ; preds = %408
%439 = load double, double* %18
%440 = load double, double* %16
%441 = fcmp oge double %439, %440
br i1 %441, label %201, label %442
442: ; preds = %438
%443 = load double*, double** %5
%444 = getelementptr inbounds double, double* %443, i64 0
%445 = load double, double* %444
%446 = fsub double 1.000000e+00, %445
%447 = load double*, double** %5
%448 = getelementptr inbounds double, double* %447, i64 2
%449 = load double, double* %448
%450 = fsub double %446, %449
%451 = load double*, double** %5
%452 = getelementptr inbounds double, double* %451, i64 3
%453 = load double, double* %452
%454 = fsub double %450, %453
%455 = load double*, double** %5
%456 = getelementptr inbounds double, double* %455, i64 1
store double %454, double* %456
%457 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%458 = load double, double* %457
%459 = fsub double 1.000000e+00, %458
%460 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
%461 = load double, double* %460
%462 = fsub double %459, %461
%463 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
%464 = load double, double* %463
%465 = fsub double %462, %464
%466 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 1
store double %465, double* %466
%467 = load i32, i32* %13
ret i32 %467
}

LLVM IR (-O2):
define i32 @find_probabilities(double* nocapture %0, double* nocapture %1, double %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = bitcast [3 x double]* %4 to <2 x double>*
store <2 x double> <double -5.000000e-01, double 0.000000e+00>, <2 x double>* %6
%7 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
store double 5.000000e-01, double* %7
%8 = fmul double %2, %2
%9 = load double, double* %0
store double %9, double* %1
%10 = getelementptr inbounds double, double* %0, i64 2
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %1, i64 2
store double %11, double* %12
%13 = getelementptr inbounds double, double* %0, i64 3
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 3
store double %14, double* %15
%16 = fsub double 1.000000e+00, %9
%17 = fsub double %16, %11
%18 = fsub double %17, %14
%19 = getelementptr inbounds double, double* %0, i64 1
store double %18, double* %19
%20 = getelementptr inbounds double, double* %1, i64 1
store double %18, double* %20
%21 = load double, double* %1
%22 = bitcast double* %12 to <2 x double>*
%23 = load <2 x double>, <2 x double>* %22
%24 = extractelement <2 x double> %23, i64 1
%25 = fmul double %24, 2.000000e+00
%26 = extractelement <2 x double> %23, i64 0
%27 = fadd double %21, %26
%28 = fmul double %25, %27
%29 = fdiv double %28, 3.000000e+00
%30 = fsub double 1.000000e+00, %29
%31 = fmul double %21, %30
%32 = tail call double @llvm.fmuladd.f64(double %26, double 2.000000e+00, double %21)
%33 = fneg double %21
%34 = fmul double %24, %33
%35 = tail call double @llvm.fmuladd.f64(double %34, double %32, double 1.000000e+00)
%36 = fdiv double %31, %35
%37 = fmul double %21, %25
%38 = fdiv double %37, 3.000000e+00
%39 = fsub double 1.000000e+00, %38
%40 = fmul double %26, %39
%41 = fdiv double %40, %35
%42 = fmul double %21, %32
%43 = fdiv double %42, 3.000000e+00
%44 = fsub double 1.000000e+00, %43
%45 = fmul double %24, %44
%46 = fdiv double %45, %35
%47 = load double, double* %0
%48 = fsub double %36, %47
%49 = fmul double %48, %48
%50 = load double, double* %10
%51 = fsub double %41, %50
%52 = tail call double @llvm.fmuladd.f64(double %51, double %51, double %49)
%53 = load double, double* %13
%54 = fsub double %46, %53
%55 = tail call double @llvm.fmuladd.f64(double %54, double %54, double %52)
%56 = insertelement <2 x double> poison, double %2, i64 0
%57 = shufflevector <2 x double> %56, <2 x double> poison, <2 x i32> zeroinitializer
%58 = bitcast double* %12 to <2 x double>*
br label %59
59: ; preds = %150, %3
%60 = phi double [ %21, %3 ], [ %154, %150 ]
%61 = phi i32 [ 0, %3 ], [ %165, %150 ]
%62 = phi double [ %55, %3 ], [ %141, %150 ]
%63 = phi <2 x double> [ %23, %3 ], [ %163, %150 ]
%64 = extractelement <2 x double> %63, i64 0
%65 = extractelement <2 x double> %63, i64 1
br label %66
66: ; preds = %59, %147
%67 = phi i64 [ 0, %59 ], [ %148, %147 ]
%68 = phi double [ %62, %59 ], [ %141, %147 ]
%69 = phi i32 [ 1, %59 ], [ %140, %147 ]
%70 = phi i32 [ 1, %59 ], [ %139, %147 ]
%71 = phi i32 [ 1, %59 ], [ %138, %147 ]
%72 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 %67
%73 = load double, double* %72
%74 = tail call double @llvm.fmuladd.f64(double %73, double %2, double %60)
%75 = fcmp ult double %74, 0.000000e+00
%76 = fneg double %74
%77 = trunc i64 %67 to i32
br label %78
78: ; preds = %66, %144
%79 = phi i64 [ 0, %66 ], [ %145, %144 ]
%80 = phi double [ %68, %66 ], [ %141, %144 ]
%81 = phi i32 [ %69, %66 ], [ %140, %144 ]
%82 = phi i32 [ %70, %66 ], [ %139, %144 ]
%83 = phi i32 [ %71, %66 ], [ %138, %144 ]
%84 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 %79
%85 = load double, double* %84
%86 = tail call double @llvm.fmuladd.f64(double %85, double %2, double %64)
%87 = fcmp ult double %86, 0.000000e+00
%88 = select i1 %75, i1 true, i1 %87
%89 = fadd double %74, %86
%90 = tail call double @llvm.fmuladd.f64(double %86, double 2.000000e+00, double %74)
%91 = fmul double %74, %90
%92 = fdiv double %91, 3.000000e+00
%93 = fsub double 1.000000e+00, %92
%94 = trunc i64 %79 to i32
br label %95
95: ; preds = %78, %137
%96 = phi i64 [ 0, %78 ], [ %142, %137 ]
%97 = phi double [ %80, %78 ], [ %141, %137 ]
%98 = phi i32 [ %81, %78 ], [ %140, %137 ]
%99 = phi i32 [ %82, %78 ], [ %139, %137 ]
%100 = phi i32 [ %83, %78 ], [ %138, %137 ]
%101 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 %96
%102 = load double, double* %101
%103 = tail call double @llvm.fmuladd.f64(double %102, double %2, double %65)
%104 = fcmp ult double %103, 0.000000e+00
%105 = select i1 %88, i1 true, i1 %104
%106 = fadd double %89, %103
%107 = fcmp ugt double %106, 1.000000e+00
%108 = select i1 %105, i1 true, i1 %107
br i1 %108, label %137, label %109
109: ; preds = %95
%110 = fmul double %103, 2.000000e+00
%111 = fmul double %89, %110
%112 = fdiv double %111, 3.000000e+00
%113 = fsub double 1.000000e+00, %112
%114 = fmul double %74, %113
%115 = fmul double %103, %76
%116 = tail call double @llvm.fmuladd.f64(double %115, double %90, double 1.000000e+00)
%117 = fdiv double %114, %116
%118 = fmul double %74, %110
%119 = fdiv double %118, 3.000000e+00
%120 = fsub double 1.000000e+00, %119
%121 = fmul double %86, %120
%122 = fdiv double %121, %116
%123 = fmul double %103, %93
%124 = fdiv double %123, %116
%125 = load double, double* %0
%126 = fsub double %117, %125
%127 = fmul double %126, %126
%128 = load double, double* %10
%129 = fsub double %122, %128
%130 = tail call double @llvm.fmuladd.f64(double %129, double %129, double %127)
%131 = load double, double* %13
%132 = fsub double %124, %131
%133 = tail call double @llvm.fmuladd.f64(double %132, double %132, double %130)
%134 = fcmp olt double %133, %97
br i1 %134, label %135, label %137
135: ; preds = %109
%136 = trunc i64 %96 to i32
br label %137
137: ; preds = %95, %135, %109
%138 = phi i32 [ %136, %135 ], [ %100, %109 ], [ %100, %95 ]
%139 = phi i32 [ %94, %135 ], [ %99, %109 ], [ %99, %95 ]
%140 = phi i32 [ %77, %135 ], [ %98, %109 ], [ %98, %95 ]
%141 = phi double [ %133, %135 ], [ %97, %109 ], [ %97, %95 ]
%142 = add nuw nsw i64 %96, 1
%143 = icmp eq i64 %142, 3
br i1 %143, label %144, label %95
144: ; preds = %137
%145 = add nuw nsw i64 %79, 1
%146 = icmp eq i64 %145, 3
br i1 %146, label %147, label %78
147: ; preds = %144
%148 = add nuw nsw i64 %67, 1
%149 = icmp eq i64 %148, 3
br i1 %149, label %150, label %66
150: ; preds = %147
%151 = sext i32 %140 to i64
%152 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 %151
%153 = load double, double* %152
%154 = tail call double @llvm.fmuladd.f64(double %153, double %2, double %60)
store double %154, double* %1
%155 = sext i32 %139 to i64
%156 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 %155
%157 = load double, double* %156
%158 = sext i32 %138 to i64
%159 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 %158
%160 = load double, double* %159
%161 = insertelement <2 x double> poison, double %157, i64 0
%162 = insertelement <2 x double> %161, double %160, i64 1
%163 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %162, <2 x double> %57, <2 x double> %63)
%164 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %162, <2 x double> %57, <2 x double> %63)
store <2 x double> %164, <2 x double>* %58
%165 = add nuw nsw i32 %61, 1
%166 = fcmp ult double %141, %8
br i1 %166, label %167, label %59
167: ; preds = %150
%168 = fsub double 1.000000e+00, %154
%169 = extractelement <2 x double> %164, i64 0
%170 = fsub double %168, %169
%171 = extractelement <2 x double> %164, i64 1
%172 = fsub double %170, %171
store double %172, double* %20
ret i32 %165
}