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

```asm
<stepVector_Eigen>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,%r13d
  movsd  %xmm0,0x48(%rsp)
  mov    %rsi,0x30(%rsp)
  mov    %rdx,%rbx
  mov    %rcx,%rbp
  movsd  %xmm1,0x10(%rsp)
  mov    %r8,0x38(%rsp)
  mov    %r9,%r12
  mov    %edi,%r14d
  imul   %edi,%r14d
  mov    $0x8,%esi
  mov    %r14d,%edi
  call   <calloc@plt>
  mov    %rax,0x28(%rsp)
  mov    $0x8,%esi
  mov    %r14d,%edi
  call   <calloc@plt>
  mov    %rax,0x18(%rsp)
  mov    $0x8,%esi
  mov    %r13d,%edi
  call   <calloc@plt>
  mov    %rax,%r14
  mov    $0x8,%esi
  mov    %r13d,%edi
  call   <calloc@plt>
  mov    %rax,0x20(%rsp)
  mov    $0x8,%esi
  mov    %r13d,%edi
  call   <calloc@plt>
  mov    %rax,%r15
  cmpq   $0x0,0x28(%rsp)
  je     L285
  cmpq   $0x0,0x18(%rsp)
  je     L285
  test   %r14,%r14
  sete   %al
  cmpq   $0x0,0x20(%rsp)
  sete   %dl
  or     %dl,%al
  jne    L285
  test   %r15,%r15
  jne    L261
L285:
  lea    D20(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L261:
  test   %r13d,%r13d
  jle    L133
  movslq %r13d,%rax
  lea    0x8(,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  mov    0x28(%rsp),%rax
  mov    $0x0,%edi
  movsd  D53(%rip),%xmm0
L303:
  movsd  %xmm0,(%rax)
  mov    %edi,%edx
  add    $0x1,%edi
  add    0x8(%rsp),%rax
  cmp    %edi,%r13d
  jne    L303
  mov    %edx,0x44(%rsp)
  mov    0x18(%rsp),%r8
  mov    %r14,%rcx
  mov    0x28(%rsp),%rdx
  mov    0x30(%rsp),%rsi
  call   <gen_sym_eigen@plt>
  mov    0x20(%rsp),%rax
  mov    %rax,%rdx
  mov    0x8(%rsp),%r9
  sub    $0x8,%r9
  mov    0x18(%rsp),%rsi
  mov    %r15,%rcx
  mov    0x44(%rsp),%edi
  lea    0x8(%rax,%rdi,8),%r8
L306:
  mov    $0x0,%eax
L314:
  movsd  (%rbx,%rax,8),%xmm0
  mulsd  (%rsi,%rax,8),%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  0x0(%rbp,%rax,8),%xmm0
  mulsd  (%rsi,%rax,8),%xmm0
  addsd  (%rcx),%xmm0
  movsd  %xmm0,(%rcx)
  mov    %rax,%r10
  add    $0x1,%rax
  cmp    %rdi,%r10
  jne    L314
  add    $0x8,%rdx
  add    %r9,%rsi
  add    $0x8,%rcx
  cmp    %r8,%rdx
  jne    L306
  mov    $0x0,%eax
  pxor   %xmm4,%xmm4
  movapd %xmm4,%xmm3
  movq   D16(%rip),%xmm6
  movapd %xmm4,%xmm5
  mov    0x20(%rsp),%rcx
  jmp    L294
L13:
  lea    0x1(%rax),%rdx
  cmp    %rdi,%rax
  je     L180
  mov    %rdx,%rax
L294:
  movsd  (%r14,%rax,8),%xmm1
  movapd %xmm1,%xmm0
  andpd  %xmm6,%xmm0
  comisd %xmm5,%xmm0
  jbe    L13
  movsd  (%r15,%rax,8),%xmm0
  movapd %xmm0,%xmm2
  mulsd  (%rcx,%rax,8),%xmm2
  divsd  %xmm1,%xmm2
  addsd  %xmm2,%xmm4
  mulsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm3
  jmp    L13
L180:
  ucomisd D21(%rip),%xmm3
  jp     L318
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x8(%rsp)
  je     L158
L318:
  movsd  0x48(%rsp),%xmm0
  subsd  %xmm4,%xmm0
  divsd  %xmm3,%xmm0
  movsd  %xmm0,0x8(%rsp)
L158:
  mov    %r12,%rax
  lea    -0x1(%r13),%edx
  lea    0x8(%r12,%rdx,8),%rdx
L174:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L174
  mov    %r13d,%ecx
  mov    $0x0,%edi
  mov    $0x0,%edx
  movq   D16(%rip),%xmm4
  pxor   %xmm3,%xmm3
  mov    0x18(%rsp),%rsi
  mov    0x20(%rsp),%r8
  movsd  0x8(%rsp),%xmm5
  jmp    L305
L8:
  add    $0x1,%rdx
  add    %r13d,%edi
  cmp    %rcx,%rdx
  je     L93
L305:
  movsd  (%r14,%rdx,8),%xmm0
  movapd %xmm0,%xmm1
  andpd  %xmm4,%xmm1
  comisd %xmm3,%xmm1
  jbe    L8
  movapd %xmm5,%xmm2
  mulsd  (%r15,%rdx,8),%xmm2
  addsd  (%r8,%rdx,8),%xmm2
  divsd  %xmm0,%xmm2
  movslq %edi,%rax
  lea    (%rsi,%rax,8),%r9
  mov    $0x0,%eax
L336:
  movapd %xmm2,%xmm1
  mulsd  (%r9,%rax,8),%xmm1
  movsd  (%r12,%rax,8),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L336
  jmp    L8
L85:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x8(%rsp)
L287:
  lea    D59(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  test   %r13d,%r13d
  jg     L131
  pxor   %xmm1,%xmm1
  jmp    L56
L319:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  jmp    L273
L207:
  test   %r13d,%r13d
  jg     L281
  jmp    L250
L93:
  pxor   %xmm0,%xmm0
  comisd 0x10(%rsp),%xmm0
  jae    L287
L131:
  mov    $0x0,%eax
  pxor   %xmm1,%xmm1
L52:
  movsd  (%r12,%rax,8),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  add    $0x1,%rax
  cmp    %eax,%r13d
  jg     L52
  pxor   %xmm0,%xmm0
  ucomisd %xmm1,%xmm0
  ja     L319
L56:
  sqrtsd %xmm1,%xmm1
L273:
  comisd 0x10(%rsp),%xmm1
  jbe    L207
  test   %r13d,%r13d
  jle    L250
  mov    %r12,%rax
  lea    -0x1(%r13),%edx
  lea    0x8(%r12,%rdx,8),%rdx
L139:
  movsd  0x10(%rsp),%xmm0
  mulsd  (%rax),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L139
L281:
  mov    $0x0,%eax
  movsd  0x8(%rsp),%xmm1
  mov    0x38(%rsp),%rdx
L311:
  movapd %xmm1,%xmm0
  mulsd  0x0(%rbp,%rax,8),%xmm0
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r13d
  jg     L311
L250:
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L133:
  mov    0x18(%rsp),%r8
  mov    %r14,%rcx
  mov    0x28(%rsp),%rdx
  mov    0x30(%rsp),%rsi
  mov    %r13d,%edi
  call   <gen_sym_eigen@plt>
  pxor   %xmm0,%xmm0
  comisd 0x10(%rsp),%xmm0
  jae    L85
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm0,%xmm1
  jmp    L56
```

tool_calls: name: parse_data
arguments: tag: D20
data_type: string
name: parse_data
arguments: tag: D53
data_type: f64
name: parse_data
arguments: tag: D16
data_type: qword
name: parse_data
arguments: tag: D21
data_type: f64
name: parse_data
arguments: tag: D59
data_type: string

tool: D20: stepVector_Eigen - error cannot allocate memory


tool: D53: 1

tool: D16: 9223372036854775807

tool: D21: 0

tool: D59: stepVector_Eigen: invalid range of maxStepSize

assistant: ```c
void stepVector_Eigen(int nDim, double C, const double *H, const double *g, const double *J, double maxStepSize, double *gL, double *dR) {
  int i, j;
  double r;
  double *I;
  double *h;
  double *e;
  double *alpha;
  double *beta;
  double gamma;
  I = calloc(nDim * nDim, sizeof(double));
  h = calloc(nDim * nDim, sizeof(double));
  e = calloc(nDim, sizeof(double));
  alpha = calloc(nDim, sizeof(double));
  beta = calloc(nDim, sizeof(double));
  if (I == NULL || h == NULL || e == NULL || alpha == NULL || beta == NULL) {
    printf("stepVector_Eigen - error cannot allocate memory\n");
    exit(-1);
  }
  for (i = 0; i < nDim; i++)
    I[i * nDim + i] = 1.0;
  gen_sym_eigen(nDim, H, I, e, h);
  for (i = 0; i < nDim; i++)
    for (j = 0; j < nDim; j++) {
      alpha[i] += g[j] * h[i * nDim + j];
      beta[i] += J[j] * h[i * nDim + j];
    }
  gamma = 0.0;
  r = 0.0;
  for (i = 0; i < nDim; i++)
    if (fabs(e[i]) > 0.0) {
      gamma += alpha[i] * beta[i] / e[i];
      r += beta[i] * beta[i] / e[i];
    }
  if (r == 0.0)
    gamma = 0.0;
  else
    gamma = (C - gamma) / r;
  for (i = 0; i < nDim; i++)
    dR[i] = 0.0;
  for (i = 0; i < nDim; i++)
    if (fabs(e[i]) > 0.0) {
      r = (alpha[i] + gamma * beta[i]) / e[i];
      for (j = 0; j < nDim; j++)
        dR[j] -= r * h[i * nDim + j];
    }
  if (maxStepSize <= 0.0) {
    printf("stepVector_Eigen: invalid range of maxStepSize");
    exit(-1);
  }
  r = 0;
  for (i = 0; i < nDim; i++)
    r += dR[i] * dR[i];
  r = sqrt(r);
  if (r > maxStepSize)
    for (i = 0; i < nDim; i++)
      dR[i] = dR[i] * maxStepSize / r;
  for (i = 0; i < nDim; i++)
    gL[i] = g[i] + gamma * J[i];
  free(I);
  free(h);
  free(e);
  free(alpha);
  free(beta);
}
```