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

```asm
<contlm>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    0x38(%rsp),%rbx
  cmp    $0x1,%edi
  jle    L149
  mov    %rdx,%rbp
  mov    %rcx,%r11
  cmp    $0x1,%esi
  jle    L149
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  jae    L86
  mov    $0x3e7,%eax
  comisd D1(%rip),%xmm0
  jae    L167
  mov    %rdx,%r10
  movslq %esi,%rcx
  shl    $0x3,%rcx
  mov    %rdx,%r13
  mov    $0x0,%r12d
L33:
  mov    %r13,%rdx
  pxor   %xmm1,%xmm1
  mov    $0x0,%eax
L88:
  addsd  (%rdx),%xmm1
  add    $0x1,%eax
  add    %rcx,%rdx
  cmp    %eax,%edi
  jg     L88
  movsd  %xmm1,(%r11,%r12,8)
  add    $0x1,%r12
  add    $0x8,%r13
  cmp    %r12d,%esi
  jg     L33
  mov    %rbp,%rdx
  mov    $0x0,%ebp
L46:
  mov    $0x0,%eax
  pxor   %xmm1,%xmm1
L117:
  addsd  (%rdx,%rax,8),%xmm1
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L117
  movsd  %xmm1,(%r8,%rbp,8)
  add    $0x1,%rbp
  add    %rcx,%rdx
  cmp    %ebp,%edi
  jg     L46
  movq   $0x0,(%r9)
  mov    $0x0,%eax
L25:
  movsd  (%r9),%xmm1
  addsd  (%r8,%rax,8),%xmm1
  movsd  %xmm1,(%r9)
  add    $0x1,%rax
  cmp    %eax,%edi
  jg     L25
  mov    0x30(%rsp),%rdx
  mov    %rdx,%rbp
  mov    $0x0,%r12d
L164:
  mov    $0x0,%eax
L110:
  movsd  (%r8),%xmm1
  mulsd  (%r11,%rax,8),%xmm1
  divsd  (%r9),%xmm1
  movsd  %xmm1,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L110
  add    $0x1,%r12d
  add    $0x8,%r8
  add    %rcx,%rbp
  cmp    %r12d,%edi
  jg     L164
  movq   $0x0,(%rbx)
  mov    $0x0,%r8d
L127:
  mov    $0x0,%eax
L21:
  movsd  (%rdx,%rax,8),%xmm2
  movsd  (%r10,%rax,8),%xmm1
  subsd  %xmm2,%xmm1
  mulsd  %xmm1,%xmm1
  divsd  %xmm2,%xmm1
  addsd  (%rbx),%xmm1
  movsd  %xmm1,(%rbx)
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L21
  add    $0x1,%r8d
  add    %rcx,%r10
  add    %rcx,%rdx
  cmp    %r8d,%edi
  jg     L127
  sub    $0x1,%edi
  sub    $0x1,%esi
  imul   %esi,%edi
  call   <pchi@plt>
  mov    0x40(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rbx),%xmm1
  comisd %xmm0,%xmm1
  jb     L18
  mov    0x48(%rsp),%rax
  movl   $0x1,(%rax)
  mov    $0x0,%eax
L167:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L18:
  mov    0x48(%rsp),%rax
  movl   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L167
L149:
  mov    $0x3e7,%eax
  jmp    L167
L86:
  mov    $0x3e7,%eax
  jmp    L167
```

tool_calls: name: unpack_data
arguments: data_label: D1
data_type: f64

tool: D1: 1

assistant: ```c
int contlm(int l, int m, double a[], double al, double ac[], double ar[], double *at, double ef[], double *x20, double *x2, int *sw) {
  int i, j, k, n, nu;
  double w;
  if (l < 2 || m < 2 || al <= 0.0 || al >= 1.0)
    return 999;
  for (i = 0; i < m; i++) {
    w = 0.0;
    for (j = 0; j < l; j++) {
      k = j * m + i;
      w += a[k];
    }
    ac[i] = w;
  }
  for (i = 0; i < l; i++) {
    n = i * m;
    w = 0.0;
    for (j = 0; j < m; j++) {
      k = n + j;
      w += a[k];
    }
    ar[i] = w;
  }
  *at = 0.0;
  for (i = 0; i < l; i++)
    *at += ar[i];
  for (i = 0; i < l; i++) {
    n = i * m;
    for (j = 0; j < m; j++) {
      k = n + j;
      ef[k] = ar[i] * ac[j] / *at;
    }
  }
  *x20 = 0.0;
  for (i = 0; i < l; i++) {
    n = i * m;
    for (j = 0; j < m; j++) {
      k = n + j;
      w = a[k] - ef[k];
      *x20 += (w * w / ef[k]);
    }
  }
  nu = (l - 1) * (m - 1);
  *x2 = pchi(al, nu);
  if (*x20 >= *x2)
    *sw = 1;
  else
    *sw = 0;
  return 0;
}
```