user: 请将以下的汇编代码转换成C语言代码：

```asm
<get_derivative_nac>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x120,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %rsi,-0xe0(%rbp)
  mov    %edx,-0xe4(%rbp)
  mov    %rcx,-0xf0(%rbp)
  mov    %r8,-0xf8(%rbp)
  mov    %r9,-0x100(%rbp)
  movsd  %xmm0,-0x120(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x108(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0x110(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rax,-0x118(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0xf0(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x40,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm3
  mov    -0xf0(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm2
  mulsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm3
  mov    -0xf0(%rbp),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm3,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm4
  mov    -0xf0(%rbp),%rax
  add    $0x40,%rax
  movsd  (%rax),%xmm3
  mulsd  %xmm4,%xmm3
  subsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm3
  mov    -0xf0(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm3,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm4
  mov    -0xf0(%rbp),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm3
  mulsd  %xmm4,%xmm3
  subsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0xb0(%rbp)
  mov    -0xf0(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x40,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    -0xf0(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x40,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  mov    -0xf0(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0xf0(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x40,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0xf0(%rbp),%rax
  add    $0x40,%rax
  movsd  (%rax),%xmm1
  mov    -0xf0(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0xf0(%rbp),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0xf0(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0xf0(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xf0(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0xf0(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0xf0(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xf0(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0xf0(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movl   $0x0,-0xc4(%rbp)
  jmp    L128
L131:
  mov    -0xc4(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x70(%rbp,%rax,8)
  movl   $0x0,-0xc0(%rbp)
  jmp    L174
L53:
  cmpq   $0x0,-0x118(%rbp)
  je     L116
  mov    -0xc4(%rbp),%eax
  cltq
  movsd  -0x70(%rbp,%rax,8),%xmm1
  mov    -0xc4(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  mov    -0xc0(%rbp),%eax
  add    %edx,%eax
  cltq
  movsd  -0x50(%rbp,%rax,8),%xmm2
  mov    -0xc0(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x118(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0xc4(%rbp),%eax
  cltq
  movsd  %xmm0,-0x70(%rbp,%rax,8)
  jmp    L87
L116:
  mov    -0xc4(%rbp),%eax
  cltq
  movsd  -0x70(%rbp,%rax,8),%xmm1
  mov    -0xc4(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  mov    -0xc0(%rbp),%eax
  add    %edx,%eax
  cltq
  movsd  -0x50(%rbp,%rax,8),%xmm2
  mov    -0xc0(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0xc4(%rbp),%eax
  cltq
  movsd  %xmm0,-0x70(%rbp,%rax,8)
L87:
  addl   $0x1,-0xc0(%rbp)
L174:
  cmpl   $0x2,-0xc0(%rbp)
  jle    L53
  addl   $0x1,-0xc4(%rbp)
L128:
  cmpl   $0x2,-0xc4(%rbp)
  jle    L131
  mov    -0x110(%rbp),%rdx
  lea    -0x70(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <get_C@plt>
  movq   %xmm0,%rax
  mov    %rax,-0xa8(%rbp)
  movl   $0x0,-0xc4(%rbp)
  jmp    L73
L168:
  movl   $0x0,-0xc0(%rbp)
  jmp    L19
L29:
  mov    -0xc4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc0(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0xa0(%rbp)
  movl   $0x0,-0xbc(%rbp)
  jmp    L57
L125:
  movl   $0x0,-0xb8(%rbp)
  jmp    L178
L109:
  mov    -0x108(%rbp),%rcx
  lea    -0x70(%rbp),%rdx
  mov    -0xb8(%rbp),%esi
  mov    -0xc4(%rbp),%eax
  mov    %eax,%edi
  call   <get_A@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x98(%rbp)
  mov    -0x108(%rbp),%rcx
  mov    -0xbc(%rbp),%edx
  mov    -0xb8(%rbp),%esi
  mov    -0xc4(%rbp),%eax
  mov    %eax,%edi
  call   <get_dA@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x90(%rbp)
  movl   $0x0,-0xb4(%rbp)
  jmp    L6
L136:
  mov    -0x108(%rbp),%rcx
  lea    -0x70(%rbp),%rdx
  mov    -0xb4(%rbp),%esi
  mov    -0xc0(%rbp),%eax
  mov    %eax,%edi
  call   <get_A@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x88(%rbp)
  mov    -0x108(%rbp),%rcx
  mov    -0xbc(%rbp),%edx
  mov    -0xb4(%rbp),%esi
  mov    -0xc0(%rbp),%eax
  mov    %eax,%edi
  call   <get_dA@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x80(%rbp)
  mov    -0x110(%rbp),%rdi
  lea    -0x70(%rbp),%rcx
  mov    -0xbc(%rbp),%edx
  mov    -0xb4(%rbp),%esi
  mov    -0xb8(%rbp),%eax
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <get_dC@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x78(%rbp)
  movsd  -0x90(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x88(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm0
  mulsd  -0x98(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  -0x98(%rbp),%xmm1
  mulsd  -0x88(%rbp),%xmm1
  mulsd  -0x78(%rbp),%xmm1
  divsd  -0xa8(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movsd  -0xa8(%rbp),%xmm1
  mulsd  -0xa0(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0xbc(%rbp),%eax
  imul   -0xe4(%rbp),%eax
  imul   -0xe4(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc4(%rbp),%eax
  imul   -0xe4(%rbp),%eax
  add    %eax,%edx
  mov    -0xc0(%rbp),%eax
  add    %eax,%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  lea    (%rax,%rdx,1),%ecx
  mov    -0xb8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0xb4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x120(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  cmpl   $0x0,-0xbc(%rbp)
  jne    L98
  movsd  -0x98(%rbp),%xmm0
  mulsd  -0x88(%rbp),%xmm0
  movsd  -0xa8(%rbp),%xmm1
  mulsd  -0xa0(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0xc4(%rbp),%eax
  imul   -0xe4(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc0(%rbp),%eax
  add    %eax,%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  lea    (%rax,%rdx,1),%ecx
  mov    -0xb8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0xb4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xe0(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x120(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L98:
  addl   $0x1,-0xb4(%rbp)
L6:
  cmpl   $0x2,-0xb4(%rbp)
  jle    L136
  addl   $0x1,-0xb8(%rbp)
L178:
  cmpl   $0x2,-0xb8(%rbp)
  jle    L109
  addl   $0x1,-0xbc(%rbp)
L57:
  cmpl   $0x2,-0xbc(%rbp)
  jle    L125
  addl   $0x1,-0xc0(%rbp)
L19:
  mov    -0xc0(%rbp),%eax
  cmp    -0xe4(%rbp),%eax
  jl     L29
  addl   $0x1,-0xc4(%rbp)
L73:
  mov    -0xc4(%rbp),%eax
  cmp    -0xe4(%rbp),%eax
  jl     L168
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L129
  call   <__stack_chk_fail@plt>
L129:
  leave
  ret
```

assistant: ```c
void get_derivative_nac(double *ddnac, double *dnac, const int num_patom, const double *lattice, const double *mass, const double *q, const double *born, const double *dielectric, const double *q_direction, const double factor) {
  int i, j, k, l, m;
  double a, b, c, da, db, dc, volume, mass_sqrt;
  double q_cart[3], rec_lat[9];
  volume = lattice[0] * (lattice[4] * lattice[8] - lattice[5] * lattice[7]) + lattice[1] * (lattice[5] * lattice[6] - lattice[3] * lattice[8]) + lattice[2] * (lattice[3] * lattice[7] - lattice[4] * lattice[6]);
  rec_lat[0] = (lattice[4] * lattice[8] - lattice[5] * lattice[7]) / volume;
  rec_lat[1] = (lattice[5] * lattice[6] - lattice[3] * lattice[8]) / volume;
  rec_lat[2] = (lattice[3] * lattice[7] - lattice[4] * lattice[6]) / volume;
  rec_lat[3] = (lattice[7] * lattice[2] - lattice[8] * lattice[1]) / volume;
  rec_lat[4] = (lattice[8] * lattice[0] - lattice[6] * lattice[2]) / volume;
  rec_lat[5] = (lattice[6] * lattice[1] - lattice[7] * lattice[0]) / volume;
  rec_lat[6] = (lattice[1] * lattice[5] - lattice[2] * lattice[4]) / volume;
  rec_lat[7] = (lattice[2] * lattice[3] - lattice[0] * lattice[5]) / volume;
  rec_lat[8] = (lattice[0] * lattice[4] - lattice[1] * lattice[3]) / volume;
  for (i = 0; i < 3; i++) {
    q_cart[i] = 0;
    for (j = 0; j < 3; j++) {
      if (q_direction) {
        q_cart[i] += rec_lat[i * 3 + j] * q_direction[j];
      } else {
        q_cart[i] += rec_lat[i * 3 + j] * q[j];
      }
    }
  }
  c = get_C(q_cart, dielectric);
  for (i = 0; i < num_patom; i++) {
    for (j = 0; j < num_patom; j++) {
      mass_sqrt = sqrt(mass[i] * mass[j]);
      for (k = 0; k < 3; k++) {
        for (l = 0; l < 3; l++) {
          a = get_A(i, l, q_cart, born);
          da = get_dA(i, l, k, born);
          for (m = 0; m < 3; m++) {
            b = get_A(j, m, q_cart, born);
            db = get_dA(j, m, k, born);
            dc = get_dC(l, m, k, q_cart, dielectric);
            ddnac[k * num_patom * num_patom * 9 + i * 9 * num_patom + j * 9 + l * 3 + m] = (da * b + db * a - a * b * dc / c) / (c * mass_sqrt) * factor;
            if (k == 0) {
              dnac[i * 9 * num_patom + j * 9 + l * 3 + m] = a * b / (c * mass_sqrt) * factor;
            }
          }
        }
      }
    }
  }
}
```