user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<SNPHWE_t>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x58,%rsp
  mov    %rdi,-0xb8(%rbp)
  mov    %rsi,-0xc0(%rbp)
  mov    %rdx,-0xc8(%rbp)
  movsd  %xmm0,-0xd0(%rbp)
  mov    -0xc0(%rbp),%rax
  cmp    -0xc8(%rbp),%rax
  jge    L223
  mov    -0xc8(%rbp),%rax
  mov    %rax,-0xa8(%rbp)
  mov    -0xc0(%rbp),%rax
  mov    %rax,-0xa0(%rbp)
  jmp    L9
L223:
  mov    -0xc0(%rbp),%rax
  mov    %rax,-0xa8(%rbp)
  mov    -0xc8(%rbp),%rax
  mov    %rax,-0xa0(%rbp)
L9:
  mov    -0xa0(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0xb8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0xb8(%rbp),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  add    %rax,%rax
  mov    %rax,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0xb8(%rbp),%xmm0
  movsd  %xmm0,-0x98(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0xa0(%rbp),%xmm0
  movsd  %xmm0,-0x90(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0xa8(%rbp),%xmm0
  movsd  %xmm0,-0x88(%rbp)
  movsd  D37(%rip),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x70(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x68(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jne    L531
  mov    $0x0,%eax
  jmp    L138
L531:
  movsd  D16(%rip),%xmm0
  subsd  -0xd0(%rbp),%xmm0
  divsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  mov    -0xb8(%rbp),%rax
  imul   -0x38(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  sub    -0x40(%rbp),%rax
  imul   -0x40(%rbp),%rax
  cmp    %rax,%rdx
  jle    L297
  cmpq   $0x1,-0xb8(%rbp)
  jg     L387
  mov    $0x0,%eax
  jmp    L138
L387:
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0x40(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0xd0(%rbp),%xmm1
  movsd  D407(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
L14:
  movsd  -0x90(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x90(%rbp)
  movsd  -0x88(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x88(%rbp)
  movsd  -0x98(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  -0x98(%rbp),%xmm0
  movsd  -0x90(%rbp),%xmm2
  movsd  D524(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  -0x88(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  -0x70(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x70(%rbp)
  movsd  -0x98(%rbp),%xmm0
  movsd  D3(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x98(%rbp)
  movsd  D407(%rip),%xmm0
  comisd -0x70(%rbp),%xmm0
  jbe    L148
  movsd  -0x70(%rbp),%xmm0
  movsd  %xmm0,-0x68(%rbp)
  jmp    L437
L148:
  movsd  -0x78(%rbp),%xmm0
  addsd  -0x70(%rbp),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movsd  -0x78(%rbp),%xmm0
  comisd -0x30(%rbp),%xmm0
  jbe    L526
  mov    $0x1,%eax
  jmp    L138
L526:
  movsd  -0x98(%rbp),%xmm0
  comisd D199(%rip),%xmm0
  ja     L14
L437:
  movsd  -0x78(%rbp),%xmm0
  divsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x80(%rbp),%xmm0
  addsd  -0x68(%rbp),%xmm0
  comisd -0x30(%rbp),%xmm0
  jb     L343
  mov    $0x0,%eax
  jmp    L138
L343:
  movsd  -0x98(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  -0x98(%rbp),%xmm0
  movsd  -0x90(%rbp),%xmm2
  movsd  D16(%rip),%xmm1
  addsd  %xmm1,%xmm2
  movsd  D524(%rip),%xmm1
  mulsd  %xmm1,%xmm2
  movsd  -0x88(%rbp),%xmm3
  movsd  D16(%rip),%xmm1
  addsd  %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  D16(%rip),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x28(%rbp),%xmm1
  movsd  -0x68(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0xb8(%rbp),%rax
  add    $0x2,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0xa0(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0xa8(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x50(%rbp),%xmm1
  movsd  D524(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movsd  -0x58(%rbp),%xmm1
  movsd  D16(%rip),%xmm2
  subsd  %xmm2,%xmm1
  mulsd  -0x58(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  D16(%rip),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x60(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x20(%rbp),%xmm1
  movsd  -0x30(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L509
  mov    $0x1,%eax
  jmp    L138
L509:
  movsd  -0x60(%rbp),%xmm0
  mulsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x80(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  cmpq   $0x1,-0xa0(%rbp)
  jle    L72
  movsd  -0x30(%rbp),%xmm0
  subsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
L178:
  movsd  -0x58(%rbp),%xmm1
  movsd  D3(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  movsd  -0x50(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x48(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x50(%rbp),%xmm1
  movsd  D524(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movsd  -0x58(%rbp),%xmm1
  movsd  D16(%rip),%xmm2
  subsd  %xmm2,%xmm1
  mulsd  -0x58(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  -0x60(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x80(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  -0x80(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L490
  mov    $0x0,%eax
  jmp    L138
L490:
  movsd  -0x8(%rbp),%xmm0
  comisd -0x80(%rbp),%xmm0
  jae    L63
  movsd  -0x50(%rbp),%xmm0
  comisd D199(%rip),%xmm0
  ja     L178
  jmp    L72
L63:
  nop
L72:
  movsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x20(%rbp),%xmm1
  movsd  -0x30(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L538
  mov    $0x1,%eax
  jmp    L138
L538:
  movsd  -0x30(%rbp),%xmm0
  subsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  jmp    L301
L505:
  movsd  -0x90(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x90(%rbp)
  movsd  -0x88(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x88(%rbp)
  movsd  -0x98(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  -0x98(%rbp),%xmm0
  movsd  -0x90(%rbp),%xmm2
  movsd  D524(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  -0x88(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  -0x70(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x70(%rbp)
  movsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x68(%rbp),%xmm0
  addsd  -0x70(%rbp),%xmm0
  movsd  %xmm0,-0x68(%rbp)
  movsd  -0x68(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jb     L117
  mov    $0x0,%eax
  jmp    L138
L117:
  movsd  -0x8(%rbp),%xmm0
  comisd -0x68(%rbp),%xmm0
  jb     L201
  mov    $0x1,%eax
  jmp    L138
L201:
  movsd  -0x98(%rbp),%xmm0
  movsd  D3(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x98(%rbp)
L301:
  movsd  -0x98(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L505
  mov    $0x1,%eax
  jmp    L138
L297:
  cmpq   $0x0,-0xa0(%rbp)
  jne    L283
  mov    $0x0,%eax
  jmp    L138
L283:
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0x40(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0xd0(%rbp),%xmm1
  movsd  D407(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
L193:
  movsd  -0x98(%rbp),%xmm1
  movsd  D3(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x98(%rbp)
  movsd  -0x90(%rbp),%xmm1
  movsd  D524(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  -0x88(%rbp),%xmm0
  movsd  -0x98(%rbp),%xmm1
  movsd  D16(%rip),%xmm2
  subsd  %xmm2,%xmm1
  mulsd  -0x98(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  -0x70(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x70(%rbp)
  movsd  -0x90(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x90(%rbp)
  movsd  -0x88(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x88(%rbp)
  movsd  D407(%rip),%xmm0
  comisd -0x70(%rbp),%xmm0
  jbe    L450
  movsd  -0x70(%rbp),%xmm0
  movsd  %xmm0,-0x68(%rbp)
  jmp    L130
L450:
  movsd  -0x78(%rbp),%xmm0
  addsd  -0x70(%rbp),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movsd  -0x78(%rbp),%xmm0
  comisd -0x30(%rbp),%xmm0
  jbe    L235
  mov    $0x1,%eax
  jmp    L138
L235:
  movsd  -0x90(%rbp),%xmm0
  comisd D85(%rip),%xmm0
  ja     L193
L130:
  movsd  -0x78(%rbp),%xmm0
  divsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x80(%rbp),%xmm0
  addsd  -0x68(%rbp),%xmm0
  comisd -0x30(%rbp),%xmm0
  jb     L105
  mov    $0x0,%eax
  jmp    L138
L105:
  movsd  -0x90(%rbp),%xmm1
  movsd  D524(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  -0x88(%rbp),%xmm0
  movsd  -0x98(%rbp),%xmm2
  movsd  D3(%rip),%xmm1
  addsd  %xmm1,%xmm2
  movsd  -0x98(%rbp),%xmm3
  movsd  D16(%rip),%xmm1
  addsd  %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  D16(%rip),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x28(%rbp),%xmm1
  movsd  -0x68(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0xb8(%rbp),%xmm0
  movsd  %xmm0,-0x58(%rbp)
  mov    -0xa0(%rbp),%rax
  add    $0x1,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    -0xa8(%rbp),%rax
  add    $0x1,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x58(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  -0x58(%rbp),%xmm0
  movsd  -0x50(%rbp),%xmm2
  movsd  D524(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  -0x48(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  D16(%rip),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x60(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x60(%rbp),%xmm0
  mulsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x80(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x20(%rbp),%xmm1
  movsd  -0x30(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L247
  mov    $0x1,%eax
  jmp    L138
L247:
  cmpq   $0x3,-0xb8(%rbp)
  jle    L300
  movsd  -0x30(%rbp),%xmm0
  subsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
L427:
  movsd  -0x58(%rbp),%xmm0
  movsd  D3(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  movsd  -0x50(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x48(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x58(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  -0x58(%rbp),%xmm0
  movsd  -0x50(%rbp),%xmm2
  movsd  D524(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  -0x48(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  -0x60(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x80(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  -0x80(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L561
  mov    $0x0,%eax
  jmp    L138
L561:
  movsd  -0x8(%rbp),%xmm0
  comisd -0x80(%rbp),%xmm0
  jae    L511
  movsd  -0x58(%rbp),%xmm0
  comisd D555(%rip),%xmm0
  ja     L427
  jmp    L300
L511:
  nop
L300:
  movsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x20(%rbp),%xmm1
  movsd  -0x30(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L390
  mov    $0x1,%eax
  jmp    L138
L390:
  movsd  -0x30(%rbp),%xmm0
  subsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  jmp    L64
L345:
  movsd  -0x98(%rbp),%xmm1
  movsd  D3(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x98(%rbp)
  movsd  -0x90(%rbp),%xmm1
  movsd  D524(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  -0x88(%rbp),%xmm0
  movsd  -0x98(%rbp),%xmm1
  movsd  D16(%rip),%xmm2
  subsd  %xmm2,%xmm1
  mulsd  -0x98(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  -0x70(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x70(%rbp)
  movsd  -0x90(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x90(%rbp)
  movsd  -0x88(%rbp),%xmm0
  movsd  D16(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x88(%rbp)
  movsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x68(%rbp),%xmm0
  addsd  -0x70(%rbp),%xmm0
  movsd  %xmm0,-0x68(%rbp)
  movsd  -0x68(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jb     L523
  mov    $0x0,%eax
  jmp    L138
L523:
  movsd  -0x8(%rbp),%xmm0
  comisd -0x68(%rbp),%xmm0
  jae    L299
  jmp    L64
L299:
  mov    $0x1,%eax
  jmp    L138
L64:
  movsd  -0x90(%rbp),%xmm0
  comisd D85(%rip),%xmm0
  ja     L345
  mov    $0x1,%eax
L138:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D37
type: byte[8]
name: parse_data
arguments: label: D16
type: f64
name: parse_data
arguments: label: D407
type: f64
name: parse_data
arguments: label: D524
type: f32[2]
name: parse_data
arguments: label: D3
type: f32[2]
name: parse_data
arguments: label: D199
type: f64[2]
name: parse_data
arguments: label: D85
type: f64[2]
name: parse_data
arguments: label: D555
type: f64

tool: {"D37": [0x00,0xfe,0xff,0xff,0xff,0xff,0xbf,0x3a]}

tool: D16: 1

tool: D407: 1.0339757656912846e-25

tool: {"D524": [0.0,2.25]}

tool: {"D3": [0.0,2.0]}

tool: {"D199": [1.5,0.5]}

tool: {"D85": [0.5,3.5]}

tool: D555: 3.5

assistant: ```c
int32_t SNPHWE_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;
  double centerp = 0;
  double lastp2 = tailp1;
  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) {
        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 / (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 / (1 - lastp1);
    if (tail1_ceil + tail2_ceil < exit_thresh) {
      return 1;
    }
    lastp1 *= tailp1;
    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) {
        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 / (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 = tailp1 / (1 - lastp1);
    lastp1 *= 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;
  }
}
```