user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<R_Dirac>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %edi,-0xf4(%rbp)
  mov    %esi,-0xf8(%rbp)
  mov    %edx,-0xfc(%rbp)
  movsd  %xmm0,-0x108(%rbp)
  mov    %rcx,-0x110(%rbp)
  mov    %r8,-0x118(%rbp)
  mov    %r9,-0x120(%rbp)
  mov    -0x120(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  mov    -0xf8(%rbp),%eax
  add    $0x1,%eax
  imul   -0xf8(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0xa8(%rbp)
  movsd  D111(%rip),%xmm0
  movsd  %xmm0,-0xa0(%rbp)
  movsd  -0xa0(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0xa0(%rbp)
  movsd  D41(%rip),%xmm0
  movsd  %xmm0,-0xc8(%rbp)
  cmpl   $0x0,-0xf8(%rbp)
  je     L138
  cmpl   $0x0,-0xfc(%rbp)
  jle    L365
  mov    -0xf8(%rbp),%eax
  not    %eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0xc8(%rbp)
  jmp    L138
L365:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0xf8(%rbp),%xmm0
  movsd  %xmm0,-0xc8(%rbp)
L138:
  movsd  -0xc8(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  -0xa0(%rbp),%xmm1
  mulsd  -0x108(%rbp),%xmm1
  mulsd  -0x108(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x98(%rbp)
  mov    $0x0,%eax
  call   <N_LogGrid@plt>
  mov    %eax,-0xd4(%rbp)
  mov    $0x0,%eax
  call   <log_amesh_LogGrid@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x90(%rbp)
  movsd  -0x90(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x88(%rbp)
  mov    $0x0,%eax
  call   <r_LogGrid@plt>
  mov    %rax,-0x80(%rbp)
  mov    $0x0,%eax
  call   <alloc_LogGrid@plt>
  mov    %rax,-0x78(%rbp)
  mov    $0x0,%eax
  call   <alloc_LogGrid@plt>
  mov    %rax,-0x70(%rbp)
  mov    $0x0,%eax
  call   <alloc_LogGrid@plt>
  mov    %rax,-0x68(%rbp)
  mov    $0x0,%eax
  call   <alloc_LogGrid@plt>
  mov    %rax,-0x60(%rbp)
  mov    $0x0,%eax
  call   <alloc_LogGrid@plt>
  mov    %rax,-0x58(%rbp)
  mov    -0xd4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0xa8(%rbp),%xmm2
  movsd  D332(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0xd4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  mov    -0xd4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mulsd  %xmm3,%xmm2
  divsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0xc0(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0xb8(%rbp)
  movl   $0x0,-0xec(%rbp)
  jmp    L216
L569:
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0xa8(%rbp),%xmm2
  movsd  D332(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  divsd  -0x18(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  comisd -0xb8(%rbp),%xmm0
  jbe    L236
  movsd  -0xb8(%rbp),%xmm0
  jmp    L227
L236:
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0xa8(%rbp),%xmm2
  movsd  D332(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  divsd  -0x18(%rbp),%xmm0
  addsd  %xmm1,%xmm0
L227:
  movsd  %xmm0,-0xb8(%rbp)
  addl   $0x1,-0xec(%rbp)
L216:
  mov    -0xec(%rbp),%eax
  cmp    -0xd4(%rbp),%eax
  jl     L569
  movsd  -0xd0(%rbp),%xmm0
  comisd -0xc0(%rbp),%xmm0
  jbe    L413
  movsd  -0xc0(%rbp),%xmm1
  movsd  D32(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
L413:
  movsd  -0xb8(%rbp),%xmm0
  comisd -0xd0(%rbp),%xmm0
  jbe    L473
  movsd  -0xb8(%rbp),%xmm1
  movsd  D155(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
L473:
  movsd  -0xd0(%rbp),%xmm0
  comisd -0xc0(%rbp),%xmm0
  jbe    L233
  movsd  -0xc0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0xb8(%rbp),%xmm1
  movsd  D332(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
L233:
  movl   $0x0,-0xec(%rbp)
  jmp    L488
L460:
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xec(%rbp)
L488:
  cmpl   $0x3,-0xec(%rbp)
  jle    L460
  movl   $0x0,-0xe4(%rbp)
  jmp    L101
L411:
  addl   $0x1,-0xe4(%rbp)
  movl   $0x0,-0xec(%rbp)
  jmp    L57
L155:
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0xd0(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  mulsd  -0x18(%rbp),%xmm0
  addsd  -0xa8(%rbp),%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x88(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xec(%rbp)
L57:
  mov    -0xec(%rbp),%eax
  cmp    -0xd4(%rbp),%eax
  jl     L155
  mov    -0x58(%rbp),%rdx
  mov    -0x110(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <Derivative_LogGrid@plt>
  movl   $0x0,-0xec(%rbp)
  jmp    L158
L27:
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x88(%rbp),%xmm0
  movq   D295(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movapd %xmm0,%xmm2
  mulsd  -0x18(%rbp),%xmm2
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0xd0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0xa0(%rbp),%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0xd0(%rbp),%xmm0
  movapd %xmm1,%xmm3
  mulsd  %xmm0,%xmm3
  movsd  -0xa0(%rbp),%xmm1
  movsd  D332(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  -0xc8(%rbp),%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm4
  movsd  -0xa0(%rbp),%xmm5
  movsd  D332(%rip),%xmm1
  mulsd  %xmm1,%xmm5
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm6
  movsd  -0xd0(%rbp),%xmm1
  subsd  %xmm6,%xmm1
  mulsd  %xmm1,%xmm5
  movsd  D199(%rip),%xmm1
  addsd  %xmm5,%xmm1
  mulsd  %xmm4,%xmm1
  divsd  %xmm1,%xmm0
  addsd  %xmm3,%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x90(%rbp),%xmm0
  movq   D295(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  D332(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0xa0(%rbp),%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0xa0(%rbp),%xmm2
  movsd  D332(%rip),%xmm1
  mulsd  %xmm1,%xmm2
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movsd  -0xd0(%rbp),%xmm1
  subsd  %xmm3,%xmm1
  mulsd  %xmm1,%xmm2
  movsd  D199(%rip),%xmm1
  addsd  %xmm2,%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xec(%rbp)
L158:
  mov    -0xec(%rbp),%eax
  cmp    -0xd4(%rbp),%eax
  jl     L27
  mov    -0xd4(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xdc(%rbp)
  jmp    L276
L126:
  subl   $0x1,-0xdc(%rbp)
  cmpl   $0x1,-0xdc(%rbp)
  jg     L276
  lea    D40(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  jmp    L117
L276:
  mov    -0xdc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xdc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  ja     L126
  movsd  D199(%rip),%xmm0
  movsd  %xmm0,-0xb0(%rbp)
  movl   $0x0,-0xec(%rbp)
  jmp    L215
L149:
  movsd  -0xb0(%rbp),%xmm0
  movq   D295(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0xb0(%rbp)
  addl   $0x1,-0xec(%rbp)
L215:
  mov    -0xf4(%rbp),%eax
  sub    -0xf8(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0xec(%rbp)
  jl     L149
  movl   $0x0,-0xec(%rbp)
  jmp    L30
L393:
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  -0x98(%rbp),%xmm0
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <pow@plt>
  movq   %xmm0,%rax
  mov    -0xec(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    0x10(%rbp),%rdx
  add    %rcx,%rdx
  movq   %rax,%xmm0
  mulsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  -0x90(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x98(%rbp),%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x90(%rbp),%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm2
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xec(%rbp)
L30:
  cmpl   $0x3,-0xec(%rbp)
  jle    L393
  movl   $0x0,-0xe0(%rbp)
  movl   $0x3,-0xec(%rbp)
  jmp    L464
L277:
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x18(%rbp),%rdx
  mov    -0xec(%rbp),%eax
  mov    0x10(%rbp),%rsi
  mov    %eax,%edi
  call   <Predictor_Out@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x70(%rbp),%rdx
  mov    0x18(%rbp),%rcx
  mov    -0xec(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <Predictor_Out@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  movl   $0x0,-0xe8(%rbp)
  jmp    L99
L1:
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x90(%rbp),%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm2
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x70(%rbp),%rdx
  mov    0x18(%rbp),%rcx
  mov    -0xec(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <Corrector_Out@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x18(%rbp),%rdx
  mov    -0xec(%rbp),%eax
  mov    0x10(%rbp),%rsi
  mov    %eax,%edi
  call   <Corrector_Out@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  addl   $0x1,-0xe8(%rbp)
L99:
  cmpl   $0x5,-0xe8(%rbp)
  jle    L1
  mov    -0xec(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jb     L47
  addl   $0x1,-0xe0(%rbp)
L47:
  addl   $0x1,-0xec(%rbp)
L464:
  mov    -0xec(%rbp),%eax
  cmp    -0xdc(%rbp),%eax
  jl     L277
  mov    -0xdc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    -0xdc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  mov    -0xe0(%rbp),%eax
  sub    -0xf4(%rbp),%eax
  mov    %eax,%edx
  mov    -0xf8(%rbp),%eax
  add    %edx,%eax
  cmp    $0xffffffff,%eax
  jge    L379
  movsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0xb8(%rbp)
  movsd  -0xb8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0xc0(%rbp),%xmm1
  movsd  D332(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  jmp    L101
L379:
  mov    -0xe0(%rbp),%eax
  sub    -0xf4(%rbp),%eax
  mov    %eax,%edx
  mov    -0xf8(%rbp),%eax
  add    %edx,%eax
  test   %eax,%eax
  js     L394
  movsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0xc0(%rbp)
  movsd  -0xb8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0xc0(%rbp),%xmm1
  movsd  D332(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  jmp    L101
L394:
  movsd  D322(%rip),%xmm0
  divsd  -0x90(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  mov    -0xdc(%rbp),%edx
  add    %edx,%eax
  mov    %eax,-0xd8(%rbp)
  mov    -0xd8(%rbp),%eax
  add    $0x4,%eax
  cmp    %eax,-0xd4(%rbp)
  jg     L563
  mov    -0xd4(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,-0xd8(%rbp)
L563:
  mov    -0xd8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xd8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movapd %xmm1,%xmm2
  mulsd  %xmm0,%xmm2
  movsd  -0xa8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  mov    -0xd8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x110(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0xd0(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0xd8(%rbp),%eax
  mov    %eax,-0xec(%rbp)
  jmp    L395
L132:
  movsd  -0x40(%rbp),%xmm0
  movq   D295(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xd8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  mov    -0xec(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    0x10(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D295(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mulsd  -0x90(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x40(%rbp),%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x90(%rbp),%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm2
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xec(%rbp)
L395:
  mov    -0xd8(%rbp),%eax
  add    $0x4,%eax
  cmp    %eax,-0xec(%rbp)
  jle    L132
  mov    -0xd8(%rbp),%eax
  mov    %eax,-0xec(%rbp)
  jmp    L242
L558:
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x18(%rbp),%rdx
  mov    -0xec(%rbp),%eax
  mov    0x10(%rbp),%rsi
  mov    %eax,%edi
  call   <Predictor_In@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x70(%rbp),%rdx
  mov    0x18(%rbp),%rcx
  mov    -0xec(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <Predictor_In@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  movl   $0x0,-0xe8(%rbp)
  jmp    L3
L118:
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x90(%rbp),%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm2
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x70(%rbp),%rdx
  mov    0x18(%rbp),%rcx
  mov    -0xec(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <Corrector_In@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  mov    -0xec(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x18(%rbp),%rdx
  mov    -0xec(%rbp),%eax
  mov    0x10(%rbp),%rsi
  mov    %eax,%edi
  call   <Corrector_In@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  addl   $0x1,-0xe8(%rbp)
L3:
  cmpl   $0x5,-0xe8(%rbp)
  jle    L118
  subl   $0x1,-0xec(%rbp)
L242:
  mov    -0xdc(%rbp),%eax
  cmp    -0xec(%rbp),%eax
  jl     L558
  mov    -0xdc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x50(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0xdc(%rbp),%eax
  mov    %eax,-0xec(%rbp)
  jmp    L358
L430:
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xec(%rbp)
L358:
  mov    -0xec(%rbp),%eax
  cmp    -0xd8(%rbp),%eax
  jle    L430
  mov    -0xdc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x98(%rbp),%rdx
  mov    -0xd8(%rbp),%eax
  mov    0x10(%rbp),%rsi
  movq   %rdx,%xmm0
  mov    %eax,%edi
  call   <Norm_LogGrid@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  D199(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x48(%rbp),%xmm0
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x30(%rbp),%xmm0
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0xec(%rbp)
  jmp    L437
L472:
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xec(%rbp)
L437:
  mov    -0xec(%rbp),%eax
  cmp    -0xd8(%rbp),%eax
  jle    L472
  mov    -0xd8(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xec(%rbp)
  jmp    L77
L326:
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xec(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xec(%rbp)
L77:
  mov    -0xec(%rbp),%eax
  cmp    -0xd4(%rbp),%eax
  jl     L326
  movsd  -0x50(%rbp),%xmm1
  movsd  D332(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x48(%rbp),%xmm0
  subsd  -0x30(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0xdc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  -0x90(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x20(%rbp),%xmm0
  movq   D200(%rip),%xmm1
  andpd  %xmm0,%xmm1
  movsd  -0xd0(%rbp),%xmm0
  movq   D200(%rip),%xmm2
  andpd  %xmm2,%xmm0
  comisd D277(%rip),%xmm0
  jbe    L357
  movsd  -0xd0(%rbp),%xmm0
  movq   D200(%rip),%xmm2
  andpd  %xmm2,%xmm0
  jmp    L241
L357:
  movsd  D277(%rip),%xmm0
L241:
  movsd  D145(%rip),%xmm2
  mulsd  %xmm2,%xmm0
  comisd %xmm1,%xmm0
  jbe    L110
  mov    -0x118(%rbp),%rax
  mov    -0xdc(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x120(%rbp),%rax
  movsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  jmp    L117
L110:
  movsd  -0x20(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L97
  movsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0xb8(%rbp)
  jmp    L273
L97:
  movsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0xc0(%rbp)
L273:
  movsd  -0xd0(%rbp),%xmm0
  addsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  movsd  -0xd0(%rbp),%xmm0
  comisd -0xc0(%rbp),%xmm0
  ja     L40
  movsd  -0xb8(%rbp),%xmm0
  comisd -0xd0(%rbp),%xmm0
  ja     L40
  jmp    L101
L40:
  movsd  -0xb8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0xc0(%rbp),%xmm1
  movsd  D332(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
L101:
  cmpl   $0x63,-0xe4(%rbp)
  jle    L411
  mov    $0x64,%esi
  lea    D311(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x118(%rbp),%rax
  mov    -0xdc(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x120(%rbp),%rax
  movsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <dealloc_LogGrid@plt>
  nop
L117:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D111
type: byte[8]
name: unpack_data
arguments: data_tag: D41
type: f32[2]
name: unpack_data
arguments: data_tag: D332
type: f64
name: unpack_data
arguments: data_tag: D32
type: f64
name: unpack_data
arguments: data_tag: D155
type: f64
name: unpack_data
arguments: data_tag: D295
type: f32[2]
name: unpack_data
arguments: data_tag: D199
type: f64
name: unpack_data
arguments: data_tag: D40
type: string
name: unpack_data
arguments: data_tag: D322
type: f64
name: unpack_data
arguments: data_tag: D200
type: qword
name: unpack_data
arguments: data_tag: D277
type: f64[2]
name: unpack_data
arguments: data_tag: D145
type: byte[8]
name: unpack_data
arguments: data_tag: D311
type: string

tool: {"D111": [0x26,0x45,0x94,0xdd,0xd3,0xe3,0x7d,0x3f]}

tool: {"D41": [0.0,-1.875]}

tool: D332: 0.5

tool: D32: 1.25

tool: D155: 0.75

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

tool: D199: 1

tool: D40: Error in R_Dirac: no turning point

tool: D322: 2.3

tool: D200: 9223372036854775807

tool: {"D277": [0.2,1e-10]}

tool: {"D145": [0xbb,0xbd,0xd7,0xd9,0xdf,0x7c,0xdb,0x3d]}

tool: D311: Error R_Dirac: More than %d iterations


assistant: ```c
void R_Dirac(int n, int l, int s2, double Z, const double *v, int *mch, double *Eig, double *u, double *uprime) {
  int i, j, iteration, node, match, Ninf, Ngrid;
  double E, de, kappa, Emax, Emin, log_amesh, log_amesh2, fss, gamma, L2, L0, r2, sum, a, scale, m1scale, uout, upout, upin, *r, *f_upp, *dv, *frp, *fr, *upp;
  E = *Eig;
  L2 = ((double)(l * (l + 1)));
  fss = 1.0 / 137.03602;
  fss = fss * fss;
  kappa = -1;
  if (l) {
    if (s2 > 0) {
      kappa = -(l + 1);
    } else {
      kappa = l;
    }
  }
  gamma = sqrt(kappa * kappa - fss * Z * Z);
  Ngrid = N_LogGrid();
  log_amesh = log_amesh_LogGrid();
  log_amesh2 = log_amesh * log_amesh;
  r = r_LogGrid();
  f_upp = alloc_LogGrid();
  upp = alloc_LogGrid();
  fr = alloc_LogGrid();
  frp = alloc_LogGrid();
  dv = alloc_LogGrid();
  Emax = v[Ngrid - 1] + 0.5 * L2 / (r[Ngrid - 1] * r[Ngrid - 1]);
  Emin = 0.0;
  for (i = 0; i < Ngrid; ++i) {
    r2 = r[i];
    r2 = r2 * r2;
    Emin = ((Emin < (v[i] + 0.5 * L2 / r2)) ? Emin : (v[i] + 0.5 * L2 / r2));
  }
  if (E > Emax)
    E = 1.25 * Emax;
  if (E < Emin)
    E = 0.75 * Emin;
  if (E > Emax)
    E = 0.5 * (Emax + Emin);
  for (i = 0; i < 4; ++i) {
    u[i] = 0.0;
    uprime[i] = 0.0;
    upp[i] = 0.0;
  }
  iteration = 0;
  while (iteration < 100) {
    ++iteration;
    for (i = 0; i < Ngrid; ++i) {
      r2 = r[i];
      r2 = r2 * r2;
      f_upp[i] = log_amesh2 * (L2 + 2.0 * (v[i] - E) * r2);
    }
    Derivative_LogGrid(v, dv);
    for (i = 0; i < Ngrid; ++i) {
      r2 = r[i] * r[i];
      fr[i] = -log_amesh2 * r2 * (fss * (v[i] - E) * (v[i] - E) + 0.5 * fss * dv[i] * kappa / (r[i] * (1.0 + 0.5 * fss * (E - v[i]))));
      frp[i] = -log_amesh * r[i] * 0.5 * fss * dv[i] / (1.0 + 0.5 * fss * (E - v[i]));
    }
    match = Ngrid - 1;
    while (f_upp[match - 1] * f_upp[match] > 0.0) {
      match = match - 1;
      if (match < 2) {
        printf("Error in R_Dirac: no turning point\n");
        dealloc_LogGrid(f_upp);
        dealloc_LogGrid(upp);
        dealloc_LogGrid(fr);
        dealloc_LogGrid(frp);
        dealloc_LogGrid(dv);
        return;
      }
    }
    m1scale = 1.0;
    for (i = 0; i < (n - l - 1); ++i)
      m1scale *= -1.0;
    for (i = 0; i < 4; ++i) {
      u[i] = m1scale * pow(r[i], gamma);
      uprime[i] = log_amesh * gamma * u[i];
      upp[i] = (log_amesh + frp[i]) * uprime[i] + (f_upp[i] + fr[i]) * u[i];
    }
    node = 0;
    for (i = 3; i < match; ++i) {
      u[i + 1] = Predictor_Out(i, u, uprime);
      uprime[i + 1] = Predictor_Out(i, uprime, upp);
      for (j = 0; j < 6; ++j) {
        upp[i + 1] = (log_amesh + frp[i + 1]) * uprime[i + 1] + (f_upp[i + 1] + fr[i + 1]) * u[i + 1];
        uprime[i + 1] = Corrector_Out(i, uprime, upp);
        u[i + 1] = Corrector_Out(i, u, uprime);
      }
      if (u[i + 1] * u[i] <= 0)
        node = node + 1;
    }
    uout = u[match];
    upout = uprime[match];
    if ((node - n + l + 1) < 0) {
      Emin = E;
      E = 0.5 * (Emin + Emax);
    } else if ((node - n + l + 1) > 0) {
      Emax = E;
      E = 0.5 * (Emin + Emax);
    } else {
      Ninf = match + floor(2.3 / log_amesh);
      if ((Ninf + 5) > Ngrid)
        Ninf = Ngrid - 5;
      a = sqrt(L2 / (r[Ninf] * r[Ninf]) + 2.0 * (v[Ninf] - E));
      for (i = Ninf; i <= (Ninf + 4); ++i) {
        u[i] = exp(-a * (r[i] - r[Ninf]));
        uprime[i] = -r[i] * log_amesh * a * u[i];
        upp[i] = (log_amesh + frp[i]) * uprime[i] + (f_upp[i] + fr[i]) * u[i];
      }
      for (i = Ninf; i >= (match + 1); --i) {
        u[i - 1] = Predictor_In(i, u, uprime);
        uprime[i - 1] = Predictor_In(i, uprime, upp);
        for (j = 0; j < 6; ++j) {
          upp[i - 1] = (log_amesh + frp[i - 1]) * uprime[i - 1] + (f_upp[i - 1] + fr[i - 1]) * u[i - 1];
          uprime[i - 1] = Corrector_In(i, uprime, upp);
          u[i - 1] = Corrector_In(i, u, uprime);
        }
      }
      scale = uout / u[match];
      for (i = match; i <= Ninf; ++i) {
        u[i] = scale * u[i];
        uprime[i] = scale * uprime[i];
      }
      upin = uprime[match];
      sum = Norm_LogGrid(Ninf, gamma, u);
      sum = 1.0 / sqrt(sum);
      uout = sum * uout;
      upout = sum * upout;
      upin = sum * upin;
      for (i = 0; i <= Ninf; ++i) {
        u[i] = sum * u[i];
        uprime[i] = sum * uprime[i];
      }
      for (i = Ninf + 1; i < Ngrid; ++i) {
        u[i] = 0.0;
        uprime[i] = 0.0;
      }
      de = 0.5 * uout * (upout - upin) / (log_amesh * r[match]);
      if (fabs(de) < (((fabs(E) > 0.2) ? fabs(E) : 0.2) * 1.0e-10)) {
        *mch = match;
        *Eig = E;
        dealloc_LogGrid(f_upp);
        dealloc_LogGrid(upp);
        dealloc_LogGrid(fr);
        dealloc_LogGrid(frp);
        dealloc_LogGrid(dv);
        return;
      }
      if (de > 0.0)
        Emin = E;
      else
        Emax = E;
      E = E + de;
      if ((E > Emax) || (E < Emin))
        E = 0.5 * (Emin + Emax);
    }
  }
  printf("Error R_Dirac: More than %d iterations\n", 100);
  *mch = match;
  *Eig = E;
  dealloc_LogGrid(f_upp);
  dealloc_LogGrid(upp);
  dealloc_LogGrid(fr);
  dealloc_LogGrid(frp);
  dealloc_LogGrid(dv);
  return;
}
```