user: What would the C source look like for the assembly code provided here:

```asm
<strtol>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x24(%rbp)
  movq   $0x0,-0x10(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x2c(%rbp)
L371:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0xd,%eax
  jg     L114
  cmp    $0x9,%eax
  jge    L226
  jmp    L32
L114:
  cmp    $0x20,%eax
  jne    L32
L226:
  nop
  addq   $0x1,-0x18(%rbp)
  jmp    L371
L32:
  nop
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L281
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L408
L281:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L408
  movl   $0x1,-0x24(%rbp)
L408:
  cmpl   $0x0,-0x44(%rbp)
  jne    L46
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  je     L171
  movl   $0xa,-0x44(%rbp)
  jmp    L194
L171:
  movl   $0x8,-0x44(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L157
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L194
L157:
  addq   $0x2,-0x18(%rbp)
  movl   $0x10,-0x44(%rbp)
  jmp    L194
L46:
  cmpl   $0x10,-0x44(%rbp)
  jne    L395
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L395
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L126
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L167
L126:
  addq   $0x2,-0x18(%rbp)
  jmp    L167
L395:
  cmpl   $0x0,-0x44(%rbp)
  js     L75
  cmpl   $0x24,-0x44(%rbp)
  jg     L75
  jmp    L194
L167:
  nop
L194:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  cmpl   $0x2f,-0x1c(%rbp)
  jle    L407
  cmpl   $0x39,-0x1c(%rbp)
  jg     L407
  mov    -0x1c(%rbp),%eax
  sub    $0x30,%eax
  mov    %eax,-0x28(%rbp)
  jmp    L265
L407:
  cmpl   $0x60,-0x1c(%rbp)
  jle    L223
  cmpl   $0x7a,-0x1c(%rbp)
  jg     L223
  mov    -0x1c(%rbp),%eax
  sub    $0x57,%eax
  mov    %eax,-0x28(%rbp)
  jmp    L265
L223:
  cmpl   $0x40,-0x1c(%rbp)
  jle    L265
  cmpl   $0x5a,-0x1c(%rbp)
  jg     L265
  mov    -0x1c(%rbp),%eax
  sub    $0x37,%eax
  mov    %eax,-0x28(%rbp)
L265:
  mov    -0x28(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jge    L165
  mov    -0x44(%rbp),%eax
  cltq
  imul   -0x10(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%eax
  cltq
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jge    L166
  movl   $0x1,-0x2c(%rbp)
L166:
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  addq   $0x1,-0x18(%rbp)
  addl   $0x1,-0x20(%rbp)
  jmp    L194
L75:
  nop
  jmp    L322
L165:
  nop
L322:
  cmpl   $0x0,-0x20(%rbp)
  jne    L313
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
L313:
  cmpq   $0x0,-0x40(%rbp)
  je     L410
  mov    -0x40(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
L410:
  cmpl   $0x0,-0x2c(%rbp)
  je     L216
  mov    D31(%rip),%rax
  mov    (%rax),%edx
  mov    D15(%rip),%rax
  mov    %edx,(%rax)
  cmpl   $0x0,-0x24(%rbp)
  je     L218
  mov    D27(%rip),%rax
  mov    (%rax),%rax
  jmp    L11
L218:
  mov    D14(%rip),%rax
  mov    (%rax),%rax
  jmp    L11
L216:
  cmpl   $0x0,-0x24(%rbp)
  je     L100
  mov    -0x10(%rbp),%rax
  neg    %rax
  jmp    L11
L100:
  mov    -0x10(%rbp),%rax
L11:
  pop    %rbp
  ret
```

assistant: ```c
long strtol(const char *nptr, char **endptr, int base) {
  const char *p;
  long n, nn;
  int c, ovfl, v, neg, ndig;
  p = nptr;
  neg = 0;
  n = 0;
  ndig = 0;
  ovfl = 0;
  for (;; p++) {
    switch (*p) {
    case ' ':
    case '\t':
    case '\n':
    case '\f':
    case '\r':
    case '\v':
      continue;
    }
    break;
  }
  if (*p == '-' || *p == '+')
    if (*p++ == '-')
      neg = 1;
  if (base == 0) {
    if (*p != '0')
      base = 10;
    else {
      base = 8;
      if (p[1] == 'x' || p[1] == 'X') {
        p += 2;
        base = 16;
      }
    }
  } else if (base == 16 && *p == '0') {
    if (p[1] == 'x' || p[1] == 'X')
      p += 2;
  } else if (base < 0 || 36 < base)
    goto Return;
  for (;; p++, ndig++) {
    c = *p;
    v = base;
    if ('0' <= c && c <= '9')
      v = c - '0';
    else if ('a' <= c && c <= 'z')
      v = c - 'a' + 10;
    else if ('A' <= c && c <= 'Z')
      v = c - 'A' + 10;
    if (v >= base)
      break;
    nn = n * base + v;
    if (nn < n)
      ovfl = 1;
    n = nn;
  }
Return:
  if (ndig == 0)
    p = nptr;
  if (endptr)
    *endptr = (char *)p;
  if (ovfl) {
    errno = ERANGE;
    if (neg)
      return LONG_MIN;
    return LONG_MAX;
  }
  if (neg)
    return -n;
  return n;
}
```