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

```asm
<indexx>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  movslq %edi,%r14
  mov    $0x1,%edi
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  mov    $0x186a0,%esi
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x28,%rsp
  call   <ivector@plt>
  cltq
  mov    %rax,0x8(%rsp)
  mov    $0x1,%eax
  test   %r14,%r14
  je     L4
L209:
  mov    %rax,%rdx
  mov    %eax,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %r14,%rdx
  jne    L209
L4:
  movl   $0x0,0x10(%rsp)
  mov    $0x1,%r15d
  mov    $0x2,%r12d
L174:
  mov    %r14,%rax
  mov    %r12,%r8
  sub    %r15,%rax
  cmp    $0x6,%rax
  ja     L223
L152:
  cmp    %r12,%r14
  jb     L21
  nopl   0x0(%rax,%rax,1)
L7:
  movslq (%rbx,%r8,4),%rax
  movss  0x0(%rbp,%rax,4),%xmm0
  mov    %rax,%rsi
  lea    0x0(,%r8,4),%rax
  test   %r15,%r15
  jne    L131
  jmp    L118
  nopl   0x0(%rax)
L58:
  mov    %ecx,(%rbx,%rax,1)
  sub    $0x4,%rax
  sub    $0x1,%r15
  je     L118
L131:
  movslq (%rbx,%r15,4),%rcx
  comiss 0x0(%rbp,%rcx,4),%xmm0
  jb     L58
  add    $0x1,%r8
  mov    %esi,(%rbx,%rax,1)
  mov    %r12,%r15
  cmp    %r8,%r14
  jb     L21
L219:
  add    $0x1,%r12
  jmp    L7
  nopl   (%rax)
L118:
  mov    $0x4,%eax
  add    $0x1,%r8
  mov    %r12,%r15
  mov    %esi,(%rbx,%rax,1)
  cmp    %r8,%r14
  jae    L219
L21:
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  je     L10
  movslq 0x10(%rsp),%rax
  mov    0x8(%rsp),%rsi
  movslq (%rsi,%rax,4),%r14
  movslq -0x4(%rsi,%rax,4),%r15
  mov    %rax,%rdi
  sub    $0x2,%edi
  mov    %r14,%rax
  lea    0x1(%r15),%r12
  mov    %edi,0x10(%rsp)
  sub    %r15,%rax
  mov    %r12,%r8
  cmp    $0x6,%rax
  jbe    L152
L223:
  lea    (%r14,%r15,1),%rax
  lea    0x0(,%r12,4),%rdi
  shr    %rax
  lea    (%rbx,%rax,4),%rcx
  lea    (%rbx,%rdi,1),%rax
  mov    (%rax),%esi
  mov    (%rcx),%edx
  mov    %esi,(%rcx)
  lea    (%rbx,%r14,4),%rsi
  movslq %edx,%rcx
  mov    %edx,(%rax)
  movslq (%rsi),%r9
  movss  0x0(%rbp,%rcx,4),%xmm1
  movss  0x0(%rbp,%r9,4),%xmm0
  mov    %r9,%rcx
  comiss %xmm0,%xmm1
  jbe    L189
  mov    %r9d,(%rax)
  movaps %xmm1,%xmm0
  mov    %edx,%ecx
  mov    %edx,(%rsi)
L189:
  lea    -0x4(%rbx,%rdi,1),%rdi
  movslq (%rdi),%rdx
  mov    %rdi,0x18(%rsp)
  movss  0x0(%rbp,%rdx,4),%xmm1
  mov    %edx,0x14(%rsp)
  comiss %xmm0,%xmm1
  jbe    L234
  mov    %ecx,(%rdi)
  mov    %edx,(%rsi)
  movslq (%rdi),%rdx
  mov    %edx,0x14(%rsp)
  movss  0x0(%rbp,%rdx,4),%xmm1
L234:
  movslq (%rax),%rcx
  movss  0x0(%rbp,%rcx,4),%xmm0
  comiss %xmm1,%xmm0
  jbe    L45
  mov    0x14(%rsp),%edi
  mov    %ecx,0x14(%rsp)
  movaps %xmm0,%xmm1
  mov    %edi,(%rax)
  mov    0x18(%rsp),%rax
  mov    %ecx,(%rax)
L45:
  mov    %r14,%rcx
  xchg   %ax,%ax
L32:
  lea    0x1(%r8),%r11
  movslq (%rbx,%r11,4),%rax
  comiss 0x0(%rbp,%rax,4),%xmm1
  mov    %rax,%rdi
  ja     L111
  lea    -0x1(%rcx),%rdx
  lea    (%rbx,%rdx,4),%rax
  jmp    L23
  nopl   0x0(%rax)
L77:
  sub    $0x1,%rdx
L23:
  movslq (%rax),%r13
  mov    %rax,%r9
  sub    $0x4,%rax
  mov    %rcx,%r10
  mov    %rdx,%rcx
  movss  0x0(%rbp,%r13,4),%xmm0
  comiss %xmm1,%xmm0
  ja     L77
  cmp    %rdx,%r11
  ja     L12
  mov    %r13d,(%rbx,%r11,4)
  mov    %edi,(%r9)
L111:
  mov    %r11,%r8
  jmp    L32
L12:
  mov    0x18(%rsp),%rax
  addl   $0x2,0x10(%rsp)
  mov    %rdx,%rsi
  mov    0x8(%rsp),%rdi
  sub    %r15,%rsi
  mov    %r13d,(%rax)
  mov    0x14(%rsp),%eax
  mov    %eax,(%r9)
  movslq 0x10(%rsp),%rax
  shl    $0x2,%rax
  lea    (%rdi,%rax,1),%rcx
  lea    -0x4(%rdi,%rax,1),%rax
  mov    %r14,%rdi
  sub    %r8,%rdi
  cmp    %rsi,%rdi
  jb     L27
  mov    %r14d,(%rcx)
  lea    -0x2(%r10),%r14
  mov    %r11d,(%rax)
  jmp    L174
L27:
  sub    $0x1,%edx
  lea    0x1(%r11),%r12
  mov    %edx,(%rcx)
  mov    %r15d,(%rax)
  mov    %r11,%r15
  jmp    L174
L10:
  mov    0x8(%rsp),%rdi
  add    $0x28,%rsp
  mov    $0x186a0,%edx
  mov    $0x1,%esi
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free_ivector@plt>
```

assistant: ```c
void indexx(n, arr, indx) float arr[];
int indx[], n;
{
  unsigned long i, indxt, ir = n, itemp, j, k, l = 1;
  int jstack = 0, *istack;
  float a;
  istack = ivector(1, 100000);
  for (j = 1; j <= n; j++)
    indx[j] = j;
  for (;;) {
    if (ir - l < 7) {
      for (j = l + 1; j <= ir; j++) {
        indxt = indx[j];
        a = arr[indxt];
        for (i = j - 1; i >= 1; i--) {
          if (arr[indx[i]] <= a)
            break;
          indx[i + 1] = indx[i];
        }
        indx[i + 1] = indxt;
      }
      if (jstack == 0)
        break;
      ir = istack[jstack--];
      l = istack[jstack--];
    } else {
      k = (l + ir) >> 1;
      itemp = (indx[k]);
      (indx[k]) = (indx[l + 1]);
      (indx[l + 1]) = itemp;
      ;
      if (arr[indx[l + 1]] > arr[indx[ir]]) {
        itemp = (indx[l + 1]);
        (indx[l + 1]) = (indx[ir]);
        (indx[ir]) = itemp;
      }
      if (arr[indx[l]] > arr[indx[ir]]) {
        itemp = (indx[l]);
        (indx[l]) = (indx[ir]);
        (indx[ir]) = itemp;
      }
      if (arr[indx[l + 1]] > arr[indx[l]]) {
        itemp = (indx[l + 1]);
        (indx[l + 1]) = (indx[l]);
        (indx[l]) = itemp;
      }
      i = l + 1;
      j = ir;
      indxt = indx[l];
      a = arr[indxt];
      for (;;) {
        do
          i++;
        while (arr[indx[i]] < a);
        do
          j--;
        while (arr[indx[j]] > a);
        if (j < i)
          break;
        itemp = (indx[i]);
        (indx[i]) = (indx[j]);
        (indx[j]) = itemp;
      }
      indx[l] = indx[j];
      indx[j] = indxt;
      jstack += 2;
      if (ir - i + 1 >= j - l) {
        istack[jstack] = ir;
        istack[jstack - 1] = i;
        ir = j - 1;
      } else {
        istack[jstack] = j - 1;
        istack[jstack - 1] = l;
        l = i;
      }
    }
  }
  free_ivector(istack, 1, 100000);
}
```