#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 */
int EOF;
int /*<<< orphan*/ contains_all(char *, char *);
int contains_one(char *, char *);
scalar_t__ contains_two_letters_in_row(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
size_t fread(char *, int, int, int /*<<< orphan*/ *);
int readline(char *, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  FILE *file;
  size_t size_read;
  char buffer[65536];
  int chars_read;
  char line[512];
  char *rbuf_tmp;
  int count = 0;
  if (argc < 2) {
    fprintf(stdout, "Usage: %s <file>\n", argv[0]);
    return 0;
  }
  file = fopen(argv[1], "rb");
  if (!file) {
    fprintf(stderr, "Error: Opening File: %s\n", argv[1]);
    return 1;
  }
loop:
  size_read = fread(buffer, sizeof(char), 65536, file);
  rbuf_tmp = buffer;
  while ((chars_read = readline(rbuf_tmp, line, 512)) != EOF) {
    if (contains_one(line, "aeiou") >= 3 && contains_two_letters_in_row(line) &&
        !contains_all(line, "ab") && !contains_all(line, "cd") &&
        !contains_all(line, "pq") && !contains_all(line, "xy")) {
      count++;
    }
    rbuf_tmp = rbuf_tmp + chars_read + 1;
  }
  if (size_read == 65536) {
    goto loop;
  }
  fprintf(stdout, "Contains %d nice strings.\n", count);
  fclose(file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10240,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1023c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11d7 <main+0x57>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe3c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1395 <main+0x215>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2c(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1225 <main+0xa5>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe03(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1395 <main+0x215>
jmp    122a <main+0xaa>
lea    -0x10020(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x10000,%edx
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
lea    -0x10020(%rbp),%rax
mov    %rax,-0x10238(%rbp)
mov    -0x10238(%rbp),%rdi
lea    -0x10230(%rbp),%rsi
mov    $0x200,%edx
call   1050 <readline@plt>
mov    %eax,-0x10024(%rbp)
mov    0x2d6d(%rip),%rcx
cmp    (%rcx),%eax
je     1355 <main+0x1d5>
lea    -0x10230(%rbp),%rdi
lea    0xd9d(%rip),%rsi
call   10a0 <contains_one@plt>
cmp    $0x3,%eax
jl     1334 <main+0x1b4>
lea    -0x10230(%rbp),%rdi
call   1080 <contains_two_letters_in_row@plt>
cmp    $0x0,%rax
je     1334 <main+0x1b4>
lea    -0x10230(%rbp),%rdi
lea    0xd71(%rip),%rsi
call   1070 <contains_all@plt>
cmp    $0x0,%eax
jne    1334 <main+0x1b4>
lea    -0x10230(%rbp),%rdi
lea    0xd58(%rip),%rsi
call   1070 <contains_all@plt>
cmp    $0x0,%eax
jne    1334 <main+0x1b4>
lea    -0x10230(%rbp),%rdi
lea    0xd3f(%rip),%rsi
call   1070 <contains_all@plt>
cmp    $0x0,%eax
jne    1334 <main+0x1b4>
lea    -0x10230(%rbp),%rdi
lea    0xd26(%rip),%rsi
call   1070 <contains_all@plt>
cmp    $0x0,%eax
jne    1334 <main+0x1b4>
mov    -0x1023c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1023c(%rbp)
mov    -0x10238(%rbp),%rax
movslq -0x10024(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x10238(%rbp)
jmp    1256 <main+0xd6>
cmpq   $0x10000,-0x20(%rbp)
jne    1368 <main+0x1e8>
jmp    122a <main+0xaa>
mov    0x2c61(%rip),%rax
mov    (%rax),%edi
mov    -0x1023c(%rbp),%edx
lea    0xcc2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10228,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     11ba <main+0x3a>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe54(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1339 <main+0x1b9>
mov    0x8(%rbx),%rdi
lea    0xe4d(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
je     1319 <main+0x199>
movl   $0x0,0xc(%rsp)
lea    0x220(%rsp),%r12
lea    0x20(%rsp),%rbx
mov    0x2df4(%rip),%r15
lea    0xe33(%rip),%r13
lea    0xe32(%rip),%rbp
jmp    1227 <main+0xa7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpq   $0x10000,0x18(%rsp)
lea    0x220(%rsp),%r12
jne    12f0 <main+0x170>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x10000,%edx
mov    0x10(%rsp),%rcx
call   1030 <fread@plt>
mov    %rax,0x18(%rsp)
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x200,%edx
call   1050 <readline@plt>
cmp    (%r15),%eax
je     1210 <main+0x90>
mov    %eax,%r14d
jmp    1282 <main+0x102>
nopl   (%rax)
movslq %r14d,%rax
add    %rax,%r12
add    $0x1,%r12
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x200,%edx
call   1050 <readline@plt>
mov    %eax,%r14d
cmp    (%r15),%eax
je     1210 <main+0x90>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <contains_one@plt>
cmp    $0x3,%eax
jl     1260 <main+0xe0>
mov    %rbx,%rdi
call   1080 <contains_two_letters_in_row@plt>
test   %rax,%rax
je     1260 <main+0xe0>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1070 <contains_all@plt>
test   %eax,%eax
jne    1260 <main+0xe0>
mov    %rbx,%rdi
lea    0xd7f(%rip),%rsi
call   1070 <contains_all@plt>
test   %eax,%eax
jne    1260 <main+0xe0>
mov    %rbx,%rdi
lea    0xd6f(%rip),%rsi
call   1070 <contains_all@plt>
test   %eax,%eax
jne    1260 <main+0xe0>
mov    %rbx,%rdi
lea    0xd5f(%rip),%rsi
call   1070 <contains_all@plt>
cmp    $0x1,%eax
adcl   $0x0,0xc(%rsp)
jmp    1260 <main+0xe0>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
lea    0xd40(%rip),%rsi
xor    %ebx,%ebx
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x10(%rsp),%rdi
call   1040 <fclose@plt>
jmp    1339 <main+0x1b9>
mov    0x2cb8(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xce8(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x10228,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [18 x i8] c"Usage: %s <file>\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@stderr = global i32 0
@.str.2 = [25 x i8] c"Error: Opening File: %s\0A\00"
@EOF = global i32 0
@.str.3 = [6 x i8] c"aeiou\00"
@.str.4 = [3 x i8] c"ab\00"
@.str.5 = [3 x i8] c"cd\00"
@.str.6 = [3 x i8] c"pq\00"
@.str.7 = [3 x i8] c"xy\00"
@.str.8 = [27 x i8] c"Contains %d nice strings.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i64
%8 = alloca [65536 x i8]
%9 = alloca i32
%10 = alloca [512 x i8]
%11 = alloca i8*
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %12
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i32, i32* @stdout
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %19)
store i32 0, i32* %3
br label %89
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %25, i32** %6
%26 = load i32*, i32** %6
%27 = icmp ne i32* %26, null
br i1 %27, label %34, label %28
28: ; preds = %21
%29 = load i32, i32* @stderr
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %32)
store i32 1, i32* %3
br label %89
34: ; preds = %21
br label %35
35: ; preds = %82, %34
%36 = getelementptr inbounds [65536 x i8], [65536 x i8]* %8, i64 0, i64 0
%37 = load i32*, i32** %6
%38 = call i64 @fread(i8* %36, i32 1, i32 65536, i32* %37)
store i64 %38, i64* %7
%39 = getelementptr inbounds [65536 x i8], [65536 x i8]* %8, i64 0, i64 0
store i8* %39, i8** %11
br label %40
40: ; preds = %73, %35
%41 = load i8*, i8** %11
%42 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%43 = call i32 @readline(i8* %41, i8* %42, i32 512)
store i32 %43, i32* %9
%44 = load i32, i32* @EOF
%45 = icmp ne i32 %43, %44
br i1 %45, label %46, label %79
46: ; preds = %40
%47 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%48 = call i32 @contains_one(i8* %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%49 = icmp sge i32 %48, 3
br i1 %49, label %50, label %73
50: ; preds = %46
%51 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%52 = call i64 @contains_two_letters_in_row(i8* %51)
%53 = icmp ne i64 %52, 0
br i1 %53, label %54, label %73
54: ; preds = %50
%55 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%56 = call i32 @contains_all(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%57 = icmp ne i32 %56, 0
br i1 %57, label %73, label %58
58: ; preds = %54
%59 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%60 = call i32 @contains_all(i8* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%61 = icmp ne i32 %60, 0
br i1 %61, label %73, label %62
62: ; preds = %58
%63 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%64 = call i32 @contains_all(i8* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%65 = icmp ne i32 %64, 0
br i1 %65, label %73, label %66
66: ; preds = %62
%67 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%68 = call i32 @contains_all(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%69 = icmp ne i32 %68, 0
br i1 %69, label %73, label %70
70: ; preds = %66
%71 = load i32, i32* %12
%72 = add nsw i32 %71, 1
store i32 %72, i32* %12
br label %73
73: ; preds = %70, %66, %62, %58, %54, %50, %46
%74 = load i8*, i8** %11
%75 = load i32, i32* %9
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8, i8* %74, i64 %76
%78 = getelementptr inbounds i8, i8* %77, i64 1
store i8* %78, i8** %11
br label %40
79: ; preds = %40
%80 = load i64, i64* %7
%81 = icmp eq i64 %80, 65536
br i1 %81, label %82, label %83
82: ; preds = %79
br label %35
83: ; preds = %79
%84 = load i32, i32* @stdout
%85 = load i32, i32* %12
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i32 %85)
%87 = load i32*, i32** %6
%88 = call i32 @fclose(i32* %87)
store i32 0, i32* %3
br label %89
89: ; preds = %83, %28, %15
%90 = load i32, i32* %3
ret i32 %90
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [18 x i8] c"Usage: %s <file>\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@stderr = global i32 0
@.str.2 = [25 x i8] c"Error: Opening File: %s\0A\00"
@EOF = global i32 0
@.str.3 = [6 x i8] c"aeiou\00"
@.str.4 = [3 x i8] c"ab\00"
@.str.5 = [3 x i8] c"cd\00"
@.str.6 = [3 x i8] c"pq\00"
@.str.7 = [3 x i8] c"xy\00"
@.str.8 = [27 x i8] c"Contains %d nice strings.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [65536 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stdout
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %65
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32* @fopen(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %13
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %19)
br label %65
21: ; preds = %12, %58
%22 = phi i32 [ %59, %58 ], [ 0, %12 ]
%23 = call i64 @fread(i8* %5, i32 1, i32 65536, i32* %15)
%24 = call i32 @readline(i8* %5, i8* %6, i32 512)
%25 = load i32, i32* @EOF
%26 = icmp eq i32 %24, %25
br i1 %26, label %58, label %27
27: ; preds = %21, %50
%28 = phi i32 [ %55, %50 ], [ %24, %21 ]
%29 = phi i32 [ %51, %50 ], [ %22, %21 ]
%30 = phi i8* [ %54, %50 ], [ %5, %21 ]
%31 = call i32 @contains_one(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp sgt i32 %31, 2
br i1 %32, label %33, label %50
33: ; preds = %27
%34 = call i64 @contains_two_letters_in_row(i8* %6)
%35 = icmp eq i64 %34, 0
br i1 %35, label %50, label %36
36: ; preds = %33
%37 = call i32 @contains_all(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %50
39: ; preds = %36
%40 = call i32 @contains_all(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %50
42: ; preds = %39
%43 = call i32 @contains_all(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %42
%46 = call i32 @contains_all(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%47 = icmp eq i32 %46, 0
%48 = zext i1 %47 to i32
%49 = add nsw i32 %29, %48
br label %50
50: ; preds = %45, %42, %39, %36, %33, %27
%51 = phi i32 [ %29, %36 ], [ %29, %39 ], [ %29, %42 ], [ %29, %33 ], [ %29, %27 ], [ %49, %45 ]
%52 = sext i32 %28 to i64
%53 = getelementptr inbounds i8, i8* %30, i64 1
%54 = getelementptr inbounds i8, i8* %53, i64 %52
%55 = call i32 @readline(i8* %54, i8* %6, i32 512)
%56 = load i32, i32* @EOF
%57 = icmp eq i32 %55, %56
br i1 %57, label %58, label %27
58: ; preds = %50, %21
%59 = phi i32 [ %22, %21 ], [ %51, %50 ]
%60 = icmp eq i64 %23, 65536
br i1 %60, label %21, label %61
61: ; preds = %58
%62 = load i32, i32* @stdout
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i32 %59)
%64 = call i32 @fclose(i32* %15)
br label %65
65: ; preds = %61, %17, %8
%66 = phi i32 [ 0, %8 ], [ 0, %61 ], [ 1, %17 ]
ret i32 %66
}