user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<strtoul>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L207:
  mov    %r15,%rbx
  movsbl (%r15),%r14d
  add    $0x1,%r15
  mov    %r14d,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L207
  cmp    $0x2d,%r14d
  je     L127
  movl   $0x0,0x1c(%rsp)
  cmp    $0x2b,%r14d
  je     L114
L144:
  test   $0xffffffef,%r13d
  jne    L89
  cmp    $0x30,%r14d
  je     L257
  test   %r13d,%r13d
  jne    L89
  movq   $0xa,(%rsp)
  mov    $0xa,%r13d
  jmp    L83
L47:
  test   %r13d,%r13d
  je     L213
  nopl   (%rax)
L89:
  movslq %r13d,%rax
  mov    %rax,(%rsp)
L83:
  mov    D12(%rip),%rax
  xor    %edx,%edx
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  mov    (%rax),%rax
  divq   (%rsp)
  mov    %edx,0x18(%rsp)
  mov    %rax,%rbp
  jmp    L26
  nopl   (%rax)
L277:
  cmp    %ecx,%r13d
  jle    L261
L46:
  test   %ebx,%ebx
  js     L222
  cmp    %rbp,%r12
  ja     L222
  jne    L237
  mov    $0xffffffff,%ebx
  cmp    0x18(%rsp),%ecx
  jle    L237
L110:
  movsbl (%r15),%r14d
  add    $0x1,%r15
L26:
  mov    %r14d,%edi
  call   <isdigit@plt>
  lea    -0x30(%r14),%ecx
  test   %rax,%rax
  jne    L277
  mov    %r14d,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L261
  mov    %r14d,%edi
  call   <isupper@plt>
  mov    %r14d,%ecx
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0x20,%eax
  add    $0x37,%eax
  sub    %eax,%ecx
  cmp    %ecx,%r13d
  jg     L46
L261:
  cmp    $0xffffffff,%ebx
  je     L135
  mov    0x1c(%rsp),%edx
  mov    %r12,%rax
  neg    %rax
  test   %edx,%edx
  cmovne %rax,%r12
  cmpq   $0x0,0x8(%rsp)
  je     L63
  test   %ebx,%ebx
  jne    L218
L85:
  mov    0x8(%rsp),%rax
  mov    0x10(%rsp),%rsi
  mov    %rsi,(%rax)
L63:
  add    $0x28,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L222:
  mov    $0xffffffff,%ebx
  jmp    L110
  nopw   0x0(%rax,%rax,1)
L237:
  imul   (%rsp),%r12
  movslq %ecx,%rcx
  mov    $0x1,%ebx
  add    %rcx,%r12
  jmp    L110
  nopl   (%rax)
L114:
  movsbl (%r15),%r14d
  lea    0x2(%rbx),%r15
  jmp    L144
  nopl   (%rax)
L135:
  mov    D12(%rip),%rax
  cmpq   $0x0,0x8(%rsp)
  mov    (%rax),%r12
  mov    D33(%rip),%rax
  mov    (%rax),%edx
  mov    D9(%rip),%rax
  mov    %edx,(%rax)
  je     L63
L218:
  lea    -0x1(%r15),%rax
  mov    %rax,0x10(%rsp)
  jmp    L85
  nopw   0x0(%rax,%rax,1)
L127:
  movsbl (%r15),%r14d
  movl   $0x1,0x1c(%rsp)
  lea    0x2(%rbx),%r15
  jmp    L144
  nopl   (%rax)
L257:
  movzbl (%r15),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L47
  movsbl 0x1(%r15),%r14d
  mov    $0x10,%r13d
  add    $0x2,%r15
  movq   $0x10,(%rsp)
  jmp    L83
L213:
  movq   $0x8,(%rsp)
  mov    $0x8,%r13d
  jmp    L83
```

assistant: ```c
unsigned long strtoul(const char *str, char **endptr, int base) {
  const char *s = str;
  unsigned long acc;
  int c;
  unsigned long cutoff;
  int neg = 0, any, cutlim;
  do {
    c = *s++;
  } while (isspace(c));
  if (c == '-') {
    neg = 1;
    c = *s++;
  } else if (c == '+')
    c = *s++;
  if ((base == 0 || base == 16) && c == '0' && (*s == 'x' || *s == 'X')) {
    c = s[1];
    s += 2;
    base = 16;
  }
  if (base == 0)
    base = c == '0' ? 8 : 10;
  cutoff = (unsigned long)ULONG_MAX / (unsigned long)base;
  cutlim = (unsigned long)ULONG_MAX % (unsigned long)base;
  for (acc = 0, any = 0;; c = *s++) {
    if (isdigit(c))
      c -= '0';
    else if (isalpha(c))
      c -= isupper(c) ? 'A' - 10 : 'a' - 10;
    else
      break;
    if (c >= base)
      break;
    if (((any < 0) || (acc > cutoff)) || ((acc == cutoff) && (c > cutlim)))
      any = -1;
    else {
      any = 1;
      acc *= base;
      acc += c;
    }
  }
  if (any < 0) {
    acc = ULONG_MAX;
    errno = ERANGE;
  } else if (neg)
    acc = -acc;
  if (endptr != 0)
    *endptr = (any) ? (char *)(s - 1) : (char *)str;
  return (acc);
}
```