user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<pca>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %esi,-0x38(%rbp)
  mov    %rdx,-0x40(%rbp)
  mov    %rcx,-0x48(%rbp)
  mov    %r8,-0x50(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L83
  cmpq   $0x0,-0x18(%rbp)
  jne    L399
L83:
  cmpq   $0x0,-0x20(%rbp)
  je     L51
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L51:
  cmpq   $0x0,-0x18(%rbp)
  je     L56
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L56:
  mov    $0xffffffff,%eax
  jmp    L154
L399:
  mov    -0x48(%rbp),%rdi
  mov    -0x50(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%esi
  mov    -0x34(%rbp),%eax
  mov    %rdi,%r8
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <svd@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jne    L139
  mov    -0x34(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L71
  movl   $0x0,-0x28(%rbp)
  jmp    L197
L176:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L119
L211:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mulsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L119:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L211
  addl   $0x1,-0x28(%rbp)
L197:
  mov    -0x28(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L176
  mov    -0x20(%rbp),%rdx
  mov    -0x50(%rbp),%rcx
  mov    -0x38(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <sort@plt>
  movl   $0x0,-0x2c(%rbp)
  jmp    L91
L432:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  sub    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  sub    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x2c(%rbp)
L91:
  mov    -0x38(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x2c(%rbp)
  jl     L432
  movl   $0x0,-0x2c(%rbp)
  jmp    L70
L153:
  movl   $0x0,-0x28(%rbp)
  jmp    L386
L201:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x28(%rbp)
L386:
  mov    -0x28(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L201
  movl   $0x0,-0x28(%rbp)
  jmp    L361
L234:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x28(%rbp)
L361:
  mov    -0x28(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L234
  addl   $0x1,-0x2c(%rbp)
L70:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L153
  movl   $0x0,-0x2c(%rbp)
  jmp    L203
L366:
  movl   $0x0,-0x28(%rbp)
  jmp    L0
L424:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x28(%rbp)
L0:
  mov    -0x28(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L424
  movl   $0x0,-0x28(%rbp)
  jmp    L384
L352:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x28(%rbp)
L384:
  mov    -0x28(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L352
  addl   $0x1,-0x2c(%rbp)
L203:
  mov    -0x2c(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L366
  movl   $0x0,-0x2c(%rbp)
  jmp    L121
L122:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L121:
  mov    -0x2c(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L122
  movl   $0x0,-0x2c(%rbp)
  jmp    L413
L275:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x50(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L413:
  mov    -0x2c(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L275
  jmp    L139
L71:
  movl   $0x0,-0x28(%rbp)
  jmp    L327
L378:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L433
L137:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mulsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L433:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L137
  addl   $0x1,-0x28(%rbp)
L327:
  mov    -0x28(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L378
  mov    -0x20(%rbp),%rdx
  mov    -0x50(%rbp),%rcx
  mov    -0x34(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <sort@plt>
  movl   $0x0,-0x2c(%rbp)
  jmp    L185
L226:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x34(%rbp),%eax
  sub    $0x1,%eax
  sub    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x34(%rbp),%eax
  sub    $0x1,%eax
  sub    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x2c(%rbp)
L185:
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x2c(%rbp)
  jl     L226
  movl   $0x0,-0x28(%rbp)
  jmp    L411
L132:
  movl   $0x0,-0x2c(%rbp)
  jmp    L290
L163:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L290:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L163
  movl   $0x0,-0x2c(%rbp)
  jmp    L116
L409:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L116:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L409
  addl   $0x1,-0x28(%rbp)
L411:
  mov    -0x28(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L132
  movl   $0x0,-0x28(%rbp)
  jmp    L461
L398:
  movl   $0x0,-0x2c(%rbp)
  jmp    L408
L3:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L408:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L3
  movl   $0x0,-0x2c(%rbp)
  jmp    L44
L183:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L44:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L183
  addl   $0x1,-0x28(%rbp)
L461:
  mov    -0x28(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L398
  movl   $0x0,-0x2c(%rbp)
  jmp    L266
L478:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L266:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L478
  movl   $0x0,-0x2c(%rbp)
  jmp    L274
L38:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x50(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L274:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L38
L139:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x24(%rbp),%eax
L154:
  leave
  ret
```

assistant: ```c
int pca(int nrows, int ncolumns, double **u, double **v, double *w) {
  int i;
  int j;
  int error;
  int *index = malloc(ncolumns * sizeof(int));
  double *temp = malloc(ncolumns * sizeof(double));
  if (!index || !temp) {
    if (index)
      free(index);
    if (temp)
      free(temp);
    return -1;
  }
  error = svd(nrows, ncolumns, u, w, v);
  if (error == 0) {
    if (nrows >= ncolumns) {
      for (j = 0; j < ncolumns; j++) {
        const double s = w[j];
        for (i = 0; i < nrows; i++)
          u[i][j] *= s;
      }
      sort(ncolumns, w, index);
      for (i = 0; i < ncolumns / 2; i++) {
        j = index[i];
        index[i] = index[ncolumns - 1 - i];
        index[ncolumns - 1 - i] = j;
      }
      for (i = 0; i < nrows; i++) {
        for (j = 0; j < ncolumns; j++)
          temp[j] = u[i][index[j]];
        for (j = 0; j < ncolumns; j++)
          u[i][j] = temp[j];
      }
      for (i = 0; i < ncolumns; i++) {
        for (j = 0; j < ncolumns; j++)
          temp[j] = v[index[j]][i];
        for (j = 0; j < ncolumns; j++)
          v[j][i] = temp[j];
      }
      for (i = 0; i < ncolumns; i++)
        temp[i] = w[index[i]];
      for (i = 0; i < ncolumns; i++)
        w[i] = temp[i];
    } else {
      for (j = 0; j < nrows; j++) {
        const double s = w[j];
        for (i = 0; i < nrows; i++)
          v[i][j] *= s;
      }
      sort(nrows, w, index);
      for (i = 0; i < nrows / 2; i++) {
        j = index[i];
        index[i] = index[nrows - 1 - i];
        index[nrows - 1 - i] = j;
      }
      for (j = 0; j < ncolumns; j++) {
        for (i = 0; i < nrows; i++)
          temp[i] = u[index[i]][j];
        for (i = 0; i < nrows; i++)
          u[i][j] = temp[i];
      }
      for (j = 0; j < nrows; j++) {
        for (i = 0; i < nrows; i++)
          temp[i] = v[j][index[i]];
        for (i = 0; i < nrows; i++)
          v[j][i] = temp[i];
      }
      for (i = 0; i < nrows; i++)
        temp[i] = w[index[i]];
      for (i = 0; i < nrows; i++)
        w[i] = temp[i];
    }
  }
  free(index);
  free(temp);
  return error;
}
```