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

```asm
<median_select>:
  endbr64
  lea    -0x1(%rsi),%r10d
  push   %rbx
  mov    %edi,%r9d
  mov    %rdx,%rcx
  cmp    $0x1,%r10d
  jbe    L124
  xor    %r11d,%r11d
  mov    $0x1,%edi
  nopl   0x0(%rax)
L121:
  lea    (%r11,%r10,1),%eax
  shr    %eax
  lea    (%rcx,%rax,4),%rdx
  mov    %edi,%eax
  lea    (%rcx,%rax,4),%rax
  movss  (%rdx),%xmm1
  movss  (%rax),%xmm0
  movss  %xmm0,(%rdx)
  mov    %r10d,%edx
  lea    (%rcx,%rdx,4),%rdx
  movss  %xmm1,(%rax)
  movss  (%rdx),%xmm0
  comiss %xmm0,%xmm1
  jbe    L74
  movss  %xmm0,(%rax)
  movaps %xmm1,%xmm0
  movss  %xmm1,(%rdx)
L74:
  mov    %r11d,%esi
  lea    (%rcx,%rsi,4),%rbx
  movss  (%rbx),%xmm1
  comiss %xmm0,%xmm1
  jbe    L133
  movss  %xmm0,(%rbx)
  movss  %xmm1,(%rdx)
  movss  (%rbx),%xmm1
L133:
  movss  (%rax),%xmm0
  comiss %xmm1,%xmm0
  jbe    L34
  movss  %xmm1,(%rax)
  movaps %xmm0,%xmm1
  movss  %xmm0,(%rbx)
L34:
  mov    %r10d,%eax
  cs nopw 0x0(%rax,%rax,1)
L102:
  lea    0x1(%rdi),%edx
  lea    (%rcx,%rdx,4),%r8
  mov    %rdx,%rdi
  movss  (%r8),%xmm2
  comiss %xmm2,%xmm1
  ja     L102
  nopl   0x0(%rax)
L2:
  lea    -0x1(%rax),%edx
  mov    %eax,%esi
  mov    %rdx,%rax
  lea    (%rcx,%rdx,4),%rdx
  movss  (%rdx),%xmm0
  comiss %xmm1,%xmm0
  ja     L2
  cmp    %eax,%edi
  ja     L104
  movss  %xmm0,(%r8)
  movss  %xmm2,(%rdx)
  jmp    L102
  nopl   0x0(%rax)
L104:
  movss  %xmm0,(%rbx)
  movss  %xmm1,(%rdx)
  cmp    %r9d,%eax
  jb     L96
  cmovne %rbx,%r8
  cmove  %edi,%r11d
  lea    -0x2(%rsi),%r10d
L37:
  lea    0x1(%r11),%edi
  cmp    %r10d,%edi
  jb     L121
L15:
  cmp    %r10d,%edi
  je     L120
L108:
  mov    %r9d,%r9d
  pop    %rbx
  movss  (%rcx,%r9,4),%xmm0
  ret
L96:
  mov    %edi,%r11d
  jmp    L37
L120:
  lea    (%rcx,%rdi,4),%rax
  movss  (%r8),%xmm0
  movss  (%rax),%xmm1
  comiss %xmm1,%xmm0
  jbe    L108
  mov    %r9d,%r9d
  movss  %xmm1,(%r8)
  movss  %xmm0,(%rax)
  movss  (%rcx,%r9,4),%xmm0
  pop    %rbx
  ret
L124:
  mov    %rdx,%r8
  mov    $0x1,%edi
  jmp    L15
```

assistant: ```c
float median_select(k, n, arr)
float arr[];
unsigned int k, n;
{
  unsigned int i, ir, j, l, mid;
  float a, temp;
  l = 0;
  ir = n - 1;
  for (;;) {
    if (ir <= l + 1) {
      if (ir == l + 1 && arr[ir] < arr[l]) {
        temp = (arr[l]);
        (arr[l]) = (arr[ir]);
        (arr[ir]) = temp;
      }
      return arr[k];
    } else {
      mid = (l + ir) >> 1;
      temp = (arr[mid]);
      (arr[mid]) = (arr[l + 1]);
      (arr[l + 1]) = temp;
      if (arr[l + 1] > arr[ir]) {
        temp = (arr[l + 1]);
        (arr[l + 1]) = (arr[ir]);
        (arr[ir]) = temp;
      }
      if (arr[l] > arr[ir]) {
        temp = (arr[l]);
        (arr[l]) = (arr[ir]);
        (arr[ir]) = temp;
      }
      if (arr[l + 1] > arr[l]) {
        temp = (arr[l + 1]);
        (arr[l + 1]) = (arr[l]);
        (arr[l]) = temp;
      }
      i = l + 1;
      j = ir;
      a = arr[l];
      for (;;) {
        do
          i++;
        while (arr[i] < a);
        do
          j--;
        while (arr[j] > a);
        if (j < i)
          break;
        temp = (arr[i]);
        (arr[i]) = (arr[j]);
        (arr[j]) = temp;
      }
      arr[l] = arr[j];
      arr[j] = a;
      if (j >= k)
        ir = j - 1;
      if (j <= k)
        l = i;
    }
  }
}
```