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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1048(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  jle    L90
  lea    0x8(%rsi),%r15
  lea    -0x2(%rdi),%eax
  lea    0x10(%rsi,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  jmp    L329
L163:
  mov    (%rsp),%rdi
  call   <perror@plt>
L258:
  add    $0x8,%r15
  cmp    0x8(%rsp),%r15
  je     L90
L329:
  mov    (%r15),%rax
  mov    %rax,(%rsp)
  mov    D12(%rip),%rdi
  mov    (%rdi),%esi
  mov    %rax,%rdi
  call   <open@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  js     L163
  lea    0x18(%rsp),%rsi
  mov    %eax,%edi
  call   <fstat@plt>
  test   %rax,%rax
  js     L139
  mov    D27(%rip),%rax
  mov    (%rax),%esi
  mov    (%rsp),%rdi
  call   <open@plt>
  mov    %eax,%r13d
  lea    0x40(%rsp),%rbx
  lea    0x1040(%rsp),%r14
  test   %eax,%eax
  jns    L29
  mov    (%rsp),%rdi
  call   <perror@plt>
  mov    %r12d,%edi
  call   <close@plt>
  jmp    L258
L139:
  mov    (%rsp),%rdi
  call   <perror@plt>
  jmp    L258
L10:
  mov    (%rsp),%rdi
  call   <perror@plt>
  mov    %r13d,%edi
  call   <close@plt>
  mov    %r12d,%edi
  call   <close@plt>
  jmp    L258
L230:
  mov    %rax,%rdx
  add    $0x2,%rbp
  sub    $0x2,%ebx
  jmp    L95
L83:
  add    $0x1,%rbp
  mov    %rax,%rdx
  sub    $0x1,%ebx
L95:
  mov    %cl,-0x1(%rax)
  test   %ebx,%ebx
  jle    L198
L192:
  add    $0x1,%rax
L170:
  lea    -0x1(%rax),%rdx
  movzbl 0x0(%rbp),%ecx
  cmp    $0xd,%cl
  jne    L83
  cmp    $0x1,%ebx
  jle    L130
  movzbl 0x1(%rbp),%ecx
  cmp    $0xa,%cl
  je     L230
  add    $0x1,%rbp
  movb   $0xd,-0x1(%rax)
  sub    $0x1,%ebx
  jmp    L192
L130:
  lea    0x40(%rsp),%rsi
  sub    %esi,%edx
  mov    %r13d,%edi
  call   <full_write@plt>
  test   %rax,%rax
  js     L201
  cmp    $0x1,%ebx
  jne    L137
  movzbl 0x0(%rbp),%eax
  mov    %al,0x40(%rsp)
  lea    0x41(%rsp),%rbx
  jmp    L29
L201:
  mov    (%rsp),%rdi
  call   <perror@plt>
  mov    %r13d,%edi
  call   <close@plt>
  mov    %r12d,%edi
  call   <close@plt>
  jmp    L258
L37:
  lea    0x40(%rsp),%rax
  cmp    %rax,%rbx
  je     L132
  mov    %rax,%rsi
  mov    %ebx,%edx
  sub    %eax,%edx
  mov    %r13d,%edi
  call   <full_write@plt>
  test   %rax,%rax
  js     L240
L132:
  mov    D1(%rip),%rax
  mov    (%rax),%edx
  mov    $0x0,%esi
  mov    %r13d,%edi
  call   <lseek@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  js     L316
  mov    %r13d,%edi
  call   <ftruncate@plt>
  test   %rax,%rax
  js     L190
  mov    %r13d,%edi
  call   <close@plt>
  mov    %r12d,%edi
  call   <close@plt>
  mov    0x1c(%rsp),%eax
  mov    %eax,0x28(%rsp)
  movq   $0x0,0x20(%rsp)
  mov    0x18(%rsp),%eax
  mov    %eax,0x38(%rsp)
  movq   $0x0,0x30(%rsp)
  lea    0x20(%rsp),%rsi
  mov    (%rsp),%rdi
  call   <utimes@plt>
  test   %rax,%rax
  jns    L258
  mov    (%rsp),%rdi
  call   <perror@plt>
  jmp    L258
L240:
  mov    (%rsp),%rdi
  call   <perror@plt>
  mov    %r13d,%edi
  call   <close@plt>
  mov    %r12d,%edi
  call   <close@plt>
  jmp    L258
L316:
  mov    (%rsp),%rdi
  call   <perror@plt>
  mov    %r13d,%edi
  call   <close@plt>
  mov    %r12d,%edi
  call   <close@plt>
  jmp    L258
L190:
  mov    (%rsp),%rdi
  call   <perror@plt>
  mov    %r13d,%edi
  call   <close@plt>
  mov    %r12d,%edi
  call   <close@plt>
  jmp    L258
L90:
  mov    $0x0,%edi
  call   <exit@plt>
  mov    0x1048(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L178
  mov    $0x0,%eax
  add    $0x1058,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L198:
  lea    0x40(%rsp),%rsi
  sub    %esi,%edx
  mov    %r13d,%edi
  call   <full_write@plt>
  test   %rax,%rax
  js     L201
L137:
  lea    0x40(%rsp),%rbx
L29:
  mov    %r14d,%edx
  sub    %ebx,%edx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <full_read@plt>
  test   %eax,%eax
  js     L10
  je     L37
  lea    0x40(%rsp),%rbp
  sub    %rbp,%rbx
  add    %eax,%ebx
  lea    0x41(%rsp),%rax
  jmp    L170
L178:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i++) {
    char *filename = argv[i];
    int rfd = open(filename, O_RDONLY);
    if (rfd < 0) {
      perror(filename);
      goto next;
    }
    {
      struct stat statbuf;
      if (fstat(rfd, &statbuf) < 0) {
        perror(filename);
        goto next;
      }
      {
        int wfd = open(filename, O_RDWR);
        if (wfd < 0) {
          perror(filename);
          close(rfd);
          goto next;
        }
        {
          char buffer[4096];
          char *bufend = &buffer[4096];
          register char *srcptr = &buffer[0];
          register char *destptr;
          while (1) {
            register int count = full_read(rfd, srcptr, bufend - srcptr);
            if (count < 0) {
              perror(filename);
              close(wfd);
              close(rfd);
              goto next;
            }
            if (count == 0)
              break;
            count += (srcptr - &buffer[0]);
            destptr = srcptr = &buffer[0];
            do {
              if (*srcptr == 13) {
                if (count > 1) {
                  if (srcptr[1] == 10) {
                    *destptr++ = 10;
                    srcptr += 2;
                    count -= 2;
                  } else {
                    *destptr++ = *srcptr++;
                    count--;
                  }
                } else
                  break;
              } else {
                *destptr++ = *srcptr++;
                count--;
              }
            } while (count > 0);
            if (full_write(wfd, buffer, destptr - buffer) < 0) {
              perror(filename);
              close(wfd);
              close(rfd);
              goto next;
            }
            if (count > 0) {
              buffer[0] = *srcptr;
              srcptr = &buffer[1];
            } else {
              srcptr = &buffer[0];
            }
          }
          if (srcptr != buffer) {
            if (full_write(wfd, buffer, srcptr - buffer) < 0) {
              perror(filename);
              close(wfd);
              close(rfd);
              goto next;
            }
          }
        }
        {
          off_t length = lseek(wfd, 0, SEEK_CUR);
          if (length < 0) {
            perror(filename);
            close(wfd);
            close(rfd);
            goto next;
          }
          if (ftruncate(wfd, length) < 0) {
            perror(filename);
            close(wfd);
            close(rfd);
            goto next;
          }
        }
        close(wfd);
      }
      close(rfd);
      {
        struct timeval tv[2];
        tv[0].tv_sec = statbuf.st_atime;
        tv[0].tv_usec = 0;
        tv[1].tv_sec = statbuf.st_mtime;
        tv[1].tv_usec = 0;
        if (utimes(filename, tv) < 0) {
          perror(filename);
          goto next;
        }
      }
    }
  next:;
  }
  exit(0);
}
```