user: Translate the below assembly code into C programming language:

```asm
<quicksort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  lea    -0x1(%rdi),%r14d
  mov    $0xffffffff,%r15d
  mov    $0x0,%ebx
  jmp    L14
L18:
  movslq %r14d,%rax
  mov    %rax,(%rsp)
  lea    0x0(%rbp,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  movsd  (%rax),%xmm1
  lea    -0x1(%r14),%edx
  mov    %ebx,%r10d
  jmp    L31
L98:
  add    $0x1,%r10d
L31:
  movslq %r10d,%r11
  lea    0x0(%rbp,%r11,8),%r13
  movsd  0x0(%r13),%xmm2
  comisd %xmm2,%xmm1
  ja     L98
  movslq %edx,%r8
  lea    0x0(%rbp,%r8,8),%r9
  movsd  (%r9),%xmm0
  cmp    %ebx,%edx
  jle    L118
  comisd %xmm1,%xmm0
  jb     L118
  lea    -0x1(%rdx),%eax
  cltq
  lea    -0x8(%rbp,%r8,8),%rcx
L41:
  mov    %eax,%edx
  mov    %rcx,%r9
  movsd  (%rcx),%xmm0
  cmp    %eax,%ebx
  setl   %dil
  comisd %xmm1,%xmm0
  setae  %sil
  mov    %rax,%r8
  sub    $0x1,%rax
  sub    $0x8,%rcx
  test   %sil,%dil
  jne    L41
L118:
  cmp    %edx,%r10d
  jge    L10
  movsd  %xmm0,0x0(%r13)
  movsd  %xmm2,(%r9)
  lea    (%r12,%r11,4),%rcx
  mov    (%rcx),%esi
  lea    (%r12,%r8,4),%rax
  mov    (%rax),%edi
  mov    %edi,(%rcx)
  mov    %esi,(%rax)
  jmp    L31
L10:
  mov    0x8(%rsp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,0x0(%r13)
  movsd  %xmm2,(%rax)
  lea    (%r12,%r11,4),%rdx
  mov    (%rdx),%ecx
  mov    (%rsp),%rax
  lea    (%r12,%rax,4),%rax
  mov    (%rax),%esi
  mov    %esi,(%rdx)
  mov    %ecx,(%rax)
  mov    %r10d,%edx
  sub    %ebx,%edx
  mov    %r14d,%eax
  sub    %r10d,%eax
  cmp    %eax,%edx
  jle    L133
  lea    0x1(%r15),%eax
  cltq
  mov    %ebx,0x10(%rsp,%rax,4)
  add    $0x2,%r15d
  movslq %r15d,%rax
  lea    -0x1(%r10),%edx
  mov    %edx,0x10(%rsp,%rax,4)
  lea    0x1(%r10),%ebx
L71:
  cmp    $0x1f,%r15d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  jmp    L14
L133:
  lea    0x1(%r15),%eax
  cltq
  lea    0x1(%r10),%edx
  mov    %edx,0x10(%rsp,%rax,4)
  add    $0x2,%r15d
  movslq %r15d,%rax
  mov    %r14d,0x10(%rsp,%rax,4)
  lea    -0x1(%r10),%r14d
  jmp    L71
L135:
  lea    -0x1(%r15),%eax
  movslq %r15d,%rdx
  mov    0x10(%rsp,%rdx,4),%r14d
  sub    $0x2,%r15d
  cltq
  mov    0x10(%rsp,%rax,4),%ebx
L14:
  cmp    %r14d,%ebx
  jl     L18
  cmp    $0xffffffff,%r15d
  jne    L135
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L130
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L130:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void quicksort(int n, double arr[], int idx[]) {
  double v, td;
  int i, j, l, r, ti, tos, stack[32];
  l = 0;
  r = n - 1;
  tos = -1;
  for (;;) {
    while (r > l) {
      v = arr[r];
      i = l;
      j = r - 1;
      for (;;) {
        while (arr[i] < v)
          i++;
        while (arr[j] >= v && j > l)
          j--;
        if (i >= j)
          break;
        td = arr[i];
        arr[i] = arr[j];
        arr[j] = td;
        ti = idx[i];
        idx[i] = idx[j];
        idx[j] = ti;
      }
      td = arr[i];
      arr[i] = arr[r];
      arr[r] = td;
      ti = idx[i];
      idx[i] = idx[r];
      idx[r] = ti;
      if (i - l > r - i) {
        stack[++tos] = l;
        stack[++tos] = i - 1;
        l = i + 1;
      } else {
        stack[++tos] = i + 1;
        stack[++tos] = r;
        r = i - 1;
      }
      assert(tos < 32);
    }
    if (tos == -1)
      break;
    r = stack[tos--];
    l = stack[tos--];
  }
}
```