#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("usage %s [string]\n", argv[0]);
    return 1;
  }
  int i = 0;
  for (i = 0; argv[1][i] != '\0'; i++) {
    char c = argv[1][i];
    switch (c) {
    case 'a':
    case 'A':
      printf("%d: a like apple.\n", i);
      break;
    case 'c':
    case 'C':
      printf("%d: c like charly.\n", i);
      break;
    case 'e':
    case 'E':
      printf("%d: e like echo.\n", i);
      break;
    case 'f':
    case 'F':
      printf("%d: f like a fox.\n", i);
      break;
    case 'm':
    case 'M':
      printf("%d: m like mother.\n", i);
      break;
    case 'l':
    case 'L':
      printf("%d: l like lollipop.\n", i);
      break;
    default:
      printf("%d: %c i dont know this character\n", i, c);
    }
  }
  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     1151 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xf76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1267 <main+0x157>
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     1260 <main+0x150>
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    $0x2c,%eax
ja     1238 <main+0x128>
mov    -0x20(%rbp),%rax
lea    0xe55(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x14(%rbp),%esi
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
mov    -0x14(%rbp),%esi
lea    0xf06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
mov    -0x14(%rbp),%esi
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
mov    -0x14(%rbp),%esi
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
mov    -0x14(%rbp),%esi
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
mov    -0x14(%rbp),%esi
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
mov    -0x14(%rbp),%esi
movsbl -0x15(%rbp),%edx
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1252 <main+0x142>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115f <main+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    11d1 <main+0xc1>
mov    0x8(%rbx),%rax
mov    (%rax),%al
test   %al,%al
je     11e9 <main+0xd9>
lea    0xec4(%rip),%r13
lea    0xfbd(%rip),%rbp
lea    0xfdd(%rip),%r14
lea    0xfc2(%rip),%r15
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edx
lea    -0x41(%rdx),%eax
cmp    $0x2c,%eax
ja     11be <main+0xae>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
lea    0xf4b(%rip),%rdi
jmp    11a0 <main+0x90>
lea    0xf55(%rip),%rdi
jmp    11a0 <main+0x90>
lea    0xf60(%rip),%rdi
jmp    11a0 <main+0x90>
mov    %rbp,%rdi
jmp    11a0 <main+0x90>
mov    %r14,%rdi
jmp    11a0 <main+0x90>
mov    %r15,%rdi
nopl   (%rax)
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%rax
movzbl 0x1(%rax,%r12,1),%eax
add    $0x1,%r12
test   %al,%al
jne    1160 <main+0x50>
jmp    11e9 <main+0xd9>
lea    0xf78(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11aa <main+0x9a>
mov    (%rbx),%rsi
lea    0xed9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
jmp    11eb <main+0xdb>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"usage %s [string]\0A\00"
@.str.1 = [19 x i8] c"%d: a like apple.\0A\00"
@.str.2 = [20 x i8] c"%d: c like charly.\0A\00"
@.str.3 = [18 x i8] c"%d: e like echo.\0A\00"
@.str.4 = [19 x i8] c"%d: f like a fox.\0A\00"
@.str.5 = [20 x i8] c"%d: m like mother.\0A\00"
@.str.6 = [22 x i8] c"%d: l like lollipop.\0A\00"
@.str.7 = [35 x i8] c"%d: %c i dont know this character\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 %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 1, i32* %3
br label %64
15: ; preds = %2
store i32 0, i32* %6
store i32 0, i32* %6
br label %16
16: ; preds = %60, %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %63
26: ; preds = %16
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
%33 = load i8, i8* %32
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = sext i8 %34 to i32
switch i32 %35, label %54 [
i32 97, label %36
i32 65, label %36
i32 99, label %39
i32 67, label %39
i32 101, label %42
i32 69, label %42
i32 102, label %45
i32 70, label %45
i32 109, label %48
i32 77, label %48
i32 108, label %51
i32 76, label %51
]
36: ; preds = %26, %26
%37 = load i32, i32* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %37)
br label %59
39: ; preds = %26, %26
%40 = load i32, i32* %6
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %40)
br label %59
42: ; preds = %26, %26
%43 = load i32, i32* %6
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %43)
br label %59
45: ; preds = %26, %26
%46 = load i32, i32* %6
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %46)
br label %59
48: ; preds = %26, %26
%49 = load i32, i32* %6
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %49)
br label %59
51: ; preds = %26, %26
%52 = load i32, i32* %6
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i32 %52)
br label %59
54: ; preds = %26
%55 = load i32, i32* %6
%56 = load i8, i8* %7
%57 = sext i8 %56 to i32
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i32 %55, i32 %57)
br label %59
59: ; preds = %54, %51, %48, %45, %42, %39, %36
br label %60
60: ; preds = %59
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 1
store i32 %62, i32* %6
br label %16
63: ; preds = %16
store i32 0, i32* %3
br label %64
64: ; preds = %63, %10
%65 = load i32, i32* %3
ret i32 %65
}

LLVM IR (-O2):
@.str = [19 x i8] c"usage %s [string]\0A\00"
@.str.1 = [19 x i8] c"%d: a like apple.\0A\00"
@.str.2 = [20 x i8] c"%d: c like charly.\0A\00"
@.str.3 = [18 x i8] c"%d: e like echo.\0A\00"
@.str.4 = [19 x i8] c"%d: f like a fox.\0A\00"
@.str.5 = [20 x i8] c"%d: m like mother.\0A\00"
@.str.6 = [22 x i8] c"%d: l like lollipop.\0A\00"
@.str.7 = [35 x i8] c"%d: %c i dont know this character\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %43, label %12
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %43
12: ; preds = %4, %37
%13 = phi i64 [ %38, %37 ], [ 0, %4 ]
%14 = phi i8 [ %41, %37 ], [ %7, %4 ]
%15 = sext i8 %14 to i32
switch i32 %15, label %34 [
i32 97, label %16
i32 65, label %16
i32 99, label %19
i32 67, label %19
i32 101, label %22
i32 69, label %22
i32 102, label %25
i32 70, label %25
i32 109, label %28
i32 77, label %28
i32 108, label %31
i32 76, label %31
]
16: ; preds = %12, %12
%17 = trunc i64 %13 to i32
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %37
19: ; preds = %12, %12
%20 = trunc i64 %13 to i32
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %37
22: ; preds = %12, %12
%23 = trunc i64 %13 to i32
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %23)
br label %37
25: ; preds = %12, %12
%26 = trunc i64 %13 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %26)
br label %37
28: ; preds = %12, %12
%29 = trunc i64 %13 to i32
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %29)
br label %37
31: ; preds = %12, %12
%32 = trunc i64 %13 to i32
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i32 %32)
br label %37
34: ; preds = %12
%35 = trunc i64 %13 to i32
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i32 %35, i32 %15)
br label %37
37: ; preds = %34, %31, %28, %25, %22, %19, %16
%38 = add nuw i64 %13, 1
%39 = load i8*, i8** %5
%40 = getelementptr inbounds i8, i8* %39, i64 %38
%41 = load i8, i8* %40
%42 = icmp eq i8 %41, 0
br i1 %42, label %43, label %12
43: ; preds = %37, %4, %9
%44 = phi i32 [ 1, %9 ], [ 0, %4 ], [ 0, %37 ]
ret i32 %44
}