user: 请从给定的汇编指令推导出C源代码:

```asm
<z2x2>:
  endbr64
  push   %r15
  mov    $0x8,%esi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x2,%edi
  push   %rbx
  sub    $0x48,%rsp
  call   <calloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L44
L74:
  mov    $0x8,%esi
  mov    $0x2,%edi
  call   <calloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L113
L4:
  movsd  (%r14),%xmm0
  addsd  0x0(%rbp),%xmm0
  pxor   %xmm3,%xmm3
  movsd  %xmm0,(%r14)
  movsd  (%r12),%xmm0
  addsd  0x0(%rbp),%xmm0
  movsd  %xmm0,(%r12)
  movsd  (%r14),%xmm0
  addsd  0x8(%rbp),%xmm0
  addsd  0x0(%rbp),%xmm3
  movsd  %xmm0,(%r14)
  movsd  0x8(%r12),%xmm0
  addsd  0x8(%rbp),%xmm0
  movsd  %xmm0,0x8(%r12)
  movsd  0x8(%r14),%xmm0
  addsd  0x10(%rbp),%xmm0
  addsd  0x8(%rbp),%xmm3
  movsd  %xmm0,0x8(%r14)
  movsd  (%r12),%xmm0
  addsd  0x10(%rbp),%xmm0
  movsd  %xmm0,(%r12)
  movsd  0x8(%r14),%xmm0
  addsd  0x18(%rbp),%xmm0
  addsd  0x10(%rbp),%xmm3
  movsd  %xmm0,0x8(%r14)
  movsd  0x8(%r12),%xmm0
  addsd  0x18(%rbp),%xmm0
  movsd  %xmm0,0x8(%r12)
  addsd  0x18(%rbp),%xmm3
  movsd  D14(%rip),%xmm0
  comisd %xmm3,%xmm0
  ja     L56
L119:
  mov    %rbp,%r9
  movsd  D76(%rip),%xmm4
  mov    %r14,%r8
  xor    %ecx,%ecx
  sub    %r12,%r9
  pxor   %xmm0,%xmm0
  lea    0x10(%r12),%r10
  lea    D82(%rip),%r11
  lea    D34(%rip),%r15
L90:
  mov    %ecx,%r13d
  mov    %r12,%rbx
L97:
  movsd  (%r8),%xmm2
  mulsd  (%rbx),%xmm2
  divsd  %xmm3,%xmm2
  comisd %xmm2,%xmm4
  ja     L39
L73:
  movsd  (%r9,%rbx,1),%xmm1
  subsd  %xmm2,%xmm1
  test   %r13d,%r13d
  jne    L139
  movsd  %xmm1,0x38(%rsp)
L139:
  mulsd  %xmm1,%xmm1
  add    $0x8,%rbx
  add    $0x1,%r13d
  divsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  cmp    %rbx,%r10
  jne    L97
  add    $0x2,%ecx
  add    $0x10,%r9
  add    $0x8,%r8
  cmp    $0x4,%ecx
  jne    L90
  addsd  %xmm4,%xmm0
  pxor   %xmm5,%xmm5
  ucomisd %xmm0,%xmm5
  ja     L20
  sqrtsd %xmm0,%xmm0
L123:
  pxor   %xmm6,%xmm6
  comisd 0x38(%rsp),%xmm6
  jbe    L125
  xorpd  D17(%rip),%xmm0
L125:
  mov    %r14,%rdi
  movsd  %xmm0,(%rsp)
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  movsd  (%rsp),%xmm0
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L39:
  mov    %r11,%rdi
  mov    %r10,0x30(%rsp)
  mov    %ecx,0x2c(%rsp)
  mov    %r9,0x20(%rsp)
  mov    %r8,(%rsp)
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm0,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <printf@plt>
  mov    $0x2,%edx
  mov    $0x2,%esi
  mov    %rbp,%rdi
  call   <printmat@plt>
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fatalx@plt>
  mov    D76(%rip),%rax
  mov    0x30(%rsp),%r10
  lea    D82(%rip),%r11
  mov    0x2c(%rsp),%ecx
  mov    0x20(%rsp),%r9
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm0
  movq   %rax,%xmm4
  movsd  0x8(%rsp),%xmm2
  mov    (%rsp),%r8
  jmp    L73
  nopl   0x0(%rax)
L56:
  lea    D52(%rip),%rdi
  xor    %eax,%eax
  movsd  %xmm3,(%rsp)
  call   <fatalx@plt>
  movsd  (%rsp),%xmm3
  jmp    L119
  nopl   (%rax)
L113:
  mov    $0x2,%esi
  lea    D71(%rip),%rdi
  xor    %eax,%eax
  call   <fatalx@plt>
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L44:
  mov    $0x2,%esi
  lea    D71(%rip),%rdi
  xor    %eax,%eax
  call   <fatalx@plt>
  jmp    L74
L20:
  call   <sqrt@plt>
  jmp    L123
```

tool_calls: name: read_data
arguments: data_label: D14
type_guessed: f64
name: read_data
arguments: data_label: D76
type_guessed: byte[8]
name: read_data
arguments: data_label: D82
type_guessed: string
name: read_data
arguments: data_label: D34
type_guessed: string
name: read_data
arguments: data_label: D17
type_guessed: f32[4]
name: read_data
arguments: data_label: D52
type_guessed: string
name: read_data
arguments: data_label: D71
type_guessed: string

tool: D14: 0.001

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

tool: D82: bad conchi


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


tool: {"D17": [0.0,-0.0,0.0,0.0]}

tool: D52: (z2x2) no data


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


assistant: ```c
double z2x2(double *a) {
  double *rsum, *csum, ee, tot = 0, chsq = 0, y, dev00, z;
  int i, j, k, m = 2, n = 2;
  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("(z2x2) 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;
      if (k == 0)
        dev00 = y;
      chsq += (y * y) / ee;
    }
  }
  z = sqrt(chsq + 1.0e-12);
  if (dev00 < 0.0)
    z = -z;
  free(rsum);
  free(csum);
  return z;
}
```