#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;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int S_IFIFO;
int /*<<< orphan*/ clearBuffer(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fork();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
scalar_t__ isNotVowel(char);
int /*<<< orphan*/ mknod(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ pipe(int *);
scalar_t__ read(int, char *, int);
int strlen(char *);
char tolower(char);
int /*<<< orphan*/ umask(int /*<<< orphan*/);
int /*<<< orphan*/ wait(int *);
scalar_t__ write(int, char *, int);
int main(void) {
  FILE *fp1, *fp2;
  char buffer[80] = {0};
  char modified[80] = {0};
  pid_t childPid;
  int child_status;
  int fd1[2];
  int fd2[2];
  int i, p;
  umask(0);
  mknod("PRE_PIPE", S_IFIFO | 0666, 0);
  while (1) {
    clearBuffer(buffer);
    clearBuffer(modified);
    fp1 = fopen("PRE_PIPE", "r");
    fgets(buffer, 80, fp1);
    fclose(fp1);
    if (pipe(fd1) < 0) {
      perror("pipe1");
      exit(1);
    }
    if (pipe(fd2) < 0) {
      perror("pipe2");
      exit(1);
    }
    childPid = fork();
    if (childPid < 0) {
      perror("fork");
      exit(2);
    } else if (childPid == 0) {
      close(fd1[1]);
      if (read(fd1[0], modified, 80) < 0) {
        perror("read");
        exit(3);
      }
      p = 0;
      for (i = 0; i < strlen(modified); i++) {
        modified[i] = tolower(modified[i]);
        char c = modified[i];
        if (isNotVowel(c)) {
          modified[p] = c;
          p++;
        }
      }
      modified[p] = '\0';
      close(fd2[0]);
      if (write(fd2[1], modified, strlen(modified)) < 0) {
        perror("write");
        exit(4);
      }
      exit(0);
    } else {
      close(fd1[0]);
      if (write(fd1[1], buffer, strlen(buffer)) < 0) {
        perror("write");
        exit(5);
      }
      close(fd2[1]);
      if (read(fd2[0], modified, 80) < 0) {
        perror("read");
        exit(6);
      }
    }
    wait(&child_status);
    fp2 = fopen("POST_PIPE", "w");
    fputs(modified, fp2);
    fclose(fp2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1080 <memset@plt>
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1080 <memset@plt>
xor    %edi,%edi
call   10d0 <umask@plt>
mov    0x2d6d(%rip),%rax
mov    (%rax),%esi
or     $0x1b6,%esi
lea    0xd7e(%rip),%rdi
xor    %edx,%edx
call   10e0 <mknod@plt>
lea    -0x70(%rbp),%rdi
call   1050 <clearBuffer@plt>
lea    -0xc0(%rbp),%rdi
call   1050 <clearBuffer@plt>
lea    0xd5b(%rip),%rdi
lea    0xd5d(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x50,%esi
call   10c0 <fgets@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0xd4(%rbp),%rdi
call   10a0 <pipe@plt>
cmp    $0x0,%rax
jge    12fc <main+0xcc>
lea    0xd1e(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
lea    -0xdc(%rbp),%rdi
call   10a0 <pipe@plt>
cmp    $0x0,%rax
jge    1328 <main+0xf8>
lea    0xcf8(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    $0x0,%al
call   1150 <fork@plt>
mov    %rax,-0xc8(%rbp)
cmpq   $0x0,-0xc8(%rbp)
jge    135a <main+0x12a>
lea    0xccc(%rip),%rdi
call   1120 <perror@plt>
mov    $0x2,%edi
call   1130 <exit@plt>
cmpq   $0x0,-0xc8(%rbp)
jne    14eb <main+0x2bb>
mov    -0xd0(%rbp),%edi
call   1090 <close@plt>
mov    -0xd4(%rbp),%edi
lea    -0xc0(%rbp),%rsi
mov    $0x50,%edx
call   10b0 <read@plt>
cmp    $0x0,%rax
jge    13aa <main+0x17a>
lea    0xc81(%rip),%rdi
call   1120 <perror@plt>
mov    $0x3,%edi
call   1130 <exit@plt>
movl   $0x0,-0xe4(%rbp)
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
mov    %eax,-0xec(%rbp)
lea    -0xc0(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0xec(%rbp),%eax
cmp    %ecx,%eax
jge    1470 <main+0x240>
movslq -0xe0(%rbp),%rax
movsbl -0xc0(%rbp,%rax,1),%edi
ff
call   1100 <tolower@plt>
mov    %al,%cl
movslq -0xe0(%rbp),%rax
mov    %cl,-0xc0(%rbp,%rax,1)
movslq -0xe0(%rbp),%rax
mov    -0xc0(%rbp,%rax,1),%al
mov    %al,-0xe5(%rbp)
movsbl -0xe5(%rbp),%edi
call   10f0 <isNotVowel@plt>
cmp    $0x0,%rax
je     1457 <main+0x227>
mov    -0xe5(%rbp),%cl
movslq -0xe4(%rbp),%rax
mov    %cl,-0xc0(%rbp,%rax,1)
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    145c <main+0x22c>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    13be <main+0x18e>
movslq -0xe4(%rbp),%rax
movb   $0x0,-0xc0(%rbp,%rax,1)
mov    -0xdc(%rbp),%edi
call   1090 <close@plt>
mov    -0xd8(%rbp),%eax
mov    %eax,-0xfc(%rbp)
lea    -0xc0(%rbp),%rax
mov    %rax,-0xf8(%rbp)
lea    -0xc0(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0xfc(%rbp),%edi
mov    -0xf8(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    14e4 <main+0x2b4>
lea    0xb4c(%rip),%rdi
call   1120 <perror@plt>
mov    $0x4,%edi
call   1130 <exit@plt>
xor    %edi,%edi
call   1130 <exit@plt>
mov    -0xd4(%rbp),%edi
call   1090 <close@plt>
mov    -0xd0(%rbp),%eax
mov    %eax,-0x10c(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x108(%rbp)
lea    -0x70(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x10c(%rbp),%edi
mov    -0x108(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    154a <main+0x31a>
lea    0xae6(%rip),%rdi
call   1120 <perror@plt>
mov    $0x5,%edi
call   1130 <exit@plt>
mov    -0xd8(%rbp),%edi
call   1090 <close@plt>
mov    -0xdc(%rbp),%edi
lea    -0xc0(%rbp),%rsi
mov    $0x50,%edx
call   10b0 <read@plt>
cmp    $0x0,%rax
jge    158c <main+0x35c>
lea    0xa9f(%rip),%rdi
call   1120 <perror@plt>
mov    $0x6,%edi
call   1130 <exit@plt>
jmp    1591 <main+0x361>
jmp    1596 <main+0x366>
lea    -0xcc(%rbp),%rdi
call   1140 <wait@plt>
lea    0xa7e(%rip),%rdi
lea    0xa81(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1289 <main+0x59>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
xor    %edi,%edi
call   10c0 <umask@plt>
mov    0x2d60(%rip),%rax
mov    $0x1b6,%esi
or     (%rax),%esi
lea    0xd72(%rip),%rdi
xor    %edx,%edx
call   10d0 <mknod@plt>
lea    0x70(%rsp),%rbx
lea    0x20(%rsp),%r15
lea    0x1c(%rsp),%r14
lea    0xd7c(%rip),%r12
lea    0xd7f(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <clearBuffer@plt>
mov    %r15,%rdi
call   1050 <clearBuffer@plt>
lea    0xd29(%rip),%rdi
lea    0xd2b(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %rax,%rdx
call   10b0 <fgets@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
lea    0x14(%rsp),%rdi
call   1090 <pipe@plt>
test   %rax,%rax
js     13b5 <main+0x195>
lea    0xc(%rsp),%rdi
call   1090 <pipe@plt>
test   %rax,%rax
js     13be <main+0x19e>
xor    %eax,%eax
call   1140 <fork@plt>
test   %rax,%rax
js     13d4 <main+0x1b4>
je     13ea <main+0x1ca>
mov    0x14(%rsp),%edi
call   1080 <close@plt>
mov    0x18(%rsp),%ebp
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %rax,%rax
js     1421 <main+0x201>
mov    0x10(%rsp),%edi
call   1080 <close@plt>
mov    0xc(%rsp),%edi
mov    %r15,%rsi
mov    $0x50,%edx
call   10a0 <read@plt>
test   %rax,%rax
js     1437 <main+0x217>
mov    %r14,%rdi
call   1130 <wait@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1100 <fopen@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    %rax,%rsi
call   1070 <fputs@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
jmp    12c0 <main+0xa0>
lea    0xc4f(%rip),%rdi
jmp    13c5 <main+0x1a5>
lea    0xc4c(%rip),%rdi
call   1110 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
lea    0xc3c(%rip),%rdi
call   1110 <perror@plt>
mov    $0x2,%edi
call   1120 <exit@plt>
mov    0x18(%rsp),%edi
call   1080 <close@plt>
mov    0x14(%rsp),%edi
lea    0x20(%rsp),%rsi
mov    $0x50,%edx
call   10a0 <read@plt>
test   %rax,%rax
jns    144d <main+0x22d>
lea    0xc0a(%rip),%rdi
call   1110 <perror@plt>
mov    $0x3,%edi
call   1120 <exit@plt>
lea    0xbf9(%rip),%rdi
call   1110 <perror@plt>
mov    $0x5,%edi
call   1120 <exit@plt>
lea    0xbde(%rip),%rdi
call   1110 <perror@plt>
mov    $0x6,%edi
call   1120 <exit@plt>
lea    0x20(%rsp),%rdi
call   1060 <strlen@plt>
xor    %r15d,%r15d
test   %eax,%eax
jle    14ae <main+0x28e>
xor    %ebp,%ebp
lea    0x20(%rsp),%r14
xor    %r15d,%r15d
jmp    1483 <main+0x263>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
mov    %r14,%rdi
call   1060 <strlen@plt>
cltq
cmp    %rax,%rbp
jge    14ae <main+0x28e>
movsbl 0x20(%rsp,%rbp,1),%edi
call   10f0 <tolower@plt>
mov    %eax,%ebx
mov    %al,0x20(%rsp,%rbp,1)
movsbl %al,%edi
call   10e0 <isNotVowel@plt>
test   %rax,%rax
je     1470 <main+0x250>
movslq %r15d,%r15
mov    %bl,0x20(%rsp,%r15,1)
add    $0x1,%r15d
jmp    1470 <main+0x250>
movslq %r15d,%rax
movb   $0x0,0x20(%rsp,%rax,1)
mov    0xc(%rsp),%edi
call   1080 <close@plt>
mov    0x10(%rsp),%ebx
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %rax,%rax
jns    14f7 <main+0x2d7>
lea    0xb39(%rip),%rdi
call   1110 <perror@plt>
mov    $0x4,%edi
call   1120 <exit@plt>
xor    %edi,%edi
call   1120 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"PRE_PIPE\00"
@S_IFIFO = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"pipe1\00"
@.str.3 = [6 x i8] c"pipe2\00"
@.str.4 = [5 x i8] c"fork\00"
@.str.5 = [5 x i8] c"read\00"
@.str.6 = [6 x i8] c"write\00"
@.str.7 = [10 x i8] c"POST_PIPE\00"
@.str.8 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [80 x i8]
%5 = alloca [80 x i8]
%6 = alloca i64
%7 = alloca i32
%8 = alloca [2 x i32]
%9 = alloca [2 x i32]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8
store i32 0, i32* %1
%13 = bitcast [80 x i8]* %4 to i8*
%14 = bitcast [80 x i8]* %5 to i8*
%15 = call i32 @umask(i32 0)
%16 = load i32, i32* @S_IFIFO
%17 = or i32 %16, 438
%18 = call i32 @mknod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %17, i32 0)
br label %19
19: ; preds = %0, %145
%20 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%21 = call i32 @clearBuffer(i8* %20)
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%23 = call i32 @clearBuffer(i8* %22)
%24 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %24, i32** %2
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%26 = load i32*, i32** %2
%27 = call i32 @fgets(i8* %25, i32 80, i32* %26)
%28 = load i32*, i32** %2
%29 = call i32 @fclose(i32* %28)
%30 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%31 = call i64 @pipe(i32* %30)
%32 = icmp slt i64 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %19
%34 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %19
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%38 = call i64 @pipe(i32* %37)
%39 = icmp slt i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %36
%44 = call i64 (...) @fork()
store i64 %44, i64* %6
%45 = load i64, i64* %6
%46 = icmp slt i64 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %43
%48 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%49 = call i32 @exit(i32 2)
unreachable
50: ; preds = %43
%51 = load i64, i64* %6
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %117
53: ; preds = %50
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%55 = load i32, i32* %54
%56 = call i32 @close(i32 %55)
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%58 = load i32, i32* %57
%59 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%60 = call i64 @read(i32 %58, i8* %59, i32 80)
%61 = icmp slt i64 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %53
%63 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%64 = call i32 @exit(i32 3)
unreachable
65: ; preds = %53
store i32 0, i32* %11
store i32 0, i32* %10
br label %66
66: ; preds = %95, %65
%67 = load i32, i32* %10
%68 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%69 = call i32 @strlen(i8* %68)
%70 = icmp slt i32 %67, %69
br i1 %70, label %71, label %98
71: ; preds = %66
%72 = load i32, i32* %10
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = call signext i8 @tolower(i8 signext %75)
%77 = load i32, i32* %10
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %78
store i8 %76, i8* %79
%80 = load i32, i32* %10
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %81
%83 = load i8, i8* %82
store i8 %83, i8* %12
%84 = load i8, i8* %12
%85 = call i64 @isNotVowel(i8 signext %84)
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %94
87: ; preds = %71
%88 = load i8, i8* %12
%89 = load i32, i32* %11
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %90
store i8 %88, i8* %91
%92 = load i32, i32* %11
%93 = add nsw i32 %92, 1
store i32 %93, i32* %11
br label %94
94: ; preds = %87, %71
br label %95
95: ; preds = %94
%96 = load i32, i32* %10
%97 = add nsw i32 %96, 1
store i32 %97, i32* %10
br label %66
98: ; preds = %66
%99 = load i32, i32* %11
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %100
store i8 0, i8* %101
%102 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%103 = load i32, i32* %102
%104 = call i32 @close(i32 %103)
%105 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%106 = load i32, i32* %105
%107 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%108 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%109 = call i32 @strlen(i8* %108)
%110 = call i64 @write(i32 %106, i8* %107, i32 %109)
%111 = icmp slt i64 %110, 0
br i1 %111, label %112, label %115
112: ; preds = %98
%113 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%114 = call i32 @exit(i32 4)
unreachable
115: ; preds = %98
%116 = call i32 @exit(i32 0)
unreachable
117: ; preds = %50
%118 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%119 = load i32, i32* %118
%120 = call i32 @close(i32 %119)
%121 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%122 = load i32, i32* %121
%123 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%124 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%125 = call i32 @strlen(i8* %124)
%126 = call i64 @write(i32 %122, i8* %123, i32 %125)
%127 = icmp slt i64 %126, 0
br i1 %127, label %128, label %131
128: ; preds = %117
%129 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%130 = call i32 @exit(i32 5)
unreachable
131: ; preds = %117
%132 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%133 = load i32, i32* %132
%134 = call i32 @close(i32 %133)
%135 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%136 = load i32, i32* %135
%137 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%138 = call i64 @read(i32 %136, i8* %137, i32 80)
%139 = icmp slt i64 %138, 0
br i1 %139, label %140, label %143
140: ; preds = %131
%141 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%142 = call i32 @exit(i32 6)
unreachable
143: ; preds = %131
br label %144
144: ; preds = %143
br label %145
145: ; preds = %144
%146 = call i32 @wait(i32* %7)
%147 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %147, i32** %3
%148 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%149 = load i32*, i32** %3
%150 = call i32 @fputs(i8* %148, i32* %149)
%151 = load i32*, i32** %3
%152 = call i32 @fclose(i32* %151)
br label %19
}

LLVM IR (-O2):
@.str = [9 x i8] c"PRE_PIPE\00"
@S_IFIFO = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"pipe1\00"
@.str.3 = [6 x i8] c"pipe2\00"
@.str.4 = [5 x i8] c"fork\00"
@.str.5 = [5 x i8] c"read\00"
@.str.6 = [6 x i8] c"write\00"
@.str.7 = [10 x i8] c"POST_PIPE\00"
@.str.8 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca [2 x i32]
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = bitcast i32* %3 to i8*
%9 = bitcast [2 x i32]* %4 to i8*
%10 = bitcast [2 x i32]* %5 to i8*
%11 = tail call i32 @umask(i32 0)
%12 = load i32, i32* @S_IFIFO
%13 = or i32 %12, 438
%14 = tail call i32 @mknod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %13, i32 0)
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
br label %19
19: ; preds = %108, %0
%20 = call i32 @clearBuffer(i8* %6)
%21 = call i32 @clearBuffer(i8* %7)
%22 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 @fgets(i8* %6, i32 80, i32* %22)
%24 = call i32 @fclose(i32* %22)
%25 = call i64 @pipe(i32* %15)
%26 = icmp slt i64 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %19
%28 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %19
%31 = call i64 @pipe(i32* %16)
%32 = icmp slt i64 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %30
%37 = call i64 (...) @fork()
%38 = icmp slt i64 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%41 = call i32 @exit(i32 2)
unreachable
42: ; preds = %36
%43 = icmp eq i64 %37, 0
br i1 %43, label %44, label %89
44: ; preds = %42
%45 = load i32, i32* %17
%46 = call i32 @close(i32 %45)
%47 = load i32, i32* %15
%48 = call i64 @read(i32 %47, i8* %7, i32 80)
%49 = icmp slt i64 %48, 0
br i1 %49, label %53, label %50
50: ; preds = %44
%51 = call i32 @strlen(i8* %7)
%52 = icmp sgt i32 %51, 0
br i1 %52, label %56, label %74
53: ; preds = %44
%54 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%55 = call i32 @exit(i32 3)
unreachable
56: ; preds = %50, %68
%57 = phi i64 [ %70, %68 ], [ 0, %50 ]
%58 = phi i32 [ %69, %68 ], [ 0, %50 ]
%59 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %57
%60 = load i8, i8* %59
%61 = call signext i8 @tolower(i8 signext %60)
store i8 %61, i8* %59
%62 = call i64 @isNotVowel(i8 signext %61)
%63 = icmp eq i64 %62, 0
br i1 %63, label %68, label %64
64: ; preds = %56
%65 = sext i32 %58 to i64
%66 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %65
store i8 %61, i8* %66
%67 = add nsw i32 %58, 1
br label %68
68: ; preds = %64, %56
%69 = phi i32 [ %67, %64 ], [ %58, %56 ]
%70 = add nuw nsw i64 %57, 1
%71 = call i32 @strlen(i8* %7)
%72 = sext i32 %71 to i64
%73 = icmp slt i64 %70, %72
br i1 %73, label %56, label %74
74: ; preds = %68, %50
%75 = phi i32 [ 0, %50 ], [ %69, %68 ]
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %76
store i8 0, i8* %77
%78 = load i32, i32* %16
%79 = call i32 @close(i32 %78)
%80 = load i32, i32* %18
%81 = call i32 @strlen(i8* %7)
%82 = call i64 @write(i32 %80, i8* %7, i32 %81)
%83 = icmp slt i64 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %74
%85 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%86 = call i32 @exit(i32 4)
unreachable
87: ; preds = %74
%88 = call i32 @exit(i32 0)
unreachable
89: ; preds = %42
%90 = load i32, i32* %15
%91 = call i32 @close(i32 %90)
%92 = load i32, i32* %17
%93 = call i32 @strlen(i8* %6)
%94 = call i64 @write(i32 %92, i8* %6, i32 %93)
%95 = icmp slt i64 %94, 0
br i1 %95, label %96, label %99
96: ; preds = %89
%97 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%98 = call i32 @exit(i32 5)
unreachable
99: ; preds = %89
%100 = load i32, i32* %18
%101 = call i32 @close(i32 %100)
%102 = load i32, i32* %16
%103 = call i64 @read(i32 %102, i8* %7, i32 80)
%104 = icmp slt i64 %103, 0
br i1 %104, label %105, label %108
105: ; preds = %99
%106 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%107 = call i32 @exit(i32 6)
unreachable
108: ; preds = %99
%109 = call i32 @wait(i32* %3)
%110 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%111 = call i32 @fputs(i8* %7, i32* %110)
%112 = call i32 @fclose(i32* %110)
br label %19
}