user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<strtol>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x20(%rsp)
  mov    %rsi,0x18(%rsp)
  nopw   0x0(%rax,%rax,1)
L203:
  mov    %r15,%rbp
  movzbl (%r15),%edi
  add    $0x1,%r15
  mov    %edi,%ebx
  call   <isspace@plt>
  test   %rax,%rax
  jne    L203
  mov    %r14d,%eax
  and    $0xffffffef,%eax
  cmp    $0x2d,%bl
  je     L135
  cmp    $0x2b,%bl
  je     L314
  test   %eax,%eax
  je     L186
L293:
  movslq %r14d,%rax
  mov    %rax,0x10(%rsp)
L120:
  mov    D22(%rip),%rax
  movl   $0x0,0x2c(%rsp)
  mov    (%rax),%rax
  jmp    L225
  nopl   0x0(%rax,%rax,1)
L135:
  movzbl (%r15),%ebx
  add    $0x2,%rbp
  test   %eax,%eax
  jne    L242
  mov    %rbp,%r15
  mov    $0x1,%eax
L186:
  cmp    $0x30,%bl
  je     L195
  test   %r14d,%r14d
  jne    L309
  movq   $0xa,0x10(%rsp)
  mov    $0xa,%r14d
L301:
  test   %eax,%eax
  je     L120
L51:
  mov    D24(%rip),%rax
  movl   $0x1,0x2c(%rsp)
  mov    (%rax),%rax
  neg    %rax
L225:
  xor    %edx,%edx
  xor    %ebp,%ebp
  xor    %r12d,%r12d
  divq   0x10(%rsp)
  mov    %rax,0x8(%rsp)
  mov    %edx,0x28(%rsp)
  jmp    L150
  nopl   0x0(%rax)
L176:
  sub    $0x30,%ebx
  movzbl %bl,%eax
  cmp    %r14d,%eax
  jge    L191
L255:
  mov    0x8(%rsp),%rcx
  cmp    %rcx,%r12
  ja     L278
  cmp    $0xffffffff,%ebp
  je     L278
  cmp    0x28(%rsp),%eax
  jle    L109
  mov    $0xffffffff,%ebp
  cmp    %rcx,%r12
  je     L68
L109:
  imul   0x10(%rsp),%r12
  movzbl %bl,%ebx
  mov    $0x1,%ebp
  add    %rbx,%r12
L68:
  movzbl (%r15),%ebx
  add    $0x1,%r15
L150:
  movzbl %bl,%r13d
  mov    %r13d,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L176
  mov    %r13d,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L191
  mov    %r13d,%edi
  call   <isupper@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0x20,%eax
  add    $0x37,%eax
  sub    %eax,%ebx
  movzbl %bl,%eax
  cmp    %r14d,%eax
  jl     L255
L191:
  cmp    $0xffffffff,%ebp
  je     L105
  mov    0x2c(%rsp),%edx
  mov    %r12,%rax
  neg    %rax
  test   %edx,%edx
  cmovne %rax,%r12
  cmpq   $0x0,0x18(%rsp)
  je     L61
  test   %ebp,%ebp
  jne    L86
L46:
  mov    0x18(%rsp),%rax
  mov    0x20(%rsp),%rdx
  mov    %rdx,(%rax)
L61:
  add    $0x38,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L314:
  movzbl (%r15),%ebx
  lea    0x2(%rbp),%r15
  test   %eax,%eax
  je     L186
  jmp    L293
  nopl   (%rax)
L278:
  mov    $0xffffffff,%ebp
  jmp    L68
  nopw   0x0(%rax,%rax,1)
L105:
  mov    0x2c(%rsp),%ecx
  test   %ecx,%ecx
  je     L312
  mov    D24(%rip),%rax
  mov    (%rax),%r12
L286:
  cmpq   $0x0,0x18(%rsp)
  je     L61
L86:
  lea    -0x1(%r15),%rax
  mov    %rax,0x20(%rsp)
  jmp    L46
  nopl   (%rax)
L312:
  mov    D22(%rip),%rax
  mov    (%rax),%r12
  jmp    L286
  nopl   0x0(%rax)
L195:
  movzbl (%r15),%edx
  and    $0xffffffdf,%edx
  cmp    $0x58,%dl
  jne    L196
  movzbl 0x1(%r15),%ebx
  mov    $0x10,%r14d
  add    $0x2,%r15
  movq   $0x10,0x10(%rsp)
  jmp    L301
L196:
  test   %r14d,%r14d
  jne    L309
  movq   $0x8,0x10(%rsp)
  mov    $0x8,%r14d
  jmp    L301
L309:
  movslq %r14d,%rdx
  mov    %rdx,0x10(%rsp)
  jmp    L301
L242:
  movslq %r14d,%rax
  mov    %rbp,%r15
  mov    %rax,0x10(%rsp)
  jmp    L51
```

assistant: ```c
long strtol(const char *nptr, char **endptr, int base) {
  const char *s = nptr;
  unsigned long acc;
  unsigned char c;
  unsigned long cutoff;
  int neg = 0, any, cutlim;
  do {
    c = *s++;
  } while (isspace(c));
  if (c == '-') {
    neg = 1;
    c = *s++;
  } else 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 ? -(unsigned long)LONG_MIN : LONG_MAX;
  cutlim = cutoff % (unsigned long)base;
  cutoff /= (unsigned long)base;
  for (acc = 0, any = 0;; c = *s++) {
    if (isdigit(c)) {
      c -= '0';
    } else if (isalpha(c)) {
      c -= isupper(c) ? 'A' - 10 : 'a' - 10;
    } else {
      break;
    }
    if (c >= base) {
      break;
    }
    if (any < 0) {
      continue;
    }
    if (acc > cutoff || (acc == cutoff && c > cutlim)) {
      any = -1;
    } else {
      any = 1;
      acc *= base;
      acc += c;
    }
  }
  if (any < 0) {
    acc = neg ? LONG_MIN : LONG_MAX;
  } else if (neg) {
    acc = -acc;
  }
  if (endptr != 0) {
    *((const char **)endptr) = any ? s - 1 : nptr;
  }
  return acc;
}
```