user: Translate the below assembly code into C programming language:

```asm
<solve_Troullier>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %r8,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x1c8,%rsp
  mov    0x10(%rbp),%rax
  mov    %edi,-0x11c(%rbp)
  mov    %rsi,-0x140(%rbp)
  mov    %rax,-0x148(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rdx,-0xa0(%rbp)
  mov    %rax,-0x150(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rcx,-0xa8(%rbp)
  mov    %rax,-0xb0(%rbp)
  mov    0x28(%rbp),%rax
  mov    %r9,-0x100(%rbp)
  mov    %rax,-0x170(%rbp)
  mov    0x30(%rbp),%rax
  mov    %rax,-0xd0(%rbp)
  mov    0x38(%rbp),%rax
  mov    %rax,-0x1a0(%rbp)
  mov    0x40(%rbp),%rax
  mov    %rax,-0x1a8(%rbp)
  mov    0x48(%rbp),%rax
  mov    %rax,-0x1b0(%rbp)
  mov    0x50(%rbp),%rax
  mov    %rax,-0x1b8(%rbp)
  mov    0x58(%rbp),%rax
  mov    %rax,-0x1c0(%rbp)
  mov    0x60(%rbp),%rax
  mov    %rax,-0x1c8(%rbp)
  mov    0x68(%rbp),%rax
  mov    %rax,-0x1d0(%rbp)
  mov    0x70(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  mov    0x78(%rbp),%rax
  mov    %rax,-0x90(%rbp)
  mov    0x80(%rbp),%rax
  mov    %rax,-0x98(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <Vall_Atom@plt>
  cltq
  mov    %rax,-0x138(%rbp)
  xor    %eax,%eax
  call   <r_LogGrid@plt>
  cltq
  mov    %rax,-0xc0(%rbp)
  xor    %eax,%eax
  call   <N_LogGrid@plt>
  mov    %eax,-0xb8(%rbp)
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <log_amesh_LogGrid@plt>
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  xor    %eax,%eax
  movsd  %xmm3,-0xf8(%rbp)
  call   <amesh_LogGrid@plt>
  test   %ebx,%ebx
  jle    L371
  movslq -0xb8(%rbp),%rdx
  mov    -0xb0(%rbp),%rdi
  xor    %esi,%esi
  shl    $0x3,%rdx
  call   <memset@plt>
L371:
  xor    %eax,%eax
  call   <debug_print@plt>
  test   %eax,%eax
  jne    L257
  movslq -0x11c(%rbp),%rax
  test   %eax,%eax
  jle    L581
L253:
  mov    -0xb8(%rbp),%esi
  mov    %r15,%rcx
  mov    %rax,-0x158(%rbp)
  lea    -0x60(%rbp),%r15
  mov    %r15,-0x128(%rbp)
  xor    %r13d,%r13d
  mov    %esi,%eax
  lea    -0x1(%rsi),%edx
  movq   $0x0,-0x168(%rbp)
  and    $0xfffffffe,%eax
  mov    %rdx,%rbx
  mov    %rcx,-0x78(%rbp)
  mov    %eax,-0x174(%rbp)
  cltq
  lea    0x0(,%rax,8),%r11
  mov    %esi,%eax
  mov    %edx,-0x120(%rbp)
  shr    %eax
  mov    %rdx,-0x1e8(%rbp)
  mov    %r11,%r15
  movq   $0x0,-0x160(%rbp)
  sub    $0x1,%eax
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,-0x180(%rbp)
  lea    0x8(,%rdx,8),%rax
  mov    -0xb0(%rbp),%rdx
  mov    %rax,%rdi
  mov    %rax,-0x1d8(%rbp)
  mov    %rdx,%rax
  add    %rdi,%rax
  mov    -0xc0(%rbp),%rdi
  mov    %rax,-0x190(%rbp)
  mov    %ebx,%eax
  shr    %eax
  sub    $0x1,%eax
  shl    $0x4,%rax
  lea    0x18(%rax,%rdi,1),%rax
  mov    %rax,-0x198(%rbp)
  mov    %ebx,%eax
  or     $0x1,%ebx
  and    $0xfffffffe,%eax
  mov    %eax,-0x178(%rbp)
  movslq %ebx,%rax
  lea    0x0(,%rax,8),%rbx
  mov    %rdi,%rax
  add    %rbx,%rax
  add    %rbx,%rdx
  mov    %rbx,-0x108(%rbp)
  lea    0x10(%rdi),%rbx
  mov    %rax,-0x110(%rbp)
  lea    -0x2(%rsi),%eax
  lea    (%rbx,%rax,8),%rax
  mov    %rdx,-0x118(%rbp)
  mov    %rbx,-0x188(%rbp)
  mov    %rax,-0x1e0(%rbp)
  jmp    L386
  cs nopw 0x0(%rax,%rax,1)
L438:
  lea    0x8(%rax),%rdx
L530:
  mov    %rdx,-0x78(%rbp)
  add    $0x1,%r13
  cmp    -0x158(%rbp),%r13
  je     L397
L386:
  mov    -0x148(%rbp),%rax
  pxor   %xmm3,%xmm3
  mov    %r13d,-0xc8(%rbp)
  mov    (%rax,%r13,8),%rbx
  mov    -0x150(%rbp),%rax
  mov    (%rax,%r13,8),%r12
  mov    -0xd0(%rbp),%rax
  mov    (%rax,%r13,8),%rax
  mov    %rax,-0x88(%rbp)
  mov    -0xa0(%rbp),%rax
  mov    (%rax,%r13,4),%esi
  mov    -0x140(%rbp),%rax
  mov    (%rax,%r13,4),%edi
  mov    -0x78(%rbp),%rax
  ucomisd (%rax),%xmm3
  jp     L889
  je     L144
L889:
  xor    %eax,%eax
  call   <state_Atom@plt>
  mov    %eax,%r8d
L306:
  mov    %r8d,%edi
  xor    %eax,%eax
  mov    %r8d,-0xd8(%rbp)
  call   <r_psi_Atom@plt>
  mov    -0xd8(%rbp),%edi
  movslq %eax,%rcx
  xor    %eax,%eax
  mov    %rcx,-0xe8(%rbp)
  call   <r_psi_prime_Atom@plt>
  movslq %eax,%r8
  mov    -0xa8(%rbp),%rax
  mov    %r8,-0xe0(%rbp)
  movsd  (%rax,%r13,8),%xmm1
  mov    -0x100(%rbp),%rax
  movsd  (%rax,%r13,8),%xmm0
  mov    -0xc0(%rbp),%rax
  movsd  %xmm1,-0x60(%rbp)
  movsd  %xmm1,-0xd8(%rbp)
  divsd  (%rax),%xmm0
  call   <log@plt>
  mov    -0xe0(%rbp),%r8
  movsd  D310(%rip),%xmm2
  movsd  D5(%rip),%xmm3
  divsd  -0xf8(%rbp),%xmm0
  movsd  -0xd8(%rbp),%xmm1
  andpd  %xmm0,%xmm2
  mov    -0xe8(%rbp),%rcx
  ucomisd %xmm2,%xmm3
  jbe    L260
  addsd  %xmm3,%xmm2
  subsd  %xmm3,%xmm2
  movsd  D310(%rip),%xmm3
  andnpd %xmm0,%xmm3
  orpd   %xmm3,%xmm2
  movapd %xmm2,%xmm0
L260:
  cvttsd2si %xmm0,%r10d
  pxor   %xmm3,%xmm3
  movslq %r10d,%r14
  lea    0x0(,%r14,8),%rax
  lea    (%r8,%rax,1),%rdi
  add    %rcx,%rax
  movsd  (%rax),%xmm2
  movsd  (%rdi),%xmm4
  mov    %rdi,-0xd8(%rbp)
  mov    %rax,-0xe0(%rbp)
  comisd %xmm2,%xmm3
  movsd  %xmm4,-0x130(%rbp)
  ja     L918
L115:
  mov    -0x78(%rbp),%rax
  mov    -0x88(%rbp),%r9
  push   %r12
  mov    %r10d,%esi
  mov    -0x138(%rbp),%rdx
  mov    -0xc8(%rbp),%edi
  push   %rbx
  movsd  (%rax),%xmm0
  mov    $0x2,%eax
  mov    %r10d,-0xe8(%rbp)
  movsd  %xmm2,-0xf0(%rbp)
  call   <init_xpansion@plt>
  xor    %eax,%eax
  call   <psi_xpansion@plt>
  xor    %eax,%eax
  call   <dpsi_xpansion@plt>
  xor    %eax,%eax
  call   <psp_xpansion@plt>
  pop    %r11
  pop    %rax
  pxor   %xmm6,%xmm6
  mov    -0x78(%rbp),%rax
  mov    -0xe8(%rbp),%r10d
  movsd  -0xf0(%rbp),%xmm2
  movsd  (%rax),%xmm0
  mov    -0xa0(%rbp),%rax
  comisd %xmm6,%xmm0
  mov    (%rax,%r13,4),%esi
  jbe    L11
  sub    $0x8,%rsp
  mov    -0x128(%rbp),%r8
  mov    %rbx,%r9
  xor    %eax,%eax
  push   %r12
  mov    -0x88(%rbp),%rdx
  lea    -0x64(%rbp),%rcx
  lea    0x1(%rsi),%edi
  call   <R_Schrodinger@plt>
  pop    %r9
  pop    %r10
L19:
  mov    -0xe0(%rbp),%rax
  movsd  (%rbx,%r14,8),%xmm4
  movsd  (%r12,%r14,8),%xmm3
  movsd  (%rax),%xmm7
  mov    -0xd8(%rbp),%rax
  movsd  %xmm4,-0xc8(%rbp)
  movsd  %xmm3,-0xe0(%rbp)
  movsd  (%rax),%xmm5
  xor    %eax,%eax
  movsd  %xmm7,-0x88(%rbp)
  movsd  %xmm5,-0xd8(%rbp)
  call   <debug_print@plt>
  test   %eax,%eax
  jne    L962
L13:
  mov    -0xa8(%rbp),%rax
  movsd  (%rax,%r13,8),%xmm0
  xor    %eax,%eax
  movsd  %xmm0,-0x60(%rbp)
  call   <psi_xpansion@plt>
  xor    %eax,%eax
  call   <dpsi_xpansion@plt>
  xor    %eax,%eax
  call   <psp_xpansion@plt>
  mov    -0x78(%rbp),%rax
  pxor   %xmm6,%xmm6
  movsd  (%rax),%xmm2
  comisd %xmm6,%xmm2
  jbe    L438
  movsd  -0x60(%rbp),%xmm0
  movsd  -0x160(%rbp),%xmm4
  mov    -0xb8(%rbp),%esi
  mulsd  %xmm2,%xmm0
  addsd  %xmm2,%xmm4
  addsd  -0x168(%rbp),%xmm0
  movsd  %xmm4,-0x160(%rbp)
  movsd  %xmm0,-0x168(%rbp)
  test   %esi,%esi
  jle    L438
  mov    -0xc0(%rbp),%rax
  movsd  (%rbx),%xmm1
  cmpl   $0x1,-0xb8(%rbp)
  divsd  (%rax),%xmm1
  movapd %xmm1,%xmm0
  mov    -0xb0(%rbp),%rax
  mulsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  je     L370
  cmpl   $0x2,-0xb8(%rbp)
  lea    0x8(%rax),%rcx
  setne  %al
  cmp    -0x188(%rbp),%rcx
  setne  %dl
  and    %edx,%eax
  lea    0x10(%rbx),%rdx
  cmp    %rdx,%rcx
  setne  %dl
  test   %dl,%al
  je     L964
  mov    -0x78(%rbp),%rsi
  lea    0x8(%rsi),%rdx
  cmp    %rdx,%rcx
  setae  %al
  cmp    %rsi,-0x190(%rbp)
  setbe  %cl
  or     %cl,%al
  je     L577
  mov    -0xc0(%rbp),%rdi
  mov    -0xb0(%rbp),%rcx
  mov    %rsi,%r11
  movsd  (%rsi),%xmm1
  mov    %rbx,%rsi
  lea    0x8(%rdi),%rax
  sub    %rdi,%rsi
  sub    %rdi,%rcx
  mov    -0x198(%rbp),%rdi
  unpcklpd %xmm1,%xmm1
  nopl   0x0(%rax)
L761:
  movupd (%rsi,%rax,1),%xmm0
  movupd (%rax),%xmm3
  movupd (%rcx,%rax,1),%xmm4
  divpd  %xmm3,%xmm0
  mulpd  %xmm0,%xmm0
  mulpd  %xmm1,%xmm0
  addpd  %xmm4,%xmm0
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdi
  jne    L761
  mov    %r11,-0x78(%rbp)
  mov    -0x120(%rbp),%ecx
  cmp    %ecx,-0x178(%rbp)
  je     L530
  mov    -0x108(%rbp),%rax
  movsd  (%rbx,%rax,1),%xmm0
  mov    -0x110(%rbp),%rax
  divsd  (%rax),%xmm0
  mov    -0x118(%rbp),%rax
  mulsd  %xmm0,%xmm0
  mulsd  (%r11),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L530
  nopl   (%rax)
L962:
  mov    -0x100(%rbp),%rax
  movsd  -0xd8(%rbp),%xmm5
  divsd  -0xe0(%rbp),%xmm5
  lea    D212(%rip),%rdi
  movsd  -0x88(%rbp),%xmm4
  andpd  D310(%rip),%xmm5
  divsd  -0xc8(%rbp),%xmm4
  movsd  (%rax,%r13,8),%xmm0
  mov    -0xa0(%rbp),%rax
  andpd  D310(%rip),%xmm4
  movsd  -0x60(%rbp),%xmm3
  mov    (%rax,%r13,4),%esi
  mov    -0xa8(%rbp),%rax
  movsd  (%rax,%r13,8),%xmm2
  mov    -0xc0(%rbp),%rax
  movsd  (%rax,%r14,8),%xmm1
  mov    $0x6,%eax
  call   <printf@plt>
  jmp    L13
  nopl   (%rax)
L144:
  mov    -0xa8(%rbp),%rax
  movsd  D167(%rip),%xmm1
  movsd  (%rax,%r13,8),%xmm0
  mov    $0x2,%eax
  call   <solve_Scattering_State_Atom@plt>
  xor    %eax,%eax
  call   <Nvalence_Atom@plt>
  mov    %eax,%r14d
  xor    %eax,%eax
  call   <Ncore_Atom@plt>
  mov    D167(%rip),%rcx
  lea    (%r14,%rax,1),%r8d
  mov    -0xc0(%rbp),%rax
  movq   %rcx,%xmm1
  mov    %r8d,-0xd8(%rbp)
  divsd  (%rax),%xmm1
  movapd %xmm1,%xmm0
  call   <log@plt>
  movsd  D310(%rip),%xmm1
  movsd  D5(%rip),%xmm7
  divsd  -0xf8(%rbp),%xmm0
  mov    -0xd8(%rbp),%r8d
  andpd  %xmm0,%xmm1
  ucomisd %xmm1,%xmm7
  jbe    L960
  addsd  %xmm7,%xmm1
  movsd  D310(%rip),%xmm2
  andnpd %xmm0,%xmm2
  subsd  %xmm7,%xmm1
  orpd   %xmm2,%xmm1
  movapd %xmm1,%xmm0
L960:
  cvttsd2si %xmm0,%eax
  mov    %r8d,%edi
  mov    %r8d,-0xd8(%rbp)
  mov    %eax,-0x64(%rbp)
  xor    %eax,%eax
  call   <r_psi_Atom@plt>
  mov    -0xd8(%rbp),%r8d
  movslq %eax,%r14
  xor    %eax,%eax
  mov    %r8d,%edi
  mov    %r8d,-0xe8(%rbp)
  call   <r_psi_prime_Atom@plt>
  pxor   %xmm0,%xmm0
  mov    -0x64(%rbp),%edi
  mov    %r14,%rsi
  cvtsi2sdl -0xc8(%rbp),%xmm0
  movsd  D17(%rip),%xmm1
  movslq %eax,%rdx
  mov    $0x1,%eax
  mov    %rdx,-0xe0(%rbp)
  movsd  %xmm1,-0xd8(%rbp)
  addsd  %xmm1,%xmm0
  call   <Norm_LogGrid@plt>
  pxor   %xmm2,%xmm2
  pxor   %xmm5,%xmm5
  movsd  -0xd8(%rbp),%xmm1
  cvtsi2sd %eax,%xmm2
  mov    -0xe0(%rbp),%rdx
  mov    -0xe8(%rbp),%r8d
  ucomisd %xmm2,%xmm5
  ja     L794
  sqrtsd %xmm2,%xmm2
L65:
  divsd  %xmm2,%xmm1
  mov    -0xb8(%rbp),%r11d
  movapd %xmm1,%xmm0
  test   %r11d,%r11d
  jle    L306
  lea    0x10(%r14),%rax
  lea    0x10(%rdx),%rdi
  mov    %r14,%rcx
  mov    %rdx,%rsi
  cmp    %rdx,%rax
  setbe  %r10b
  cmp    %r14,%rdi
  setbe  %r9b
  or     %r10b,%r9b
  je     L621
  cmp    $0x1,%r11d
  je     L621
  mov    -0x180(%rbp),%r11
  movapd %xmm1,%xmm2
  unpcklpd %xmm2,%xmm2
  lea    (%r14,%r11,1),%r9
  mov    -0x78(%rbp),%r11
  jmp    L731
  nopl   (%rax)
L783:
  add    $0x10,%rax
  add    $0x10,%rdi
L731:
  movupd (%rcx),%xmm1
  mulpd  %xmm2,%xmm1
  movups %xmm1,(%rcx)
  movupd (%rsi),%xmm1
  mov    %rax,%rcx
  mulpd  %xmm2,%xmm1
  movups %xmm1,(%rsi)
  mov    %rdi,%rsi
  cmp    %r9,%rax
  jne    L783
  mov    %r11,-0x78(%rbp)
  mov    -0x174(%rbp),%esi
  cmp    %esi,-0xb8(%rbp)
  je     L306
  add    %r15,%r14
  add    %r15,%rdx
  movsd  (%r14),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%r14)
  mulsd  (%rdx),%xmm0
  movsd  %xmm0,(%rdx)
  jmp    L306
L11:
  sub    $0x8,%rsp
  mov    %r10d,%ecx
  lea    0x1(%rsi),%edi
  mov    %rbx,%r9
  movsd  -0x130(%rbp),%xmm0
  push   %r12
  mov    $0x1,%eax
  mov    -0x128(%rbp),%r8
  mov    -0x88(%rbp),%rdx
  divsd  %xmm2,%xmm0
  call   <R_Schrodinger_Fixed_Logderiv@plt>
  movsd  -0x60(%rbp),%xmm0
  mov    %r12,%r9
  mov    %rbx,%r8
  mov    -0xa0(%rbp),%rax
  mov    -0x120(%rbp),%ecx
  mov    -0x88(%rbp),%rdx
  mov    (%rax,%r13,4),%esi
  mov    $0x1,%eax
  lea    0x1(%rsi),%edi
  call   <R_Schrodinger_Fixed_E@plt>
  mov    -0xc0(%rbp),%rax
  movsd  D167(%rip),%xmm0
  divsd  (%rax),%xmm0
  call   <log@plt>
  movsd  D310(%rip),%xmm1
  movsd  D5(%rip),%xmm7
  divsd  -0xf8(%rbp),%xmm0
  andpd  %xmm0,%xmm1
  ucomisd %xmm1,%xmm7
  jbe    L503
  addsd  %xmm7,%xmm1
  movsd  D310(%rip),%xmm2
  andnpd %xmm0,%xmm2
  subsd  %xmm7,%xmm1
  orpd   %xmm2,%xmm1
  movapd %xmm1,%xmm0
L503:
  cvttsd2si %xmm0,%edi
  pxor   %xmm0,%xmm0
  mov    %rbx,%rsi
  movsd  D17(%rip),%xmm1
  cvtsi2sdl -0xc8(%rbp),%xmm0
  mov    $0x1,%eax
  movsd  %xmm1,-0x88(%rbp)
  mov    %edi,-0x64(%rbp)
  addsd  %xmm1,%xmm0
  call   <Norm_LogGrid@plt>
  pxor   %xmm2,%xmm2
  pxor   %xmm6,%xmm6
  pop    %rdi
  cvtsi2sd %eax,%xmm2
  movsd  -0x88(%rbp),%xmm1
  pop    %r8
  ucomisd %xmm2,%xmm6
  ja     L951
  sqrtsd %xmm2,%xmm2
L351:
  divsd  %xmm2,%xmm1
  mov    -0xb8(%rbp),%edx
  movapd %xmm1,%xmm0
  test   %edx,%edx
  jle    L19
  lea    0xf(%rbx),%rax
  sub    %r12,%rax
  cmp    $0x1e,%rax
  jbe    L608
  cmp    $0x1,%edx
  je     L608
  movapd %xmm1,%xmm2
  mov    -0x180(%rbp),%rdx
  mov    -0x78(%rbp),%rcx
  xor    %eax,%eax
  unpcklpd %xmm2,%xmm2
  nopw   0x0(%rax,%rax,1)
L128:
  movupd (%rbx,%rax,1),%xmm1
  mulpd  %xmm2,%xmm1
  movups %xmm1,(%rbx,%rax,1)
  movupd (%r12,%rax,1),%xmm1
  mulpd  %xmm2,%xmm1
  movups %xmm1,(%r12,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L128
  mov    %rcx,-0x78(%rbp)
  mov    -0x174(%rbp),%edi
  cmp    %edi,-0xb8(%rbp)
  je     L19
  lea    (%rbx,%r15,1),%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  lea    (%r12,%r15,1),%rax
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L19
  nopl   0x0(%rax)
L918:
  mov    -0xb8(%rbp),%eax
  test   %eax,%eax
  jle    L115
  lea    0x10(%rcx),%rax
  lea    0x10(%r8),%rdi
  mov    %rcx,%rdx
  mov    %r8,%rsi
  cmp    %r8,%rax
  setbe  %r11b
  cmp    %rcx,%rdi
  setbe  %r9b
  or     %r11b,%r9b
  je     L123
  cmpl   $0x1,-0x120(%rbp)
  jbe    L123
  mov    -0x180(%rbp),%r11
  lea    (%rcx,%r11,1),%r9
  mov    -0x78(%rbp),%r11
  jmp    L817
  nopl   0x0(%rax)
L484:
  add    $0x10,%rax
  add    $0x10,%rdi
L817:
  movupd (%rdx),%xmm0
  xorpd  D306(%rip),%xmm0
  movups %xmm0,(%rdx)
  movupd (%rsi),%xmm0
  xorpd  D306(%rip),%xmm0
  mov    %rax,%rdx
  movups %xmm0,(%rsi)
  mov    %rdi,%rsi
  cmp    %r9,%rax
  jne    L484
  mov    %r11,-0x78(%rbp)
  mov    -0x174(%rbp),%edx
  cmp    %edx,-0xb8(%rbp)
  je     L584
  lea    (%rcx,%r15,1),%rax
  movsd  (%rax),%xmm0
  xorpd  D245(%rip),%xmm0
  movsd  %xmm0,(%rax)
  lea    (%r8,%r15,1),%rax
  movsd  (%rax),%xmm0
  xorpd  D245(%rip),%xmm0
  movsd  %xmm0,(%rax)
L584:
  movsd  -0x60(%rbp),%xmm1
  jmp    L115
  nopl   (%rax)
L397:
  xor    %eax,%eax
  mov    -0x128(%rbp),%r15
  call   <debug_print@plt>
  test   %eax,%eax
  jne    L955
L628:
  mov    -0xa0(%rbp),%r12
  movl   $0x0,-0x88(%rbp)
  movq   $0x0,-0xa0(%rbp)
  nopw   0x0(%rax,%rax,1)
L697:
  mov    -0xa0(%rbp),%rax
  mov    -0xd0(%rbp),%rbx
  movsd  D186(%rip),%xmm0
  mov    (%rbx,%rax,8),%r13
  mov    -0xa8(%rbp),%rbx
  addsd  (%rbx,%rax,8),%xmm0
  movslq (%r12),%rax
  mov    -0x80(%rbp),%rbx
  mov    %rax,%rsi
  cmpl   $0x1,(%rbx,%rax,4)
  movsd  %xmm0,-0x60(%rbp)
  jle    L212
  mov    -0x88(%rbp),%ebx
  xor    %eax,%eax
  lea    -0x64(%rbp),%r14
  mov    %eax,-0x78(%rbp)
  mov    %r15,%rax
  mov    %r14,%r15
  mov    %r13,%r14
  add    $0x1,%ebx
  mov    %rax,%r13
  movslq %ebx,%rbx
  nopl   0x0(%rax)
L737:
  mov    -0x90(%rbp),%rax
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r13,%r8
  sub    $0x8,%rsp
  mov    -0x8(%rax,%rbx,8),%r9
  mov    -0x78(%rbp),%eax
  lea    0x2(%rsi,%rax,1),%edi
  mov    -0x98(%rbp),%rax
  push   -0x8(%rax,%rbx,8)
  xor    %eax,%eax
  call   <R_Schrodinger@plt>
  xor    %eax,%eax
  mov    %ebx,-0x88(%rbp)
  call   <debug_print@plt>
  pop    %rdx
  pop    %rcx
  test   %eax,%eax
  jne    L920
  movslq (%r12),%rax
  mov    -0x80(%rbp),%rdx
  add    $0x1,%rbx
  addl   $0x1,-0x78(%rbp)
  mov    -0x78(%rbp),%ecx
  mov    %rax,%rsi
  mov    (%rdx,%rax,4),%eax
  sub    $0x1,%eax
  cmp    %ecx,%eax
  jg     L737
L674:
  mov    %r13,%r15
L212:
  addq   $0x1,-0xa0(%rbp)
  add    $0x4,%r12
  mov    -0xa0(%rbp),%rax
  cmp    %eax,-0x11c(%rbp)
  jg     L697
L490:
  xor    %eax,%eax
  call   <alloc_LogGrid@plt>
  movslq %eax,%r15
  xor    %eax,%eax
  call   <alloc_LogGrid@plt>
  movslq %eax,%r12
  xor    %eax,%eax
  call   <alloc_LogGrid@plt>
  mov    -0xb0(%rbp),%rbx
  movsd  -0x160(%rbp),%xmm0
  mov    %r15,%rsi
  movslq %eax,%r13
  mov    $0x1,%eax
  mov    %rbx,%rdi
  call   <R_Hartree_DFT@plt>
  pxor   %xmm4,%xmm4
  cvtsi2sd %eax,%xmm4
  xor    %eax,%eax
  movsd  %xmm4,-0x80(%rbp)
  mulsd  D312(%rip),%xmm4
  movsd  %xmm4,-0x88(%rbp)
  call   <alloc_LogGrid@plt>
  mov    -0xb8(%rbp),%esi
  movslq %eax,%rcx
  mov    %rcx,-0x78(%rbp)
  test   %esi,%esi
  jle    L556
  lea    -0x1(%rsi),%eax
  mov    -0x170(%rbp),%r10
  mov    %rbx,%r11
  mov    %rcx,%rdi
  cmp    $0x1,%eax
  lea    0x8(%rbx),%rax
  seta   %r14b
  cmp    %rax,%rcx
  lea    0x8(%r10),%rax
  setne  %bl
  cmp    %rax,%rcx
  setne  %al
  test   %bl,%al
  je     L191
  test   %r14b,%r14b
  je     L191
  mov    %esi,%edx
  mov    %r11,%rsi
  mov    %rcx,%rax
  shr    %edx
  sub    %rcx,%rsi
  shl    $0x4,%rdx
  add    %rcx,%rdx
  mov    %r10,%rcx
  sub    %rdi,%rcx
  nopw   0x0(%rax,%rax,1)
L239:
  movupd (%rsi,%rax,1),%xmm0
  movupd (%rcx,%rax,1),%xmm7
  add    $0x10,%rax
  addpd  %xmm7,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L239
  mov    -0xb8(%rbp),%esi
  mov    %rdi,-0x78(%rbp)
  mov    %esi,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%esi
  je     L391
  mov    -0xb0(%rbp),%rdx
  mov    -0x170(%rbp),%rsi
  movsd  (%rdx,%rax,8),%xmm0
  addsd  (%rsi,%rax,8),%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
L391:
  mov    -0x78(%rbp),%rdi
  lea    -0x58(%rbp),%rcx
  lea    -0x48(%rbp),%rdx
  mov    %r12,%rsi
  xor    %eax,%eax
  and    %r14d,%ebx
  call   <R_Exchange_DFT@plt>
  mov    -0x78(%rbp),%rdi
  lea    -0x50(%rbp),%rcx
  mov    %r13,%rsi
  lea    -0x40(%rbp),%rdx
  xor    %eax,%eax
  call   <R_Correlation_DFT@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <R_Screening_Cut@plt>
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <R_Screening_Cut@plt>
  lea    0x8(%r12),%rax
  cmp    %rax,-0x78(%rbp)
  je     L909
  test   %bl,%bl
  je     L909
  mov    -0xb8(%rbp),%edx
  mov    -0x78(%rbp),%rdi
  mov    %r12,%rax
  mov    -0xb0(%rbp),%rsi
  shr    %edx
  mov    %rdi,%rcx
  shl    $0x4,%rdx
  sub    %r12,%rsi
  sub    %r12,%rcx
  add    %r12,%rdx
  nopl   0x0(%rax)
L352:
  movupd (%rsi,%rax,1),%xmm0
  movupd (%rax),%xmm4
  mulpd  %xmm4,%xmm0
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L352
  mov    -0xb8(%rbp),%ecx
  mov    %rdi,-0x78(%rbp)
  mov    %ecx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%ecx
  je     L659
  mov    -0xb0(%rbp),%rdi
  movsd  (%r12,%rax,8),%xmm0
  mov    -0x78(%rbp),%rdx
  mulsd  (%rdi,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
L659:
  mov    -0x78(%rbp),%r14
  xor    %eax,%eax
  mov    %r14,%rdi
  call   <Integrate_LogGrid@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  lea    0x8(%r13),%rax
  movsd  %xmm0,-0x58(%rbp)
  cmp    %rax,%r14
  je     L33
  test   %bl,%bl
  je     L33
  mov    -0xb8(%rbp),%edx
  mov    -0x78(%rbp),%rbx
  mov    %r13,%rax
  mov    -0xb0(%rbp),%rsi
  shr    %edx
  mov    %rbx,%rcx
  mov    %rbx,%rdi
  shl    $0x4,%rdx
  sub    %r13,%rsi
  sub    %r13,%rcx
  add    %r13,%rdx
  nopw   0x0(%rax,%rax,1)
L472:
  movupd (%rsi,%rax,1),%xmm0
  movupd (%rax),%xmm7
  mulpd  %xmm7,%xmm0
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L472
  mov    -0xb8(%rbp),%ebx
  mov    %rdi,-0x78(%rbp)
  mov    %ebx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%ebx
  je     L857
  mov    -0xb0(%rbp),%rbx
  movsd  0x0(%r13,%rax,8),%xmm0
  mulsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
L857:
  mov    -0x78(%rbp),%rdi
  xor    %eax,%eax
  call   <Integrate_LogGrid@plt>
  movsd  -0x48(%rbp),%xmm4
  movsd  -0x40(%rbp),%xmm2
  pxor   %xmm1,%xmm1
  movsd  -0x80(%rbp),%xmm7
  movsd  -0x58(%rbp),%xmm3
  cvtsi2sd %eax,%xmm1
  movsd  -0x88(%rbp),%xmm5
  movsd  -0x168(%rbp),%xmm0
  mov    -0x1a0(%rbp),%rbx
  mov    -0x11c(%rbp),%eax
  addsd  %xmm5,%xmm0
  movsd  %xmm1,-0x50(%rbp)
  addsd  %xmm4,%xmm0
  addsd  %xmm2,%xmm0
  subsd  %xmm7,%xmm0
  subsd  %xmm3,%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx)
  mov    -0x1a8(%rbp),%rbx
  movsd  %xmm5,(%rbx)
  mov    -0x1b0(%rbp),%rbx
  movsd  %xmm7,(%rbx)
  mov    -0x1b8(%rbp),%rbx
  movsd  %xmm4,(%rbx)
  mov    -0x1c0(%rbp),%rbx
  movsd  %xmm3,(%rbx)
  mov    -0x1c8(%rbp),%rbx
  movsd  %xmm2,(%rbx)
  mov    -0x1d0(%rbp),%rbx
  movsd  %xmm1,(%rbx)
  test   %eax,%eax
  jle    L788
  mov    -0xb8(%rbp),%edx
  test   %edx,%edx
  jle    L788
  mov    -0xd0(%rbp),%r14
  sub    $0x1,%eax
  lea    0x8(%r12),%rsi
  lea    0x8(%r13),%rcx
  mov    %rsi,-0x90(%rbp)
  lea    0x8(%r15),%rsi
  lea    0x8(%r14,%rax,8),%rbx
  mov    %edx,%eax
  mov    %rsi,-0x98(%rbp)
  shr    %eax
  mov    %rbx,-0x88(%rbp)
  mov    %edx,%ebx
  sub    $0x1,%eax
  and    $0xfffffffe,%ebx
  mov    %rcx,-0xa0(%rbp)
  add    $0x1,%rax
  mov    %ebx,%r9d
  mov    %ebx,-0xa8(%rbp)
  shl    $0x4,%rax
  shl    $0x3,%r9
  mov    %rax,-0xb0(%rbp)
  mov    %edx,%eax
  lea    (%r15,%r9,1),%rbx
  lea    (%r12,%r9,1),%r11
  lea    0x0(,%rax,8),%rsi
  mov    -0x78(%rbp),%rax
  mov    %edx,-0x78(%rbp)
  lea    0x0(%r13,%r9,1),%r10
  mov    %rsi,-0xb8(%rbp)
  mov    %rax,-0xc0(%rbp)
  nopw   0x0(%rax,%rax,1)
L654:
  mov    (%r14),%rax
  cmp    -0x90(%rbp),%rax
  setne  %cl
  cmp    -0x98(%rbp),%rax
  setne  %dl
  and    %ecx,%edx
  cmpl   $0x1,-0x78(%rbp)
  setne  %cl
  test   %cl,%dl
  je     L377
  cmp    -0xa0(%rbp),%rax
  je     L377
  mov    -0xb0(%rbp),%rsi
  mov    %r15,%rdi
  mov    %r13,%rcx
  mov    %rax,%rdx
  mov    %rax,-0x80(%rbp)
  sub    %rax,%rdi
  sub    %rax,%rcx
  lea    (%rsi,%rax,1),%r8
  mov    %r12,%rsi
  sub    %rax,%rsi
  nopl   0x0(%rax)
L354:
  movupd (%rdx),%xmm0
  movupd (%rdi,%rdx,1),%xmm6
  movupd (%rsi,%rdx,1),%xmm7
  movupd (%rcx,%rdx,1),%xmm5
  add    $0x10,%rdx
  subpd  %xmm6,%xmm0
  subpd  %xmm7,%xmm0
  subpd  %xmm5,%xmm0
  movups %xmm0,-0x10(%rdx)
  cmp    %r8,%rdx
  jne    L354
  mov    -0x80(%rbp),%rax
  mov    -0x78(%rbp),%esi
  cmp    %esi,-0xa8(%rbp)
  je     L350
  add    %r9,%rax
  movsd  (%rax),%xmm0
  subsd  (%rbx),%xmm0
  subsd  (%r11),%xmm0
  subsd  (%r10),%xmm0
  movsd  %xmm0,(%rax)
L350:
  add    $0x8,%r14
  cmp    -0x88(%rbp),%r14
  jne    L654
  mov    -0xc0(%rbp),%rax
  mov    %rax,-0x78(%rbp)
L788:
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <dealloc_LogGrid@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <dealloc_LogGrid@plt>
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <dealloc_LogGrid@plt>
  mov    -0x78(%rbp),%rdi
  xor    %eax,%eax
  call   <dealloc_LogGrid@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L920:
  mov    (%r12),%esi
  mov    -0x78(%rbp),%edi
  mov    $0x1,%eax
  add    $0x1,%rbx
  movsd  -0x60(%rbp),%xmm0
  lea    0x2(%rsi,%rdi,1),%edx
  lea    D130(%rip),%rdi
  call   <printf@plt>
  movslq (%r12),%rax
  mov    -0x80(%rbp),%rcx
  addl   $0x1,-0x78(%rbp)
  mov    -0x78(%rbp),%edi
  mov    %rax,%rsi
  mov    (%rcx,%rax,4),%eax
  sub    $0x1,%eax
  cmp    %edi,%eax
  jg     L737
  jmp    L674
  nopw   0x0(%rax,%rax,1)
L377:
  mov    -0xb8(%rbp),%rdx
  mov    %r15,%rdi
  mov    %r12,%rcx
  mov    -0x78(%rbp),%r8d
  sub    %rax,%rdi
  sub    %rax,%rcx
  lea    (%rax,%rdx,1),%rsi
  mov    %r13,%rdx
  sub    %rax,%rdx
  nopl   0x0(%rax)
L775:
  movsd  (%rax),%xmm0
  subsd  (%rdi,%rax,1),%xmm0
  subsd  (%rcx,%rax,1),%xmm0
  subsd  (%rdx,%rax,1),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rsi
  jne    L775
  mov    %r8d,-0x78(%rbp)
  jmp    L350
L964:
  mov    -0x78(%rbp),%rax
  lea    0x8(%rax),%rdx
L577:
  mov    -0xc0(%rbp),%rdi
  mov    -0xb0(%rbp),%rcx
  mov    -0x1e0(%rbp),%rsi
  lea    0x8(%rdi),%rax
  sub    %rdi,%rbx
  sub    %rdi,%rcx
  mov    -0x78(%rbp),%rdi
  nopl   (%rax)
L66:
  movsd  (%rbx,%rax,1),%xmm0
  divsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  (%rdi),%xmm0
  addsd  (%rcx,%rax,1),%xmm0
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L66
  jmp    L530
L621:
  mov    -0x1d8(%rbp),%rax
  mov    -0x78(%rbp),%rsi
  sub    %r14,%rdx
  lea    (%rax,%r14,1),%rcx
  nopl   0x0(%rax,%rax,1)
L482:
  movsd  (%r14),%xmm1
  lea    (%rdx,%r14,1),%rax
  add    $0x8,%r14
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%r14)
  movsd  (%rax),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  cmp    %rcx,%r14
  jne    L482
  mov    %rsi,-0x78(%rbp)
  jmp    L306
L257:
  lea    D100(%rip),%rdi
  call   <puts@plt>
  lea    D293(%rip),%rdi
  call   <puts@plt>
  movslq -0x11c(%rbp),%rax
  test   %eax,%eax
  jg     L253
L581:
  xor    %eax,%eax
  call   <debug_print@plt>
  test   %eax,%eax
  jne    L927
L495:
  pxor   %xmm6,%xmm6
  movsd  %xmm6,-0x168(%rbp)
  movsd  %xmm6,-0x160(%rbp)
  jmp    L490
L608:
  mov    -0x1e8(%rbp),%rcx
  mov    -0x78(%rbp),%rsi
  xor    %eax,%eax
  nopl   (%rax)
L723:
  movsd  (%rbx,%rax,8),%xmm1
  mov    %rax,%rdx
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx,%rax,8)
  movsd  (%r12,%rax,8),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rcx,%rdx
  jne    L723
  mov    %rsi,-0x78(%rbp)
  jmp    L19
L955:
  lea    D248(%rip),%rdi
  call   <puts@plt>
  lea    D19(%rip),%rdi
  call   <puts@plt>
  jmp    L628
L123:
  mov    -0x1d8(%rbp),%rax
  mov    %r8,%rdx
  mov    -0x78(%rbp),%r11
  sub    %rcx,%rdx
  lea    (%rax,%rcx,1),%rsi
  mov    %rcx,%rax
  nopl   0x0(%rax,%rax,1)
L791:
  movsd  (%rax),%xmm0
  xorpd  D245(%rip),%xmm0
  lea    (%rdx,%rax,1),%rdi
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  movsd  (%rdi),%xmm0
  xorpd  D245(%rip),%xmm0
  movsd  %xmm0,(%rdi)
  cmp    %rsi,%rax
  jne    L791
  mov    %r11,-0x78(%rbp)
  jmp    L584
L370:
  mov    -0x78(%rbp),%rax
  jmp    L438
L191:
  mov    -0x78(%rbp),%rdi
  mov    -0xb8(%rbp),%eax
  mov    -0xb0(%rbp),%rdx
  mov    -0x170(%rbp),%rsi
  lea    (%rdi,%rax,8),%rcx
  mov    %rdi,%rax
  sub    %rdi,%rdx
  sub    %rdi,%rsi
  nopl   (%rax)
L967:
  movsd  (%rdx,%rax,1),%xmm0
  addsd  (%rsi,%rax,1),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rcx
  jne    L967
  mov    %rdi,-0x78(%rbp)
  jmp    L391
L909:
  mov    -0x78(%rbp),%rdi
  mov    -0xb8(%rbp),%eax
  mov    -0xb0(%rbp),%rdx
  mov    %rdi,%rcx
  lea    (%r12,%rax,8),%rsi
  mov    %r12,%rax
  sub    %r12,%rcx
  sub    %r12,%rdx
  nopw   0x0(%rax,%rax,1)
L785:
  movsd  (%rdx,%rax,1),%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L785
  mov    %rdi,-0x78(%rbp)
  jmp    L659
L33:
  mov    -0x78(%rbp),%rbx
  mov    -0xb8(%rbp),%eax
  mov    -0xb0(%rbp),%rdx
  mov    %rbx,%rcx
  lea    0x0(%r13,%rax,8),%rsi
  mov    %rbx,%rdi
  mov    %r13,%rax
  sub    %r13,%rcx
  sub    %r13,%rdx
  nopl   (%rax)
L357:
  movsd  (%rdx,%rax,1),%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rsi
  jne    L357
  mov    %rdi,-0x78(%rbp)
  jmp    L857
L556:
  mov    %rcx,%rbx
  lea    -0x48(%rbp),%rdx
  lea    -0x58(%rbp),%rcx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <R_Exchange_DFT@plt>
  lea    -0x50(%rbp),%rcx
  lea    -0x40(%rbp),%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <R_Correlation_DFT@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <R_Screening_Cut@plt>
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <R_Screening_Cut@plt>
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <Integrate_LogGrid@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  jmp    L857
L927:
  lea    D248(%rip),%rdi
  call   <puts@plt>
  lea    D19(%rip),%rdi
  call   <puts@plt>
  jmp    L495
L794:
  movapd %xmm2,%xmm0
  mov    %rdx,-0xe8(%rbp)
  mov    %r8d,-0xd8(%rbp)
  movsd  %xmm1,-0xe0(%rbp)
  call   <sqrt@plt>
  mov    -0xe8(%rbp),%rdx
  movsd  -0xe0(%rbp),%xmm1
  mov    -0xd8(%rbp),%r8d
  movapd %xmm0,%xmm2
  jmp    L65
L17:
  call   <__stack_chk_fail@plt>
L951:
  movapd %xmm2,%xmm0
  movsd  %xmm1,-0x88(%rbp)
  call   <sqrt@plt>
  movsd  -0x88(%rbp),%xmm1
  movapd %xmm0,%xmm2
  jmp    L351
```

tool_calls: name: unpack_data
arguments: data_label: D310
type: qword[2]
name: unpack_data
arguments: data_label: D5
type: f32[2]
name: unpack_data
arguments: data_label: D212
type: string
name: unpack_data
arguments: data_label: D167
type: f64
name: unpack_data
arguments: data_label: D17
type: f64
name: unpack_data
arguments: data_label: D306
type: f32[4]
name: unpack_data
arguments: data_label: D245
type: f32[4]
name: unpack_data
arguments: data_label: D186
type: f64
name: unpack_data
arguments: data_label: D312
type: f64
name: unpack_data
arguments: data_label: D130
type: string
name: unpack_data
arguments: data_label: D100
type: string
name: unpack_data
arguments: data_label: D293
type: string
name: unpack_data
arguments: data_label: D248
type: string
name: unpack_data
arguments: data_label: D19
type: string

tool: {"D310": [0x7fffffffffffffff,0x0000000000000000]}

tool: {"D5": [0.0,176.0]}

tool: D212: %d	%lf  %lf  %lf  %lf  %lf  %lf


tool: D167: 20

tool: D17: 1

tool: {"D306": [0.0,-0.0,0.0,-0.0]}

tool: {"D245": [0.0,-0.0,0.0,0.0]}

tool: D186: 0.1

tool: D312: 0.5

tool: D130: %d	%d	%lf


tool: D100: 

Troullier pseudopotential check


tool: D293: l	rcore     rmatch    E in       E psp      norm test slope test

tool: D248: 

Troullier pseudopotential extra states


tool: D19: l	n	E psp

assistant: ```c
void solve_Troullier(num_psp, n_psp, l_psp, e_psp, fill_psp, rcut_psp, r_psi_psp, r_psi_prime_psp, rho_psp, rho_semicore, V_psp, eall_psp, eh_psp, ph_psp, ex_psp, px_psp, ec_psp, pc_psp, kb_expansion, r_psi_extra, r_psi_prime_extra) int num_psp;
int n_psp[];
int l_psp[];
double e_psp[];
double fill_psp[];
double rcut_psp[];
double **r_psi_psp;
double **r_psi_prime_psp;
double *rho_psp;
double *rho_semicore;
double **V_psp;
double *eall_psp;
double *eh_psp;
double *ph_psp;
double *ex_psp;
double *px_psp;
double *ec_psp;
double *pc_psp;
int kb_expansion[];
double **r_psi_extra;
double **r_psi_prime_extra;
{
  int istate, i, l, k, match, mch, Ngrid;
  double al, amesh, rmax, Zion;
  double gamma, gpr, nu0;
  double ldpsi_match;
  double el, eeig;
  double ph, px, pc, eh, ex, ec;
  double *ul, *ul_prime;
  double *wl, *wl_prime;
  double *r, *Vh, *Vx, *Vc, *rho_total, *Vall, *Vl;
  Vall = Vall_Atom();
  r = r_LogGrid();
  Ngrid = N_LogGrid();
  al = log_amesh_LogGrid();
  amesh = amesh_LogGrid();
  eeig = 0.0;
  Zion = 0.0;
  for (k = 0; k < Ngrid; ++k)
    rho_psp[k] = 0.0;
  if (debug_print()) {
    printf("\n\nTroullier pseudopotential check\n\n");
    printf("l\trcore     rmatch    E in       E psp      norm test slope test\n");
  }
  for (l = 0; l < (num_psp); ++l) {
    wl = r_psi_psp[l];
    wl_prime = r_psi_prime_psp[l];
    Vl = V_psp[l];
    if (fill_psp[l] == 0.0) {
      rmax = 20.0;
      solve_Scattering_State_Atom(n_psp[l], l_psp[l], e_psp[l], rmax);
      istate = Nvalence_Atom() + Ncore_Atom();
      mch = rint(log(rmax / r[0]) / al);
      ul = r_psi_Atom(istate);
      ul_prime = r_psi_prime_Atom(istate);
      nu0 = Norm_LogGrid(mch, (l + 1.0), ul);
      nu0 = 1.0 / sqrt(nu0);
      for (i = 0; i < Ngrid; ++i) {
        ul[i] = ul[i] * nu0;
        ul_prime[i] = ul_prime[i] * nu0;
      }
    } else
      istate = state_Atom(n_psp[l], l_psp[l]);
    ul = r_psi_Atom(istate);
    ul_prime = r_psi_prime_Atom(istate);
    el = e_psp[l];
    match = rint(log(rcut_psp[l] / r[0]) / al);
    ldpsi_match = ul_prime[match] / ul[match];
    if (ul[match] < 0.0) {
      nu0 = -1.0;
      for (i = 0; i < Ngrid; ++i) {
        ul[i] = ul[i] * nu0;
        ul_prime[i] = ul_prime[i] * nu0;
      }
    }
    init_xpansion(l, match, fill_psp[l], el, Vall, ul, ul_prime, Vl, wl, wl_prime);
    psi_xpansion();
    dpsi_xpansion();
    psp_xpansion();
    if (fill_psp[l] > 0.0) {
      R_Schrodinger(l_psp[l] + 1, l_psp[l], Vl, &mch, &el, wl, wl_prime);
    } else {
      R_Schrodinger_Fixed_Logderiv(l_psp[l] + 1, l_psp[l], Vl, match, ldpsi_match, &el, wl, wl_prime);
      R_Schrodinger_Fixed_E(l_psp[l] + 1, l_psp[l], Vl, Ngrid - 1, el, wl, wl_prime);
      rmax = 20.0;
      mch = rint(log(rmax / r[0]) / al);
      nu0 = Norm_LogGrid(mch, (l + 1.0), wl);
      nu0 = 1.0 / sqrt(nu0);
      for (i = 0; i < Ngrid; ++i) {
        wl[i] = wl[i] * nu0;
        wl_prime[i] = wl_prime[i] * nu0;
      }
    }
    gamma = fabs(ul[match] / wl[match]);
    gpr = fabs(ul_prime[match] / wl_prime[match]);
    if (debug_print()) {
      printf("%d\t%lf  %lf  %lf  %lf  %lf  %lf\n", l_psp[l], rcut_psp[l], r[match], e_psp[l], el, gamma, gpr);
    }
    el = e_psp[l];
    psi_xpansion();
    dpsi_xpansion();
    psp_xpansion();
    if (fill_psp[l] > 0.0) {
      eeig += fill_psp[l] * el;
      Zion += fill_psp[l];
      for (k = 0; k < Ngrid; ++k)
        rho_psp[k] += fill_psp[l] * pow(wl[k] / r[k], 2.0);
    }
  }
  if (debug_print()) {
    printf("\n\nTroullier pseudopotential extra states\n\n");
    printf("l\tn\tE psp\n");
  }
  i = 0;
  for (l = 0; l < num_psp; ++l) {
    Vl = V_psp[l];
    el = e_psp[l] + 0.1;
    for (k = 0; k < (kb_expansion[l_psp[l]] - 1); ++k) {
      wl = r_psi_extra[i];
      wl_prime = r_psi_prime_extra[i];
      R_Schrodinger(l_psp[l] + 2 + k, l_psp[l], Vl, &mch, &el, wl, wl_prime);
      ++i;
      if (debug_print())
        printf("%d\t%d\t%lf\n", l_psp[l], l_psp[l] + 2 + k, el);
    }
  }
  Vh = alloc_LogGrid();
  Vx = alloc_LogGrid();
  Vc = alloc_LogGrid();
  ph = R_Hartree_DFT(rho_psp, Zion, Vh);
  eh = 0.5 * ph;
  rho_total = alloc_LogGrid();
  for (k = 0; k < Ngrid; ++k)
    rho_total[k] = rho_psp[k] + rho_semicore[k];
  R_Exchange_DFT(rho_total, Vx, &ex, &px);
  R_Correlation_DFT(rho_total, Vc, &ec, &pc);
  R_Screening_Cut(Vx);
  R_Screening_Cut(Vc);
  for (k = 0; k < Ngrid; ++k)
    rho_total[k] = (rho_psp[k]) * Vx[k];
  px = Integrate_LogGrid(rho_total);
  for (k = 0; k < Ngrid; ++k)
    rho_total[k] = (rho_psp[k]) * Vc[k];
  pc = Integrate_LogGrid(rho_total);
  *eall_psp = eeig + eh + ex + ec - ph - px - pc;
  *eh_psp = eh;
  *ph_psp = ph;
  *ex_psp = ex;
  *px_psp = px;
  *ec_psp = ec;
  *pc_psp = pc;
  for (l = 0; l < num_psp; ++l)
    for (k = 0; k < Ngrid; ++k)
      V_psp[l][k] = V_psp[l][k] - Vh[k] - Vx[k] - Vc[k];
  dealloc_LogGrid(Vh);
  dealloc_LogGrid(Vx);
  dealloc_LogGrid(Vc);
  dealloc_LogGrid(rho_total);
}
```