user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x130,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x11c(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  cmp    $0xffffffff,%eax
  jne    L63
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L10
  jmp    L59
L63:
  call   <fork@plt>
  mov    %eax,-0x128(%rbp)
  cmpl   $0x0,-0x128(%rbp)
  jne    L70
  call   <fork@plt>
  mov    %eax,-0x128(%rbp)
  cmpl   $0x0,-0x128(%rbp)
  jne    L74
  mov    -0x114(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0x11c(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
L40:
  mov    -0x11c(%rbp),%eax
  lea    -0x110(%rbp),%rcx
  mov    $0xff,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x120(%rbp)
  mov    -0x120(%rbp),%eax
  cltq
  movb   $0x0,-0x110(%rbp,%rax,1)
  mov    $0x0,%eax
  call   <getpid@plt>
  mov    %eax,%ecx
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdx
  mov    %ecx,%esi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L40
L74:
  mov    -0x118(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0x114(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
L4:
  mov    -0x11c(%rbp),%eax
  lea    -0x110(%rbp),%rcx
  mov    $0xff,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x124(%rbp)
  mov    -0x124(%rbp),%eax
  cltq
  movb   $0x0,-0x110(%rbp,%rax,1)
  mov    $0x0,%eax
  call   <getpid@plt>
  mov    %eax,%ecx
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdx
  mov    %ecx,%esi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L4
L70:
  mov    -0x11c(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
L39:
  lea    -0x110(%rbp),%rax
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x118(%rbp),%eax
  lea    -0x110(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
  jmp    L39
L59:
  call   <__stack_chk_fail@plt>
L10:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D25
type: string
name: unpack_data
arguments: data_tag: D26
type: string
name: unpack_data
arguments: data_tag: D15
type: string

tool: D25: Erro ao criar pipe

tool: D26: %d: %s


tool: D15: %s

assistant: ```c
int main() {
  int pipeFd[3];
  if (pipe(pipeFd) == -1) {
    perror("Erro ao criar pipe");
    return -1;
  }
  int idProcesso = fork();
  if (idProcesso == 0) {
    idProcesso = fork();
    if (idProcesso == 0) {
      close(pipeFd[2]);
      close(pipeFd[0]);
      char buffer[255];
      while (1) {
        int bytesLidos = read(pipeFd[0], buffer, 255);
        buffer[bytesLidos] = '\0';
        printf("%d: %s\n", getpid(), buffer);
      }
    } else {
      close(pipeFd[1]);
      close(pipeFd[2]);
      char buffer[255];
      while (1) {
        int bytesLidos = read(pipeFd[0], buffer, 255);
        buffer[bytesLidos] = '\0';
        printf("%d: %s\n", getpid(), buffer);
      }
    }
  } else {
    close(pipeFd[0]);
    char buffer[255];
    while (1) {
      scanf("%s", buffer);
      write(pipeFd[1], buffer, strlen(buffer));
    }
  }
}
```