user: Translate the below assembly code into C programming language:

```asm
<recv_msg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x18(%rbp)
  mov    D7(%rip),%eax
  test   %eax,%eax
  jne    L129
  mov    $0x0,%eax
  call   <netlink_create@plt>
  mov    %eax,D141(%rip)
  mov    $0x1,%edi
  call   <epoll_create@plt>
  mov    %eax,D29(%rip)
  mov    D29(%rip),%eax
  test   %eax,%eax
  js     L178
  mov    D141(%rip),%eax
  test   %eax,%eax
  jns    L89
L178:
  mov    $0xffffffff,%eax
  jmp    L149
L89:
  mov    D98(%rip),%rax
  mov    (%rax),%edx
  mov    D137(%rip),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    D141(%rip),%eax
  mov    %eax,-0xc(%rbp)
  mov    D141(%rip),%edx
  mov    D155(%rip),%rax
  mov    (%rax),%esi
  mov    D29(%rip),%eax
  lea    -0x10(%rbp),%rcx
  mov    %eax,%edi
  call   <epoll_ctl@plt>
  movl   $0x1,D7(%rip)
  jmp    L194
L129:
  nop
L194:
  mov    D19(%rip),%rax
  movq   $0x0,(%rax)
  cmpl   $0x0,-0x34(%rbp)
  js     L24
  mov    -0x34(%rbp),%eax
  imul   $0xfa,%eax,%eax
  jmp    L84
L24:
  mov    $0xffffffff,%eax
L84:
  mov    D29(%rip),%edi
  lea    -0x10(%rbp),%rsi
  mov    %eax,%ecx
  mov    $0x1,%edx
  call   <epoll_wait@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jne    L175
  mov    $0x0,%eax
  jmp    L149
L175:
  cmpl   $0x0,-0x14(%rbp)
  jns    L165
  mov    D19(%rip),%rax
  mov    (%rax),%rdx
  mov    D101(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L50
  jmp    L194
L50:
  mov    $0xffffffff,%eax
  jmp    L149
L81:
  mov    -0x1c(%rbp),%eax
  cltq
  add    %rax,-0x28(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  sub    %rax,-0x30(%rbp)
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x18(%rbp)
L165:
  cmpq   $0x0,-0x30(%rbp)
  je     L140
  mov    -0xc(%rbp),%eax
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rsi
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <recv@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jg     L81
L140:
  cmpl   $0x0,-0x1c(%rbp)
  jns    L1
  mov    D19(%rip),%rax
  mov    (%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  je     L1
  mov    D19(%rip),%rax
  mov    (%rax),%rdx
  mov    D129(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  je     L1
  mov    $0xffffffff,%eax
  jmp    L149
L1:
  mov    -0x18(%rbp),%eax
L149:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L32
  call   <__stack_chk_fail@plt>
L32:
  leave
  ret
```

assistant: ```c
int recv_msg(char *buffer, size_t size, int timeout) {
  static int first_init = 0;
  static int nlfd = -1;
  static int epollfd = -1;
  int retval;
  int len;
  int recv_size = 0;
  struct epoll_event event;
  if (!first_init) {
    nlfd = netlink_create();
    epollfd = epoll_create(1);
    if (epollfd < 0 || nlfd < 0)
      return -1;
    event.events = EPOLLIN | EPOLLET;
    event.data.fd = nlfd;
    epoll_ctl(epollfd, EPOLL_CTL_ADD, nlfd, &event);
    first_init = 1;
  }
retry_again:
  errno = 0;
  retval = epoll_wait(epollfd, &event, 1, timeout < 0 ? -1 : timeout * 1000 / 4);
  if (retval == 0)
    return 0;
  if (retval < 0) {
    if (errno == EINTR)
      goto retry_again;
    return -1;
  }
  while (size && (len = recv(event.data.fd, buffer, size, 0)) > 0) {
    buffer += len;
    size -= len;
    recv_size += len;
  }
  if (len < 0 && errno != EWOULDBLOCK && errno != EAGAIN)
    return -1;
  return recv_size;
}
```