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)
  movq   $0x0,-0x8(%rbp)
  movl   $0x0,-0x10(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L91
  cmpl   $0x0,-0x24(%rbp)
  js     L91
  cmpl   $0x24,-0x24(%rbp)
  jg     L91
  jmp    L132
L74:
  addq   $0x1,-0x18(%rbp)
L132:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L74
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x30,%eax
  je     L68
  cmp    $0x30,%eax
  jg     L186
  cmp    $0x2b,%eax
  je     L170
  cmp    $0x2d,%eax
  je     L212
  jmp    L186
L68:
  cmpl   $0x0,-0x24(%rbp)
  jne    L179
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L205
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L16
L205:
  movl   $0x10,-0x24(%rbp)
  addq   $0x2,-0x18(%rbp)
  jmp    L179
L16:
  movl   $0x8,-0x24(%rbp)
  addq   $0x1,-0x18(%rbp)
  jmp    L179
L212:
  movl   $0x1,-0x10(%rbp)
  addq   $0x1,-0x18(%rbp)
  jmp    L142
L170:
  addq   $0x1,-0x18(%rbp)
  jmp    L142
L186:
  nop
  jmp    L142
L179:
  nop
L142:
  cmpl   $0x0,-0x24(%rbp)
  jne    L58
  movl   $0xa,-0x24(%rbp)
  jmp    L58
L10:
  subl   $0x57,-0xc(%rbp)
  cmpl   $0x9,-0xc(%rbp)
  jg     L124
  addl   $0x20,-0xc(%rbp)
  cmpl   $0x9,-0xc(%rbp)
  jg     L124
  addl   $0x7,-0xc(%rbp)
L124:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jge    L217
  cmpl   $0x0,-0x10(%rbp)
  je     L213
  mov    -0x24(%rbp),%eax
  cltq
  imul   -0x8(%rbp),%rax
  mov    -0xc(%rbp),%edx
  movslq %edx,%rdx
  sub    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L141
L213:
  mov    -0x24(%rbp),%eax
  cltq
  imul   -0x8(%rbp),%rax
  mov    %rax,%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
L141:
  addq   $0x1,-0x18(%rbp)
L58:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %rax,%rax
  jne    L10
  jmp    L91
L217:
  nop
L91:
  cmpq   $0x0,-0x20(%rbp)
  je     L257
  mov    -0x20(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
L257:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
unsigned long strtoul(char *str, char **ptr, int base) {
  unsigned long rvalue = 0;
  int neg = 0;
  int c;
  if ((str != 0) && (base >= 0) && (base <= 36)) {
    while (isspace(*str)) {
      ++str;
    }
    switch (str[0]) {
    case '0':
      if (base == 0) {
        if ((str[1] == 'x') || (str[1] == 'X')) {
          base = 16;
          str += 2;
        } else {
          base = 8;
          str++;
        }
      }
      break;
    case '-':
      neg = 1;
      str++;
      break;
    case '+':
      str++;
      break;
    default:
      break;
    }
    if (base == 0)
      base = 10;
    while (isalnum(c = *str)) {
      if ((c -= ('a' - 10)) < 10) {
        if ((c += ('a' - 'A')) < 10) {
          c += ('A' - '0' - 10);
        }
      }
      if (c >= base) {
        break;
      }
      if (neg) {
        rvalue = (rvalue * base) - c;
      } else {
        rvalue = (rvalue * base) + c;
      }
      ++str;
    }
  }
  if (ptr != 0)
    *ptr = str;
  return rvalue;
}
```