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

```asm
<strtol>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %edx,-0x64(%rbp)
  cmpl   $0x0,-0x64(%rbp)
  js     L205
  cmpl   $0x1,-0x64(%rbp)
  je     L205
  cmpl   $0x24,-0x64(%rbp)
  jle    L79
L205:
  movl   $0xa,-0x64(%rbp)
L79:
  mov    -0x58(%rbp),%rbx
  mov    %rbx,-0x40(%rbp)
  jmp    L304
L312:
  add    $0x1,%rbx
L304:
  movzbl (%rbx),%eax
  cmp    $0x20,%al
  ja     L403
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L312
L403:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L464
  movzbl (%rbx),%eax
  cmp    $0x2d,%al
  jne    L177
  movl   $0x1,-0x48(%rbp)
  add    $0x1,%rbx
  jmp    L385
L177:
  movzbl (%rbx),%eax
  cmp    $0x2b,%al
  jne    L217
  movl   $0x0,-0x48(%rbp)
  add    $0x1,%rbx
  jmp    L385
L217:
  movl   $0x0,-0x48(%rbp)
L385:
  cmpl   $0x10,-0x64(%rbp)
  jne    L19
  movzbl (%rbx),%eax
  cmp    $0x30,%al
  jne    L19
  lea    0x1(%rbx),%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  je     L274
L19:
  lea    0x1(%rbx),%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  jne    L283
L274:
  add    $0x2,%rbx
L283:
  cmpl   $0x0,-0x64(%rbp)
  jne    L328
  movzbl (%rbx),%eax
  cmp    $0x30,%al
  jne    L210
  lea    0x1(%rbx),%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  je     L375
  lea    0x1(%rbx),%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  jne    L136
L375:
  add    $0x2,%rbx
  movl   $0x10,-0x64(%rbp)
  jmp    L328
L136:
  movl   $0x8,-0x64(%rbp)
  jmp    L328
L210:
  movl   $0xa,-0x64(%rbp)
L328:
  mov    %rbx,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  mov    -0x64(%rbp),%esi
  mov    $0x7fffffff,%eax
  mov    $0x0,%edx
  div    %esi
  mov    %eax,%r14d
  mov    -0x64(%rbp),%ecx
  mov    $0x7fffffff,%eax
  mov    $0x0,%edx
  div    %ecx
  mov    %edx,%r15d
  movl   $0x0,-0x44(%rbp)
  mov    $0x0,%r13d
  movzbl (%rbx),%eax
  mov    %eax,%r12d
  jmp    L105
L178:
  cmp    -0x38(%rbp),%rbx
  je     L466
  cmp    $0x2f,%r12b
  jbe    L292
  cmp    $0x39,%r12b
  ja     L292
  sub    $0x30,%r12d
  jmp    L272
L292:
  cmp    $0x40,%r12b
  jbe    L78
  cmp    $0x5a,%r12b
  ja     L78
  sub    $0x37,%r12d
  jmp    L272
L78:
  cmp    $0x60,%r12b
  jbe    L369
  cmp    $0x7a,%r12b
  ja     L369
  sub    $0x57,%r12d
L272:
  movzbl %r12b,%eax
  cmp    %eax,-0x64(%rbp)
  jle    L404
  cmp    %r14d,%r13d
  ja     L287
  cmp    %r14d,%r13d
  jne    L338
  movzbl %r12b,%eax
  cmp    %eax,%r15d
  jae    L338
L287:
  movl   $0x1,-0x44(%rbp)
  jmp    L197
L338:
  mov    -0x64(%rbp),%eax
  imul   %eax,%r13d
  movzbl %r12b,%eax
  add    %eax,%r13d
L197:
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  mov    %eax,%r12d
L105:
  test   %r12b,%r12b
  jne    L178
  jmp    L369
L466:
  nop
  jmp    L369
L404:
  nop
L369:
  cmp    -0x40(%rbp),%rbx
  je     L303
  cmpq   $0x0,-0x60(%rbp)
  je     L337
  mov    -0x60(%rbp),%rax
  mov    %rbx,(%rax)
L337:
  cmpl   $0x0,-0x44(%rbp)
  je     L387
  cmpl   $0x0,-0x48(%rbp)
  je     L492
  mov    $0x80000000,%eax
  jmp    L17
L492:
  mov    $0x7fffffff,%eax
  jmp    L17
L387:
  cmpl   $0x0,-0x48(%rbp)
  je     L137
  mov    %r13d,%eax
  neg    %eax
  jmp    L17
L137:
  mov    %r13d,%eax
  jmp    L17
L464:
  nop
  jmp    L396
L303:
  nop
L396:
  cmpq   $0x0,-0x60(%rbp)
  je     L280
  mov    -0x40(%rbp),%rax
  sub    -0x58(%rbp),%rax
  cmp    $0x1,%rax
  jle    L190
  mov    -0x40(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <__tolower@plt>
  cmp    $0x78,%eax
  jne    L190
  mov    -0x40(%rbp),%rax
  sub    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L190
  mov    -0x40(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x60(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L280
L190:
  mov    -0x60(%rbp),%rax
  mov    -0x58(%rbp),%rdx
  mov    %rdx,(%rax)
L280:
  mov    $0x0,%eax
L17:
  add    $0x48,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

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;
}
```