#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("ERROR: You need one argument.\n");
    return 1;
  }
  int i = 0;
  for (i = 0; argv[1][i] != '\0'; i++) {
    char letter = argv[1][i];
    switch (letter) {
    case 'a':
    case 'A':
      printf("%d: 'A'\n", i);
      break;
    case 'e':
    case 'E':
      printf("%d: 'E'\n", i);
      break;
    case 'i':
    case 'I':
      printf("%d: 'I'\n", i);
      break;
    case 'u':
    case 'U':
      printf("%d: 'U'\n", i);
      break;
    case 'y':
    case 'Y':
      if (i > 2) {
        printf("%d: 'Y'\n", i);
      }
      break;
    default:
      printf("%d: %c is not a vowel\n", i, letter);
    }
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114a <main+0x3a>
lea    0xfad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1241 <main+0x131>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1241 <main+0x131>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x38,%eax
ja     1225 <main+0x115>
mov    -0x20(%rbp),%rax
lea    0xe5c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x14(%rbp),%esi
lea    0xf4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123a <main+0x12a>
mov    -0x14(%rbp),%esi
lea    0xf3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123a <main+0x12a>
mov    -0x14(%rbp),%esi
lea    0xf32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123a <main+0x12a>
mov    -0x14(%rbp),%esi
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123a <main+0x12a>
cmpl   $0x2,-0x14(%rbp)
jle    1220 <main+0x110>
mov    -0x14(%rbp),%esi
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123a <main+0x12a>
mov    -0x14(%rbp),%esi
movsbl -0x15(%rbp),%edx
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1157 <main+0x37>
mov    0x8(%rsi),%rax
movsbl (%rax),%edx
xor    %ebx,%ebx
test   %edx,%edx
je     118e <main+0x6e>
lea    -0x41(%rdx),%eax
rol    $0x1e,%eax
cmp    $0xe,%eax
ja     1192 <main+0x72>
lea    0xebb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee7(%rip),%rdi
jmp    1183 <main+0x63>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    118e <main+0x6e>
lea    0xed4(%rip),%rdi
jmp    1183 <main+0x63>
lea    0xed4(%rip),%rdi
jmp    1183 <main+0x63>
lea    0xed4(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec7(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118e <main+0x6e>

LLVM IR (-O0):
@.str = [31 x i8] c"ERROR: You need one argument.\0A\00"
@.str.1 = [9 x i8] c"%d: 'A'\0A\00"
@.str.2 = [9 x i8] c"%d: 'E'\0A\00"
@.str.3 = [9 x i8] c"%d: 'I'\0A\00"
@.str.4 = [9 x i8] c"%d: 'U'\0A\00"
@.str.5 = [9 x i8] c"%d: 'Y'\0A\00"
@.str.6 = [23 x i8] c"%d: %c is not a vowel\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %61
12: ; preds = %2
store i32 0, i32* %6
store i32 0, i32* %6
br label %13
13: ; preds = %58, %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %61
23: ; preds = %13
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = sext i8 %31 to i32
switch i32 %32, label %52 [
i32 97, label %33
i32 65, label %33
i32 101, label %36
i32 69, label %36
i32 105, label %39
i32 73, label %39
i32 117, label %42
i32 85, label %42
i32 121, label %45
i32 89, label %45
]
33: ; preds = %23, %23
%34 = load i32, i32* %6
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %34)
br label %57
36: ; preds = %23, %23
%37 = load i32, i32* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %37)
br label %57
39: ; preds = %23, %23
%40 = load i32, i32* %6
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %40)
br label %57
42: ; preds = %23, %23
%43 = load i32, i32* %6
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %43)
br label %57
45: ; preds = %23, %23
%46 = load i32, i32* %6
%47 = icmp sgt i32 %46, 2
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = load i32, i32* %6
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %48, %45
br label %57
52: ; preds = %23
%53 = load i32, i32* %6
%54 = load i8, i8* %7
%55 = sext i8 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %53, i32 %55)
br label %57
57: ; preds = %52, %51, %42, %39, %36, %33
store i32 0, i32* %3
br label %61
58: ; No predecessors!
%59 = load i32, i32* %6
%60 = add nsw i32 %59, 1
store i32 %60, i32* %6
br label %13
61: ; preds = %10, %57, %13
%62 = load i32, i32* %3
ret i32 %62
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d: 'A'\0A\00"
@.str.2 = [9 x i8] c"%d: 'E'\0A\00"
@.str.3 = [9 x i8] c"%d: 'I'\0A\00"
@.str.4 = [9 x i8] c"%d: 'U'\0A\00"
@.str.6 = [23 x i8] c"%d: %c is not a vowel\0A\00"
@str = [30 x i8] c"ERROR: You need one argument.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %25
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i8 %9, 0
br i1 %11, label %25, label %12
12: ; preds = %6
%13 = add nsw i32 %10, -65
%14 = tail call i32 @llvm.fshl.i32(i32 %13, i32 %13, i32 30)
switch i32 %14, label %23 [
i32 8, label %15
i32 0, label %15
i32 9, label %17
i32 1, label %17
i32 10, label %19
i32 2, label %19
i32 13, label %21
i32 5, label %21
i32 14, label %25
i32 6, label %25
]
15: ; preds = %12, %12
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %25
17: ; preds = %12, %12
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %25
19: ; preds = %12, %12
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %25
21: ; preds = %12, %12
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 0)
br label %25
23: ; preds = %12
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 0, i32 %10)
br label %25
25: ; preds = %12, %12, %23, %21, %19, %17, %15, %6, %4
%26 = phi i32 [ 1, %4 ], [ 0, %6 ], [ 0, %15 ], [ 0, %17 ], [ 0, %19 ], [ 0, %21 ], [ 0, %23 ], [ 0, %12 ], [ 0, %12 ]
ret i32 %26
}