char *prog_type_to_name(int type) {
  switch (type) {
  case (1):
    return "ACT";
  case (2048):
    return "SPEECH";
  case (1024):
    return "RANDOM";
  case (16):
    return "FIGHT";
  case (512):
    return "HPCNT";
  case (4):
    return "DEATH";
  case (8):
    return "ENTRY";
  case (64):
    return "GREET";
  case (128):
    return "GRALL";
  case (32):
    return "GIVE";
  case (2):
    return "BRIBE";
  case (256):
    return "KILL";
  case (16384):
    return "DELAY";
  case (32768):
    return "SURRENDER";
  case (4096):
    return "EXIT";
  case (8192):
    return "EXALL";
  case (65536):
    return "GET";
  case (131072):
    return "DROP";
  case (262144):
    return "SIT";
  default:
    return "ERROR";
  }
}


x86 assembly (clang, -O0):
<prog_type_to_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1265 <prog_type_to_name+0x165>
jmp    111b <prog_type_to_name+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1305 <prog_type_to_name+0x205>
jmp    112c <prog_type_to_name+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     12b5 <prog_type_to_name+0x1b5>
jmp    113d <prog_type_to_name+0x3d>
mov    -0x10(%rbp),%eax
sub    $0x8,%eax
je     12c5 <prog_type_to_name+0x1c5>
jmp    114e <prog_type_to_name+0x4e>
mov    -0x10(%rbp),%eax
sub    $0x10,%eax
je     1295 <prog_type_to_name+0x195>
jmp    115f <prog_type_to_name+0x5f>
mov    -0x10(%rbp),%eax
sub    $0x20,%eax
je     12f5 <prog_type_to_name+0x1f5>
jmp    1170 <prog_type_to_name+0x70>
mov    -0x10(%rbp),%eax
sub    $0x40,%eax
je     12d5 <prog_type_to_name+0x1d5>
jmp    1181 <prog_type_to_name+0x81>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
je     12e5 <prog_type_to_name+0x1e5>
jmp    1194 <prog_type_to_name+0x94>
mov    -0x10(%rbp),%eax
sub    $0x100,%eax
je     1315 <prog_type_to_name+0x215>
jmp    11a7 <prog_type_to_name+0xa7>
mov    -0x10(%rbp),%eax
sub    $0x200,%eax
je     12a5 <prog_type_to_name+0x1a5>
jmp    11ba <prog_type_to_name+0xba>
mov    -0x10(%rbp),%eax
sub    $0x400,%eax
je     1285 <prog_type_to_name+0x185>
jmp    11cd <prog_type_to_name+0xcd>
mov    -0x10(%rbp),%eax
sub    $0x800,%eax
je     1275 <prog_type_to_name+0x175>
jmp    11e0 <prog_type_to_name+0xe0>
mov    -0x10(%rbp),%eax
sub    $0x1000,%eax
je     1345 <prog_type_to_name+0x245>
jmp    11f3 <prog_type_to_name+0xf3>
mov    -0x10(%rbp),%eax
sub    $0x2000,%eax
je     1355 <prog_type_to_name+0x255>
jmp    1206 <prog_type_to_name+0x106>
mov    -0x10(%rbp),%eax
sub    $0x4000,%eax
je     1325 <prog_type_to_name+0x225>
jmp    1219 <prog_type_to_name+0x119>
mov    -0x10(%rbp),%eax
sub    $0x8000,%eax
je     1335 <prog_type_to_name+0x235>
jmp    122c <prog_type_to_name+0x12c>
mov    -0x10(%rbp),%eax
sub    $0x10000,%eax
je     1365 <prog_type_to_name+0x265>
jmp    123f <prog_type_to_name+0x13f>
mov    -0x10(%rbp),%eax
sub    $0x20000,%eax
je     1375 <prog_type_to_name+0x275>
jmp    1252 <prog_type_to_name+0x152>
mov    -0x10(%rbp),%eax
sub    $0x40000,%eax
je     1385 <prog_type_to_name+0x285>
jmp    1395 <prog_type_to_name+0x295>
lea    0xd94(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd88(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd7f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd76(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd6c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd62(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd58(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd4e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd44(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd3a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd2f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd25(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd1a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd10(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xd0a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xcff(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xcf5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xce9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xcde(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13a0 <prog_type_to_name+0x2a0>
lea    0xcd2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_type_to_name>:
cmp    $0x1ff,%edi
jle    1148 <prog_type_to_name+0x48>
cmp    $0x3fff,%edi
jg     116f <prog_type_to_name+0x6f>
cmp    $0x7ff,%edi
jle    11bf <prog_type_to_name+0xbf>
cmp    $0x800,%edi
je     1223 <prog_type_to_name+0x123>
cmp    $0x1000,%edi
je     122b <prog_type_to_name+0x12b>
cmp    $0x2000,%edi
jne    121b <prog_type_to_name+0x11b>
lea    0x1014(%rip),%rax
ret
lea    -0x1(%rdi),%ecx
cmp    $0x3f,%ecx
ja     11a3 <prog_type_to_name+0xa3>
lea    0xfa9(%rip),%rax
lea    0xea2(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xfcd(%rip),%rax
ret
cmp    $0xffff,%edi
jle    11db <prog_type_to_name+0xdb>
cmp    $0x10000,%edi
je     1233 <prog_type_to_name+0x133>
cmp    $0x20000,%edi
je     123b <prog_type_to_name+0x13b>
cmp    $0x40000,%edi
jne    121b <prog_type_to_name+0x11b>
lea    0xfc8(%rip),%rax
ret
cmp    $0x80,%edi
je     1243 <prog_type_to_name+0x143>
cmp    $0x100,%edi
jne    121b <prog_type_to_name+0x11b>
lea    0xf83(%rip),%rax
ret
cmp    $0x200,%edi
je     124b <prog_type_to_name+0x14b>
cmp    $0x400,%edi
jne    121b <prog_type_to_name+0x11b>
lea    0xf31(%rip),%rax
ret
cmp    $0x4000,%edi
je     1253 <prog_type_to_name+0x153>
cmp    $0x8000,%edi
jne    121b <prog_type_to_name+0x11b>
lea    0xf5a(%rip),%rax
ret
lea    0xf24(%rip),%rax
ret
lea    0xf22(%rip),%rax
ret
lea    0xf08(%rip),%rax
ret
lea    0xf24(%rip),%rax
ret
lea    0xf10(%rip),%rax
ret
lea    0xf4c(%rip),%rax
ret
lea    0xeda(%rip),%rax
ret
lea    0xf24(%rip),%rax
ret
lea    0xf27(%rip),%rax
ret
lea    0xf23(%rip),%rax
ret
lea    0xee6(%rip),%rax
ret
lea    0xec6(%rip),%rax
ret
lea    0xeec(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ACT\00"
@.str.1 = [7 x i8] c"SPEECH\00"
@.str.2 = [7 x i8] c"RANDOM\00"
@.str.3 = [6 x i8] c"FIGHT\00"
@.str.4 = [6 x i8] c"HPCNT\00"
@.str.5 = [6 x i8] c"DEATH\00"
@.str.6 = [6 x i8] c"ENTRY\00"
@.str.7 = [6 x i8] c"GREET\00"
@.str.8 = [6 x i8] c"GRALL\00"
@.str.9 = [5 x i8] c"GIVE\00"
@.str.10 = [6 x i8] c"BRIBE\00"
@.str.11 = [5 x i8] c"KILL\00"
@.str.12 = [6 x i8] c"DELAY\00"
@.str.13 = [10 x i8] c"SURRENDER\00"
@.str.14 = [5 x i8] c"EXIT\00"
@.str.15 = [6 x i8] c"EXALL\00"
@.str.16 = [4 x i8] c"GET\00"
@.str.17 = [5 x i8] c"DROP\00"
@.str.18 = [4 x i8] c"SIT\00"
@.str.19 = [6 x i8] c"ERROR\00"
define i8* @prog_type_to_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %24 [
i32 1, label %5
i32 2048, label %6
i32 1024, label %7
i32 16, label %8
i32 512, label %9
i32 4, label %10
i32 8, label %11
i32 64, label %12
i32 128, label %13
i32 32, label %14
i32 2, label %15
i32 256, label %16
i32 16384, label %17
i32 32768, label %18
i32 4096, label %19
i32 8192, label %20
i32 65536, label %21
i32 131072, label %22
i32 262144, label %23
]
5: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %25
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %25
7: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %25
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %25
9: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %25
10: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %25
11: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %25
12: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %25
13: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %25
14: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %25
15: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %25
16: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %25
17: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %25
18: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %25
19: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %25
20: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %25
21: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %25
22: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %25
23: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %25
24: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %25
25: ; preds = %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
@.str = [4 x i8] c"ACT\00"
@.str.1 = [7 x i8] c"SPEECH\00"
@.str.2 = [7 x i8] c"RANDOM\00"
@.str.3 = [6 x i8] c"FIGHT\00"
@.str.4 = [6 x i8] c"HPCNT\00"
@.str.5 = [6 x i8] c"DEATH\00"
@.str.6 = [6 x i8] c"ENTRY\00"
@.str.7 = [6 x i8] c"GREET\00"
@.str.8 = [6 x i8] c"GRALL\00"
@.str.9 = [5 x i8] c"GIVE\00"
@.str.10 = [6 x i8] c"BRIBE\00"
@.str.11 = [5 x i8] c"KILL\00"
@.str.12 = [6 x i8] c"DELAY\00"
@.str.13 = [10 x i8] c"SURRENDER\00"
@.str.14 = [5 x i8] c"EXIT\00"
@.str.15 = [6 x i8] c"EXALL\00"
@.str.16 = [4 x i8] c"GET\00"
@.str.17 = [5 x i8] c"DROP\00"
@.str.18 = [4 x i8] c"SIT\00"
@.str.19 = [6 x i8] c"ERROR\00"
define i8* @prog_type_to_name(i32 %0) {
switch i32 %0, label %20 [
i32 1, label %21
i32 2048, label %2
i32 1024, label %3
i32 16, label %4
i32 512, label %5
i32 4, label %6
i32 8, label %7
i32 64, label %8
i32 128, label %9
i32 32, label %10
i32 2, label %11
i32 256, label %12
i32 16384, label %13
i32 32768, label %14
i32 4096, label %15
i32 8192, label %16
i32 65536, label %17
i32 131072, label %18
i32 262144, label %19
]
2: ; preds = %1
br label %21
3: ; preds = %1
br label %21
4: ; preds = %1
br label %21
5: ; preds = %1
br label %21
6: ; preds = %1
br label %21
7: ; preds = %1
br label %21
8: ; preds = %1
br label %21
9: ; preds = %1
br label %21
10: ; preds = %1
br label %21
11: ; preds = %1
br label %21
12: ; preds = %1
br label %21
13: ; preds = %1
br label %21
14: ; preds = %1
br label %21
15: ; preds = %1
br label %21
16: ; preds = %1
br label %21
17: ; preds = %1
br label %21
18: ; preds = %1
br label %21
19: ; preds = %1
br label %21
20: ; preds = %1
br label %21
21: ; preds = %1, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%22 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), %20 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), %19 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), %18 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %22
}