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

```asm
<main>:
  endbr64
  sub    $0x28,%rsp
  lea    D28(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  xor    %eax,%eax
  call   <printParent@plt>
  xor    %eax,%eax
  call   <fork@plt>
  test   %rax,%rax
  je     L4
  lea    D30(%rip),%rdi
  call   <puts@plt>
  xor    %edx,%edx
  lea    0xc(%rsp),%rsi
  or     $0xffffffff,%edi
  call   <waitpid@plt>
  mov    0xc(%rsp),%edi
  call   <WEXITSTATUS@plt>
  mov    %eax,0xc(%rsp)
  xor    %eax,%eax
  call   <printParent@plt>
  xor    %eax,%eax
  call   <fork@plt>
  test   %rax,%rax
  je     L65
  lea    D33(%rip),%rdi
  call   <puts@plt>
  xor    %edx,%edx
  lea    0x10(%rsp),%rsi
  or     $0xffffffff,%edi
  call   <waitpid@plt>
  mov    0x10(%rsp),%edi
  call   <WEXITSTATUS@plt>
  mov    %eax,0x10(%rsp)
  xor    %eax,%eax
  call   <printParent@plt>
  xor    %eax,%eax
  call   <fork@plt>
  test   %rax,%rax
  je     L50
  lea    D21(%rip),%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rsi
  xor    %edx,%edx
  or     $0xffffffff,%edi
  call   <waitpid@plt>
  mov    0x14(%rsp),%edi
  call   <WEXITSTATUS@plt>
  mov    %eax,0x14(%rsp)
  xor    %eax,%eax
  call   <printParent@plt>
  mov    0xc(%rsp),%eax
  imul   0x10(%rsp),%eax
  mov    $0x2,%edx
  sub    0x14(%rsp),%eax
  mov    $0x2,%r9d
  mov    $0x2,%r8d
  mov    $0x2,%ecx
  push   %rax
  mov    $0x2,%esi
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  push   $0x2
  call   <printf@plt>
  pop    %rax
  xor    %eax,%eax
  pop    %rdx
L64:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L51
  add    $0x28,%rsp
  ret
L65:
  call   <printChild@plt>
  mov    $0x2,%esi
  mov    $0x2,%edi
  call   <add@plt>
  jmp    L64
L4:
  call   <printChild@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L51
  mov    $0x2,%esi
  mov    $0x2,%edi
  add    $0x28,%rsp
  jmp    10e0 <add@plt>
L50:
  call   <printChild@plt>
  mov    $0x2,%esi
  mov    $0x2,%edi
  call   <divi@plt>
  jmp    L64
L51:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D28
type_guessed: string
name: disassemble_data
arguments: tag: D30
type_guessed: string
name: disassemble_data
arguments: tag: D33
type_guessed: string
name: disassemble_data
arguments: tag: D21
type_guessed: string
name: disassemble_data
arguments: tag: D12
type_guessed: string

tool: D28: Program begins here!

tool: D30: I just finished forking pid1.

tool: D33: I just finished forking pid2.

tool: D21: I just finished forking pid3.

tool: D12: The result of doing (%d + %d) * (%d + %d) - (%d / %d) is: %d


assistant: ```c
int main() {
  printf("Program begins here!\n");
  printParent();
  pid_t pid1, pid2, pid3;
  int a = 2, b = 2, c = 2, d = 2, e = 2, f = 2;
  int result, rtval1, rtval2, rtval3;
  pid1 = fork();
  if (pid1 == 0) {
    printChild();
    return add(a, b);
  } else {
    printf("I just finished forking pid1.\n");
    waitpid(-1, &rtval1, 0);
    rtval1 = WEXITSTATUS(rtval1);
    printParent();
    pid2 = fork();
    if (pid2 == 0) {
      printChild();
      return add(c, b);
    } else {
      printf("I just finished forking pid2.\n");
      waitpid(-1, &rtval2, 0);
      rtval2 = WEXITSTATUS(rtval2);
      printParent();
      pid3 = fork();
      if (pid3 == 0) {
        printChild();
        return divi(e, f);
      } else {
        printf("I just finished forking pid3.\n");
        waitpid(-1, &rtval3, 0);
        rtval3 = WEXITSTATUS(rtval3);
        printParent();
      }
    }
  }
  result = (rtval1 * rtval2) - rtval3;
  printf("The result of doing (%d + %d) * (%d + %d) - (%d / %d) is: %d\n", a, b, c, d, e, f, result);
  return 0;
}
```