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

```asm
<strtoul>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,(%rsp)
  jmp    L96
  xchg   %ax,%ax
L48:
  add    $0x1,%r15
L96:
  movsbl (%r15),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L48
  movsbl (%r15),%edi
  cmp    $0x2b,%dil
  je     L194
  movb   $0x0,0xf(%rsp)
  cmp    $0x2d,%dil
  je     L17
L99:
  test   %r12d,%r12d
  jne    L77
L137:
  mov    $0xa,%ebx
  cmp    $0x30,%dil
  je     L84
L134:
  xor    %r14d,%r14d
  movzbl %bl,%ebp
  jmp    L154
  nop
L184:
  mov    %rbp,%rdx
  movzbl %al,%eax
  imul   %r14,%rdx
  add    %rdx,%rax
  cmp    %rax,%r14
  jbe    L87
  mov    D15(%rip),%rax
  mov    (%rax),%edx
  mov    D26(%rip),%rax
  mov    %edx,(%rax)
  mov    D3(%rip),%rax
  mov    (%rax),%rax
L87:
  movsbl 0x0(%r13),%edi
  mov    %r13,%r15
  mov    %rax,%r14
L154:
  call   <toupper@plt>
  lea    0x1(%r15),%r13
  lea    -0x37(%rax),%esi
  lea    -0x30(%rax),%edx
  cmp    $0x41,%al
  mov    %esi,%eax
  cmovb  %edx,%eax
  cmp    %bl,%al
  jb     L184
  mov    %r14,%rax
  neg    %rax
  cmpb   $0x0,0xf(%rsp)
  cmovne %rax,%r14
  cmpq   $0x0,(%rsp)
  je     L214
  test   %r12d,%r12d
  je     L204
  xchg   %ax,%ax
L55:
  mov    (%rsp),%rax
  mov    %r15,(%rax)
L214:
  add    $0x18,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L204:
  movzbl (%r15),%eax
  sub    $0x4c,%eax
  cmp    $0x29,%al
  ja     L55
  movabs $0xfffffdfeeffffffe,%rdx
  bt     %rax,%rdx
  jb     L55
  movzbl 0x0(%r13),%eax
  mov    %r13,%r15
  sub    $0x4c,%eax
  cmp    $0x29,%al
  ja     L55
L126:
  bt     %rax,%rdx
  jb     L55
  movzbl 0x1(%r13),%eax
  add    $0x1,%r13
  mov    %r13,%r15
  sub    $0x4c,%eax
  cmp    $0x29,%al
  ja     L55
  jmp    L126
  nopl   (%rax)
L17:
  movsbl 0x1(%r15),%edi
  movb   $0x1,0xf(%rsp)
  add    $0x1,%r15
  test   %r12d,%r12d
  je     L137
L77:
  mov    %r12d,%ebx
  cmp    $0x10,%r12d
  jne    L134
  mov    $0x10,%ebx
  cmp    $0x30,%dil
  jne    L134
  movzbl 0x1(%r15),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L134
  movsbl 0x2(%r15),%edi
  add    $0x2,%r15
  jmp    L134
  nopl   0x0(%rax)
L194:
  movsbl 0x1(%r15),%edi
  movb   $0x0,0xf(%rsp)
  add    $0x1,%r15
  jmp    L99
  nopl   0x0(%rax,%rax,1)
L84:
  movzbl 0x1(%r15),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  sete   %bl
  lea    0x8(,%rbx,8),%ebx
  jmp    L134
```

assistant: ```c
unsigned long strtoul(const char *__restrict nptr, char **__restrict endptr, int base) {
  unsigned long sum, psum;
  unsigned char sign;
  unsigned char digit;
  unsigned char radix = base;
  char *cp = (char *)nptr;
  while (isspace(*cp))
    ++cp;
  sign = 0;
  if (*cp == '+') {
    ++cp;
  } else if (*cp == '-') {
    ++cp;
    sign = 1;
  }
  if (base == 0) {
    if (*cp == '0')
      if (cp[1] == 'x' || cp[1] == 'X')
        radix = 16;
      else
        radix = 8;
    else
      radix = 10;
  }
  if (base == 16 && *cp == '0' && (cp[1] == 'x' || cp[1] == 'X'))
    cp += 2;
  sum = 0;
  for (;;) {
    digit = toupper(*(cp++));
    if (digit >= 'A')
      digit = digit - ('A' - 10);
    else
      digit -= '0';
    if (digit >= radix)
      break;
    psum = sum;
    sum = sum * radix + digit;
    if (sum < psum) {
      errno = ERANGE;
      sum = ULONG_MAX;
    }
  }
  if (sign) {
    sum = -sum;
  }
  if (endptr) {
    --cp;
    if (base == 0) {
      while (*cp == 'h' || *cp == 'u' || *cp == 'l' || *cp == 'L')
        ++cp;
    }
    *endptr = (char *)cp;
  }
  return (sum);
}
```