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

/* Variables and functions */
char *disemvowel(char *);
int /*<<< orphan*/ disemvowelFile(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
scalar_t__ getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  FILE *inputFile;
  FILE *outputFile;
  char *line;
  size_t size;
  if (argc == 2) {
    char buffer[1024];
    int inputSize;
    char *result;
    inputFile = fopen(argv[1], "r");
    while (!feof(inputFile)) {
      inputSize = fread(buffer, 1, 1024, inputFile);
      buffer[inputSize] = '\0';
      result = disemvowel(buffer);
      printf("%s\n", result);
    }
    free(result);
    fclose(inputFile);
  } else if (argc == 3) {
    inputFile = fopen(argv[1], "r");
    outputFile = fopen(argv[2], "w");
    disemvowelFile(inputFile, outputFile);
  } else {
    line = NULL;
    while (getline(&line, &size, stdin) > 0) {
      char *result = disemvowel(line);
      printf("%s", result);
      free(result);
    }
    free(line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    125d <main+0xcd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3e(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11e9 <main+0x59>
jmp    1243 <main+0xb3>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   1060 <fread@plt>
mov    %eax,-0x434(%rbp)
movslq -0x434(%rbp),%rax
movb   $0x0,-0x430(%rbp,%rax,1)
lea    -0x430(%rbp),%rdi
call   1040 <disemvowel@plt>
mov    %rax,-0x440(%rbp)
mov    -0x440(%rbp),%rsi
lea    0xdc9(%rip),%rdi
call   1080 <printf@plt>
jmp    11cb <main+0x3b>
mov    -0x440(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1070 <fclose@plt>
jmp    1313 <main+0x183>
cmpl   $0x3,-0x8(%rbp)
jne    12a9 <main+0x119>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd8a(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd78(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <disemvowelFile@plt>
jmp    130e <main+0x17e>
movq   $0x0,-0x28(%rbp)
mov    0x2d30(%rip),%rax
mov    (%rax),%edx
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   10b0 <getline@plt>
cmp    $0x0,%rax
jle    1305 <main+0x175>
mov    -0x28(%rbp),%rdi
call   1040 <disemvowel@plt>
mov    %rax,-0x448(%rbp)
mov    -0x448(%rbp),%rsi
lea    0xd19(%rip),%rdi
call   1080 <printf@plt>
mov    -0x448(%rbp),%rdi
call   1030 <free@plt>
jmp    12b1 <main+0x121>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
jmp    1313 <main+0x183>
xor    %eax,%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x410,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
je     1233 <main+0xa3>
cmp    $0x2,%edi
jne    1263 <main+0xd3>
mov    0x8(%rbx),%rdi
lea    0xe40(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   1090 <feof@plt>
lea    0x10(%rsp),%r14
lea    0xe26(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    %r12,%rcx
call   1060 <fread@plt>
cltq
movb   $0x0,0x10(%rsp,%rax,1)
mov    %r14,%rdi
call   1040 <disemvowel@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1080 <printf@plt>
mov    %r12,%rdi
call   1090 <feof@plt>
test   %eax,%eax
je     11e0 <main+0x50>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1070 <fclose@plt>
jmp    12de <main+0x14e>
mov    0x8(%rbx),%rdi
lea    0xdc2(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
lea    0xdb5(%rip),%rsi
call   10a0 <fopen@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <disemvowelFile@plt>
jmp    12de <main+0x14e>
movq   $0x0,0x10(%rsp)
mov    0x2d75(%rip),%r13
mov    0x0(%r13),%edx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   10b0 <getline@plt>
test   %rax,%rax
jle    12d4 <main+0x144>
lea    0xd76(%rip),%r14
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%r12
nopl   0x0(%rax)
mov    0x10(%rsp),%rdi
call   1040 <disemvowel@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x0(%r13),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   10b0 <getline@plt>
test   %rax,%rax
jg     12a0 <main+0x110>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [2 x i8] c"w\00"
@stdin = global i32 0
@.str.3 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca [1024 x i8]
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %42
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %20, i32** %6
br label %21
21: ; preds = %26, %16
%22 = load i32*, i32** %6
%23 = call i32 @feof(i32* %22)
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
br i1 %25, label %26, label %37
26: ; preds = %21
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%28 = load i32*, i32** %6
%29 = call i32 @fread(i8* %27, i32 1, i32 1024, i32* %28)
store i32 %29, i32* %11
%30 = load i32, i32* %11
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 %31
store i8 0, i8* %32
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%34 = call i8* @disemvowel(i8* %33)
store i8* %34, i8** %12
%35 = load i8*, i8** %12
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %35)
br label %21
37: ; preds = %21
%38 = load i8*, i8** %12
%39 = call i32 @free(i8* %38)
%40 = load i32*, i32** %6
%41 = call i32 @fclose(i32* %40)
br label %73
42: ; preds = %2
%43 = load i32, i32* %4
%44 = icmp eq i32 %43, 3
br i1 %44, label %45, label %57
45: ; preds = %42
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i32* @fopen(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %49, i32** %6
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 2
%52 = load i8*, i8** %51
%53 = call i32* @fopen(i8* %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %53, i32** %7
%54 = load i32*, i32** %6
%55 = load i32*, i32** %7
%56 = call i32 @disemvowelFile(i32* %54, i32* %55)
br label %72
57: ; preds = %42
store i8* null, i8** %8
br label %58
58: ; preds = %62, %57
%59 = load i32, i32* @stdin
%60 = call i64 @getline(i8** %8, i64* %9, i32 %59)
%61 = icmp sgt i64 %60, 0
br i1 %61, label %62, label %69
62: ; preds = %58
%63 = load i8*, i8** %8
%64 = call i8* @disemvowel(i8* %63)
store i8* %64, i8** %13
%65 = load i8*, i8** %13
%66 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %65)
%67 = load i8*, i8** %13
%68 = call i32 @free(i8* %67)
br label %58
69: ; preds = %58
%70 = load i8*, i8** %8
%71 = call i32 @free(i8* %70)
br label %72
72: ; preds = %69, %45
br label %73
73: ; preds = %72, %37
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [2 x i8] c"w\00"
@stdin = global i32 0
@.str.3 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [1024 x i8]
%6 = bitcast i8** %3 to i8*
%7 = bitcast i64* %4 to i8*
switch i32 %0, label %34 [
i32 2, label %8
i32 3, label %26
]
8: ; preds = %2
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @feof(i32* %12)
%14 = icmp eq i32 %13, 0
br label %15
15: ; preds = %8, %15
%16 = call i32 @fread(i8* %9, i32 1, i32 1024, i32* %12)
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 %17
store i8 0, i8* %18
%19 = call i8* @disemvowel(i8* %9)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = call i32 @feof(i32* %12)
%22 = icmp eq i32 %21, 0
br i1 %22, label %15, label %23
23: ; preds = %15
%24 = call i32 @free(i8* %19)
%25 = call i32 @fclose(i32* %12)
br label %49
26: ; preds = %2
%27 = getelementptr inbounds i8*, i8** %1, i64 1
%28 = load i8*, i8** %27
%29 = tail call i32* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%30 = getelementptr inbounds i8*, i8** %1, i64 2
%31 = load i8*, i8** %30
%32 = tail call i32* @fopen(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = tail call i32 @disemvowelFile(i32* %29, i32* %32)
br label %49
34: ; preds = %2
store i8* null, i8** %3
%35 = load i32, i32* @stdin
%36 = call i64 @getline(i8** %3, i64* %4, i32 %35)
%37 = icmp sgt i64 %36, 0
br i1 %37, label %38, label %46
38: ; preds = %34, %38
%39 = load i8*, i8** %3
%40 = call i8* @disemvowel(i8* %39)
%41 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %40)
%42 = call i32 @free(i8* %40)
%43 = load i32, i32* @stdin
%44 = call i64 @getline(i8** %3, i64* %4, i32 %43)
%45 = icmp sgt i64 %44, 0
br i1 %45, label %38, label %46
46: ; preds = %38, %34
%47 = load i8*, i8** %3
%48 = call i32 @free(i8* %47)
br label %49
49: ; preds = %26, %46, %23
ret i32 0
}