#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 */
typedef int uint32_t;

/* Variables and functions */
const char *rcpProcName(uint32_t proc) {
  switch (proc) {
  case 1:
    return "CLI";
  case (1 << 1):
    return "SERVICES";
  case (1 << 2):
    return "ROUTER";
  case (1 << 3):
    return "DHCP";
  case (1 << 4):
    return "RIP";
  case (1 << 6):
    return "SECURITY";
  case (1 << 5):
    return "*";
  case (1 << 7):
    return "DNS";
  case (1 << 8):
    return "NTPD";
  case (1 << 9):
    return "ACL";
  case (1 << 10):
    return "NETMON";
  case (1 << 11):
    return "OSPF";
  }
  return "";
}


x86 assembly (clang, -O0):
<rcpProcName>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     11e0 <rcpProcName+0xe0>
jmp    111b <rcpProcName+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11f0 <rcpProcName+0xf0>
jmp    112c <rcpProcName+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     1200 <rcpProcName+0x100>
jmp    113d <rcpProcName+0x3d>
mov    -0x10(%rbp),%eax
sub    $0x8,%eax
je     1210 <rcpProcName+0x110>
jmp    114e <rcpProcName+0x4e>
mov    -0x10(%rbp),%eax
sub    $0x10,%eax
je     1220 <rcpProcName+0x120>
jmp    115f <rcpProcName+0x5f>
mov    -0x10(%rbp),%eax
sub    $0x20,%eax
je     1240 <rcpProcName+0x140>
jmp    1170 <rcpProcName+0x70>
mov    -0x10(%rbp),%eax
sub    $0x40,%eax
je     1230 <rcpProcName+0x130>
jmp    1181 <rcpProcName+0x81>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
je     1250 <rcpProcName+0x150>
jmp    1194 <rcpProcName+0x94>
mov    -0x10(%rbp),%eax
sub    $0x100,%eax
je     1260 <rcpProcName+0x160>
jmp    11a7 <rcpProcName+0xa7>
mov    -0x10(%rbp),%eax
sub    $0x200,%eax
je     1270 <rcpProcName+0x170>
jmp    11ba <rcpProcName+0xba>
mov    -0x10(%rbp),%eax
sub    $0x400,%eax
je     1280 <rcpProcName+0x180>
jmp    11cd <rcpProcName+0xcd>
mov    -0x10(%rbp),%eax
sub    $0x800,%eax
je     1290 <rcpProcName+0x190>
jmp    12a0 <rcpProcName+0x1a0>
lea    0xe19(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xe0d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xe06(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xdfd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xdf2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xde6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xddf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xdd1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xdc5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xdba(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xdae(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xda5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ab <rcpProcName+0x1ab>
lea    0xd80(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcpProcName>:
cmp    $0x7f,%edi
jg     1130 <rcpProcName+0x30>
add    $0xffffffff,%edi
cmp    $0x3f,%edi
ja     11b0 <rcpProcName+0xb0>
lea    0xfe8(%rip),%rax
lea    0xee1(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0xfd5(%rip),%rax
ret
cmp    $0x1ff,%edi
jle    1158 <rcpProcName+0x58>
cmp    $0x200,%edi
je     1198 <rcpProcName+0x98>
cmp    $0x400,%edi
je     11a0 <rcpProcName+0xa0>
cmp    $0x800,%edi
jne    11b0 <rcpProcName+0xb0>
lea    0xfe5(%rip),%rax
ret
cmp    $0x80,%edi
je     11a8 <rcpProcName+0xa8>
cmp    $0x100,%edi
jne    11b0 <rcpProcName+0xb0>
lea    0xfbd(%rip),%rax
ret
lea    0xf96(%rip),%rax
ret
lea    0xf95(%rip),%rax
ret
lea    0xf92(%rip),%rax
ret
lea    0xf97(%rip),%rax
ret
lea    0xf86(%rip),%rax
ret
lea    0xf92(%rip),%rax
ret
lea    0xf8e(%rip),%rax
ret
lea    0xf79(%rip),%rax
ret
lea    0xf70(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"CLI\00"
@.str.1 = [9 x i8] c"SERVICES\00"
@.str.2 = [7 x i8] c"ROUTER\00"
@.str.3 = [5 x i8] c"DHCP\00"
@.str.4 = [4 x i8] c"RIP\00"
@.str.5 = [9 x i8] c"SECURITY\00"
@.str.6 = [2 x i8] c"*\00"
@.str.7 = [4 x i8] c"DNS\00"
@.str.8 = [5 x i8] c"NTPD\00"
@.str.9 = [4 x i8] c"ACL\00"
@.str.10 = [7 x i8] c"NETMON\00"
@.str.11 = [5 x i8] c"OSPF\00"
@.str.12 = [1 x i8] zeroinitializer
define i8* @rcpProcName(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %17 [
i32 1, label %5
i32 2, label %6
i32 4, label %7
i32 8, label %8
i32 16, label %9
i32 64, label %10
i32 32, label %11
i32 128, label %12
i32 256, label %13
i32 512, label %14
i32 1024, label %15
i32 2048, label %16
]
5: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %18
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %18
7: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %18
8: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %18
9: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %18
10: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %18
11: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %18
12: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %18
13: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %18
14: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %18
15: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %18
16: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %18
17: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %18
18: ; preds = %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"CLI\00"
@.str.1 = [9 x i8] c"SERVICES\00"
@.str.2 = [7 x i8] c"ROUTER\00"
@.str.3 = [5 x i8] c"DHCP\00"
@.str.4 = [4 x i8] c"RIP\00"
@.str.5 = [9 x i8] c"SECURITY\00"
@.str.6 = [2 x i8] c"*\00"
@.str.7 = [4 x i8] c"DNS\00"
@.str.8 = [5 x i8] c"NTPD\00"
@.str.9 = [4 x i8] c"ACL\00"
@.str.10 = [7 x i8] c"NETMON\00"
@.str.11 = [5 x i8] c"OSPF\00"
@.str.12 = [1 x i8] zeroinitializer
define i8* @rcpProcName(i32 %0) {
switch i32 %0, label %13 [
i32 1, label %14
i32 2, label %2
i32 4, label %3
i32 8, label %4
i32 16, label %5
i32 64, label %6
i32 32, label %7
i32 128, label %8
i32 256, label %9
i32 512, label %10
i32 1024, label %11
i32 2048, label %12
]
2: ; preds = %1
br label %14
3: ; preds = %1
br label %14
4: ; preds = %1
br label %14
5: ; preds = %1
br label %14
6: ; preds = %1
br label %14
7: ; preds = %1
br label %14
8: ; preds = %1
br label %14
9: ; preds = %1
br label %14
10: ; preds = %1
br label %14
11: ; preds = %1
br label %14
12: ; preds = %1
br label %14
13: ; preds = %1
br label %14
14: ; preds = %1, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%15 = phi i8* [ getelementptr inbounds ([1 x i8], [1 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 ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([5 x i8], [5 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 ([9 x i8], [9 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* %15
}