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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x120,%rsp
  mov    %edi,-0x114(%rbp)
  mov    %rsi,-0x120(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xe0(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  lea    -0xd8(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  call   <fork@plt>
  mov    %eax,-0x104(%rbp)
  cmpl   $0xffffffff,-0x104(%rbp)
  jne    L72
  lea    D86(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L72:
  cmpl   $0x0,-0x104(%rbp)
  jne    L52
  mov    -0xdc(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0xd8(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0xe0(%rbp),%eax
  lea    D38(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fdopen@plt>
  mov    %rax,-0xf0(%rbp)
  mov    -0xd4(%rbp),%eax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fdopen@plt>
  mov    %rax,-0xe8(%rbp)
  lea    -0x110(%rbp),%rdx
  mov    -0xf0(%rbp),%rax
  lea    D101(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  movl   $0x1,-0x10c(%rbp)
  jmp    L89
L58:
  mov    -0x110(%rbp),%eax
  cltd
  idivl  -0x10c(%rbp)
  mov    %edx,%eax
  test   %eax,%eax
  jne    L13
  mov    -0x10c(%rbp),%eax
  add    %eax,-0x108(%rbp)
L13:
  addl   $0x1,-0x10c(%rbp)
L89:
  mov    -0x110(%rbp),%eax
  cmp    %eax,-0x10c(%rbp)
  jl     L58
  mov    -0x110(%rbp),%eax
  cmp    %eax,-0x108(%rbp)
  jne    L59
  mov    -0xe8(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  lea    D112(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  jmp    L5
L59:
  mov    -0xe8(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D63(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
L5:
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L70
L52:
  mov    -0xe0(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0xd4(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  lea    -0x110(%rbp),%rax
  mov    %rax,%rsi
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0xdc(%rbp),%eax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fdopen@plt>
  mov    %rax,-0x100(%rbp)
  mov    -0xd8(%rbp),%eax
  lea    D38(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fdopen@plt>
  mov    %rax,-0xf8(%rbp)
  mov    -0x110(%rbp),%edx
  mov    -0x100(%rbp),%rax
  lea    D116(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x100(%rbp),%rax
  mov    %rax,%rdi
  call   <fflush@plt>
  lea    -0xd0(%rbp),%rdx
  mov    -0xf8(%rbp),%rax
  lea    D52(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  lea    -0xd0(%rbp),%rax
  mov    %rax,%rsi
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L70:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D86
type: string
name: disassemble_data
arguments: tag: D38
type: string
name: disassemble_data
arguments: tag: D21
type: string
name: disassemble_data
arguments: tag: D101
type: string
name: disassemble_data
arguments: tag: D112
type: string
name: disassemble_data
arguments: tag: D63
type: string
name: disassemble_data
arguments: tag: D116
type: string
name: disassemble_data
arguments: tag: D52
type: string
name: disassemble_data
arguments: tag: D97
type: string

tool: D86: fork

tool: D38: r

tool: D21: w

tool: D101: %d

tool: D112: True


tool: D63: False


tool: D116: %d


tool: D52: %s

tool: D97: %s


assistant: ```c
int main(int argc, const char *argv[]) {
  int fd_to_child[2];
  int fd_to_parent[2];
  pid_t child_pid;
  pipe(fd_to_child);
  pipe(fd_to_parent);
  child_pid = fork();
  if (child_pid == -1) {
    perror("fork");
    exit(1);
  }
  if (child_pid == 0) {
    close(fd_to_child[1]);
    close(fd_to_parent[0]);
    FILE *input = fdopen(fd_to_child[0], "r");
    FILE *output = fdopen(fd_to_parent[1], "w");
    int n;
    fscanf(input, "%d", &n);
    int i;
    int sum;
    for (i = 1; i < n; i++) {
      if (n % i == 0)
        sum += i;
    }
    if (sum == n)
      fprintf(output, "True\n");
    else
      fprintf(output, "False\n");
    exit(0);
  } else {
    close(fd_to_child[0]);
    close(fd_to_parent[1]);
    int n;
    scanf("%d", &n);
    FILE *output = fdopen(fd_to_child[1], "w");
    FILE *input = fdopen(fd_to_parent[0], "r");
    fprintf(output, "%d\n", n);
    fflush(output);
    char answer[200];
    fscanf(input, "%s", answer);
    printf("%s\n", answer);
  }
  return 0;
}
```