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

```asm
<dchisqr_sysrem>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  movsd  %xmm0,-0x50(%rbp)
  movsd  %xmm1,-0x58(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x1,-0x18(%rbp)
  jmp    L207
L89:
  fldz
  fstpt  -0x10(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jg     L16
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L108
L112:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L93
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D61(%rip),%xmm1
  andpd  %xmm1,%xmm0
  ucomisd D58(%rip),%xmm0
  setbe  %al
  xor    $0x1,%eax
  movzbl %al,%eax
  test   %eax,%eax
  jne    L93
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd -0x58(%rbp),%xmm0
  jbe    L93
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L142
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  jmp    L56
L142:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movq   D22(%rip),%xmm1
  xorpd  %xmm1,%xmm0
L56:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x50(%rbp),%xmm0
  comisd %xmm1,%xmm0
  ja     L25
  pxor   %xmm0,%xmm0
  comisd -0x50(%rbp),%xmm0
  jbe    L93
L25:
  mov    -0x34(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  subsd  %xmm2,%xmm0
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  mov    -0x34(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mulsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm1,%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D20(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x60(%rbp)
  fldl   -0x60(%rbp)
  fldt   -0x10(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x10(%rbp)
L93:
  addl   $0x1,-0x1c(%rbp)
L108:
  mov    -0x1c(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L112
  jmp    L155
L16:
  mov    -0x18(%rbp),%eax
  sub    -0x34(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L96
L146:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L62
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D61(%rip),%xmm1
  andpd  %xmm1,%xmm0
  ucomisd D58(%rip),%xmm0
  setbe  %al
  xor    $0x1,%eax
  movzbl %al,%eax
  test   %eax,%eax
  jne    L62
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd -0x58(%rbp),%xmm0
  jbe    L62
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L12
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  jmp    L65
L12:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movq   D22(%rip),%xmm1
  xorpd  %xmm1,%xmm0
L65:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x50(%rbp),%xmm0
  comisd %xmm1,%xmm0
  ja     L42
  pxor   %xmm0,%xmm0
  comisd -0x50(%rbp),%xmm0
  jbe    L62
L42:
  mov    -0x20(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  subsd  %xmm2,%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mulsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm1,%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D20(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x60(%rbp)
  fldl   -0x60(%rbp)
  fldt   -0x10(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x10(%rbp)
L62:
  addl   $0x1,-0x20(%rbp)
L96:
  mov    -0x20(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L146
L155:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x38(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x34(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x60(%rbp)
  fldl   -0x60(%rbp)
  fldt   -0x10(%rbp)
  fdivp  %st,%st(1)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  fstpl  -0x60(%rbp)
  movsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x18(%rbp)
L207:
  mov    -0x34(%rbp),%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x18(%rbp)
  jle    L89
  nop
  nop
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D61
type: byte[8]
name: extract_symbolic_data
arguments: label: D58
type: byte[8]
name: extract_symbolic_data
arguments: label: D22
type: byte[8]
name: extract_symbolic_data
arguments: label: D20
type: byte[8]

tool: {"D61": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f]}

tool: {"D58": [0xff,0xff,0xff,0xff,0xff,0xff,0xef,0x7f]}

tool: {"D22": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

tool: {"D20": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0]}

assistant: ```c
void dchisqr_sysrem(double p[], double xi[], int numlc, int numJD, double **mag, double **sig, double *mag_ave, double sigma_clip, double saturation) {
  int j, k;
  int n, num;
  long double S;
  num = 0;
  for (n = 1; n <= numlc + numJD; n++) {
    S = 0;
    if (n <= numlc) {
      j = n - 1;
      for (k = 0; k < numJD; k++) {
        if (!isnan(mag[j][k]) && !isinf(mag[j][k]) && mag[j][k] > saturation && (((mag[j][k] - mag_ave[j]) > 0 ? (mag[j][k] - mag_ave[j]) : (-(mag[j][k] - mag_ave[j]))) / sig[j][k] < sigma_clip || sigma_clip < 0))
          S += -2.0 * (p[numlc + k + 1] * (mag[j][k] - mag_ave[j] - p[n] * p[numlc + k + 1]) / (sig[j][k] * sig[j][k]));
      }
    } else {
      k = n - numlc - 1;
      for (j = 0; j < numlc; j++) {
        if (!isnan(mag[j][k]) && !isinf(mag[j][k]) && mag[j][k] > saturation && (((mag[j][k] - mag_ave[j]) > 0 ? (mag[j][k] - mag_ave[j]) : (-(mag[j][k] - mag_ave[j]))) / sig[j][k] < sigma_clip || sigma_clip < 0))
          S += -2.0 * (p[j + 1] * (mag[j][k] - mag_ave[j] - p[j + 1] * p[n]) / (sig[j][k] * sig[j][k]));
      }
    }
    xi[n] = (double)(S / ((double)numJD * numlc));
  }
}
```