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

```asm
<stdlib_strided_dnansumkbn2>:
  endbr64
  test   %rdi,%rdi
  jle    L57
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x30,%rsp
  cmp    $0x1,%rdi
  je     L121
  test   %rdx,%rdx
  je     L121
  mov    $0x0,%eax
  jns    L17
  mov    $0x1,%eax
  sub    %rdi,%rax
  imul   %rdx,%rax
L17:
  pxor   %xmm6,%xmm6
  lea    (%rbx,%rax,8),%rbp
  lea    0x0(,%rdx,8),%r12
  xor    %ebx,%ebx
  movsd  %xmm6,0x18(%rsp)
  movsd  %xmm6,0x20(%rsp)
  movsd  %xmm6,0x10(%rsp)
  jmp    L9
  nopl   0x0(%rax,%rax,1)
L35:
  add    $0x1,%rbx
  add    %r12,%rbp
  cmp    %rbx,%r13
  je     L4
L9:
  movsd  0x0(%rbp),%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <stdlib_base_is_nan@plt>
  movsd  0x8(%rsp),%xmm1
  test   %rax,%rax
  jne    L35
  movsd  0x10(%rsp),%xmm3
  movsd  %xmm1,0x28(%rsp)
  movapd %xmm3,%xmm4
  movapd %xmm3,%xmm0
  addsd  %xmm1,%xmm4
  movsd  %xmm4,0x8(%rsp)
  call   <fabs@plt>
  movsd  0x28(%rsp),%xmm1
  mov    %rax,%r14
  movapd %xmm1,%xmm0
  call   <fabs@plt>
  movsd  0x28(%rsp),%xmm1
  cmp    %rax,%r14
  jl     L45
  movsd  0x10(%rsp),%xmm0
  subsd  0x8(%rsp),%xmm0
  addsd  %xmm0,%xmm1
L112:
  movsd  0x18(%rsp),%xmm5
  movsd  %xmm1,0x10(%rsp)
  movapd %xmm5,%xmm2
  movapd %xmm5,%xmm0
  addsd  %xmm1,%xmm2
  movsd  %xmm2,0x28(%rsp)
  call   <fabs@plt>
  movsd  0x10(%rsp),%xmm1
  mov    %rax,%r14
  movapd %xmm1,%xmm0
  call   <fabs@plt>
  movsd  0x10(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm2
  cmp    %rax,%r14
  jl     L28
  movsd  0x18(%rsp),%xmm0
  subsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
L55:
  addsd  0x20(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm7
  add    $0x1,%rbx
  add    %r12,%rbp
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm1,0x20(%rsp)
  cmp    %rbx,%r13
  jne    L9
L4:
  movsd  0x10(%rsp),%xmm0
  addsd  0x18(%rsp),%xmm0
  addsd  0x20(%rsp),%xmm0
L11:
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L121:
  movsd  (%rbx),%xmm0
  call   <stdlib_base_is_nan@plt>
  pxor   %xmm0,%xmm0
  test   %rax,%rax
  jne    L11
  movsd  (%rbx),%xmm0
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L28:
  subsd  %xmm2,%xmm1
  addsd  0x18(%rsp),%xmm1
  jmp    L55
  nopw   0x0(%rax,%rax,1)
L45:
  subsd  0x8(%rsp),%xmm1
  addsd  0x10(%rsp),%xmm1
  jmp    L112
  nopl   0x0(%rax)
L57:
  pxor   %xmm0,%xmm0
  ret
```

assistant: ```c
double stdlib_strided_dnansumkbn2(const int64_t N, const double *X, const int64_t stride) {
  double sum;
  double ccs;
  int64_t ix;
  int64_t i;
  double cs;
  double cc;
  double v;
  double t;
  double c;
  if (N <= 0) {
    return 0.0;
  }
  if (N == 1 || stride == 0) {
    if (stdlib_base_is_nan(X[0])) {
      return 0.0;
    }
    return X[0];
  }
  if (stride < 0) {
    ix = (1 - N) * stride;
  } else {
    ix = 0;
  }
  sum = 0.0;
  ccs = 0.0;
  cs = 0.0;
  for (i = 0; i < N; i++) {
    v = X[ix];
    if (!stdlib_base_is_nan(v)) {
      t = sum + v;
      if (fabs(sum) >= fabs(v)) {
        c = (sum - t) + v;
      } else {
        c = (v - t) + sum;
      }
      sum = t;
      t = cs + c;
      if (fabs(cs) >= fabs(c)) {
        cc = (cs - t) + c;
      } else {
        cc = (c - t) + cs;
      }
      cs = t;
      ccs += cc;
    }
    ix += stride;
  }
  return sum + cs + ccs;
}
```