user: Converte this assembly snippet into its equivalent C code:

```asm
<agbnp3_test_cspline>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movss  D26(%rip),%xmm0
  movss  %xmm0,-0x48(%rbp)
  movl   $0x64,-0x44(%rbp)
  movss  D1(%rip),%xmm0
  movss  %xmm0,-0x40(%rbp)
  movl   $0x3e8,-0x3c(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x38(%rbp)
  movss  D32(%rip),%xmm0
  movss  %xmm0,-0x34(%rbp)
  movss  D48(%rip),%xmm0
  movss  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x58(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L13
L44:
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  lea    -0x5c(%rbp),%rdx
  movss  -0x34(%rbp),%xmm1
  movss  -0x30(%rbp),%xmm0
  mov    -0x58(%rbp),%eax
  mov    %rdx,%rdi
  movaps %xmm1,%xmm2
  movaps %xmm0,%xmm1
  movd   %eax,%xmm0
  call   <agbnp3_i4@plt>
  movd   %xmm0,%eax
  mov    %eax,(%rbx)
  cmpl   $0x0,-0x50(%rbp)
  jne    L58
  movss  -0x5c(%rbp),%xmm0
  movss  %xmm0,-0x54(%rbp)
L58:
  movss  -0x58(%rbp),%xmm0
  addss  -0x48(%rbp),%xmm0
  movss  %xmm0,-0x58(%rbp)
  addl   $0x1,-0x50(%rbp)
L13:
  mov    -0x50(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L44
  mov    -0x20(%rbp),%rdx
  movss  -0x38(%rbp),%xmm1
  movss  -0x54(%rbp),%xmm0
  mov    -0x28(%rbp),%rsi
  mov    -0x44(%rbp),%ecx
  mov    -0x48(%rbp),%eax
  movaps %xmm1,%xmm2
  movaps %xmm0,%xmm1
  mov    %ecx,%edi
  movd   %eax,%xmm0
  call   <agbnp3_cspline_setup@plt>
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x58(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L26
L22:
  lea    -0x60(%rbp),%r8
  lea    -0x64(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rsi
  mov    -0x44(%rbp),%edi
  movss  -0x48(%rbp),%xmm0
  mov    -0x58(%rbp),%eax
  movaps %xmm0,%xmm1
  movd   %eax,%xmm0
  call   <agbnp3_cspline_interpolate@plt>
  cmpl   $0x0,-0x50(%rbp)
  jle    L66
  movss  -0x60(%rbp),%xmm0
  movaps %xmm0,%xmm2
  mulss  -0x40(%rbp),%xmm2
  movss  -0x64(%rbp),%xmm0
  movaps %xmm0,%xmm1
  subss  -0x4c(%rbp),%xmm1
  movss  -0x64(%rbp),%xmm0
  mov    -0x58(%rbp),%eax
  movaps %xmm2,%xmm3
  movaps %xmm1,%xmm2
  movaps %xmm0,%xmm1
  movd   %eax,%xmm0
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L66:
  movss  -0x64(%rbp),%xmm0
  movss  %xmm0,-0x4c(%rbp)
  movss  -0x58(%rbp),%xmm0
  movss  %xmm0,-0x2c(%rbp)
  movss  -0x58(%rbp),%xmm0
  addss  -0x40(%rbp),%xmm0
  movss  %xmm0,-0x58(%rbp)
  addl   $0x1,-0x50(%rbp)
L26:
  mov    -0x50(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L22
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L11
  call   <__stack_chk_fail@plt>
L11:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D26
data_type: f32
name: unpack_data
arguments: tag: D1
data_type: f32
name: unpack_data
arguments: tag: D32
data_type: f32
name: unpack_data
arguments: tag: D48
data_type: f32
name: unpack_data
arguments: tag: D10
data_type: string

tool: D26: 0.2

tool: D1: 0.02

tool: D32: 2

tool: D48: 1

tool: D10: csp: %f %f %f %f


assistant: ```c
void agbnp3_test_cspline(void) {
  float x, dx = 0.2;
  int n = 100;
  float dxi = 0.02;
  int ni = 1000;
  float *y = malloc(n * sizeof(float));
  float *y2 = malloc(n * sizeof(float));
  float yp1, ypn = 0.0;
  float f, fp;
  int i;
  float Rj = 2.0, Ri = 1.0, dq;
  float q;
  float fold, xold;
  x = 0.0;
  for (i = 0; i < n; i++) {
    y[i] = agbnp3_i4(x, Ri, Rj, &dq);
    if (i == 0)
      yp1 = dq;
    x += dx;
  }
  agbnp3_cspline_setup(dx, n, y, yp1, ypn, y2);
  x = 0.0;
  for (i = 0; i < ni; i++) {
    agbnp3_cspline_interpolate(x, dx, n, y, y2, &f, &fp);
    if (i > 0) {
      printf("csp: %f %f %f %f\n", x, f, f - fold, fp * dxi);
    }
    fold = f;
    xold = x;
    x += dxi;
  }
  free(y);
  free(y2);
}
```