user: 请将以下的汇编代码转换成C语言代码：

```asm
<conchi>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %esi,%r12d
  mov    $0x8,%esi
  push   %rbp
  mov    %r12d,%edi
  push   %rbx
  mov    %edx,%ebx
  sub    $0x48,%rsp
  call   <calloc@plt>
  mov    %rax,0x38(%rsp)
  test   %rax,%rax
  je     L36
L121:
  mov    $0x8,%esi
  mov    %ebx,%edi
  call   <calloc@plt>
  mov    %rax,0x30(%rsp)
  test   %rax,%rax
  je     L73
  test   %r12d,%r12d
  jle    L8
L28:
  mov    0x38(%rsp),%rsi
  mov    0x30(%rsp),%r10
  mov    %r12d,%eax
  lea    -0x1(%rbx),%ebp
  xor    %r8d,%r8d
  pxor   %xmm2,%xmm2
  lea    0x8(%r13),%r11
  mov    %rbp,%r14
  mov    %rsi,%rcx
  lea    (%rsi,%rax,8),%r9
  sub    %r13,%r10
L35:
  test   %ebx,%ebx
  jle    L72
  movslq %r8d,%rdx
  lea    0x0(,%rdx,8),%rdi
  add    %rbp,%rdx
  lea    (%r11,%rdx,8),%rsi
  mov    %r10,%rdx
  lea    0x0(%r13,%rdi,1),%rax
  sub    %rdi,%rdx
  nopl   0x0(%rax)
L155:
  movsd  (%rcx),%xmm0
  addsd  (%rax),%xmm0
  lea    (%rdx,%rax,1),%rdi
  add    $0x8,%rax
  movsd  %xmm0,(%rcx)
  movsd  (%rdi),%xmm0
  addsd  -0x8(%rax),%xmm0
  movsd  %xmm0,(%rdi)
  addsd  -0x8(%rax),%xmm2
  cmp    %rax,%rsi
  jne    L155
L72:
  add    $0x8,%rcx
  add    %ebx,%r8d
  cmp    %rcx,%r9
  jne    L35
  movsd  D79(%rip),%xmm0
  comisd %xmm2,%xmm0
  ja     L133
L16:
  mov    0x38(%rsp),%rax
  mov    0x30(%rsp),%rsi
  movl   $0x0,0x2c(%rsp)
  pxor   %xmm3,%xmm3
  movl   $0x0,0x28(%rsp)
  movsd  D37(%rip),%xmm5
  mov    %rax,0x20(%rsp)
  mov    %r14d,%eax
  lea    0x8(%rsi,%rax,8),%r14
  nopl   0x0(%rax)
L131:
  test   %ebx,%ebx
  jle    L159
  movslq 0x2c(%rsp),%rax
  mov    0x30(%rsp),%r15
  lea    0x0(%r13,%rax,8),%r8
  sub    %r15,%r8
  mov    %r8,%rbp
L142:
  mov    0x20(%rsp),%rax
  movsd  (%rax),%xmm4
L23:
  movsd  (%r15),%xmm1
  mulsd  %xmm4,%xmm1
  divsd  %xmm2,%xmm1
  comisd %xmm1,%xmm5
  ja     L119
  movsd  0x0(%rbp,%r15,1),%xmm0
  add    $0x8,%r15
  subsd  %xmm1,%xmm0
  mulsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm3
  cmp    %r15,%r14
  jne    L23
L159:
  addl   $0x1,0x28(%rsp)
  mov    0x28(%rsp),%eax
  add    %ebx,0x2c(%rsp)
  addq   $0x8,0x20(%rsp)
  cmp    %eax,%r12d
  jg     L131
L18:
  mov    0x38(%rsp),%rdi
  movsd  %xmm3,0x8(%rsp)
  call   <free@plt>
  mov    0x30(%rsp),%rdi
  call   <free@plt>
  movsd  0x8(%rsp),%xmm3
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  movapd %xmm3,%xmm0
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L119:
  lea    D23(%rip),%rdi
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <printf@plt>
  mov    %ebx,%edx
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <printmat@plt>
  xor    %eax,%eax
  lea    D10(%rip),%rdi
  call   <fatalx@plt>
  movsd  0x0(%rbp,%r15,1),%xmm0
  add    $0x8,%r15
  movsd  0x8(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm3
  mov    D37(%rip),%rax
  cmp    %r14,%r15
  subsd  %xmm1,%xmm0
  movsd  0x10(%rsp),%xmm2
  movq   %rax,%xmm5
  mulsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm3
  jne    L142
  jmp    L159
L36:
  mov    %r12d,%esi
  lea    D76(%rip),%rdi
  call   <fatalx@plt>
  jmp    L121
L73:
  mov    %ebx,%esi
  lea    D76(%rip),%rdi
  call   <fatalx@plt>
  test   %r12d,%r12d
  jg     L28
L8:
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  call   <fatalx@plt>
  pxor   %xmm3,%xmm3
  jmp    L18
L133:
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  movsd  %xmm2,0x8(%rsp)
  call   <fatalx@plt>
  movsd  0x8(%rsp),%xmm2
  jmp    L16
```

tool_calls: name: parse_data
arguments: data_label: D79
type_guessed: f64
name: parse_data
arguments: data_label: D37
type_guessed: byte[8]
name: parse_data
arguments: data_label: D23
type_guessed: string
name: parse_data
arguments: data_label: D10
type_guessed: string
name: parse_data
arguments: data_label: D76
type_guessed: string
name: parse_data
arguments: data_label: D5
type_guessed: string

tool: D79: 0.001

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

tool: D23: bad conchi


tool: D10: (conchi) zero row or column sum


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


tool: D5: (conchi) no data


assistant: ```c
double conchi(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("(conchi) 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("(conchi) zero row or column sum\n");
      }
      y = a[k] - ee;
      chsq += (y * y) / ee;
    }
  }
  free(rsum);
  free(csum);
  return chsq;
}
```