user: Please show me the C implementation that matches the assembly code listed below:

```asm
<unbiasedest>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %rdi,-0xc8(%rbp)
  mov    %esi,-0xcc(%rbp)
  mov    %rdx,-0xd8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xb8(%rbp),%rdx
  mov    -0xcc(%rbp),%esi
  mov    -0xc8(%rbp),%rax
  mov    $0x0,%ecx
  mov    %rax,%rdi
  call   <ivmaxmin@plt>
  mov    -0xb8(%rbp),%eax
  add    $0x1,%eax
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x78(%rbp)
  cmpq   $0x0,-0x78(%rbp)
  jne    L204
  mov    -0xb8(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  lea    D88(%rip),%rax
  mov    %rax,%rdi
  call   <fatalx@plt>
L204:
  movl   $0x0,-0xb4(%rbp)
  jmp    L214
L186:
  mov    -0xb4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    (%rax),%ecx
  mov    -0xb4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x4,%rax
  mov    (%rax),%edx
  mov    -0xb4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x78(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0xb4(%rbp)
L214:
  mov    -0xb8(%rbp),%eax
  cmp    %eax,-0xb4(%rbp)
  jle    L186
  mov    -0xb8(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0xcc(%rbp),%eax
  mov    D55(%rip),%rdx
  movq   %rdx,%xmm0
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <initarray_2Ddouble@plt>
  mov    %rax,-0x98(%rbp)
  movl   $0x0,-0xb4(%rbp)
  jmp    L165
L87:
  mov    -0x98(%rbp),%rdx
  mov    -0xb4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  D93(%rip),%xmm0
  movsd  %xmm0,(%rax)
  movl   $0x1,-0xb0(%rbp)
  jmp    L191
L78:
  mov    -0xb4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    (%rax),%eax
  mov    -0xb0(%rbp),%edx
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ifall@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x70(%rbp)
  mov    -0xb4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0xb0(%rbp),%edx
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ifall@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x68(%rbp)
  movsd  D49(%rip),%xmm0
  comisd -0x68(%rbp),%xmm0
  jb     L55
  mov    -0x98(%rbp),%rdx
  mov    -0xb4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xb0(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  D39(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L190
L55:
  mov    -0x98(%rbp),%rdx
  mov    -0xb4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xb0(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  -0x70(%rbp),%xmm0
  divsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L190:
  addl   $0x1,-0xb0(%rbp)
L191:
  mov    -0xb0(%rbp),%eax
  cmp    -0xcc(%rbp),%eax
  jle    L78
  addl   $0x1,-0xb4(%rbp)
L165:
  mov    -0xb8(%rbp),%eax
  cmp    %eax,-0xb4(%rbp)
  jle    L87
  mov    -0xcc(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,-0x9c(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x90(%rbp)
  movl   $0x0,-0xac(%rbp)
  jmp    L128
L154:
  mov    -0xac(%rbp),%eax
  mov    %eax,-0xa4(%rbp)
  mov    -0xb8(%rbp),%eax
  lea    0x1(%rax),%edx
  lea    -0x60(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <ivzero@plt>
  movl   $0x0,-0xb0(%rbp)
  jmp    L98
L19:
  movl   $0x0,-0xa8(%rbp)
  mov    -0xa4(%rbp),%eax
  and    $0x1,%eax
  mov    %eax,-0xa0(%rbp)
  sarl   -0xa4(%rbp)
  cmpl   $0x1,-0xa0(%rbp)
  jne    L67
  mov    -0xb0(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xc8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xa8(%rbp)
L67:
  mov    -0xa8(%rbp),%eax
  cltq
  mov    -0x60(%rbp,%rax,4),%eax
  lea    0x1(%rax),%edx
  mov    -0xa8(%rbp),%eax
  cltq
  mov    %edx,-0x60(%rbp,%rax,4)
  addl   $0x1,-0xb0(%rbp)
L98:
  mov    -0xb0(%rbp),%eax
  cmp    -0xcc(%rbp),%eax
  jl     L19
  movsd  D93(%rip),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movl   $0x0,-0xb4(%rbp)
  jmp    L73
L108:
  mov    -0xb4(%rbp),%eax
  cltq
  mov    -0x60(%rbp,%rax,4),%eax
  mov    %eax,-0xa4(%rbp)
  movl   $0x0,-0xa0(%rbp)
  cmpl   $0x0,-0xb4(%rbp)
  jle    L29
  mov    -0xa4(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  mov    %eax,-0xa0(%rbp)
L29:
  mov    -0x98(%rbp),%rdx
  mov    -0xb4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xa4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x88(%rbp)
  movsd  D0(%rip),%xmm0
  comisd -0x88(%rbp),%xmm0
  jbe    L197
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0xb8(%rbp),%eax
  lea    0x1(%rax),%edx
  lea    -0x98(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <free2D@plt>
  movsd  D39(%rip),%xmm0
  jmp    L138
L197:
  cmpl   $0x1,-0xa0(%rbp)
  jne    L160
  movsd  -0x88(%rbp),%xmm0
  movq   D64(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x88(%rbp)
L160:
  movsd  -0x80(%rbp),%xmm0
  mulsd  -0x88(%rbp),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  addl   $0x1,-0xb4(%rbp)
L73:
  mov    -0xb8(%rbp),%eax
  cmp    %eax,-0xb4(%rbp)
  jle    L108
  movsd  -0x90(%rbp),%xmm0
  addsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x90(%rbp)
  addl   $0x1,-0xac(%rbp)
L128:
  mov    -0xac(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jle    L154
  mov    -0x90(%rbp),%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  cmp    $0x63,%eax
  jle    L26
  movsd  D39(%rip),%xmm0
  movsd  %xmm0,-0x90(%rbp)
L26:
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0xb8(%rbp),%eax
  lea    0x1(%rax),%edx
  lea    -0x98(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <free2D@plt>
  movsd  -0x90(%rbp),%xmm0
L138:
  movq   %xmm0,%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L63
  call   <__stack_chk_fail@plt>
L63:
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D88
data_type: string
name: extract_symbolic_data
arguments: data_label: D55
data_type: f64
name: extract_symbolic_data
arguments: data_label: D93
data_type: f64
name: extract_symbolic_data
arguments: data_label: D49
data_type: f64
name: extract_symbolic_data
arguments: data_label: D39
data_type: byte[8]
name: extract_symbolic_data
arguments: data_label: D0
data_type: byte[8]
name: extract_symbolic_data
arguments: data_label: D64
data_type: byte[8]

tool: D88: Unable to allocate %d unit(s) for item 


tool: D55: 0

tool: D93: 1

tool: D49: 0.1

tool: {"D39": [0x00,0x00,0x00,0x00,0x00,0x88,0xc3,0xc0]}

tool: {"D0": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: {"D64": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

assistant: ```c
double unbiasedest(int *ndx, int ndsize, int **counts) {
  double xtop, xbot, yest, y;
  int popind[20];
  int popmax, j, k, n, nmax, a, t, s;
  int *tcounts;
  double **xmomest, yp;
  ivmaxmin(ndx, ndsize, &popmax, NULL);
  if ((tcounts = (int *)calloc((popmax + 1), sizeof(int))) == NULL)
    fatalx("Unable to allocate %d unit(s) for item \n", popmax + 1);
  for (j = 0; j <= popmax; ++j) {
    tcounts[j] = counts[j][0] + counts[j][1];
  }
  xmomest = initarray_2Ddouble(popmax + 1, ndsize, 0.0);
  for (j = 0; j <= popmax; ++j) {
    xmomest[j][0] = 1.0;
    for (k = 1; k <= ndsize; ++k) {
      xtop = ifall(counts[j][0], k);
      xbot = ifall(tcounts[j], k);
      if (xbot <= 0.1)
        xmomest[j][k] = -10000.0;
      else
        xmomest[j][k] = (double)xtop / (double)xbot;
    }
  }
  nmax = (1 << (ndsize)) - 1;
  yest = 0.0;
  for (n = 0; n <= nmax; ++n) {
    t = n;
    ivzero(popind, popmax + 1);
    for (k = 0; k < ndsize; ++k) {
      a = 0;
      s = t & 1;
      t = t >> 1;
      if (s == 1)
        a = ndx[k];
      ++popind[a];
    }
    yp = 1.0;
    for (j = 0; j <= popmax; ++j) {
      t = popind[j];
      s = 0;
      if (j > 0)
        s = t % 2;
      y = xmomest[j][t];
      if (y < -1.0) {
        free(tcounts);
        free2D(&xmomest, popmax + 1);
        return (-10000.0);
      }
      if (s == 1)
        y = -y;
      yp *= y;
    }
    yest += yp;
  }
  if (fabs(yest) >= 100)
    yest = -10000;
  free(tcounts);
  free2D(&xmomest, popmax + 1);
  return (yest);
}
```