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

```asm
<contlm>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    0x38(%rsp),%rbx
  cmp    $0x1,%edi
  jle    L82
  cmp    $0x1,%esi
  jle    L82
  pxor   %xmm2,%xmm2
  mov    $0x3e7,%eax
  comisd %xmm0,%xmm2
  jae    L6
  comisd D2(%rip),%xmm0
  jae    L6
  mov    %rcx,%r11
  movslq %esi,%rcx
  mov    %rdx,%rbp
  mov    %rdx,%r10
  shl    $0x3,%rcx
  mov    %rdx,%r13
  xor    %r12d,%r12d
  nopl   0x0(%rax)
L80:
  mov    %r13,%rdx
  movapd %xmm2,%xmm1
  xor    %eax,%eax
  nopl   0x0(%rax)
L25:
  add    $0x1,%eax
  addsd  (%rdx),%xmm1
  add    %rcx,%rdx
  cmp    %eax,%edi
  jg     L25
  movsd  %xmm1,(%r11,%r12,8)
  add    $0x1,%r12
  add    $0x8,%r13
  cmp    %r12d,%esi
  jg     L80
  mov    %rbp,%rdx
  xor    %ebp,%ebp
  cs nopw 0x0(%rax,%rax,1)
L21:
  xor    %eax,%eax
  movapd %xmm2,%xmm1
  cs nopw 0x0(%rax,%rax,1)
L155:
  addsd  (%rdx,%rax,8),%xmm1
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L155
  movsd  %xmm1,(%r8,%rbp,8)
  add    $0x1,%rbp
  add    %rcx,%rdx
  cmp    %ebp,%edi
  jg     L21
  movq   $0x0,(%r9)
  xor    %eax,%eax
  movapd %xmm2,%xmm3
  nopl   0x0(%rax,%rax,1)
L121:
  addsd  (%r8,%rax,8),%xmm3
  add    $0x1,%rax
  movsd  %xmm3,(%r9)
  cmp    %eax,%edi
  jg     L121
  mov    0x30(%rsp),%rdx
  xor    %r12d,%r12d
  mov    %rdx,%rbp
  xchg   %ax,%ax
L9:
  xor    %eax,%eax
  jmp    L28
  nopl   0x0(%rax)
L103:
  movsd  (%r9),%xmm3
L28:
  movsd  (%r8),%xmm1
  mulsd  (%r11,%rax,8),%xmm1
  divsd  %xmm3,%xmm1
  movsd  %xmm1,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L103
  add    $0x1,%r12d
  add    $0x8,%r8
  add    %rcx,%rbp
  cmp    %r12d,%edi
  jle    L123
  movsd  (%r9),%xmm3
  jmp    L9
  nopl   0x0(%rax)
L123:
  movq   $0x0,(%rbx)
  xor    %r8d,%r8d
  nopw   0x0(%rax,%rax,1)
L41:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L2:
  movsd  (%rdx,%rax,8),%xmm3
  movsd  (%r10,%rax,8),%xmm1
  add    $0x1,%rax
  subsd  %xmm3,%xmm1
  mulsd  %xmm1,%xmm1
  divsd  %xmm3,%xmm1
  addsd  %xmm1,%xmm2
  movsd  %xmm2,(%rbx)
  cmp    %eax,%esi
  jg     L2
  add    $0x1,%r8d
  add    %rcx,%r10
  add    %rcx,%rdx
  cmp    %r8d,%edi
  jg     L41
  sub    $0x1,%esi
  sub    $0x1,%edi
  imul   %esi,%edi
  call   <pchi@plt>
  mov    0x40(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rbx),%xmm1
  mov    0x48(%rsp),%rax
  comisd %xmm0,%xmm1
  jb     L158
  movl   $0x1,(%rax)
  xor    %eax,%eax
L6:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L158:
  movl   $0x0,(%rax)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L82:
  add    $0x8,%rsp
  mov    $0x3e7,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: retrieve_data
arguments: label: D2
type: f64

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