user: Please show me the C implementation that matches the assembly code listed below:

```asm
<strtoull>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  nopl   (%rax)
L218:
  mov    %rbx,%r15
  movzbl (%rbx),%edi
  add    $0x1,%rbx
  mov    %edi,%r14d
  call   <isspace@plt>
  test   %rax,%rax
  jne    L218
  cmp    $0x2d,%r14b
  je     L254
  xor    %r8d,%r8d
  cmp    $0x2b,%r14b
  je     L105
L197:
  test   $0xffffffef,%ebp
  je     L259
L157:
  lea    -0x2(%rbp),%eax
  cmp    $0x22,%eax
  jbe    L299
L266:
  xor    %eax,%eax
  test   %r13,%r13
  je     L147
L232:
  mov    %r12,0x0(%r13)
L147:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L259:
  cmp    $0x30,%r14b
  je     L121
  test   %ebp,%ebp
  jne    L157
  mov    $0xa,%ebp
L299:
  mov    D1(%rip),%rax
  xor    %r11d,%r11d
  movslq %ebp,%r10
  mov    (%rax),%r9d
  mov    %r9d,%eax
  cltd
  idiv   %ebp
  movslq %eax,%rdi
  xor    %eax,%eax
  jmp    L0
L270:
  lea    -0x37(%r14),%ecx
L108:
  movsbl %cl,%esi
  cmp    %ebp,%esi
  jge    L255
L127:
  test   %r11d,%r11d
  js     L229
  cmp    %rdi,%rax
  ja     L229
  cmp    %edx,%esi
  jle    L151
  mov    $0xffffffff,%r11d
  cmp    %rdi,%rax
  je     L230
L151:
  imul   %r10,%rax
  movsbq %cl,%rcx
  mov    $0x1,%r11d
  add    %rcx,%rax
L230:
  movzbl (%rbx),%r14d
  add    $0x1,%rbx
L0:
  lea    -0x30(%r14),%ecx
  cmp    $0x9,%cl
  jbe    L108
  lea    -0x41(%r14),%ecx
  cmp    $0x19,%cl
  jbe    L270
  lea    -0x61(%r14),%ecx
  cmp    $0x19,%cl
  ja     L255
  lea    -0x57(%r14),%ecx
  movsbl %cl,%esi
  cmp    %ebp,%esi
  jl     L127
  nopl   0x0(%rax,%rax,1)
L255:
  cmp    $0xffffffff,%r11d
  je     L325
  test   %r11d,%r11d
  je     L266
  test   %r8d,%r8d
  je     L221
  neg    %rax
  test   %r13,%r13
  je     L147
L150:
  lea    -0x1(%rbx),%r12
  jmp    L232
  nopl   (%rax)
L229:
  mov    $0xffffffff,%r11d
  jmp    L230
  nopl   0x0(%rax,%rax,1)
L325:
  movslq %r9d,%rax
  test   %r13,%r13
  je     L147
  lea    -0x1(%rbx),%r12
  jmp    L232
  nopl   (%rax)
L105:
  movzbl (%rbx),%r14d
  lea    0x2(%r15),%rbx
  jmp    L197
  nopl   (%rax)
L254:
  movzbl (%rbx),%r14d
  mov    $0x1,%r8d
  lea    0x2(%r15),%rbx
  jmp    L197
  nopl   0x0(%rax,%rax,1)
L121:
  movzbl (%rbx),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L38
  movzbl 0x1(%rbx),%r14d
  mov    $0x10,%ebp
  add    $0x2,%rbx
  jmp    L299
  nopl   (%rax)
L221:
  test   %r13,%r13
  jne    L150
  jmp    L147
L38:
  test   %ebp,%ebp
  jne    L157
  mov    $0x8,%ebp
  jmp    L299
```

assistant: ```c
unsigned long long strtoull(const char *__restrict nptr, char **__restrict endptr, int base) {
  const char *s;
  unsigned long long acc;
  char c;
  unsigned long long cutoff;
  int neg, any, cutlim;
  s = nptr;
  do {
    c = *s++;
  } while (isspace((unsigned char)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')) {
    c = s[1];
    s += 2;
    base = 16;
  }
  if (base == 0)
    base = c == '0' ? 8 : 10;
  acc = any = 0;
  if (base < 2 || base > 36)
    goto noconv;
  cutoff = ULLONG_MAX / base;
  cutlim = ULLONG_MAX % base;
  for (;; c = *s++) {
    if (c >= '0' && c <= '9')
      c -= '0';
    else if (c >= 'A' && c <= 'Z')
      c -= 'A' - 10;
    else if (c >= 'a' && c <= 'z')
      c -= '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 = ULLONG_MAX;
  } else if (!any) {
  noconv:
    acc = 0;
  } else if (neg)
    acc = -acc;
  if (endptr != NULL)
    *endptr = (char *)(any ? s - 1 : nptr);
  return (acc);
}
```