user: What is the c source code of the assembly code below?

```asm
<strtoul>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %edx,%ebp
  mov    %r12,%r14
  push   %rbx
  sub    $0x18,%rsp
  test   %rdi,%rdi
  setne  %dil
  mov    %rsi,0x8(%rsp)
  movzbl %dil,%edi
  call   <assert@plt>
  lea    -0x2(%rbp),%eax
  cmp    $0x22,%eax
  seta   %r13b
  test   %ebp,%ebp
  setne  %al
  and    %al,%r13b
  jne    L61
  nopw   0x0(%rax,%rax,1)
L78:
  mov    %r14,%r15
  movzbl (%r14),%edi
  add    $0x1,%r14
  mov    %edi,%ebx
  call   <isspace@plt>
  test   %rax,%rax
  jne    L78
  cmp    $0x2d,%bl
  je     L25
  cmp    $0x2b,%bl
  jne    L88
  movzbl (%r14),%ebx
  lea    0x2(%r15),%r14
  test   $0xffffffef,%ebp
  je     L31
  nopl   (%rax)
L320:
  movslq %ebp,%r9
L116:
  mov    D36(%rip),%rax
  xor    %edx,%edx
  xor    %esi,%esi
  mov    (%rax),%r8
  mov    %r8,%rax
  div    %r9
  mov    %rax,%rdi
  mov    D39(%rip),%rax
  mov    (%rax),%r10d
  xor    %eax,%eax
  jmp    L218
  nopl   0x0(%rax,%rax,1)
L55:
  sub    $0x30,%ebx
L60:
  cmp    %ebx,%ebp
  jle    L89
L313:
  cmp    $0xffffffff,%esi
  je     L222
  cmp    %rdi,%rax
  ja     L182
  jne    L298
  cmp    %edx,%ebx
  jle    L298
L182:
  mov    D29(%rip),%rax
  mov    $0xffffffff,%esi
  mov    %r10d,(%rax)
  mov    %r8,%rax
L222:
  movzbl (%r14),%ebx
  add    $0x1,%r14
L218:
  lea    -0x30(%rbx),%r11d
  cmp    $0x9,%r11b
  jbe    L55
  lea    -0x61(%rbx),%r11d
  cmp    $0x19,%r11b
  ja     L225
  sub    $0x57,%ebx
  cmp    %ebx,%ebp
  jg     L313
L89:
  test   %esi,%esi
  jle    L33
  test   %r13b,%r13b
  je     L33
  neg    %rax
  cmpq   $0x0,0x8(%rsp)
  je     L273
L221:
  lea    -0x1(%r14),%r12
L314:
  mov    0x8(%rsp),%rcx
L140:
  mov    %r12,(%rcx)
L273:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L25:
  movzbl (%r14),%ebx
  mov    $0x1,%r13d
  lea    0x2(%r15),%r14
L88:
  test   $0xffffffef,%ebp
  jne    L320
L31:
  cmp    $0x30,%bl
  je     L165
  test   %ebp,%ebp
  jne    L320
  mov    $0xa,%r9d
  mov    $0xa,%ebp
  jmp    L116
  nopl   0x0(%rax,%rax,1)
L225:
  lea    -0x41(%rbx),%r11d
  cmp    $0x19,%r11b
  ja     L89
  sub    $0x37,%ebx
  jmp    L60
  cs nopw 0x0(%rax,%rax,1)
L298:
  imul   %r9,%rax
  movslq %ebx,%rbx
  mov    $0x1,%esi
  add    %rbx,%rax
  jmp    L222
  nopl   0x0(%rax)
L61:
  mov    D25(%rip),%rax
  mov    0x8(%rsp),%rcx
  mov    (%rax),%edx
  mov    D29(%rip),%rax
  mov    %edx,(%rax)
  xor    %eax,%eax
  test   %rcx,%rcx
  jne    L140
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L33:
  cmpq   $0x0,0x8(%rsp)
  je     L273
  test   %esi,%esi
  je     L314
  jmp    L221
  nopl   0x0(%rax)
L165:
  movzbl (%r14),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L328
  movzbl 0x1(%r14),%eax
  lea    -0x30(%rax),%edx
  cmp    $0x9,%dl
  ja     L237
L203:
  add    $0x2,%r14
  movzbl %al,%ebx
  mov    $0x10,%r9d
  mov    $0x10,%ebp
  jmp    L116
L237:
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  sub    $0x41,%edx
  cmp    $0x5,%dl
  jbe    L203
L328:
  test   %ebp,%ebp
  jne    L320
  mov    $0x8,%r9d
  mov    $0x8,%ebp
  jmp    L116
```

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