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

```asm
<pcapack_scale>:
  endbr64
  test   %edx,%edx
  je     L57
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  sub    $0x28,%rsp
  test   %ecx,%ecx
  je     L174
  mov    %edx,%ebx
  test   %edi,%edi
  je     L107
  test   %esi,%esi
  je     L54
  pxor   %xmm0,%xmm0
  movsd  D22(%rip),%xmm4
  cvtsi2sd %edx,%xmm0
  movapd %xmm4,%xmm5
  subsd  %xmm4,%xmm0
  divsd  %xmm0,%xmm5
  test   %ecx,%ecx
  jle    L174
  xor    %r12d,%r12d
  pxor   %xmm8,%xmm8
  lea    -0x1(%rdx),%r14d
  xor    %r13d,%r13d
  nopl   0x0(%rax)
L192:
  movapd %xmm8,%xmm0
  movapd %xmm8,%xmm2
  test   %ebx,%ebx
  jle    L180
  movslq %r12d,%rax
  movapd %xmm8,%xmm0
  movapd %xmm8,%xmm2
  mov    %ebx,%ecx
  lea    (%r8,%rax,8),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L160:
  pxor   %xmm3,%xmm3
  movsd  (%rdx,%rax,8),%xmm1
  cvtsi2sd %eax,%xmm3
  add    $0x1,%rax
  movapd %xmm1,%xmm6
  subsd  %xmm2,%xmm6
  addsd  %xmm4,%xmm3
  movapd %xmm6,%xmm7
  divsd  %xmm3,%xmm7
  addsd  %xmm7,%xmm2
  subsd  %xmm2,%xmm1
  mulsd  %xmm6,%xmm1
  addsd  %xmm1,%xmm0
  cmp    %rax,%rcx
  jne    L160
L180:
  mulsd  %xmm5,%xmm0
  ucomisd %xmm0,%xmm8
  ja     L196
  sqrtsd %xmm0,%xmm0
L81:
  test   %ebx,%ebx
  jle    L270
  movslq %r12d,%rcx
  mov    %r14d,%edx
  add    %rcx,%rdx
  lea    (%r8,%rcx,8),%rax
  lea    0x8(%r8,%rdx,8),%rdx
  nopl   0x0(%rax,%rax,1)
L244:
  movsd  (%rax),%xmm1
  add    $0x8,%rax
  subsd  %xmm2,%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rax)
  cmp    %rax,%rdx
  jne    L244
L270:
  add    $0x1,%r13d
  add    %ebx,%r12d
  cmp    %r13d,%ebp
  jne    L192
L174:
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L107:
  test   %esi,%esi
  je     L174
  pxor   %xmm0,%xmm0
  pxor   %xmm8,%xmm8
  lea    -0x1(%rbx),%r15d
  xor    %r14d,%r14d
  cvtsi2sd %ebx,%xmm0
  movsd  D22(%rip),%xmm2
  subsd  %xmm2,%xmm0
  divsd  %xmm0,%xmm2
  test   %ebp,%ebp
  jle    L174
  nopw   0x0(%rax,%rax,1)
L216:
  movapd %xmm8,%xmm1
  test   %ebx,%ebx
  jle    L159
  movslq %r14d,%r13
  lea    0x8(%r8),%r12
  movapd %xmm8,%xmm1
  mov    %r15d,%edx
  add    %r13,%rdx
  lea    (%r8,%r13,8),%rax
  lea    (%r12,%rdx,8),%rdx
  nopl   0x0(%rax,%rax,1)
L80:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  mulsd  %xmm0,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rdx,%rax
  jne    L80
  ucomisd %xmm1,%xmm8
  ja     L258
L159:
  movapd %xmm1,%xmm0
  lea    0x8(%r8),%r12
  movslq %r14d,%r13
  sqrtsd %xmm0,%xmm0
  test   %ebx,%ebx
  jle    L28
L261:
  mov    %r15d,%edx
  lea    (%r8,%r13,8),%rax
  add    %r13,%rdx
  lea    (%r12,%rdx,8),%rdx
  nopl   (%rax)
L16:
  movsd  (%rax),%xmm1
  add    $0x8,%rax
  divsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rax)
  cmp    %rdx,%rax
  jne    L16
L28:
  add    $0x1,%edi
  add    %ebx,%r14d
  cmp    %edi,%ebp
  jne    L216
  jmp    L174
L57:
  xor    %eax,%eax
  ret
L54:
  test   %edi,%edi
  je     L107
  pxor   %xmm0,%xmm0
  movsd  D22(%rip),%xmm2
  cvtsi2sd %edx,%xmm0
  divsd  %xmm0,%xmm2
  test   %ecx,%ecx
  jle    L174
  xor    %edi,%edi
  lea    -0x1(%rdx),%r10d
  lea    0x8(%r8),%r9
  xor    %esi,%esi
  nopl   0x0(%rax)
L205:
  test   %ebx,%ebx
  jle    L185
  movslq %edi,%rdx
  pxor   %xmm1,%xmm1
  lea    (%r8,%rdx,8),%rax
  add    %r10,%rdx
  lea    (%r9,%rdx,8),%rcx
  mov    %rax,%rdx
  nopl   0x0(%rax)
L55:
  movsd  (%rdx),%xmm0
  add    $0x8,%rdx
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rdx,%rcx
  jne    L55
  nopl   (%rax)
L11:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rcx
  jne    L11
L185:
  add    $0x1,%esi
  add    %ebx,%edi
  cmp    %esi,%ebp
  jne    L205
  jmp    L174
L196:
  mov    %r8,0x10(%rsp)
  movsd  %xmm8,0x18(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm5,(%rsp)
  call   <sqrt@plt>
  mov    0x10(%rsp),%r8
  movsd  (%rsp),%xmm5
  mov    D22(%rip),%rax
  movsd  0x18(%rsp),%xmm8
  movsd  0x8(%rsp),%xmm2
  movq   %rax,%xmm4
  jmp    L81
L258:
  movapd %xmm1,%xmm0
  mov    %r8,0x10(%rsp)
  mov    %edi,0x8(%rsp)
  movsd  %xmm8,0x18(%rsp)
  movsd  %xmm2,(%rsp)
  call   <sqrt@plt>
  movsd  (%rsp),%xmm2
  mov    0x8(%rsp),%edi
  mov    0x10(%rsp),%r8
  movsd  0x18(%rsp),%xmm8
  jmp    L261
```

tool_calls: name: parse_data
arguments: data_label: D22
data_type: f64

tool: D22: 1

assistant: ```c
int pcapack_scale(const bool centerx, const bool scalex, const int m, const int n, double *restrict x) {
  int i, j;
  double colmean, colvar;
  double dt, tmp;
  if (m == 0 || n == 0)
    return 0;
  ;
  if (centerx && scalex) {
    tmp = 1. / ((double)m - 1);
#pragma omp parallel for private(i, j, colmean, colvar, dt) shared(x) if (m * n > OMP_MIN_SIZE)
    for (j = 0; j < n; j++) {
      colmean = 0;
      colvar = 0;

      for (i = 0; i < m; i++) {
        dt = x[i + m * j] - colmean;
        colmean += dt / ((double)i + 1);
        colvar += dt * (x[i + m * j] - colmean);
      }
      colvar = sqrt(colvar * tmp);

      for (i = 0; i < m; i++)
        x[i + m * j] = (x[i + m * j] - colmean) / colvar;
    }
  } else if (centerx) {
    const double div = 1. / ((double)m);
#pragma omp parallel for private(i, j, colmean) shared(x) if (m * n > OMP_MIN_SIZE)
    for (j = 0; j < n; j++) {
      colmean = 0;

      for (i = 0; i < m; i++)
        colmean += x[i + m * j] * div;

      for (i = 0; i < m; i++)
        x[i + m * j] -= colmean;
    }
  } else if (scalex) {
    const double div = 1. / ((double)m - 1);
#pragma omp parallel for private(i, j, colvar, tmp) shared(x) if (m * n > OMP_MIN_SIZE)
    for (j = 0; j < n; j++) {
      colvar = 0;

      for (i = 0; i < m; i++) {
        tmp = x[i + m * j];
        colvar += tmp * tmp * div;
      }
      colvar = sqrt(colvar);

      for (i = 0; i < m; i++)
        x[i + m * j] /= colvar;
    }
  }
  return 0;
}
```