user: 这段汇编代码用C语言表示是什么样的:

```asm
<wcsrtombs>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L3
  mov    %rdi,%rbx
  mov    %rdx,%r12
  cmp    $0x3,%rdx
  jbe    L101
  mov    (%rsi),%rax
  mov    %rdx,%rbp
  jmp    L72
  cs nopw 0x0(%rax,%rax,1)
L56:
  add    $0x4,%rax
  sub    $0x1,%rbp
  mov    %sil,(%rbx)
  add    $0x1,%rbx
  mov    %rax,(%r14)
  cmp    $0x3,%rbp
  jbe    L167
L72:
  mov    (%rax),%esi
  test   %esi,%esi
  je     L10
  cmp    $0x7f,%esi
  jbe    L56
  xor    %edx,%edx
  mov    %rbx,%rdi
  call   <wcrtomb@plt>
  cmp    $0xffffffffffffffff,%rax
  je     L208
  add    %rax,%rbx
  sub    %rax,%rbp
  mov    (%r14),%rax
  add    $0x4,%rax
  mov    %rax,(%r14)
  cmp    $0x3,%rbp
  ja     L72
L167:
  test   %rbp,%rbp
  je     L5
  mov    (%r14),%rax
  lea    0x4(%rsp),%r13
  jmp    L196
L112:
  add    $0x4,%rax
  sub    $0x1,%rbp
  mov    %sil,(%rbx)
  add    $0x1,%rbx
  mov    %rax,(%r14)
  test   %rbp,%rbp
  je     L5
L196:
  mov    (%rax),%esi
  test   %esi,%esi
  je     L10
  cmp    $0x7f,%esi
  jbe    L112
  xor    %edx,%edx
  mov    %r13,%rdi
  call   <wcrtomb@plt>
  mov    %rax,%r15
  cmp    $0xffffffffffffffff,%rax
  je     L208
  cmp    %rbp,%rax
  ja     L226
  mov    (%r14),%rax
  mov    %rbx,%rdi
  xor    %edx,%edx
  sub    %r15,%rbp
  add    %r15,%rbx
  mov    (%rax),%esi
  call   <wcrtomb@plt>
  mov    (%r14),%rax
  add    $0x4,%rax
  mov    %rax,(%r14)
  test   %rbp,%rbp
  jne    L196
  nopw   0x0(%rax,%rax,1)
L5:
  movq   $0x0,(%r14)
L35:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L124
  add    $0x18,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L3:
  mov    (%rsi),%rbx
  xor    %r12d,%r12d
  mov    (%rbx),%esi
  test   %esi,%esi
  je     L35
  lea    0x4(%rsp),%rbp
  jmp    L100
  nopl   0x0(%rax,%rax,1)
L175:
  add    $0x1,%r12
L154:
  mov    0x4(%rbx),%esi
  add    $0x4,%rbx
  test   %esi,%esi
  je     L35
L100:
  cmp    $0x7f,%esi
  jbe    L175
  xor    %edx,%edx
  mov    %rbp,%rdi
  call   <wcrtomb@plt>
  cmp    $0xffffffffffffffff,%rax
  je     L208
  add    %rax,%r12
  jmp    L154
  nopl   0x0(%rax)
L208:
  mov    $0xffffffffffffffff,%r12
  jmp    L35
  nopl   0x0(%rax)
L10:
  movb   $0x0,(%rbx)
  sub    %rbp,%r12
  jmp    L5
L226:
  sub    %rbp,%r12
  jmp    L35
L101:
  mov    %rdx,%rbp
  jmp    L167
L124:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
size_t wcsrtombs(char *restrict s, const wchar_t **restrict ws, size_t n, mbstate_t *restrict st) {
  const wchar_t *ws2;
  char buf[4];
  size_t N = n, l;
  if (!s) {
    for (n = 0, ws2 = *ws; *ws2; ws2++) {
      if (*ws2 >= 0x80u) {
        l = wcrtomb(buf, *ws2, 0);
        if (!(l + 1))
          return -1;
        n += l;
      } else
        n++;
    }
    return n;
  }
  while (n >= 4 && **ws) {
    if (**ws >= 0x80u) {
      l = wcrtomb(s, **ws, 0);
      if (!(l + 1))
        return -1;
      s += l;
      n -= l;
    } else {
      *s++ = **ws;
      n--;
    }
    (*ws)++;
  }
  while (n && **ws) {
    if (**ws >= 0x80u) {
      l = wcrtomb(buf, **ws, 0);
      if (!(l + 1))
        return -1;
      if (l > n)
        return N - n;
      wcrtomb(s, **ws, 0);
      s += l;
      n -= l;
    } else {
      *s++ = **ws;
      n--;
    }
    (*ws)++;
  }
  if (n)
    *s = 0;
  *ws = 0;
  return N - n;
}
```