user: Please show me the C implementation that matches the assembly code listed below:

```asm
<rpmvercmp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    -0x60(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L231
  mov    $0x0,%eax
  jmp    L391
L231:
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%rax
  lea    0x8(%rax),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%ebx
  mov    $0x0,%edx
  div    %rbx
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L127:
  cmp    %rdx,%rsp
  je     L193
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L127
L193:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L289
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L289:
  mov    %rsp,%rax
  add    $0xf,%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%rax
  lea    0x8(%rax),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L344:
  cmp    %rdx,%rsp
  je     L152
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L344
L152:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L44
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L44:
  mov    %rsp,%rax
  add    $0xf,%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x58(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x60(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L326
L226:
  addq   $0x1,-0x28(%rbp)
L223:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L474
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  je     L226
  jmp    L474
L443:
  addq   $0x1,-0x20(%rbp)
L474:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L279
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  je     L443
L279:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L415
  jmp    L535
L287:
  addq   $0x1,-0x38(%rbp)
L535:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L241
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L287
  jmp    L241
L156:
  addq   $0x1,-0x30(%rbp)
L241:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L20
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L156
L20:
  movl   $0x1,-0x40(%rbp)
  jmp    L439
L21:
  addq   $0x1,-0x38(%rbp)
L415:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L371
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L21
  jmp    L371
L248:
  addq   $0x1,-0x30(%rbp)
L371:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L479
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L248
L479:
  movl   $0x0,-0x40(%rbp)
L439:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x42(%rbp)
  mov    -0x38(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x41(%rbp)
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jne    L534
  mov    $0xffffffff,%eax
  jmp    L391
L534:
  mov    -0x20(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jne    L524
  cmpl   $0x0,-0x40(%rbp)
  je     L108
  mov    $0x1,%eax
  jmp    L391
L108:
  mov    $0xffffffff,%eax
  jmp    L391
L524:
  cmpl   $0x0,-0x40(%rbp)
  je     L336
  jmp    L427
L536:
  addq   $0x1,-0x28(%rbp)
L427:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  je     L536
  jmp    L470
L354:
  addq   $0x1,-0x20(%rbp)
L470:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  je     L354
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbx
  jle    L385
  mov    $0x1,%eax
  jmp    L391
L385:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbx
  jle    L336
  mov    $0xffffffff,%eax
  jmp    L391
L336:
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  mov    %eax,-0x3c(%rbp)
  cmpl   $0x0,-0x3c(%rbp)
  je     L65
  cmpl   $0x0,-0x3c(%rbp)
  jg     L394
  mov    $0xffffffff,%eax
  jmp    L391
L394:
  mov    $0x1,%eax
  jmp    L391
L65:
  mov    -0x38(%rbp),%rax
  movzbl -0x42(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rax
  movzbl -0x41(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x20(%rbp)
L326:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L395
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L223
L395:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L203
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L203
  mov    $0x0,%eax
  jmp    L391
L203:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L377
  mov    $0xffffffff,%eax
  jmp    L391
L377:
  mov    $0x1,%eax
L391:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L119
  call   <__stack_chk_fail@plt>
L119:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int rpmvercmp(const char *a, const char *b) {
  char oldch1, oldch2;
  char *str1, *str2;
  char *one, *two;
  int rc;
  int isnum;
  if (!strcmp(a, b))
    return 0;
  str1 = alloca(strlen(a) + 1);
  str2 = alloca(strlen(b) + 1);
  strcpy(str1, a);
  strcpy(str2, b);
  one = str1;
  two = str2;
  while (*one && *two) {
    while (*one && !isalnum(*one))
      one++;
    while (*two && !isalnum(*two))
      two++;
    str1 = one;
    str2 = two;
    if (isdigit(*str1)) {
      while (*str1 && isdigit(*str1))
        str1++;
      while (*str2 && isdigit(*str2))
        str2++;
      isnum = 1;
    } else {
      while (*str1 && isalpha(*str1))
        str1++;
      while (*str2 && isalpha(*str2))
        str2++;
      isnum = 0;
    }
    oldch1 = *str1;
    *str1 = '\0';
    oldch2 = *str2;
    *str2 = '\0';
    if (one == str1)
      return -1;
    if (two == str2)
      return (isnum ? 1 : -1);
    if (isnum) {
      while (*one == '0')
        one++;
      while (*two == '0')
        two++;
      if (strlen(one) > strlen(two))
        return 1;
      if (strlen(two) > strlen(one))
        return -1;
    }
    rc = strcmp(one, two);
    if (rc)
      return (rc < 1 ? -1 : 1);
    *str1 = oldch1;
    one = str1;
    *str2 = oldch2;
    two = str2;
  }
  if ((!*one) && (!*two))
    return 0;
  if (!*one)
    return -1;
  else
    return 1;
}
```