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

```asm
<rbasis>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x13000(%rsp),%r11
L18:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L18
  sub    $0x8f0,%rsp
  mov    %edi,-0x138c4(%rbp)
  movsd  %xmm0,-0x138d0(%rbp)
  mov    %esi,-0x138c8(%rbp)
  mov    %rdx,-0x138d8(%rbp)
  mov    %rcx,-0x138e0(%rbp)
  mov    %r8,-0x138e8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x138c8(%rbp),%edx
  mov    -0x138c4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x138ac(%rbp)
  cmpl   $0x270f,-0x138ac(%rbp)
  jg     L204
  movl   $0x1,-0x138b4(%rbp)
  jmp    L27
L173:
  mov    -0x138b4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x138d8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  -0x138d0(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jb     L248
  mov    -0x138b4(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x138d8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  comisd -0x138d0(%rbp),%xmm0
  jbe    L248
  mov    -0x138b4(%rbp),%eax
  cltq
  movsd  D16(%rip),%xmm0
  movsd  %xmm0,-0x13890(%rbp,%rax,8)
  jmp    L177
L248:
  mov    -0x138b4(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x13890(%rbp,%rax,8)
L177:
  addl   $0x1,-0x138b4(%rbp)
L27:
  mov    -0x138ac(%rbp),%eax
  cmp    -0x138b4(%rbp),%eax
  jg     L173
  movl   $0x2,-0x138b0(%rbp)
  jmp    L140
L249:
  movl   $0x1,-0x138b4(%rbp)
  jmp    L179
L16:
  mov    -0x138b4(%rbp),%eax
  cltq
  movsd  -0x13890(%rbp,%rax,8),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L86
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  je     L81
L86:
  mov    -0x138b4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x138d8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  -0x138d0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  mov    -0x138b4(%rbp),%eax
  cltq
  movsd  -0x13890(%rbp,%rax,8),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x138b4(%rbp),%edx
  mov    -0x138b0(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x138d8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x138b4(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x138d8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%edx
  sub    %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x138a8(%rbp)
  jmp    L47
L81:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x138a8(%rbp)
L47:
  mov    -0x138b4(%rbp),%eax
  add    $0x1,%eax
  cltq
  movsd  -0x13890(%rbp,%rax,8),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L186
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  je     L37
L186:
  mov    -0x138b4(%rbp),%edx
  mov    -0x138b0(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x138d8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x138d0(%rbp),%xmm1
  mov    -0x138b4(%rbp),%eax
  add    $0x1,%eax
  cltq
  movsd  -0x13890(%rbp,%rax,8),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x138b4(%rbp),%edx
  mov    -0x138b0(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x138d8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x138b4(%rbp),%edx
  movslq %edx,%rdx
  add    $0x1,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x138d8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%edx
  sub    %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x138a0(%rbp)
  jmp    L103
L37:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x138a0(%rbp)
L103:
  movsd  -0x138a8(%rbp),%xmm0
  addsd  -0x138a0(%rbp),%xmm0
  mov    -0x138b4(%rbp),%eax
  cltq
  movsd  %xmm0,-0x13890(%rbp,%rax,8)
  addl   $0x1,-0x138b4(%rbp)
L179:
  mov    -0x138ac(%rbp),%eax
  sub    -0x138b0(%rbp),%eax
  cmp    %eax,-0x138b4(%rbp)
  jle    L16
  addl   $0x1,-0x138b0(%rbp)
L140:
  mov    -0x138b0(%rbp),%eax
  cmp    -0x138c4(%rbp),%eax
  jle    L249
  mov    -0x138ac(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x138d8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  ucomisd -0x138d0(%rbp),%xmm0
  jp     L151
  ucomisd -0x138d0(%rbp),%xmm0
  jne    L151
  mov    -0x138c8(%rbp),%eax
  cltq
  movsd  D16(%rip),%xmm0
  movsd  %xmm0,-0x13890(%rbp,%rax,8)
L151:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x13898(%rbp)
  movl   $0x1,-0x138b4(%rbp)
  jmp    L200
L154:
  mov    -0x138b4(%rbp),%eax
  cltq
  movsd  -0x13890(%rbp,%rax,8),%xmm1
  mov    -0x138b4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x138e0(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x13898(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x13898(%rbp)
  addl   $0x1,-0x138b4(%rbp)
L200:
  mov    -0x138b4(%rbp),%eax
  cmp    -0x138c8(%rbp),%eax
  jle    L154
  movl   $0x1,-0x138b4(%rbp)
  jmp    L75
L233:
  pxor   %xmm0,%xmm0
  ucomisd -0x13898(%rbp),%xmm0
  jp     L12
  pxor   %xmm0,%xmm0
  ucomisd -0x13898(%rbp),%xmm0
  je     L0
L12:
  mov    -0x138b4(%rbp),%eax
  cltq
  movsd  -0x13890(%rbp,%rax,8),%xmm1
  mov    -0x138b4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x138e0(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x138b4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x138e8(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x13898(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L148
L0:
  mov    -0x138b4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x138e8(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
L148:
  addl   $0x1,-0x138b4(%rbp)
L75:
  mov    -0x138b4(%rbp),%eax
  cmp    -0x138c8(%rbp),%eax
  jle    L233
L204:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L192
  call   <__stack_chk_fail@plt>
L192:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D16
datatype: f32[2]

tool: {"D16": [0.0,1.875]}

assistant: ```c
void rbasis(int c, double t, int npts, int x[], double h[], double r[]) {
  int nplusc;
  int i, j, k;
  double d, e;
  double sum;
  double temp[10000];
  nplusc = npts + c;
  if (nplusc < 10000) {
    for (i = 1; i <= nplusc - 1; i++) {
      if ((t >= x[i]) && (t < x[i + 1]))
        temp[i] = 1;
      else
        temp[i] = 0;
    }
    for (k = 2; k <= c; k++) {
      for (i = 1; i <= nplusc - k; i++) {
        if (temp[i] != 0)
          d = ((t - x[i]) * temp[i]) / (x[i + k - 1] - x[i]);
        else
          d = 0;
        if (temp[i + 1] != 0)
          e = ((x[i + k] - t) * temp[i + 1]) / (x[i + k] - x[i + 1]);
        else
          e = 0;
        temp[i] = d + e;
      }
    }
    if (t == (double)x[nplusc]) {
      temp[npts] = 1;
    }
    sum = 0.;
    for (i = 1; i <= npts; i++) {
      sum = sum + temp[i] * h[i];
    }
    for (i = 1; i <= npts; i++) {
      if (sum != 0) {
        r[i] = (temp[i] * h[i]) / (sum);
      } else
        r[i] = 0;
    }
  }
}
```