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

/* Variables and functions */
int32_t SNPHWE_midp_t(int32_t obs_hets, int32_t obs_hom1, int32_t obs_hom2,
                      double thresh) {
  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;
  double curr_hets_t2 = obs_hets;
  double curr_homr_t2 = obs_homr;
  double curr_homc_t2 = obs_homc;
  double tailp1 =
      (1 - 0.00000000000005684341886080801486968994140625) *
      0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125 *
      0.5;
  double centerp = tailp1;
  double lastp2 =
      (1 - 0.00000000000005684341886080801486968994140625) *
      0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125;
  double tailp2 = 0;
  double tail1_ceil;
  double tail2_ceil;
  double lastp1;
  double curr_hets_t1;
  double curr_homr_t1;
  double curr_homc_t1;
  double exit_thresh;
  double exit_threshx;
  double ratio;
  double preaddp;
  if (!genotypes2) {
    return 0;
  }
  thresh = (1 - thresh) / thresh;
  if (obs_hets * genotypes2 > rare_copies * (genotypes2 - rare_copies)) {
    if (obs_hets < 2) {
      return 0;
    }
    exit_thresh =
        rare_copies * thresh *
        0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125;
    do {
      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) {
          tailp2 = tailp1;
          centerp += tailp1;
        } else {
          tailp2 = lastp2;
        }
        break;
      }
      centerp += lastp2;
      if (centerp > exit_thresh) {
        return 1;
      }
    } while (curr_hets_t2 > 1.5);
    exit_thresh = centerp / thresh;
    if (tailp1 + tailp2 >= exit_thresh) {
      return 0;
    }
    ratio = (curr_hets_t2 * (curr_hets_t2 - 1)) /
            (4 * (curr_homr_t2 + 1) * (curr_homc_t2 + 1));
    tail2_ceil = tailp2 + lastp2 * ratio / (1 - ratio);
    curr_hets_t1 = obs_hets + 2;
    curr_homr_t1 = obs_homr;
    curr_homc_t1 = obs_homc;
    lastp1 =
        (4 * curr_homr_t1 * curr_homc_t1) / (curr_hets_t1 * (curr_hets_t1 - 1));
    tail1_ceil = tailp1 * 2 / (1 - lastp1) - tailp1;
    if (tail1_ceil + tail2_ceil < exit_thresh) {
      return 1;
    }
    lastp1 *= tailp1 * 2;
    tailp1 += lastp1;
    if (obs_homr > 1) {
      exit_threshx = exit_thresh - tailp2;
      do {
        curr_hets_t1 += 2;
        curr_homr_t1 -= 1;
        curr_homc_t1 -= 1;
        lastp1 *= (4 * curr_homr_t1 * curr_homc_t1) /
                  (curr_hets_t1 * (curr_hets_t1 - 1));
        preaddp = tailp1;
        tailp1 += lastp1;
        if (tailp1 > exit_threshx) {
          return 0;
        }
        if (tailp1 <= preaddp) {
          break;
        }
      } while (curr_homr_t1 > 1.5);
    }
    if (tailp1 + tail2_ceil < exit_thresh) {
      return 1;
    }
    exit_threshx = exit_thresh - tailp1;
    while (curr_hets_t2 > 1) {
      curr_homr_t2 += 1;
      curr_homc_t2 += 1;
      lastp2 *= (curr_hets_t2 * (curr_hets_t2 - 1)) /
                (4 * curr_homr_t2 * curr_homc_t2);
      preaddp = tailp2;
      tailp2 += lastp2;
      if (tailp2 >= exit_threshx) {
        return 0;
      }
      if (tailp2 <= preaddp) {
        return 1;
      }
      curr_hets_t2 -= 2;
    }
    return 1;
  } else {
    if (!obs_homr) {
      return 0;
    }
    exit_thresh =
        rare_copies * thresh *
        0.00000000000000000000000010339757656912845935892608650874535669572651386260986328125;
    do {
      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) {
          tailp2 = tailp1;
          centerp += tailp1;
        } else {
          tailp2 = lastp2;
        }
        break;
      }
      centerp += lastp2;
      if (centerp > exit_thresh) {
        return 1;
      }
    } while (curr_homr_t2 > 0.5);
    exit_thresh = centerp / thresh;
    if (tailp1 + tailp2 >= exit_thresh) {
      return 0;
    }
    ratio = (4 * curr_homr_t2 * curr_homc_t2) /
            ((curr_hets_t2 + 2) * (curr_hets_t2 + 1));
    tail2_ceil = tailp2 + lastp2 * ratio / (1 - ratio);
    curr_hets_t1 = obs_hets;
    curr_homr_t1 = obs_homr + 1;
    curr_homc_t1 = obs_homc + 1;
    lastp1 =
        (curr_hets_t1 * (curr_hets_t1 - 1)) / (4 * curr_homr_t1 * curr_homc_t1);
    tail1_ceil = 2 * tailp1 / (1 - lastp1) - tailp1;
    lastp1 *= 2 * tailp1;
    tailp1 += lastp1;
    if (tail1_ceil + tail2_ceil < exit_thresh) {
      return 1;
    }
    if (obs_hets >= 4) {
      exit_threshx = exit_thresh - tailp2;
      do {
        curr_hets_t1 -= 2;
        curr_homr_t1 += 1;
        curr_homc_t1 += 1;
        lastp1 *= (curr_hets_t1 * (curr_hets_t1 - 1)) /
                  (4 * curr_homr_t1 * curr_homc_t1);
        preaddp = tailp1;
        tailp1 += lastp1;
        if (tailp1 > exit_threshx) {
          return 0;
        }
        if (tailp1 <= preaddp) {
          break;
        }
      } while (curr_hets_t1 > 3.5);
    }
    if (tailp1 + tail2_ceil < exit_thresh) {
      return 1;
    }
    exit_threshx = exit_thresh - tailp1;
    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 = tailp2;
      tailp2 += lastp2;
      if (tailp2 >= exit_threshx) {
        return 0;
      }
      if (tailp2 <= preaddp) {
        return 1;
      }
    }
    return 1;
  }
}


x86 assembly (clang, -O0):
<SNPHWE_midp_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    113c <SNPHWE_midp_t+0x3c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    114c <SNPHWE_midp_t+0x4c>
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)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
cvtsi2sdq -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
cvtsi2sdq -0x30(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe50(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    11d5 <SNPHWE_midp_t+0xd5>
movq   $0x0,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  0xe33(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
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    178e <SNPHWE_midp_t+0x68e>
cmpq   $0x2,-0x10(%rbp)
jge    1226 <SNPHWE_midp_t+0x126>
movq   $0x0,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
cvtsi2sdq -0x40(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xddf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xdc3(%rip),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xdb1(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0xd95(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd95(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xd78(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd57(%rip),%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    1310 <SNPHWE_midp_t+0x210>
movsd  -0x78(%rbp),%xmm0
movsd  0xd5f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1301 <SNPHWE_midp_t+0x201>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    130b <SNPHWE_midp_t+0x20b>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    135b <SNPHWE_midp_t+0x25b>
movsd  -0x78(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    133f <SNPHWE_midp_t+0x23f>
movq   $0x1,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
jmp    1344 <SNPHWE_midp_t+0x244>
movsd  -0x50(%rbp),%xmm0
movsd  0xcf7(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1245 <SNPHWE_midp_t+0x145>
movsd  -0x70(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jb     1392 <SNPHWE_midp_t+0x292>
movq   $0x0,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0xc6c(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc5c(%rip),%xmm2
addsd  -0x58(%rbp),%xmm2
movsd  0xc5f(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xc43(%rip),%xmm2
addsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
mulsd  -0xc8(%rbp),%xmm1
ff
movsd  0xc14(%rip),%xmm2
subsd  -0xc8(%rbp),%xmm2
ff
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%rax
add    $0x2,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
cvtsi2sdq -0x38(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
cvtsi2sdq -0x30(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xbd3(%rip),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
movsd  0xb9b(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xb97(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  0xb72(%rip),%xmm1
subsd  -0x98(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
addsd  -0x90(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    14e6 <SNPHWE_midp_t+0x3e6>
movq   $0x1,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  0xb3a(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpq   $0x1,-0x38(%rbp)
jle    1650 <SNPHWE_midp_t+0x550>
movsd  -0xb8(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  0xaeb(%rip),%xmm0
addsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0xab3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  0xa97(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xa93(%rip),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
movsd  0xa5b(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
ucomisd -0xc0(%rbp),%xmm0
ff
jbe    1610 <SNPHWE_midp_t+0x510>
movq   $0x0,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  -0x68(%rbp),%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     162c <SNPHWE_midp_t+0x52c>
jmp    164b <SNPHWE_midp_t+0x54b>
jmp    1631 <SNPHWE_midp_t+0x531>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0xa07(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1535 <SNPHWE_midp_t+0x435>
jmp    1650 <SNPHWE_midp_t+0x550>
movsd  -0x68(%rbp),%xmm1
addsd  -0x90(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    167c <SNPHWE_midp_t+0x57c>
movq   $0x1,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  -0xb8(%rbp),%xmm0
ff
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  0x972(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1781 <SNPHWE_midp_t+0x681>
movsd  0x960(%rip),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0x94e(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0x932(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x932(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
ucomisd -0xc0(%rbp),%xmm0
ff
jb     1742 <SNPHWE_midp_t+0x642>
movq   $0x0,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  -0x80(%rbp),%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1766 <SNPHWE_midp_t+0x666>
movq   $0x1,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  -0x50(%rbp),%xmm0
movsd  0x8b5(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1691 <SNPHWE_midp_t+0x591>
movq   $0x1,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
cmpq   $0x0,-0x38(%rbp)
jne    17a6 <SNPHWE_midp_t+0x6a6>
movq   $0x0,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
cvtsi2sdq -0x40(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0x85f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0x85b(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0x841(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  0x815(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0x7f2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0x7dc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0x7d3(%rip),%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    1894 <SNPHWE_midp_t+0x794>
movsd  -0x78(%rbp),%xmm0
movsd  0x7db(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1885 <SNPHWE_midp_t+0x785>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    188f <SNPHWE_midp_t+0x78f>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    18df <SNPHWE_midp_t+0x7df>
movsd  -0x78(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    18c3 <SNPHWE_midp_t+0x7c3>
movq   $0x1,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
jmp    18c8 <SNPHWE_midp_t+0x7c8>
movsd  -0x58(%rbp),%xmm0
movsd  0x75b(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     17c5 <SNPHWE_midp_t+0x6c5>
movsd  -0x70(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jb     1916 <SNPHWE_midp_t+0x816>
movq   $0x0,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  0x702(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  0x6f8(%rip),%xmm1
addsd  -0x50(%rbp),%xmm1
movsd  0x6d3(%rip),%xmm2
addsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
mulsd  -0xc8(%rbp),%xmm1
ff
movsd  0x6a4(%rip),%xmm2
subsd  -0xc8(%rbp),%xmm2
ff
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x38(%rbp),%rax
add    $0x1,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x30(%rbp),%rax
add    $0x1,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0x63c(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x63c(%rip),%xmm1
mulsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0xb0(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0x620(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  0x5fb(%rip),%xmm1
subsd  -0x98(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0x5f2(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x88(%rbp),%xmm1
ff
addsd  -0x90(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    1a8c <SNPHWE_midp_t+0x98c>
movq   $0x1,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
cmpq   $0x4,-0x10(%rbp)
jl     1bc3 <SNPHWE_midp_t+0xac3>
movsd  -0xb8(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0x56c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0x540(%rip),%xmm0
addsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0x528(%rip),%xmm0
addsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0x500(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x500(%rip),%xmm1
mulsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0xb0(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
ucomisd -0xc0(%rbp),%xmm0
ff
jbe    1b83 <SNPHWE_midp_t+0xa83>
movq   $0x0,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  -0x68(%rbp),%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1b9f <SNPHWE_midp_t+0xa9f>
jmp    1bbe <SNPHWE_midp_t+0xabe>
jmp    1ba4 <SNPHWE_midp_t+0xaa4>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0x48c(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1aac <SNPHWE_midp_t+0x9ac>
jmp    1bc3 <SNPHWE_midp_t+0xac3>
movsd  -0x68(%rbp),%xmm1
addsd  -0x90(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    1bef <SNPHWE_midp_t+0xaef>
movq   $0x1,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  -0xb8(%rbp),%xmm0
ff
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  0x41f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1cf8 <SNPHWE_midp_t+0xbf8>
movsd  0x405(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0x3eb(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  0x3bf(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0x39c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0x386(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
ucomisd -0xc0(%rbp),%xmm0
ff
jb     1ccf <SNPHWE_midp_t+0xbcf>
movq   $0x0,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
movsd  -0x80(%rbp),%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1cf3 <SNPHWE_midp_t+0xbf3>
movq   $0x1,-0x8(%rbp)
jmp    1d00 <SNPHWE_midp_t+0xc00>
jmp    1c04 <SNPHWE_midp_t+0xb04>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SNPHWE_midp_t>:
cmp    %rdx,%rsi
mov    %rsi,%r8
cmovl  %rdx,%r8
cmovl  %rsi,%rdx
lea    (%r8,%rdi,1),%rsi
add    %rdx,%rsi
je     179b <SNPHWE_midp_t+0x69b>
lea    (%rdi,%rdx,2),%rcx
cvtsi2sd %rdi,%xmm10
cvtsi2sd %rdx,%xmm9
cvtsi2sd %r8,%xmm12
add    %rsi,%rsi
movsd  0xec6(%rip),%xmm8
movapd %xmm8,%xmm13
subsd  %xmm0,%xmm13
divsd  %xmm0,%xmm13
mov    %rsi,%rax
imul   %rdi,%rax
sub    %rcx,%rsi
imul   %rcx,%rsi
cmp    %rsi,%rax
jle    1217 <SNPHWE_midp_t+0x117>
cmp    $0x2,%rdi
jl     179b <SNPHWE_midp_t+0x69b>
cvtsi2sd %rcx,%xmm1
mulsd  %xmm13,%xmm1
mulsd  0xe8c(%rip),%xmm1
movsd  0xe8c(%rip),%xmm6
movsd  0xe8c(%rip),%xmm0
movsd  0xe94(%rip),%xmm4
movsd  0xe6b(%rip),%xmm11
movsd  0xeb2(%rip),%xmm14
movapd %xmm9,%xmm2
movapd %xmm12,%xmm5
movapd %xmm6,%xmm7
addsd  %xmm8,%xmm2
addsd  %xmm8,%xmm5
movapd %xmm10,%xmm6
addsd  0xe65(%rip),%xmm6
mulsd  %xmm10,%xmm6
movapd %xmm2,%xmm3
mulsd  %xmm4,%xmm3
mulsd  %xmm5,%xmm3
divsd  %xmm3,%xmm6
mulsd  %xmm7,%xmm6
addsd  0xe5b(%rip),%xmm10
ucomisd %xmm6,%xmm11
ja     12ec <SNPHWE_midp_t+0x1ec>
addsd  %xmm6,%xmm0
ucomisd %xmm1,%xmm0
ja     12cc <SNPHWE_midp_t+0x1cc>
ucomisd %xmm14,%xmm10
ja     11b0 <SNPHWE_midp_t+0xb0>
xorpd  %xmm15,%xmm15
jmp    14c8 <SNPHWE_midp_t+0x3c8>
test   %rdx,%rdx
je     179b <SNPHWE_midp_t+0x69b>
cvtsi2sd %rcx,%xmm3
mulsd  %xmm13,%xmm3
mulsd  0xdd6(%rip),%xmm3
movsd  0xdd6(%rip),%xmm5
movsd  0xdd6(%rip),%xmm0
movsd  0xddd(%rip),%xmm15
movsd  0xddc(%rip),%xmm14
movsd  0xdac(%rip),%xmm6
movapd %xmm10,%xmm4
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movapd %xmm5,%xmm7
addsd  0xda4(%rip),%xmm4
movapd %xmm9,%xmm5
mulsd  %xmm15,%xmm5
mulsd  %xmm12,%xmm5
movapd %xmm4,%xmm1
addsd  %xmm14,%xmm1
mulsd  %xmm4,%xmm1
divsd  %xmm1,%xmm5
mulsd  %xmm7,%xmm5
addsd  %xmm14,%xmm9
addsd  %xmm14,%xmm12
ucomisd %xmm5,%xmm6
ja     12d2 <SNPHWE_midp_t+0x1d2>
addsd  %xmm5,%xmm0
ucomisd %xmm3,%xmm0
ja     12cc <SNPHWE_midp_t+0x1cc>
ucomisd 0xd75(%rip),%xmm9
ja     1270 <SNPHWE_midp_t+0x170>
xorpd  %xmm11,%xmm11
jmp    1312 <SNPHWE_midp_t+0x212>
mov    $0x1,%eax
ret
ucomisd 0xd66(%rip),%xmm5
jbe    130d <SNPHWE_midp_t+0x20d>
movsd  0xd33(%rip),%xmm11
addsd  %xmm11,%xmm0
jmp    1312 <SNPHWE_midp_t+0x212>
ucomisd 0xd4c(%rip),%xmm6
jbe    14c3 <SNPHWE_midp_t+0x3c3>
movsd  0xd15(%rip),%xmm15
addsd  %xmm15,%xmm0
jmp    14c8 <SNPHWE_midp_t+0x3c8>
movapd %xmm5,%xmm11
divsd  %xmm13,%xmm0
movsd  0xcf9(%rip),%xmm1
addsd  %xmm11,%xmm1
ucomisd %xmm0,%xmm1
jae    179b <SNPHWE_midp_t+0x69b>
movsd  0xcc9(%rip),%xmm8
add    $0x1,%rdx
xorps  %xmm3,%xmm3
cvtsi2sd %rdx,%xmm3
addsd  %xmm4,%xmm8
add    $0x1,%r8
xorps  %xmm6,%xmm6
cvtsi2sd %r8,%xmm6
movapd %xmm10,%xmm1
unpcklpd %xmm9,%xmm1
movsd  0xcca(%rip),%xmm7
mulpd  0xcf2(%rip),%xmm1
addsd  %xmm10,%xmm7
movsd  %xmm7,%xmm1
movapd %xmm10,%xmm7
unpcklpd %xmm12,%xmm7
mulpd  %xmm1,%xmm7
unpcklpd %xmm4,%xmm1
movsd  0xc97(%rip),%xmm2
addpd  0xcd7(%rip),%xmm1
mulpd  %xmm3,%xmm2
movsd  %xmm2,%xmm1
movapd %xmm6,%xmm2
unpcklpd %xmm8,%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm2,%xmm7
movapd %xmm7,%xmm1
unpckhpd %xmm7,%xmm1
mulsd  %xmm5,%xmm1
movapd 0xcb9(%rip),%xmm8
subpd  %xmm7,%xmm8
movapd 0xcbc(%rip),%xmm2
unpcklpd %xmm1,%xmm2
divpd  %xmm8,%xmm2
movapd 0xcbb(%rip),%xmm1
unpcklpd %xmm11,%xmm1
addpd  %xmm2,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
addsd  %xmm2,%xmm1
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     179a <SNPHWE_midp_t+0x69a>
mulsd  0xbff(%rip),%xmm7
movsd  0xbfe(%rip),%xmm8
addsd  %xmm7,%xmm8
cmp    $0x4,%rdi
movapd %xmm2,-0x18(%rsp)
jl     1669 <SNPHWE_midp_t+0x569>
movapd %xmm0,%xmm1
subsd  %xmm11,%xmm1
movsd  %xmm1,-0x28(%rsp)
movapd %xmm8,%xmm13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm7,%xmm1
addsd  0xbeb(%rip),%xmm10
movsd  0xb9b(%rip),%xmm2
addsd  %xmm2,%xmm3
addsd  %xmm2,%xmm6
movapd %xmm10,%xmm7
addsd  %xmm14,%xmm7
mulsd  %xmm10,%xmm7
movapd %xmm3,%xmm2
mulsd  %xmm15,%xmm2
mulsd  %xmm6,%xmm2
divsd  %xmm2,%xmm7
mulsd  %xmm1,%xmm7
addsd  %xmm7,%xmm13
ucomisd -0x28(%rsp),%xmm13
ja     179b <SNPHWE_midp_t+0x69b>
ucomisd %xmm13,%xmm8
jae    166e <SNPHWE_midp_t+0x56e>
ucomisd 0xb99(%rip),%xmm10
movapd %xmm13,%xmm8
ja     1450 <SNPHWE_midp_t+0x350>
jmp    166e <SNPHWE_midp_t+0x56e>
movapd %xmm6,%xmm15
divsd  %xmm13,%xmm0
movsd  0xb43(%rip),%xmm1
addsd  %xmm15,%xmm1
ucomisd %xmm0,%xmm1
jae    179b <SNPHWE_midp_t+0x69b>
movsd  0xb13(%rip),%xmm11
addsd  %xmm2,%xmm11
mulsd  %xmm4,%xmm11
add    $0x2,%rdi
xorps  %xmm3,%xmm3
cvtsi2sd %rdi,%xmm3
unpcklpd %xmm10,%xmm1
movapd %xmm9,%xmm7
mulsd  %xmm4,%xmm7
addpd  0xb97(%rip),%xmm1
movsd  %xmm7,%xmm1
movapd %xmm15,%xmm7
movapd %xmm12,%xmm15
unpcklpd %xmm10,%xmm15
mulpd  %xmm1,%xmm15
movapd %xmm3,%xmm13
unpcklpd %xmm5,%xmm13
addpd  0xb7c(%rip),%xmm13
movapd %xmm3,%xmm1
unpcklpd %xmm11,%xmm1
mulpd  %xmm13,%xmm1
divpd  %xmm1,%xmm15
movapd %xmm15,%xmm1
unpckhpd %xmm15,%xmm1
mulsd  %xmm6,%xmm1
movapd 0xb12(%rip),%xmm11
subpd  %xmm15,%xmm11
movapd 0xb14(%rip),%xmm13
unpcklpd %xmm1,%xmm13
divpd  %xmm11,%xmm13
movapd 0xb12(%rip),%xmm1
movapd %xmm7,-0x28(%rsp)
unpcklpd %xmm7,%xmm1
addpd  %xmm13,%xmm1
movapd %xmm1,%xmm7
unpckhpd %xmm1,%xmm7
addsd  %xmm7,%xmm1
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     179a <SNPHWE_midp_t+0x69a>
movapd %xmm7,-0x18(%rsp)
mulsd  0xa49(%rip),%xmm15
movsd  0xa48(%rip),%xmm11
addsd  %xmm15,%xmm11
cmp    $0x2,%rdx
jl     16f9 <SNPHWE_midp_t+0x5f9>
movapd %xmm0,%xmm4
subsd  -0x28(%rsp),%xmm4
movapd %xmm11,%xmm13
xchg   %ax,%ax
movapd %xmm15,%xmm1
addsd  0xa23(%rip),%xmm3
addsd  0xa2a(%rip),%xmm12
unpcklpd %xmm3,%xmm9
addpd  0xabc(%rip),%xmm9
movapd 0xac4(%rip),%xmm7
unpcklpd %xmm3,%xmm7
mulpd  %xmm9,%xmm7
movapd %xmm7,%xmm15
mulsd  %xmm12,%xmm15
unpckhpd %xmm7,%xmm7
divsd  %xmm7,%xmm15
mulsd  %xmm1,%xmm15
addsd  %xmm15,%xmm13
ucomisd %xmm4,%xmm13
ja     179b <SNPHWE_midp_t+0x69b>
ucomisd %xmm13,%xmm11
jae    16fe <SNPHWE_midp_t+0x5fe>
ucomisd %xmm14,%xmm9
movapd %xmm13,%xmm11
ja     15f0 <SNPHWE_midp_t+0x4f0>
jmp    16fe <SNPHWE_midp_t+0x5fe>
movapd %xmm8,%xmm13
movapd -0x18(%rsp),%xmm1
addsd  %xmm13,%xmm1
ucomisd %xmm1,%xmm0
ja     179a <SNPHWE_midp_t+0x69a>
subsd  %xmm13,%xmm0
movsd  0x990(%rip),%xmm6
movsd  0x9a0(%rip),%xmm7
ucomisd %xmm7,%xmm9
jbe    179a <SNPHWE_midp_t+0x69a>
addsd  %xmm6,%xmm4
movapd %xmm9,%xmm1
mulsd  %xmm15,%xmm1
mulsd  %xmm12,%xmm1
movapd %xmm4,%xmm2
addsd  %xmm14,%xmm2
mulsd  %xmm4,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm5
movapd %xmm11,%xmm3
addsd  %xmm5,%xmm3
ucomisd %xmm0,%xmm3
jae    179b <SNPHWE_midp_t+0x69b>
addsd  %xmm14,%xmm12
addsd  %xmm14,%xmm9
ucomisd %xmm3,%xmm11
movapd %xmm3,%xmm11
jb     1698 <SNPHWE_midp_t+0x598>
jmp    179a <SNPHWE_midp_t+0x69a>
movapd %xmm11,%xmm13
movapd -0x18(%rsp),%xmm1
addsd  %xmm13,%xmm1
ucomisd %xmm1,%xmm0
ja     179a <SNPHWE_midp_t+0x69a>
ucomisd 0x8e4(%rip),%xmm10
jbe    179a <SNPHWE_midp_t+0x69a>
subsd  %xmm13,%xmm0
movapd -0x28(%rsp),%xmm3
movapd %xmm3,%xmm1
movsd  0x8f2(%rip),%xmm9
movsd  0x8f1(%rip),%xmm12
movsd  0x900(%rip),%xmm11
movapd %xmm6,%xmm4
addsd  %xmm8,%xmm2
addsd  %xmm8,%xmm5
movapd %xmm10,%xmm6
addsd  %xmm12,%xmm6
mulsd  %xmm10,%xmm6
movapd %xmm2,%xmm7
mulsd  %xmm9,%xmm7
mulsd  %xmm5,%xmm7
divsd  %xmm7,%xmm6
mulsd  %xmm4,%xmm6
addsd  %xmm6,%xmm1
ucomisd %xmm0,%xmm1
jae    179b <SNPHWE_midp_t+0x69b>
ucomisd %xmm1,%xmm3
addsd  %xmm11,%xmm10
jae    179a <SNPHWE_midp_t+0x69a>
ucomisd %xmm8,%xmm10
movapd %xmm1,%xmm3
ja     1748 <SNPHWE_midp_t+0x648>
ret
xor    %eax,%eax
ret

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

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