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

```asm
<mc64rd_>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x108,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xf8(%rsp)
  mov    (%rdi),%eax
  test   %eax,%eax
  jle    L267
  sub    $0x1,%eax
  mov    %rcx,%r10
  lea    -0x8(%r8),%r15
  mov    %rdx,%r11
  lea    (%rdx,%rax,4),%rax
  lea    -0x4(%rcx),%r14
  mov    %rax,0x10(%rsp)
  lea    -0x18(%r8),%rax
  mov    %rax,0x8(%rsp)
  lea    0x30(%rsp),%rax
  mov    %rax,0x28(%rsp)
  nopl   (%rax)
L148:
  mov    0x4(%r11),%r9d
  mov    (%r11),%ebx
  mov    %r9d,%eax
  sub    %ebx,%eax
  cmp    $0x1,%eax
  jle    L107
  cmp    $0xe,%eax
  jg     L32
L298:
  lea    0x1(%rbx),%ecx
  cmp    %ecx,%r9d
  jle    L107
  movslq %ebx,%rax
  mov    $0xfffffffe,%r13d
  movslq %ecx,%rcx
  sub    $0x1,%r9d
  lea    (%r15,%rax,8),%rsi
  lea    (%r14,%rax,4),%rax
  sub    %ebx,%r13d
  mov    %rsi,0x18(%rsp)
  mov    %ebx,%esi
  mov    %rax,0x20(%rsp)
  jmp    L231
  nopl   0x0(%rax,%rax,1)
L83:
  add    $0x1,%esi
  add    $0x1,%rcx
  cmp    %esi,%r9d
  je     L107
L231:
  movsd  -0x10(%r8,%rcx,8),%xmm0
  movsd  -0x8(%r8,%rcx,8),%xmm1
  comisd %xmm0,%xmm1
  jbe    L83
  mov    -0x8(%r10,%rcx,4),%eax
  mov    -0x4(%r10,%rcx,4),%r12d
  movsd  %xmm0,-0x8(%r8,%rcx,8)
  mov    %eax,-0x4(%r10,%rcx,4)
  cmp    %esi,%ebx
  jge    L75
  mov    0x8(%rsp),%rdi
  movslq %esi,%rdx
  lea    -0x8(%r8,%rdx,8),%rax
  lea    -0x4(%r10,%rdx,4),%rdx
  lea    (%rdi,%rcx,8),%rbp
  lea    0x0(%r13,%rcx,1),%edi
  shl    $0x3,%rdi
  sub    %rdi,%rbp
  jmp    L22
  xchg   %ax,%ax
L273:
  mov    -0x4(%rdx),%edi
  movsd  %xmm0,(%rax)
  sub    $0x8,%rax
  sub    $0x4,%rdx
  mov    %edi,0x4(%rdx)
  cmp    %rax,%rbp
  je     L75
L22:
  movsd  -0x8(%rax),%xmm0
  comisd %xmm0,%xmm1
  ja     L273
  add    $0x1,%esi
  movsd  %xmm1,(%rax)
  add    $0x1,%rcx
  mov    %r12d,(%rdx)
  cmp    %esi,%r9d
  jne    L231
  nopl   0x0(%rax)
L107:
  lea    0x4(%r11),%rax
  cmp    0x10(%rsp),%r11
  je     L267
  mov    %rax,%r11
  jmp    L148
  nopw   0x0(%rax,%rax,1)
L75:
  mov    0x18(%rsp),%rax
  movsd  %xmm1,(%rax)
  mov    0x20(%rsp),%rax
  mov    %r12d,(%rax)
  jmp    L83
  cs nopw 0x0(%rax,%rax,1)
L32:
  mov    %ebx,0x30(%rsp)
  mov    %r9d,%edx
  mov    %ebx,%ecx
  mov    $0x2,%edi
  mov    %r9d,0x34(%rsp)
  mov    %r9d,%r13d
L127:
  lea    (%rcx,%rdx,1),%r9d
  lea    -0x2(%rdi),%eax
  mov    %r9d,%esi
  shr    $0x1f,%esi
  add    %r9d,%esi
  sar    %esi
  movslq %esi,%rsi
  movsd  (%r15,%rsi,8),%xmm1
  cmp    %edx,%ecx
  jge    L45
  lea    -0x1(%rdx),%ebp
  movslq %ecx,%r9
  sub    %ecx,%ebp
  lea    -0x8(%r8,%r9,8),%rsi
  add    %r9,%rbp
  lea    (%r8,%rbp,8),%rbp
  jmp    L216
  nop
L12:
  add    $0x8,%rsi
  cmp    %rbp,%rsi
  je     L45
L216:
  movsd  (%rsi),%xmm0
  ucomisd %xmm0,%xmm1
  jp     L195
  je     L12
L195:
  minsd  %xmm0,%xmm1
  mov    %eax,0x18(%rsp)
  mov    %ecx,%esi
  nopl   0x0(%rax,%rax,1)
L98:
  movsd  -0x8(%r8,%r9,8),%xmm0
  comisd %xmm0,%xmm1
  jae    L261
  movslq %esi,%rbp
  mov    -0x4(%r10,%r9,4),%eax
  add    $0x1,%esi
  lea    (%r15,%rbp,8),%r12
  lea    (%r14,%rbp,4),%rbp
  movsd  (%r12),%xmm2
  movsd  %xmm0,(%r12)
  mov    0x0(%rbp),%r12d
  movsd  %xmm2,-0x8(%r8,%r9,8)
  mov    %eax,0x0(%rbp)
  mov    %r12d,-0x4(%r10,%r9,4)
L261:
  add    $0x1,%r9
  cmp    %r9d,%edx
  jg     L98
  mov    %esi,%r12d
  movslq 0x18(%rsp),%rax
  lea    0x1(%rdi),%ebp
  lea    -0x1(%rdi),%r9d
  sub    %ecx,%r12d
  movslq %ebp,%rbp
  mov    %r12d,0x18(%rsp)
  mov    %edx,%r12d
  sub    %esi,%r12d
  cmp    %r12d,0x18(%rsp)
  jl     L164
  movslq %edi,%rax
  movslq %r9d,%r9
  mov    %edx,0x30(%rsp,%rbp,4)
  mov    %esi,0x30(%rsp,%rax,4)
  mov    %esi,0x30(%rsp,%r9,4)
L64:
  lea    0x2(%rdi),%eax
L45:
  mov    0x28(%rsp),%rcx
  movslq %eax,%rdx
  lea    (%rcx,%rdx,4),%rsi
  jmp    L26
  nop
L220:
  mov    -0x4(%rsi),%edx
  mov    -0x8(%rsi),%ecx
  lea    -0x2(%rax),%r9d
  sub    $0x8,%rsi
  mov    %edx,%edi
  sub    %ecx,%edi
  cmp    $0xe,%edi
  jg     L67
  mov    %r9d,%eax
L26:
  test   %eax,%eax
  jne    L220
  mov    %r13d,%r9d
  jmp    L298
  cs nopw 0x0(%rax,%rax,1)
L67:
  mov    %eax,%edi
  jmp    L127
  nopw   0x0(%rax,%rax,1)
L267:
  mov    0xf8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L237
  add    $0x108,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L164:
  mov    %esi,0x30(%rsp,%rbp,4)
  movslq %r9d,%r9
  movslq %edi,%rbp
  mov    %ecx,0x30(%rsp,%rbp,4)
  mov    %edx,0x30(%rsp,%r9,4)
  mov    %esi,0x30(%rsp,%rax,4)
  jmp    L64
L237:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int mc64rd_(int *n, int *ne, int *ip, int *irn, double *a) {
  int i__1, i__2, i__3;
  int j, k, r__, s;
  double ha;
  int hi, td, mid, len, ipj;
  double key;
  int last, todo[50], first;
  --ip;
  --a;
  --irn;
  i__1 = *n;
  for (j = 1; j <= i__1; ++j) {
    len = ip[j + 1] - ip[j];
    if (len <= 1) {
      goto L100;
    }
    ipj = ip[j];
    if (len < 15) {
      goto L400;
    }
    todo[0] = ipj;
    todo[1] = ipj + len;
    td = 2;
  L500:
    first = todo[td - 2];
    last = todo[td - 1];
    key = a[(first + last) / 2];
    i__2 = last - 1;
    for (k = first; k <= i__2; ++k) {
      ha = a[k];
      if (ha == key) {
        goto L475;
      }
      if (ha > key) {
        goto L470;
      }
      key = ha;
      goto L470;
    L475:;
    }
    td += -2;
    goto L425;
  L470:
    mid = first;
    i__2 = last - 1;
    for (k = first; k <= i__2; ++k) {
      if (a[k] <= key) {
        goto L450;
      }
      ha = a[mid];
      a[mid] = a[k];
      a[k] = ha;
      hi = irn[mid];
      irn[mid] = irn[k];
      irn[k] = hi;
      ++mid;
    L450:;
    }
    if (mid - first >= last - mid) {
      todo[td + 1] = last;
      todo[td] = mid;
      todo[td - 1] = mid;
    } else {
      todo[td + 1] = mid;
      todo[td] = first;
      todo[td - 1] = last;
      todo[td - 2] = mid;
    }
    td += 2;
  L425:
    if (td == 0) {
      goto L400;
    }
    if (todo[td - 1] - todo[td - 2] >= 15) {
      goto L500;
    }
    td += -2;
    goto L425;
  L400:
    i__2 = ipj + len - 1;
    for (r__ = ipj + 1; r__ <= i__2; ++r__) {
      if (a[r__ - 1] < a[r__]) {
        ha = a[r__];
        hi = irn[r__];
        a[r__] = a[r__ - 1];
        irn[r__] = irn[r__ - 1];
        i__3 = ipj + 1;
        for (s = r__ - 1; s >= i__3; --s) {
          if (a[s - 1] < ha) {
            a[s] = a[s - 1];
            irn[s] = irn[s - 1];
          } else {
            a[s] = ha;
            irn[s] = hi;
            goto L200;
          }
        }
        a[ipj] = ha;
        irn[ipj] = hi;
      }
    L200:;
    }
  L100:;
  }
  return 0;
}
```