user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  test   %rax,%rax
  jns    L33
  lea    D64(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L33:
  lea    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  test   %rax,%rax
  jns    L95
  lea    D64(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L95:
  mov    $0x0,%eax
  call   <fork@plt>
  mov    %rax,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  jns    L24
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L71
L24:
  cmpq   $0x0,-0x30(%rbp)
  jne    L78
  mov    -0x14(%rbp),%eax
  mov    $0x13,%edx
  lea    D101(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x13,-0x20(%rbp)
  je     L48
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L48:
  mov    -0x10(%rbp),%eax
  mov    -0x28(%rbp),%rcx
  mov    $0x14,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L71
L78:
  mov    -0x18(%rbp),%eax
  mov    -0x28(%rbp),%rcx
  mov    $0x13,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0xc(%rbp),%eax
  mov    $0x14,%edx
  lea    D70(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x14,-0x20(%rbp)
  je     L71
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L71:
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  test   %rax,%rax
  jns    L39
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L39:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  test   %rax,%rax
  jns    L85
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L85:
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  test   %rax,%rax
  jns    L45
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L45:
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  test   %rax,%rax
  jns    L81
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L81:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L76
  call   <__stack_chk_fail@plt>
L76:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D64
data_type: string
name: parse_data
arguments: data_label: D4
data_type: string
name: parse_data
arguments: data_label: D101
data_type: string
name: parse_data
arguments: data_label: D36
data_type: string
name: parse_data
arguments: data_label: D11
data_type: string
name: parse_data
arguments: data_label: D3
data_type: string
name: parse_data
arguments: data_label: D70
data_type: string
name: parse_data
arguments: data_label: D19
data_type: string
name: parse_data
arguments: data_label: D24
data_type: string

tool: D64: Can't create pipe

tool: D4: Error in fork()

tool: D101: Message from child

tool: D36: Can't write all string

tool: D11: I'm child, I've received "%s"


tool: D3: I'm parent, I've received "%s"


tool: D70: Message from parent

tool: D19: Can't close input stream

tool: D24: Can't close output stream

assistant: ```c
int main() {
  int fd1[2], fd2[2];
  size_t size;
  char *string;
  pid_t pid;
  if (pipe(fd1) < 0) {
    printf("Can\'t create pipe\n");
    exit(-1);
  }
  if (pipe(fd2) < 0) {
    printf("Can\'t create pipe\n");
    exit(-1);
  }
  pid = fork();
  if (pid < 0)
    printf("Error in fork()\n");
  else if (pid == 0) {
    size = write(fd1[1], "Message from child", 19);
    if (size != 19) {
      printf("Can\'t write all string\n");
      exit(-1);
    }
    size = read(fd2[0], string, 20);
    if (size < 0) {
      printf("Can\'t read string\n");
      exit(-1);
    }
    printf("I\'m child, I've received \"%s\"\n", string);
  } else {
    size = read(fd1[0], string, 19);
    if (size < 0) {
      printf("Can\'t read string\n");
      exit(-1);
    }
    printf("I\'m parent, I've received \"%s\"\n", string);
    size = write(fd2[1], "Message from parent", 20);
    if (size != 20) {
      printf("Can\'t write all string\n");
      exit(-1);
    }
  }
  if (close(fd1[0]) < 0) {
    printf("Can\'t close input stream\n");
  }
  if (close(fd1[1]) < 0) {
    printf("Can\'t close output stream\n");
  }
  if (close(fd2[0]) < 0) {
    printf("Can\'t close input stream\n");
  }
  if (close(fd2[1]) < 0) {
    printf("Can\'t close output stream\n");
  }
  return 0;
}
```