user: Demonstrate the C code that generates the assembly output below:

```asm
<fd_timed_read_n>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  js     L81
  test   %rsi,%rsi
  je     L81
  mov    D129(%rip),%rax
  mov    %edi,%r13d
  mov    %rdx,%r12
  mov    %rcx,%rbx
  mov    %edi,0x1c(%rsp)
  mov    %rdx,%r15
  mov    (%rax),%eax
  mov    %eax,0x20(%rsp)
  test   %r8d,%r8d
  je     L75
  mov    $0xffffffff,%r14d
  test   %rdx,%rdx
  je     L75
L180:
  mov    0x8(%rsp),%rsi
  mov    %r15,%rdx
  mov    %r13d,%edi
  call   <read@plt>
  test   %eax,%eax
  js     L172
  je     L85
  cltq
  sub    %rax,%r15
  test   %r14d,%r14d
  jne    L9
  nopl   0x0(%rax)
L85:
  mov    %r12d,%eax
  sub    %r15d,%eax
L181:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L212
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L9:
  add    %rax,0x8(%rsp)
  xchg   %ax,%ax
L75:
  test   %r15,%r15
  je     L85
L84:
  lea    0x1c(%rsp),%rbp
  nopw   0x0(%rax,%rax,1)
L74:
  mov    %rbx,%rdi
  call   <_fd_get_poll_timeout@plt>
  mov    $0x1,%esi
  mov    %rbp,%rdi
  mov    %eax,%edx
  mov    %eax,%r14d
  call   <poll@plt>
  test   %eax,%eax
  jns    L195
  mov    D36(%rip),%rax
  mov    D135(%rip),%rdx
  mov    (%rax),%rax
  cmp    (%rdx),%rax
  je     L74
  mov    D7(%rip),%rdx
  cmp    (%rdx),%rax
  je     L74
L238:
  mov    $0xffffffff,%eax
  jmp    L181
  nopw   0x0(%rax,%rax,1)
L195:
  je     L239
  mov    0x24(%rsp),%edi
  mov    D97(%rip),%rax
  mov    %edi,%ecx
  and    (%rax),%ecx
  jne    L183
  mov    D53(%rip),%rax
  mov    %edi,%ecx
  and    (%rax),%ecx
  jne    L32
  mov    D129(%rip),%rax
  and    (%rax),%edi
  call   <assert@plt>
  jmp    L180
  nopl   0x0(%rax,%rax,1)
L239:
  mov    D136(%rip),%rax
  mov    (%rax),%rdx
  mov    D36(%rip),%rax
  mov    %rdx,(%rax)
  jmp    L85
  nopl   0x0(%rax)
L172:
  mov    D36(%rip),%rax
  mov    D135(%rip),%rdx
  mov    (%rax),%rax
  cmp    (%rdx),%rax
  je     L84
  mov    D7(%rip),%rdx
  cmp    (%rdx),%rax
  je     L84
  jmp    L238
L81:
  mov    D54(%rip),%rax
  mov    (%rax),%rdx
  mov    D36(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L181
L32:
  mov    D94(%rip),%rax
  mov    (%rax),%rdx
  mov    D36(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L181
L183:
  mov    D92(%rip),%rax
  mov    (%rax),%rdx
  mov    D36(%rip),%rax
  mov    %rdx,(%rax)
  jmp    L238
L212:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
ssize_t fd_timed_read_n(int fd, void *buf, size_t n, const struct timeval *when, int do_skip_first_poll) {
  unsigned char *p;
  int msecs;
  struct pollfd pfd;
  int nfd;
  size_t nleft;
  ssize_t nread;
  if ((fd < 0) || (buf == NULL)) {
    errno = EINVAL;
    return (-1);
  }
  p = buf;
  nleft = n;
  pfd.fd = fd;
  pfd.events = POLLIN;
  if (do_skip_first_poll && (nleft > 0)) {
    msecs = -1;
    goto read_me;
  }
  while (nleft > 0) {
    msecs = _fd_get_poll_timeout(when);
    nfd = poll(&pfd, 1, msecs);
    if (nfd < 0) {
      if ((errno == EINTR) || (errno == EAGAIN))
        continue;
      else
        return (-1);
    } else if (nfd == 0) {
      errno = ETIMEDOUT;
      break;
    } else if (pfd.revents & POLLNVAL) {
      errno = EBADF;
      return (-1);
    } else if (pfd.revents & POLLERR) {
      errno = EIO;
      return (-1);
    }
    assert(pfd.revents & POLLIN);
  read_me:
    nread = read(fd, p, nleft);
    if (nread < 0) {
      if ((errno == EINTR) || (errno == EAGAIN))
        continue;
      else
        return (-1);
    } else if (nread == 0) {
      break;
    }
    nleft -= nread;
    p += nread;
    if (msecs == 0) {
      break;
    }
  }
  return (n - nleft);
}
```