user: Please show me the C implementation that matches the assembly code listed below:

```asm
<quicksortDoublesAscending>:
  endbr64
  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    %rdi,%rcx
  mov    %rsi,%r10
  mov    %rsi,0x960(%rsp)
L147:
  lea    -0x1(%r10),%rax
  cmp    %rdx,%rax
  ja     L22
L166:
  sub    $0x1,%r9d
  jb     L92
  movslq %r9d,%rax
  mov    0x960(%rsp,%rax,8),%r10
  mov    (%rsp,%rax,8),%rdx
  lea    -0x1(%r10),%rax
  cmp    %rdx,%rax
  jbe    L166
L22:
  movsd  (%rcx,%rdx,8),%xmm1
  cs nopw 0x0(%rax,%rax,1)
L12:
  movsd  (%rcx,%rax,8),%xmm0
  cmp    %rax,%rdx
  setb   %sil
  comisd %xmm1,%xmm0
  jb     L167
  test   %sil,%sil
  je     L167
  sub    $0x1,%rax
  cmp    %rdx,%rax
  jbe    L12
  movsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rcx,%rdx,8)
  add    $0x1,%rdx
  jmp    L12
L167:
  lea    0x0(,%rdx,8),%r8
  lea    (%rcx,%r8,1),%rdi
  comisd (%rdi),%xmm1
  jb     L136
  test   %sil,%sil
  je     L136
  lea    0x8(%rcx,%r8,1),%rsi
L46:
  add    $0x1,%rdx
  mov    %rsi,%rdi
  cmp    %rax,%rdx
  jb     L34
L165:
  movsd  %xmm1,(%rdi)
  lea    0x1(%r9),%edi
  movslq %r9d,%r9
  lea    0x1(%rdx),%rsi
  movslq %edi,%rax
  mov    %rdx,%r11
  mov    %r10,0x960(%rsp,%rax,8)
  mov    %rdx,0x960(%rsp,%r9,8)
  mov    0x960(%rsp,%rax,8),%r10
  mov    %rsi,(%rsp,%rax,8)
  mov    (%rsp,%r9,8),%r8
  mov    %r10,%rbx
  sub    %rsi,%rbx
  sub    %r8,%r11
  cmp    %r11,%rbx
  jbe    L2
  movslq %r10d,%r10
  movslq %esi,%rsi
  mov    %rdx,0x960(%rsp,%rax,8)
  mov    %r8,(%rsp,%rax,8)
  mov    %r10,0x960(%rsp,%r9,8)
  mov    0x960(%rsp,%rax,8),%r10
  mov    %rsi,(%rsp,%r9,8)
  mov    (%rsp,%rax,8),%rdx
L107:
  mov    %edi,%r9d
  jmp    L147
  nopl   (%rax)
L34:
  movsd  (%rsi),%xmm0
  sub    $0x1,%rax
  add    $0x8,%rsi
  movsd  %xmm0,0x8(%rcx,%rax,8)
  cmp    %rax,%rdx
  jae    L136
  comisd %xmm0,%xmm1
  jae    L46
L136:
  cmp    %rdx,%rax
  ja     L12
  jmp    L165
  nopw   0x0(%rax,%rax,1)
L2:
  mov    %rsi,%rdx
  jmp    L107
L92:
  mov    0x12c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L141
  add    $0x12d0,%rsp
  pop    %rbx
  ret
L141:
  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--;
    }
  }
}
```