user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<R_Hartree>:
  endbr64
  push   %r15
  movapd %xmm0,%xmm5
  xor    %eax,%eax
  mov    %rsi,%r15
  push   %r14
  unpcklpd %xmm5,%xmm5
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  movq   %xmm0,%rbx
  sub    $0x38,%rsp
  mov    %rdi,0x10(%rsp)
  movaps %xmm5,(%rsp)
  call   <N_LogGrid@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <log_amesh_LogGrid@plt>
  pxor   %xmm6,%xmm6
  cvtsi2sd %eax,%xmm6
  xor    %eax,%eax
  movsd  %xmm6,0x18(%rsp)
  call   <r_LogGrid@plt>
  movslq %eax,%rbp
  xor    %eax,%eax
  call   <alloc_LogGrid@plt>
  movslq %eax,%r13
  test   %r12d,%r12d
  jle    L266
  lea    0x8(%r14),%rsi
  lea    0x8(%rbp),%rax
  mov    %r14,%rdx
  cmp    %rsi,%r13
  mov    %rsi,0x20(%rsp)
  setne  %sil
  cmp    $0x1,%r12d
  setne  %cl
  test   %cl,%sil
  je     L27
  cmp    %rax,%r13
  je     L27
  mov    %r12d,%eax
  movsd  0x18(%rsp),%xmm2
  sub    %rbp,%rdx
  mov    %r13,%rcx
  shr    %eax
  mov    %rdx,%rsi
  sub    %rbp,%rcx
  sub    $0x1,%eax
  unpcklpd %xmm2,%xmm2
  shl    $0x4,%rax
  lea    0x10(%rax,%rbp,1),%rdi
  mov    %rbp,%rax
  nopl   0x0(%rax)
L68:
  movupd (%rax),%xmm1
  movupd (%rsi,%rax,1),%xmm6
  movapd %xmm1,%xmm0
  mulpd  %xmm1,%xmm0
  mulpd  %xmm1,%xmm0
  mulpd  %xmm2,%xmm0
  mulpd  %xmm6,%xmm0
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rdi,%rax
  jne    L68
  mov    %r12d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r12b
  je     L190
  movsd  0x0(%rbp,%rax,8),%xmm1
  mov    0x10(%rsp),%rdx
  movapd %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  0x18(%rsp),%xmm0
  mulsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
L190:
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    -0x3(%r12),%r14d
  call   <Zero_LogGrid@plt>
  movapd (%rsp),%xmm7
  movslq %r12d,%rax
  shl    $0x3,%rax
  mov    %rbx,-0x8(%r15,%rax,1)
  movups %xmm7,-0x18(%r15,%rax,1)
  movslq %r14d,%rax
  mov    %rax,0x28(%rsp)
  mov    %rax,%rbx
  test   %r14d,%r14d
  jle    L225
  nopl   (%rax)
L227:
  movsd  (%r15,%rbx,8),%xmm3
  mov    %ebx,%edi
  mov    %r13,%rsi
  xor    %eax,%eax
  movsd  %xmm3,(%rsp)
  call   <Corrector_In_F@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,-0x8(%r15,%rbx,8)
  sub    $0x1,%rbx
  test   %ebx,%ebx
  jg     L227
  mov    0x28(%rsp),%rbx
  test   %r12d,%r12d
  jle    L39
L225:
  cmp    0x20(%rsp),%r13
  setne  %cl
  cmp    $0x1,%r12d
  setg   %al
  test   %al,%cl
  je     L3
  lea    0x8(%rbp),%rax
  cmp    %rax,%r13
  je     L3
  test   %r12d,%r12d
  mov    $0x1,%r9d
  mov    0x10(%rsp),%rsi
  mov    %r13,%rcx
  cmovg  %r12d,%r9d
  movsd  0x18(%rsp),%xmm1
  sub    %rbp,%rcx
  sub    %rbp,%rsi
  mov    %r9d,%eax
  unpcklpd %xmm1,%xmm1
  shr    %eax
  sub    $0x1,%eax
  shl    $0x4,%rax
  lea    0x10(%rax,%rbp,1),%rdi
  mov    %rbp,%rax
  xchg   %ax,%ax
L80:
  movupd (%rax),%xmm0
  movupd (%rsi,%rax,1),%xmm6
  mulpd  %xmm0,%xmm0
  mulpd  %xmm1,%xmm0
  mulpd  %xmm6,%xmm0
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rdi,%rax
  jne    L80
  mov    %r9d,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%r9d
  je     L108
  movsd  0x0(%rbp,%rax,8),%xmm0
  mov    0x10(%rsp),%rdx
  mulsd  %xmm0,%xmm0
  mulsd  0x18(%rsp),%xmm0
  mulsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
L108:
  test   %r14d,%r14d
  jle    L267
  movslq %r14d,%rax
  mov    %rax,0x28(%rsp)
  mov    %rax,%rbx
L39:
  lea    -0x8(%rbp,%rbx,8),%r14
  pxor   %xmm1,%xmm1
  nopl   0x0(%rax,%rax,1)
L31:
  mov    %ebx,%edi
  mov    %r13,%rsi
  xor    %eax,%eax
  movsd  %xmm1,(%rsp)
  call   <Corrector_In_F@plt>
  pxor   %xmm0,%xmm0
  movsd  (%rsp),%xmm1
  movsd  (%r14),%xmm2
  cvtsi2sd %eax,%xmm0
  sub    $0x8,%r14
  addsd  %xmm0,%xmm1
  movsd  -0x8(%r15,%rbx,8),%xmm0
  mulsd  %xmm1,%xmm2
  subsd  %xmm2,%xmm0
  movsd  %xmm0,-0x8(%r15,%rbx,8)
  sub    $0x1,%rbx
  test   %ebx,%ebx
  jg     L31
L267:
  test   %r12d,%r12d
  jle    L306
  lea    0x8(%rbp),%rax
  cmp    %rax,%r15
  je     L250
  cmp    $0x1,%r12d
  je     L250
  mov    %r12d,%eax
  mov    %rbp,%rcx
  shr    %eax
  sub    %r15,%rcx
  sub    $0x1,%eax
  shl    $0x4,%rax
  lea    0x10(%r15,%rax,1),%rsi
  mov    %r15,%rax
  nopl   0x0(%rax,%rax,1)
L91:
  movupd (%rax),%xmm0
  movupd (%rcx,%rax,1),%xmm7
  add    $0x10,%rax
  divpd  %xmm7,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rsi,%rax
  jne    L91
  mov    %r12d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r12b
  je     L158
  lea    (%r15,%rax,8),%rcx
  movsd  (%rcx),%xmm0
  divsd  0x0(%rbp,%rax,8),%xmm0
  movsd  %xmm0,(%rcx)
L158:
  lea    -0x1(%r12),%ecx
  lea    0x8(%r15),%rsi
L241:
  cmp    %rsi,%r13
  mov    %r13,%rax
  setne  %dil
  cmp    $0x1,%ecx
  seta   %sil
  test   %sil,%dil
  je     L35
  cmp    %r13,0x20(%rsp)
  je     L35
  mov    %r12d,%ecx
  mov    %r15,%rsi
  shr    %ecx
  sub    %r13,%rsi
  sub    $0x1,%ecx
  shl    $0x4,%rcx
  lea    0x10(%rcx,%r13,1),%rdi
  mov    0x10(%rsp),%rcx
  sub    %r13,%rcx
  nopl   (%rax)
L146:
  movupd (%rsi,%rax,1),%xmm0
  movupd (%rcx,%rax,1),%xmm4
  add    $0x10,%rax
  mulpd  %xmm4,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rdi,%rax
  jne    L146
  mov    %r12d,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%r12d
  je     L306
  mov    0x10(%rsp),%rdx
  movsd  (%r15,%rax,8),%xmm0
  mulsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
L306:
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <Integrate_LogGrid@plt>
  mov    %r13,%rdi
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <dealloc_LogGrid@plt>
  add    $0x38,%rsp
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L27:
  lea    -0x1(%r12),%ecx
  mov    %r13,%rsi
  lea    (%rax,%rcx,8),%rdi
  mov    0x10(%rsp),%rcx
  mov    %rbp,%rax
  sub    %rbp,%rsi
  sub    %rbp,%rcx
  nopw   0x0(%rax,%rax,1)
L60:
  movsd  (%rax),%xmm1
  movapd %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  0x18(%rsp),%xmm0
  mulsd  (%rcx,%rax,1),%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %rdi,%rax
  jne    L60
  jmp    L190
  xchg   %ax,%ax
L3:
  mov    0x10(%rsp),%rsi
  mov    %r13,%rdi
  mov    %rbp,%rax
  xor    %ecx,%ecx
  sub    %rbp,%rdi
  sub    %rbp,%rsi
  nopl   0x0(%rax,%rax,1)
L66:
  movsd  (%rax),%xmm0
  add    $0x1,%ecx
  mulsd  %xmm0,%xmm0
  mulsd  0x18(%rsp),%xmm0
  mulsd  (%rsi,%rax,1),%xmm0
  movsd  %xmm0,(%rdi,%rax,1)
  add    $0x8,%rax
  cmp    %ecx,%r12d
  jg     L66
  jmp    L108
  nopl   0x0(%rax)
L250:
  lea    -0x1(%r12),%eax
  lea    0x8(%r15),%rsi
  sub    %r15,%rbp
  mov    %rax,%rcx
  lea    (%rsi,%rax,8),%rdi
  mov    %r15,%rax
  xchg   %ax,%ax
L116:
  movsd  (%rax),%xmm0
  divsd  0x0(%rbp,%rax,1),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rdi
  jne    L116
  jmp    L241
  nopl   (%rax)
L35:
  mov    0x10(%rsp),%rsi
  mov    %ecx,%ecx
  mov    %r15,%rdx
  mov    %r13,%rax
  lea    0x8(%r13,%rcx,8),%rcx
  sub    %r13,%rdx
  sub    %r13,%rsi
  nopl   0x0(%rax,%rax,1)
L275:
  movsd  (%rdx,%rax,1),%xmm0
  mulsd  (%rsi,%rax,1),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rcx
  jne    L275
  jmp    L306
  nopl   (%rax)
L266:
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <Zero_LogGrid@plt>
  movapd (%rsp),%xmm4
  movslq %r12d,%rax
  shl    $0x3,%rax
  mov    %rbx,-0x8(%r15,%rax,1)
  movups %xmm4,-0x18(%r15,%rax,1)
  jmp    L306
```

assistant: ```c
double R_Hartree(n, charge, Vh)
double n[], charge, Vh[];
{
  int i, Ngrid;
  double log_amesh;
  double *rgrid, *tmp;
  double r, r2, r3, tt;
  double E;
  Ngrid = N_LogGrid();
  log_amesh = log_amesh_LogGrid();
  rgrid = r_LogGrid();
  tmp = alloc_LogGrid();
  for (i = 0; i < Ngrid; ++i) {
    r = rgrid[i];
    r3 = r * r * r;
    tmp[i] = (log_amesh * r3) * n[i];
  }
  Zero_LogGrid(Vh);
  Vh[Ngrid - 1] = charge;
  Vh[Ngrid - 2] = charge;
  Vh[Ngrid - 3] = charge;
  for (i = (Ngrid - 3); i > 0; --i) {
    Vh[i - 1] = Vh[i] + Corrector_In_F(i, tmp);
  }
  for (i = 0; i < Ngrid; ++i) {
    r = rgrid[i];
    r2 = r * r;
    tmp[i] = (log_amesh * r2) * n[i];
  }
  tt = 0.0;
  for (i = (Ngrid - 3); i > 0; --i) {
    tt = tt + Corrector_In_F(i, tmp);
    Vh[i - 1] = Vh[i - 1] - rgrid[i - 1] * tt;
  }
  for (i = 0; i < Ngrid; ++i)
    Vh[i] = Vh[i] / rgrid[i];
  for (i = 0; i < Ngrid; ++i) {
    tmp[i] = n[i] * Vh[i];
  }
  E = Integrate_LogGrid(tmp);
  dealloc_LogGrid(tmp);
  return E;
}
```