user: What would the C source look like for the assembly code provided here?

```asm
<mbsnrtowcs>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x448,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,0x18(%rsp)
  mov    %rdx,%rbp
  mov    %r8,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x438(%rsp)
  xor    %eax,%eax
  mov    (%rsi),%rax
  mov    %rax,0x28(%rsp)
  test   %rdi,%rdi
  je     L34
  mov    %rcx,%r13
  mov    %rdi,%r12
L242:
  test   %rax,%rax
  je     L97
  test   %r13,%r13
  je     L97
  mov    %rbp,%rdx
  shr    $0x2,%rdx
  cmp    $0x83,%rbp
  ja     L59
  cmp    %rdx,%r13
  ja     L251
L59:
  mov    $0x0,%r14d
  lea    0x28(%rsp),%rax
  mov    %rax,0x8(%rsp)
L87:
  cmp    %rdx,%r13
  cmovbe %r13,%rdx
  sub    %rdx,%rbp
  mov    %r15,%rcx
  mov    0x8(%rsp),%rsi
  mov    %r12,%rdi
  call   <mbsrtowcs@plt>
  mov    %rax,%rbx
  cmp    $0xffffffffffffffff,%rax
  je     L85
  lea    0x30(%rsp),%rax
  cmp    %rax,%r12
  je     L165
  lea    (%r12,%rbx,4),%r12
  sub    %rbx,%r13
L72:
  add    %rbx,%r14
  cmpq   $0x0,0x28(%rsp)
  je     L141
  test   %r13,%r13
  je     L141
  mov    %rbp,%rdx
  shr    $0x2,%rdx
  cmp    $0x83,%rbp
  ja     L87
  cmp    %rdx,%r13
  jbe    L87
  jmp    L193
L34:
  lea    0x30(%rsp),%r12
  mov    $0x100,%r13d
  jmp    L242
L165:
  lea    0x30(%rsp),%r12
  jmp    L72
L97:
  mov    $0x0,%r14d
L141:
  cmpq   $0x0,0x28(%rsp)
  je     L259
L193:
  test   %r13,%r13
  je     L73
  test   %rbp,%rbp
  je     L73
  mov    %r14,%rbx
  add    %r13,%r14
L83:
  mov    %r15,%rcx
  mov    %rbp,%rdx
  mov    0x28(%rsp),%rsi
  mov    %r12,%rdi
  call   <mbrtowc@plt>
  lea    0x2(%rax),%rdx
  cmp    $0x2,%rdx
  jbe    L176
  add    %rax,0x28(%rsp)
  sub    %rax,%rbp
  add    $0x4,%r12
  add    $0x1,%rbx
  cmp    %rbx,%r14
  je     L85
  test   %rbp,%rbp
  jne    L83
  jmp    L85
L176:
  cmp    $0xffffffffffffffff,%rax
  je     L241
  movl   $0x0,(%r15)
L85:
  cmpq   $0x0,0x10(%rsp)
  je     L120
  mov    0x28(%rsp),%rax
  mov    0x18(%rsp),%rcx
  mov    %rax,(%rcx)
L120:
  mov    0x438(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L158
  mov    %rbx,%rax
  add    $0x448,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L259:
  mov    %r14,%rbx
  jmp    L85
L73:
  mov    %r14,%rbx
  jmp    L85
L241:
  mov    %rax,%rbx
  jmp    L85
L251:
  mov    $0x0,%r14d
  jmp    L193
L158:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
size_t mbsnrtowcs(wchar_t *wcs, const char **src, size_t n, size_t wn, mbstate_t *st) {
  size_t l, cnt = 0, n2;
  wchar_t *ws, wbuf[256];
  const char *s = *src;
  if (!wcs)
    ws = wbuf, wn = sizeof wbuf / sizeof *wbuf;
  else
    ws = wcs;
  while (s && wn && ((n2 = n / 4) >= wn || n2 > 32)) {
    if (n2 >= wn)
      n2 = wn;
    n -= n2;
    l = mbsrtowcs(ws, &s, n2, st);
    if (!(l + 1)) {
      cnt = l;
      wn = 0;
      break;
    }
    if (ws != wbuf) {
      ws += l;
      wn -= l;
    }
    cnt += l;
  }
  if (s)
    while (wn && n) {
      l = mbrtowc(ws, s, n, st);
      if (l + 2 <= 2) {
        if (!(l + 1)) {
          cnt = l;
          break;
        }
        *(unsigned *)st = 0;
        break;
      }
      s += l;
      n -= l;
      ws++;
      wn--;
      cnt++;
    }
  if (wcs)
    *src = s;
  return cnt;
}
```