user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<strtol>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r12
  cmp    $0x1,%edx
  je     L248
  mov    %edx,%r9d
  cmp    $0x24,%edx
  jbe    L235
L248:
  mov    $0xa,%r9d
L235:
  movzbl 0x0(%rbp),%eax
  lea    -0x1(%rax),%edx
  cmp    $0x1f,%dl
  ja     L174
  mov    %rbp,%rbx
L176:
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  lea    -0x1(%rax),%edx
  cmp    $0x1f,%dl
  jbe    L176
L399:
  test   %al,%al
  je     L187
  cmp    $0x2d,%al
  je     L200
  mov    $0x0,%r11d
  cmp    $0x2b,%al
  je     L341
L12:
  cmp    $0x10,%r9d
  je     L413
  cmpb   $0x78,0x1(%rbx)
  je     L188
L425:
  test   %r9d,%r9d
  jne    L258
  mov    $0xa,%r9d
  cmpb   $0x30,(%rbx)
  je     L41
L258:
  mov    %r9d,%r13d
  mov    $0x7fffffff,%eax
  mov    $0x0,%edx
  div    %r9d
  movzbl (%rbx),%esi
  test   %sil,%sil
  je     L330
L149:
  mov    %rbx,%r8
  mov    $0x0,%r10d
  mov    $0x0,%edi
  mov    $0x1,%r14d
  jmp    L182
L174:
  mov    %rbp,%rbx
  jmp    L399
L200:
  add    $0x1,%rbx
  mov    $0x1,%r11d
  jmp    L12
L341:
  add    $0x1,%rbx
  jmp    L12
L413:
  cmpb   $0x30,(%rbx)
  je     L54
L306:
  cmpb   $0x78,0x1(%rbx)
  jne    L258
L188:
  add    $0x2,%rbx
  jmp    L425
L54:
  cmpb   $0x58,0x1(%rbx)
  jne    L306
  jmp    L188
L41:
  movzbl 0x1(%rbx),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L95
  add    $0x2,%rbx
  mov    $0x10,%r9d
  jmp    L258
L95:
  mov    $0x7,%edx
  mov    $0xfffffff,%eax
  mov    $0x8,%r9d
  mov    $0x8,%r13d
  mov    $0x30,%esi
  jmp    L149
L50:
  lea    -0x61(%rsi),%ecx
  cmp    $0x19,%cl
  ja     L223
  lea    -0x57(%rsi),%ecx
  jmp    L344
L391:
  cmp    %edx,%esi
  jbe    L128
  mov    %r14d,%r10d
  jmp    L270
L234:
  mov    %r14d,%r10d
L270:
  add    $0x1,%r8
  movzbl (%r8),%esi
  test   %sil,%sil
  je     L223
L182:
  lea    -0x30(%rsi),%ecx
  cmp    $0x9,%cl
  jbe    L344
  lea    -0x41(%rsi),%ecx
  cmp    $0x19,%cl
  ja     L50
  lea    -0x37(%rsi),%ecx
L344:
  movzbl %cl,%esi
  cmp    %r9d,%esi
  jge    L223
  cmp    %eax,%edi
  ja     L234
  je     L391
L128:
  imul   %r13d,%edi
  movzbl %cl,%ecx
  add    %ecx,%edi
  jmp    L270
L223:
  cmp    %rbx,%r8
  je     L330
  test   %r12,%r12
  je     L99
  mov    %r8,(%r12)
L99:
  lea    0x7fffffff(%r11),%eax
  test   %r10d,%r10d
  jne    L324
  mov    %edi,%eax
  neg    %eax
  test   %r11d,%r11d
  cmove  %edi,%eax
L324:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L330:
  test   %r12,%r12
  je     L68
  mov    %rbx,%rax
  sub    %rbp,%rax
  cmp    $0x1,%rax
  jle    L192
  movsbl -0x1(%rbx),%edi
  mov    $0x0,%eax
  call   <__tolower@plt>
  cmp    $0x78,%eax
  jne    L192
  cmpb   $0x30,-0x2(%rbx)
  jne    L192
  sub    $0x1,%rbx
  mov    %rbx,(%r12)
  mov    $0x0,%eax
  jmp    L324
L68:
  mov    $0x0,%eax
  jmp    L324
L187:
  mov    $0x0,%eax
  test   %r12,%r12
  je     L324
L192:
  mov    %rbp,(%r12)
  mov    $0x0,%eax
  jmp    L324
```

assistant: ```c
int strtol(nptr, endptr, base) const char *nptr;
char **endptr;
int base;
{
  int negative;
  register unsigned int cutoff;
  register unsigned int cutlim;
  register unsigned int i;
  register const char *s;
  register unsigned char c;
  const char *save, *end;
  int overflow;
  if (base < 0 || base == 1 || base > 36)
    base = 10;
  save = s = nptr;
  while (((unsigned char)*s) <= 32 && *s)
    ++s;
  if (*s == '\0')
    goto noconv;
  if (*s == '-') {
    negative = 1;
    ++s;
  } else if (*s == '+') {
    negative = 0;
    ++s;
  } else
    negative = 0;
  if ((base == 16 && s[0] == '0' && (s[1] == 'X')) || (s[1] == 'x'))
    s += 2;
  if (base == 0) {
    if (*s == '0') {
      if (s[1] == 'X' || s[1] == 'x') {
        s += 2;
        base = 16;
      } else
        base = 8;
    } else
      base = 10;
  }
  save = s;
  end = 0;
  cutoff = 0x7FFFFFFF / (unsigned int)base;
  cutlim = 0x7FFFFFFF % (unsigned int)base;
  overflow = 0;
  i = 0;
  for (c = *s; c != '\0'; c = *++s) {
    if (s == end)
      break;
    if (c >= '0' && c <= '9')
      c -= '0';
    else if (c >= 'A' && c <= 'Z')
      c = c - 'A' + 10;
    else if (c >= 'a' && c <= 'z')
      c = c - 'a' + 10;
    else
      break;
    if (c >= base)
      break;
    if (i > cutoff || (i == cutoff && c > cutlim))
      overflow = 1;
    else {
      i *= (unsigned int)base;
      i += c;
    }
  }
  if (s == save)
    goto noconv;
  if (endptr)
    *endptr = (char *)s;
  if (overflow)
    return negative ? (int)0x80000000 : (int)0x7FFFFFFF;
  return (negative ? -i : i);
noconv:
  if (endptr) {
    if (save - nptr >= 2 && __tolower(save[-1]) == 'x' && save[-2] == '0')
      *endptr = (char *)&save[-1];
    else
      *endptr = (char *)nptr;
  }
  return 0L;
}
```