#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 *);
void lookup(char *guessword_element) {
  if (*guessword_element == 0) {
    printf("  Magenta ");
  } else if (*guessword_element == 1) {
    printf("  Yellow  ");
  } else if (*guessword_element == 2) {
    printf("  Red     ");
  } else if (*guessword_element == 3) {
    printf("  Green   ");
  } else if (*guessword_element == 4) {
    printf("  Blue    ");
  } else if (*guessword_element == 5) {
    printf("  Cyan    ");
  }
}


x86 assembly (clang, -O0):
<lookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113d <lookup+0x2d>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
jmp    11f6 <lookup+0xe6>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    115e <lookup+0x4e>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    11f1 <lookup+0xe1>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2,%eax
jne    117f <lookup+0x6f>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    11ec <lookup+0xdc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3,%eax
jne    11a0 <lookup+0x90>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    11e7 <lookup+0xd7>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x4,%eax
jne    11c1 <lookup+0xb1>
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
jmp    11e2 <lookup+0xd2>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5,%eax
jne    11dd <lookup+0xcd>
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
jmp    11e2 <lookup+0xd2>
jmp    11e7 <lookup+0xd7>
jmp    11ec <lookup+0xdc>
jmp    11f1 <lookup+0xe1>
jmp    11f6 <lookup+0xe6>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup>:
movsbq (%rdi),%rax
cmp    $0x5,%rax
ja     112d <lookup+0x1d>
lea    0xf23(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [11 x i8] c" Magenta \00"
@.str.1 = [11 x i8] c" Yellow \00"
@.str.2 = [11 x i8] c" Red \00"
@.str.3 = [11 x i8] c" Green \00"
@.str.4 = [11 x i8] c" Blue \00"
@.str.5 = [11 x i8] c" Cyan \00"
define void @lookup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %49
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %48
16: ; preds = %9
%17 = load i8*, i8** %2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %47
23: ; preds = %16
%24 = load i8*, i8** %2
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 3
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %46
30: ; preds = %23
%31 = load i8*, i8** %2
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 4
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %45
37: ; preds = %30
%38 = load i8*, i8** %2
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 5
br i1 %41, label %42, label %44
42: ; preds = %37
%43 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %44
44: ; preds = %42, %37
br label %45
45: ; preds = %44, %35
br label %46
46: ; preds = %45, %28
br label %47
47: ; preds = %46, %21
br label %48
48: ; preds = %47, %14
br label %49
49: ; preds = %48, %7
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c" Magenta \00"
@.str.1 = [11 x i8] c" Yellow \00"
@.str.2 = [11 x i8] c" Red \00"
@.str.3 = [11 x i8] c" Green \00"
@.str.4 = [11 x i8] c" Blue \00"
@.str.5 = [11 x i8] c" Cyan \00"
@reltable.lookup = [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str to i64), i64 ptrtoint ([6 x i32]* @reltable.lookup to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.lookup to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.2 to i64), i64 ptrtoint ([6 x i32]* @reltable.lookup to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.3 to i64), i64 ptrtoint ([6 x i32]* @reltable.lookup to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.4 to i64), i64 ptrtoint ([6 x i32]* @reltable.lookup to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.5 to i64), i64 ptrtoint ([6 x i32]* @reltable.lookup to i64)) to i32)]
define void @lookup(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 6
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([6 x i32]* @reltable.lookup to i8*), i64 %6)
%8 = tail call i32 @printf(i8* dereferenceable(1) %7)
br label %9
9: ; preds = %1, %4
ret void
}