user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1018(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rdi
  call   <pipe@plt>
  test   %eax,%eax
  js     L37
L15:
  xor    %eax,%eax
  call   <fork@plt>
  test   %rax,%rax
  mov    $0x0,%eax
  je     L2
  call   <getpid@plt>
  mov    0x8(%rsp),%edi
  lea    D43(%rip),%rbp
  lea    D12(%rip),%r13
  mov    %rax,%r12
  call   <close@plt>
  mov    %rbp,%rdx
  mov    %r12d,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    0xc(%rsp),%edi
  mov    %rbp,%rsi
  lea    D57(%rip),%rbp
  mov    %eax,%edx
  call   <write@plt>
  mov    %rbp,%rdx
  mov    %r12d,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    0xc(%rsp),%edi
  mov    %rbp,%rsi
  mov    %eax,%edx
  call   <write@plt>
L30:
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  mov    %r12,%rsi
  call   <printf@plt>
  xor    %edi,%edi
  call   <exit@plt>
  mov    0x1018(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L45
  add    $0x1020,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L2:
  call   <getpid@plt>
  mov    0xc(%rsp),%edi
  lea    0x10(%rsp),%rbx
  lea    D46(%rip),%r13
  mov    %rax,%r12
  call   <close@plt>
  mov    $0x1000,%edx
  xor    %esi,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    %r12d,%ebp
  jmp    L51
  nopw   0x0(%rax,%rax,1)
L52:
  mov    %rbx,%rdx
  mov    %ebp,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1000,%edx
  xor    %esi,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
L51:
  mov    0x8(%rsp),%edi
  mov    $0x1000,%edx
  mov    %rbx,%rsi
  call   <read@plt>
  test   %rax,%rax
  jne    L52
  mov    %ebp,%esi
  lea    D25(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%edi
  call   <close@plt>
  jmp    L30
L37:
  lea    D48(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L15
L45:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D43
datatype: string
name: retrieve_data
arguments: tag: D12
datatype: string
name: retrieve_data
arguments: tag: D57
datatype: string
name: retrieve_data
arguments: tag: D47
datatype: string
name: retrieve_data
arguments: tag: D46
datatype: string
name: retrieve_data
arguments: tag: D25
datatype: string
name: retrieve_data
arguments: tag: D48
datatype: string

tool: D43: a string made by the parent


tool: D12: pid: %d -- writing %s to pipe_desc[1]


tool: D57: and another string

tool: D47: pid: %d -- I am exiting


tool: D46: pid: %d -- received %s from parent


tool: D25: pid: %d -- child detects write end closed


tool: D48: error creating pipe

assistant: ```c
int main(int argc, char **argv) {
  pid_t child_id;
  pid_t my_id;
  int pipe_desc[2];
  char *string;
  char read_buffer[4096];
  int err;
  err = pipe(pipe_desc);
  if (err < 0) {
    printf("error creating pipe\n");
    exit(1);
  }
  child_id = fork();
  if (child_id != 0) {
    my_id = getpid();
    close(pipe_desc[0]);
    string = "a string made by the parent\n";
    printf("pid: %d -- writing %s to pipe_desc[1]\n", (int)my_id, string);
    write(pipe_desc[1], string, strlen(string));
    string = "and another string";
    printf("pid: %d -- writing %s to pipe_desc[1]\n", (int)my_id, string);
    write(pipe_desc[1], string, strlen(string));
  } else {
    my_id = getpid();
    close(pipe_desc[1]);
    memset(read_buffer, 0, sizeof(read_buffer));
    while (read(pipe_desc[0], read_buffer, sizeof(read_buffer))) {
      printf("pid: %d -- received %s from parent\n", (int)my_id, read_buffer);
      memset(read_buffer, 0, sizeof(read_buffer));
    }
    printf("pid: %d -- child detects write end closed\n", (int)my_id);
    close(pipe_desc[0]);
  }
  printf("pid: %d -- I am exiting\n", my_id);
  exit(0);
}
```