char *sObjectIndexType(int iType) {
  switch (iType) {
  case 'O':
    return ("Object");
  case 'U':
    return ("Unit");
  case 'M':
    return ("Molecule");
  case 'R':
    return ("Residue");
  case 'A':
    return ("Atom");
  case 'a':
    return ("Association");
  case 'c':
    return ("Collection");
  case 'L':
    return ("List");
  case 'B':
    return ("ByteArray");
  case 'I':
    return ("Internal");
  case 'P':
    return ("ParameterSet");
  case 's':
    return ("String");
  case 'd':
    return ("Double");
  case 'i':
    return ("Integer");
  default:
    return ("?? Unknown type ??");
  }
  return ("?? Unknown type ??");
}


x86 assembly (clang, -O0):
<sObjectIndexType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x32,%eax
ja     1210 <sObjectIndexType+0x110>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf95(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf8c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf81(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf7a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf72(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf67(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf63(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf5e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf53(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf4d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf46(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf43(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf3a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf31(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121b <sObjectIndexType+0x11b>
lea    0xf29(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sObjectIndexType>:
add    $0xffffffbf,%edi
cmp    $0x32,%edi
ja     112f <sObjectIndexType+0x2f>
lea    0xfbd(%rip),%rax
lea    0xeea(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0xfc3(%rip),%rax
ret
lea    0xfdc(%rip),%rax
ret
lea    0x100a(%rip),%rax
ret
lea    0xfd6(%rip),%rax
ret
lea    0xfbf(%rip),%rax
ret
lea    0xf8a(%rip),%rax
ret
lea    0xfc7(%rip),%rax
ret
lea    0xf83(%rip),%rax
ret
lea    0xf6d(%rip),%rax
ret
lea    0xf80(%rip),%rax
ret
lea    0xf84(%rip),%rax
ret
lea    0xfb3(%rip),%rax
ret
lea    0xfb2(%rip),%rax
ret
lea    0xf9c(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Object\00"
@.str.1 = [5 x i8] c"Unit\00"
@.str.2 = [9 x i8] c"Molecule\00"
@.str.3 = [8 x i8] c"Residue\00"
@.str.4 = [5 x i8] c"Atom\00"
@.str.5 = [12 x i8] c"Association\00"
@.str.6 = [11 x i8] c"Collection\00"
@.str.7 = [5 x i8] c"List\00"
@.str.8 = [10 x i8] c"ByteArray\00"
@.str.9 = [9 x i8] c"Internal\00"
@.str.10 = [13 x i8] c"ParameterSet\00"
@.str.11 = [7 x i8] c"String\00"
@.str.12 = [7 x i8] c"Double\00"
@.str.13 = [8 x i8] c"Integer\00"
@.str.14 = [19 x i8] c"?? Unknown type ??\00"
define i8* @sObjectIndexType(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %19 [
i32 79, label %5
i32 85, label %6
i32 77, label %7
i32 82, label %8
i32 65, label %9
i32 97, label %10
i32 99, label %11
i32 76, label %12
i32 66, label %13
i32 73, label %14
i32 80, label %15
i32 115, label %16
i32 100, label %17
i32 105, label %18
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %20
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %20
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %20
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %20
9: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %20
10: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %20
11: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %20
12: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %20
13: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %20
14: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %20
15: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %20
16: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %20
17: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %20
18: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %20
19: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %20
20: ; preds = %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@.str = [7 x i8] c"Object\00"
@.str.1 = [5 x i8] c"Unit\00"
@.str.2 = [9 x i8] c"Molecule\00"
@.str.3 = [8 x i8] c"Residue\00"
@.str.4 = [5 x i8] c"Atom\00"
@.str.5 = [12 x i8] c"Association\00"
@.str.6 = [11 x i8] c"Collection\00"
@.str.7 = [5 x i8] c"List\00"
@.str.8 = [10 x i8] c"ByteArray\00"
@.str.9 = [9 x i8] c"Internal\00"
@.str.10 = [13 x i8] c"ParameterSet\00"
@.str.11 = [7 x i8] c"String\00"
@.str.12 = [7 x i8] c"Double\00"
@.str.13 = [8 x i8] c"Integer\00"
@.str.14 = [19 x i8] c"?? Unknown type ??\00"
define i8* @sObjectIndexType(i32 %0) {
switch i32 %0, label %15 [
i32 79, label %16
i32 85, label %2
i32 77, label %3
i32 82, label %4
i32 65, label %5
i32 97, label %6
i32 99, label %7
i32 76, label %8
i32 66, label %9
i32 73, label %10
i32 80, label %11
i32 115, label %12
i32 100, label %13
i32 105, label %14
]
2: ; preds = %1
br label %16
3: ; preds = %1
br label %16
4: ; preds = %1
br label %16
5: ; preds = %1
br label %16
6: ; preds = %1
br label %16
7: ; preds = %1
br label %16
8: ; preds = %1
br label %16
9: ; preds = %1
br label %16
10: ; preds = %1
br label %16
11: ; preds = %1
br label %16
12: ; preds = %1
br label %16
13: ; preds = %1
br label %16
14: ; preds = %1
br label %16
15: ; preds = %1
br label %16
16: ; preds = %1, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%17 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %17
}