#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 A_BOLD;
int /*<<< orphan*/ strncasecmp(char *, char *, int);
int str2color(char *color) {
  while (color[0] == ' ')
    color++;
  if (!strncasecmp(color, "black", 5))
    return (0UL);
  else if (!strncasecmp(color, "red", 3))
    return (1UL);
  else if (!strncasecmp(color, "green", 5))
    return (2UL);
  else if (!strncasecmp(color, "brown", 5))
    return (3UL);
  else if (!strncasecmp(color, "blue", 4))
    return (4UL);
  else if (!strncasecmp(color, "magenta", 7))
    return (5UL);
  else if (!strncasecmp(color, "cyan", 4))
    return (6UL);
  else if (!strncasecmp(color, "grey", 4))
    return (7UL);
  else if (!strncasecmp(color, "b_black", 7))
    return (A_BOLD >> 11);
  else if (!strncasecmp(color, "b_red", 5))
    return (A_BOLD >> 11 | 1UL);
  else if (!strncasecmp(color, "b_green", 7))
    return (A_BOLD >> 11 | 2UL);
  else if (!strncasecmp(color, "yellow", 6))
    return (A_BOLD >> 11 | 3UL);
  else if (!strncasecmp(color, "b_blue", 6))
    return (A_BOLD >> 11 | 4UL);
  else if (!strncasecmp(color, "b_magenta", 9))
    return (A_BOLD >> 11 | 5UL);
  else if (!strncasecmp(color, "b_cyan", 6))
    return (A_BOLD >> 11 | 6UL);
  else if (!strncasecmp(color, "white", 5))
    return (A_BOLD >> 11 | 7UL);
  return (7UL);
}


x86 assembly (clang, -O0):
<str2color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    113d <str2color+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <str2color+0xc>
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1167 <str2color+0x57>
movl   $0x0,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1191 <str2color+0x81>
movl   $0x1,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xe7f(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    11bb <str2color+0xab>
movl   $0x2,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xe3a(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    11e5 <str2color+0xd5>
movl   $0x3,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xe3a(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    120f <str2color+0xff>
movl   $0x4,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xe17(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1239 <str2color+0x129>
movl   $0x5,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xdf7(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1263 <str2color+0x153>
movl   $0x6,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xd98(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    128d <str2color+0x17d>
movl   $0x7,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xd73(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    12bf <str2color+0x1af>
mov    0x2d2e(%rip),%rax
mov    (%rax),%eax
sar    $0xb,%eax
mov    %eax,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xd49(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    12f7 <str2color+0x1e7>
mov    0x2cfc(%rip),%rax
mov    (%rax),%eax
sar    $0xb,%eax
cltq
or     $0x1,%rax
mov    %eax,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xd17(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    132f <str2color+0x21f>
mov    0x2cc4(%rip),%rax
mov    (%rax),%eax
sar    $0xb,%eax
cltq
or     $0x2,%rax
mov    %eax,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xce7(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1367 <str2color+0x257>
mov    0x2c8c(%rip),%rax
mov    (%rax),%eax
sar    $0xb,%eax
cltq
or     $0x3,%rax
mov    %eax,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xcb6(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    139f <str2color+0x28f>
mov    0x2c54(%rip),%rax
mov    (%rax),%eax
sar    $0xb,%eax
cltq
or     $0x4,%rax
mov    %eax,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xc85(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    13d7 <str2color+0x2c7>
mov    0x2c1c(%rip),%rax
mov    (%rax),%eax
sar    $0xb,%eax
cltq
or     $0x5,%rax
mov    %eax,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xc57(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    140f <str2color+0x2ff>
mov    0x2be4(%rip),%rax
mov    (%rax),%eax
sar    $0xb,%eax
cltq
or     $0x6,%rax
mov    %eax,-0x4(%rbp)
jmp    1499 <str2color+0x389>
mov    -0x10(%rbp),%rdi
lea    0xc26(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1447 <str2color+0x337>
mov    0x2bac(%rip),%rax
mov    (%rax),%eax
sar    $0xb,%eax
cltq
or     $0x7,%rax
mov    %eax,-0x4(%rbp)
jmp    1499 <str2color+0x389>
jmp    144c <str2color+0x33c>
jmp    1451 <str2color+0x341>
jmp    1456 <str2color+0x346>
jmp    145b <str2color+0x34b>
jmp    1460 <str2color+0x350>
jmp    1465 <str2color+0x355>
jmp    146a <str2color+0x35a>
jmp    146f <str2color+0x35f>
jmp    1474 <str2color+0x364>
jmp    1479 <str2color+0x369>
jmp    147e <str2color+0x36e>
jmp    1483 <str2color+0x373>
jmp    1488 <str2color+0x378>
jmp    148d <str2color+0x37d>
jmp    1492 <str2color+0x382>
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2color>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rbx)
lea    0x1(%rbx),%rbx
je     1120 <str2color+0x10>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1308 <str2color+0x1f8>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     130f <str2color+0x1ff>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1319 <str2color+0x209>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1323 <str2color+0x213>
lea    0xe89(%rip),%rsi
mov    $0x4,%ebp
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     13b7 <str2color+0x2a7>
lea    0xe6f(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     132d <str2color+0x21d>
lea    0xe5d(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1337 <str2color+0x227>
lea    0xe0c(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     133e <str2color+0x22e>
lea    0xdf5(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1345 <str2color+0x235>
lea    0xde1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1353 <str2color+0x243>
lea    0xdcb(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1364 <str2color+0x254>
lea    0xdb7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1375 <str2color+0x265>
lea    0xda2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1386 <str2color+0x276>
lea    0xd8d(%rip),%rsi
mov    %rbx,%rdi
mov    $0x9,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     1397 <str2color+0x287>
lea    0xd7b(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncasecmp@plt>
test   %eax,%eax
je     13a8 <str2color+0x298>
lea    0xd66(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
mov    $0x7,%ebp
test   %eax,%eax
jne    13b7 <str2color+0x2a7>
mov    0x2ce5(%rip),%rax
mov    (%rax),%ebp
sar    $0xb,%ebp
or     $0x7,%ebp
jmp    13b7 <str2color+0x2a7>
xor    %ebp,%ebp
jmp    13b7 <str2color+0x2a7>
mov    $0x1,%ebp
jmp    13b7 <str2color+0x2a7>
mov    $0x2,%ebp
jmp    13b7 <str2color+0x2a7>
mov    $0x3,%ebp
jmp    13b7 <str2color+0x2a7>
mov    $0x5,%ebp
jmp    13b7 <str2color+0x2a7>
mov    $0x6,%ebp
jmp    13b7 <str2color+0x2a7>
mov    $0x7,%ebp
jmp    13b7 <str2color+0x2a7>
mov    0x2c94(%rip),%rax
mov    (%rax),%ebp
sar    $0xb,%ebp
jmp    13b7 <str2color+0x2a7>
mov    0x2c86(%rip),%rax
mov    (%rax),%ebp
sar    $0xb,%ebp
or     $0x1,%ebp
jmp    13b7 <str2color+0x2a7>
mov    0x2c75(%rip),%rax
mov    (%rax),%ebp
sar    $0xb,%ebp
or     $0x2,%ebp
jmp    13b7 <str2color+0x2a7>
mov    0x2c64(%rip),%rax
mov    (%rax),%ebp
sar    $0xb,%ebp
or     $0x3,%ebp
jmp    13b7 <str2color+0x2a7>
mov    0x2c53(%rip),%rax
mov    (%rax),%ebp
sar    $0xb,%ebp
or     $0x4,%ebp
jmp    13b7 <str2color+0x2a7>
mov    0x2c42(%rip),%rax
mov    (%rax),%ebp
sar    $0xb,%ebp
or     $0x5,%ebp
jmp    13b7 <str2color+0x2a7>
mov    0x2c31(%rip),%rax
mov    (%rax),%ebp
sar    $0xb,%ebp
or     $0x6,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"black\00"
@.str.1 = [4 x i8] c"red\00"
@.str.2 = [6 x i8] c"green\00"
@.str.3 = [6 x i8] c"brown\00"
@.str.4 = [5 x i8] c"blue\00"
@.str.5 = [8 x i8] c"magenta\00"
@.str.6 = [5 x i8] c"cyan\00"
@.str.7 = [5 x i8] c"grey\00"
@.str.8 = [8 x i8] c"b_black\00"
@A_BOLD = global i32 0
@.str.9 = [6 x i8] c"b_red\00"
@.str.10 = [8 x i8] c"b_green\00"
@.str.11 = [7 x i8] c"yellow\00"
@.str.12 = [7 x i8] c"b_blue\00"
@.str.13 = [10 x i8] c"b_magenta\00"
@.str.14 = [7 x i8] c"b_cyan\00"
@.str.15 = [6 x i8] c"white\00"
define i32 @str2color(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %4
13: ; preds = %4
%14 = load i8*, i8** %3
%15 = call i32 @strncasecmp(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
store i32 0, i32* %2
br label %146
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = call i32 @strncasecmp(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %18
store i32 1, i32* %2
br label %146
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = call i32 @strncasecmp(i8* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23
store i32 2, i32* %2
br label %146
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = call i32 @strncasecmp(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 5)
%31 = icmp ne i32 %30, 0
br i1 %31, label %33, label %32
32: ; preds = %28
store i32 3, i32* %2
br label %146
33: ; preds = %28
%34 = load i8*, i8** %3
%35 = call i32 @strncasecmp(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%36 = icmp ne i32 %35, 0
br i1 %36, label %38, label %37
37: ; preds = %33
store i32 4, i32* %2
br label %146
38: ; preds = %33
%39 = load i8*, i8** %3
%40 = call i32 @strncasecmp(i8* %39, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 7)
%41 = icmp ne i32 %40, 0
br i1 %41, label %43, label %42
42: ; preds = %38
store i32 5, i32* %2
br label %146
43: ; preds = %38
%44 = load i8*, i8** %3
%45 = call i32 @strncasecmp(i8* %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4)
%46 = icmp ne i32 %45, 0
br i1 %46, label %48, label %47
47: ; preds = %43
store i32 6, i32* %2
br label %146
48: ; preds = %43
%49 = load i8*, i8** %3
%50 = call i32 @strncasecmp(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%51 = icmp ne i32 %50, 0
br i1 %51, label %53, label %52
52: ; preds = %48
store i32 7, i32* %2
br label %146
53: ; preds = %48
%54 = load i8*, i8** %3
%55 = call i32 @strncasecmp(i8* %54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 7)
%56 = icmp ne i32 %55, 0
br i1 %56, label %60, label %57
57: ; preds = %53
%58 = load i32, i32* @A_BOLD
%59 = ashr i32 %58, 11
store i32 %59, i32* %2
br label %146
60: ; preds = %53
%61 = load i8*, i8** %3
%62 = call i32 @strncasecmp(i8* %61, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 5)
%63 = icmp ne i32 %62, 0
br i1 %63, label %70, label %64
64: ; preds = %60
%65 = load i32, i32* @A_BOLD
%66 = ashr i32 %65, 11
%67 = sext i32 %66 to i64
%68 = or i64 %67, 1
%69 = trunc i64 %68 to i32
store i32 %69, i32* %2
br label %146
70: ; preds = %60
%71 = load i8*, i8** %3
%72 = call i32 @strncasecmp(i8* %71, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 7)
%73 = icmp ne i32 %72, 0
br i1 %73, label %80, label %74
74: ; preds = %70
%75 = load i32, i32* @A_BOLD
%76 = ashr i32 %75, 11
%77 = sext i32 %76 to i64
%78 = or i64 %77, 2
%79 = trunc i64 %78 to i32
store i32 %79, i32* %2
br label %146
80: ; preds = %70
%81 = load i8*, i8** %3
%82 = call i32 @strncasecmp(i8* %81, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 6)
%83 = icmp ne i32 %82, 0
br i1 %83, label %90, label %84
84: ; preds = %80
%85 = load i32, i32* @A_BOLD
%86 = ashr i32 %85, 11
%87 = sext i32 %86 to i64
%88 = or i64 %87, 3
%89 = trunc i64 %88 to i32
store i32 %89, i32* %2
br label %146
90: ; preds = %80
%91 = load i8*, i8** %3
%92 = call i32 @strncasecmp(i8* %91, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 6)
%93 = icmp ne i32 %92, 0
br i1 %93, label %100, label %94
94: ; preds = %90
%95 = load i32, i32* @A_BOLD
%96 = ashr i32 %95, 11
%97 = sext i32 %96 to i64
%98 = or i64 %97, 4
%99 = trunc i64 %98 to i32
store i32 %99, i32* %2
br label %146
100: ; preds = %90
%101 = load i8*, i8** %3
%102 = call i32 @strncasecmp(i8* %101, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i32 9)
%103 = icmp ne i32 %102, 0
br i1 %103, label %110, label %104
104: ; preds = %100
%105 = load i32, i32* @A_BOLD
%106 = ashr i32 %105, 11
%107 = sext i32 %106 to i64
%108 = or i64 %107, 5
%109 = trunc i64 %108 to i32
store i32 %109, i32* %2
br label %146
110: ; preds = %100
%111 = load i8*, i8** %3
%112 = call i32 @strncasecmp(i8* %111, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i32 6)
%113 = icmp ne i32 %112, 0
br i1 %113, label %120, label %114
114: ; preds = %110
%115 = load i32, i32* @A_BOLD
%116 = ashr i32 %115, 11
%117 = sext i32 %116 to i64
%118 = or i64 %117, 6
%119 = trunc i64 %118 to i32
store i32 %119, i32* %2
br label %146
120: ; preds = %110
%121 = load i8*, i8** %3
%122 = call i32 @strncasecmp(i8* %121, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 5)
%123 = icmp ne i32 %122, 0
br i1 %123, label %130, label %124
124: ; preds = %120
%125 = load i32, i32* @A_BOLD
%126 = ashr i32 %125, 11
%127 = sext i32 %126 to i64
%128 = or i64 %127, 7
%129 = trunc i64 %128 to i32
store i32 %129, i32* %2
br label %146
130: ; preds = %120
br label %131
131: ; preds = %130
br label %132
132: ; preds = %131
br label %133
133: ; preds = %132
br label %134
134: ; preds = %133
br label %135
135: ; preds = %134
br label %136
136: ; preds = %135
br label %137
137: ; preds = %136
br label %138
138: ; preds = %137
br label %139
139: ; preds = %138
br label %140
140: ; preds = %139
br label %141
141: ; preds = %140
br label %142
142: ; preds = %141
br label %143
143: ; preds = %142
br label %144
144: ; preds = %143
br label %145
145: ; preds = %144
store i32 7, i32* %2
br label %146
146: ; preds = %145, %124, %114, %104, %94, %84, %74, %64, %57, %52, %47, %42, %37, %32, %27, %22, %17
%147 = load i32, i32* %2
ret i32 %147
}

LLVM IR (-O2):
@.str = [6 x i8] c"black\00"
@.str.1 = [4 x i8] c"red\00"
@.str.2 = [6 x i8] c"green\00"
@.str.3 = [6 x i8] c"brown\00"
@.str.4 = [5 x i8] c"blue\00"
@.str.5 = [8 x i8] c"magenta\00"
@.str.6 = [5 x i8] c"cyan\00"
@.str.7 = [5 x i8] c"grey\00"
@.str.8 = [8 x i8] c"b_black\00"
@A_BOLD = global i32 0
@.str.9 = [6 x i8] c"b_red\00"
@.str.10 = [8 x i8] c"b_green\00"
@.str.11 = [7 x i8] c"yellow\00"
@.str.12 = [7 x i8] c"b_blue\00"
@.str.13 = [10 x i8] c"b_magenta\00"
@.str.14 = [7 x i8] c"b_cyan\00"
@.str.15 = [6 x i8] c"white\00"
define i32 @str2color(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%9 = icmp eq i32 %8, 0
br i1 %9, label %86, label %10
10: ; preds = %7
%11 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%12 = icmp eq i32 %11, 0
br i1 %12, label %86, label %13
13: ; preds = %10
%14 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%15 = icmp eq i32 %14, 0
br i1 %15, label %86, label %16
16: ; preds = %13
%17 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 5)
%18 = icmp eq i32 %17, 0
br i1 %18, label %86, label %19
19: ; preds = %16
%20 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%21 = icmp eq i32 %20, 0
br i1 %21, label %86, label %22
22: ; preds = %19
%23 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 7)
%24 = icmp eq i32 %23, 0
br i1 %24, label %86, label %25
25: ; preds = %22
%26 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4)
%27 = icmp eq i32 %26, 0
br i1 %27, label %86, label %28
28: ; preds = %25
%29 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%30 = icmp eq i32 %29, 0
br i1 %30, label %86, label %31
31: ; preds = %28
%32 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 7)
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i32, i32* @A_BOLD
%36 = ashr i32 %35, 11
br label %86
37: ; preds = %31
%38 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 5)
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = load i32, i32* @A_BOLD
%42 = ashr i32 %41, 11
%43 = or i32 %42, 1
br label %86
44: ; preds = %37
%45 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 7)
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %51
47: ; preds = %44
%48 = load i32, i32* @A_BOLD
%49 = ashr i32 %48, 11
%50 = or i32 %49, 2
br label %86
51: ; preds = %44
%52 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 6)
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %51
%55 = load i32, i32* @A_BOLD
%56 = ashr i32 %55, 11
%57 = or i32 %56, 3
br label %86
58: ; preds = %51
%59 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 6)
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %65
61: ; preds = %58
%62 = load i32, i32* @A_BOLD
%63 = ashr i32 %62, 11
%64 = or i32 %63, 4
br label %86
65: ; preds = %58
%66 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i32 9)
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %65
%69 = load i32, i32* @A_BOLD
%70 = ashr i32 %69, 11
%71 = or i32 %70, 5
br label %86
72: ; preds = %65
%73 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i32 6)
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %79
75: ; preds = %72
%76 = load i32, i32* @A_BOLD
%77 = ashr i32 %76, 11
%78 = or i32 %77, 6
br label %86
79: ; preds = %72
%80 = tail call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 5)
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %86
82: ; preds = %79
%83 = load i32, i32* @A_BOLD
%84 = ashr i32 %83, 11
%85 = or i32 %84, 7
br label %86
86: ; preds = %79, %28, %25, %22, %19, %16, %13, %10, %7, %82, %75, %68, %61, %54, %47, %40, %34
%87 = phi i32 [ %85, %82 ], [ %78, %75 ], [ %71, %68 ], [ %64, %61 ], [ %57, %54 ], [ %50, %47 ], [ %43, %40 ], [ %36, %34 ], [ 0, %7 ], [ 1, %10 ], [ 2, %13 ], [ 3, %16 ], [ 4, %19 ], [ 5, %22 ], [ 6, %25 ], [ 7, %28 ], [ 7, %79 ]
ret i32 %87
}