user: Converte this assembly snippet into its equivalent C code:

```asm
<cntab2>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x1,%edi
  sub    $0x68,%rsp
  mov    0xa0(%rsp),%rax
  mov    %r8,0x10(%rsp)
  mov    %r9,0x18(%rsp)
  mov    %rax,0x30(%rsp)
  mov    0xa8(%rsp),%rax
  mov    %rax,0x38(%rsp)
  mov    0xb0(%rsp),%rax
  mov    %rax,0x40(%rsp)
  mov    0xb8(%rsp),%rax
  mov    %rax,0x48(%rsp)
  mov    0xc0(%rsp),%rax
  mov    %rax,0x50(%rsp)
  call   <vector@plt>
  mov    %r14d,%esi
  mov    $0x1,%edi
  mov    %rax,0x28(%rsp)
  mov    %rax,%r13
  call   <vector@plt>
  mov    %rax,0x20(%rsp)
  test   %r12d,%r12d
  jle    L14
  mov    %r12d,%edx
  lea    0x4(%r13),%rdi
  xor    %esi,%esi
  shl    $0x2,%rdx
  call   <memset@plt>
  mov    %r14d,%eax
  mov    %r14d,%r10d
  pxor   %xmm5,%xmm5
  shr    $0x2,%eax
  lea    0x1(%r12),%r11d
  lea    -0x1(%r14),%ecx
  and    $0xfffffffc,%r10d
  lea    -0x1(%rax),%r9d
  lea    0x1(%r10),%ebp
  movaps %xmm5,%xmm1
  mov    $0x1,%eax
  shl    $0x4,%r9
  add    $0x14,%r9
  nopw   0x0(%rax,%rax,1)
L104:
  test   %r14d,%r14d
  jle    L362
  mov    (%rbx,%rax,8),%rdx
  cmp    $0x2,%ecx
  jbe    L115
  lea    0x4(%rdx),%rsi
  lea    (%rdx,%r9,1),%rdi
  movaps %xmm5,%xmm2
  nopl   0x0(%rax)
L108:
  movdqu (%rsi),%xmm7
  add    $0x10,%rsi
  cvtdq2ps %xmm7,%xmm0
  movaps %xmm0,%xmm3
  addss  %xmm0,%xmm2
  movaps %xmm0,%xmm6
  addss  %xmm3,%xmm1
  shufps $0x55,%xmm0,%xmm6
  movaps %xmm0,%xmm4
  unpckhps %xmm0,%xmm4
  shufps $0xff,%xmm0,%xmm0
  addss  %xmm6,%xmm2
  addss  %xmm6,%xmm1
  addss  %xmm4,%xmm2
  addss  %xmm4,%xmm1
  addss  %xmm0,%xmm2
  addss  %xmm0,%xmm1
  cmp    %rdi,%rsi
  jne    L108
  mov    %ebp,%esi
  cmp    %r14d,%r10d
  je     L141
L156:
  movslq %esi,%rdi
  pxor   %xmm0,%xmm0
  cvtsi2ssl (%rdx,%rdi,4),%xmm0
  lea    0x0(,%rdi,4),%r8
  lea    0x1(%rsi),%edi
  addss  %xmm0,%xmm2
  addss  %xmm0,%xmm1
  cmp    %edi,%r14d
  jl     L141
  pxor   %xmm0,%xmm0
  add    $0x2,%esi
  cvtsi2ssl 0x4(%rdx,%r8,1),%xmm0
  addss  %xmm0,%xmm2
  addss  %xmm0,%xmm1
  cmp    %r14d,%esi
  jg     L141
  pxor   %xmm0,%xmm0
  cvtsi2ssl 0x8(%rdx,%r8,1),%xmm0
  addss  %xmm0,%xmm2
  addss  %xmm0,%xmm1
L141:
  movss  %xmm2,0x0(%r13,%rax,4)
L362:
  add    $0x1,%rax
  cmp    %r11,%rax
  jne    L104
  test   %r14d,%r14d
  jle    L179
L369:
  movslq %r14d,%rdx
  mov    0x20(%rsp),%rbp
  mov    $0x4,%eax
  movss  %xmm5,0x8(%rsp)
  shl    $0x2,%rdx
  test   %r14d,%r14d
  movss  %xmm1,0x4(%rsp)
  cmovle %rax,%rdx
  lea    0x4(%rbp),%rdi
  xor    %esi,%esi
  call   <memset@plt>
  lea    -0x1(%r12),%eax
  mov    %rbp,%rsi
  movss  0x8(%rsp),%xmm5
  movss  0x4(%rsp),%xmm1
  lea    0x10(%rbx,%rax,8),%rdi
  mov    $0x1,%r8d
L99:
  lea    0x0(,%r8,4),%rcx
  test   %r12d,%r12d
  jle    L2
  lea    0x8(%rbx),%rax
  movaps %xmm5,%xmm0
  nopl   0x0(%rax)
L168:
  mov    (%rax),%rdx
  pxor   %xmm2,%xmm2
  add    $0x8,%rax
  cvtsi2ssl (%rdx,%rcx,1),%xmm2
  addss  %xmm2,%xmm0
  cmp    %rax,%rdi
  jne    L168
  movss  %xmm0,(%rsi,%r8,4)
L2:
  add    $0x1,%r8
  cmp    %r8d,%r14d
  jge    L99
  mov    0x10(%rsp),%rax
  movl   $0x0,(%rax)
  test   %r12d,%r12d
  jle    L224
L358:
  mov    $0x1,%eax
  mov    %rbx,0x58(%rsp)
  mov    0x28(%rsp),%r13
  mov    0x10(%rsp),%rbx
  movss  %xmm1,0xc(%rsp)
  mov    %rax,%rbp
  jmp    L327
  nopl   0x0(%rax,%rax,1)
L192:
  add    $0x1,%rbp
  cmp    %ebp,%r12d
  jl     L15
L327:
  movss  0x0(%r13,%rbp,4),%xmm2
  ucomiss %xmm5,%xmm2
  jp     L127
  je     L192
L127:
  divss  0xc(%rsp),%xmm2
  movaps %xmm2,%xmm0
  movss  %xmm5,0x8(%rsp)
  add    $0x1,%rbp
  movss  %xmm2,0x4(%rsp)
  call   <log@plt>
  movss  0x4(%rsp),%xmm2
  movss  0x8(%rsp),%xmm5
  mulss  %xmm0,%xmm2
  movss  (%rbx),%xmm0
  subss  %xmm2,%xmm0
  movss  %xmm0,(%rbx)
  cmp    %ebp,%r12d
  jge    L327
L15:
  mov    0x18(%rsp),%rax
  movss  0xc(%rsp),%xmm1
  mov    0x58(%rsp),%rbx
  movl   $0x0,(%rax)
  test   %r14d,%r14d
  jle    L281
L71:
  mov    %rbx,0x58(%rsp)
  mov    0x20(%rsp),%r13
  mov    $0x1,%ebp
  mov    0x18(%rsp),%rbx
  movss  %xmm1,0xc(%rsp)
  jmp    L154
  nopl   0x0(%rax)
L305:
  add    $0x1,%rbp
  cmp    %ebp,%r14d
  jl     L54
L154:
  movss  0x0(%r13,%rbp,4),%xmm2
  ucomiss %xmm5,%xmm2
  jp     L314
  je     L305
L314:
  divss  0xc(%rsp),%xmm2
  movaps %xmm2,%xmm0
  movss  %xmm5,0x8(%rsp)
  add    $0x1,%rbp
  movss  %xmm2,0x4(%rsp)
  call   <log@plt>
  movss  0x4(%rsp),%xmm2
  movss  0x8(%rsp),%xmm5
  mulss  %xmm0,%xmm2
  movss  (%rbx),%xmm0
  subss  %xmm2,%xmm0
  movss  %xmm0,(%rbx)
  cmp    %ebp,%r14d
  jge    L154
L54:
  movl   $0x0,(%r15)
  movss  0xc(%rsp),%xmm1
  mov    0x58(%rsp),%rbx
  test   %r12d,%r12d
  jle    L258
  test   %r14d,%r14d
  jle    L312
  add    $0x8,%rbx
  mov    $0x1,%eax
  mov    %r12d,0xc(%rsp)
  mov    %r15,%r12
  movss  %xmm1,0x8(%rsp)
  mov    %r14d,%r15d
  mov    %rbx,%r14
  mov    %eax,%ebx
  nopl   0x0(%rax)
L275:
  mov    $0x4,%r13d
  mov    $0x1,%ebp
  jmp    L288
  nopl   (%rax)
L190:
  add    $0x1,%ebp
  add    $0x4,%r13
  cmp    %ebp,%r15d
  jl     L183
L288:
  mov    (%r14),%rax
  mov    (%rax,%r13,1),%eax
  test   %eax,%eax
  je     L190
  pxor   %xmm2,%xmm2
  add    $0x1,%ebp
  add    $0x4,%r13
  cvtsi2ss %eax,%xmm2
  divss  0x8(%rsp),%xmm2
  movaps %xmm2,%xmm0
  movss  %xmm2,0x4(%rsp)
  call   <log@plt>
  movss  0x4(%rsp),%xmm2
  mulss  %xmm0,%xmm2
  movss  (%r12),%xmm0
  subss  %xmm2,%xmm0
  movss  %xmm0,(%r12)
  cmp    %ebp,%r15d
  jge    L288
L183:
  add    $0x1,%ebx
  add    $0x8,%r14
  cmp    %ebx,0xc(%rsp)
  jge    L275
  mov    %r15d,%r14d
  mov    %r12,%r15
  mov    0xc(%rsp),%r12d
L312:
  movss  (%r15),%xmm5
L258:
  mov    0x10(%rsp),%rax
  mov    0x30(%rsp),%rbx
  mov    %r14d,%edx
  mov    $0x1,%esi
  mov    0x18(%rsp),%rcx
  mov    0x38(%rsp),%rdi
  subss  (%rax),%xmm5
  movsd  D7(%rip),%xmm2
  movss  %xmm5,(%rbx)
  movss  (%r15),%xmm0
  subss  (%rcx),%xmm0
  movss  %xmm0,(%rdi)
  movss  (%rcx),%xmm1
  movaps %xmm1,%xmm0
  cvtss2sd %xmm1,%xmm1
  subss  (%rbx),%xmm0
  addsd  %xmm2,%xmm1
  mov    0x40(%rsp),%rbx
  cvtss2sd %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rbx)
  movss  (%rax),%xmm1
  mov    0x48(%rsp),%rbx
  movaps %xmm1,%xmm0
  cvtss2sd %xmm1,%xmm1
  subss  (%rdi),%xmm0
  addsd  %xmm2,%xmm1
  mov    0x20(%rsp),%rdi
  cvtss2sd %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rbx)
  movss  (%rax),%xmm1
  addss  (%rcx),%xmm1
  mov    0x50(%rsp),%rax
  movaps %xmm1,%xmm0
  subss  (%r15),%xmm0
  cvtss2sd %xmm1,%xmm1
  addsd  %xmm2,%xmm1
  cvtss2sd %xmm0,%xmm0
  addsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  call   <free_vector@plt>
  mov    0x28(%rsp),%rdi
  add    $0x68,%rsp
  mov    %r12d,%edx
  pop    %rbx
  mov    $0x1,%esi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <free_vector@plt>
L115:
  movaps %xmm5,%xmm2
  mov    $0x1,%esi
  jmp    L156
L14:
  pxor   %xmm5,%xmm5
  movaps %xmm5,%xmm1
  test   %r14d,%r14d
  jg     L369
  mov    0x10(%rsp),%rax
  movl   $0x0,(%rax)
  mov    0x18(%rsp),%rax
  movl   $0x0,(%rax)
  movl   $0x0,(%r15)
  jmp    L258
L179:
  mov    0x10(%rsp),%rax
  movl   $0x0,(%rax)
  jmp    L358
L224:
  mov    0x18(%rsp),%rax
  movl   $0x0,(%rax)
  jmp    L71
L281:
  movl   $0x0,(%r15)
  test   %r12d,%r12d
  jg     L312
  jmp    L258
```

tool_calls: name: retrieve_data
arguments: label: D7
data_type: byte[8]

tool: {"D7": [0xa0,0xc2,0xeb,0xfe,0x4b,0x48,0xb4,0x39]}

assistant: ```c
void cntab2(int **nn, int ni, int nj, float *h, float *hx, float *hy, float *hygx, float *hxgy, float *uygx, float *uxgy, float *uxy) {
  int i, j;
  float sum = 0.0, p, *sumi, *sumj;
  sumi = vector(1, ni);
  sumj = vector(1, nj);
  for (i = 1; i <= ni; i++) {
    sumi[i] = 0.0;
    for (j = 1; j <= nj; j++) {
      sumi[i] += nn[i][j];
      sum += nn[i][j];
    }
  }
  for (j = 1; j <= nj; j++) {
    sumj[j] = 0.0;
    for (i = 1; i <= ni; i++)
      sumj[j] += nn[i][j];
  }
  *hx = 0.0;
  for (i = 1; i <= ni; i++)
    if (sumi[i]) {
      p = sumi[i] / sum;
      *hx -= p * log(p);
    }
  *hy = 0.0;
  for (j = 1; j <= nj; j++)
    if (sumj[j]) {
      p = sumj[j] / sum;
      *hy -= p * log(p);
    }
  *h = 0.0;
  for (i = 1; i <= ni; i++)
    for (j = 1; j <= nj; j++)
      if (nn[i][j]) {
        p = nn[i][j] / sum;
        *h -= p * log(p);
      }
  *hygx = (*h) - (*hx);
  *hxgy = (*h) - (*hy);
  *uygx = (*hy - *hygx) / (*hy + 1.0e-30);
  *uxgy = (*hx - *hxgy) / (*hx + 1.0e-30);
  *uxy = 2.0 * (*hx + *hy - *h) / (*hx + *hy + 1.0e-30);
  free_vector(sumj, 1, nj);
  free_vector(sumi, 1, ni);
}
```