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

```asm
<cpi_vercmp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jne    L97
  cmpq   $0x0,-0x50(%rbp)
  je     L97
  mov    $0xffffffff,%eax
  jmp    L128
L97:
  cmpq   $0x0,-0x48(%rbp)
  jne    L246
  cmpq   $0x0,-0x50(%rbp)
  jne    L246
  mov    $0x0,%eax
  jmp    L128
L246:
  cmpq   $0x0,-0x48(%rbp)
  je     L199
  cmpq   $0x0,-0x50(%rbp)
  jne    L199
  mov    $0x1,%eax
  jmp    L128
L199:
  cmpq   $0x0,-0x48(%rbp)
  je     L55
  cmpq   $0x0,-0x50(%rbp)
  je     L55
  mov    $0x1,%eax
  jmp    L23
L55:
  mov    $0x0,%eax
L23:
  mov    %eax,%edi
  call   <assert@plt>
  jmp    L259
L132:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <vercmp_nondigit_end@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <vercmp_nondigit_end@plt>
  mov    %rax,-0x18(%rbp)
  jmp    L212
L243:
  movb   $0x0,-0x32(%rbp)
  movb   $0x0,-0x31(%rbp)
  mov    -0x48(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jae    L154
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x32(%rbp)
L154:
  mov    -0x50(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jae    L254
  mov    -0x50(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x50(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x31(%rbp)
L254:
  movsbl -0x32(%rbp),%eax
  mov    %eax,%edi
  call   <vercmp_char_value@plt>
  mov    %eax,%ebx
  movsbl -0x31(%rbp),%eax
  mov    %eax,%edi
  call   <vercmp_char_value@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L176
  mov    -0x24(%rbp),%eax
  jmp    L128
L176:
  mov    -0x48(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  ja     L113
  mov    -0x50(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  ja     L113
  mov    $0x1,%eax
  jmp    L102
L113:
  mov    $0x0,%eax
L102:
  mov    %eax,%edi
  call   <assert@plt>
L212:
  mov    -0x48(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L243
  mov    -0x50(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L243
  mov    -0x48(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jne    L193
  mov    -0x50(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jne    L193
  mov    $0x1,%eax
  jmp    L61
L193:
  mov    $0x0,%eax
L61:
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <vercmp_digit_end@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <vercmp_digit_end@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <vercmp_num_value@plt>
  mov    %eax,-0x30(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <vercmp_num_value@plt>
  mov    %eax,-0x2c(%rbp)
  mov    -0x30(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  je     L28
  mov    -0x28(%rbp),%eax
  jmp    L128
L28:
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x50(%rbp)
L259:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L132
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L132
  mov    $0x0,%eax
L128:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
__attribute__((visibility("hidden"))) int cpi_vercmp(const char *v1, const char *v2) {
  const char *v1n;
  const char *v2n;
  int diff;
  if (v1 == NULL && v2 != NULL) {
    return -1;
  } else if (v1 == NULL && v2 == NULL) {
    return 0;
  } else if (v1 != NULL && v2 == NULL) {
    return 1;
  }
  assert(v1 != NULL && v2 != NULL);
  while (*v1 != '\0' || *v2 != '\0') {
    v1n = vercmp_nondigit_end(v1);
    v2n = vercmp_nondigit_end(v2);
    while (v1 < v1n || v2 < v2n) {
      char c1 = '\0';
      char c2 = '\0';
      if (v1 < v1n) {
        c1 = *v1++;
      }
      if (v2 < v2n) {
        c2 = *v2++;
      }
      diff = vercmp_char_value(c1) - vercmp_char_value(c2);
      if (diff != 0) {
        return diff;
      }
      assert(v1 <= v1n && v2 <= v2n);
    }
    assert(v1 == v1n && v2 == v2n);
    v1n = vercmp_digit_end(v1);
    v2n = vercmp_digit_end(v2);
    {
      int i1 = vercmp_num_value(v1, v1n);
      int i2 = vercmp_num_value(v2, v2n);
      int diff = i1 - i2;
      if (diff != 0) {
        return diff;
      }
    }
    v1 = v1n;
    v2 = v2n;
  }
  return 0;
}
```