#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 */

/* Variables and functions */
int LOG_ALERT;
int LOG_CRIT;
int LOG_DEBUG;
int LOG_EMERG;
int LOG_ERR;
int LOG_INFO;
int LOG_NOTICE;
int LOG_WARNING;
int sysloglevel(int level) {
  switch (level) {
  case (0x01):
    return LOG_INFO;
    break;
  case (0x02):
    return LOG_WARNING;
    break;
  case (0x04):
    return LOG_ERR;
    break;
  case ((0x01) | (0x02) | (0x04)):
    return LOG_EMERG | LOG_ALERT | LOG_CRIT | LOG_ERR | LOG_WARNING |
           LOG_NOTICE | LOG_INFO | LOG_DEBUG;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sysloglevel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6,%eax
ja     11b3 <sysloglevel+0xb3>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ba <sysloglevel+0xba>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ba <sysloglevel+0xba>
mov    0x2e47(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ba <sysloglevel+0xba>
mov    0x2e6e(%rip),%rax
mov    (%rax),%eax
mov    0x2e75(%rip),%rcx
or     (%rcx),%eax
mov    0x2e64(%rip),%rcx
or     (%rcx),%eax
mov    0x2e1b(%rip),%rcx
or     (%rcx),%eax
mov    0x2e42(%rip),%rcx
or     (%rcx),%eax
mov    0x2e29(%rip),%rcx
or     (%rcx),%eax
mov    0x2e10(%rip),%rcx
or     (%rcx),%eax
mov    0x2e0f(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    11ba <sysloglevel+0xba>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysloglevel>:
xor    %eax,%eax
add    $0xffffffff,%edi
cmp    $0x6,%edi
ja     1180 <sysloglevel+0x80>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e99(%rip),%rcx
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2e8f(%rip),%rcx
or     (%rcx),%eax
mov    0x2e46(%rip),%rcx
or     (%rcx),%eax
mov    0x2e6d(%rip),%rcx
or     (%rcx),%eax
mov    0x2e54(%rip),%rcx
or     (%rcx),%eax
mov    0x2e3b(%rip),%rcx
or     (%rcx),%eax
mov    0x2e3a(%rip),%rcx
or     (%rcx),%eax
ret

LLVM IR (-O0):
@LOG_INFO = global i32 0
@LOG_WARNING = global i32 0
@LOG_ERR = global i32 0
@LOG_EMERG = global i32 0
@LOG_ALERT = global i32 0
@LOG_CRIT = global i32 0
@LOG_NOTICE = global i32 0
@LOG_DEBUG = global i32 0
define i32 @sysloglevel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %27 [
i32 1, label %5
i32 2, label %7
i32 4, label %9
i32 7, label %11
]
5: ; preds = %1
%6 = load i32, i32* @LOG_INFO
store i32 %6, i32* %2
br label %28
7: ; preds = %1
%8 = load i32, i32* @LOG_WARNING
store i32 %8, i32* %2
br label %28
9: ; preds = %1
%10 = load i32, i32* @LOG_ERR
store i32 %10, i32* %2
br label %28
11: ; preds = %1
%12 = load i32, i32* @LOG_EMERG
%13 = load i32, i32* @LOG_ALERT
%14 = or i32 %12, %13
%15 = load i32, i32* @LOG_CRIT
%16 = or i32 %14, %15
%17 = load i32, i32* @LOG_ERR
%18 = or i32 %16, %17
%19 = load i32, i32* @LOG_WARNING
%20 = or i32 %18, %19
%21 = load i32, i32* @LOG_NOTICE
%22 = or i32 %20, %21
%23 = load i32, i32* @LOG_INFO
%24 = or i32 %22, %23
%25 = load i32, i32* @LOG_DEBUG
%26 = or i32 %24, %25
store i32 %26, i32* %2
br label %28
27: ; preds = %1
store i32 0, i32* %2
br label %28
28: ; preds = %27, %11, %9, %7, %5
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@LOG_WARNING = global i32 0
@LOG_ERR = global i32 0
@LOG_EMERG = global i32 0
@LOG_ALERT = global i32 0
@LOG_CRIT = global i32 0
@LOG_NOTICE = global i32 0
@LOG_DEBUG = global i32 0
define i32 @sysloglevel(i32 %0) {
switch i32 %0, label %24 [
i32 1, label %2
i32 2, label %4
i32 4, label %6
i32 7, label %8
]
2: ; preds = %1
%3 = load i32, i32* @LOG_INFO
br label %24
4: ; preds = %1
%5 = load i32, i32* @LOG_WARNING
br label %24
6: ; preds = %1
%7 = load i32, i32* @LOG_ERR
br label %24
8: ; preds = %1
%9 = load i32, i32* @LOG_EMERG
%10 = load i32, i32* @LOG_ALERT
%11 = or i32 %10, %9
%12 = load i32, i32* @LOG_CRIT
%13 = or i32 %11, %12
%14 = load i32, i32* @LOG_ERR
%15 = or i32 %13, %14
%16 = load i32, i32* @LOG_WARNING
%17 = or i32 %15, %16
%18 = load i32, i32* @LOG_NOTICE
%19 = or i32 %17, %18
%20 = load i32, i32* @LOG_INFO
%21 = or i32 %19, %20
%22 = load i32, i32* @LOG_DEBUG
%23 = or i32 %21, %22
br label %24
24: ; preds = %1, %8, %6, %4, %2
%25 = phi i32 [ %23, %8 ], [ %7, %6 ], [ %5, %4 ], [ %3, %2 ], [ 0, %1 ]
ret i32 %25
}