#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 double uint64_t;
typedef double uint32_t;

/* Variables and functions */
double INFINITY;
double fisher22_1sided(uint32_t m11, uint32_t m12, uint32_t m21, uint32_t m22,
                       uint32_t m11_is_greater_alt, uint32_t midp) {
  double cur_prob =
      0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125;
  double left_prob = cur_prob;
  double right_prob = 0;
  uint32_t uii;
  double cur11;
  double cur12;
  double cur21;
  double cur22;
  double preaddp;
  if (m12 > m21) {
    uii = m12;
    m12 = m21;
    m21 = uii;
  }
  if (m11 > m22) {
    uii = m11;
    m11 = m22;
    m22 = uii;
  }
  if (m11_is_greater_alt) {
    uii = m11;
    m11 = m12;
    m12 = uii;
    uii = m21;
    m21 = m22;
    m22 = uii;
  }
  cur11 = m11;
  cur12 = m12;
  cur21 = m21;
  cur22 = m22;
  if ((((uint64_t)m11) * m22) >= (((uint64_t)m12) * m21)) {
    while (cur11 > 0.5) {
      cur12 += 1;
      cur21 += 1;
      cur_prob *= (cur11 * cur22) / (cur12 * cur21);
      cur11 -= 1;
      cur22 -= 1;
      preaddp = left_prob;
      left_prob += cur_prob;
      if (left_prob <= preaddp) {
        break;
      }
      if (left_prob >= 1.0) {
        return 1;
      }
    }
    cur11 = m11;
    cur12 = m12;
    cur21 = m21;
    cur22 = m22;
    cur_prob =
        0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125;
    right_prob = left_prob;
    while (cur12 > 0.5) {
      cur11 += 1;
      cur22 += 1;
      cur_prob *= (cur12 * cur21) / (cur11 * cur22);
      cur12 -= 1;
      cur21 -= 1;
      preaddp = right_prob;
      right_prob += cur_prob;
      if (right_prob <= preaddp) {
        break;
      }
    }
    if (!midp) {
      return left_prob / right_prob;
    } else {
      return (left_prob -
              0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125 *
                  0.5) /
             right_prob;
    }
  } else {
    while (cur12 > 0.5) {
      cur11 += 1;
      cur22 += 1;
      cur_prob *= (cur12 * cur21) / (cur11 * cur22);
      cur12 -= 1;
      cur21 -= 1;
      preaddp = right_prob;
      right_prob += cur_prob;
      if (right_prob == INFINITY) {
        return 0;
      }
      if (right_prob <= preaddp) {
        break;
      }
    }
    cur11 = m11;
    cur12 = m12;
    cur21 = m21;
    cur22 = m22;
    cur_prob =
        0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125;
    while (cur11 > 0.5) {
      cur12 += 1;
      cur21 += 1;
      cur_prob *= (cur11 * cur22) / (cur12 * cur21);
      cur11 -= 1;
      cur22 -= 1;
      preaddp = left_prob;
      left_prob += cur_prob;
      if (left_prob <= preaddp) {
        break;
      }
    }
    if (!midp) {
      return left_prob / (left_prob + right_prob);
    } else {
      return (left_prob -
              0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125 *
                  0.5) /
             (left_prob + right_prob);
    }
  }
}


x86 assembly (clang, -O0):
<fisher22_1sided>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    116f <fisher22_1sided+0x6f>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    119d <fisher22_1sided+0x9d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11ba <fisher22_1sided+0xba>
jp     11ba <fisher22_1sided+0xba>
jmp    11f6 <fisher22_1sided+0xf6>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     1475 <fisher22_1sided+0x375>
jmp    1241 <fisher22_1sided+0x141>
movsd  -0x60(%rbp),%xmm0
movsd  0xdba(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    132a <fisher22_1sided+0x22a>
movsd  0xdb0(%rip),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xd9e(%rip),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xd65(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  0xd4f(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     12fc <fisher22_1sided+0x1fc>
jmp    132a <fisher22_1sided+0x22a>
movsd  -0x48(%rbp),%xmm0
movsd  0xd07(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1325 <fisher22_1sided+0x225>
movsd  0xcf5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16b1 <fisher22_1sided+0x5b1>
jmp    1241 <fisher22_1sided+0x141>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xca6(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xc92(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1429 <fisher22_1sided+0x329>
movsd  0xc88(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xc76(%rip),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xc3d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  0xc27(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1424 <fisher22_1sided+0x324>
jmp    1429 <fisher22_1sided+0x329>
jmp    1369 <fisher22_1sided+0x269>
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1455 <fisher22_1sided+0x355>
jp     1455 <fisher22_1sided+0x355>
movsd  -0x48(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16b1 <fisher22_1sided+0x5b1>
movsd  -0x48(%rbp),%xmm0
movsd  0xbb6(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16b1 <fisher22_1sided+0x5b1>
jmp    147a <fisher22_1sided+0x37a>
movsd  -0x68(%rbp),%xmm0
movsd  0xb81(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1563 <fisher22_1sided+0x463>
movsd  0xb77(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xb65(%rip),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xb2c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  0xb16(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    0x2ac0(%rip),%rax
ucomisd (%rax),%xmm0
jne    1545 <fisher22_1sided+0x445>
jp     1545 <fisher22_1sided+0x445>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16b1 <fisher22_1sided+0x5b1>
movsd  -0x50(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     155e <fisher22_1sided+0x45e>
jmp    1563 <fisher22_1sided+0x463>
jmp    147a <fisher22_1sided+0x37a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xa6d(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xa63(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1658 <fisher22_1sided+0x558>
movsd  0xa59(%rip),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xa47(%rip),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xa0e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  0x9f8(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1653 <fisher22_1sided+0x553>
jmp    1658 <fisher22_1sided+0x558>
jmp    1598 <fisher22_1sided+0x498>
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    168d <fisher22_1sided+0x58d>
jp     168d <fisher22_1sided+0x58d>
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
addsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16b1 <fisher22_1sided+0x5b1>
movsd  -0x48(%rbp),%xmm0
movsd  0x97e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
addsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fisher22_1sided>:
movapd %xmm2,%xmm8
minsd  %xmm1,%xmm8
maxsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
maxsd  %xmm3,%xmm2
minsd  %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm4
jne    1126 <fisher22_1sided+0x26>
jnp    1132 <fisher22_1sided+0x32>
movapd %xmm3,%xmm15
movapd %xmm2,%xmm13
jmp    1145 <fisher22_1sided+0x45>
movapd %xmm8,%xmm15
movapd %xmm1,%xmm13
movapd %xmm2,%xmm1
movapd %xmm3,%xmm8
movapd %xmm1,%xmm0
mulsd  %xmm8,%xmm0
movapd %xmm15,%xmm2
mulsd  %xmm13,%xmm2
ucomisd %xmm2,%xmm0
jae    12b0 <fisher22_1sided+0x1b0>
movsd  %xmm5,-0x10(%rsp)
xorpd  %xmm14,%xmm14
ucomisd 0xe92(%rip),%xmm15
jbe    122b <fisher22_1sided+0x12b>
mov    0x2e65(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rsp)
xorpd  %xmm0,%xmm0
movsd  0xe67(%rip),%xmm7
movsd  0xe6e(%rip),%xmm11
movsd  0xe6d(%rip),%xmm9
xorpd  %xmm10,%xmm10
movapd %xmm8,%xmm12
movapd %xmm15,%xmm2
movapd %xmm13,%xmm3
movapd %xmm1,%xmm4
xorpd  %xmm14,%xmm14
nopl   0x0(%rax,%rax,1)
movapd %xmm7,%xmm5
addsd  %xmm11,%xmm12
addsd  %xmm11,%xmm4
movapd %xmm2,%xmm7
mulsd  %xmm3,%xmm7
movapd %xmm12,%xmm6
mulsd  %xmm4,%xmm6
divsd  %xmm6,%xmm7
mulsd  %xmm5,%xmm7
addsd  %xmm9,%xmm2
addsd  %xmm7,%xmm14
ucomisd -0x8(%rsp),%xmm14
jne    1210 <fisher22_1sided+0x110>
jnp    1340 <fisher22_1sided+0x240>
addsd  %xmm9,%xmm3
ucomisd %xmm14,%xmm10
jae    122b <fisher22_1sided+0x12b>
ucomisd 0xde4(%rip),%xmm2
movapd %xmm14,%xmm10
ja     11d0 <fisher22_1sided+0xd0>
ucomisd 0xdd4(%rip),%xmm8
jbe    1341 <fisher22_1sided+0x241>
movsd  0xdbe(%rip),%xmm3
movsd  0xdc6(%rip),%xmm7
movsd  0xdc6(%rip),%xmm6
movsd  0xdad(%rip),%xmm9
movapd %xmm3,%xmm0
nop
movapd %xmm0,%xmm4
movapd %xmm3,%xmm5
addsd  %xmm7,%xmm15
addsd  %xmm7,%xmm13
movapd %xmm8,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm15,%xmm2
mulsd  %xmm13,%xmm2
divsd  %xmm2,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm3,%xmm0
ucomisd %xmm0,%xmm4
jae    1349 <fisher22_1sided+0x249>
addsd  %xmm6,%xmm8
addsd  %xmm6,%xmm1
ucomisd %xmm9,%xmm8
ja     1260 <fisher22_1sided+0x160>
jmp    1349 <fisher22_1sided+0x249>
movsd  0xd47(%rip),%xmm11
movsd  0xd46(%rip),%xmm12
movsd  0xd46(%rip),%xmm0
movsd  0xd45(%rip),%xmm9
movapd %xmm11,%xmm10
movapd %xmm8,%xmm2
movapd %xmm15,%xmm14
movapd %xmm13,%xmm3
movapd %xmm1,%xmm6
nopl   0x0(%rax,%rax,1)
ucomisd %xmm12,%xmm2
jbe    1373 <fisher22_1sided+0x273>
addsd  %xmm0,%xmm14
addsd  %xmm0,%xmm3
movapd %xmm2,%xmm7
mulsd  %xmm6,%xmm7
movapd %xmm14,%xmm4
mulsd  %xmm3,%xmm4
divsd  %xmm4,%xmm7
mulsd  %xmm7,%xmm11
movapd %xmm10,%xmm7
addsd  %xmm11,%xmm7
ucomisd %xmm7,%xmm10
jae    136e <fisher22_1sided+0x26e>
addsd  %xmm9,%xmm6
addsd  %xmm9,%xmm2
ucomisd %xmm0,%xmm7
movapd %xmm7,%xmm10
jb     12f0 <fisher22_1sided+0x1f0>
ret
movsd  0xcb7(%rip),%xmm0
xorpd  %xmm1,%xmm1
movsd  -0x10(%rsp),%xmm2
addsd  %xmm0,%xmm14
ucomisd %xmm1,%xmm2
jne    1360 <fisher22_1sided+0x260>
jnp    1368 <fisher22_1sided+0x268>
addsd  0xcb8(%rip),%xmm0
divsd  %xmm14,%xmm0
ret
movapd %xmm7,%xmm10
ucomisd 0xc8c(%rip),%xmm15
movapd %xmm10,%xmm0
jbe    13e7 <fisher22_1sided+0x2e7>
movsd  0xc75(%rip),%xmm3
movsd  0xc7d(%rip),%xmm2
movapd %xmm10,%xmm0
nopl   0x0(%rax,%rax,1)
movapd %xmm0,%xmm4
movapd %xmm3,%xmm7
addsd  %xmm2,%xmm8
addsd  %xmm2,%xmm1
movapd %xmm15,%xmm3
mulsd  %xmm13,%xmm3
movapd %xmm8,%xmm6
mulsd  %xmm1,%xmm6
divsd  %xmm6,%xmm3
mulsd  %xmm7,%xmm3
addsd  %xmm3,%xmm0
ucomisd %xmm0,%xmm4
jae    13e7 <fisher22_1sided+0x2e7>
addsd  %xmm9,%xmm15
addsd  %xmm9,%xmm13
ucomisd %xmm12,%xmm15
ja     13a0 <fisher22_1sided+0x2a0>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm5
jne    13f3 <fisher22_1sided+0x2f3>
jnp    13fc <fisher22_1sided+0x2fc>
addsd  0xc24(%rip),%xmm10
divsd  %xmm0,%xmm10
movapd %xmm10,%xmm0
ret

LLVM IR (-O0):
@INFINITY = global double 0.000000e+00
define double @fisher22_1sided(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double 0x3AC0000000000000, double* %14
%23 = load double, double* %14
store double %23, double* %15
store double 0.000000e+00, double* %16
%24 = load double, double* %9
%25 = load double, double* %10
%26 = fcmp ogt double %24, %25
br i1 %26, label %27, label %31
27: ; preds = %6
%28 = load double, double* %9
store double %28, double* %17
%29 = load double, double* %10
store double %29, double* %9
%30 = load double, double* %17
store double %30, double* %10
br label %31
31: ; preds = %27, %6
%32 = load double, double* %8
%33 = load double, double* %11
%34 = fcmp ogt double %32, %33
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load double, double* %8
store double %36, double* %17
%37 = load double, double* %11
store double %37, double* %8
%38 = load double, double* %17
store double %38, double* %11
br label %39
39: ; preds = %35, %31
%40 = load double, double* %12
%41 = fcmp une double %40, 0.000000e+00
br i1 %41, label %42, label %49
42: ; preds = %39
%43 = load double, double* %8
store double %43, double* %17
%44 = load double, double* %9
store double %44, double* %8
%45 = load double, double* %17
store double %45, double* %9
%46 = load double, double* %10
store double %46, double* %17
%47 = load double, double* %11
store double %47, double* %10
%48 = load double, double* %17
store double %48, double* %11
br label %49
49: ; preds = %42, %39
%50 = load double, double* %8
store double %50, double* %18
%51 = load double, double* %9
store double %51, double* %19
%52 = load double, double* %10
store double %52, double* %20
%53 = load double, double* %11
store double %53, double* %21
%54 = load double, double* %8
%55 = load double, double* %11
%56 = fmul double %54, %55
%57 = load double, double* %9
%58 = load double, double* %10
%59 = fmul double %57, %58
%60 = fcmp oge double %56, %59
br i1 %60, label %61, label %144
61: ; preds = %49
br label %62
62: ; preds = %95, %61
%63 = load double, double* %18
%64 = fcmp ogt double %63, 5.000000e-01
br i1 %64, label %65, label %96
65: ; preds = %62
%66 = load double, double* %19
%67 = fadd double %66, 1.000000e+00
store double %67, double* %19
%68 = load double, double* %20
%69 = fadd double %68, 1.000000e+00
store double %69, double* %20
%70 = load double, double* %18
%71 = load double, double* %21
%72 = fmul double %70, %71
%73 = load double, double* %19
%74 = load double, double* %20
%75 = fmul double %73, %74
%76 = fdiv double %72, %75
%77 = load double, double* %14
%78 = fmul double %77, %76
store double %78, double* %14
%79 = load double, double* %18
%80 = fsub double %79, 1.000000e+00
store double %80, double* %18
%81 = load double, double* %21
%82 = fsub double %81, 1.000000e+00
store double %82, double* %21
%83 = load double, double* %15
store double %83, double* %22
%84 = load double, double* %14
%85 = load double, double* %15
%86 = fadd double %85, %84
store double %86, double* %15
%87 = load double, double* %15
%88 = load double, double* %22
%89 = fcmp ole double %87, %88
br i1 %89, label %90, label %91
90: ; preds = %65
br label %96
91: ; preds = %65
%92 = load double, double* %15
%93 = fcmp oge double %92, 1.000000e+00
br i1 %93, label %94, label %95
94: ; preds = %91
store double 1.000000e+00, double* %7
br label %231
95: ; preds = %91
br label %62
96: ; preds = %90, %62
%97 = load double, double* %8
store double %97, double* %18
%98 = load double, double* %9
store double %98, double* %19
%99 = load double, double* %10
store double %99, double* %20
%100 = load double, double* %11
store double %100, double* %21
store double 0x3AC0000000000000, double* %14
%101 = load double, double* %15
store double %101, double* %16
br label %102
102: ; preds = %131, %96
%103 = load double, double* %19
%104 = fcmp ogt double %103, 5.000000e-01
br i1 %104, label %105, label %132
105: ; preds = %102
%106 = load double, double* %18
%107 = fadd double %106, 1.000000e+00
store double %107, double* %18
%108 = load double, double* %21
%109 = fadd double %108, 1.000000e+00
store double %109, double* %21
%110 = load double, double* %19
%111 = load double, double* %20
%112 = fmul double %110, %111
%113 = load double, double* %18
%114 = load double, double* %21
%115 = fmul double %113, %114
%116 = fdiv double %112, %115
%117 = load double, double* %14
%118 = fmul double %117, %116
store double %118, double* %14
%119 = load double, double* %19
%120 = fsub double %119, 1.000000e+00
store double %120, double* %19
%121 = load double, double* %20
%122 = fsub double %121, 1.000000e+00
store double %122, double* %20
%123 = load double, double* %16
store double %123, double* %22
%124 = load double, double* %14
%125 = load double, double* %16
%126 = fadd double %125, %124
store double %126, double* %16
%127 = load double, double* %16
%128 = load double, double* %22
%129 = fcmp ole double %127, %128
br i1 %129, label %130, label %131
130: ; preds = %105
br label %132
131: ; preds = %105
br label %102
132: ; preds = %130, %102
%133 = load double, double* %13
%134 = fcmp une double %133, 0.000000e+00
br i1 %134, label %139, label %135
135: ; preds = %132
%136 = load double, double* %15
%137 = load double, double* %16
%138 = fdiv double %136, %137
store double %138, double* %7
br label %231
139: ; preds = %132
%140 = load double, double* %15
%141 = fsub double %140, 0x3AB0000000000000
%142 = load double, double* %16
%143 = fdiv double %141, %142
store double %143, double* %7
br label %231
144: ; preds = %49
br label %145
145: ; preds = %179, %144
%146 = load double, double* %19
%147 = fcmp ogt double %146, 5.000000e-01
br i1 %147, label %148, label %180
148: ; preds = %145
%149 = load double, double* %18
%150 = fadd double %149, 1.000000e+00
store double %150, double* %18
%151 = load double, double* %21
%152 = fadd double %151, 1.000000e+00
store double %152, double* %21
%153 = load double, double* %19
%154 = load double, double* %20
%155 = fmul double %153, %154
%156 = load double, double* %18
%157 = load double, double* %21
%158 = fmul double %156, %157
%159 = fdiv double %155, %158
%160 = load double, double* %14
%161 = fmul double %160, %159
store double %161, double* %14
%162 = load double, double* %19
%163 = fsub double %162, 1.000000e+00
store double %163, double* %19
%164 = load double, double* %20
%165 = fsub double %164, 1.000000e+00
store double %165, double* %20
%166 = load double, double* %16
store double %166, double* %22
%167 = load double, double* %14
%168 = load double, double* %16
%169 = fadd double %168, %167
store double %169, double* %16
%170 = load double, double* %16
%171 = load double, double* @INFINITY
%172 = fcmp oeq double %170, %171
br i1 %172, label %173, label %174
173: ; preds = %148
store double 0.000000e+00, double* %7
br label %231
174: ; preds = %148
%175 = load double, double* %16
%176 = load double, double* %22
%177 = fcmp ole double %175, %176
br i1 %177, label %178, label %179
178: ; preds = %174
br label %180
179: ; preds = %174
br label %145
180: ; preds = %178, %145
%181 = load double, double* %8
store double %181, double* %18
%182 = load double, double* %9
store double %182, double* %19
%183 = load double, double* %10
store double %183, double* %20
%184 = load double, double* %11
store double %184, double* %21
store double 0x3AC0000000000000, double* %14
br label %185
185: ; preds = %214, %180
%186 = load double, double* %18
%187 = fcmp ogt double %186, 5.000000e-01
br i1 %187, label %188, label %215
188: ; preds = %185
%189 = load double, double* %19
%190 = fadd double %189, 1.000000e+00
store double %190, double* %19
%191 = load double, double* %20
%192 = fadd double %191, 1.000000e+00
store double %192, double* %20
%193 = load double, double* %18
%194 = load double, double* %21
%195 = fmul double %193, %194
%196 = load double, double* %19
%197 = load double, double* %20
%198 = fmul double %196, %197
%199 = fdiv double %195, %198
%200 = load double, double* %14
%201 = fmul double %200, %199
store double %201, double* %14
%202 = load double, double* %18
%203 = fsub double %202, 1.000000e+00
store double %203, double* %18
%204 = load double, double* %21
%205 = fsub double %204, 1.000000e+00
store double %205, double* %21
%206 = load double, double* %15
store double %206, double* %22
%207 = load double, double* %14
%208 = load double, double* %15
%209 = fadd double %208, %207
store double %209, double* %15
%210 = load double, double* %15
%211 = load double, double* %22
%212 = fcmp ole double %210, %211
br i1 %212, label %213, label %214
213: ; preds = %188
br label %215
214: ; preds = %188
br label %185
215: ; preds = %213, %185
%216 = load double, double* %13
%217 = fcmp une double %216, 0.000000e+00
br i1 %217, label %224, label %218
218: ; preds = %215
%219 = load double, double* %15
%220 = load double, double* %15
%221 = load double, double* %16
%222 = fadd double %220, %221
%223 = fdiv double %219, %222
store double %223, double* %7
br label %231
224: ; preds = %215
%225 = load double, double* %15
%226 = fsub double %225, 0x3AB0000000000000
%227 = load double, double* %15
%228 = load double, double* %16
%229 = fadd double %227, %228
%230 = fdiv double %226, %229
store double %230, double* %7
br label %231
231: ; preds = %224, %218, %173, %139, %135, %94
%232 = load double, double* %7
ret double %232
}

LLVM IR (-O2):
@INFINITY = global double 0.000000e+00
define double @fisher22_1sided(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fcmp ogt double %1, %2
%8 = select i1 %7, double %2, double %1
%9 = select i1 %7, double %1, double %2
%10 = fcmp ogt double %0, %3
%11 = select i1 %10, double %0, double %3
%12 = select i1 %10, double %3, double %0
%13 = fcmp une double %4, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %6
br label %15
15: ; preds = %14, %6
%16 = phi double [ %12, %14 ], [ %8, %6 ]
%17 = phi double [ %11, %14 ], [ %9, %6 ]
%18 = phi double [ %9, %14 ], [ %11, %6 ]
%19 = phi double [ %8, %14 ], [ %12, %6 ]
%20 = fmul double %18, %19
%21 = fmul double %16, %17
%22 = fcmp ult double %20, %21
br i1 %22, label %74, label %23
23: ; preds = %15, %40
%24 = phi double [ %37, %40 ], [ 0x3AC0000000000000, %15 ]
%25 = phi double [ %38, %40 ], [ 0x3AC0000000000000, %15 ]
%26 = phi double [ %42, %40 ], [ %19, %15 ]
%27 = phi double [ %32, %40 ], [ %16, %15 ]
%28 = phi double [ %33, %40 ], [ %17, %15 ]
%29 = phi double [ %41, %40 ], [ %18, %15 ]
%30 = fcmp ogt double %26, 5.000000e-01
br i1 %30, label %31, label %44
31: ; preds = %23
%32 = fadd double %27, 1.000000e+00
%33 = fadd double %28, 1.000000e+00
%34 = fmul double %26, %29
%35 = fmul double %32, %33
%36 = fdiv double %34, %35
%37 = fmul double %24, %36
%38 = fadd double %25, %37
%39 = fcmp ugt double %38, %25
br i1 %39, label %40, label %44
40: ; preds = %31
%41 = fadd double %29, -1.000000e+00
%42 = fadd double %26, -1.000000e+00
%43 = fcmp ult double %38, 1.000000e+00
br i1 %43, label %23, label %131
44: ; preds = %31, %23
%45 = phi double [ %38, %31 ], [ %25, %23 ]
%46 = fcmp ogt double %16, 5.000000e-01
br i1 %46, label %47, label %66
47: ; preds = %44, %47
%48 = phi double [ %59, %47 ], [ 0x3AC0000000000000, %44 ]
%49 = phi double [ %62, %47 ], [ %45, %44 ]
%50 = phi double [ %54, %47 ], [ %19, %44 ]
%51 = phi double [ %60, %47 ], [ %16, %44 ]
%52 = phi double [ %61, %47 ], [ %17, %44 ]
%53 = phi double [ %55, %47 ], [ %18, %44 ]
%54 = fadd double %50, 1.000000e+00
%55 = fadd double %53, 1.000000e+00
%56 = fmul double %51, %52
%57 = fmul double %54, %55
%58 = fdiv double %56, %57
%59 = fmul double %48, %58
%60 = fadd double %51, -1.000000e+00
%61 = fadd double %52, -1.000000e+00
%62 = fadd double %49, %59
%63 = fcmp ugt double %62, %49
%64 = fcmp ogt double %60, 5.000000e-01
%65 = select i1 %63, i1 %64, i1 false
br i1 %65, label %47, label %66
66: ; preds = %47, %44
%67 = phi double [ %45, %44 ], [ %62, %47 ]
%68 = fcmp une double %5, 0.000000e+00
br i1 %68, label %71, label %69
69: ; preds = %66
%70 = fdiv double %45, %67
br label %131
71: ; preds = %66
%72 = fadd double %45, 0xBAB0000000000000
%73 = fdiv double %72, %67
br label %131
74: ; preds = %15
%75 = fcmp ogt double %16, 5.000000e-01
br i1 %75, label %76, label %99
76: ; preds = %74
%77 = load double, double* @INFINITY
br label %78
78: ; preds = %76, %94
%79 = phi double [ %90, %94 ], [ 0x3AC0000000000000, %76 ]
%80 = phi double [ %92, %94 ], [ 0.000000e+00, %76 ]
%81 = phi double [ %85, %94 ], [ %19, %76 ]
%82 = phi double [ %91, %94 ], [ %16, %76 ]
%83 = phi double [ %95, %94 ], [ %17, %76 ]
%84 = phi double [ %86, %94 ], [ %18, %76 ]
%85 = fadd double %81, 1.000000e+00
%86 = fadd double %84, 1.000000e+00
%87 = fmul double %82, %83
%88 = fmul double %85, %86
%89 = fdiv double %87, %88
%90 = fmul double %79, %89
%91 = fadd double %82, -1.000000e+00
%92 = fadd double %80, %90
%93 = fcmp oeq double %92, %77
br i1 %93, label %131, label %94
94: ; preds = %78
%95 = fadd double %83, -1.000000e+00
%96 = fcmp ugt double %92, %80
%97 = fcmp ogt double %91, 5.000000e-01
%98 = select i1 %96, i1 %97, i1 false
br i1 %98, label %78, label %99
99: ; preds = %94, %74
%100 = phi double [ 0.000000e+00, %74 ], [ %92, %94 ]
%101 = fcmp ogt double %19, 5.000000e-01
br i1 %101, label %102, label %121
102: ; preds = %99, %102
%103 = phi double [ %114, %102 ], [ 0x3AC0000000000000, %99 ]
%104 = phi double [ %117, %102 ], [ 0x3AC0000000000000, %99 ]
%105 = phi double [ %115, %102 ], [ %19, %99 ]
%106 = phi double [ %109, %102 ], [ %16, %99 ]
%107 = phi double [ %110, %102 ], [ %17, %99 ]
%108 = phi double [ %116, %102 ], [ %18, %99 ]
%109 = fadd double %106, 1.000000e+00
%110 = fadd double %107, 1.000000e+00
%111 = fmul double %105, %108
%112 = fmul double %109, %110
%113 = fdiv double %111, %112
%114 = fmul double %103, %113
%115 = fadd double %105, -1.000000e+00
%116 = fadd double %108, -1.000000e+00
%117 = fadd double %104, %114
%118 = fcmp ugt double %117, %104
%119 = fcmp ogt double %115, 5.000000e-01
%120 = select i1 %118, i1 %119, i1 false
br i1 %120, label %102, label %121
121: ; preds = %102, %99
%122 = phi double [ 0x3AC0000000000000, %99 ], [ %117, %102 ]
%123 = fcmp une double %5, 0.000000e+00
br i1 %123, label %127, label %124
124: ; preds = %121
%125 = fadd double %100, %122
%126 = fdiv double %122, %125
br label %131
127: ; preds = %121
%128 = fadd double %122, 0xBAB0000000000000
%129 = fadd double %100, %122
%130 = fdiv double %128, %129
br label %131
131: ; preds = %40, %78, %127, %124, %71, %69
%132 = phi double [ %73, %71 ], [ %70, %69 ], [ %130, %127 ], [ %126, %124 ], [ 0.000000e+00, %78 ], [ 1.000000e+00, %40 ]
ret double %132
}