user: 请从给定的汇编指令推导出C源代码:

```asm
<strtol>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rsi,0x20(%rsp)
  cmp    $0x1,%edx
  je     L301
  mov    %edx,%ebx
  cmp    $0x24,%edx
  jbe    L73
L301:
  mov    $0xa,%ebx
L73:
  mov    0x18(%rsp),%r12
  jmp    L199
L30:
  add    $0x1,%r12
L199:
  movsbl (%r12),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L30
  mov    %rax,%rbp
  movzbl (%r12),%eax
  test   %al,%al
  je     L138
  cmp    $0x2d,%al
  je     L251
  movl   $0x0,0x2c(%rsp)
  cmp    $0x2b,%al
  je     L99
L70:
  cmp    $0x10,%ebx
  je     L110
  test   %ebx,%ebx
  jne    L11
  mov    $0xa,%ebx
  cmpb   $0x30,(%r12)
  je     L272
L11:
  mov    D62(%rip),%rax
  mov    (%rax),%rax
  mov    %ebx,%r15d
  movslq %ebx,%rcx
  mov    %rcx,0x10(%rsp)
  mov    $0x0,%edx
  div    %rcx
  mov    %edx,0x28(%rsp)
  movzbl (%r12),%ebx
  test   %bl,%bl
  je     L138
  mov    %r12,%r14
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%r13d
  mov    %r12,0x30(%rsp)
  mov    %rbp,0x38(%rsp)
  mov    %rax,%r12
  jmp    L77
L251:
  add    $0x1,%r12
  movl   $0x1,0x2c(%rsp)
  jmp    L70
L99:
  add    $0x1,%r12
  jmp    L70
L110:
  cmpb   $0x30,(%r12)
  jne    L11
  movsbl 0x1(%r12),%edi
  call   <toupper@plt>
  mov    %eax,%edx
  lea    0x2(%r12),%rax
  cmp    $0x58,%dl
  cmove  %rax,%r12
  jmp    L11
L272:
  movsbl 0x1(%r12),%edi
  call   <toupper@plt>
  mov    $0x8,%ebx
  cmp    $0x58,%al
  jne    L11
  add    $0x2,%r12
  mov    $0x10,%ebx
  jmp    L11
L97:
  mov    %ebp,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L381
  movsbl %bl,%edi
  call   <toupper@plt>
  lea    -0x37(%rax),%ebx
  jmp    L128
L187:
  cmp    0x28(%rsp),%eax
  jbe    L246
  movl   $0x1,0xc(%rsp)
  jmp    L34
L365:
  movl   $0x1,0xc(%rsp)
L34:
  add    $0x1,%r14
  movzbl (%r14),%ebx
  test   %bl,%bl
  je     L381
L77:
  movzbl %bl,%ebp
  mov    %ebp,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L97
  sub    $0x30,%ebx
L128:
  movzbl %bl,%eax
  cmp    %r15d,%eax
  jge    L381
  cmp    %r13,%r12
  jb     L365
  je     L187
L246:
  imul   0x10(%rsp),%r13
  movzbl %bl,%ebx
  add    %rbx,%r13
  jmp    L34
L381:
  mov    0x30(%rsp),%r12
  mov    0x38(%rsp),%rbp
  cmp    %r14,%r12
  je     L138
  mov    0x20(%rsp),%rax
  test   %rax,%rax
  je     L43
  mov    %r14,(%rax)
L43:
  cmpl   $0x0,0x2c(%rsp)
  je     L74
  mov    D14(%rip),%rax
  mov    (%rax),%rbp
  mov    %rbp,%rax
  neg    %rax
  cmp    %r13,%rax
  jb     L353
  cmpl   $0x0,0xc(%rsp)
  jne    L353
  mov    %r13,%rbp
  neg    %rbp
  jmp    L218
L74:
  mov    D31(%rip),%rax
  mov    (%rax),%rbp
  cmpl   $0x0,0xc(%rsp)
  jne    L230
  cmp    %r13,%rbp
  jb     L230
  mov    %r13,%rbp
  jmp    L218
L138:
  mov    0x20(%rsp),%rax
  test   %rax,%rax
  je     L218
  mov    0x18(%rsp),%rsi
  mov    %rsi,(%rax)
L218:
  mov    %rbp,%rax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L353:
  mov    D51(%rip),%rax
  mov    (%rax),%edx
  mov    D59(%rip),%rax
  mov    %edx,(%rax)
  jmp    L218
L230:
  mov    D51(%rip),%rax
  mov    (%rax),%edx
  mov    D59(%rip),%rax
  mov    %edx,(%rax)
  jmp    L218
```

assistant: ```c
long int strtol(const char *nptr, char **endptr, int base) {
  int negative;
  register unsigned long int cutoff;
  register unsigned int cutlim;
  register unsigned long int i;
  register const char *s;
  register unsigned char c;
  const char *save;
  int overflow;
  if (base < 0 || base == 1 || base > 36)
    base = 10;
  s = nptr;
  while (isspace(*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' && toupper(s[1]) == 'X')
    s += 2;
  if (base == 0)
    if (*s == '0') {
      if (toupper(s[1]) == 'X') {
        s += 2;
        base = 16;
      } else
        base = 8;
    } else
      base = 10;
  save = s;
  cutoff = ULONG_MAX / (unsigned long int)base;
  cutlim = ULONG_MAX % (unsigned long int)base;
  overflow = 0;
  i = 0;
  for (c = *s; c != '\0'; c = *++s) {
    if (isdigit(c))
      c -= '0';
    else if (isalpha(c))
      c = toupper(c) - 'A' + 10;
    else
      break;
    if (c >= base)
      break;
    if (i > cutoff || (i == cutoff && c > cutlim))
      overflow = 1;
    else {
      i *= (unsigned long int)base;
      i += c;
    }
  }
  if (s == save)
    goto noconv;
  if (endptr != NULL)
    *endptr = (char *)s;
  if (i > (negative ? -(unsigned long int)LONG_MIN : (unsigned long int)LONG_MAX))
    overflow = 1;
  if (overflow) {
    errno = ERANGE;
    return negative ? LONG_MIN : LONG_MAX;
  }
  return (negative ? -i : i);
noconv:
  if (endptr != NULL)
    *endptr = (char *)nptr;
  return 0L;
}
```