user: 请将以下的汇编代码转换成C语言代码:

```asm
<__wcsncat_chk>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%r12
  mov    %rdx,%r14
  mov    %rcx,%rbp
  jmp    L40
L255:
  lea    0x4(%rbx),%rdx
  lea    -0x1(%rbp),%rax
  cmpl   $0x0,(%rbx)
  je     L46
  mov    %rax,%rbp
  mov    %rdx,%rbx
L40:
  test   %rbp,%rbp
  sete   %dil
  movzbl %dil,%edi
  call   <__glibc_unlikely@plt>
  test   %rax,%rax
  je     L255
  mov    $0x0,%eax
  call   <__chk_fail@plt>
  jmp    L255
L46:
  sub    $0x4,%rbx
  cmp    $0x3,%r14
  jbe    L210
  mov    %r14,%rax
  and    $0xfffffffffffffffc,%rax
  mov    %rbp,%r15
  sub    %rax,%r15
  jmp    L286
L69:
  mov    $0x0,%eax
  call   <__chk_fail@plt>
  jmp    L28
L159:
  mov    $0x0,%eax
  call   <__chk_fail@plt>
  jmp    L218
L203:
  mov    $0x0,%eax
  call   <__chk_fail@plt>
  jmp    L263
L115:
  add    $0x10,%r12
  mov    -0x4(%r12),%eax
  add    $0x10,%rbx
  mov    %eax,(%rbx)
  test   %eax,%eax
  je     L234
  cmp    %r15,%r13
  je     L199
  mov    %r13,%rbp
L286:
  test   %rbp,%rbp
  sete   %dil
  movzbl %dil,%edi
  call   <__glibc_unlikely@plt>
  test   %rax,%rax
  jne    L69
L28:
  mov    (%r12),%eax
  mov    %eax,0x4(%rbx)
  test   %eax,%eax
  je     L234
  cmp    $0x1,%rbp
  sete   %dil
  movzbl %dil,%edi
  call   <__glibc_unlikely@plt>
  test   %rax,%rax
  jne    L159
L218:
  mov    0x4(%r12),%eax
  mov    %eax,0x8(%rbx)
  test   %eax,%eax
  je     L234
  cmp    $0x2,%rbp
  sete   %dil
  movzbl %dil,%edi
  call   <__glibc_unlikely@plt>
  test   %rax,%rax
  jne    L203
L263:
  mov    0x8(%r12),%eax
  mov    %eax,0xc(%rbx)
  test   %eax,%eax
  je     L234
  lea    -0x4(%rbp),%r13
  cmp    $0x3,%rbp
  sete   %dil
  movzbl %dil,%edi
  call   <__glibc_unlikely@plt>
  test   %rax,%rax
  je     L115
  mov    $0x0,%eax
  call   <__chk_fail@plt>
  jmp    L115
L199:
  and    $0x3,%r14d
  je     L212
  mov    %r13,%rbp
  jmp    L253
L280:
  add    $0x4,%r12
  mov    -0x4(%r12),%eax
  add    $0x4,%rbx
  mov    %eax,(%rbx)
  test   %eax,%eax
  je     L234
  lea    0x0(%r13,%r14,1),%rax
  cmp    %rbp,%rax
  je     L212
L193:
  mov    %r13,%rax
  sub    $0x1,%r13
  test   %rax,%rax
  sete   %dil
  movzbl %dil,%edi
  call   <__glibc_unlikely@plt>
  test   %rax,%rax
  je     L280
  mov    $0x0,%eax
  call   <__chk_fail@plt>
  jmp    L280
L212:
  test   %r13,%r13
  sete   %dil
  movzbl %dil,%edi
  call   <__glibc_unlikely@plt>
  test   %rax,%rax
  jne    L278
L275:
  movl   $0x0,0x4(%rbx)
L234:
  mov    0x8(%rsp),%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L278:
  mov    $0x0,%eax
  call   <__chk_fail@plt>
  jmp    L275
L210:
  test   %r14,%r14
  je     L234
L253:
  mov    %rbp,%r13
  jmp    L193
```

assistant: ```c
wchar_t *__wcsncat_chk(wchar_t *dest, const wchar_t *src, size_t n, size_t destlen) {
  wchar_t c;
  wchar_t *const s = dest;
  do {
    if (__glibc_unlikely(destlen-- == 0))
      __chk_fail();
    c = *dest++;
  } while (c != L'\0');
  ++destlen;
  dest -= 2;
  if (n >= 4) {
    size_t n4 = n >> 2;
    do {
      if (__glibc_unlikely(destlen-- == 0))
        __chk_fail();
      c = *src++;
      *++dest = c;
      if (c == L'\0')
        return s;
      if (__glibc_unlikely(destlen-- == 0))
        __chk_fail();
      c = *src++;
      *++dest = c;
      if (c == L'\0')
        return s;
      if (__glibc_unlikely(destlen-- == 0))
        __chk_fail();
      c = *src++;
      *++dest = c;
      if (c == L'\0')
        return s;
      if (__glibc_unlikely(destlen-- == 0))
        __chk_fail();
      c = *src++;
      *++dest = c;
      if (c == L'\0')
        return s;
    } while (--n4 > 0);
    n &= 3;
  }
  while (n > 0) {
    if (__glibc_unlikely(destlen-- == 0))
      __chk_fail();
    c = *src++;
    *++dest = c;
    if (c == L'\0')
      return s;
    n--;
  }
  if (c != L'\0') {
    if (__glibc_unlikely(destlen-- == 0))
      __chk_fail();
    *++dest = L'\0';
  }
  return s;
}
```