user: Please show me the C implementation that matches the assembly code listed below:

```asm
<R_revPBE_Exchange>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x98,%rsp
  mov    %rsi,0x50(%rsp)
  mov    %rdx,0x60(%rsp)
  mov    %rcx,0x58(%rsp)
  call   <N_LogGrid@plt>
  mov    %eax,%r15d
  xor    %eax,%eax
  call   <r_LogGrid@plt>
  mov    %eax,0x4c(%rsp)
  xor    %eax,%eax
  call   <alloc_LogGrid@plt>
  movslq %eax,%r13
  xor    %eax,%eax
  call   <alloc_LogGrid@plt>
  movslq %eax,%rbp
  xor    %eax,%eax
  call   <alloc_LogGrid@plt>
  cltq
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <alloc_LogGrid@plt>
  cltq
  mov    %rax,0x10(%rsp)
  xor    %eax,%eax
  call   <alloc_LogGrid@plt>
  cltq
  mov    %rax,0x18(%rsp)
  test   %r15d,%r15d
  jle    L30
  mov    %rbp,%rcx
  sub    $0x1,%r15d
  mov    %rbx,%r12
  mov    %rbp,%r14
  neg    %rcx
  shl    $0x3,%r15
  mov    %rbp,%rax
  sub    %rbp,%r12
  mov    %rcx,0x68(%rsp)
  movsd  D174(%rip),%xmm3
  lea    0x8(%rbp,%r15,1),%r9
  nop
L89:
  movsd  (%r12,%rax,1),%xmm0
  add    $0x8,%rax
  divsd  %xmm3,%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %r9,%rax
  jne    L89
  mov    0x8(%rsp),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    %r9,0x20(%rsp)
  call   <Derivative_LogGrid@plt>
  mov    0x10(%rsp),%rsi
  mov    0x8(%rsp),%rdi
  xor    %eax,%eax
  call   <Derivative_LogGrid@plt>
  mov    0x8(%rsp),%rdx
  mov    %rbp,%rsi
  movq   D133(%rip),%xmm5
  mov    0x20(%rsp),%r9
  mov    %rdx,%rax
  lea    0x8(%r15,%rdx,1),%rdi
  sub    %rdx,%rsi
  nopl   (%rax)
L68:
  movsd  (%rax),%xmm0
  andpd  %xmm5,%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %rdi,%rax
  jne    L68
  mov    0x18(%rsp),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    %r9,0x20(%rsp)
  sub    %r13,%rbx
  call   <Derivative_LogGrid@plt>
  mov    %r13,%rax
  lea    0x8(%r15,%r13,1),%rsi
  mov    0x20(%rsp),%r9
  neg    %rax
  mov    %rbp,0x70(%rsp)
  movsd  D108(%rip),%xmm7
  pxor   %xmm6,%xmm6
  mov    %rax,%r15
  mov    %r14,0x78(%rsp)
  mov    D174(%rip),%rax
  mov    %rsi,%rbp
  mov    %r12,0x80(%rsp)
  mov    %r13,%r14
  mov    0x50(%rsp),%r12
  mov    %r9,0x88(%rsp)
  movq   %rax,%xmm3
  jmp    L55
  nop
L73:
  lea    (%r12,%r15,1),%r8
  movsd  %xmm10,0x0(%r13)
  movsd  %xmm0,(%r8,%r13,1)
  add    $0x8,%r13
  cmp    %rbp,%r13
  je     L82
L55:
  movsd  (%rbx,%r13,1),%xmm2
  movapd %xmm6,%xmm10
  movapd %xmm6,%xmm0
  divsd  %xmm3,%xmm2
  comisd %xmm7,%xmm2
  jbe    L73
  mov    0x8(%rsp),%r8
  movsd  D52(%rip),%xmm1
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x20(%rsp)
  movsd  D129(%rip),%xmm8
  mulsd  D105(%rip),%xmm0
  sub    %r14,%r8
  divsd  D195(%rip),%xmm0
  movsd  (%r8,%r13,1),%xmm10
  mov    0x18(%rsp),%r8
  sub    %r14,%r8
  movsd  %xmm10,0x38(%rsp)
  movsd  (%r8,%r13,1),%xmm12
  movslq 0x4c(%rsp),%r8
  mulsd  %xmm10,%xmm12
  sub    %r14,%r8
  divsd  (%r8,%r13,1),%xmm8
  mov    0x10(%rsp),%r8
  mulsd  %xmm10,%xmm8
  sub    %r14,%r8
  addsd  (%r8,%r13,1),%xmm8
  movsd  %xmm12,0x40(%rsp)
  movsd  %xmm8,0x30(%rsp)
  call   <pow@plt>
  movsd  0x20(%rsp),%xmm2
  mov    D52(%rip),%rax
  movsd  %xmm0,0x28(%rsp)
  movsd  D158(%rip),%xmm0
  movq   %rax,%xmm1
  mulsd  %xmm2,%xmm0
  call   <pow@plt>
  movsd  0x20(%rsp),%xmm2
  pxor   %xmm6,%xmm6
  movsd  0x38(%rsp),%xmm10
  movapd %xmm0,%xmm4
  movsd  0x30(%rsp),%xmm8
  movq   D133(%rip),%xmm5
  movapd %xmm4,%xmm1
  movapd %xmm10,%xmm0
  movsd  D184(%rip),%xmm11
  movsd  D67(%rip),%xmm10
  addsd  %xmm4,%xmm1
  andpd  %xmm5,%xmm0
  movsd  D93(%rip),%xmm15
  movsd  D153(%rip),%xmm13
  movsd  0x28(%rsp),%xmm9
  movsd  0x40(%rsp),%xmm12
  mulsd  %xmm4,%xmm15
  mov    D174(%rip),%rax
  movsd  D14(%rip),%xmm14
  mulsd  %xmm2,%xmm1
  mulsd  D92(%rip),%xmm9
  movq   %rax,%xmm3
  mov    D108(%rip),%rax
  movq   %rax,%xmm7
  mulsd  %xmm4,%xmm15
  divsd  %xmm1,%xmm0
  movsd  D168(%rip),%xmm1
  mulsd  %xmm2,%xmm15
  mulsd  %xmm2,%xmm2
  divsd  %xmm15,%xmm8
  mulsd  %xmm0,%xmm11
  mulsd  %xmm0,%xmm11
  addsd  D15(%rip),%xmm11
  divsd  %xmm11,%xmm10
  subsd  %xmm10,%xmm1
  movapd %xmm11,%xmm10
  mulsd  %xmm11,%xmm10
  divsd  %xmm10,%xmm13
  movapd %xmm9,%xmm10
  mulsd  %xmm1,%xmm10
  mulsd  %xmm14,%xmm1
  mulsd  %xmm0,%xmm14
  mulsd  %xmm0,%xmm14
  mulsd  %xmm0,%xmm14
  mulsd  D131(%rip),%xmm0
  mulsd  %xmm13,%xmm8
  mulsd  %xmm13,%xmm0
  subsd  %xmm8,%xmm1
  movsd  D94(%rip),%xmm8
  divsd  %xmm11,%xmm0
  mulsd  %xmm4,%xmm8
  mulsd  %xmm4,%xmm8
  mulsd  %xmm8,%xmm4
  mulsd  %xmm4,%xmm2
  divsd  %xmm2,%xmm12
  subsd  %xmm14,%xmm12
  mulsd  %xmm0,%xmm12
  subsd  %xmm12,%xmm1
  movapd %xmm1,%xmm0
  mulsd  %xmm9,%xmm0
  jmp    L73
  nopl   0x0(%rax,%rax,1)
L82:
  mov    %rbp,%rsi
  mov    0x70(%rsp),%rbp
  mov    %r14,%r13
  mov    0x80(%rsp),%r12
  mov    0x88(%rsp),%r9
  mov    0x78(%rsp),%r14
  mov    %r13,%rax
  mov    %rbp,%rdi
  sub    %r13,%rdi
  nopl   0x0(%rax)
L39:
  movsd  (%rbx,%rax,1),%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rdi,%rax,1)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L39
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    %r9,0x20(%rsp)
  call   <Integrate_LogGrid@plt>
  pxor   %xmm0,%xmm0
  mov    0x68(%rsp),%rdx
  mov    0x20(%rsp),%r9
  cvtsi2sd %eax,%xmm0
  mov    0x60(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0x50(%rsp),%rax
  add    %rdx,%rax
  nopl   0x0(%rax)
L6:
  movsd  (%rax,%r14,1),%xmm0
  mulsd  (%r12,%r14,1),%xmm0
  add    $0x8,%r14
  movsd  %xmm0,-0x8(%r14)
  cmp    %r9,%r14
  jne    L6
L52:
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <Integrate_LogGrid@plt>
  pxor   %xmm0,%xmm0
  mov    %r13,%rdi
  cvtsi2sd %eax,%xmm0
  mov    0x58(%rsp),%rax
  movsd  %xmm0,(%rax)
  xor    %eax,%eax
  call   <dealloc_LogGrid@plt>
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <dealloc_LogGrid@plt>
  mov    0x8(%rsp),%rdi
  xor    %eax,%eax
  call   <dealloc_LogGrid@plt>
  mov    0x10(%rsp),%rdi
  xor    %eax,%eax
  call   <dealloc_LogGrid@plt>
  mov    0x18(%rsp),%rdi
  xor    %eax,%eax
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10f0 <dealloc_LogGrid@plt>
  nopw   0x0(%rax,%rax,1)
L30:
  mov    0x8(%rsp),%rbx
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    %rbx,%rsi
  call   <Derivative_LogGrid@plt>
  mov    0x10(%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <Derivative_LogGrid@plt>
  mov    0x18(%rsp),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <Derivative_LogGrid@plt>
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <Integrate_LogGrid@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    0x60(%rsp),%rax
  movsd  %xmm0,(%rax)
  jmp    L52
```

tool_calls: name: extract_symbolic_data
arguments: tag: D174
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D133
datatype: qword
name: extract_symbolic_data
arguments: tag: D108
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D52
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D129
datatype: f64
name: extract_symbolic_data
arguments: tag: D105
datatype: f64
name: extract_symbolic_data
arguments: tag: D195
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D158
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D184
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D67
datatype: f64
name: extract_symbolic_data
arguments: tag: D93
datatype: f64
name: extract_symbolic_data
arguments: tag: D153
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D14
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D92
datatype: f32[2]
name: extract_symbolic_data
arguments: tag: D168
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D15
datatype: f64
name: extract_symbolic_data
arguments: tag: D131
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D94
datatype: f64

tool: {"D174": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x29,0x40]}

tool: D133: 9223372036854775807

tool: {"D108": [0xac,0x43,0xd2,0xd1,0x5d,0x72,0x32,0x3c]}

tool: {"D52": [0x55,0x55,0x55,0x55,0x55,0x55,0xd5,0x3f]}

tool: D129: 2

tool: D105: 3

tool: {"D195": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x09,0x40]}

tool: {"D158": [0xcd,0x68,0x9d,0x2e,0xdb,0x9b,0x3d,0x40]}

tool: {"D184": [0xf0,0x27,0x39,0x45,0x90,0x91,0xc6,0x3f]}

tool: D67: 1.245

tool: D93: 4

tool: {"D153": [0x5e,0xc2,0x80,0x0e,0x11,0x19,0xdc,0x3f]}

tool: {"D14": [0x55,0x55,0x55,0x55,0x55,0x55,0xf5,0x3f]}

tool: {"D92": [0.0,-1.8125]}

tool: {"D168": [0xf6,0x28,0x5c,0x8f,0xc2,0xf5,0x01,0x40]}

tool: D15: 1

tool: {"D131": [0xf0,0x27,0x39,0x45,0x90,0x91,0xe6,0xbf]}

tool: D94: 8

assistant: ```c
void R_revPBE_Exchange(rho, Vx, Ex, Px) double rho[], Vx[], *Ex, *Px;
{
  int i;
  double mu, kappa;
  double onethird, fourthird, twothird;
  double pi;
  double n;
  double n_onethird;
  double ex_p;
  double ux_p;
  double s, F, Fs, Fss, kf, P0;
  double u, v;
  double agr, lap, delgr;
  int Ngrid;
  double *ex_functional;
  double *tmp;
  double *drho;
  double *ddrho;
  double *dadrho;
  double *rgrid;
  mu = 0.2195149727645171;
  kappa = 1.2450000000000000;
  pi = 4.0 * atan(1.0);
  onethird = 1.0 / 3.0;
  fourthird = 4.0 / 3.0;
  twothird = 2.0 / 3.0;
  Ngrid = N_LogGrid();
  rgrid = r_LogGrid();
  ex_functional = alloc_LogGrid();
  tmp = alloc_LogGrid();
  drho = alloc_LogGrid();
  ddrho = alloc_LogGrid();
  dadrho = alloc_LogGrid();
  for (i = 0; i < Ngrid; ++i)
    tmp[i] = rho[i] / (4.0 * pi);
  Derivative_LogGrid(tmp, drho);
  Derivative_LogGrid(drho, ddrho);
  for (i = 0; i < Ngrid; ++i)
    tmp[i] = fabs(drho[i]);
  Derivative_LogGrid(tmp, dadrho);
  for (i = 0; i < Ngrid; ++i) {
    n = rho[i] / (4.0 * pi);
    if (n > 1.0e-18) {
      agr = fabs(drho[i]);
      delgr = drho[i] * dadrho[i];
      lap = ddrho[i] + (2.0 / rgrid[i]) * drho[i];
      n_onethird = pow((3.0 * n / pi), onethird);
      kf = pow((3.0 * pi * pi * n), onethird);
      s = agr / (2.0 * kf * n);
      u = delgr / (n * n * (8.0 * kf * kf * kf));
      v = lap / (n * (4.0 * kf * kf));
      P0 = 1.0 + (mu / kappa) * s * s;
      F = (1.0 + kappa - kappa / P0);
      Fs = 2.0 * mu / (P0 * P0);
      Fss = -4.0 * (mu / kappa) * s * Fs / P0;
      ex_p = -(3.0 / 4.0) * n_onethird * F;
      ux_p = -(3.0 / 4.0) * n_onethird * (fourthird * F - v * Fs - (u - fourthird * s * s * s) * Fss);
      ex_functional[i] = ex_p;
      Vx[i] = ux_p;
    } else {
      ex_functional[i] = 0.0;
      Vx[i] = 0.0;
    }
  }
  for (i = 0; i < Ngrid; ++i)
    tmp[i] = (rho[i]) * ex_functional[i];
  *Ex = Integrate_LogGrid(tmp);
  for (i = 0; i < Ngrid; ++i)
    tmp[i] = (rho[i]) * Vx[i];
  *Px = Integrate_LogGrid(tmp);
  dealloc_LogGrid(ex_functional);
  dealloc_LogGrid(tmp);
  dealloc_LogGrid(drho);
  dealloc_LogGrid(ddrho);
  dealloc_LogGrid(dadrho);
}
```