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

```asm
<Hessian_BFGS>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,%r14d
  mov    %rsi,%r13
  mov    %rdx,%rbp
  mov    %rcx,%r12
  mov    $0x8,%esi
  call   <calloc@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L154
L91:
  test   %r14d,%r14d
  jle    L130
  mov    %r14d,%ecx
  mov    $0x0,%eax
  pxor   %xmm7,%xmm7
  movsd  %xmm7,(%rsp)
L87:
  movsd  0x0(%rbp,%rax,8),%xmm0
  mulsd  0x0(%r13,%rax,8),%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L87
  mov    %rbx,%rdx
  movslq %r14d,%rdi
  shl    $0x3,%rdi
  mov    %r12,%rsi
  mov    %r14d,%eax
  lea    (%rbx,%rax,8),%r8
L21:
  mov    $0x0,%eax
L81:
  movsd  (%rsi,%rax,8),%xmm0
  mulsd  0x0(%r13,%rax,8),%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L81
  add    $0x8,%rdx
  add    %rdi,%rsi
  cmp    %r8,%rdx
  jne    L21
  mov    $0x0,%eax
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x8(%rsp)
L112:
  movsd  (%rbx,%rax,8),%xmm0
  mulsd  0x0(%r13,%rax,8),%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L112
  movsd  (%rsp),%xmm6
  ucomisd D12(%rip),%xmm6
  jp     L116
  je     L147
L116:
  movsd  0x8(%rsp),%xmm7
  ucomisd D12(%rip),%xmm7
  jp     L83
  jne    L83
L150:
  lea    D43(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L97:
  test   %r14d,%r14d
  jle    L124
L83:
  movslq %r14d,%rsi
  shl    $0x3,%rsi
  mov    %rbp,%rdx
  mov    %rbx,%rcx
  lea    -0x1(%r14),%eax
  lea    0x8(%rbp,%rax,8),%rdi
  mov    %r14d,%r14d
L82:
  mov    $0x0,%eax
L7:
  movsd  (%rdx),%xmm0
  mulsd  0x0(%rbp,%rax,8),%xmm0
  divsd  (%rsp),%xmm0
  movsd  (%rcx),%xmm1
  mulsd  (%rbx,%rax,8),%xmm1
  divsd  0x8(%rsp),%xmm1
  subsd  %xmm1,%xmm0
  addsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r14
  jne    L7
  add    %rsi,%r12
  add    $0x8,%rdx
  add    $0x8,%rcx
  cmp    %rdi,%rdx
  jne    L82
L124:
  mov    %rbx,%rdi
  call   <free@plt>
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L154:
  lea    D23(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L91
L130:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  %xmm7,(%rsp)
L147:
  lea    D2(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  movsd  0x8(%rsp),%xmm6
  ucomisd D12(%rip),%xmm6
  jp     L97
  jne    L97
  jmp    L150
```

tool_calls: name: retrieve_data
arguments: tag: D12
type_infered: f64
name: retrieve_data
arguments: tag: D43
type_infered: string
name: retrieve_data
arguments: tag: D23
type_infered: string
name: retrieve_data
arguments: tag: D2
type_infered: string

tool: D12: 0

tool: D43: Hessian_BFGS: error dR perpendicular to HdR


tool: D23: Hessian_BFGS: error cannnot allocate memory


tool: D2: Hessian_BFGS: error dR perpendicular to dGrad


assistant: ```c
void Hessian_BFGS(int nDim, const double *dR, const double *dGrad, double *H) {
  int i, j;
  double alpha;
  double beta;
  double *HdR;
  HdR = calloc(nDim, sizeof(double));
  if (HdR == NULL) {
    printf("Hessian_BFGS: error cannnot allocate memory\n");
    exit(-1);
  }
  alpha = 0.0;
  for (i = 0; i < nDim; i++)
    alpha += dGrad[i] * dR[i];
  for (i = 0; i < nDim; i++)
    for (j = 0; j < nDim; j++)
      HdR[i] += H[i * nDim + j] * dR[j];
  beta = 0.0;
  for (i = 0; i < nDim; i++)
    beta += HdR[i] * dR[i];
  if (alpha == 0.0) {
    printf("Hessian_BFGS: error dR perpendicular to dGrad\n");
    exit(-1);
  }
  if (beta == 0.0) {
    printf("Hessian_BFGS: error dR perpendicular to HdR\n");
    exit(-1);
  }
  for (i = 0; i < nDim; i++)
    for (j = 0; j < nDim; j++)
      H[i * nDim + j] += dGrad[i] * dGrad[j] / alpha - HdR[i] * HdR[j] / beta;
  free(HdR);
}
```