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

```asm
<strtol>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
L282:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x28(%rbp)
  cmpl   $0x20,-0x28(%rbp)
  je     L282
  cmpl   $0xa,-0x28(%rbp)
  je     L282
  cmpl   $0x9,-0x28(%rbp)
  je     L282
  cmpl   $0x2d,-0x28(%rbp)
  jne    L77
  movl   $0x1,-0x24(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x28(%rbp)
  jmp    L90
L77:
  movl   $0x0,-0x24(%rbp)
  cmpl   $0x2b,-0x28(%rbp)
  jne    L90
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x28(%rbp)
L90:
  cmpl   $0x0,-0x44(%rbp)
  je     L154
  cmpl   $0x10,-0x44(%rbp)
  jne    L70
L154:
  cmpl   $0x30,-0x28(%rbp)
  jne    L70
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L414
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L70
L414:
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x28(%rbp)
  addq   $0x2,-0x18(%rbp)
  movl   $0x10,-0x44(%rbp)
L70:
  cmpl   $0x0,-0x44(%rbp)
  jne    L24
  cmpl   $0x30,-0x28(%rbp)
  jne    L321
  mov    $0x8,%eax
  jmp    L182
L321:
  mov    $0xa,%eax
L182:
  mov    %eax,-0x44(%rbp)
L24:
  cmpl   $0x0,-0x24(%rbp)
  je     L92
  mov    D45(%rip),%rax
  mov    (%rax),%rax
  jmp    L402
L92:
  mov    D38(%rip),%rax
  mov    (%rax),%rax
L402:
  mov    %rax,-0x8(%rbp)
  mov    -0x44(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x8(%rbp),%rax
  cqto
  idiv   %rcx
  mov    %rdx,%rax
  mov    %eax,-0x1c(%rbp)
  mov    -0x44(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x8(%rbp),%rax
  cqto
  idiv   %rsi
  mov    %rax,-0x8(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L218
  cmpl   $0x0,-0x1c(%rbp)
  jle    L401
  mov    -0x44(%rbp),%eax
  sub    %eax,-0x1c(%rbp)
  addq   $0x1,-0x8(%rbp)
L401:
  negl   -0x1c(%rbp)
L218:
  movq   $0x0,-0x10(%rbp)
  movl   $0x0,-0x20(%rbp)
L371:
  cmpl   $0x2f,-0x28(%rbp)
  jle    L161
  cmpl   $0x39,-0x28(%rbp)
  jg     L161
  subl   $0x30,-0x28(%rbp)
  jmp    L392
L161:
  cmpl   $0x60,-0x28(%rbp)
  jle    L201
  cmpl   $0x7a,-0x28(%rbp)
  jle    L308
L201:
  cmpl   $0x40,-0x28(%rbp)
  jle    L123
  cmpl   $0x5a,-0x28(%rbp)
  jg     L123
L308:
  cmpl   $0x40,-0x28(%rbp)
  jle    L106
  cmpl   $0x5a,-0x28(%rbp)
  jg     L106
  mov    $0x37,%eax
  jmp    L169
L106:
  mov    $0x57,%eax
L169:
  sub    %eax,-0x28(%rbp)
L392:
  mov    -0x28(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jge    L164
  cmpl   $0x0,-0x20(%rbp)
  js     L390
  cmpl   $0x0,-0x24(%rbp)
  je     L63
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jl     L435
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jne    L284
  mov    -0x28(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L284
L435:
  movl   $0xffffffff,-0x20(%rbp)
  mov    D45(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,-0x10(%rbp)
  mov    D10(%rip),%rax
  mov    (%rax),%edx
  mov    D26(%rip),%rax
  mov    %edx,(%rax)
  jmp    L30
L284:
  movl   $0x1,-0x20(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  mov    -0x10(%rbp),%rdx
  imul   %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  sub    %rax,-0x10(%rbp)
  jmp    L30
L63:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jg     L66
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jne    L415
  mov    -0x28(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L415
L66:
  movl   $0xffffffff,-0x20(%rbp)
  mov    D38(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,-0x10(%rbp)
  mov    D10(%rip),%rax
  mov    (%rax),%edx
  mov    D26(%rip),%rax
  mov    %edx,(%rax)
  jmp    L30
L415:
  movl   $0x1,-0x20(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  mov    -0x10(%rbp),%rdx
  imul   %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  add    %rax,-0x10(%rbp)
  jmp    L30
L390:
  nop
L30:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x28(%rbp)
  jmp    L371
L164:
  nop
L123:
  cmpq   $0x0,-0x40(%rbp)
  je     L14
  cmpl   $0x0,-0x20(%rbp)
  je     L264
  mov    -0x18(%rbp),%rax
  sub    $0x1,%rax
  jmp    L3
L264:
  mov    -0x38(%rbp),%rax
L3:
  mov    -0x40(%rbp),%rdx
  mov    %rax,(%rdx)
L14:
  mov    -0x10(%rbp),%rax
  leave
  ret
```

assistant: ```c
long int strtol(const char *nptr, char **endptr, int base) {
  const char *s;
  long acc, cutoff;
  int c;
  int neg, any, cutlim;
  assert(nptr != NULL);
  s = nptr;
  do {
    c = (unsigned char)*s++;
  } while (((c == ' ') || (c == '\n') || (c == '\t')));
  if (c == '-') {
    neg = 1;
    c = *s++;
  } else {
    neg = 0;
    if (c == '+')
      c = *s++;
  }
  if ((base == 0 || base == 16) && c == '0' && (*s == 'x' || *s == 'X')) {
    c = s[1];
    s += 2;
    base = 16;
  }
  if (base == 0)
    base = c == '0' ? 8 : 10;
  cutoff = neg ? LONG_MIN : LONG_MAX;
  cutlim = (int)(cutoff % base);
  cutoff /= base;
  if (neg) {
    if (cutlim > 0) {
      cutlim -= base;
      cutoff += 1;
    }
    cutlim = -cutlim;
  }
  for (acc = 0, any = 0;; c = (unsigned char)*s++) {
    if ((c >= '0' && c <= '9'))
      c -= '0';
    else if ((((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))))
      c -= ((c >= 'A') && (c <= 'Z')) ? 'A' - 10 : 'a' - 10;
    else
      break;
    if (c >= base)
      break;
    if (any < 0)
      continue;
    if (neg) {
      if (acc < cutoff || (acc == cutoff && c > cutlim)) {
        any = -1;
        acc = LONG_MIN;
        errno = ERANGE;
      } else {
        any = 1;
        acc *= base;
        acc -= c;
      }
    } else {
      if (acc > cutoff || (acc == cutoff && c > cutlim)) {
        any = -1;
        acc = LONG_MAX;
        errno = ERANGE;
      } else {
        any = 1;
        acc *= base;
        acc += c;
      }
    }
  }
  if (endptr != 0)
    *endptr = (char *)(any ? s - 1 : nptr);
  return (acc);
}
```