user: 请将以下的汇编代码转换成C语言代码:

```asm
<fquickSortIdx>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x9b0,%rsp
  mov    %rdi,-0x998(%rbp)
  mov    %rsi,-0x9a0(%rbp)
  mov    %edx,-0x9a4(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x988(%rbp)
  movl   $0x0,-0x970(%rbp)
  mov    -0x9a4(%rbp),%eax
  mov    %eax,-0x4c0(%rbp)
  jmp    L90
L7:
  cmpl   $0x12a,-0x988(%rbp)
  jle    L79
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <error@plt>
L79:
  mov    -0x988(%rbp),%eax
  cltq
  mov    -0x970(%rbp,%rax,4),%eax
  mov    %eax,-0x984(%rbp)
  mov    -0x988(%rbp),%eax
  cltq
  mov    -0x4c0(%rbp,%rax,4),%eax
  sub    $0x1,%eax
  mov    %eax,-0x980(%rbp)
  mov    -0x984(%rbp),%eax
  cmp    -0x980(%rbp),%eax
  jge    L22
  mov    -0x984(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x998(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  %xmm0,-0x97c(%rbp)
  mov    -0x984(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x9a0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x978(%rbp)
  jmp    L32
L63:
  subl   $0x1,-0x980(%rbp)
L126:
  mov    -0x980(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x998(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  comiss -0x97c(%rbp),%xmm0
  jb     L147
  mov    -0x984(%rbp),%eax
  cmp    -0x980(%rbp),%eax
  jl     L63
L147:
  mov    -0x984(%rbp),%eax
  cmp    -0x980(%rbp),%eax
  jge    L76
  mov    -0x980(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x9a0(%rbp),%rax
  add    %rdx,%rax
  mov    -0x984(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x9a0(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x980(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x998(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x984(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x984(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x998(%rbp),%rax
  add    %rdx,%rax
  movss  (%rcx),%xmm0
  movss  %xmm0,(%rax)
  jmp    L76
L43:
  addl   $0x1,-0x984(%rbp)
L76:
  mov    -0x984(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x998(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  movss  -0x97c(%rbp),%xmm0
  comiss %xmm1,%xmm0
  jb     L82
  mov    -0x984(%rbp),%eax
  cmp    -0x980(%rbp),%eax
  jl     L43
L82:
  mov    -0x984(%rbp),%eax
  cmp    -0x980(%rbp),%eax
  jge    L32
  mov    -0x984(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x9a0(%rbp),%rax
  add    %rdx,%rax
  mov    -0x980(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x9a0(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x984(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x998(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x980(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x980(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x998(%rbp),%rax
  add    %rdx,%rax
  movss  (%rcx),%xmm0
  movss  %xmm0,(%rax)
L32:
  mov    -0x984(%rbp),%eax
  cmp    -0x980(%rbp),%eax
  jl     L126
  mov    -0x984(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x998(%rbp),%rax
  add    %rdx,%rax
  movss  -0x97c(%rbp),%xmm0
  movss  %xmm0,(%rax)
  mov    -0x984(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x9a0(%rbp),%rax
  add    %rax,%rdx
  mov    -0x978(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x988(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x984(%rbp),%eax
  lea    0x1(%rax),%edx
  movslq %ecx,%rax
  mov    %edx,-0x970(%rbp,%rax,4)
  mov    -0x988(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x988(%rbp),%eax
  cltq
  mov    -0x4c0(%rbp,%rax,4),%edx
  movslq %ecx,%rax
  mov    %edx,-0x4c0(%rbp,%rax,4)
  mov    -0x988(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x988(%rbp)
  cltq
  mov    -0x984(%rbp),%edx
  mov    %edx,-0x4c0(%rbp,%rax,4)
  mov    -0x988(%rbp),%eax
  cltq
  mov    -0x4c0(%rbp,%rax,4),%edx
  mov    -0x988(%rbp),%eax
  cltq
  mov    -0x970(%rbp,%rax,4),%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x988(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x4c0(%rbp,%rax,4),%edx
  mov    -0x988(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x970(%rbp,%rax,4),%esi
  mov    %edx,%eax
  sub    %esi,%eax
  cmp    %eax,%ecx
  jle    L90
  mov    -0x988(%rbp),%eax
  cltq
  mov    -0x970(%rbp,%rax,4),%eax
  mov    %eax,-0x974(%rbp)
  mov    -0x988(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x970(%rbp,%rax,4),%edx
  mov    -0x988(%rbp),%eax
  cltq
  mov    %edx,-0x970(%rbp,%rax,4)
  mov    -0x988(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x974(%rbp),%edx
  mov    %edx,-0x970(%rbp,%rax,4)
  mov    -0x988(%rbp),%eax
  cltq
  mov    -0x4c0(%rbp,%rax,4),%eax
  mov    %eax,-0x974(%rbp)
  mov    -0x988(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x4c0(%rbp,%rax,4),%edx
  mov    -0x988(%rbp),%eax
  cltq
  mov    %edx,-0x4c0(%rbp,%rax,4)
  mov    -0x988(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x974(%rbp),%edx
  mov    %edx,-0x4c0(%rbp,%rax,4)
  jmp    L90
L22:
  subl   $0x1,-0x988(%rbp)
L90:
  cmpl   $0x0,-0x988(%rbp)
  jns    L7
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L45
  call   <__stack_chk_fail@plt>
L45:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D2
type: string

tool: D2: sort overflow

assistant: ```c
void fquickSortIdx(float *arr, int *idx, int elements) {
  int beg[(300)], end[(300)], i = 0, L, R, swap;
  float piv;
  int ipiv;
  beg[0] = 0;
  end[0] = elements;
  while (i >= 0) {
    if (i > (300) - 2)
      error("sort overflow");
    L = beg[i];
    R = end[i] - 1;
    if (L < R) {
      piv = arr[L];
      ipiv = idx[L];
      while (L < R) {
        while (arr[R] >= piv && L < R)
          R--;
        if (L < R) {
          idx[L] = idx[R];
          arr[L++] = arr[R];
        }
        while (arr[L] <= piv && L < R)
          L++;
        if (L < R) {
          idx[R] = idx[L];
          arr[R--] = arr[L];
        }
      }
      arr[L] = piv;
      idx[L] = ipiv;
      beg[i + 1] = L + 1;
      end[i + 1] = end[i];
      end[i++] = L;
      if (end[i] - beg[i] > end[i - 1] - beg[i - 1]) {
        swap = beg[i];
        beg[i] = beg[i - 1];
        beg[i - 1] = swap;
        swap = end[i];
        end[i] = end[i - 1];
        end[i - 1] = swap;
      }
    } else {
      i--;
    }
  }
}
```