user: 请将以下的汇编代码转换成C语言代码：

```asm
<alphanum_cmp>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%r12
  movzbl (%rdi),%eax
  test   %al,%al
  je     L281
  mov    %rdi,%rbp
  mov    $0x0,%r15d
  jmp    L249
L228:
  movzbl 0x0(%rbp),%r13d
  test   %r13b,%r13b
  jne    L133
  mov    $0xffffffff,%eax
  jmp    L231
L26:
  test   %r14d,%r14d
  jne    L59
  test   %eax,%eax
  jne    L257
  mov    %r13d,%edi
  call   <toupper@plt>
  mov    %eax,%r13d
  mov    %ebx,%edi
  call   <toupper@plt>
  mov    %eax,%edx
  movsbl %r13b,%eax
  movsbl %dl,%edx
  sub    %edx,%eax
  jne    L231
  add    $0x1,%rbp
  add    $0x1,%r12
  movzbl 0x0(%rbp),%r13d
  test   %r13b,%r13b
  je     L281
  movzbl (%r12),%ebx
  test   %bl,%bl
  je     L246
L133:
  movsbl %r13b,%r13d
  mov    %r13d,%edi
  call   <alphanum_isdigit@plt>
  mov    %eax,%r14d
  movsbl %bl,%ebx
  mov    %ebx,%edi
  call   <alphanum_isdigit@plt>
  test   %r14d,%r14d
  je     L26
  test   %eax,%eax
  je     L26
  mov    $0x1,%r15d
  jmp    L246
L275:
  movzbl (%r12),%ebx
  test   %bl,%bl
  je     L65
L273:
  mov    $0x0,%r14d
L44:
  movsbl %bl,%edi
  call   <alphanum_isdigit@plt>
  test   %eax,%eax
  je     L85
  lea    (%r14,%r14,4),%rdx
  movsbq (%r12),%rax
  lea    -0x30(%rax,%rdx,2),%r14
  add    $0x1,%r12
  movzbl (%r12),%ebx
  test   %bl,%bl
  jne    L44
L85:
  sub    %r14,%r13
  jne    L102
  mov    $0x0,%r15d
L246:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L281
L249:
  movzbl (%r12),%ebx
  test   %bl,%bl
  je     L131
  test   %r15d,%r15d
  je     L228
  movzbl 0x0(%rbp),%edi
  mov    $0x0,%r13d
  test   %dil,%dil
  je     L273
L278:
  movsbl %dil,%edi
  call   <alphanum_isdigit@plt>
  test   %eax,%eax
  je     L275
  lea    0x0(%r13,%r13,4),%rdx
  movsbq 0x0(%rbp),%rax
  lea    -0x30(%rax,%rdx,2),%r13
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  jne    L278
  jmp    L275
L65:
  mov    $0x0,%r14d
  jmp    L85
L102:
  mov    %r13d,%eax
  jmp    L231
L281:
  movzbl (%r12),%eax
  test   %al,%al
  jne    L256
L131:
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  jmp    L231
L59:
  mov    $0xffffffff,%eax
L231:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L257:
  mov    $0x1,%eax
  jmp    L231
L256:
  mov    $0xffffffff,%eax
  jmp    L231
```

assistant: ```c
int alphanum_cmp(const char *l, const char *r) {
  enum mode_t { STRING, NUMBER } mode = STRING;
  while (*l && *r) {
    if (mode == STRING) {
      char l_char, r_char;
      while ((l_char = *l) && (r_char = *r)) {
        const int l_digit = alphanum_isdigit(l_char);
        const int r_digit = alphanum_isdigit(r_char);
        if (l_digit && r_digit) {
          mode = NUMBER;
          break;
        }
        if (l_digit)
          return -1;
        if (r_digit)
          return +1;
        l_char = toupper(l_char);
        r_char = toupper(r_char);
        const int diff = l_char - r_char;
        if (diff != 0)
          return diff;
        ++l;
        ++r;
      }
    } else {
      unsigned long l_int = 0;
      while (*l && alphanum_isdigit(*l)) {
        l_int = l_int * 10 + *l - '0';
        ++l;
      }
      unsigned long r_int = 0;
      while (*r && alphanum_isdigit(*r)) {
        r_int = r_int * 10 + *r - '0';
        ++r;
      }
      const long diff = l_int - r_int;
      if (diff != 0)
        return diff;
      mode = STRING;
    }
  }
  if (*r)
    return -1;
  if (*l)
    return +1;
  return 0;
}
```