user: 请将以下的汇编代码转换成C语言代码：

```asm
<copyLoop>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x828,%rsp
  mov    %edi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x818(%rsp)
  xor    %eax,%eax
  mov    D1(%rip),%rax
  mov    (%rax),%r14d
  movl   $0x0,0x4(%rsp)
  movl   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  lea    0x20(%rsp),%rdi
  mov    $0x0,%eax
  mov    $0x7e,%ecx
  rep stos %rax,%es:(%rdi)
  movq   $0x0,0x410(%rsp)
  movq   $0x0,0x418(%rsp)
  lea    0x420(%rsp),%rdi
  mov    $0x7e,%ecx
  rep stos %rax,%es:(%rdi)
  test   %rsi,%rsi
  je     L31
  mov    %rsi,%rbx
  mov    %edx,%r12d
  test   %edx,%edx
  jne    L67
L31:
  mov    0x818(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L77
  mov    %r14d,%eax
  add    $0x828,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L67:
  lea    0x4(%rsp),%rdi
  mov    %rsi,%rdx
  mov    %r12d,%esi
  call   <RC4_set_key@plt>
  lea    0x8(%rsp),%rdi
  mov    %rbx,%rdx
  mov    %r12d,%esi
  call   <RC4_set_key@plt>
  lea    0xc(%rsp),%rbx
  jmp    L23
L85:
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L23
  mov    D36(%rip),%rax
  mov    (%rax),%r13d
  mov    %ebp,%r15d
L28:
  cmp    $0xffffffff,%r15d
  je     L23
  cmp    $0xffffffff,%r13d
  je     L23
  lea    0x10(%rsp),%r12
  mov    $0x400,%esi
  mov    %r12,%rdi
  call   <bzero@plt>
  lea    0x410(%rsp),%rdi
  mov    $0x400,%esi
  call   <bzero@plt>
  mov    $0x400,%edx
  mov    %r12,%rsi
  mov    %r15d,%edi
  call   <read@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L31
  lea    0x8(%rsp),%rax
  lea    0x4(%rsp),%rdi
  cmp    %ebp,%r13d
  cmovne %rax,%rdi
  lea    0x410(%rsp),%r15
  lea    0x10(%rsp),%rdx
  mov    %r15,%rcx
  mov    %r12,%rsi
  call   <RC4@plt>
  mov    %r12,%rdx
  mov    %r15,%rsi
  mov    %r13d,%edi
  call   <write@plt>
  mov    %r13d,%edi
  call   <fsync@plt>
L23:
  movl   $0x0,0xc(%rsp)
  mov    %rbx,%rdi
  call   <FD_ZERO@plt>
  mov    %rbx,%rsi
  mov    D45(%rip),%rax
  mov    (%rax),%edi
  call   <FD_SET@plt>
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <FD_SET@plt>
  lea    0x1(%rbp),%edi
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    %rbx,%rsi
  call   <select@plt>
  test   %rax,%rax
  jle    L23
  mov    %rbx,%rsi
  mov    D45(%rip),%rax
  mov    (%rax),%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L85
  mov    D45(%rip),%rax
  mov    (%rax),%r15d
  mov    %ebp,%r13d
  jmp    L28
L77:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int copyLoop(int s, char *pKey, int nKeyLen) {
  int nRetVal = EXIT_FAILURE;
  RC4_KEY sEKey = {0};
  RC4_KEY sDKey = {0};
  char pPlain[(1024)] = {0};
  char pCipher[(1024)] = {0};
  if (pKey && nKeyLen) {
    RC4_set_key(&sEKey, nKeyLen, pKey);
    RC4_set_key(&sDKey, nKeyLen, pKey);
    while (true) {
      fd_set set = {0};
      int from = -1, to = -1;
      FD_ZERO(&set);
      FD_SET(STDIN_FILENO, &set);
      FD_SET(s, &set);
      if (0 < select(s + 1, &set, NULL, NULL, NULL)) {
        if (FD_ISSET(STDIN_FILENO, &set)) {
          from = STDIN_FILENO;
          to = s;
        } else if (FD_ISSET(s, &set)) {
          from = s;
          to = STDOUT_FILENO;
        }
      }
      if (-1 != from && -1 != to) {
        ssize_t len = 0;
        bzero(pPlain, (1024));
        bzero(pCipher, (1024));
        len = read(from, pPlain, (1024));
        if (len) {
          RC4((to == s) ? &sEKey : &sDKey, len, pPlain, pCipher);
          write(to, pCipher, len);
          fsync(to);
        } else {
          break;
        }
      }
    }
  }
  return nRetVal;
}
```