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

```asm
<conchiv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x28(%rsp)
  mov    %esi,%edi
  mov    %esi,0x38(%rsp)
  mov    %edx,%r14d
  mov    $0x8,%esi
  call   <calloc@plt>
  mov    %rax,0x48(%rsp)
  test   %rax,%rax
  je     L148
L102:
  mov    $0x8,%esi
  mov    %r14d,%edi
  call   <calloc@plt>
  mov    %rax,0x40(%rsp)
  test   %rax,%rax
  je     L170
L77:
  mov    0x38(%rsp),%eax
  test   %eax,%eax
  jle    L16
  mov    0x48(%rsp),%rsi
  mov    %rsi,%r8
  mov    %eax,%eax
  lea    (%rsi,%rax,8),%r10
  mov    $0x0,%r9d
  pxor   %xmm4,%xmm4
  movsd  %xmm4,0x10(%rsp)
  lea    -0x1(%r14),%ebp
  mov    0x28(%rsp),%r12
  lea    0x8(%r12),%rbx
  mov    0x40(%rsp),%r11
  sub    %r12,%r11
  jmp    L160
L148:
  mov    0x38(%rsp),%esi
  lea    D17(%rip),%rdi
  call   <fatalx@plt>
  jmp    L102
L170:
  mov    %r14d,%esi
  lea    D17(%rip),%rdi
  call   <fatalx@plt>
  jmp    L77
L185:
  mov    %r8,%rcx
  movslq %r9d,%rdx
  lea    0x0(,%rdx,8),%r13
  lea    (%r12,%r13,1),%rax
  add    %rbp,%rdx
  lea    (%rbx,%rdx,8),%rdi
  mov    %r11,%rsi
  sub    %r13,%rsi
L140:
  movsd  (%rcx),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rcx)
  lea    (%rax,%rsi,1),%rdx
  movsd  (%rdx),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  0x10(%rsp),%xmm3
  addsd  (%rax),%xmm3
  movsd  %xmm3,0x10(%rsp)
  add    $0x8,%rax
  cmp    %rdi,%rax
  jne    L140
L115:
  add    %r14d,%r9d
  add    $0x8,%r8
  cmp    %r10,%r8
  je     L9
L160:
  test   %r14d,%r14d
  jg     L185
  jmp    L115
L168:
  movsd  0x0(%r13,%rbx,1),%xmm0
  subsd  (%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  mov    %ebp,%edx
  mov    0x24(%rsp),%esi
  lea    D106(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movsd  0x0(%r13,%rbx,1),%xmm0
  mov    %r12,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  (%rsp),%xmm0
  lea    D54(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm0
  mov    %r12,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  pxor   %xmm0,%xmm0
  movsd  (%rsp),%xmm2
  ucomisd %xmm2,%xmm0
  ja     L154
  sqrtsd %xmm2,%xmm2
  movapd %xmm2,%xmm0
L186:
  movsd  0x8(%rsp),%xmm1
  divsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  mov    %r12,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <printnl@plt>
  movsd  0x8(%rsp),%xmm0
  mulsd  %xmm0,%xmm0
  divsd  (%rsp),%xmm0
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  add    $0x1,%ebp
  add    $0x8,%rbx
  cmp    %ebp,%r14d
  je     L97
L27:
  movsd  (%r15),%xmm0
  mulsd  (%rbx),%xmm0
  divsd  0x10(%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  movsd  D26(%rip),%xmm5
  comisd %xmm0,%xmm5
  jbe    L168
  lea    D60(%rip),%rdi
  call   <puts@plt>
  mov    %r14d,%edx
  mov    0x38(%rsp),%esi
  mov    0x28(%rsp),%rdi
  call   <printmat@plt>
  lea    D37(%rip),%rdi
  mov    $0x0,%eax
  call   <fatalx@plt>
  jmp    L168
L154:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  jmp    L186
L97:
  addl   $0x1,0x24(%rsp)
  mov    0x24(%rsp),%eax
  add    %r14d,0x3c(%rsp)
  addq   $0x8,0x30(%rsp)
  cmp    %eax,0x38(%rsp)
  jle    L23
L19:
  test   %r14d,%r14d
  jle    L97
  mov    0x30(%rsp),%r15
  mov    0x40(%rsp),%rsi
  mov    %rsi,%rbx
  movslq 0x3c(%rsp),%rax
  mov    0x28(%rsp),%rcx
  lea    (%rcx,%rax,8),%r13
  sub    %rsi,%r13
  mov    $0x0,%ebp
  lea    D70(%rip),%r12
  jmp    L27
L9:
  movsd  D80(%rip),%xmm0
  comisd 0x10(%rsp),%xmm0
  ja     L61
L189:
  mov    0x48(%rsp),%rax
  mov    %rax,0x30(%rsp)
  movl   $0x0,0x3c(%rsp)
  movl   $0x0,0x24(%rsp)
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x18(%rsp)
  jmp    L19
L61:
  lea    D89(%rip),%rdi
  mov    $0x0,%eax
  call   <fatalx@plt>
  jmp    L189
L16:
  lea    D89(%rip),%rdi
  mov    $0x0,%eax
  call   <fatalx@plt>
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x18(%rsp)
L23:
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    0x40(%rsp),%rdi
  call   <free@plt>
  movsd  0x18(%rsp),%xmm0
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: tag: D17
type_infered: string
name: unpack_data
arguments: tag: D106
type_infered: string
name: unpack_data
arguments: tag: D54
type_infered: string
name: unpack_data
arguments: tag: D26
type_infered: byte[8]
name: unpack_data
arguments: tag: D60
type_infered: string
name: unpack_data
arguments: tag: D37
type_infered: string
name: unpack_data
arguments: tag: D70
type_infered: string
name: unpack_data
arguments: tag: D80
type_infered: f64
name: unpack_data
arguments: tag: D89
type_infered: string

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


tool: D106: conchiv: %4d %4d 

tool: D54: %9.3f   

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

tool: D60: bad conchi

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


tool: D70: %9.3f 

tool: D80: 0.001

tool: D89: (conchiv) no data


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;
}
```