user: 请从给定的汇编指令推导出C源代码:

```asm
<compute_revents>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %esi,-0x68(%rbp)
  mov    %rdx,-0x70(%rbp)
  mov    %rcx,-0x78(%rbp)
  mov    %r8,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x5c(%rbp)
  mov    -0x70(%rbp),%rdx
  mov    -0x64(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L31
  lea    -0x50(%rbp),%rsi
  mov    -0x64(%rbp),%eax
  mov    $0x0,%ecx
  mov    $0x40,%edx
  mov    %eax,%edi
  call   <recv@plt>
  mov    %eax,-0x58(%rbp)
  cmpl   $0x0,-0x58(%rbp)
  jns    L52
  mov    D141(%rip),%rax
  mov    (%rax),%eax
  jmp    L117
L52:
  mov    $0x0,%eax
L117:
  mov    %eax,-0x54(%rbp)
  cmpl   $0x0,-0x58(%rbp)
  jne    L115
  mov    D119(%rip),%rax
  mov    (%rax),%eax
  or     %eax,-0x5c(%rbp)
  jmp    L31
L115:
  cmpl   $0x0,-0x58(%rbp)
  jg     L131
  mov    D50(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x54(%rbp)
  jne    L2
L131:
  mov    D64(%rip),%rax
  mov    (%rax),%edx
  mov    D28(%rip),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  and    -0x68(%rbp),%eax
  or     %eax,-0x5c(%rbp)
  jmp    L31
L2:
  mov    D62(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x54(%rbp)
  je     L20
  mov    D106(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x54(%rbp)
  je     L20
  mov    D182(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x54(%rbp)
  je     L20
  mov    D77(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x54(%rbp)
  jne    L4
L20:
  mov    D119(%rip),%rax
  mov    (%rax),%eax
  or     %eax,-0x5c(%rbp)
  jmp    L31
L4:
  mov    D163(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x54(%rbp)
  jne    L168
  mov    D64(%rip),%rax
  mov    (%rax),%edx
  mov    D28(%rip),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  and    -0x68(%rbp),%eax
  or     %eax,-0x5c(%rbp)
  jmp    L31
L168:
  mov    D132(%rip),%rax
  mov    (%rax),%eax
  or     %eax,-0x5c(%rbp)
L31:
  mov    -0x78(%rbp),%rdx
  mov    -0x64(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L127
  mov    D168(%rip),%rax
  mov    (%rax),%edx
  mov    D65(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D25(%rip),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  and    -0x68(%rbp),%eax
  or     %eax,-0x5c(%rbp)
L127:
  mov    -0x80(%rbp),%rdx
  mov    -0x64(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L160
  mov    D126(%rip),%rax
  mov    (%rax),%edx
  mov    D92(%rip),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  and    -0x68(%rbp),%eax
  or     %eax,-0x5c(%rbp)
L160:
  mov    -0x5c(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L46
  call   <__stack_chk_fail@plt>
L46:
  leave
  ret
```

assistant: ```c
int compute_revents(int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds) {
  int happened = 0;
  if (FD_ISSET(fd, rfds)) {
    int r;
    int socket_errno;
    char data[64];
    r = recv(fd, data, sizeof(data), 0);
    socket_errno = (r < 0) ? errno : 0;
    if (r == 0)
      happened |= POLLHUP;
    else if (r > 0 || (socket_errno == ENOTCONN))
      happened |= (POLLIN | POLLRDNORM) & sought;
    else if (socket_errno == ESHUTDOWN || socket_errno == ECONNRESET || socket_errno == ECONNABORTED || socket_errno == ENETRESET)
      happened |= POLLHUP;
    else if (socket_errno == ENOTSOCK)
      happened |= (POLLIN | POLLRDNORM) & sought;
    else
      happened |= POLLERR;
  }
  if (FD_ISSET(fd, wfds))
    happened |= (POLLOUT | POLLWRNORM | POLLWRBAND) & sought;
  if (FD_ISSET(fd, efds))
    happened |= (POLLPRI | POLLRDBAND) & sought;
  return happened;
}
```