user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<quicksortDoublesAscending>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x2d0,%rsp
  xor    %edx,%edx
  xor    %r9d,%r9d
  mov    %fs:0x28,%rax
  mov    %rax,0x12c8(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  mov    %rsi,%r10
  lea    0x960(%rsp),%r11
  mov    %rsi,0x960(%rsp)
L30:
  lea    -0x1(%r10),%rax
  cmp    %rdx,%rax
  ja     L4
L155:
  sub    $0x1,%r9d
  jb     L27
  movslq %r9d,%rax
  mov    0x960(%rsp,%rax,8),%r10
  mov    (%rsp,%rax,8),%rdx
  lea    -0x1(%r10),%rax
  cmp    %rdx,%rax
  jbe    L155
L4:
  movsd  (%rdi,%rdx,8),%xmm1
  xchg   %ax,%ax
L150:
  movsd  (%rdi,%rax,8),%xmm0
  cmp    %rax,%rdx
  setb   %cl
  comisd %xmm1,%xmm0
  jb     L136
  test   %cl,%cl
  je     L136
  sub    $0x1,%rax
  cmp    %rdx,%rax
  jbe    L207
L161:
  movsd  (%rdi,%rax,8),%xmm0
  lea    0x1(%rdx),%r8
  cmp    %r8,%rax
  movsd  %xmm0,(%rdi,%rdx,8)
  seta   %dl
  comisd %xmm1,%xmm0
  mov    %edx,%ecx
  jb     L121
  test   %dl,%dl
  je     L121
  mov    %r8,%rdx
  sub    $0x1,%rax
  cmp    %rdx,%rax
  ja     L161
L207:
  lea    (%rdi,%rdx,8),%rsi
L129:
  movsd  %xmm1,(%rsi)
  movq   %r10,%xmm2
  lea    0x1(%r9),%esi
  movslq %r9d,%r9
  movq   %rdx,%xmm0
  lea    0x1(%rdx),%rax
  movslq %esi,%rcx
  mov    %rdx,%rbp
  lea    (%r11,%r9,8),%r8
  punpcklqdq %xmm2,%xmm0
  mov    %rax,(%rsp,%rcx,8)
  movups %xmm0,(%r8)
  mov    0x960(%rsp,%rcx,8),%r10
  mov    (%rsp,%r9,8),%rbx
  mov    %r10,%r12
  sub    %rbx,%rbp
  sub    %rax,%r12
  cmp    %rbp,%r12
  jbe    L125
  cltq
  movq   %rbx,%xmm3
  movq   %rdx,%xmm4
  movq   %rax,%xmm0
  movslq %r10d,%rax
  punpcklqdq %xmm3,%xmm0
  movups %xmm0,(%rsp,%r9,8)
  movq   %rax,%xmm0
  punpcklqdq %xmm4,%xmm0
  movups %xmm0,(%r8)
  mov    (%rsp,%rcx,8),%rdx
  mov    0x960(%rsp,%rcx,8),%r10
L49:
  mov    %esi,%r9d
  jmp    L30
  nopl   0x0(%rax)
L136:
  mov    %rdx,%r8
  nopl   0x0(%rax,%rax,1)
L121:
  lea    0x0(,%r8,8),%rdx
  lea    (%rdi,%rdx,1),%rsi
  comisd (%rsi),%xmm1
  jb     L178
  test   %cl,%cl
  je     L178
  lea    0x8(%rdi,%rdx,1),%rcx
  mov    %r8,%rdx
L29:
  add    $0x1,%rdx
  mov    %rcx,%rsi
  cmp    %rax,%rdx
  jae    L129
  movsd  (%rcx),%xmm0
  sub    $0x1,%rax
  add    $0x8,%rcx
  movsd  %xmm0,0x8(%rdi,%rax,8)
  cmp    %rax,%rdx
  jae    L190
  comisd %xmm0,%xmm1
  jae    L29
L190:
  cmp    %rdx,%rax
  ja     L150
  jmp    L129
  nopl   0x0(%rax)
L125:
  mov    %rax,%rdx
  jmp    L49
L27:
  mov    0x12c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L81
  add    $0x12d0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L178:
  mov    %r8,%rdx
  jmp    L190
L81:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void quicksortDoublesAscending(double *arr, size_t len) {
  double piv;
  size_t beg[300];
  size_t end[300];
  size_t L, R;
  int i = 0;
  int swap;
  beg[0] = 0;
  end[0] = len;
  while (i >= 0) {
    L = beg[i];
    R = end[i] - 1;
    if (L < R) {
      piv = arr[L];
      while (L < R) {
        while (arr[R] >= piv && L < R) {
          --R;
          if (L < R) {
            arr[L++] = arr[R];
          }
        }
        while (arr[L] <= piv && L < R) {
          ++L;
          if (L < R) {
            arr[R--] = arr[L];
          }
        }
      }
      arr[L] = piv;
      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--;
    }
  }
}
```