user: Demonstrate the C code that generates the assembly output below:

```asm
<strtol>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x28(%rsp)
  mov    %rsi,0x20(%rsp)
  mov    %edx,%r15d
  mov    %rdi,%rbp
L81:
  mov    %rbp,%r12
  add    $0x1,%rbp
  movzbl -0x1(%rbp),%ebx
  movzbl %bl,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L81
  cmp    $0x2d,%bl
  je     L162
  movl   $0x0,0x1c(%rsp)
  cmp    $0x2b,%bl
  je     L209
L14:
  test   $0xffffffef,%r15d
  jne    L102
  cmp    $0x30,%bl
  je     L223
L102:
  test   %r15d,%r15d
  jne    L269
  cmp    $0x30,%bl
  setne  %r15b
  movzbl %r15b,%r15d
  lea    0x8(%r15,%r15,1),%r15d
L269:
  cmpl   $0x0,0x1c(%rsp)
  je     L202
  mov    D1(%rip),%rax
  mov    (%rax),%rax
  neg    %rax
L142:
  movslq %r15d,%rdx
  mov    %rdx,0x10(%rsp)
  mov    %rdx,%rsi
  mov    $0x0,%edx
  div    %rsi
  mov    %rax,0x8(%rsp)
  mov    %edx,0x18(%rsp)
  mov    $0x0,%r14d
  mov    $0x0,%r13d
  jmp    L157
L162:
  movzbl 0x0(%rbp),%ebx
  lea    0x2(%r12),%rbp
  movl   $0x1,0x1c(%rsp)
  jmp    L14
L209:
  movzbl 0x0(%rbp),%ebx
  lea    0x2(%r12),%rbp
  jmp    L14
L223:
  movzbl 0x0(%rbp),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L82
  movzbl 0x1(%rbp),%ebx
  add    $0x2,%rbp
  mov    $0x10,%r15d
  jmp    L269
L82:
  mov    $0x30,%ebx
  jmp    L102
L202:
  mov    D8(%rip),%rax
  mov    (%rax),%rax
  jmp    L142
L248:
  mov    %r12d,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L12
  mov    %r12d,%edi
  call   <isupper@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0x20,%eax
  add    $0x37,%eax
  sub    %eax,%ebx
  jmp    L199
L289:
  imul   0x10(%rsp),%r13
  movzbl %bl,%ebx
  add    %rbx,%r13
  mov    $0x1,%r14d
L179:
  add    $0x1,%rbp
  movzbl -0x1(%rbp),%ebx
L157:
  movzbl %bl,%r12d
  mov    %r12d,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L248
  sub    $0x30,%ebx
L199:
  movzbl %bl,%eax
  cmp    %r15d,%eax
  jge    L12
  test   %r14d,%r14d
  js     L179
  mov    $0xffffffff,%r14d
  mov    0x8(%rsp),%rcx
  cmp    %rcx,%r13
  ja     L179
  cmp    0x18(%rsp),%eax
  jle    L289
  cmp    %rcx,%r13
  jne    L289
  jmp    L179
L12:
  test   %r14d,%r14d
  js     L59
  mov    %r13,%rax
  neg    %rax
  cmpl   $0x0,0x1c(%rsp)
  cmovne %rax,%r13
  cmpq   $0x0,0x20(%rsp)
  je     L118
  test   %r14d,%r14d
  jne    L183
L50:
  mov    0x20(%rsp),%rax
  mov    0x28(%rsp),%rdx
  mov    %rdx,(%rax)
L118:
  mov    %r13,%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L59:
  cmpl   $0x0,0x1c(%rsp)
  je     L1
  mov    D1(%rip),%rax
  mov    (%rax),%r13
L251:
  cmpq   $0x0,0x20(%rsp)
  je     L118
L183:
  lea    -0x1(%rbp),%rax
  mov    %rax,0x28(%rsp)
  jmp    L50
L1:
  mov    D8(%rip),%rax
  mov    (%rax),%r13
  jmp    L251
```

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