user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<selip>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r14
  mov    %rdx,%r13
  test   %rdi,%rdi
  sete   %al
  cmp    %rsi,%rdi
  seta   %dl
  or     %dl,%al
  jne    L242
  test   %rsi,%rsi
  jne    L35
L242:
  lea    D18(%rip),%rdi
  call   <nrerror@plt>
L35:
  mov    $0x42,%esi
  mov    $0x1,%edi
  call   <nr_lvector@plt>
  mov    %rax,%r12
  mov    $0x42,%esi
  mov    $0x1,%edi
  call   <nr_vector@plt>
  mov    %rax,%rbx
  lea    0x4(%r13,%r14,4),%r15
  movss  D0(%rip),%xmm7
  movss  %xmm7,0x8(%rsp)
  movss  D5(%rip),%xmm5
  movss  %xmm5,0xc(%rsp)
  jmp    L105
L239:
  cmp    %rdi,%rcx
  je     L58
L241:
  addss  0x0(%r13,%rax,4),%xmm1
L59:
  lea    0x1(%rax),%rdx
  cmp    %rax,%r14
  je     L203
  mov    %rdx,%rax
L259:
  movss  0x0(%r13,%rax,4),%xmm0
  movss  0x8(%rsp),%xmm3
  comiss %xmm3,%xmm0
  jb     L59
  comiss %xmm0,%xmm2
  jb     L59
  add    $0x1,%rcx
  ucomiss %xmm3,%xmm0
  jp     L76
  jne    L76
  add    $0x1,%rsi
L76:
  cmp    $0x40,%rcx
  ja     L239
  movss  %xmm0,(%rbx,%rcx,4)
  jmp    L241
L58:
  mov    %rdi,%r8
  shr    $0x6,%r8
  lea    (%rax,%rdi,1),%rdx
  add    %rbp,%rdx
  and    $0x3f,%edx
  movss  %xmm0,0x4(%rbx,%rdx,4)
  lea    (%r8,%rdi,1),%rdi
  jmp    L241
L203:
  cmp    %rsi,%rbp
  jbe    L298
  cmp    $0x40,%rcx
  jbe    L243
  test   %rcx,%rcx
  js     L86
  pxor   %xmm0,%xmm0
  cvtsi2ss %rcx,%xmm0
L1:
  divss  %xmm0,%xmm1
  movss  %xmm1,0x104(%rbx)
  mov    %rbx,%rsi
  mov    $0x41,%edi
  call   <shell@plt>
  movss  0xc(%rsp),%xmm5
  movss  %xmm5,0x108(%rbx)
  lea    0x8(%r12),%rax
  lea    0x218(%r12),%rdx
L72:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L72
  lea    0x4(%r13),%rsi
  mov    $0x0,%edi
  movss  0xc(%rsp),%xmm1
  jmp    L295
L243:
  mov    %rcx,%r14
L119:
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <shell@plt>
  movss  (%rbx,%rbp,4),%xmm6
  movss  %xmm6,0x8(%rsp)
  mov    $0x42,%edx
  mov    $0x1,%esi
  mov    %rbx,%rdi
  call   <nr_free_vector@plt>
  mov    $0x42,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <nr_free_lvector@plt>
  jmp    L2
L86:
  mov    %rcx,%rax
  shr    %rax
  and    $0x1,%ecx
  or     %rcx,%rax
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  addss  %xmm0,%xmm0
  jmp    L1
L73:
  lea    (%rdx,%rcx,1),%rax
  shr    %rax
  comiss (%rbx,%rax,4),%xmm0
  cmovb  %rax,%rdx
  cmovae %rax,%rcx
L252:
  mov    %rdx,%rax
  sub    %rcx,%rax
  cmp    $0x1,%rax
  ja     L73
  addq   $0x1,(%r12,%rdx,8)
L268:
  add    $0x4,%rsi
  cmp    %r15,%rsi
  je     L173
L295:
  movss  (%rsi),%xmm0
  comiss 0x8(%rsp),%xmm0
  jb     L268
  comiss %xmm0,%xmm1
  jb     L268
  mov    $0x42,%edx
  mov    %rdi,%rcx
  jmp    L252
L173:
  mov    0x8(%r12),%rdx
  cmp    %rdx,%rbp
  jbe    L177
  mov    $0x1,%eax
L277:
  mov    %rax,%rcx
  add    $0x1,%rax
  sub    %rdx,%rbp
  mov    (%r12,%rax,8),%rdx
  cmp    %rbp,%rdx
  jb     L277
  movss  (%rbx,%rcx,4),%xmm7
  movss  %xmm7,0x8(%rsp)
L266:
  movss  (%rbx,%rax,4),%xmm6
  movss  %xmm6,0xc(%rsp)
L105:
  test   %r14,%r14
  je     L149
  pxor   %xmm1,%xmm1
  mov    $0x41,%edi
  mov    $0x0,%esi
  mov    $0x0,%ecx
  mov    $0x1,%eax
  movss  0xc(%rsp),%xmm2
  jmp    L259
L177:
  mov    $0x1,%eax
  jmp    L266
L149:
  test   %rbp,%rbp
  jne    L119
L298:
  mov    $0x42,%edx
  mov    $0x1,%esi
  mov    %rbx,%rdi
  call   <nr_free_vector@plt>
  mov    $0x42,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <nr_free_lvector@plt>
L2:
  movss  0x8(%rsp),%xmm0
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D18
datatype: string
name: disassemble_data
arguments: data_tag: D0
datatype: byte[4]
name: disassemble_data
arguments: data_tag: D5
datatype: f32

tool: D18: bad input to selip

tool: {"D0": [0xca,0xf2,0x49,0xf1]}

tool: D5: 1e+30

assistant: ```c
float selip(unsigned long k, unsigned long n, float arr[]) {
  void shell(unsigned long n, float a[]);
  unsigned long i, j, jl, jm, ju, kk, mm, nlo, nxtmm, *isel;
  float ahi, alo, sum, *sel;
  if (k < 1 || k > n || n <= 0)
    nrerror("bad input to selip");
  isel = nr_lvector(1, 64 + 2);
  sel = nr_vector(1, 64 + 2);
  kk = k;
  ahi = 1.0e30;
  alo = -1.0e30;
  for (;;) {
    mm = nlo = 0;
    sum = 0.0;
    nxtmm = 64 + 1;
    for (i = 1; i <= n; i++) {
      if (arr[i] >= alo && arr[i] <= ahi) {
        mm++;
        if (arr[i] == alo)
          nlo++;
        if (mm <= 64)
          sel[mm] = arr[i];
        else if (mm == nxtmm) {
          nxtmm = mm + mm / 64;
          sel[1 + ((i + mm + kk) % 64)] = arr[i];
        }
        sum += arr[i];
      }
    }
    if (kk <= nlo) {
      nr_free_vector(sel, 1, 64 + 2);
      nr_free_lvector(isel, 1, 64 + 2);
      return alo;
    } else if (mm <= 64) {
      shell(mm, sel);
      ahi = sel[kk];
      nr_free_vector(sel, 1, 64 + 2);
      nr_free_lvector(isel, 1, 64 + 2);
      return ahi;
    }
    sel[64 + 1] = sum / mm;
    shell(64 + 1, sel);
    sel[64 + 2] = ahi;
    for (j = 1; j <= 64 + 2; j++)
      isel[j] = 0;
    for (i = 1; i <= n; i++) {
      if (arr[i] >= alo && arr[i] <= ahi) {
        jl = 0;
        ju = 64 + 2;
        while (ju - jl > 1) {
          jm = (ju + jl) / 2;
          if (arr[i] >= sel[jm])
            jl = jm;
          else
            ju = jm;
        }
        isel[ju]++;
      }
    }
    j = 1;
    while (kk > isel[j]) {
      alo = sel[j];
      kk -= isel[j++];
    }
    ahi = sel[j];
  }
}
```