#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 unsigned long long uint64_t;

/* Variables and functions */
const char *rcpLogFacility(uint64_t fc) {
  if (fc & (1ULL << 2))
    return "ROUTER";
  if (fc & (1ULL << 10))
    return "OSPF-SPF";
  if (fc & (1ULL << 12))
    return "OSPF-LSA";
  if (fc & (1ULL << 11))
    return "OSPF-DRBDR";
  if (fc & (1ULL << 13))
    return "OSPF-PKT";
  switch (fc) {
  case 1ULL:
    return "CONFIG";
  case (1ULL << 1):
    return "INTERFACE";
  case (1ULL << 3):
    return "ADMIN";
  case (1ULL << 4):
    return "SYSCFG";
  case (1ULL << 5):
    return "IPC";
  case (1ULL << 6):
    return "DHCP";
  case (1ULL << 7):
    return "RIP";
  case (1ULL << 8):
    return "DNS";
  case (1ULL << 9):
    return "NTPD";
  case (1ULL << 14):
    return "MONITOR";
  case (1ULL << 15):
    return "HTTP";
  }
  return "";
}


x86 assembly (clang, -O0):
<rcpLogFacility>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x4,%rax
cmp    $0x0,%rax
je     112a <rcpLogFacility+0x2a>
lea    0xedf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
mov    -0x10(%rbp),%rax
and    $0x400,%rax
cmp    $0x0,%rax
je     114e <rcpLogFacility+0x4e>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
mov    -0x10(%rbp),%rax
and    $0x1000,%rax
cmp    $0x0,%rax
je     1172 <rcpLogFacility+0x72>
lea    0xea7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
mov    -0x10(%rbp),%rax
and    $0x800,%rax
cmp    $0x0,%rax
je     1196 <rcpLogFacility+0x96>
lea    0xe8c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
mov    -0x10(%rbp),%rax
and    $0x2000,%rax
cmp    $0x0,%rax
je     11ba <rcpLogFacility+0xba>
lea    0xe73(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x1,%rax
je     1299 <rcpLogFacility+0x199>
jmp    11d1 <rcpLogFacility+0xd1>
mov    -0x18(%rbp),%rax
sub    $0x2,%rax
je     12a9 <rcpLogFacility+0x1a9>
jmp    11e4 <rcpLogFacility+0xe4>
mov    -0x18(%rbp),%rax
sub    $0x8,%rax
je     12b9 <rcpLogFacility+0x1b9>
jmp    11f7 <rcpLogFacility+0xf7>
mov    -0x18(%rbp),%rax
sub    $0x10,%rax
je     12c9 <rcpLogFacility+0x1c9>
jmp    120a <rcpLogFacility+0x10a>
mov    -0x18(%rbp),%rax
sub    $0x20,%rax
je     12d9 <rcpLogFacility+0x1d9>
jmp    121d <rcpLogFacility+0x11d>
mov    -0x18(%rbp),%rax
sub    $0x40,%rax
je     12e9 <rcpLogFacility+0x1e9>
jmp    1230 <rcpLogFacility+0x130>
mov    -0x18(%rbp),%rax
sub    $0x80,%rax
je     12f9 <rcpLogFacility+0x1f9>
jmp    1245 <rcpLogFacility+0x145>
mov    -0x18(%rbp),%rax
sub    $0x100,%rax
je     1309 <rcpLogFacility+0x209>
jmp    125a <rcpLogFacility+0x15a>
mov    -0x18(%rbp),%rax
sub    $0x200,%rax
je     1319 <rcpLogFacility+0x219>
jmp    126f <rcpLogFacility+0x16f>
mov    -0x18(%rbp),%rax
sub    $0x4000,%rax
je     1329 <rcpLogFacility+0x229>
jmp    1284 <rcpLogFacility+0x184>
mov    -0x18(%rbp),%rax
sub    $0x8000,%rax
je     1339 <rcpLogFacility+0x239>
jmp    1349 <rcpLogFacility+0x249>
lea    0xd8d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xd84(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xd7e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xd74(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xd6b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xd5f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xd54(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xd48(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xd3c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xd31(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xd29(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1354 <rcpLogFacility+0x254>
lea    0xcc8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcpLogFacility>:
test   $0x4,%dil
jne    1161 <rcpLogFacility+0x61>
test   $0x400,%edi
jne    1169 <rcpLogFacility+0x69>
test   $0x1000,%edi
jne    1171 <rcpLogFacility+0x71>
test   $0x800,%edi
jne    1179 <rcpLogFacility+0x79>
test   $0x2000,%edi
jne    1181 <rcpLogFacility+0x81>
cmp    $0x3f,%rdi
jle    1189 <rcpLogFacility+0x89>
cmp    $0x1ff,%rdi
jg     11b2 <rcpLogFacility+0xb2>
cmp    $0x40,%rdi
je     11d5 <rcpLogFacility+0xd5>
cmp    $0x80,%rdi
je     11dd <rcpLogFacility+0xdd>
cmp    $0x100,%rdi
jne    120d <rcpLogFacility+0x10d>
lea    0xf78(%rip),%rax
ret
lea    0xf18(%rip),%rax
ret
lea    0xf17(%rip),%rax
ret
lea    0xf18(%rip),%rax
ret
lea    0xf19(%rip),%rax
ret
lea    0xf1c(%rip),%rax
ret
add    $0xffffffffffffffff,%rdi
cmp    $0x1f,%rdi
ja     120d <rcpLogFacility+0x10d>
lea    0xf13(%rip),%rax
lea    0xe5f(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0xf03(%rip),%rax
ret
cmp    $0x200,%rdi
je     11fd <rcpLogFacility+0xfd>
cmp    $0x4000,%rdi
je     1205 <rcpLogFacility+0x105>
cmp    $0x8000,%rdi
jne    120d <rcpLogFacility+0x10d>
lea    0xf15(%rip),%rax
ret
lea    0xef3(%rip),%rax
ret
lea    0xef0(%rip),%rax
ret
lea    0xed2(%rip),%rax
ret
lea    0xed0(%rip),%rax
ret
lea    0xecf(%rip),%rax
ret
lea    0xed8(%rip),%rax
ret
lea    0xed5(%rip),%rax
ret
lea    0xe84(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ROUTER\00"
@.str.1 = [9 x i8] c"OSPF-SPF\00"
@.str.2 = [9 x i8] c"OSPF-LSA\00"
@.str.3 = [11 x i8] c"OSPF-DRBDR\00"
@.str.4 = [9 x i8] c"OSPF-PKT\00"
@.str.5 = [7 x i8] c"CONFIG\00"
@.str.6 = [10 x i8] c"INTERFACE\00"
@.str.7 = [6 x i8] c"ADMIN\00"
@.str.8 = [7 x i8] c"SYSCFG\00"
@.str.9 = [4 x i8] c"IPC\00"
@.str.10 = [5 x i8] c"DHCP\00"
@.str.11 = [4 x i8] c"RIP\00"
@.str.12 = [4 x i8] c"DNS\00"
@.str.13 = [5 x i8] c"NTPD\00"
@.str.14 = [8 x i8] c"MONITOR\00"
@.str.15 = [5 x i8] c"HTTP\00"
@.str.16 = [1 x i8] zeroinitializer
define i8* @rcpLogFacility(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, 4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %42
8: ; preds = %1
%9 = load i64, i64* %3
%10 = and i64 %9, 1024
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %42
13: ; preds = %8
%14 = load i64, i64* %3
%15 = and i64 %14, 4096
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %42
18: ; preds = %13
%19 = load i64, i64* %3
%20 = and i64 %19, 2048
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %42
23: ; preds = %18
%24 = load i64, i64* %3
%25 = and i64 %24, 8192
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %42
28: ; preds = %23
%29 = load i64, i64* %3
switch i64 %29, label %41 [
i64 1, label %30
i64 2, label %31
i64 8, label %32
i64 16, label %33
i64 32, label %34
i64 64, label %35
i64 128, label %36
i64 256, label %37
i64 512, label %38
i64 16384, label %39
i64 32768, label %40
]
30: ; preds = %28
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %42
31: ; preds = %28
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %42
32: ; preds = %28
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %42
33: ; preds = %28
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %42
34: ; preds = %28
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %42
35: ; preds = %28
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %42
36: ; preds = %28
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %42
37: ; preds = %28
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %42
38: ; preds = %28
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %42
39: ; preds = %28
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %42
40: ; preds = %28
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %42
41: ; preds = %28
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %42
42: ; preds = %41, %40, %39, %38, %37, %36, %35, %34, %33, %32, %31, %30, %27, %22, %17, %12, %7
%43 = load i8*, i8** %2
ret i8* %43
}

LLVM IR (-O2):
@.str = [7 x i8] c"ROUTER\00"
@.str.1 = [9 x i8] c"OSPF-SPF\00"
@.str.2 = [9 x i8] c"OSPF-LSA\00"
@.str.3 = [11 x i8] c"OSPF-DRBDR\00"
@.str.4 = [9 x i8] c"OSPF-PKT\00"
@.str.5 = [7 x i8] c"CONFIG\00"
@.str.6 = [10 x i8] c"INTERFACE\00"
@.str.7 = [6 x i8] c"ADMIN\00"
@.str.8 = [7 x i8] c"SYSCFG\00"
@.str.9 = [4 x i8] c"IPC\00"
@.str.10 = [5 x i8] c"DHCP\00"
@.str.11 = [4 x i8] c"RIP\00"
@.str.12 = [4 x i8] c"DNS\00"
@.str.13 = [5 x i8] c"NTPD\00"
@.str.14 = [8 x i8] c"MONITOR\00"
@.str.15 = [5 x i8] c"HTTP\00"
@.str.16 = [1 x i8] zeroinitializer
define i8* @rcpLogFacility(i64 %0) {
%2 = and i64 %0, 4
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %28
4: ; preds = %1
%5 = and i64 %0, 1024
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %28
7: ; preds = %4
%8 = and i64 %0, 4096
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = and i64 %0, 2048
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %28
13: ; preds = %10
%14 = and i64 %0, 8192
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %13
switch i64 %0, label %27 [
i64 1, label %28
i64 2, label %17
i64 8, label %18
i64 16, label %19
i64 32, label %20
i64 64, label %21
i64 128, label %22
i64 256, label %23
i64 512, label %24
i64 16384, label %25
i64 32768, label %26
]
17: ; preds = %16
br label %28
18: ; preds = %16
br label %28
19: ; preds = %16
br label %28
20: ; preds = %16
br label %28
21: ; preds = %16
br label %28
22: ; preds = %16
br label %28
23: ; preds = %16
br label %28
24: ; preds = %16
br label %28
25: ; preds = %16
br label %28
26: ; preds = %16
br label %28
27: ; preds = %16
br label %28
28: ; preds = %16, %13, %10, %7, %4, %1, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17
%29 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.16, i64 0, i64 0), %27 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), %26 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), %25 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), %24 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), %23 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), %22 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), %21 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %20 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), %19 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %18 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), %17 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), %7 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %10 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), %13 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %16 ]
ret i8* %29
}