user: 请从给定的汇编指令推导出C源代码:

```asm
<wcstoull>:
  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)
L242:
  mov    %rbx,%r15
  mov    (%rbx),%r14d
  add    $0x4,%rbx
  mov    %r14d,%edi
  call   <iswspace@plt>
  test   %rax,%rax
  jne    L242
  cmp    $0x2d,%r14d
  je     L111
  xor    %r8d,%r8d
  cmp    $0x2b,%r14d
  je     L305
L49:
  test   $0xffffffef,%ebp
  je     L74
L159:
  lea    -0x2(%rbp),%edx
  xor    %eax,%eax
  cmp    $0x22,%edx
  jbe    L172
L212:
  mov    D21(%rip),%rdx
  mov    (%rdx),%ecx
  mov    D18(%rip),%rdx
  mov    %ecx,(%rdx)
  test   %r13,%r13
  je     L29
L203:
  mov    %r12,0x0(%r13)
L29:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L74:
  cmp    $0x30,%r14d
  je     L148
  test   %ebp,%ebp
  jne    L159
  mov    $0xa,%ebp
L172:
  mov    D44(%rip),%rax
  xor    %esi,%esi
  movslq %ebp,%r10
  mov    (%rax),%r9d
  mov    %r9d,%eax
  cltd
  idiv   %ebp
  movslq %eax,%rdi
  xor    %eax,%eax
  jmp    L324
  nop
L190:
  lea    -0x37(%r14),%ecx
L107:
  cmp    %ebp,%ecx
  jge    L332
L142:
  test   %esi,%esi
  js     L87
  cmp    %rdi,%rax
  ja     L87
  jne    L216
  mov    $0xffffffff,%esi
  cmp    %edx,%ecx
  jle    L216
L208:
  mov    (%rbx),%r14d
  add    $0x4,%rbx
L324:
  lea    -0x30(%r14),%ecx
  cmp    $0x9,%ecx
  jbe    L107
  lea    -0x41(%r14),%ecx
  cmp    $0x19,%ecx
  jbe    L190
  lea    -0x61(%r14),%ecx
  cmp    $0x19,%ecx
  ja     L332
  lea    -0x57(%r14),%ecx
  cmp    %ebp,%ecx
  jl     L142
  cs nopw 0x0(%rax,%rax,1)
L332:
  cmp    $0xffffffff,%esi
  je     L319
  test   %esi,%esi
  je     L212
  test   %r8d,%r8d
  je     L346
  neg    %rax
  test   %r13,%r13
  je     L29
L77:
  lea    -0x4(%rbx),%r12
  jmp    L203
  nopl   0x0(%rax,%rax,1)
L87:
  mov    $0xffffffff,%esi
  jmp    L208
  nopw   0x0(%rax,%rax,1)
L216:
  imul   %r10,%rax
  movslq %ecx,%rcx
  mov    $0x1,%esi
  add    %rcx,%rax
  jmp    L208
  nopl   0x0(%rax)
L319:
  mov    D3(%rip),%rdx
  movslq %r9d,%rax
  mov    (%rdx),%ecx
  mov    D18(%rip),%rdx
  mov    %ecx,(%rdx)
  test   %r13,%r13
  je     L29
  lea    -0x4(%rbx),%r12
  jmp    L203
  nop
L305:
  mov    (%rbx),%r14d
  lea    0x8(%r15),%rbx
  jmp    L49
  nopl   0x0(%rax)
L111:
  mov    (%rbx),%r14d
  mov    $0x1,%r8d
  lea    0x8(%r15),%rbx
  jmp    L49
  nopw   0x0(%rax,%rax,1)
L148:
  mov    (%rbx),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%eax
  jne    L84
  mov    0x4(%rbx),%r14d
  mov    $0x10,%ebp
  add    $0x8,%rbx
  jmp    L172
  nopl   0x0(%rax)
L346:
  test   %r13,%r13
  jne    L77
  jmp    L29
L84:
  test   %ebp,%ebp
  jne    L159
  mov    $0x8,%ebp
  jmp    L172
```

assistant: ```c
unsigned long long wcstoull(const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base) {
  const wchar_t *s;
  unsigned long long acc;
  wchar_t c;
  unsigned long long cutoff;
  int neg, any, cutlim;
  s = nptr;
  do {
    c = *s++;
  } while (iswspace(c));
  if (c == L'-') {
    neg = 1;
    c = *s++;
  } else {
    neg = 0;
    if (c == L'+')
      c = *s++;
  }
  if ((base == 0 || base == 16) && c == L'0' && (*s == L'x' || *s == L'X')) {
    c = s[1];
    s += 2;
    base = 16;
  }
  if (base == 0)
    base = c == L'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 >= L'0' && c <= L'9')
      c -= L'0';
    else if (c >= L'A' && c <= L'Z')
      c -= L'A' - 10;
    else if (c >= L'a' && c <= L'z')
      c -= L'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;
    errno = ERANGE;
  } else if (!any) {
  noconv:
    errno = EINVAL;
  } else if (neg)
    acc = -acc;
  if (endptr != NULL)
    *endptr = (wchar_t *)(any ? s - 1 : nptr);
  return (acc);
}
```