#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 *rcpProcRestartHandler(uint32_t proc) {
  switch (proc) {
  case (1 << 1):
    return "rcpservices";
  case (1 << 2):
    return "rcprouter";
  case (1 << 3):
    return "rcpdhcp";
  case (1 << 4):
    return "rcprip";
  case (1 << 6):
    return "rcpsec";
  case (1 << 7):
    return "rcpdns";
  case (1 << 9):
    return "rcpacl";
  case (1 << 10):
    return "rcpnetmon";
  case (1 << 11):
    return "rcpospf";
  }
  return "";
}


x86 assembly (clang, -O0):
<rcpProcRestartHandler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x2,%eax
je     11ab <rcpProcRestartHandler+0xab>
jmp    111b <rcpProcRestartHandler+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     11bb <rcpProcRestartHandler+0xbb>
jmp    112c <rcpProcRestartHandler+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x8,%eax
je     11cb <rcpProcRestartHandler+0xcb>
jmp    113d <rcpProcRestartHandler+0x3d>
mov    -0x10(%rbp),%eax
sub    $0x10,%eax
je     11db <rcpProcRestartHandler+0xdb>
jmp    114e <rcpProcRestartHandler+0x4e>
mov    -0x10(%rbp),%eax
sub    $0x40,%eax
je     11eb <rcpProcRestartHandler+0xeb>
jmp    115f <rcpProcRestartHandler+0x5f>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
je     11fb <rcpProcRestartHandler+0xfb>
jmp    1172 <rcpProcRestartHandler+0x72>
mov    -0x10(%rbp),%eax
sub    $0x200,%eax
je     120b <rcpProcRestartHandler+0x10b>
jmp    1185 <rcpProcRestartHandler+0x85>
mov    -0x10(%rbp),%eax
sub    $0x400,%eax
je     121b <rcpProcRestartHandler+0x11b>
jmp    1198 <rcpProcRestartHandler+0x98>
mov    -0x10(%rbp),%eax
sub    $0x800,%eax
je     122b <rcpProcRestartHandler+0x12b>
jmp    123b <rcpProcRestartHandler+0x13b>
lea    0xe4e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1246 <rcpProcRestartHandler+0x146>
lea    0xe4a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1246 <rcpProcRestartHandler+0x146>
lea    0xe44(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1246 <rcpProcRestartHandler+0x146>
lea    0xe3c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1246 <rcpProcRestartHandler+0x146>
lea    0xe33(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1246 <rcpProcRestartHandler+0x146>
lea    0xe2a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1246 <rcpProcRestartHandler+0x146>
lea    0xe21(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1246 <rcpProcRestartHandler+0x146>
lea    0xe18(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1246 <rcpProcRestartHandler+0x146>
lea    0xe12(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1246 <rcpProcRestartHandler+0x146>
lea    0xde9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcpProcRestartHandler>:
cmp    $0x7f,%edi
jg     112c <rcpProcRestartHandler+0x2c>
lea    -0x2(%rdi),%ecx
cmp    $0xe,%ecx
ja     1164 <rcpProcRestartHandler+0x64>
lea    0xf28(%rip),%rax
lea    0xee5(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf1d(%rip),%rax
ret
cmp    $0x3ff,%edi
jg     114c <rcpProcRestartHandler+0x4c>
cmp    $0x80,%edi
je     1189 <rcpProcRestartHandler+0x89>
cmp    $0x200,%edi
jne    1171 <rcpProcRestartHandler+0x71>
lea    0xf24(%rip),%rax
ret
cmp    $0x400,%edi
je     1191 <rcpProcRestartHandler+0x91>
cmp    $0x800,%edi
jne    1171 <rcpProcRestartHandler+0x71>
lea    0xf1d(%rip),%rax
ret
cmp    $0x40,%edi
jne    1171 <rcpProcRestartHandler+0x71>
lea    0xef1(%rip),%rax
ret
lea    0xeef(%rip),%rax
ret
lea    0xed2(%rip),%rax
ret
lea    0xed2(%rip),%rax
ret
lea    0xed8(%rip),%rax
ret
lea    0xede(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"rcpservices\00"
@.str.1 = [10 x i8] c"rcprouter\00"
@.str.2 = [8 x i8] c"rcpdhcp\00"
@.str.3 = [7 x i8] c"rcprip\00"
@.str.4 = [7 x i8] c"rcpsec\00"
@.str.5 = [7 x i8] c"rcpdns\00"
@.str.6 = [7 x i8] c"rcpacl\00"
@.str.7 = [10 x i8] c"rcpnetmon\00"
@.str.8 = [8 x i8] c"rcpospf\00"
@.str.9 = [1 x i8] zeroinitializer
define i8* @rcpProcRestartHandler(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %14 [
i32 2, label %5
i32 4, label %6
i32 8, label %7
i32 16, label %8
i32 64, label %9
i32 128, label %10
i32 512, label %11
i32 1024, label %12
i32 2048, label %13
]
5: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
br label %15
6: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %15
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %15
8: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %15
9: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %15
10: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %15
11: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %15
12: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %15
13: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %15
14: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [12 x i8] c"rcpservices\00"
@.str.1 = [10 x i8] c"rcprouter\00"
@.str.2 = [8 x i8] c"rcpdhcp\00"
@.str.3 = [7 x i8] c"rcprip\00"
@.str.4 = [7 x i8] c"rcpsec\00"
@.str.5 = [7 x i8] c"rcpdns\00"
@.str.6 = [7 x i8] c"rcpacl\00"
@.str.7 = [10 x i8] c"rcpnetmon\00"
@.str.8 = [8 x i8] c"rcpospf\00"
@.str.9 = [1 x i8] zeroinitializer
define i8* @rcpProcRestartHandler(i32 %0) {
switch i32 %0, label %10 [
i32 2, label %11
i32 4, label %2
i32 8, label %3
i32 16, label %4
i32 64, label %5
i32 128, label %6
i32 512, label %7
i32 1024, label %8
i32 2048, label %9
]
2: ; preds = %1
br label %11
3: ; preds = %1
br label %11
4: ; preds = %1
br label %11
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5, %4, %3, %2
%12 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %12
}