user: Converte this assembly snippet into its equivalent C code:

```asm
<R_qsort_I>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x128,%rsp
  mov    %rdi,%r10
  mov    %rsi,0x8(%rsp)
  mov    %edx,0x4(%rsp)
  mov    %ecx,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  lea    -0x8(%rdi),%r12
  lea    -0x4(%rsi),%r13
  mov    %edx,%r11d
  movl   $0x1,(%rsp)
  movsd  D19(%rip),%xmm3
L186:
  cmp    %ebp,%r11d
  jl     L216
L121:
  mov    (%rsp),%ebx
  cmp    $0x1,%ebx
  je     L114
  movslq %ebx,%rax
  mov    0x10(%rsp,%rax,4),%r11d
  mov    0x90(%rsp,%rax,4),%ebp
  sub    $0x1,%ebx
  mov    %ebx,(%rsp)
L130:
  mov    %ebp,%eax
  sub    %r11d,%eax
  cmp    $0xa,%eax
  jg     L107
  cmp    0x4(%rsp),%r11d
  je     L186
  cmp    %ebp,%r11d
  je     L121
  movslq %r11d,%rax
  mov    0x8(%rsp),%rbx
  lea    -0x4(%rbx,%rax,4),%rdi
  lea    -0x8(%r10,%rax,8),%rcx
  jmp    L211
L216:
  movsd  D30(%rip),%xmm4
  comisd %xmm3,%xmm4
  jbe    L135
  addsd  D32(%rip),%xmm3
L107:
  mov    %ebp,%eax
  sub    %r11d,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm3,%xmm0
  cvttsd2si %xmm0,%eax
  add    %r11d,%eax
  cltq
  lea    0x0(%r13,%rax,4),%rdx
  mov    (%rdx),%r8d
  lea    (%r12,%rax,8),%rax
  movsd  (%rax),%xmm1
  movslq %r11d,%rdi
  lea    (%r12,%rdi,8),%rcx
  movsd  (%rcx),%xmm0
  comisd %xmm1,%xmm0
  jbe    L228
  lea    0x0(%r13,%rdi,4),%rsi
  mov    (%rsi),%r9d
  mov    %r9d,(%rdx)
  mov    %r8d,(%rsi)
  mov    (%rdx),%r8d
  movsd  (%rcx),%xmm0
  movsd  %xmm0,(%rax)
  movsd  %xmm1,(%rcx)
  movsd  (%rax),%xmm1
L228:
  movslq %ebp,%r9
  lea    (%r12,%r9,8),%rsi
  comisd (%rsi),%xmm1
  jbe    L93
  lea    0x0(%r13,%r9,4),%r9
  mov    (%r9),%ebx
  mov    %ebx,(%rdx)
  mov    %r8d,(%r9)
  mov    (%rdx),%r8d
  movsd  (%rsi),%xmm0
  movsd  %xmm0,(%rax)
  movsd  %xmm1,(%rsi)
  movsd  (%rax),%xmm1
  movsd  (%rcx),%xmm0
  comisd %xmm1,%xmm0
  jbe    L93
  lea    0x0(%r13,%rdi,4),%rsi
  mov    (%rsi),%edi
  mov    %edi,(%rdx)
  mov    %r8d,(%rsi)
  movsd  (%rcx),%xmm0
  movsd  %xmm0,(%rax)
  movsd  %xmm1,(%rcx)
  movsd  (%rax),%xmm1
L93:
  mov    %ebp,%edx
  mov    %r11d,%edi
L104:
  lea    -0x1(%rdx),%eax
  movslq %eax,%rsi
  lea    (%r12,%rsi,8),%r8
  movsd  (%r8),%xmm0
  comisd %xmm1,%xmm0
  jbe    L52
  lea    -0x2(%rdx),%eax
  cltq
  lea    -0x10(%r10,%rsi,8),%rcx
L248:
  mov    %eax,%edx
  mov    %rcx,%r8
  movsd  (%rcx),%xmm0
  mov    %rax,%rsi
  sub    $0x1,%rax
  sub    $0x8,%rcx
  comisd %xmm1,%xmm0
  ja     L248
L77:
  lea    0x0(%r13,%rsi,4),%rbx
  mov    (%rbx),%r15d
  lea    0x1(%rdi),%r14d
  movslq %r14d,%r9
  lea    0x0(,%r9,8),%rcx
  lea    (%r12,%rcx,1),%rsi
  lea    0x2(%rdi),%eax
  cltq
  add    %r10,%rcx
  comisd (%rsi),%xmm1
  jbe    L143
L139:
  mov    %eax,%edi
  mov    %rcx,%rsi
  mov    %rax,%r9
  add    $0x1,%rax
  add    $0x8,%rcx
  comisd (%rsi),%xmm1
  ja     L139
L35:
  cmp    %edx,%edi
  jg     L126
  lea    0x0(%r13,%r9,4),%rax
  mov    (%rax),%ecx
  mov    %ecx,(%rbx)
  mov    %r15d,(%rax)
  movsd  (%rsi),%xmm2
  movsd  %xmm2,(%r8)
  movsd  %xmm0,(%rsi)
  jmp    L104
L135:
  subsd  D17(%rip),%xmm3
  jmp    L107
L52:
  mov    %eax,%edx
  jmp    L77
L143:
  mov    %r14d,%edi
  jmp    L35
L126:
  addl   $0x1,(%rsp)
  mov    (%rsp),%ebx
  mov    %edx,%ecx
  sub    %r11d,%ecx
  mov    %ebp,%eax
  sub    %edi,%eax
  cmp    %eax,%ecx
  jg     L115
  movslq %ebx,%rax
  mov    %edi,0x10(%rsp,%rax,4)
  mov    %ebp,0x90(%rsp,%rax,4)
  mov    %edx,%ebp
  jmp    L130
L115:
  movslq (%rsp),%rax
  mov    %r11d,0x10(%rsp,%rax,4)
  mov    %edx,0x90(%rsp,%rax,4)
  mov    %edi,%r11d
  jmp    L130
L38:
  add    $0x1,%r11d
  add    $0x4,%rdi
  add    $0x8,%rcx
  cmp    %r11d,%ebp
  je     L121
L211:
  movsd  0x8(%rcx),%xmm0
  comisd (%rcx),%xmm0
  jae    L38
  mov    0x4(%rdi),%r9d
  mov    %rcx,%rdx
  mov    %rdi,%rax
L122:
  mov    %rax,%r8
  mov    (%rax),%esi
  mov    %esi,0x4(%rax)
  mov    %rdx,%rsi
  movsd  (%rdx),%xmm1
  movsd  %xmm1,0x8(%rdx)
  sub    $0x4,%rax
  sub    $0x8,%rdx
  movsd  -0x8(%rsi),%xmm1
  comisd %xmm0,%xmm1
  ja     L122
  mov    %r9d,(%r8)
  movsd  %xmm0,(%rsi)
  jmp    L38
L114:
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L66
  add    $0x128,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L66:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D19
datatype: f64
name: disassemble_data
arguments: data_label: D30
datatype: f64
name: disassemble_data
arguments: data_label: D32
datatype: f64
name: disassemble_data
arguments: data_label: D17
datatype: f64

tool: D19: 0.375

tool: D30: 0.5898437

tool: D32: 0.0390625

tool: D17: 0.21875

assistant: ```c
void R_qsort_I(double *v, int *I, int i, int j) {
  int il[31], iu[31];
  double vt, vtt;
  double R = 0.375;
  int ii, ij, k, l, m;
  int it, tt;
  --v;
  --I;
  ii = i;
  m = 1;
L10:
  if (i < j) {
    if (R < 0.5898437)
      R += 0.0390625;
    else
      R -= 0.21875;
  L20:
    k = i;
    ij = i + (int)((j - i) * R);
    it = I[ij];
    vt = v[ij];
    if (v[i] > vt) {
      I[ij] = I[i];
      I[i] = it;
      it = I[ij];
      v[ij] = v[i];
      v[i] = vt;
      vt = v[ij];
    }
    l = j;
    if (v[j] < vt) {
      I[ij] = I[j];
      I[j] = it;
      it = I[ij];
      v[ij] = v[j];
      v[j] = vt;
      vt = v[ij];
      if (v[i] > vt) {
        I[ij] = I[i];
        I[i] = it;
        it = I[ij];
        v[ij] = v[i];
        v[i] = vt;
        vt = v[ij];
      }
    }
    for (;;) {
      l--;
      for (; v[l] > vt; l--)
        ;
      tt = I[l];
      vtt = v[l];
      k = k + 1;
      for (; v[k] < vt; k++)
        ;
      if (k > l)
        break;
      I[l] = I[k];
      I[k] = tt;
      v[l] = v[k];
      v[k] = vtt;
    }
    m++;
    if (l - i <= j - k) {
      il[m] = k;
      iu[m] = j;
      j = l;
    } else {
      il[m] = i;
      iu[m] = l;
      i = k;
    }
  } else {
  L80:
    if (m == 1)
      return;
    i = il[m];
    j = iu[m];
    m--;
  }
  if (j - i > 10)
    goto L20;
  if (i == ii)
    goto L10;
  --i;
L100:
  do {
    ++i;
    if (i == j) {
      goto L80;
    }
    it = I[i + 1];
    vt = v[i + 1];
  } while (v[i] <= vt);
  k = i;
  do {
    I[k + 1] = I[k];
    v[k + 1] = v[k];
    --k;
  } while (vt < v[k]);
  I[k + 1] = it;
  v[k + 1] = vt;
  goto L100;
}
```