user: Translate the below assembly code into C programming language:

```asm
<conchiv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %edx,-0x50(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L5
  mov    -0x4c(%rbp),%eax
  mov    %eax,%esi
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fatalx@plt>
L5:
  mov    -0x50(%rbp),%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L94
  mov    -0x50(%rbp),%eax
  mov    %eax,%esi
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fatalx@plt>
L94:
  movl   $0x0,-0x3c(%rbp)
  jmp    L95
L29:
  movl   $0x0,-0x38(%rbp)
  jmp    L55
L8:
  mov    -0x3c(%rbp),%eax
  imul   -0x50(%rbp),%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  addl   $0x1,-0x38(%rbp)
L55:
  mov    -0x38(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L8
  addl   $0x1,-0x3c(%rbp)
L95:
  mov    -0x3c(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L29
  movsd  D38(%rip),%xmm0
  comisd -0x30(%rbp),%xmm0
  jbe    L73
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fatalx@plt>
L73:
  movl   $0x0,-0x3c(%rbp)
  jmp    L78
L3:
  movl   $0x0,-0x38(%rbp)
  jmp    L11
L63:
  mov    -0x3c(%rbp),%eax
  imul   -0x50(%rbp),%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  divsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  D20(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L85
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x50(%rbp),%edx
  mov    -0x4c(%rbp),%ecx
  mov    -0x48(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <printmat@plt>
  lea    D67(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fatalx@plt>
L85:
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x38(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  mov    %eax,%esi
  lea    D82(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  lea    D65(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  lea    D65(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movsd  -0x8(%rbp),%xmm1
  divsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  lea    D65(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <printnl@plt>
  movsd  -0x8(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  divsd  -0x10(%rbp),%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addl   $0x1,-0x38(%rbp)
L11:
  mov    -0x38(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L63
  addl   $0x1,-0x3c(%rbp)
L78:
  mov    -0x3c(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L3
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movsd  -0x28(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D62
data_type: string
name: unpack_data
arguments: data_label: D38
data_type: f64
name: unpack_data
arguments: data_label: D12
data_type: string
name: unpack_data
arguments: data_label: D20
data_type: byte[8]
name: unpack_data
arguments: data_label: D52
data_type: string
name: unpack_data
arguments: data_label: D67
data_type: string
name: unpack_data
arguments: data_label: D82
data_type: string
name: unpack_data
arguments: data_label: D65
data_type: string
name: unpack_data
arguments: data_label: D58
data_type: string

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


tool: D38: 0.001

tool: D12: (conchiv) no data


tool: {"D20": [0x11,0xea,0x2d,0x81,0x99,0x97,0x71,0x3d]}

tool: D52: bad conchi

tool: D67: (conchiv) zero row or column sum


tool: D82: conchiv: %4d %4d 

tool: D65: %9.3f 

tool: D58: %9.3f   

assistant: ```c
double conchiv(double *a, int m, int n) {
  double *rsum, *csum, ee, tot = 0, chsq = 0, y;
  int i, j, k;
  if ((rsum = (double *)calloc((m), sizeof(double))) == NULL)
    fatalx("Unable to allocate %d unit(s) for item \n", m);
  if ((csum = (double *)calloc((n), sizeof(double))) == NULL)
    fatalx("Unable to allocate %d unit(s) for item \n", n);
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      k = i * n + j;
      rsum[i] += a[k];
      csum[j] += a[k];
      tot += a[k];
    }
  }
  if (tot < 0.001)
    fatalx("(conchiv) no data\n");
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      k = i * n + j;
      ee = rsum[i] * csum[j] / tot;
      if (ee < 1.0e-12) {
        printf("bad conchi\n");
        printmat(a, m, n);
        fatalx("(conchiv) zero row or column sum\n");
      }
      y = a[k] - ee;
      printf("conchiv: %4d %4d ", i, j);
      printf("%9.3f ", a[k]);
      printf("%9.3f   ", ee);
      printf("%9.3f ", y);
      printf("%9.3f ", y / sqrt(ee));
      printnl();
      chsq += (y * y) / ee;
    }
  }
  free(rsum);
  free(csum);
  return chsq;
}
```