user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<conchiv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x30(%rsp)
  mov    %esi,%edi
  mov    %esi,0x38(%rsp)
  mov    $0x8,%esi
  mov    %edx,0x2c(%rsp)
  call   <calloc@plt>
  mov    %rax,0x48(%rsp)
  test   %rax,%rax
  je     L176
L59:
  mov    0x2c(%rsp),%edi
  mov    $0x8,%esi
  call   <calloc@plt>
  mov    %rax,0x40(%rsp)
  test   %rax,%rax
  je     L30
  mov    0x38(%rsp),%eax
  test   %eax,%eax
  jle    L0
L88:
  mov    0x48(%rsp),%rsi
  mov    0x30(%rsp),%r12
  xor    %r8d,%r8d
  movq   $0x0,0x10(%rsp)
  mov    0x2c(%rsp),%ebp
  mov    0x40(%rsp),%r10
  mov    %rsi,%rcx
  lea    (%rsi,%rax,8),%r9
  lea    0x8(%r12),%r11
  lea    -0x1(%rbp),%ebx
  sub    %r12,%r10
  nopw   0x0(%rax,%rax,1)
L9:
  test   %ebp,%ebp
  jle    L134
  movslq %r8d,%rdx
  mov    %r10,%rsi
  lea    0x0(,%rdx,8),%r13
  add    %rbx,%rdx
  lea    (%r12,%r13,1),%rax
  lea    (%r11,%rdx,8),%rdi
  sub    %r13,%rsi
  nopl   0x0(%rax,%rax,1)
L42:
  movsd  (%rcx),%xmm0
  addsd  (%rax),%xmm0
  lea    (%rax,%rsi,1),%rdx
  add    $0x8,%rax
  movsd  0x10(%rsp),%xmm3
  movsd  %xmm0,(%rcx)
  movsd  (%rdx),%xmm0
  addsd  -0x8(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  addsd  -0x8(%rax),%xmm3
  movsd  %xmm3,0x10(%rsp)
  cmp    %rdi,%rax
  jne    L42
L134:
  add    $0x8,%rcx
  add    %ebp,%r8d
  cmp    %r9,%rcx
  jne    L9
  movsd  D40(%rip),%xmm0
  comisd 0x10(%rsp),%xmm0
  ja     L131
L105:
  movl   $0x0,0x3c(%rsp)
  mov    0x48(%rsp),%r13
  xor    %r14d,%r14d
  movq   $0x0,0x18(%rsp)
L94:
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  jle    L60
  movslq 0x3c(%rsp),%rax
  mov    0x30(%rsp),%rsi
  xor    %ebx,%ebx
  lea    D89(%rip),%rbp
  mov    0x40(%rsp),%rcx
  lea    (%rsi,%rax,8),%r12
  mov    %rcx,%r15
  sub    %rcx,%r12
  jmp    L72
  nopl   0x0(%rax,%rax,1)
L45:
  movsd  (%r12,%r15,1),%xmm0
  mov    %ebx,%edx
  mov    %r14d,%esi
  xor    %eax,%eax
  lea    D77(%rip),%rdi
  movsd  %xmm1,0x20(%rsp)
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  movsd  (%r12,%r15,1),%xmm0
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  0x20(%rsp),%xmm1
  mov    $0x1,%eax
  lea    D24(%rip),%rdi
  movapd %xmm1,%xmm0
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm0
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  0x20(%rsp),%xmm1
  pxor   %xmm6,%xmm6
  ucomisd %xmm1,%xmm6
  movapd %xmm1,%xmm0
  ja     L155
  sqrtsd %xmm0,%xmm0
L186:
  movsd  0x8(%rsp),%xmm2
  mov    %rbp,%rdi
  add    $0x1,%ebx
  add    $0x8,%r15
  mov    $0x1,%eax
  movsd  %xmm1,0x20(%rsp)
  divsd  %xmm0,%xmm2
  movapd %xmm2,%xmm0
  call   <printf@plt>
  xor    %eax,%eax
  call   <printnl@plt>
  movsd  0x8(%rsp),%xmm0
  movsd  0x20(%rsp),%xmm1
  mulsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  cmp    %ebx,0x2c(%rsp)
  je     L60
L72:
  movsd  D80(%rip),%xmm5
  movsd  0x0(%r13),%xmm1
  mulsd  (%r15),%xmm1
  divsd  0x10(%rsp),%xmm1
  comisd %xmm1,%xmm5
  jbe    L45
  lea    D60(%rip),%rdi
  movsd  %xmm1,0x8(%rsp)
  call   <puts@plt>
  mov    0x2c(%rsp),%edx
  mov    0x38(%rsp),%esi
  mov    0x30(%rsp),%rdi
  call   <printmat@plt>
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  call   <fatalx@plt>
  movsd  0x8(%rsp),%xmm1
  jmp    L45
  nopl   0x0(%rax,%rax,1)
L60:
  mov    0x2c(%rsp),%ecx
  add    $0x1,%r14d
  add    %ecx,0x3c(%rsp)
  add    $0x8,%r13
  cmp    %r14d,0x38(%rsp)
  jg     L94
L19:
  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
L176:
  mov    0x38(%rsp),%esi
  lea    D74(%rip),%rdi
  call   <fatalx@plt>
  jmp    L59
L30:
  mov    0x2c(%rsp),%esi
  lea    D74(%rip),%rdi
  call   <fatalx@plt>
  mov    0x38(%rsp),%eax
  test   %eax,%eax
  jg     L88
L0:
  lea    D2(%rip),%rdi
  xor    %eax,%eax
  call   <fatalx@plt>
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x18(%rsp)
  jmp    L19
L131:
  lea    D2(%rip),%rdi
  xor    %eax,%eax
  call   <fatalx@plt>
  jmp    L105
L155:
  movsd  %xmm1,0x20(%rsp)
  call   <sqrt@plt>
  movsd  0x20(%rsp),%xmm1
  jmp    L186
```

tool_calls: name: read_data
arguments: data_tag: D40
type_guessed: f64
name: read_data
arguments: data_tag: D89
type_guessed: string
name: read_data
arguments: data_tag: D77
type_guessed: string
name: read_data
arguments: data_tag: D24
type_guessed: string
name: read_data
arguments: data_tag: D80
type_guessed: byte[8]
name: read_data
arguments: data_tag: D60
type_guessed: string
name: read_data
arguments: data_tag: D12
type_guessed: string
name: read_data
arguments: data_tag: D74
type_guessed: string
name: read_data
arguments: data_tag: D2
type_guessed: string

tool: D40: 0.001

tool: D89: %9.3f 

tool: D77: conchiv: %4d %4d 

tool: D24: %9.3f   

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

tool: D60: bad conchi

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


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


tool: D2: (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;
}
```