#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 */
const char *pin_group_color(unsigned group, unsigned block) {
  (void)block;
  switch (group) {
  case 0:
    return "RED";
  case 1:
    return "TEAL";
  case 2:
    return "PURPLE";
  case 3:
    return "RED";
  case 4:
    return "OLIVE";
  case 5:
    return "OLIVE";
  case 6:
    return "PINK";
  case 7:
    return "GREEN";
  case 8:
    return "RED";
  case 9:
    return "ORANGE";
  case 10:
    return "OLIVE";
  case 11:
    return "TEAL";
  case 12:
    return "ORANGE";
  case 13:
    return "PURPLE";
  case 14:
    return "GRAY";
  case 15:
    return "LIME";
  case 16:
    return NULL;
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<pin_group_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x10,%rax
ja     123c <pin_group_color+0x13c>
mov    -0x18(%rbp),%rax
lea    0xeda(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf0e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xf02(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xef7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xe8e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xe9f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xe7e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xe62(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xe6f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xe47(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xe56(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
lea    0xe4b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
movq   $0x0,-0x8(%rbp)
jmp    1244 <pin_group_color+0x144>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pin_group_color>:
cmp    $0x10,%edi
ja     1114 <pin_group_color+0x14>
movslq %edi,%rax
lea    0x2cb9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"RED\00"
@.str.1 = [5 x i8] c"TEAL\00"
@.str.2 = [7 x i8] c"PURPLE\00"
@.str.3 = [6 x i8] c"OLIVE\00"
@.str.4 = [5 x i8] c"PINK\00"
@.str.5 = [6 x i8] c"GREEN\00"
@.str.6 = [7 x i8] c"ORANGE\00"
@.str.7 = [5 x i8] c"GRAY\00"
@.str.8 = [5 x i8] c"LIME\00"
define i8* @pin_group_color(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
switch i32 %7, label %25 [
i32 0, label %8
i32 1, label %9
i32 2, label %10
i32 3, label %11
i32 4, label %12
i32 5, label %13
i32 6, label %14
i32 7, label %15
i32 8, label %16
i32 9, label %17
i32 10, label %18
i32 11, label %19
i32 12, label %20
i32 13, label %21
i32 14, label %22
i32 15, label %23
i32 16, label %24
]
8: ; preds = %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
br label %26
9: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %26
10: ; preds = %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %26
11: ; preds = %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
br label %26
12: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %26
13: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %26
14: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %26
15: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %26
16: ; preds = %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
br label %26
17: ; preds = %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %26
18: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %26
19: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %26
20: ; preds = %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %26
21: ; preds = %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %26
22: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %26
23: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %26
24: ; preds = %2
store i8* null, i8** %3
br label %26
25: ; preds = %2
store i8* null, i8** %3
br label %26
26: ; preds = %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
@.str = [4 x i8] c"RED\00"
@.str.1 = [5 x i8] c"TEAL\00"
@.str.2 = [7 x i8] c"PURPLE\00"
@.str.3 = [6 x i8] c"OLIVE\00"
@.str.4 = [5 x i8] c"PINK\00"
@.str.5 = [6 x i8] c"GREEN\00"
@.str.6 = [7 x i8] c"ORANGE\00"
@.str.7 = [5 x i8] c"GRAY\00"
@.str.8 = [5 x i8] c"LIME\00"
@switch.table.pin_group_color = [17 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* null]
define i8* @pin_group_color(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 17
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [17 x i8*], [17 x i8*]* @switch.table.pin_group_color, i64 0, i64 %5
%7 = load i8*, i8** %6
br label %8
8: ; preds = %2, %4
%9 = phi i8* [ %7, %4 ], [ null, %2 ]
ret i8* %9
}