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

```asm
<c_dsortins>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,0x28(%rsp)
  test   %edi,%edi
  jle    L101
  pxor   %xmm1,%xmm1
  mov    %edx,%ebx
  setle  %dl
  ucomisd %xmm1,%xmm0
  setnp  %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L101
  mov    %ebx,%eax
  mov    %rsi,%r13
  neg    %eax
  comisd %xmm0,%xmm1
  cmova  %eax,%ebx
  test   %ebx,%ebx
  js     L196
  lea    -0x1(%rdi),%r12d
  mov    %r12d,%eax
  imul   %ebx,%eax
  mov    %eax,0x2c(%rsp)
  cmp    $0x1,%edi
  je     L101
  cltq
  mov    %ebx,0x24(%rsp)
  movslq %ebx,%r12
  mov    %r13,%r14
  lea    0x0(%r13,%rax,8),%rax
  movl   $0x1,0x18(%rsp)
  lea    0x0(%r13,%r12,8),%r15
  mov    %rax,0x30(%rsp)
  mov    %ebx,%eax
  neg    %eax
  cltq
  shl    $0x3,%rax
  mov    %rax,0x48(%rsp)
  nopl   0x0(%rax,%rax,1)
L28:
  movslq 0x24(%rsp),%r13
  lea    (%r14,%r13,8),%rbp
  movsd  0x0(%rbp),%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <stdlib_base_is_nan@plt>
  movsd  0x8(%rsp),%xmm1
  test   %rax,%rax
  je     L195
  mov    0x24(%rsp),%eax
  cmp    %eax,0x2c(%rsp)
  jle    L46
  mov    0x2c(%rsp),%eax
  cs nopw 0x0(%rax,%rax,1)
L138:
  movsd  (%r15,%r13,8),%xmm0
  movsd  %xmm0,(%r14,%r13,8)
  add    %r12,%r13
  cmp    %r13d,%eax
  jg     L138
L46:
  mov    0x30(%rsp),%rax
  movsd  %xmm1,(%rax)
L39:
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  cmp    %eax,0x28(%rsp)
  jne    L28
L101:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L195:
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <stdlib_base_is_negative_zero@plt>
  mov    0x24(%rsp),%r13d
  movsd  0x8(%rsp),%xmm1
  mov    %eax,0x20(%rsp)
  sub    %ebx,%r13d
  js     L139
  movslq %r13d,%rax
  mov    %r15,0x38(%rsp)
  mov    %ebx,%r15d
  mov    0x48(%rsp),%rbx
  lea    (%r14,%rax,8),%rdx
  mov    %r14,0x40(%rsp)
  mov    %r12,%r14
  mov    %rdx,%rbp
  cs nopw 0x0(%rax,%rax,1)
L59:
  movsd  0x0(%rbp),%xmm0
  mov    %rbp,%r12
  comisd %xmm0,%xmm1
  jb     L226
  mov    0x20(%rsp),%eax
  test   %eax,%eax
  je     L264
  ucomisd %xmm0,%xmm1
  mov    $0x1,%ecx
  setp   %al
  cmovne %ecx,%eax
  test   %al,%al
  jne    L264
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm0,0x8(%rsp)
  call   <stdlib_base_is_negative_zero@plt>
  movsd  0x8(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm1
  test   %eax,%eax
  jne    L264
L226:
  movsd  %xmm0,0x0(%rbp,%r14,8)
  add    %rbx,%rbp
  sub    %r15d,%r13d
  jns    L59
  mov    %r12,%rbp
  mov    %r15d,%ebx
  mov    %r14,%r12
  mov    0x38(%rsp),%r15
  mov    0x40(%rsp),%r14
L139:
  add    %ebx,0x24(%rsp)
  movsd  %xmm1,0x0(%rbp)
  jmp    L39
  nopw   0x0(%rax,%rax,1)
L264:
  mov    %r15d,%ebx
  mov    %r14,%r12
  mov    0x40(%rsp),%r14
  mov    0x38(%rsp),%r15
  lea    (%rbx,%r13,1),%eax
  cltq
  lea    (%r14,%rax,8),%rbp
  jmp    L139
L196:
  mov    $0x1,%eax
  sub    %edi,%eax
  imul   %ebx,%eax
  mov    %eax,0x8(%rsp)
  add    %ebx,%eax
  mov    %eax,0x2c(%rsp)
  cmp    $0x1,%edi
  je     L101
  mov    %ebx,%eax
  movl   $0x1,0x20(%rsp)
  movslq %ebx,%r12
  mov    %rsi,%rbp
  neg    %eax
  mov    %ebx,0x30(%rsp)
  lea    (%rsi,%r12,8),%r14
  cltq
  mov    %rax,0x40(%rsp)
  nopw   0x0(%rax,%rax,1)
L132:
  movslq 0x2c(%rsp),%r13
  lea    0x0(%rbp,%r13,8),%rbx
  movsd  (%rbx),%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x10(%rsp)
  call   <stdlib_base_is_nan@plt>
  movsd  0x10(%rsp),%xmm1
  test   %rax,%rax
  je     L189
  test   %r13d,%r13d
  jle    L152
  nopl   (%rax)
L236:
  movsd  (%r14,%r13,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%r13,8)
  add    %r12,%r13
  test   %r13d,%r13d
  jg     L236
L152:
  movsd  %xmm1,0x0(%rbp)
L80:
  addl   $0x1,0x20(%rsp)
  mov    0x20(%rsp),%eax
  cmp    %eax,0x28(%rsp)
  jne    L132
  jmp    L101
  xchg   %ax,%ax
L189:
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x10(%rsp)
  call   <stdlib_base_is_negative_zero@plt>
  mov    0x2c(%rsp),%edx
  sub    0x30(%rsp),%edx
  cmp    %edx,0x8(%rsp)
  movsd  0x10(%rsp),%xmm1
  mov    %eax,0x24(%rsp)
  jl     L72
  mov    %r12,0x38(%rsp)
  mov    0x40(%rsp),%r13
  movslq %edx,%r15
  nopl   0x0(%rax)
L213:
  movsd  0x0(%rbp,%r15,8),%xmm0
  mov    %r15d,%ebx
  lea    0x0(%rbp,%r15,8),%r12
  comisd %xmm0,%xmm1
  jb     L41
  mov    0x24(%rsp),%edx
  test   %edx,%edx
  je     L125
  ucomisd %xmm0,%xmm1
  mov    $0x1,%edi
  setp   %al
  cmovne %edi,%eax
  test   %al,%al
  jne    L125
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm0,0x10(%rsp)
  call   <stdlib_base_is_negative_zero@plt>
  movsd  0x10(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm1
  test   %eax,%eax
  jne    L125
L41:
  movsd  %xmm0,(%r14,%r15,8)
  add    %r13,%r15
  cmp    %r15d,0x8(%rsp)
  jge    L213
  mov    %r12,%rbx
  mov    0x38(%rsp),%r12
L72:
  mov    0x30(%rsp),%edi
  movsd  %xmm1,(%rbx)
  add    %edi,0x2c(%rsp)
  jmp    L80
L125:
  mov    0x30(%rsp),%eax
  mov    0x38(%rsp),%r12
  add    %ebx,%eax
  cltq
  lea    0x0(%rbp,%rax,8),%rbx
  jmp    L72
```

assistant: ```c
void c_dsortins(const int64_t N, const double order, double *X, const int64_t stride) {
  int64_t ix;
  int64_t jx;
  int64_t fx;
  int64_t lx;
  int64_t sx;
  int64_t i;
  double v;
  double u;
  bool flg;
  if (N <= 0 || order == 0.0) {
    return;
  }
  if (order < 0.0) {
    sx = -stride;
  } else {
    sx = stride;
  }
  if (sx < 0) {
    fx = (1 - N) * sx;
    lx = 0;
    ix = fx + sx;
    for (i = 1; i < N; i++) {
      v = X[ix];
      if (stdlib_base_is_nan(v)) {
        jx = ix;
        while (jx > lx) {
          X[jx] = X[jx + sx];
          jx += sx;
        }
        X[lx] = v;
      } else {
        flg = stdlib_base_is_negative_zero(v);
        jx = ix - sx;
        while (jx <= fx) {
          u = X[jx];
          if (u <= v && !(flg && u == v && !stdlib_base_is_negative_zero(u))) {
            break;
          }
          X[jx + sx] = u;
          jx -= sx;
        }
        X[jx + sx] = v;
        ix += sx;
      }
    }
    return;
  }
  fx = 0;
  lx = (N - 1) * sx;
  ix = fx + sx;
  for (i = 1; i < N; i++) {
    v = X[ix];
    if (stdlib_base_is_nan(v)) {
      jx = ix;
      while (jx < lx) {
        X[jx] = X[jx + sx];
        jx += sx;
      }
      X[lx] = v;
    } else {
      flg = stdlib_base_is_negative_zero(v);
      jx = ix - sx;
      while (jx >= fx) {
        u = X[jx];
        if (u <= v && !(flg && u == v && !stdlib_base_is_negative_zero(u))) {
          break;
        }
        X[jx + sx] = u;
        jx -= sx;
      }
      X[jx + sx] = v;
      ix += sx;
    }
  }
  return;
}
```