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

```asm
<sprstp>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    0x8(%rsi),%r12
  mov    %rdx,0x38(%rsp)
  mov    %r12,%rax
  mov    %rcx,0x28(%rsp)
  sub    $0x2,%rax
  mov    %rax,(%rsp)
  je     L131
  lea    -0x1(%r12),%r15
  mov    $0x1,%eax
L83:
  movss  (%r14,%rax,4),%xmm0
  mov    0x38(%rsp),%rdx
  movss  %xmm0,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %r15,%rax
  jne    L83
  lea    0x0(,%r12,8),%r13
  mov    0x28(%rsp),%rdx
  lea    -0x8(%r13),%rax
  lea    0x0(%rbp,%rax,1),%rbx
  add    %rax,%rdx
  mov    (%rbx),%rdi
  mov    %rbx,%rsi
  sub    %r12,%rdi
  call   <iindexx@plt>
  mov    (%rbx),%rax
  mov    0x8(%rbp),%r9
  sub    $0x1,%rax
  cmp    %rax,%r9
  ja     L137
L150:
  mov    0x28(%rsp),%r8
  xor    %edi,%edi
L205:
  mov    (%r8,%r9,8),%rsi
  mov    0x38(%rsp),%rax
  add    %r15,%rsi
  movss  (%r14,%rsi,4),%xmm0
  lea    0x0(%rbp,%rsi,8),%rdx
  movss  %xmm0,(%rax,%r9,4)
  lea    0x1(%rdi),%rax
  mov    (%rdx),%rdi
  cmp    %rdi,%rax
  ja     L192
  nopl   (%rax)
L29:
  mov    %r9,(%r8,%rax,8)
  mov    (%rdx),%rdi
  add    $0x1,%rax
  cmp    %rax,%rdi
  jae    L29
L192:
  mov    %r15,%rcx
  mov    $0x1,%edx
  jmp    L212
  nopw   0x0(%rax,%rax,1)
L178:
  lea    (%rdx,%rcx,1),%rax
  shr    %rax
  cmp    %rsi,0x0(%rbp,%rax,8)
  cmovbe %rax,%rdx
  cmova  %rax,%rcx
L212:
  mov    %rcx,%rax
  sub    %rdx,%rax
  cmp    $0x1,%rax
  ja     L178
  mov    %rdx,(%r8,%r9,8)
  mov    (%rbx),%rax
  add    $0x1,%r9
  sub    $0x1,%rax
  cmp    %r9,%rax
  jae    L205
  add    $0x1,%rdi
  cmp    %rdi,%r12
  jbe    L229
L159:
  mov    0x28(%rsp),%rdx
  lea    (%rdx,%rdi,8),%rax
  add    %rdx,%r13
L124:
  mov    (%rbx),%rdx
  add    $0x8,%rax
  mov    %rdx,-0x8(%rax)
  cmp    %r13,%rax
  jne    L124
L229:
  cmpq   $0x0,(%rsp)
  je     L211
L13:
  mov    0x28(%rsp),%rax
  mov    (%rsp),%rdx
  add    $0x8,%rax
  mov    %rax,0x40(%rsp)
  lea    (%rax,%rdx,8),%rax
  mov    %rax,0x48(%rsp)
L179:
  mov    0x40(%rsp),%rax
  mov    $0x1,%ecx
  mov    0x8(%rax),%rdx
  mov    (%rax),%rax
  mov    %rdx,%rbx
  mov    %rax,0x30(%rsp)
  sub    %rax,%rbx
  mov    %rbx,%rax
  cs nopw 0x0(%rax,%rax,1)
L209:
  lea    0x1(%rcx,%rcx,2),%rcx
  cmp    %rcx,%rax
  jae    L209
  lea    -0x1(%rdx),%rax
  mov    %rcx,0x18(%rsp)
  mov    $0x1,%r14d
  sub    0x30(%rsp),%r14
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax,%rax,1)
L188:
  movabs $0xaaaaaaaaaaaaaaab,%rax
  mov    0x18(%rsp),%rbx
  mul    %rbx
  mov    0x30(%rsp),%rax
  mov    %rbx,0x20(%rsp)
  shr    %rdx
  add    %rdx,%rax
  mov    %rdx,0x18(%rsp)
  mov    %rax,(%rsp)
  cmp    0x10(%rsp),%rax
  ja     L116
  mov    0x28(%rsp),%rbx
  mov    (%rsp),%rax
  lea    (%rbx,%rax,8),%r15
  mov    0x38(%rsp),%rbx
  lea    (%rbx,%rax,4),%rax
  mov    %rdx,%rbx
  mov    %rax,0x8(%rsp)
  neg    %rbx
  lea    0x0(,%rbx,8),%rbp
  shl    $0x2,%rbx
  nopl   0x0(%rax,%rax,1)
L164:
  mov    0x8(%rsp),%r8
  mov    (%r15),%r12
  lea    (%r15,%rbp,1),%rax
  mov    %r15,%rdi
  mov    (%rsp),%rsi
  movss  (%r8),%xmm1
  lea    (%r8,%rbx,1),%rcx
  jmp    L111
  xchg   %ax,%ax
L86:
  movss  (%rcx),%xmm0
  mov    %r9,(%rdi)
  add    %rbp,%rax
  mov    %rcx,%r9
  lea    (%r11,%rbp,1),%rdi
  add    %rbx,%rcx
  movss  %xmm0,(%r8)
  lea    (%r10,%rbx,1),%r8
  lea    (%r14,%rsi,1),%r10
  cmp    %r10,%rdx
  jae    L203
L111:
  mov    (%rax),%r9
  sub    %rdx,%rsi
  mov    %rax,%r13
  mov    %rdi,%r11
  mov    %r8,%r10
  cmp    %r12,%r9
  ja     L86
L128:
  addq   $0x1,(%rsp)
  add    $0x8,%r15
  mov    (%rsp),%rax
  mov    %r12,(%r11)
  addq   $0x4,0x8(%rsp)
  movss  %xmm1,(%r10)
  cmp    0x10(%rsp),%rax
  jbe    L164
L116:
  cmpq   $0x5,0x20(%rsp)
  ja     L188
  addq   $0x8,0x40(%rsp)
  mov    0x40(%rsp),%rax
  cmp    %rax,0x48(%rsp)
  jne    L179
L211:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L203:
  mov    %r9,%r10
  mov    %r13,%r11
  jmp    L128
L131:
  mov    0x28(%rsp),%rax
  lea    0x8(%rsi),%rbx
  xor    %edi,%edi
  lea    -0x1(%r12),%r15
  mov    %rbx,%rsi
  mov    $0x10,%r13d
  lea    0x8(%rax),%rdx
  call   <iindexx@plt>
  mov    0x8(%rbp),%r9
  mov    $0x1,%edi
  test   %r9,%r9
  je     L150
  jmp    L159
L137:
  mov    $0x1,%edi
  cmp    $0x1,%r12
  ja     L159
  jmp    L13
```

assistant: ```c
void sprstp(float sa[], unsigned long ija[], float sb[], unsigned long ijb[]) {
  void iindexx(unsigned long n, long arr[], unsigned long indx[]);
  unsigned long j, jl, jm, jp, ju, k, m, n2, noff, inc, iv;
  float v;
  n2 = ija[1];
  for (j = 1; j <= n2 - 2; j++)
    sb[j] = sa[j];
  iindexx(ija[n2 - 1] - ija[1], (long *)&ija[n2 - 1], &ijb[n2 - 1]);
  jp = 0;
  for (k = ija[1]; k <= ija[n2 - 1] - 1; k++) {
    m = ijb[k] + n2 - 1;
    sb[k] = sa[m];
    for (j = jp + 1; j <= ija[m]; j++)
      ijb[j] = k;
    jp = ija[m];
    jl = 1;
    ju = n2 - 1;
    while (ju - jl > 1) {
      jm = (ju + jl) / 2;
      if (ija[jm] > m)
        ju = jm;
      else
        jl = jm;
    }
    ijb[k] = jl;
  }
  for (j = jp + 1; j < n2; j++)
    ijb[j] = ija[n2 - 1];
  for (j = 1; j <= n2 - 2; j++) {
    jl = ijb[j + 1] - ijb[j];
    noff = ijb[j] - 1;
    inc = 1;
    do {
      inc *= 3;
      inc++;
    } while (inc <= jl);
    do {
      inc /= 3;
      for (k = noff + inc + 1; k <= noff + jl; k++) {
        iv = ijb[k];
        v = sb[k];
        m = k;
        while (ijb[m - inc] > iv) {
          ijb[m] = ijb[m - inc];
          sb[m] = sb[m - inc];
          m -= inc;
          if (m - noff <= inc)
            break;
        }
        ijb[m] = iv;
        sb[m] = v;
      }
    } while (inc > 1);
  }
}
```