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

```asm
<compare_prerelease>:
  endbr64
  push   %r15
  mov    %rdi,%rcx
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  or     %rsi,%rcx
  je     L41
  mov    %rsi,%r15
  test   %rsi,%rsi
  jne    L120
  test   %rdi,%rdi
  je     L221
L23:
  mov    $0xffffffff,%eax
  nopl   (%rax)
L41:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L69
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L120:
  cmpq   $0x0,0x10(%rsp)
  je     L221
L64:
  mov    0x10(%rsp),%rbx
  lea    0x40(%rsp),%r13
  mov    %rbx,%rdi
  mov    %rbx,%r14
  call   <strlen@plt>
  mov    %r15,%rdi
  mov    %r14,%r12
  mov    %r15,%r14
  mov    %rax,%rbp
  mov    %rax,0x38(%rsp)
  call   <strlen@plt>
  add    %rbp,%rbx
  lea    (%r15,%rax,1),%rcx
  lea    0x1(%r15,%rax,1),%rax
  mov    %rbx,0x28(%rsp)
  mov    %rcx,0x30(%rsp)
  mov    %rax,0x20(%rsp)
  jmp    L166
  nopl   0x0(%rax)
L253:
  cmp    0x20(%rsp),%r14
  je     L245
L166:
  mov    $0x2e,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  mov    $0x2e,%esi
  mov    %r14,%rdi
  test   %rax,%rax
  mov    %rax,%rbx
  cmove  0x28(%rsp),%rbx
  call   <strchr@plt>
  mov    $0xa,%edx
  mov    %r13,%rsi
  mov    %r12,%rdi
  test   %rax,%rax
  mov    %rax,%r15
  cmove  0x30(%rsp),%r15
  call   <strtol@plt>
  mov    0x40(%rsp),%r10
  mov    %r13,%rsi
  mov    %r14,%rdi
  mov    $0xa,%edx
  mov    %eax,0x1c(%rsp)
  cmp    %rbx,%r10
  mov    %r10,0x8(%rsp)
  sete   %bpl
  call   <strtol@plt>
  cmp    %r15,0x40(%rsp)
  mov    0x8(%rsp),%r10
  sete   %dl
  je     L11
  test   %bpl,%bpl
  jne    L23
L11:
  cmp    %rbx,%r10
  je     L6
  test   %dl,%dl
  jne    L245
L6:
  test   %bpl,%bpl
  je     L132
  test   %dl,%dl
  je     L132
  cmp    %eax,0x1c(%rsp)
  jne    L180
L5:
  mov    0x10(%rsp),%rax
  mov    0x38(%rsp),%rcx
  lea    0x1(%rbx),%r12
  lea    0x1(%r15),%r14
  lea    0x1(%rax,%rcx,1),%rax
  cmp    %rax,%r12
  jne    L253
  xor    %eax,%eax
  cmp    0x20(%rsp),%r14
  setne  %al
  neg    %eax
  jmp    L41
  nop
L221:
  test   %r15,%r15
  je     L64
L245:
  mov    $0x1,%eax
  jmp    L41
  nopl   0x0(%rax,%rax,1)
L132:
  mov    %rbx,%r10
  mov    %r15,%rbp
  mov    %r14,%rsi
  mov    %r12,%rdi
  sub    %r12,%r10
  sub    %r14,%rbp
  cmp    %rbp,%r10
  mov    %rbp,%rdx
  mov    %r10,0x8(%rsp)
  cmovbe %r10,%rdx
  call   <strncmp@plt>
  mov    0x8(%rsp),%r10
  test   %eax,%eax
  jne    L91
  cmp    %rbp,%r10
  je     L5
  jb     L23
  jmp    L245
L180:
  jge    L245
  jmp    L23
L91:
  jns    L245
  jmp    L23
L69:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int compare_prerelease(char *x, char *y) {
  char *lastx, *lasty, *xptr, *yptr, *endptr;
  size_t xlen, ylen, xn, yn, min;
  int xisnum, yisnum, xnum, ynum;
  int res;
  if (x == NULL && y == NULL)
    return 0;
  if (y == NULL && x)
    return -1;
  if (x == NULL && y)
    return 1;
  lastx = x;
  lasty = y;
  xlen = strlen(x);
  ylen = strlen(y);
  while (1) {
    if ((xptr = strchr(lastx, "."[0])) == NULL)
      xptr = x + xlen;
    if ((yptr = strchr(lasty, "."[0])) == NULL)
      yptr = y + ylen;
    xnum = strtol(lastx, &endptr, 10);
    xisnum = endptr == xptr ? 1 : 0;
    ynum = strtol(lasty, &endptr, 10);
    yisnum = endptr == yptr ? 1 : 0;
    if (xisnum && !yisnum)
      return -1;
    if (!xisnum && yisnum)
      return 1;
    if (xisnum && yisnum) {
      if (xnum != ynum)
        return xnum < ynum ? -1 : 1;
    } else {
      xn = xptr - lastx;
      yn = yptr - lasty;
      min = xn < yn ? xn : yn;
      if ((res = strncmp(lastx, lasty, min)))
        return res < 0 ? -1 : 1;
      if (xn != yn)
        return xn < yn ? -1 : 1;
    }
    lastx = xptr + 1;
    lasty = yptr + 1;
    if (lastx == x + xlen + 1 && lasty == y + ylen + 1)
      break;
    if (lastx == x + xlen + 1)
      return -1;
    if (lasty == y + ylen + 1)
      return 1;
  }
  return 0;
}
```