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

```asm
<ver_compare>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x10,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,(%rsp)
  test   %rdi,%rdi
  je     L154
  cmpq   $0x0,(%rsp)
  je     L262
L369:
  movsbl (%rbx),%edi
  mov    %rsp,%rbp
  jmp    L84
  nopl   0x0(%rax,%rax,1)
L338:
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L77
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
L84:
  test   %dil,%dil
  jne    L338
L77:
  mov    (%rsp),%r12
  movsbl (%r12),%edi
  mov    %r12,%rdx
  test   %dil,%dil
  jne    L91
  jmp    L302
  nopl   (%rax)
L109:
  movsbl 0x1(%r12),%edi
  add    $0x1,%r12
  test   %dil,%dil
  je     L348
L91:
  call   <isdigit@plt>
  test   %rax,%rax
  je     L109
  jmp    L348
  nopl   0x0(%rax,%rax,1)
L4:
  lea    0x1(%rax),%rcx
  mov    %rcx,0x8(%rsp)
  movsbl (%rax),%r14d
  mov    %r14d,%eax
  cmp    %rdx,%r12
  je     L144
  lea    0x1(%rdx),%rcx
  mov    %rcx,(%rsp)
  movsbl (%rdx),%r13d
  or     %r13b,%al
  je     L85
  test   %r14d,%r14d
  je     L153
  mov    %r14d,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  je     L256
L151:
  test   %r13d,%r13d
  je     L83
  mov    %r13d,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  je     L275
L201:
  cmp    %r14d,%r13d
  jne    L43
L348:
  mov    (%rsp),%rdx
L302:
  mov    0x8(%rsp),%rax
  cmp    %rbx,%rax
  jne    L4
  cmp    %rdx,%r12
  je     L85
  lea    0x1(%rdx),%rax
  mov    %rax,(%rsp)
  movsbl (%rdx),%r13d
  test   %r13d,%r13d
  je     L85
L323:
  mov    %r13d,%edi
  call   <isalpha@plt>
  mov    %eax,%r14d
  test   %eax,%eax
  jne    L64
L275:
  add    $0x100,%r13d
  jmp    L201
  nopl   0x0(%rax)
L144:
  test   %r14d,%r14d
  je     L85
  mov    %r14d,%edi
  call   <isalpha@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  jne    L83
L256:
  add    $0x100,%r14d
  jmp    L151
  nopl   0x0(%rax,%rax,1)
L153:
  test   %r13d,%r13d
  je     L348
  jmp    L323
  nopw   0x0(%rax,%rax,1)
L85:
  mov    %rbx,0x8(%rsp)
  mov    %r12,(%rsp)
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  mov    %rax,%r14
  test   %rax,%rax
  jne    L267
  movsbl (%r12),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L264
L69:
  mov    (%rsp),%rdi
  mov    $0xa,%edx
  mov    %rbp,%rsi
  call   <strtol@plt>
L273:
  cmp    %r14,%rax
  jne    L173
L264:
  mov    0x8(%rsp),%rbx
  mov    (%rsp),%rax
  movsbl (%rbx),%edi
  movzbl (%rax),%eax
  test   %dil,%dil
  jne    L276
  neg    %al
  sbb    %r14d,%r14d
L83:
  add    $0x10,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L276:
  test   %al,%al
  jne    L84
  mov    $0x1,%r14d
  jmp    L83
L267:
  mov    0x8(%rsp),%rdi
  lea    0x8(%rsp),%rsi
  mov    $0xa,%edx
  call   <strtol@plt>
  movsbl (%r12),%edi
  mov    %rax,%r14
  call   <isdigit@plt>
  test   %rax,%rax
  je     L273
  jmp    L69
  nopl   0x0(%rax,%rax,1)
L154:
  lea    D10(%rip),%rbx
  cmpq   $0x0,(%rsp)
  mov    %rbx,0x8(%rsp)
  jne    L369
L262:
  lea    D10(%rip),%rax
  mov    %rax,(%rsp)
  jmp    L369
L173:
  sub    %eax,%r14d
  jmp    L83
L64:
  xor    %r14d,%r14d
L43:
  sub    %r13d,%r14d
  jmp    L83
```

tool_calls: name: unpack_data
arguments: label: D10
data_type: string

tool: 

assistant: ```c
int ver_compare(const char *value, const char *reference) {
  const char *valptr, *refptr;
  int vc, rc;
  long vl, rl;
  if (!value)
    value = "";
  if (!reference)
    reference = "";
  for (;;) {
    valptr = value;
    while (*valptr && !isdigit((int)*valptr))
      valptr++;
    refptr = reference;
    while (*refptr && !isdigit((int)*refptr))
      refptr++;
    for (;;) {
      vc = (value == valptr) ? 0 : *value++;
      rc = (reference == refptr) ? 0 : *reference++;
      if ((!vc) && (!rc))
        break;
      if (vc && !isalpha(vc))
        vc += 256;
      if (rc && !isalpha(rc))
        rc += 256;
      if (vc != rc)
        return (vc - rc);
    }
    value = valptr;
    reference = refptr;
    vl = rl = 0;
    if (isdigit((int)*valptr))
      vl = strtol(value, (char **)&value, 10);
    if (isdigit((int)*refptr))
      rl = strtol(reference, (char **)&reference, 10);
    if (vl != rl)
      return (vl - rl);
    if ((!*value) && (!*reference))
      return 0;
    if (!*value)
      return -1;
    if (!*reference)
      return 1;
  }
}
```