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

```asm
<pipedata>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x140,%rsp
  mov    %edi,-0x134(%rbp)
  mov    %esi,-0x138(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x11c(%rbp)
  lea    -0x124(%rbp),%rax
  mov    %rax,%rdi
  call   <FD_ZERO@plt>
  lea    -0x120(%rbp),%rax
  mov    %rax,%rdi
  call   <FD_ZERO@plt>
L4:
  cmpl   $0xff,-0x11c(%rbp)
  jg     L9
  lea    -0x124(%rbp),%rdx
  mov    -0x134(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_SET@plt>
L9:
  cmpl   $0x0,-0x11c(%rbp)
  je     L124
  lea    -0x120(%rbp),%rdx
  mov    -0x138(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_SET@plt>
L124:
  mov    -0x134(%rbp),%eax
  cmp    -0x138(%rbp),%eax
  jle    L19
  mov    -0x134(%rbp),%eax
  add    $0x1,%eax
  jmp    L70
L19:
  mov    -0x138(%rbp),%eax
  add    $0x1,%eax
L70:
  lea    -0x120(%rbp),%rdx
  lea    -0x124(%rbp),%rsi
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <select@plt>
  mov    %eax,-0x118(%rbp)
  cmpl   $0x0,-0x118(%rbp)
  js     L69
  lea    -0x124(%rbp),%rdx
  mov    -0x134(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L93
  mov    -0x11c(%rbp),%edx
  mov    $0x100,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  mov    -0x11c(%rbp),%eax
  cltq
  lea    -0x110(%rbp),%rcx
  add    %rax,%rcx
  mov    -0x134(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x114(%rbp)
  cmpl   $0x0,-0x114(%rbp)
  jle    L17
  mov    -0x114(%rbp),%eax
  add    %eax,-0x11c(%rbp)
  lea    -0x124(%rbp),%rdx
  mov    -0x134(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_CLR@plt>
L93:
  lea    -0x120(%rbp),%rdx
  mov    -0x138(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L4
  mov    -0x11c(%rbp),%edx
  lea    -0x110(%rbp),%rcx
  mov    -0x138(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
  mov    %eax,-0x114(%rbp)
  cmpl   $0x0,-0x114(%rbp)
  jle    L91
  mov    -0x114(%rbp),%eax
  sub    %eax,-0x11c(%rbp)
  mov    -0x114(%rbp),%eax
  cltq
  lea    -0x110(%rbp),%rdx
  lea    (%rdx,%rax,1),%rcx
  mov    -0x11c(%rbp),%edx
  lea    -0x110(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  lea    -0x120(%rbp),%rdx
  mov    -0x138(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_CLR@plt>
  jmp    L4
L69:
  nop
  jmp    L6
L17:
  nop
  jmp    L6
L91:
  nop
L6:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L50
  call   <__stack_chk_fail@plt>
L50:
  leave
  ret
```

assistant: ```c
void pipedata(int fdr, int fdw) {
  char ch;
  char buf[256];
  int i = 0, retv, n;
  fd_set fsr, fsw;
  FD_ZERO(&fsr);
  FD_ZERO(&fsw);
  while (1) {
    if (i < 256)
      FD_SET(fdr, &fsr);
    if (i)
      FD_SET(fdw, &fsw);
    retv = select((fdr > fdw) ? (1 + fdr) : (1 + fdw), &fsr, &fsw, NULL, NULL);
    if (retv < 0)
      return;
    if (FD_ISSET(fdr, &fsr)) {
      n = read(fdr, buf + i, sizeof(buf) - i);
      if (n <= 0)
        return;
      i += n;
      FD_CLR(fdr, &fsr);
    }
    if (FD_ISSET(fdw, &fsw)) {
      n = write(fdw, buf, i);
      if (n <= 0)
        return;
      i -= n;
      memmove(buf, buf + n, i);
      FD_CLR(fdw, &fsw);
    }
  }
}
```