#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
scalar_t__ fork();
int /*<<< orphan*/ perror(char *);
scalar_t__ pipe(int *);
int /*<<< orphan*/ printf(char *);
scalar_t__ read(int, char *, int);
int strlen(char *);
int /*<<< orphan*/ wait(int *);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  char hello[] = "Happy mashujaa day!!\n";
  char c;
  int pfd[2];
  pid_t cpid1;
  pid_t cpid2;
  pid_t cpid3;
  pid_t cpid4;
  pid_t cpid5;
  int status;
  if (pipe(pfd) < 0) {
    perror("pipe");
    return 1;
  }
  cpid1 = fork();
  if (cpid1 == 0) {
    close(pfd[1]);
    printf("\n\nthis is child 1 and my parent told me to print: \n");
    while (read(pfd[0], &c, 1) > 0) {
      write(1, &c, 1);
    }
    close(pfd[0]);
    _exit(0);
  } else if (cpid1 > 0) {
    close(pfd[0]);
    write(pfd[1], hello, strlen(hello));
    close(pfd[1]);
    wait(&status);
    if (pipe(pfd) < 0) {
      perror("pipe");
      return 1;
    }
    cpid2 = fork();
    if (cpid2 == 0) {
      close(pfd[1]);
      printf("\n\nthis is child 2 and my parent told me to print: \n");
      while (read(pfd[0], &c, 1) > 0) {
        write(1, &c, 1);
      }
      close(pfd[0]);
      _exit(0);
    } else if (cpid2 > 0) {
      close(pfd[0]);
      write(pfd[1], hello, strlen(hello));
      close(pfd[1]);
      wait(&status);
      if (pipe(pfd) < 0) {
        perror("pipe");
        return 1;
      }
      cpid3 = fork();
      if (cpid3 == 0) {
        close(pfd[1]);
        printf("\n\nthis is child 3 and my parent told me to print: \n");
        while (read(pfd[0], &c, 1) > 0) {
          write(1, &c, 1);
        }
        close(pfd[0]);
        _exit(0);
      } else if (cpid3 > 0) {
        close(pfd[0]);
        write(pfd[1], hello, strlen(hello));
        close(pfd[1]);
        wait(&status);
        if (pipe(pfd) < 0) {
          perror("pipe");
          return 1;
        }
        cpid4 = fork();
        if (cpid4 == 0) {
          close(pfd[1]);
          printf("\n\nthis is child 4 and my parent told me to print: \n");
          while (read(pfd[0], &c, 1) > 0) {
            write(1, &c, 1);
          }
          close(pfd[0]);
          _exit(0);
        } else if (cpid4 > 0) {
          close(pfd[0]);
          write(pfd[1], hello, strlen(hello));
          close(pfd[1]);
          wait(&status);
          if (pipe(pfd) < 0) {
            perror("pipe");
            return 1;
          }
          cpid5 = fork();
          if (cpid5 == 0) {
            close(pfd[1]);
            printf("\n\nthis is child 5 and my parent told me to print: \n");
            while (read(pfd[0], &c, 1) > 0) {
              write(1, &c, 1);
            }
            close(pfd[0]);
            _exit(0);
          } else if (cpid5 > 0) {
            close(pfd[0]);
            write(pfd[1], hello, strlen(hello));
            close(pfd[1]);
            wait(&status);
          } else {
            perror("fork");
            return 1;
          }
        } else {
          perror("fork");
          return 1;
        }
      } else {
        perror("fork");
        return 1;
      }
    } else {
      perror("fork");
      return 1;
    }
  } else {
    perror("fork");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe40(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe3d(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe3b(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xe35(%rip),%ax
mov    %ax,-0x1c(%rbp)
lea    -0x3c(%rbp),%rdi
call   1080 <pipe@plt>
cmp    $0x0,%rax
jge    120e <main+0x6e>
lea    0xe19(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1715 <main+0x575>
mov    $0x0,%al
call   10c0 <fork@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1277 <main+0xd7>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
lea    0xde8(%rip),%rdi
call   1060 <printf@plt>
mov    -0x3c(%rbp),%edi
lea    -0x31(%rbp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
cmp    $0x0,%rax
jle    1268 <main+0xc8>
mov    $0x1,%edx
lea    -0x31(%rbp),%rsi
mov    %edx,%edi
call   1040 <write@plt>
jmp    1238 <main+0x98>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
cmpq   $0x0,-0x48(%rbp)
jle    16f1 <main+0x551>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x7c(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x7c(%rbp),%edi
mov    -0x78(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
lea    -0x6c(%rbp),%rdi
call   10b0 <wait@plt>
lea    -0x3c(%rbp),%rdi
call   1080 <pipe@plt>
cmp    $0x0,%rax
jge    12eb <main+0x14b>
lea    0xd3c(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1715 <main+0x575>
mov    $0x0,%al
call   10c0 <fork@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1354 <main+0x1b4>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
lea    0xd3f(%rip),%rdi
call   1060 <printf@plt>
mov    -0x3c(%rbp),%edi
lea    -0x31(%rbp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
cmp    $0x0,%rax
jle    1345 <main+0x1a5>
mov    $0x1,%edx
lea    -0x31(%rbp),%rsi
mov    %edx,%edi
call   1040 <write@plt>
jmp    1315 <main+0x175>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
cmpq   $0x0,-0x50(%rbp)
jle    16cf <main+0x52f>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x8c(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x88(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x8c(%rbp),%edi
mov    -0x88(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
lea    -0x6c(%rbp),%rdi
call   10b0 <wait@plt>
lea    -0x3c(%rbp),%rdi
call   1080 <pipe@plt>
cmp    $0x0,%rax
jge    13d4 <main+0x234>
lea    0xc53(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1715 <main+0x575>
mov    $0x0,%al
call   10c0 <fork@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    143d <main+0x29d>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
lea    0xc8a(%rip),%rdi
call   1060 <printf@plt>
mov    -0x3c(%rbp),%edi
lea    -0x31(%rbp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
cmp    $0x0,%rax
jle    142e <main+0x28e>
mov    $0x1,%edx
lea    -0x31(%rbp),%rsi
mov    %edx,%edi
call   1040 <write@plt>
jmp    13fe <main+0x25e>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
cmpq   $0x0,-0x58(%rbp)
jle    16ad <main+0x50d>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x9c(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x9c(%rbp),%edi
mov    -0x98(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
lea    -0x6c(%rbp),%rdi
call   10b0 <wait@plt>
lea    -0x3c(%rbp),%rdi
call   1080 <pipe@plt>
cmp    $0x0,%rax
jge    14bd <main+0x31d>
lea    0xb6a(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1715 <main+0x575>
mov    $0x0,%al
call   10c0 <fork@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    1526 <main+0x386>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
lea    0xbd5(%rip),%rdi
call   1060 <printf@plt>
mov    -0x3c(%rbp),%edi
lea    -0x31(%rbp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
cmp    $0x0,%rax
jle    1517 <main+0x377>
mov    $0x1,%edx
lea    -0x31(%rbp),%rsi
mov    %edx,%edi
call   1040 <write@plt>
jmp    14e7 <main+0x347>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
cmpq   $0x0,-0x60(%rbp)
jle    168b <main+0x4eb>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0xac(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xac(%rbp),%edi
mov    -0xa8(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
lea    -0x6c(%rbp),%rdi
call   10b0 <wait@plt>
lea    -0x3c(%rbp),%rdi
call   1080 <pipe@plt>
cmp    $0x0,%rax
jge    15a6 <main+0x406>
lea    0xa81(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1715 <main+0x575>
mov    $0x0,%al
call   10c0 <fork@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    160f <main+0x46f>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
lea    0xb20(%rip),%rdi
call   1060 <printf@plt>
mov    -0x3c(%rbp),%edi
lea    -0x31(%rbp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
cmp    $0x0,%rax
jle    1600 <main+0x460>
mov    $0x1,%edx
lea    -0x31(%rbp),%rsi
mov    %edx,%edi
call   1040 <write@plt>
jmp    15d0 <main+0x430>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
cmpq   $0x0,-0x68(%rbp)
jle    1669 <main+0x4c9>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0xbc(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0xb8(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xbc(%rbp),%edi
mov    -0xb8(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
lea    -0x6c(%rbp),%rdi
call   10b0 <wait@plt>
jmp    1681 <main+0x4e1>
lea    0xaaf(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1715 <main+0x575>
jmp    1686 <main+0x4e6>
jmp    16a3 <main+0x503>
lea    0xa8d(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1715 <main+0x575>
jmp    16a8 <main+0x508>
jmp    16c5 <main+0x525>
lea    0xa6b(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1715 <main+0x575>
jmp    16ca <main+0x52a>
jmp    16e7 <main+0x547>
lea    0xa49(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1715 <main+0x575>
jmp    16ec <main+0x54c>
jmp    1709 <main+0x569>
lea    0xa27(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1715 <main+0x575>
jmp    170e <main+0x56e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movaps 0xe52(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0xa212179616420,%rax
mov    %rax,0x1e(%rsp)
lea    0x4(%rsp),%rdi
call   1080 <pipe@plt>
test   %rax,%rax
js     13a8 <main+0x208>
xor    %eax,%eax
call   10c0 <fork@plt>
test   %rax,%rax
je     13ca <main+0x22a>
jle    13b1 <main+0x211>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
mov    0x8(%rsp),%ebx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0xc(%rsp),%rdi
call   10b0 <wait@plt>
lea    0x4(%rsp),%rdi
call   1080 <pipe@plt>
test   %rax,%rax
js     13a8 <main+0x208>
xor    %eax,%eax
call   10c0 <fork@plt>
test   %rax,%rax
je     142d <main+0x28d>
jle    13b1 <main+0x211>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
mov    0x8(%rsp),%ebx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0xc(%rsp),%rdi
call   10b0 <wait@plt>
lea    0x4(%rsp),%rdi
call   1080 <pipe@plt>
test   %rax,%rax
js     13a8 <main+0x208>
xor    %eax,%eax
call   10c0 <fork@plt>
test   %rax,%rax
je     149d <main+0x2fd>
jle    13b1 <main+0x211>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
mov    0x8(%rsp),%ebx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0xc(%rsp),%rdi
call   10b0 <wait@plt>
lea    0x4(%rsp),%rdi
call   1080 <pipe@plt>
test   %rax,%rax
js     13a8 <main+0x208>
xor    %eax,%eax
call   10c0 <fork@plt>
test   %rax,%rax
je     150d <main+0x36d>
jle    13b1 <main+0x211>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
mov    0x8(%rsp),%ebx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0xc(%rsp),%rdi
call   10b0 <wait@plt>
lea    0x4(%rsp),%rdi
call   1080 <pipe@plt>
test   %rax,%rax
js     13a8 <main+0x208>
xor    %eax,%eax
call   10c0 <fork@plt>
test   %rax,%rax
je     157a <main+0x3da>
jle    13b1 <main+0x211>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
mov    0x8(%rsp),%ebx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0xc(%rsp),%rdi
call   10b0 <wait@plt>
xor    %eax,%eax
jmp    13c2 <main+0x222>
lea    0xc67(%rip),%rdi
jmp    13b8 <main+0x218>
lea    0xc63(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0xd12(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%edi
lea    0x3(%rsp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jle    15d8 <main+0x438>
lea    0x3(%rsp),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <write@plt>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jg     1400 <main+0x260>
jmp    15d8 <main+0x438>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0xc7c(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%edi
lea    0x3(%rsp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jle    15d8 <main+0x438>
lea    0x3(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <write@plt>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jg     1470 <main+0x2d0>
jmp    15d8 <main+0x438>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0xbd9(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%edi
lea    0x3(%rsp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jle    15d8 <main+0x438>
lea    0x3(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <write@plt>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jg     14e0 <main+0x340>
jmp    15d8 <main+0x438>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0xb36(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%edi
lea    0x3(%rsp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jle    15d8 <main+0x438>
lea    0x3(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <write@plt>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jg     1550 <main+0x3b0>
jmp    15d8 <main+0x438>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0xa96(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%edi
lea    0x3(%rsp),%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jle    15d8 <main+0x438>
lea    0x3(%rsp),%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <write@plt>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1090 <read@plt>
test   %rax,%rax
jg     15b0 <main+0x410>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@__const.main.hello = [22 x i8] c"Happy mashujaa day!!\0A\00"
@.str = [5 x i8] c"pipe\00"
@.str.1 = [52 x i8] c"\0A\0Athis is child 1 and my parent told me to print: \0A\00"
@.str.2 = [52 x i8] c"\0A\0Athis is child 2 and my parent told me to print: \0A\00"
@.str.3 = [52 x i8] c"\0A\0Athis is child 3 and my parent told me to print: \0A\00"
@.str.4 = [52 x i8] c"\0A\0Athis is child 4 and my parent told me to print: \0A\00"
@.str.5 = [52 x i8] c"\0A\0Athis is child 5 and my parent told me to print: \0A\00"
@.str.6 = [5 x i8] c"fork\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [22 x i8]
%7 = alloca i8
%8 = alloca [2 x i32]
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = bitcast [22 x i8]* %6 to i8*
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%17 = call i64 @pipe(i32* %16)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %251
21: ; preds = %2
%22 = call i64 (...) @fork()
store i64 %22, i64* %9
%23 = load i64, i64* %9
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %42
25: ; preds = %21
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%27 = load i32, i32* %26
%28 = call i32 @close(i32 %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %35, %25
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%32 = load i32, i32* %31
%33 = call i64 @read(i32 %32, i8* %7, i32 1)
%34 = icmp sgt i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = call i32 @write(i32 1, i8* %7, i32 1)
br label %30
37: ; preds = %30
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%39 = load i32, i32* %38
%40 = call i32 @close(i32 %39)
%41 = call i32 @_exit(i32 0)
unreachable
42: ; preds = %21
%43 = load i64, i64* %9
%44 = icmp sgt i64 %43, 0
br i1 %44, label %45, label %247
45: ; preds = %42
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%47 = load i32, i32* %46
%48 = call i32 @close(i32 %47)
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%50 = load i32, i32* %49
%51 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%52 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%53 = call i32 @strlen(i8* %52)
%54 = call i32 @write(i32 %50, i8* %51, i32 %53)
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%56 = load i32, i32* %55
%57 = call i32 @close(i32 %56)
%58 = call i32 @wait(i32* %14)
%59 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%60 = call i64 @pipe(i32* %59)
%61 = icmp slt i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %45
%63 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %251
64: ; preds = %45
%65 = call i64 (...) @fork()
store i64 %65, i64* %10
%66 = load i64, i64* %10
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %85
68: ; preds = %64
%69 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%70 = load i32, i32* %69
%71 = call i32 @close(i32 %70)
%72 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
br label %73
73: ; preds = %78, %68
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%75 = load i32, i32* %74
%76 = call i64 @read(i32 %75, i8* %7, i32 1)
%77 = icmp sgt i64 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %73
%79 = call i32 @write(i32 1, i8* %7, i32 1)
br label %73
80: ; preds = %73
%81 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%82 = load i32, i32* %81
%83 = call i32 @close(i32 %82)
%84 = call i32 @_exit(i32 0)
unreachable
85: ; preds = %64
%86 = load i64, i64* %10
%87 = icmp sgt i64 %86, 0
br i1 %87, label %88, label %243
88: ; preds = %85
%89 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%90 = load i32, i32* %89
%91 = call i32 @close(i32 %90)
%92 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%93 = load i32, i32* %92
%94 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%95 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%96 = call i32 @strlen(i8* %95)
%97 = call i32 @write(i32 %93, i8* %94, i32 %96)
%98 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%99 = load i32, i32* %98
%100 = call i32 @close(i32 %99)
%101 = call i32 @wait(i32* %14)
%102 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%103 = call i64 @pipe(i32* %102)
%104 = icmp slt i64 %103, 0
br i1 %104, label %105, label %107
105: ; preds = %88
%106 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %251
107: ; preds = %88
%108 = call i64 (...) @fork()
store i64 %108, i64* %11
%109 = load i64, i64* %11
%110 = icmp eq i64 %109, 0
br i1 %110, label %111, label %128
111: ; preds = %107
%112 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%113 = load i32, i32* %112
%114 = call i32 @close(i32 %113)
%115 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
br label %116
116: ; preds = %121, %111
%117 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%118 = load i32, i32* %117
%119 = call i64 @read(i32 %118, i8* %7, i32 1)
%120 = icmp sgt i64 %119, 0
br i1 %120, label %121, label %123
121: ; preds = %116
%122 = call i32 @write(i32 1, i8* %7, i32 1)
br label %116
123: ; preds = %116
%124 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%125 = load i32, i32* %124
%126 = call i32 @close(i32 %125)
%127 = call i32 @_exit(i32 0)
unreachable
128: ; preds = %107
%129 = load i64, i64* %11
%130 = icmp sgt i64 %129, 0
br i1 %130, label %131, label %239
131: ; preds = %128
%132 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%133 = load i32, i32* %132
%134 = call i32 @close(i32 %133)
%135 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%136 = load i32, i32* %135
%137 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%138 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%139 = call i32 @strlen(i8* %138)
%140 = call i32 @write(i32 %136, i8* %137, i32 %139)
%141 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%142 = load i32, i32* %141
%143 = call i32 @close(i32 %142)
%144 = call i32 @wait(i32* %14)
%145 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%146 = call i64 @pipe(i32* %145)
%147 = icmp slt i64 %146, 0
br i1 %147, label %148, label %150
148: ; preds = %131
%149 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %251
150: ; preds = %131
%151 = call i64 (...) @fork()
store i64 %151, i64* %12
%152 = load i64, i64* %12
%153 = icmp eq i64 %152, 0
br i1 %153, label %154, label %171
154: ; preds = %150
%155 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%156 = load i32, i32* %155
%157 = call i32 @close(i32 %156)
%158 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
br label %159
159: ; preds = %164, %154
%160 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%161 = load i32, i32* %160
%162 = call i64 @read(i32 %161, i8* %7, i32 1)
%163 = icmp sgt i64 %162, 0
br i1 %163, label %164, label %166
164: ; preds = %159
%165 = call i32 @write(i32 1, i8* %7, i32 1)
br label %159
166: ; preds = %159
%167 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%168 = load i32, i32* %167
%169 = call i32 @close(i32 %168)
%170 = call i32 @_exit(i32 0)
unreachable
171: ; preds = %150
%172 = load i64, i64* %12
%173 = icmp sgt i64 %172, 0
br i1 %173, label %174, label %235
174: ; preds = %171
%175 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%176 = load i32, i32* %175
%177 = call i32 @close(i32 %176)
%178 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%179 = load i32, i32* %178
%180 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%181 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%182 = call i32 @strlen(i8* %181)
%183 = call i32 @write(i32 %179, i8* %180, i32 %182)
%184 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%185 = load i32, i32* %184
%186 = call i32 @close(i32 %185)
%187 = call i32 @wait(i32* %14)
%188 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%189 = call i64 @pipe(i32* %188)
%190 = icmp slt i64 %189, 0
br i1 %190, label %191, label %193
191: ; preds = %174
%192 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %251
193: ; preds = %174
%194 = call i64 (...) @fork()
store i64 %194, i64* %13
%195 = load i64, i64* %13
%196 = icmp eq i64 %195, 0
br i1 %196, label %197, label %214
197: ; preds = %193
%198 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%199 = load i32, i32* %198
%200 = call i32 @close(i32 %199)
%201 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
br label %202
202: ; preds = %207, %197
%203 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%204 = load i32, i32* %203
%205 = call i64 @read(i32 %204, i8* %7, i32 1)
%206 = icmp sgt i64 %205, 0
br i1 %206, label %207, label %209
207: ; preds = %202
%208 = call i32 @write(i32 1, i8* %7, i32 1)
br label %202
209: ; preds = %202
%210 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%211 = load i32, i32* %210
%212 = call i32 @close(i32 %211)
%213 = call i32 @_exit(i32 0)
unreachable
214: ; preds = %193
%215 = load i64, i64* %13
%216 = icmp sgt i64 %215, 0
br i1 %216, label %217, label %231
217: ; preds = %214
%218 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%219 = load i32, i32* %218
%220 = call i32 @close(i32 %219)
%221 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%222 = load i32, i32* %221
%223 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%224 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%225 = call i32 @strlen(i8* %224)
%226 = call i32 @write(i32 %222, i8* %223, i32 %225)
%227 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%228 = load i32, i32* %227
%229 = call i32 @close(i32 %228)
%230 = call i32 @wait(i32* %14)
br label %233
231: ; preds = %214
%232 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %251
233: ; preds = %217
br label %234
234: ; preds = %233
br label %237
235: ; preds = %171
%236 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %251
237: ; preds = %234
br label %238
238: ; preds = %237
br label %241
239: ; preds = %128
%240 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %251
241: ; preds = %238
br label %242
242: ; preds = %241
br label %245
243: ; preds = %85
%244 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %251
245: ; preds = %242
br label %246
246: ; preds = %245
br label %249
247: ; preds = %42
%248 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %251
249: ; preds = %246
br label %250
250: ; preds = %249
store i32 0, i32* %3
br label %251
251: ; preds = %250, %247, %243, %239, %235, %231, %191, %148, %105, %62, %19
%252 = load i32, i32* %3
ret i32 %252
}

LLVM IR (-O2):
@__const.main.hello = [22 x i8] c"Happy mashujaa day!!\0A\00"
@.str = [5 x i8] c"pipe\00"
@.str.6 = [5 x i8] c"fork\00"
@str = [51 x i8] c"\0A\0Athis is child 5 and my parent told me to print: \00"
@str.7 = [51 x i8] c"\0A\0Athis is child 4 and my parent told me to print: \00"
@str.8 = [51 x i8] c"\0A\0Athis is child 3 and my parent told me to print: \00"
@str.9 = [51 x i8] c"\0A\0Athis is child 2 and my parent told me to print: \00"
@str.10 = [51 x i8] c"\0A\0Athis is child 1 and my parent told me to print: \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [22 x i8]
%4 = alloca i8
%5 = alloca [2 x i32]
%6 = alloca i32
%7 = getelementptr inbounds [22 x i8], [22 x i8]* %3, i64 0, i64 0
%8 = bitcast [2 x i32]* %5 to i8*
%9 = bitcast i32* %6 to i8*
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%11 = call i64 @pipe(i32* %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %193
15: ; preds = %2
%16 = call i64 (...) @fork()
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %15
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%20 = load i32, i32* %19
%21 = call i32 @close(i32 %20)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.10, i64 0, i64 0))
%23 = load i32, i32* %10
%24 = call i64 @read(i32 %23, i8* %4, i32 1)
%25 = icmp sgt i64 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %18, %26
%27 = call i32 @write(i32 1, i8* %4, i32 1)
%28 = load i32, i32* %10
%29 = call i64 @read(i32 %28, i8* %4, i32 1)
%30 = icmp sgt i64 %29, 0
br i1 %30, label %26, label %31
31: ; preds = %26, %18
%32 = load i32, i32* %10
%33 = call i32 @close(i32 %32)
%34 = call i32 @_exit(i32 0)
unreachable
35: ; preds = %15
%36 = icmp sgt i64 %16, 0
br i1 %36, label %37, label %191
37: ; preds = %35
%38 = load i32, i32* %10
%39 = call i32 @close(i32 %38)
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%41 = load i32, i32* %40
%42 = call i32 @strlen(i8* %7)
%43 = call i32 @write(i32 %41, i8* %7, i32 %42)
%44 = load i32, i32* %40
%45 = call i32 @close(i32 %44)
%46 = call i32 @wait(i32* %6)
%47 = call i64 @pipe(i32* %10)
%48 = icmp slt i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %37
%50 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %193
51: ; preds = %37
%52 = call i64 (...) @fork()
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %70
54: ; preds = %51
%55 = load i32, i32* %40
%56 = call i32 @close(i32 %55)
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.9, i64 0, i64 0))
%58 = load i32, i32* %10
%59 = call i64 @read(i32 %58, i8* %4, i32 1)
%60 = icmp sgt i64 %59, 0
br i1 %60, label %61, label %66
61: ; preds = %54, %61
%62 = call i32 @write(i32 1, i8* %4, i32 1)
%63 = load i32, i32* %10
%64 = call i64 @read(i32 %63, i8* %4, i32 1)
%65 = icmp sgt i64 %64, 0
br i1 %65, label %61, label %66
66: ; preds = %61, %54
%67 = load i32, i32* %10
%68 = call i32 @close(i32 %67)
%69 = call i32 @_exit(i32 0)
unreachable
70: ; preds = %51
%71 = icmp sgt i64 %52, 0
br i1 %71, label %72, label %189
72: ; preds = %70
%73 = load i32, i32* %10
%74 = call i32 @close(i32 %73)
%75 = load i32, i32* %40
%76 = call i32 @strlen(i8* %7)
%77 = call i32 @write(i32 %75, i8* %7, i32 %76)
%78 = load i32, i32* %40
%79 = call i32 @close(i32 %78)
%80 = call i32 @wait(i32* %6)
%81 = call i64 @pipe(i32* %10)
%82 = icmp slt i64 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %72
%84 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %193
85: ; preds = %72
%86 = call i64 (...) @fork()
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %104
88: ; preds = %85
%89 = load i32, i32* %40
%90 = call i32 @close(i32 %89)
%91 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.8, i64 0, i64 0))
%92 = load i32, i32* %10
%93 = call i64 @read(i32 %92, i8* %4, i32 1)
%94 = icmp sgt i64 %93, 0
br i1 %94, label %95, label %100
95: ; preds = %88, %95
%96 = call i32 @write(i32 1, i8* %4, i32 1)
%97 = load i32, i32* %10
%98 = call i64 @read(i32 %97, i8* %4, i32 1)
%99 = icmp sgt i64 %98, 0
br i1 %99, label %95, label %100
100: ; preds = %95, %88
%101 = load i32, i32* %10
%102 = call i32 @close(i32 %101)
%103 = call i32 @_exit(i32 0)
unreachable
104: ; preds = %85
%105 = icmp sgt i64 %86, 0
br i1 %105, label %106, label %187
106: ; preds = %104
%107 = load i32, i32* %10
%108 = call i32 @close(i32 %107)
%109 = load i32, i32* %40
%110 = call i32 @strlen(i8* %7)
%111 = call i32 @write(i32 %109, i8* %7, i32 %110)
%112 = load i32, i32* %40
%113 = call i32 @close(i32 %112)
%114 = call i32 @wait(i32* %6)
%115 = call i64 @pipe(i32* %10)
%116 = icmp slt i64 %115, 0
br i1 %116, label %117, label %119
117: ; preds = %106
%118 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %193
119: ; preds = %106
%120 = call i64 (...) @fork()
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %138
122: ; preds = %119
%123 = load i32, i32* %40
%124 = call i32 @close(i32 %123)
%125 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.7, i64 0, i64 0))
%126 = load i32, i32* %10
%127 = call i64 @read(i32 %126, i8* %4, i32 1)
%128 = icmp sgt i64 %127, 0
br i1 %128, label %129, label %134
129: ; preds = %122, %129
%130 = call i32 @write(i32 1, i8* %4, i32 1)
%131 = load i32, i32* %10
%132 = call i64 @read(i32 %131, i8* %4, i32 1)
%133 = icmp sgt i64 %132, 0
br i1 %133, label %129, label %134
134: ; preds = %129, %122
%135 = load i32, i32* %10
%136 = call i32 @close(i32 %135)
%137 = call i32 @_exit(i32 0)
unreachable
138: ; preds = %119
%139 = icmp sgt i64 %120, 0
br i1 %139, label %140, label %185
140: ; preds = %138
%141 = load i32, i32* %10
%142 = call i32 @close(i32 %141)
%143 = load i32, i32* %40
%144 = call i32 @strlen(i8* %7)
%145 = call i32 @write(i32 %143, i8* %7, i32 %144)
%146 = load i32, i32* %40
%147 = call i32 @close(i32 %146)
%148 = call i32 @wait(i32* %6)
%149 = call i64 @pipe(i32* %10)
%150 = icmp slt i64 %149, 0
br i1 %150, label %151, label %153
151: ; preds = %140
%152 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %193
153: ; preds = %140
%154 = call i64 (...) @fork()
%155 = icmp eq i64 %154, 0
br i1 %155, label %156, label %172
156: ; preds = %153
%157 = load i32, i32* %40
%158 = call i32 @close(i32 %157)
%159 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%160 = load i32, i32* %10
%161 = call i64 @read(i32 %160, i8* %4, i32 1)
%162 = icmp sgt i64 %161, 0
br i1 %162, label %163, label %168
163: ; preds = %156, %163
%164 = call i32 @write(i32 1, i8* %4, i32 1)
%165 = load i32, i32* %10
%166 = call i64 @read(i32 %165, i8* %4, i32 1)
%167 = icmp sgt i64 %166, 0
br i1 %167, label %163, label %168
168: ; preds = %163, %156
%169 = load i32, i32* %10
%170 = call i32 @close(i32 %169)
%171 = call i32 @_exit(i32 0)
unreachable
172: ; preds = %153
%173 = icmp sgt i64 %154, 0
br i1 %173, label %174, label %183
174: ; preds = %172
%175 = load i32, i32* %10
%176 = call i32 @close(i32 %175)
%177 = load i32, i32* %40
%178 = call i32 @strlen(i8* %7)
%179 = call i32 @write(i32 %177, i8* %7, i32 %178)
%180 = load i32, i32* %40
%181 = call i32 @close(i32 %180)
%182 = call i32 @wait(i32* %6)
br label %193
183: ; preds = %172
%184 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %193
185: ; preds = %138
%186 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %193
187: ; preds = %104
%188 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %193
189: ; preds = %70
%190 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %193
191: ; preds = %35
%192 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %193
193: ; preds = %174, %191, %189, %187, %185, %183, %151, %117, %83, %49, %13
%194 = phi i32 [ 1, %13 ], [ 1, %49 ], [ 1, %83 ], [ 1, %117 ], [ 1, %151 ], [ 0, %174 ], [ 1, %183 ], [ 1, %185 ], [ 1, %187 ], [ 1, %189 ], [ 1, %191 ]
ret i32 %194
}