user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<un_recv_fds>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  lea    0x0(,%r13,4),%r14d
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %edi,%ebx
  mov    %r14d,%edi
  sub    $0x858,%rsp
  mov    %rsi,0x8(%rsp)
  lea    0x10(%rsp),%r15
  mov    %edx,0x4(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x848(%rsp)
  xor    %eax,%eax
  call   <CMSG_SPACE@plt>
  xor    %edi,%edi
  cmp    $0x800,%rax
  mov    %rax,%r12
  setbe  %dil
  call   <assert@plt>
  mov    $0x20,%edx
  xor    %esi,%esi
  mov    %r15,%rdi
  call   <memset@plt>
  lea    0x40(%rsp),%rax
  mov    0x8(%rsp),%r10
  mov    0x4(%rsp),%r9d
  mov    %rax,0x10(%rsp)
  lea    0x30(%rsp),%rax
  mov    %r12,0x18(%rsp)
  mov    %rax,0x28(%rsp)
  movl   $0x1,0x20(%rsp)
  mov    %r10,0x30(%rsp)
  mov    %r9d,0x38(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L11:
  xor    %edx,%edx
  mov    %r15,%rsi
  mov    %ebx,%edi
  call   <recvmsg@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  jne    L88
  mov    D25(%rip),%rax
  mov    D37(%rip),%rdx
  mov    (%rax),%rax
  cmp    (%rdx),%rax
  je     L11
  mov    D49(%rip),%rdx
  cmp    (%rdx),%rax
  je     L11
L18:
  mov    0x848(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L47
  add    $0x858,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L88:
  test   %eax,%eax
  jle    L18
  test   %rbp,%rbp
  je     L18
  mov    %r15,%rdi
  call   <CMSG_FIRSTHDR@plt>
  xor    %edi,%edi
  test   %rax,%rax
  mov    %rax,%r15
  setne  %dil
  call   <assert@plt>
  mov    D23(%rip),%rax
  xor    %edi,%edi
  mov    (%rax),%rax
  cmp    %rax,(%r15)
  sete   %dil
  call   <assert@plt>
  mov    D39(%rip),%rax
  xor    %edi,%edi
  mov    (%rax),%rax
  cmp    %rax,0x8(%r15)
  sete   %dil
  call   <assert@plt>
  mov    0x10(%r15),%rbx
  mov    %r14d,%edi
  call   <CMSG_LEN@plt>
  xor    %edi,%edi
  cmp    %rax,%rbx
  sete   %dil
  call   <assert@plt>
  mov    %r15,%rdi
  call   <CMSG_DATA@plt>
  test   %r13d,%r13d
  jle    L18
  lea    (%rax,%r13,4),%rcx
  sub    %rax,%rbp
  nopl   (%rax)
L45:
  mov    (%rax),%edx
  mov    %edx,0x0(%rbp,%rax,1)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L45
  jmp    L18
L47:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int un_recv_fds(int fd, char *data, int datalen, int *fds, int fdslen) {
  struct msghdr mh;
  struct cmsghdr *cmh = NULL;
  char buf[2048];
  size_t buflen = CMSG_SPACE(sizeof(int) * fdslen);
  struct iovec iov[1];
  assert(sizeof(buf) >= buflen);
  memset(&mh, 0, sizeof(mh));
  mh.msg_control = buf;
  mh.msg_controllen = buflen;
  mh.msg_iov = iov;
  mh.msg_iovlen = 1;
  iov[0].iov_base = data;
  iov[0].iov_len = datalen;
  int rv;
  do {
    rv = recvmsg(fd, &mh, 0);
  } while (rv == -1 && (errno == EINTR || errno == EAGAIN));
  if (rv <= 0) {
    goto done;
  }
  if (fds != NULL) {
    cmh = CMSG_FIRSTHDR(&mh);
    assert(cmh != NULL);
    assert(cmh->cmsg_level == SOL_SOCKET);
    assert(cmh->cmsg_type == SCM_RIGHTS);
    assert(cmh->cmsg_len == CMSG_LEN(sizeof(int) * fdslen));
    int *fds_ = (int *)CMSG_DATA(cmh);
    int i;
    for (i = 0; i < fdslen; i++) {
      fds[i] = fds_[i];
    }
  }
done:
  return rv;
}
```