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

```asm
<R_qsort_I>:
  endbr64
  push   %r15
  mov    %rdi,%r10
  mov    %edx,%r11d
  push   %r14
  push   %r13
  lea    -0x4(%rsi),%r13
  push   %r12
  lea    -0x8(%rdi),%r12
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x128,%rsp
  movsd  D29(%rip),%xmm3
  mov    %rsi,0x8(%rsp)
  mov    %edx,0x4(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  movl   $0x1,(%rsp)
L12:
  cmp    %ebx,%r11d
  jl     L82
L140:
  mov    (%rsp),%edx
  cmp    $0x1,%edx
  je     L0
  movslq %edx,%rax
  sub    $0x1,%edx
  mov    0x90(%rsp,%rax,4),%ebx
  mov    0x10(%rsp,%rax,4),%r11d
  mov    %edx,(%rsp)
  mov    %ebx,%eax
  sub    %r11d,%eax
L135:
  cmp    $0xa,%eax
  jg     L163
  cmp    0x4(%rsp),%r11d
  je     L12
  cmp    %ebx,%r11d
  je     L140
  mov    0x8(%rsp),%rsi
  movslq %r11d,%rax
  lea    -0x8(%r10,%rax,8),%rcx
  lea    -0x4(%rsi,%rax,4),%rdi
  jmp    L13
  nopl   0x0(%rax,%rax,1)
L178:
  add    $0x1,%r11d
  add    $0x4,%rdi
  add    $0x8,%rcx
  cmp    %r11d,%ebx
  je     L140
L13:
  movsd  0x8(%rcx),%xmm0
  comisd (%rcx),%xmm0
  jae    L178
  mov    0x4(%rdi),%r9d
  mov    %rcx,%rdx
  mov    %rdi,%rax
  cs nopw 0x0(%rax,%rax,1)
L179:
  mov    (%rax),%esi
  movsd  (%rdx),%xmm1
  mov    %rax,%r8
  sub    $0x4,%rax
  mov    %esi,0x8(%rax)
  mov    %rdx,%rsi
  sub    $0x8,%rdx
  movsd  %xmm1,0x10(%rdx)
  movsd  -0x8(%rsi),%xmm1
  comisd %xmm0,%xmm1
  ja     L179
  mov    %r9d,(%r8)
  movsd  %xmm0,(%rsi)
  jmp    L178
L82:
  movsd  D30(%rip),%xmm4
  mov    %ebx,%eax
  sub    %r11d,%eax
  comisd %xmm3,%xmm4
  ja     L114
  subsd  D17(%rip),%xmm3
L163:
  pxor   %xmm0,%xmm0
  movslq %r11d,%rsi
  cvtsi2sd %eax,%xmm0
  lea    (%r12,%rsi,8),%rcx
  mulsd  %xmm3,%xmm0
  cvttsd2si %xmm0,%eax
  movsd  (%rcx),%xmm0
  add    %r11d,%eax
  cltq
  lea    0x0(%r13,%rax,4),%rdx
  lea    (%r12,%rax,8),%rax
  movsd  (%rax),%xmm2
  mov    (%rdx),%r8d
  comisd %xmm2,%xmm0
  jbe    L168
  lea    0x0(%r13,%rsi,4),%rdi
  mov    (%rdi),%r9d
  mov    %r9d,(%rdx)
  mov    %r8d,(%rdi)
  mov    (%rdx),%r8d
  movsd  %xmm0,(%rax)
  movsd  %xmm2,(%rcx)
  movsd  (%rax),%xmm2
L168:
  movslq %ebx,%r9
  lea    (%r12,%r9,8),%rdi
  movsd  (%rdi),%xmm0
  comisd %xmm0,%xmm2
  ja     L31
L234:
  mov    %ebx,%edx
  mov    %r11d,%esi
  nopl   0x0(%rax)
L181:
  lea    -0x1(%rdx),%eax
  movslq %eax,%rdi
  lea    (%r12,%rdi,8),%r8
  movsd  (%r8),%xmm0
  comisd %xmm2,%xmm0
  jbe    L152
  lea    -0x2(%rdx),%eax
  lea    -0x10(%r10,%rdi,8),%rcx
  cltq
  nopl   0x0(%rax,%rax,1)
L8:
  movsd  (%rcx),%xmm0
  mov    %eax,%edx
  mov    %rcx,%r8
  mov    %rax,%rdi
  sub    $0x8,%rcx
  sub    $0x1,%rax
  comisd %xmm2,%xmm0
  ja     L8
L209:
  lea    0x1(%rsi),%r14d
  lea    0x0(%r13,%rdi,4),%rbp
  movslq %r14d,%r9
  lea    0x2(%rsi),%ecx
  mov    0x0(%rbp),%r15d
  lea    0x0(,%r9,8),%rax
  movslq %ecx,%rcx
  lea    (%r12,%rax,1),%rdi
  add    %r10,%rax
  movsd  (%rdi),%xmm1
  comisd %xmm1,%xmm2
  jbe    L93
  nopl   0x0(%rax)
L167:
  movsd  (%rax),%xmm1
  mov    %ecx,%esi
  mov    %rax,%rdi
  mov    %rcx,%r9
  add    $0x8,%rax
  add    $0x1,%rcx
  comisd %xmm1,%xmm2
  ja     L167
  cmp    %esi,%edx
  jl     L248
L266:
  lea    0x0(%r13,%r9,4),%rax
  mov    (%rax),%ecx
  mov    %ecx,0x0(%rbp)
  mov    %r15d,(%rax)
  movsd  %xmm1,(%r8)
  movsd  %xmm0,(%rdi)
  jmp    L181
  nopl   0x0(%rax)
L93:
  mov    %r14d,%esi
  cmp    %esi,%edx
  jge    L266
  nop
L248:
  mov    %edx,%ecx
  mov    %ebx,%eax
  addl   $0x1,(%rsp)
  mov    (%rsp),%edi
  sub    %r11d,%ecx
  sub    %esi,%eax
  cmp    %eax,%ecx
  jg     L25
  movslq %edi,%rax
  mov    %ebx,0x90(%rsp,%rax,4)
  mov    %edx,%ebx
  mov    %esi,0x10(%rsp,%rax,4)
  mov    %ecx,%eax
  jmp    L135
  nopl   0x0(%rax,%rax,1)
L152:
  mov    %eax,%edx
  jmp    L209
L25:
  movslq (%rsp),%rcx
  mov    %r11d,0x10(%rsp,%rcx,4)
  mov    %esi,%r11d
  mov    %edx,0x90(%rsp,%rcx,4)
  jmp    L135
L114:
  addsd  D12(%rip),%xmm3
  jmp    L163
L31:
  lea    0x0(%r13,%r9,4),%r9
  mov    (%r9),%ebp
  mov    %ebp,(%rdx)
  mov    %r8d,(%r9)
  mov    (%rdx),%r8d
  movsd  %xmm0,(%rax)
  movsd  %xmm2,(%rdi)
  movsd  (%rax),%xmm2
  movsd  (%rcx),%xmm0
  comisd %xmm2,%xmm0
  jbe    L234
  lea    0x0(%r13,%rsi,4),%rsi
  mov    (%rsi),%edi
  mov    %edi,(%rdx)
  mov    %r8d,(%rsi)
  movsd  %xmm0,(%rax)
  movsd  %xmm2,(%rcx)
  movsd  (%rax),%xmm2
  jmp    L234
L0:
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L272
  add    $0x128,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L272:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D29
type_infered: f64
name: unpack_data
arguments: tag: D30
type_infered: f64
name: unpack_data
arguments: tag: D17
type_infered: f64
name: unpack_data
arguments: tag: D12
type_infered: f64

tool: D29: 0.375

tool: D30: 0.5898437

tool: D17: 0.21875

tool: D12: 0.0390625

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;
}
```