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

```asm
<c_ssortsh>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x48,%rsp
  mov    %edi,0x38(%rsp)
  mov    %rsi,0x20(%rsp)
  test   %edi,%edi
  jle    L31
  pxor   %xmm1,%xmm1
  mov    %edx,%edi
  setle  %dl
  ucomiss %xmm1,%xmm0
  setnp  %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L31
  mov    %edi,%eax
  movl   $0x0,0x3c(%rsp)
  neg    %eax
  comiss %xmm0,%xmm1
  cmovbe %edi,%eax
  mov    %eax,0x14(%rsp)
  mov    %eax,%edi
  test   %eax,%eax
  js     L134
L72:
  mov    0x20(%rsp),%rbx
  lea    D17(%rip),%rax
  movslq 0x14(%rsp),%r12
  mov    $0x2bd,%r14d
  mov    %rax,0x28(%rsp)
  movslq 0x3c(%rsp),%rax
  mov    %rax,0x30(%rsp)
  lea    (%rbx,%rax,4),%rax
  mov    %rax,0x18(%rsp)
  xchg   %ax,%ax
L94:
  cmp    %r14d,0x38(%rsp)
  jle    L17
  mov    0x14(%rsp),%eax
  mov    %r14d,%r15d
  movl   $0x0,0x10(%rsp)
  xor    %ebx,%ebx
  neg    %r15d
  imul   %eax,%r15d
  mov    %eax,%edi
  imul   %r14d,%edi
  movslq %r15d,%r15
  shl    $0x2,%r15
  movslq %edi,%rbp
  mov    %r15,%rax
  mov    %rbp,%r13
  mov    %r14d,%r15d
  mov    %rax,%rbp
  jmp    L70
  nopl   0x0(%rax)
L91:
  mov    0x14(%rsp),%esi
  add    $0x1,%r15d
  add    %esi,0x10(%rsp)
  add    %r12,%r13
  add    %r12,%rbx
  cmp    %r15d,0x38(%rsp)
  je     L17
L70:
  mov    0x18(%rsp),%rax
  movss  (%rax,%r13,4),%xmm1
  movaps %xmm1,%xmm0
  movss  %xmm1,0xc(%rsp)
  call   <stdlib_base_is_nanf@plt>
  movss  0xc(%rsp),%xmm1
  test   %rax,%rax
  jne    L91
  movaps %xmm1,%xmm0
  call   <stdlib_base_is_negative_zerof@plt>
  mov    0x20(%rsp),%rdi
  mov    %r13,%r8
  mov    %r15d,%edx
  mov    %eax,%r11d
  movss  0xc(%rsp),%xmm1
  movslq 0x10(%rsp),%rax
  sub    %rbx,%r8
  add    0x30(%rsp),%rax
  lea    (%rdi,%rax,4),%rax
  cs nopw 0x0(%rax,%rax,1)
L159:
  movss  (%rax),%xmm0
  mov    %edx,%esi
  sub    %r14d,%edx
  mov    %rax,%rdi
  comiss %xmm0,%xmm1
  jb     L132
  test   %r11d,%r11d
  je     L49
  ucomiss %xmm0,%xmm1
  mov    $0x1,%r9d
  setp   %cl
  cmovne %r9d,%ecx
  test   %cl,%cl
  jne    L49
L132:
  movss  %xmm0,(%rax,%r8,4)
  add    %rbp,%rax
  cmp    %r14d,%edx
  jge    L159
  movss  %xmm1,(%rdi)
  jmp    L91
  nopl   0x0(%rax)
L17:
  lea    D5(%rip),%rbx
  cmp    %rbx,0x28(%rsp)
  je     L31
  mov    0x28(%rsp),%rax
  mov    (%rax),%r14d
  add    $0x4,%rax
  mov    %rax,0x28(%rsp)
  jmp    L94
  nopl   0x0(%rax)
L49:
  imul   0x14(%rsp),%esi
  mov    0x3c(%rsp),%eax
  mov    0x20(%rsp),%rdi
  add    %esi,%eax
  cltq
  lea    (%rdi,%rax,4),%rdi
  movss  %xmm1,(%rdi)
  jmp    L91
L31:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L134:
  mov    $0x1,%eax
  sub    %ebx,%eax
  imul   %edi,%eax
  mov    %eax,0x3c(%rsp)
  jmp    L72
```

tool_calls: name: parse_data
arguments: data_label: D17
datatype: string

tool: D17: -

assistant: ```c
void c_ssortsh(const int64_t N, const float order, float *X, const int64_t stride) {
  int64_t offset;
  int64_t gap;
  int64_t sx;
  int64_t i;
  int64_t j;
  int64_t k;
  bool flg;
  float v;
  float u;
  const static int64_t GAPS[] = {701, 301, 132, 57, 23, 10, 4, 1};
  const static int64_t NGAPS = 8;
  if (N <= 0 || order == 0.0f) {
    return;
  }
  if (order < 0.0f) {
    sx = -stride;
  } else {
    sx = stride;
  }
  if (sx < 0) {
    offset = (1 - N) * sx;
  } else {
    offset = 0;
  }
  for (i = 0; i < NGAPS; i++) {
    gap = GAPS[i];
    for (j = gap; j < N; j++) {
      v = X[offset + (j * sx)];
      if (stdlib_base_is_nanf(v)) {
        continue;
      }
      flg = stdlib_base_is_negative_zerof(v);
      for (k = j; k >= gap; k -= gap) {
        u = X[offset + ((k - gap) * sx)];
        if (u <= v && !(flg && u == v)) {
          break;
        }
        X[offset + (k * sx)] = u;
      }
      X[offset + (k * sx)] = v;
    }
  }
  return;
}
```