user: What would the C source look like for the assembly code provided here:

```asm
<alphanum_compare>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %r12,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  movsbl (%rdi),%edi
  test   %dil,%dil
  jne    L118
  jmp    L124
  nopl   (%rax)
L155:
  movsbl 0x1(%rbp),%edi
  add    $0x1,%rbp
  add    $0x1,%rbx
  test   %dil,%dil
  je     L124
L118:
  call   <tolower@plt>
  movsbl (%rbx),%edi
  mov    %eax,%r13d
  call   <tolower@plt>
  cmp    %eax,%r13d
  je     L155
  movsbl 0x0(%rbp),%edi
L124:
  call   <isdigit@plt>
  test   %rax,%rax
  je     L31
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L23
L31:
  movsbl 0x0(%rbp),%edi
  call   <tolower@plt>
  movsbl (%rbx),%edi
  mov    %eax,%r12d
  call   <tolower@plt>
  mov    %eax,%r8d
  mov    %r12d,%eax
  sub    %r8d,%eax
L106:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L23:
  cmp    %rbp,%r12
  jb     L137
  movsbl 0x0(%rbp),%edi
  mov    %rbp,%r15
  mov    %rbx,%r13
L225:
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L159
  add    $0x1,%r15
  add    $0x1,%r13
L159:
  xor    %r14d,%r14d
  xor    %r12d,%r12d
  jmp    L237
  nopl   (%rax)
L75:
  movsbl (%r15,%r14,1),%eax
  lea    (%r12,%r12,4),%ecx
  add    $0x1,%r14
  lea    -0x30(%rax,%rcx,2),%r12d
L237:
  movsbl (%r15,%r14,1),%edi
  mov    %r14d,0x8(%rsp)
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L75
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  jmp    L239
  cs nopw 0x0(%rax,%rax,1)
L56:
  movsbl 0x0(%r13,%r14,1),%eax
  lea    (%r15,%r15,4),%ecx
  add    $0x1,%r14
  lea    -0x30(%rax,%rcx,2),%r15d
L239:
  movsbl 0x0(%r13,%r14,1),%edi
  mov    %r14d,0xc(%rsp)
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L56
  cmpl   $0x8,0x8(%rsp)
  jg     L18
  cmpl   $0x8,0xc(%rsp)
  jg     L18
  cmp    %r15d,%r12d
  setne  %dl
  test   %r15d,%r15d
  setne  %al
  test   %al,%dl
  je     L74
  test   %r12d,%r12d
  je     L74
  mov    %r12d,%eax
  sub    %r15d,%eax
  jmp    L106
  cs nopw 0x0(%rax,%rax,1)
L137:
  cmpb   $0x30,(%rbx)
  mov    %rbp,%r15
  mov    %rbx,%r13
  jne    L60
  jmp    L123
  nopl   (%rax)
L83:
  mov    %rax,%r15
L60:
  movsbl (%r15),%edi
  cmp    $0x30,%dil
  jne    L225
  lea    -0x1(%r15),%rax
  sub    $0x1,%r13
  cmp    %rax,%r12
  jne    L83
  movsbl -0x1(%r15),%edi
  mov    %r12,%r15
  jmp    L225
  nopl   0x0(%rax,%rax,1)
L18:
  mov    0x8(%rsp),%edx
  mov    0xc(%rsp),%esi
  mov    %edx,%eax
  sub    %esi,%eax
  cmp    %esi,%edx
  jne    L106
L74:
  movsbl 0x0(%rbp),%eax
  movsbl (%rbx),%edx
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  sub    %edx,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L123:
  lea    -0x1(%rbp),%r15
  lea    -0x1(%rbx),%r13
  cmp    %r15,%r12
  jb     L60
  movsbl -0x1(%rbp),%edi
  jmp    L225
```

assistant: ```c
int alphanum_compare(const char *t1, const char *s2) {
  int n1, n2, cnt1, cnt2;
  const char *u1, *u2;
  const char *s1 = t1;
  while (*s1 && tolower(*s1) == tolower(*s2)) {
    s1++;
    s2++;
  }
  if (isdigit(*s1) && isdigit(*s2)) {
    u1 = s1;
    u2 = s2;
    n1 = n2 = 0;
    cnt1 = cnt2 = 0;
    if (s1 > t1 && *s2 == '0') {
      s1--;
      s2--;
    }
    while (s1 > t1 && *s1 == '0') {
      s1--;
      s2--;
    }
    if (!isdigit(*s1)) {
      s1++;
      s2++;
    }
    while (isdigit(*s1)) {
      cnt1++;
      n1 = (n1 * 10) + (*s1++ - '0');
    }
    while (isdigit(*s2)) {
      cnt2++;
      n2 = (n2 * 10) + (*s2++ - '0');
    }
    if (cnt1 > 8 || cnt2 > 8) {
      if (cnt1 == cnt2)
        return (*u1 - *u2);
      return (cnt1 - cnt2);
    }
    if (n1 && n2 && n1 != n2)
      return (n1 - n2);
    return (*u1 - *u2);
  }
  return (tolower(*s1) - tolower(*s2));
}
```