#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_DAEMON;
int LOG_LOCAL0;
int LOG_LOCAL1;
int LOG_LOCAL2;
int LOG_LOCAL3;
int LOG_LOCAL4;
int LOG_LOCAL5;
int LOG_LOCAL6;
int LOG_LOCAL7;
scalar_t__ strcasecmp(char const *, char *);
int logger_get_facility(const char *facility) {
  if (facility == NULL) {
    return LOG_LOCAL1;
  }
  if (strcasecmp(facility, "daemon") == 0) {
    return LOG_DAEMON;
  } else if (strcasecmp(facility, "local0") == 0) {
    return LOG_LOCAL0;
  } else if (strcasecmp(facility, "local1") == 0) {
    return LOG_LOCAL1;
  } else if (strcasecmp(facility, "local2") == 0) {
    return LOG_LOCAL2;
  } else if (strcasecmp(facility, "local3") == 0) {
    return LOG_LOCAL3;
  } else if (strcasecmp(facility, "local4") == 0) {
    return LOG_LOCAL4;
  } else if (strcasecmp(facility, "local5") == 0) {
    return LOG_LOCAL5;
  } else if (strcasecmp(facility, "local6") == 0) {
    return LOG_LOCAL6;
  } else if (strcasecmp(facility, "local7") == 0) {
    return LOG_LOCAL7;
  } else {
    return LOG_LOCAL1;
  }
}


x86 assembly (clang, -O0):
<logger_get_facility>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <logger_get_facility+0x28>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c7 <logger_get_facility+0x1b7>
mov    -0x10(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1163 <logger_get_facility+0x53>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c7 <logger_get_facility+0x1b7>
mov    -0x10(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    118e <logger_get_facility+0x7e>
mov    0x2e44(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c7 <logger_get_facility+0x1b7>
mov    -0x10(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11b9 <logger_get_facility+0xa9>
mov    0x2df1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c7 <logger_get_facility+0x1b7>
mov    -0x10(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11e4 <logger_get_facility+0xd4>
mov    0x2dfe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c7 <logger_get_facility+0x1b7>
mov    -0x10(%rbp),%rdi
lea    0xe2d(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    120f <logger_get_facility+0xff>
mov    0x2dab(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c7 <logger_get_facility+0x1b7>
mov    -0x10(%rbp),%rdi
lea    0xe09(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    123a <logger_get_facility+0x12a>
mov    0x2da0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c7 <logger_get_facility+0x1b7>
mov    -0x10(%rbp),%rdi
lea    0xde5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1265 <logger_get_facility+0x155>
mov    0x2d4d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c7 <logger_get_facility+0x1b7>
mov    -0x10(%rbp),%rdi
lea    0xdc1(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1290 <logger_get_facility+0x180>
mov    0x2d5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c7 <logger_get_facility+0x1b7>
mov    -0x10(%rbp),%rdi
lea    0xd9d(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12bb <logger_get_facility+0x1ab>
mov    0x2d07(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12c7 <logger_get_facility+0x1b7>
mov    0x2cde(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_get_facility>:
push   %r14
push   %rbx
push   %rax
mov    0x2e85(%rip),%r14
test   %rdi,%rdi
je     1233 <logger_get_facility+0x123>
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11ed <logger_get_facility+0xdd>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11f6 <logger_get_facility+0xe6>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1233 <logger_get_facility+0x123>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11ff <logger_get_facility+0xef>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1208 <logger_get_facility+0xf8>
lea    0xe88(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1211 <logger_get_facility+0x101>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     121a <logger_get_facility+0x10a>
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1223 <logger_get_facility+0x113>
lea    0xe61(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
jne    122c <logger_get_facility+0x11c>
mov    0x2dcd(%rip),%r14
jmp    1233 <logger_get_facility+0x123>
mov    0x2df4(%rip),%r14
jmp    1233 <logger_get_facility+0x123>
mov    0x2dcb(%rip),%r14
jmp    1233 <logger_get_facility+0x123>
mov    0x2dd2(%rip),%r14
jmp    1233 <logger_get_facility+0x123>
mov    0x2da1(%rip),%r14
jmp    1233 <logger_get_facility+0x123>
mov    0x2db8(%rip),%r14
jmp    1233 <logger_get_facility+0x123>
mov    0x2d87(%rip),%r14
jmp    1233 <logger_get_facility+0x123>
mov    0x2db6(%rip),%r14
jmp    1233 <logger_get_facility+0x123>
mov    0x2d6d(%rip),%r14
mov    (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@LOG_LOCAL1 = global i32 0
@.str = [7 x i8] c"daemon\00"
@LOG_DAEMON = global i32 0
@.str.1 = [7 x i8] c"local0\00"
@LOG_LOCAL0 = global i32 0
@.str.2 = [7 x i8] c"local1\00"
@.str.3 = [7 x i8] c"local2\00"
@LOG_LOCAL2 = global i32 0
@.str.4 = [7 x i8] c"local3\00"
@LOG_LOCAL3 = global i32 0
@.str.5 = [7 x i8] c"local4\00"
@LOG_LOCAL4 = global i32 0
@.str.6 = [7 x i8] c"local5\00"
@LOG_LOCAL5 = global i32 0
@.str.7 = [7 x i8] c"local6\00"
@LOG_LOCAL6 = global i32 0
@.str.8 = [7 x i8] c"local7\00"
@LOG_LOCAL7 = global i32 0
define i32 @logger_get_facility(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @LOG_LOCAL1
store i32 %7, i32* %2
br label %64
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcasecmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i32, i32* @LOG_DAEMON
store i32 %13, i32* %2
br label %64
14: ; preds = %8
%15 = load i8*, i8** %3
%16 = call i64 @strcasecmp(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32, i32* @LOG_LOCAL0
store i32 %19, i32* %2
br label %64
20: ; preds = %14
%21 = load i8*, i8** %3
%22 = call i64 @strcasecmp(i8* %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* @LOG_LOCAL1
store i32 %25, i32* %2
br label %64
26: ; preds = %20
%27 = load i8*, i8** %3
%28 = call i64 @strcasecmp(i8* %27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = load i32, i32* @LOG_LOCAL2
store i32 %31, i32* %2
br label %64
32: ; preds = %26
%33 = load i8*, i8** %3
%34 = call i64 @strcasecmp(i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = load i32, i32* @LOG_LOCAL3
store i32 %37, i32* %2
br label %64
38: ; preds = %32
%39 = load i8*, i8** %3
%40 = call i64 @strcasecmp(i8* %39, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = load i32, i32* @LOG_LOCAL4
store i32 %43, i32* %2
br label %64
44: ; preds = %38
%45 = load i8*, i8** %3
%46 = call i64 @strcasecmp(i8* %45, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %44
%49 = load i32, i32* @LOG_LOCAL5
store i32 %49, i32* %2
br label %64
50: ; preds = %44
%51 = load i8*, i8** %3
%52 = call i64 @strcasecmp(i8* %51, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %50
%55 = load i32, i32* @LOG_LOCAL6
store i32 %55, i32* %2
br label %64
56: ; preds = %50
%57 = load i8*, i8** %3
%58 = call i64 @strcasecmp(i8* %57, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %56
%61 = load i32, i32* @LOG_LOCAL7
store i32 %61, i32* %2
br label %64
62: ; preds = %56
%63 = load i32, i32* @LOG_LOCAL1
store i32 %63, i32* %2
br label %64
64: ; preds = %62, %60, %54, %48, %42, %36, %30, %24, %18, %12, %6
%65 = load i32, i32* %2
ret i32 %65
}

LLVM IR (-O2):
@LOG_LOCAL1 = global i32 0
@.str = [7 x i8] c"daemon\00"
@LOG_DAEMON = global i32 0
@.str.1 = [7 x i8] c"local0\00"
@LOG_LOCAL0 = global i32 0
@.str.2 = [7 x i8] c"local1\00"
@.str.3 = [7 x i8] c"local2\00"
@LOG_LOCAL2 = global i32 0
@.str.4 = [7 x i8] c"local3\00"
@LOG_LOCAL3 = global i32 0
@.str.5 = [7 x i8] c"local4\00"
@LOG_LOCAL4 = global i32 0
@.str.6 = [7 x i8] c"local5\00"
@LOG_LOCAL5 = global i32 0
@.str.7 = [7 x i8] c"local6\00"
@LOG_LOCAL6 = global i32 0
@.str.8 = [7 x i8] c"local7\00"
@LOG_LOCAL7 = global i32 0
define i32 @logger_get_facility(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %31, label %3
3: ; preds = %1
%4 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %31, label %6
6: ; preds = %3
%7 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %31, label %9
9: ; preds = %6
%10 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %31, label %12
12: ; preds = %9
%13 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %31, label %15
15: ; preds = %12
%16 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %31, label %18
18: ; preds = %15
%19 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %31, label %21
21: ; preds = %18
%22 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %31, label %24
24: ; preds = %21
%25 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %24
%28 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
%30 = select i1 %29, i32* @LOG_LOCAL7, i32* @LOG_LOCAL1
br label %31
31: ; preds = %27, %24, %21, %18, %15, %12, %9, %6, %3, %1
%32 = phi i32* [ @LOG_LOCAL1, %1 ], [ @LOG_DAEMON, %3 ], [ @LOG_LOCAL0, %6 ], [ @LOG_LOCAL1, %9 ], [ @LOG_LOCAL2, %12 ], [ @LOG_LOCAL3, %15 ], [ @LOG_LOCAL4, %18 ], [ @LOG_LOCAL5, %21 ], [ @LOG_LOCAL6, %24 ], [ %30, %27 ]
%33 = load i32, i32* %32
ret i32 %33
}