user: What would the C source look like for the assembly code provided here:

```asm
<pcapack_scale>:
  endbr64
  test   %edx,%edx
  je     L157
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r12d
  mov    %edx,%ebx
  mov    %ecx,%r13d
  mov    %r8,%rbp
  test   %ecx,%ecx
  je     L70
  test   %edi,%edi
  je     L71
  test   %esi,%esi
  je     L71
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  movsd  D30(%rip),%xmm1
  subsd  %xmm1,%xmm0
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rsp)
  test   %ecx,%ecx
  jle    L70
  mov    $0x0,%r12d
  mov    $0x0,%r14d
  lea    -0x1(%rdx),%eax
  mov    %eax,0x1c(%rsp)
  lea    0x8(%r8),%r15
  jmp    L233
L95:
  mov    %ebx,%ecx
  movslq %r12d,%rax
  lea    0x0(%rbp,%rax,8),%rdx
  mov    $0x0,%eax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,0x8(%rsp)
L144:
  movsd  (%rdx,%rax,8),%xmm1
  movapd %xmm1,%xmm3
  movsd  0x8(%rsp),%xmm5
  subsd  %xmm5,%xmm3
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  addsd  D30(%rip),%xmm2
  movapd %xmm3,%xmm4
  divsd  %xmm2,%xmm4
  addsd  %xmm5,%xmm4
  movsd  %xmm4,0x8(%rsp)
  subsd  %xmm4,%xmm1
  mulsd  %xmm3,%xmm1
  addsd  %xmm1,%xmm0
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L144
L105:
  mulsd  0x10(%rsp),%xmm0
  pxor   %xmm7,%xmm7
  ucomisd %xmm0,%xmm7
  ja     L277
  sqrtsd %xmm0,%xmm0
L292:
  test   %ebx,%ebx
  jle    L96
  movslq %r12d,%rcx
  lea    0x0(%rbp,%rcx,8),%rax
  mov    0x1c(%rsp),%edx
  add    %rcx,%rdx
  lea    (%r15,%rdx,8),%rdx
L162:
  movsd  (%rax),%xmm1
  subsd  0x8(%rsp),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L162
L96:
  add    $0x1,%r14d
  add    %ebx,%r12d
  cmp    %r14d,%r13d
  je     L70
L233:
  test   %ebx,%ebx
  jg     L95
  pxor   %xmm0,%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L105
L277:
  call   <sqrt@plt>
  jmp    L292
L71:
  test   %r12d,%r12d
  je     L201
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  movsd  D30(%rip),%xmm2
  divsd  %xmm0,%xmm2
  test   %r13d,%r13d
  jle    L70
  mov    $0x0,%edi
  mov    $0x0,%esi
  lea    -0x1(%rbx),%r9d
  lea    0x8(%rbp),%r8
  jmp    L255
L163:
  movslq %edi,%rdx
  lea    0x0(%rbp,%rdx,8),%rax
  add    %r9,%rdx
  lea    (%r8,%rdx,8),%rcx
  mov    %rax,%rdx
  pxor   %xmm1,%xmm1
L89:
  movapd %xmm2,%xmm0
  mulsd  (%rdx),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rdx
  cmp    %rcx,%rdx
  jne    L89
L267:
  movsd  (%rax),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L267
L167:
  add    $0x1,%esi
  add    %ebx,%edi
  cmp    %esi,%r13d
  je     L70
L255:
  test   %ebx,%ebx
  jg     L163
  jmp    L167
L201:
  test   %esi,%esi
  je     L70
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  movsd  D30(%rip),%xmm1
  subsd  %xmm1,%xmm0
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rsp)
  test   %r13d,%r13d
  jle    L70
  mov    $0x0,%r14d
  jmp    L13
L171:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
L199:
  movslq %r14d,%rcx
  lea    0x0(%rbp,%rcx,8),%rax
  lea    -0x1(%rbx),%edx
  add    %rcx,%rdx
  lea    0x8(%rbp,%rdx,8),%rdx
L3:
  movsd  (%rax),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L3
L317:
  add    $0x1,%r12d
  add    %ebx,%r14d
  cmp    %r12d,%r13d
  je     L70
L13:
  pxor   %xmm1,%xmm1
  test   %ebx,%ebx
  jle    L11
  movslq %r14d,%rcx
  lea    0x0(%rbp,%rcx,8),%rax
  lea    -0x1(%rbx),%edx
  add    %rcx,%rdx
  lea    0x8(%rbp,%rdx,8),%rdx
  pxor   %xmm1,%xmm1
L253:
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  0x8(%rsp),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L253
  pxor   %xmm7,%xmm7
  ucomisd %xmm1,%xmm7
  ja     L171
L11:
  movapd %xmm1,%xmm0
  sqrtsd %xmm0,%xmm0
  test   %ebx,%ebx
  jg     L199
  jmp    L317
L70:
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L157:
  mov    $0x0,%eax
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D30
datatype: f64

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