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

```asm
<wcsnrtombs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x170,%rsp
  mov    %rdi,-0x148(%rbp)
  mov    %rsi,-0x150(%rbp)
  mov    %rdx,-0x158(%rbp)
  mov    %rcx,-0x160(%rbp)
  mov    %r8,-0x168(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x130(%rbp)
  mov    -0x150(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x138(%rbp)
  cmpq   $0x0,-0x148(%rbp)
  jne    L181
  lea    -0x110(%rbp),%rax
  mov    %rax,-0x120(%rbp)
  movq   $0x100,-0x160(%rbp)
  jmp    L63
L181:
  mov    -0x148(%rbp),%rax
  mov    %rax,-0x120(%rbp)
  jmp    L63
L101:
  mov    -0x128(%rbp),%rax
  cmp    -0x160(%rbp),%rax
  jb     L28
  mov    -0x160(%rbp),%rax
  mov    %rax,-0x128(%rbp)
L28:
  mov    -0x128(%rbp),%rax
  sub    %rax,-0x158(%rbp)
  mov    -0x128(%rbp),%rdx
  lea    -0x138(%rbp),%rsi
  mov    -0x120(%rbp),%rax
  mov    $0x0,%ecx
  mov    %rax,%rdi
  call   <wcsrtombs@plt>
  mov    %rax,-0x118(%rbp)
  cmpq   $0xffffffffffffffff,-0x118(%rbp)
  jne    L83
  mov    -0x118(%rbp),%rax
  mov    %rax,-0x130(%rbp)
  movq   $0x0,-0x160(%rbp)
  jmp    L183
L83:
  lea    -0x110(%rbp),%rax
  cmp    %rax,-0x120(%rbp)
  je     L188
  mov    -0x118(%rbp),%rax
  add    %rax,-0x120(%rbp)
  mov    -0x118(%rbp),%rax
  sub    %rax,-0x160(%rbp)
L188:
  mov    -0x118(%rbp),%rax
  add    %rax,-0x130(%rbp)
L63:
  mov    -0x138(%rbp),%rax
  test   %rax,%rax
  je     L183
  cmpq   $0x0,-0x160(%rbp)
  je     L183
  mov    -0x158(%rbp),%rax
  mov    %rax,-0x128(%rbp)
  mov    -0x128(%rbp),%rax
  cmp    -0x160(%rbp),%rax
  jae    L101
  cmpq   $0x20,-0x128(%rbp)
  ja     L101
L183:
  mov    -0x138(%rbp),%rax
  test   %rax,%rax
  je     L194
  jmp    L169
L202:
  mov    -0x138(%rbp),%rax
  mov    (%rax),%ecx
  mov    -0x120(%rbp),%rax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <wcrtomb@plt>
  mov    %rax,-0x118(%rbp)
  mov    -0x118(%rbp),%rax
  add    $0x1,%rax
  cmp    $0x1,%rax
  ja     L49
  cmpq   $0x0,-0x118(%rbp)
  jne    L56
  movq   $0x0,-0x138(%rbp)
  jmp    L194
L56:
  mov    -0x118(%rbp),%rax
  mov    %rax,-0x130(%rbp)
  jmp    L194
L49:
  mov    -0x138(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x138(%rbp)
  subq   $0x1,-0x158(%rbp)
  mov    -0x118(%rbp),%rax
  add    %rax,-0x120(%rbp)
  mov    -0x118(%rbp),%rax
  sub    %rax,-0x160(%rbp)
  addq   $0x1,-0x130(%rbp)
L169:
  cmpq   $0x0,-0x160(%rbp)
  je     L194
  cmpq   $0x0,-0x158(%rbp)
  jne    L202
L194:
  cmpq   $0x0,-0x148(%rbp)
  je     L131
  mov    -0x138(%rbp),%rdx
  mov    -0x150(%rbp),%rax
  mov    %rdx,(%rax)
L131:
  mov    -0x130(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L47
  call   <__stack_chk_fail@plt>
L47:
  leave
  ret
```

assistant: ```c
size_t wcsnrtombs(char *dst, const wchar_t **wcs, size_t wn, size_t n, mbstate_t *st) {
  size_t l, cnt = 0, n2;
  char *s, buf[256];
  const wchar_t *ws = *wcs;
  if (!dst)
    s = buf, n = sizeof buf;
  else
    s = dst;
  while (ws && n && ((n2 = wn) >= n || n2 > 32)) {
    if (n2 >= n)
      n2 = n;
    wn -= n2;
    l = wcsrtombs(s, &ws, n2, 0);
    if (!(l + 1)) {
      cnt = l;
      n = 0;
      break;
    }
    if (s != buf) {
      s += l;
      n -= l;
    }
    cnt += l;
  }
  if (ws)
    while (n && wn) {
      l = wcrtomb(s, *ws, 0);
      if ((l + 1) <= 1) {
        if (!l)
          ws = 0;
        else
          cnt = l;
        break;
      }
      ws++;
      wn--;
      s += l;
      n -= l;
      cnt++;
    }
  if (dst)
    *wcs = ws;
  return cnt;
}
```