user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<rbasis>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x13000(%rsp),%r11
L145:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L145
  sub    $0x898,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x13888(%rsp)
  xor    %eax,%eax
  lea    (%rsi,%rdi,1),%r9d
  mov    %esi,%ebx
  cmp    $0x270f,%r9d
  jg     L183
  mov    %rdx,%rsi
  mov    %edi,%r11d
  movapd %xmm0,%xmm4
  mov    %rcx,%rbp
  movslq %r9d,%r12
  mov    $0x1,%eax
  pxor   %xmm3,%xmm3
  mov    %rsp,%rdx
  movsd  D18(%rip),%xmm2
  cmp    $0x1,%r9d
  jg     L178
  xchg   %ax,%ax
L142:
  cmp    $0x1,%r11d
  jle    L189
  sub    $0x2,%r9d
  add    $0x1,%r11d
  mov    $0x2,%edi
  pxor   %xmm2,%xmm2
  nopl   0x0(%rax,%rax,1)
L41:
  lea    0x1(%rdi),%r10d
  test   %r9d,%r9d
  jle    L206
  lea    0x1(%rdi),%r10d
  lea    0x8(%rsp),%rax
  mov    %r10d,%edx
  lea    0x4(%rsi),%rcx
  lea    0x1(%rdi,%r9,1),%edi
  nopw   0x0(%rax,%rax,1)
L87:
  movsd  (%rax),%xmm1
  ucomisd %xmm2,%xmm1
  jp     L50
  movapd %xmm2,%xmm0
  je     L46
L50:
  pxor   %xmm3,%xmm3
  movapd %xmm4,%xmm0
  movslq %edx,%r13
  cvtsi2sdl (%rcx),%xmm3
  mov    -0x4(%rsi,%r13,4),%r13d
  sub    (%rcx),%r13d
  subsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %r13d,%xmm1
  divsd  %xmm1,%xmm0
L46:
  movsd  0x8(%rax),%xmm3
  ucomisd %xmm2,%xmm3
  jp     L166
  movapd %xmm2,%xmm1
  je     L147
L166:
  movslq %edx,%r13
  pxor   %xmm1,%xmm1
  mov    (%rsi,%r13,4),%r13d
  cvtsi2sd %r13d,%xmm1
  sub    0x4(%rcx),%r13d
  subsd  %xmm4,%xmm1
  mulsd  %xmm3,%xmm1
  pxor   %xmm3,%xmm3
  cvtsi2sd %r13d,%xmm3
  divsd  %xmm3,%xmm1
L147:
  addsd  %xmm1,%xmm0
  add    $0x1,%edx
  add    $0x8,%rax
  add    $0x4,%rcx
  movsd  %xmm0,-0x8(%rax)
  cmp    %edi,%edx
  jne    L87
L206:
  mov    %r10d,%edi
  sub    $0x1,%r9d
  cmp    %r11d,%r10d
  jne    L41
L189:
  pxor   %xmm0,%xmm0
  cvtsi2sdl (%rsi,%r12,4),%xmm0
  ucomisd %xmm4,%xmm0
  jp     L57
  jne    L57
  mov    D18(%rip),%rsi
  movslq %ebx,%rax
  mov    %rsi,(%rsp,%rax,8)
L57:
  test   %ebx,%ebx
  jle    L183
  pxor   %xmm2,%xmm2
  lea    0x1(%rbx),%ecx
  mov    $0x1,%eax
  mov    %rsp,%rdx
  movapd %xmm2,%xmm1
  nopl   0x0(%rax)
L208:
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  0x0(%rbp,%rax,8),%xmm0
  add    $0x1,%rax
  addsd  %xmm0,%xmm1
  cmp    %rax,%rcx
  jne    L208
  mov    $0x1,%eax
  nopl   (%rax)
L193:
  ucomisd %xmm2,%xmm1
  jp     L83
  movapd %xmm2,%xmm0
  je     L154
L83:
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  0x0(%rbp,%rax,8),%xmm0
  divsd  %xmm1,%xmm0
L154:
  movsd  %xmm0,(%r8,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L193
L183:
  mov    0x13888(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L79
  add    $0x13898,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L182:
  pxor   %xmm1,%xmm1
  movapd %xmm4,%xmm0
  cvtsi2sdl 0x4(%rsi,%rax,4),%xmm1
  cmpltsd %xmm1,%xmm0
  movapd %xmm2,%xmm1
  andpd  %xmm0,%xmm1
  andnpd %xmm3,%xmm0
  orpd   %xmm1,%xmm0
L163:
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %r12,%rax
  je     L142
L178:
  pxor   %xmm0,%xmm0
  cvtsi2sdl (%rsi,%rax,4),%xmm0
  comisd %xmm0,%xmm4
  jae    L182
  movapd %xmm3,%xmm0
  jmp    L163
L79:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D18
data_type: f32[2]

tool: {"D18": [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;
    }
  }
}
```