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

```asm
<strtoul>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  cmpl   $0x1,-0x24(%rbp)
  je     L201
  cmpl   $0x24,-0x24(%rbp)
  jg     L201
  cmpl   $0x0,-0x24(%rbp)
  jns    L9
L201:
  movl   $0x0,-0x24(%rbp)
  jmp    L9
L184:
  addq   $0x1,-0x18(%rbp)
L9:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L184
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L158
  addq   $0x1,-0x18(%rbp)
  jmp    L4
L158:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L4
  addq   $0x1,-0x18(%rbp)
L4:
  cmpl   $0x0,-0x24(%rbp)
  jne    L110
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L110
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  cmp    $0x58,%eax
  jne    L122
  movl   $0x10,-0x24(%rbp)
  addq   $0x2,-0x18(%rbp)
  jmp    L110
L122:
  movl   $0x8,-0x24(%rbp)
  addq   $0x1,-0x18(%rbp)
L110:
  cmpl   $0x0,-0x24(%rbp)
  jne    L195
  movl   $0xa,-0x24(%rbp)
L195:
  movq   $0x0,-0x8(%rbp)
  jmp    L205
L117:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <islower@plt>
  test   %eax,%eax
  je     L166
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,-0xc(%rbp)
L166:
  cmpl   $0x39,-0xc(%rbp)
  jg     L186
  mov    $0x30,%eax
  jmp    L150
L186:
  mov    $0x37,%eax
L150:
  sub    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jg     L92
  mov    -0x24(%rbp),%eax
  cltq
  imul   -0x8(%rbp),%rax
  mov    %rax,%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  addq   $0x1,-0x18(%rbp)
L205:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xffffff80,%eax
  test   %eax,%eax
  jne    L39
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L117
  jmp    L39
L92:
  nop
L39:
  cmpq   $0x0,-0x20(%rbp)
  je     L216
  mov    -0x20(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
L216:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
unsigned long int strtoul(const char *nptr, char **endptr, int base) {
  unsigned long int number;
  if (base == 1 || base > 36 || base < 0)
    base = 0;
  while (isspace(*nptr))
    nptr++;
  if (*nptr == '-')
    nptr++;
  else if (*nptr == '+')
    nptr++;
  if (base == 0 && *nptr == '0') {
    if (toupper(*(nptr + 1)) == 'X') {
      base = 16;
      nptr += 2;
    } else {
      base = 8;
      nptr++;
    }
  }
  if (base == 0)
    base = 10;
  number = 0;
  while (isascii(*nptr) && isalnum(*nptr)) {
    int ch = *nptr;
    if (islower(ch))
      ch = toupper(ch);
    ch -= (ch <= '9' ? '0' : 'A' - 10);
    if (ch > base)
      break;
    number = (number * base) + ch;
    nptr++;
  }
  if (endptr != ((void *)0))
    *endptr = (char *)nptr;
  return number;
}
```