user: 请从给定的汇编指令推导出C源代码:

```asm
<indexx>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r14d
  mov    %rsi,%rbx
  mov    %rdx,%r12
  mov    $0x32,%esi
  mov    $0x1,%edi
  call   <ivector@plt>
  mov    %rax,(%rsp)
  test   %r14d,%r14d
  jle    L137
  lea    0x1(%r14),%edx
  mov    $0x1,%eax
L170:
  mov    %eax,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L170
L137:
  mov    $0x0,%r15d
  movl   $0x1,0x8(%rsp)
  jmp    L217
L182:
  movslq %edx,%rdx
  mov    %r9d,0x4(%r12,%rdx,4)
  add    $0x4,%r8
  add    $0x1,%edi
  cmp    %r14d,%edi
  je     L58
L61:
  mov    (%r8),%r9d
  movslq %r9d,%rax
  movss  (%rbx,%rax,4),%xmm0
  mov    %edi,%edx
  test   %edi,%edi
  jle    L182
  movslq %edi,%rax
  lea    (%r12,%rax,4),%rax
L168:
  mov    (%rax),%ecx
  movslq %ecx,%rsi
  comiss (%rbx,%rsi,4),%xmm0
  jae    L182
  mov    %ecx,0x4(%rax)
  sub    $0x4,%rax
  sub    $0x1,%edx
  jne    L168
  jmp    L182
L58:
  test   %r15d,%r15d
  je     L17
  movslq %r15d,%rax
  mov    (%rsp),%rdi
  mov    (%rdi,%rax,4),%r14d
  sub    $0x2,%r15d
  mov    -0x4(%rdi,%rax,4),%eax
  mov    %eax,0x8(%rsp)
L217:
  mov    %r14d,%eax
  mov    0x8(%rsp),%edi
  sub    %edi,%eax
  cmp    $0x6,%eax
  jg     L244
  lea    0x1(%rdi),%eax
  cmp    %eax,%r14d
  jl     L58
  cltq
  lea    (%r12,%rax,4),%r8
  jmp    L61
L244:
  mov    0x8(%rsp),%edi
  lea    (%r14,%rdi,1),%eax
  sar    %eax
  cltq
  lea    (%r12,%rax,4),%rdx
  mov    (%rdx),%ecx
  movslq %edi,%rax
  lea    0x4(,%rax,4),%rsi
  lea    (%r12,%rsi,1),%rax
  mov    (%rax),%edi
  mov    %edi,(%rdx)
  mov    %ecx,(%rax)
  movslq %r14d,%rdx
  lea    (%r12,%rdx,4),%rdx
  mov    (%rdx),%edi
  movslq %ecx,%r9
  movslq %edi,%r8
  movss  (%rbx,%r9,4),%xmm0
  comiss (%rbx,%r8,4),%xmm0
  jbe    L237
  mov    %edi,(%rax)
  mov    %ecx,(%rdx)
L237:
  lea    -0x4(%r12,%rsi,1),%r9
  mov    (%r9),%ecx
  mov    (%rdx),%esi
  movslq %ecx,%r8
  movslq %esi,%rdi
  movss  (%rbx,%r8,4),%xmm0
  comiss (%rbx,%rdi,4),%xmm0
  jbe    L94
  mov    %esi,(%r9)
  mov    %ecx,(%rdx)
L94:
  mov    (%rax),%edx
  mov    (%r9),%ecx
  movslq %edx,%rdi
  movslq %ecx,%rsi
  movss  (%rbx,%rdi,4),%xmm0
  comiss (%rbx,%rsi,4),%xmm0
  jbe    L71
  mov    %ecx,(%rax)
  mov    %edx,(%r9)
L71:
  mov    (%r9),%r10d
  movslq %r10d,%rax
  movss  (%rbx,%rax,4),%xmm1
  mov    0x8(%rsp),%eax
  lea    0x2(%rax),%edi
  movslq %edi,%rdi
  mov    %r14d,%ebp
  jmp    L163
L91:
  add    $0x1,%rdi
L163:
  mov    %edi,%r8d
  mov    (%r12,%rdi,4),%ecx
  movslq %ecx,%rax
  comiss (%rbx,%rax,4),%xmm1
  ja     L91
  movslq %ebp,%rax
  lea    -0x4(%r12,%rax,4),%rax
L219:
  mov    %ebp,%r13d
  sub    $0x1,%ebp
  mov    %rax,%rsi
  mov    (%rax),%edx
  sub    $0x4,%rax
  movslq %edx,%r11
  movss  (%rbx,%r11,4),%xmm0
  comiss %xmm1,%xmm0
  ja     L219
  cmp    %edi,%ebp
  jl     L140
  mov    %edx,(%r12,%rdi,4)
  mov    %ecx,(%rsi)
  jmp    L91
L140:
  mov    %r8d,0xc(%rsp)
  mov    %edx,(%r9)
  mov    %r10d,(%rsi)
  add    $0x2,%r15d
  cmp    $0x32,%r15d
  jg     L8
L121:
  mov    %r14d,%eax
  mov    0xc(%rsp),%edi
  sub    %edi,%eax
  add    $0x1,%eax
  sub    0x8(%rsp),%ebp
  cmp    %ebp,%eax
  jl     L160
  movslq %r15d,%rax
  mov    (%rsp),%rdx
  mov    %r14d,(%rdx,%rax,4)
  mov    %edi,-0x4(%rdx,%rax,4)
  lea    -0x2(%r13),%r14d
  jmp    L217
L8:
  lea    D6(%rip),%rdi
  call   <nrerror@plt>
  jmp    L121
L160:
  movslq %r15d,%rax
  sub    $0x2,%r13d
  mov    (%rsp),%rdi
  mov    %r13d,(%rdi,%rax,4)
  mov    0x8(%rsp),%edx
  mov    %edx,-0x4(%rdi,%rax,4)
  mov    0xc(%rsp),%eax
  mov    %eax,0x8(%rsp)
  jmp    L217
L17:
  mov    $0x32,%edx
  mov    $0x1,%esi
  mov    (%rsp),%rdi
  call   <free_ivector@plt>
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D6
type: string

tool: D6: NSTACK too small in indexx.

assistant: ```c
void indexx(int n, float arr[], int indx[]) {
  int i, indxt, ir = n, itemp, j, k, l = 1;
  int jstack = 0, *istack;
  float a;
  istack = ivector(1, 50);
  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 (jstack > 50)
        nrerror("NSTACK too small in indexx.");
      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, 50);
}
```