#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 scalar_t__ uint32_t;
typedef long long int64_t;
typedef long long int32_t;

/* Variables and functions */
double INFINITY;
double SNPHWE2(int32_t obs_hets, int32_t obs_hom1, int32_t obs_hom2,
               uint32_t midp) {
  intptr_t obs_homc;
  intptr_t obs_homr;
  if (obs_hom1 < obs_hom2) {
    obs_homc = obs_hom2;
    obs_homr = obs_hom1;
  } else {
    obs_homc = obs_hom1;
    obs_homr = obs_hom2;
  }
  int64_t rare_copies = 2LL * obs_homr + obs_hets;
  int64_t genotypes2 = (obs_hets + obs_homc + obs_homr) * 2LL;
  int32_t tie_ct = 1;
  double curr_hets_t2 = obs_hets;
  double curr_homr_t2 = obs_homr;
  double curr_homc_t2 = obs_homc;
  double tailp =
      (1 - 0.00000000000005684341886080801486968994140625) *
      0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125;
  double centerp = 0;
  double lastp2 = tailp;
  double lastp1 = tailp;
  double curr_hets_t1;
  double curr_homr_t1;
  double curr_homc_t1;
  double preaddp;
  if (!genotypes2) {
    if (midp) {
      return 0.5;
    } else {
      return 1;
    }
  }
  if (obs_hets * genotypes2 > rare_copies * (genotypes2 - rare_copies)) {
    while (curr_hets_t2 > 1.5) {
      curr_homr_t2 += 1;
      curr_homc_t2 += 1;
      lastp2 *= (curr_hets_t2 * (curr_hets_t2 - 1)) /
                (4 * curr_homr_t2 * curr_homc_t2);
      curr_hets_t2 -= 2;
      if (lastp2 <
          0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125) {
        if (lastp2 >
            (1 - 2 * 0.00000000000005684341886080801486968994140625) *
                0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125) {
          tie_ct++;
        }
        tailp += lastp2;
        break;
      }
      centerp += lastp2;
      if (centerp == INFINITY) {
        return 0;
      }
    }
    if ((centerp == 0) && (!midp)) {
      return 1;
    }
    while (curr_hets_t2 > 1.5) {
      curr_homr_t2 += 1;
      curr_homc_t2 += 1;
      lastp2 *= (curr_hets_t2 * (curr_hets_t2 - 1)) /
                (4 * curr_homr_t2 * curr_homc_t2);
      curr_hets_t2 -= 2;
      preaddp = tailp;
      tailp += lastp2;
      if (tailp <= preaddp) {
        break;
      }
    }
    curr_hets_t1 = obs_hets + 2;
    curr_homr_t1 = obs_homr;
    curr_homc_t1 = obs_homc;
    while (curr_homr_t1 > 0.5) {
      lastp1 *= (4 * curr_homr_t1 * curr_homc_t1) /
                (curr_hets_t1 * (curr_hets_t1 - 1));
      preaddp = tailp;
      tailp += lastp1;
      if (tailp <= preaddp) {
        break;
      }
      curr_hets_t1 += 2;
      curr_homr_t1 -= 1;
      curr_homc_t1 -= 1;
    }
  } else {
    while (curr_homr_t2 > 0.5) {
      curr_hets_t2 += 2;
      lastp2 *= (4 * curr_homr_t2 * curr_homc_t2) /
                (curr_hets_t2 * (curr_hets_t2 - 1));
      curr_homr_t2 -= 1;
      curr_homc_t2 -= 1;
      if (lastp2 <
          0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125) {
        if (lastp2 >
            (1 - 2 * 0.00000000000005684341886080801486968994140625) *
                0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125) {
          tie_ct++;
        }
        tailp += lastp2;
        break;
      }
      centerp += lastp2;
      if (centerp == INFINITY) {
        return 0;
      }
    }
    if ((centerp == 0) && (!midp)) {
      return 1;
    }
    while (curr_homr_t2 > 0.5) {
      curr_hets_t2 += 2;
      lastp2 *= (4 * curr_homr_t2 * curr_homc_t2) /
                (curr_hets_t2 * (curr_hets_t2 - 1));
      curr_homr_t2 -= 1;
      curr_homc_t2 -= 1;
      preaddp = tailp;
      tailp += lastp2;
      if (tailp <= preaddp) {
        break;
      }
    }
    curr_hets_t1 = obs_hets;
    curr_homr_t1 = obs_homr;
    curr_homc_t1 = obs_homc;
    while (curr_hets_t1 > 1.5) {
      curr_homr_t1 += 1;
      curr_homc_t1 += 1;
      lastp1 *= (curr_hets_t1 * (curr_hets_t1 - 1)) /
                (4 * curr_homr_t1 * curr_homc_t1);
      preaddp = tailp;
      tailp += lastp1;
      if (tailp <= preaddp) {
        break;
      }
      curr_hets_t1 -= 2;
    }
  }
  if (!midp) {
    return tailp / (tailp + centerp);
  } else {
    return (tailp -
            ((1 - 0.00000000000005684341886080801486968994140625) *
             0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125 *
             0.5) *
                tie_ct) /
           (tailp + centerp);
  }
}


x86 assembly (clang, -O0):
<SNPHWE2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x28,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    113b <SNPHWE2+0x3b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    114b <SNPHWE2+0x4b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
shl    $0x1,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
add    -0x30(%rbp),%rax
add    -0x38(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x48(%rbp)
movq   $0x1,-0x50(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
cvtsi2sdq -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
cvtsi2sdq -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe60(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
cmpq   $0x0,-0x48(%rbp)
jne    11fe <SNPHWE2+0xfe>
cmpq   $0x0,-0x28(%rbp)
je     11ec <SNPHWE2+0xec>
movsd  0xe2e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    18fd <SNPHWE2+0x7fd>
movsd  0xe14(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    18fd <SNPHWE2+0x7fd>
mov    -0x10(%rbp),%rax
imul   -0x48(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%rdx
sub    -0x40(%rbp),%rdx
imul   %rdx,%rcx
cmp    %rcx,%rax
jle    1565 <SNPHWE2+0x465>
jmp    1225 <SNPHWE2+0x125>
movsd  -0x58(%rbp),%xmm0
movsd  0xe06(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1337 <SNPHWE2+0x237>
movsd  0xdc4(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xdb2(%rip),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xd96(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd9e(%rip),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xd81(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd60(%rip),%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    12fa <SNPHWE2+0x1fa>
movsd  -0x80(%rbp),%xmm0
movsd  0xd60(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12e6 <SNPHWE2+0x1e6>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
movsd  -0x80(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1337 <SNPHWE2+0x237>
movsd  -0x80(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
mov    0x2cd3(%rip),%rax
ucomisd (%rax),%xmm0
jne    1332 <SNPHWE2+0x232>
jp     1332 <SNPHWE2+0x232>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    18fd <SNPHWE2+0x7fd>
jmp    1225 <SNPHWE2+0x125>
movsd  -0x78(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    136c <SNPHWE2+0x26c>
jp     136c <SNPHWE2+0x26c>
cmpq   $0x0,-0x28(%rbp)
jne    136c <SNPHWE2+0x26c>
movsd  0xca6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    18fd <SNPHWE2+0x7fd>
jmp    1371 <SNPHWE2+0x271>
movsd  -0x58(%rbp),%xmm0
movsd  0xcba(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1439 <SNPHWE2+0x339>
movsd  0xc78(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xc66(%rip),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xc4a(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc52(%rip),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xc35(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1434 <SNPHWE2+0x334>
jmp    1439 <SNPHWE2+0x339>
jmp    1371 <SNPHWE2+0x271>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
cvtsi2sdq -0x38(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
cvtsi2sdq -0x30(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xb96(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1560 <SNPHWE2+0x460>
movsd  0xb94(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  0xb54(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     150b <SNPHWE2+0x40b>
jmp    1560 <SNPHWE2+0x460>
movsd  0xb15(%rip),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xad5(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0xab9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    146a <SNPHWE2+0x36a>
jmp    18a7 <SNPHWE2+0x7a7>
jmp    156a <SNPHWE2+0x46a>
movsd  -0x60(%rbp),%xmm0
movsd  0xa99(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1680 <SNPHWE2+0x580>
movsd  0xa9f(%rip),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xa85(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  0xa51(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xa2e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xa18(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xa17(%rip),%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    1643 <SNPHWE2+0x543>
movsd  -0x80(%rbp),%xmm0
movsd  0xa17(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    162f <SNPHWE2+0x52f>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
movsd  -0x80(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1680 <SNPHWE2+0x580>
movsd  -0x80(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
mov    0x298a(%rip),%rax
ucomisd (%rax),%xmm0
jne    167b <SNPHWE2+0x57b>
jp     167b <SNPHWE2+0x57b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    18fd <SNPHWE2+0x7fd>
jmp    156a <SNPHWE2+0x46a>
movsd  -0x78(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    16b5 <SNPHWE2+0x5b5>
jp     16b5 <SNPHWE2+0x5b5>
cmpq   $0x0,-0x28(%rbp)
jne    16b5 <SNPHWE2+0x5b5>
movsd  0x95d(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    18fd <SNPHWE2+0x7fd>
jmp    16ba <SNPHWE2+0x5ba>
movsd  -0x60(%rbp),%xmm0
movsd  0x949(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1786 <SNPHWE2+0x686>
movsd  0x94f(%rip),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0x935(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  0x901(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0x8de(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0x8c8(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1781 <SNPHWE2+0x681>
jmp    1786 <SNPHWE2+0x686>
jmp    16ba <SNPHWE2+0x5ba>
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
cvtsi2sdq -0x38(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
cvtsi2sdq -0x30(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  0x878(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    18a2 <SNPHWE2+0x7a2>
movsd  0x836(%rip),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0x81e(%rip),%xmm0
addsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  0x7f6(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x7fe(%rip),%xmm1
mulsd  -0x98(%rbp),%xmm1
ff
mulsd  -0xa0(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1881 <SNPHWE2+0x781>
jmp    18a2 <SNPHWE2+0x7a2>
movsd  -0x90(%rbp),%xmm0
ff
movsd  0x797(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    17b0 <SNPHWE2+0x6b0>
jmp    18a7 <SNPHWE2+0x7a7>
cmpq   $0x0,-0x28(%rbp)
jne    18cf <SNPHWE2+0x7cf>
movsd  -0x70(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
addsd  -0x78(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    18fd <SNPHWE2+0x7fd>
movsd  -0x70(%rbp),%xmm1
cvtsi2sdq -0x50(%rbp),%xmm0
movsd  0x75e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x70(%rbp),%xmm1
addsd  -0x78(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x28,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SNPHWE2>:
cmp    %rdx,%rsi
mov    %rdx,%r8
cmovl  %rsi,%r8
cmovl  %rdx,%rsi
lea    (%rsi,%rdi,1),%rdx
add    %r8,%rdx
je     11fe <SNPHWE2+0xfe>
lea    (%rdi,%r8,2),%rax
add    %rdx,%rdx
cvtsi2sd %rdi,%xmm10
cvtsi2sd %r8,%xmm8
cvtsi2sd %rsi,%xmm11
mov    %rdx,%rsi
imul   %rdi,%rsi
sub    %rax,%rdx
imul   %rax,%rdx
mov    0x2ea2(%rip),%rax
movsd  (%rax),%xmm13
movsd  0xead(%rip),%xmm2
xorpd  %xmm15,%xmm15
cmp    %rdx,%rsi
jle    1213 <SNPHWE2+0x113>
movsd  0xede(%rip),%xmm9
movsd  0xec6(%rip),%xmm0
movsd  0xea5(%rip),%xmm14
movsd  0xebd(%rip),%xmm1
movsd  0xe9d(%rip),%xmm5
movapd %xmm8,%xmm12
movapd %xmm11,%xmm4
movapd %xmm2,%xmm6
nopl   0x0(%rax)
ucomisd %xmm9,%xmm10
jbe    12a6 <SNPHWE2+0x1a6>
addsd  %xmm0,%xmm12
addsd  %xmm0,%xmm4
movapd %xmm10,%xmm7
addsd  %xmm14,%xmm7
mulsd  %xmm10,%xmm7
movapd %xmm12,%xmm3
mulsd  0xe48(%rip),%xmm3
mulsd  %xmm4,%xmm3
divsd  %xmm3,%xmm7
mulsd  %xmm7,%xmm6
addsd  %xmm1,%xmm10
ucomisd %xmm6,%xmm5
ja     12c4 <SNPHWE2+0x1c4>
addsd  %xmm6,%xmm15
ucomisd %xmm13,%xmm15
jne    11a0 <SNPHWE2+0xa0>
jp     11a0 <SNPHWE2+0xa0>
xorpd  %xmm0,%xmm0
ret
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
lea    0xe4b(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret
movsd  0xded(%rip),%xmm0
movsd  0xdf5(%rip),%xmm1
movsd  0xdf4(%rip),%xmm12
movsd  0xdf3(%rip),%xmm14
movapd %xmm10,%xmm9
movapd %xmm8,%xmm7
movapd %xmm11,%xmm3
movapd %xmm2,%xmm6
nopl   0x0(%rax,%rax,1)
ucomisd %xmm0,%xmm7
jbe    12b5 <SNPHWE2+0x1b5>
addsd  0xdb1(%rip),%xmm9
movapd %xmm7,%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm4
movapd %xmm9,%xmm5
addsd  %xmm12,%xmm5
mulsd  %xmm9,%xmm5
divsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm6
addsd  %xmm12,%xmm7
addsd  %xmm12,%xmm3
ucomisd %xmm6,%xmm14
ja     12f4 <SNPHWE2+0x1f4>
addsd  %xmm6,%xmm15
ucomisd %xmm13,%xmm15
jne    1250 <SNPHWE2+0x150>
jp     1250 <SNPHWE2+0x150>
xorpd  %xmm0,%xmm0
ret
mov    $0x1,%edx
test   %rcx,%rcx
je     12e6 <SNPHWE2+0x1e6>
jmp    1338 <SNPHWE2+0x238>
mov    $0x1,%edx
test   %rcx,%rcx
je     131a <SNPHWE2+0x21a>
jmp    1427 <SNPHWE2+0x327>
xor    %edx,%edx
ucomisd 0xd62(%rip),%xmm6
seta   %dl
add    $0x1,%rdx
movsd  0xd23(%rip),%xmm2
addsd  %xmm6,%xmm2
test   %rcx,%rcx
jne    1338 <SNPHWE2+0x238>
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm15
jne    1338 <SNPHWE2+0x238>
jp     1338 <SNPHWE2+0x238>
ret
xor    %edx,%edx
ucomisd 0xd32(%rip),%xmm6
seta   %dl
add    $0x1,%rdx
movsd  0xcf3(%rip),%xmm2
addsd  %xmm6,%xmm2
test   %rcx,%rcx
jne    1427 <SNPHWE2+0x327>
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm15
jne    1427 <SNPHWE2+0x327>
jp     1427 <SNPHWE2+0x327>
movsd  0xd01(%rip),%xmm0
ret
ucomisd 0xd07(%rip),%xmm10
jbe    139f <SNPHWE2+0x29f>
movsd  0xced(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movapd %xmm6,%xmm3
movapd %xmm2,%xmm5
addsd  %xmm0,%xmm12
addsd  %xmm0,%xmm4
movapd %xmm10,%xmm6
addsd  %xmm14,%xmm6
mulsd  %xmm10,%xmm6
movapd %xmm12,%xmm7
mulsd  0xc9b(%rip),%xmm7
mulsd  %xmm4,%xmm7
divsd  %xmm7,%xmm6
mulsd  %xmm3,%xmm6
addsd  %xmm1,%xmm10
addsd  %xmm6,%xmm2
ucomisd %xmm2,%xmm5
jae    139f <SNPHWE2+0x29f>
ucomisd %xmm9,%xmm10
ja     1350 <SNPHWE2+0x250>
test   %r8,%r8
jle    151d <SNPHWE2+0x41d>
add    $0x2,%rdi
xorps  %xmm0,%xmm0
cvtsi2sd %rdi,%xmm0
movsd  0xc44(%rip),%xmm5
movsd  0xc4c(%rip),%xmm3
movsd  0xc3c(%rip),%xmm4
nopl   0x0(%rax)
movapd %xmm2,%xmm1
movapd %xmm5,%xmm6
movapd %xmm8,%xmm5
mulsd  0xc33(%rip),%xmm5
mulsd  %xmm11,%xmm5
movapd %xmm0,%xmm7
addsd  %xmm14,%xmm7
mulsd  %xmm0,%xmm7
divsd  %xmm7,%xmm5
mulsd  %xmm6,%xmm5
addsd  %xmm5,%xmm2
ucomisd %xmm2,%xmm1
jae    151d <SNPHWE2+0x41d>
addsd  %xmm3,%xmm0
addsd  %xmm14,%xmm8
addsd  %xmm14,%xmm11
ucomisd %xmm4,%xmm8
ja     13d0 <SNPHWE2+0x2d0>
jmp    151d <SNPHWE2+0x41d>
ucomisd 0xbd9(%rip),%xmm7
jbe    149d <SNPHWE2+0x39d>
movapd %xmm0,%xmm13
cs nopw 0x0(%rax,%rax,1)
movapd %xmm6,%xmm4
movapd %xmm2,%xmm5
addsd  0xbbf(%rip),%xmm9
movapd %xmm7,%xmm6
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm6
mulsd  %xmm3,%xmm6
movapd %xmm9,%xmm1
addsd  %xmm12,%xmm1
mulsd  %xmm9,%xmm1
divsd  %xmm1,%xmm6
mulsd  %xmm4,%xmm6
addsd  %xmm6,%xmm2
ucomisd %xmm2,%xmm5
jae    1499 <SNPHWE2+0x399>
addsd  %xmm12,%xmm7
addsd  %xmm12,%xmm3
ucomisd %xmm13,%xmm7
movapd %xmm0,%xmm1
ja     1440 <SNPHWE2+0x340>
jmp    149d <SNPHWE2+0x39d>
movapd %xmm0,%xmm1
cmp    $0x2,%rdi
jl     151d <SNPHWE2+0x41d>
movapd %xmm1,%xmm4
movsd  0xb51(%rip),%xmm6
movsd  0xb81(%rip),%xmm3
movsd  0xb81(%rip),%xmm0
movsd  0xb80(%rip),%xmm9
nopl   0x0(%rax,%rax,1)
movapd %xmm2,%xmm1
movapd %xmm6,%xmm7
addsd  %xmm3,%xmm8
addsd  %xmm3,%xmm11
movapd %xmm10,%xmm6
addsd  %xmm12,%xmm6
mulsd  %xmm10,%xmm6
movapd %xmm8,%xmm5
mulsd  %xmm4,%xmm5
mulsd  %xmm11,%xmm5
divsd  %xmm5,%xmm6
mulsd  %xmm7,%xmm6
addsd  %xmm6,%xmm2
ucomisd %xmm2,%xmm1
addsd  %xmm0,%xmm10
jae    151d <SNPHWE2+0x41d>
ucomisd %xmm9,%xmm10
ja     14d0 <SNPHWE2+0x3d0>
test   %rcx,%rcx
je     1540 <SNPHWE2+0x440>
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
mulsd  0xb1f(%rip),%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm2,%xmm15
divsd  %xmm15,%xmm0
ret
addsd  %xmm2,%xmm15
divsd  %xmm15,%xmm2
movapd %xmm2,%xmm0
ret

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

LLVM IR (-O2):
@INFINITY = global double 0.000000e+00
define double @SNPHWE2(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp slt i64 %1, %2
%6 = select i1 %5, i64 %1, i64 %2
%7 = select i1 %5, i64 %2, i64 %1
%8 = shl nsw i64 %6, 1
%9 = add nsw i64 %8, %0
%10 = add nsw i64 %7, %0
%11 = add nsw i64 %10, %6
%12 = shl nsw i64 %11, 1
%13 = sitofp i64 %0 to double
%14 = sitofp i64 %6 to double
%15 = sitofp i64 %7 to double
%16 = icmp eq i64 %11, 0
br i1 %16, label %17, label %20
17: ; preds = %4
%18 = icmp eq i64 %3, 0
%19 = select i1 %18, double 1.000000e+00, double 5.000000e-01
br label %198
20: ; preds = %4
%21 = mul nsw i64 %12, %0
%22 = sub nsw i64 %12, %9
%23 = mul nsw i64 %22, %9
%24 = icmp sgt i64 %21, %23
%25 = load double, double* @INFINITY
br i1 %24, label %26, label %107
26: ; preds = %20, %48
%27 = phi double [ %42, %48 ], [ %13, %20 ]
%28 = phi double [ %34, %48 ], [ %14, %20 ]
%29 = phi double [ %35, %48 ], [ %15, %20 ]
%30 = phi double [ %49, %48 ], [ 0.000000e+00, %20 ]
%31 = phi double [ %41, %48 ], [ 0x3ABFFFFFFFFFFE00, %20 ]
%32 = fcmp ogt double %27, 1.500000e+00
br i1 %32, label %33, label %51
33: ; preds = %26
%34 = fadd double %28, 1.000000e+00
%35 = fadd double %29, 1.000000e+00
%36 = fadd double %27, -1.000000e+00
%37 = fmul double %27, %36
%38 = fmul double %34, 4.000000e+00
%39 = fmul double %38, %35
%40 = fdiv double %37, %39
%41 = fmul double %31, %40
%42 = fadd double %27, -2.000000e+00
%43 = fcmp olt double %41, 0x3AC0000000000000
br i1 %43, label %44, label %48
44: ; preds = %33
%45 = fcmp ogt double %41, 0x3ABFFFFFFFFFFC00
%46 = select i1 %45, i64 2, i64 1
%47 = fadd double %41, 0x3ABFFFFFFFFFFE00
br label %51
48: ; preds = %33
%49 = fadd double %30, %41
%50 = fcmp oeq double %49, %25
br i1 %50, label %198, label %26
51: ; preds = %26, %44
%52 = phi i64 [ %46, %44 ], [ 1, %26 ]
%53 = phi double [ %42, %44 ], [ %27, %26 ]
%54 = phi double [ %34, %44 ], [ %28, %26 ]
%55 = phi double [ %35, %44 ], [ %29, %26 ]
%56 = phi double [ %47, %44 ], [ 0x3ABFFFFFFFFFFE00, %26 ]
%57 = phi double [ %41, %44 ], [ %31, %26 ]
%58 = fcmp une double %30, 0.000000e+00
%59 = icmp ne i64 %3, 0
%60 = or i1 %59, %58
br i1 %60, label %61, label %198
61: ; preds = %51
%62 = fcmp ogt double %53, 1.500000e+00
br i1 %62, label %63, label %82
63: ; preds = %61, %63
%64 = phi double [ %77, %63 ], [ %53, %61 ]
%65 = phi double [ %69, %63 ], [ %54, %61 ]
%66 = phi double [ %70, %63 ], [ %55, %61 ]
%67 = phi double [ %78, %63 ], [ %56, %61 ]
%68 = phi double [ %76, %63 ], [ %57, %61 ]
%69 = fadd double %65, 1.000000e+00
%70 = fadd double %66, 1.000000e+00
%71 = fadd double %64, -1.000000e+00
%72 = fmul double %64, %71
%73 = fmul double %69, 4.000000e+00
%74 = fmul double %73, %70
%75 = fdiv double %72, %74
%76 = fmul double %68, %75
%77 = fadd double %64, -2.000000e+00
%78 = fadd double %67, %76
%79 = fcmp ugt double %78, %67
%80 = fcmp ogt double %77, 1.500000e+00
%81 = select i1 %79, i1 %80, i1 false
br i1 %81, label %63, label %82
82: ; preds = %63, %61
%83 = phi double [ %56, %61 ], [ %78, %63 ]
%84 = icmp sgt i64 %6, 0
br i1 %84, label %85, label %185
85: ; preds = %82
%86 = add nsw i64 %0, 2
%87 = sitofp i64 %86 to double
br label %88
88: ; preds = %85, %102
%89 = phi double [ %105, %102 ], [ %15, %85 ]
%90 = phi double [ %104, %102 ], [ %14, %85 ]
%91 = phi double [ %103, %102 ], [ %87, %85 ]
%92 = phi double [ %99, %102 ], [ 0x3ABFFFFFFFFFFE00, %85 ]
%93 = phi double [ %100, %102 ], [ %83, %85 ]
%94 = fmul double %90, 4.000000e+00
%95 = fmul double %94, %89
%96 = fadd double %91, -1.000000e+00
%97 = fmul double %91, %96
%98 = fdiv double %95, %97
%99 = fmul double %92, %98
%100 = fadd double %93, %99
%101 = fcmp ugt double %100, %93
br i1 %101, label %102, label %185
102: ; preds = %88
%103 = fadd double %91, 2.000000e+00
%104 = fadd double %90, -1.000000e+00
%105 = fadd double %89, -1.000000e+00
%106 = fcmp ogt double %104, 5.000000e-01
br i1 %106, label %88, label %185
107: ; preds = %20, %129
%108 = phi double [ %115, %129 ], [ %13, %20 ]
%109 = phi double [ %122, %129 ], [ %14, %20 ]
%110 = phi double [ %123, %129 ], [ %15, %20 ]
%111 = phi double [ %130, %129 ], [ 0.000000e+00, %20 ]
%112 = phi double [ %121, %129 ], [ 0x3ABFFFFFFFFFFE00, %20 ]
%113 = fcmp ogt double %109, 5.000000e-01
br i1 %113, label %114, label %132
114: ; preds = %107
%115 = fadd double %108, 2.000000e+00
%116 = fmul double %109, 4.000000e+00
%117 = fmul double %116, %110
%118 = fadd double %115, -1.000000e+00
%119 = fmul double %115, %118
%120 = fdiv double %117, %119
%121 = fmul double %112, %120
%122 = fadd double %109, -1.000000e+00
%123 = fadd double %110, -1.000000e+00
%124 = fcmp olt double %121, 0x3AC0000000000000
br i1 %124, label %125, label %129
125: ; preds = %114
%126 = fcmp ogt double %121, 0x3ABFFFFFFFFFFC00
%127 = select i1 %126, i64 2, i64 1
%128 = fadd double %121, 0x3ABFFFFFFFFFFE00
br label %132
129: ; preds = %114
%130 = fadd double %111, %121
%131 = fcmp oeq double %130, %25
br i1 %131, label %198, label %107
132: ; preds = %107, %125
%133 = phi i64 [ %127, %125 ], [ 1, %107 ]
%134 = phi double [ %115, %125 ], [ %108, %107 ]
%135 = phi double [ %122, %125 ], [ %109, %107 ]
%136 = phi double [ %123, %125 ], [ %110, %107 ]
%137 = phi double [ %128, %125 ], [ 0x3ABFFFFFFFFFFE00, %107 ]
%138 = phi double [ %121, %125 ], [ %112, %107 ]
%139 = fcmp une double %111, 0.000000e+00
%140 = icmp ne i64 %3, 0
%141 = or i1 %140, %139
br i1 %141, label %142, label %198
142: ; preds = %132
%143 = fcmp ogt double %135, 5.000000e-01
br i1 %143, label %144, label %163
144: ; preds = %142, %144
%145 = phi double [ %150, %144 ], [ %134, %142 ]
%146 = phi double [ %157, %144 ], [ %135, %142 ]
%147 = phi double [ %158, %144 ], [ %136, %142 ]
%148 = phi double [ %159, %144 ], [ %137, %142 ]
%149 = phi double [ %156, %144 ], [ %138, %142 ]
%150 = fadd double %145, 2.000000e+00
%151 = fmul double %146, 4.000000e+00
%152 = fmul double %151, %147
%153 = fadd double %150, -1.000000e+00
%154 = fmul double %150, %153
%155 = fdiv double %152, %154
%156 = fmul double %149, %155
%157 = fadd double %146, -1.000000e+00
%158 = fadd double %147, -1.000000e+00
%159 = fadd double %148, %156
%160 = fcmp ugt double %159, %148
%161 = fcmp ogt double %157, 5.000000e-01
%162 = select i1 %160, i1 %161, i1 false
br i1 %162, label %144, label %163
163: ; preds = %144, %142
%164 = phi double [ %137, %142 ], [ %159, %144 ]
%165 = icmp sgt i64 %0, 1
br i1 %165, label %166, label %185
166: ; preds = %163, %166
%167 = phi double [ %173, %166 ], [ %15, %163 ]
%168 = phi double [ %172, %166 ], [ %14, %163 ]
%169 = phi double [ %182, %166 ], [ %13, %163 ]
%170 = phi double [ %179, %166 ], [ 0x3ABFFFFFFFFFFE00, %163 ]
%171 = phi double [ %180, %166 ], [ %164, %163 ]
%172 = fadd double %168, 1.000000e+00
%173 = fadd double %167, 1.000000e+00
%174 = fadd double %169, -1.000000e+00
%175 = fmul double %169, %174
%176 = fmul double %172, 4.000000e+00
%177 = fmul double %176, %173
%178 = fdiv double %175, %177
%179 = fmul double %170, %178
%180 = fadd double %171, %179
%181 = fcmp ugt double %180, %171
%182 = fadd double %169, -2.000000e+00
%183 = fcmp ogt double %182, 1.500000e+00
%184 = select i1 %181, i1 %183, i1 false
br i1 %184, label %166, label %185
185: ; preds = %166, %88, %102, %163, %82
%186 = phi i64 [ %52, %82 ], [ %133, %163 ], [ %52, %102 ], [ %52, %88 ], [ %133, %166 ]
%187 = phi double [ %83, %82 ], [ %164, %163 ], [ %100, %102 ], [ %100, %88 ], [ %180, %166 ]
%188 = phi double [ %30, %82 ], [ %111, %163 ], [ %30, %102 ], [ %30, %88 ], [ %111, %166 ]
%189 = icmp eq i64 %3, 0
br i1 %189, label %190, label %193
190: ; preds = %185
%191 = fadd double %187, %188
%192 = fdiv double %187, %191
br label %198
193: ; preds = %185
%194 = sitofp i64 %186 to double
%195 = tail call double @llvm.fmuladd.f64(double %194, double 0xBAAFFFFFFFFFFE00, double %187)
%196 = fadd double %187, %188
%197 = fdiv double %195, %196
br label %198
198: ; preds = %129, %48, %132, %51, %17, %193, %190
%199 = phi double [ %197, %193 ], [ %192, %190 ], [ %19, %17 ], [ 1.000000e+00, %51 ], [ 1.000000e+00, %132 ], [ 0.000000e+00, %48 ], [ 0.000000e+00, %129 ]
ret double %199
}