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

```asm
<wcstoimax>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x18,%rsp
  mov    %rsi,(%rsp)
  jmp    L75
  nopl   (%rax)
L21:
  add    $0x1,%r15
L75:
  movsbl (%r15),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L21
  movsbl (%r15),%edi
  cmp    $0x2d,%dil
  je     L72
  movl   $0x0,0xc(%rsp)
  cmp    $0x2b,%dil
  je     L49
L31:
  test   %ebx,%ebx
  jne    L194
  mov    $0xa,%ebx
  cmp    $0x30,%dil
  je     L124
L212:
  mov    D43(%rip),%rax
  xor    %ebp,%ebp
  xor    %r13d,%r13d
  mov    $0x1,%r14d
  mov    (%rax),%eax
  cltd
  idiv   %ebx
  mov    %edx,0x8(%rsp)
  mov    %eax,%r12d
  jmp    L228
  nopl   0x0(%rax)
L230:
  jne    L173
  cmp    %eax,0x8(%rsp)
  cmovl  %r14d,%ebp
L173:
  mov    %r13d,%r8d
  movsbl 0x1(%r15),%edi
  add    $0x1,%r15
  imul   %ebx,%r8d
  lea    (%r8,%rax,1),%r13d
L228:
  call   <CharToInt@plt>
  cmp    %eax,%ebx
  jle    L3
  cmp    %r12d,%r13d
  jle    L230
  mov    $0x1,%ebp
  jmp    L173
  nopl   0x0(%rax,%rax,1)
L3:
  mov    (%rsp),%rax
  test   %rax,%rax
  je     L2
  mov    %r15,(%rax)
L2:
  test   %ebp,%ebp
  jne    L189
  mov    0xc(%rsp),%edx
  mov    %r13d,%eax
  neg    %eax
  test   %edx,%edx
  cmovne %eax,%r13d
L217:
  add    $0x18,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L194:
  cmp    $0x10,%ebx
  jne    L212
  cmp    $0x30,%dil
  jne    L212
  movzbl 0x1(%r15),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L212
  movsbl 0x2(%r15),%edi
  add    $0x2,%r15
  jmp    L212
  nopl   0x0(%rax)
L49:
  movsbl 0x1(%r15),%edi
  add    $0x1,%r15
  jmp    L31
  cs nopw 0x0(%rax,%rax,1)
L72:
  movsbl 0x1(%r15),%edi
  movl   $0x1,0xc(%rsp)
  add    $0x1,%r15
  jmp    L31
  cs nopw 0x0(%rax,%rax,1)
L189:
  mov    D44(%rip),%rax
  mov    0xc(%rsp),%ecx
  mov    (%rax),%edx
  mov    D20(%rip),%rax
  mov    %edx,(%rax)
  test   %ecx,%ecx
  je     L140
  mov    D15(%rip),%rax
  mov    (%rax),%r13d
  jmp    L217
  nopl   0x0(%rax)
L140:
  mov    D43(%rip),%rax
  mov    (%rax),%r13d
  jmp    L217
  nop
L124:
  movsbl 0x1(%r15),%edi
  mov    %edi,%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L145
  movsbl 0x2(%r15),%edi
  mov    $0x10,%ebx
  add    $0x2,%r15
  jmp    L212
L145:
  add    $0x1,%r15
  mov    $0x8,%ebx
  jmp    L212
```

assistant: ```c
intmax_t wcstoimax(wchar_t const *restrict nptr, wchar_t **restrict endptr, int base) {
  while (isspace(*nptr))
    ++nptr;
  bool sign;
  if (*nptr == '-')
    sign = true, ++nptr;
  else if (*nptr == '+')
    sign = false, ++nptr;
  else
    sign = false;
  if (!base) {
    if (*nptr == '0') {
      if (*++nptr == 'X' || *nptr == 'x')
        base = 16, ++nptr;
      else
        base = 8;
    } else
      base = 10;
  } else if (base == 16) {
    if (nptr[0] == '0' && (nptr[1] == 'X' || nptr[1] == 'x'))
      nptr += 2;
  };
  intmax_t val = 0, mul = base, max = INTMAX_MAX / mul;
  int gap = INTMAX_MAX % mul;
  bool ovr = 0;
  for (int dig; (dig = CharToInt(*nptr)) < base; ++nptr) {
    if (val > max || (val == max && dig > gap))
      ovr = 1;
    val = val * mul + dig;
  };
  if (endptr)
    *endptr = (wchar_t *)nptr;
  if (ovr) {
    errno = ERANGE;
    return sign ? INTMAX_MIN : INTMAX_MAX;
  }
  return sign ? -val : val;
  ;
}
```