#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_AUTH;
int LOG_AUTHPRIV;
int LOG_CRON;
int LOG_DAEMON;
int LOG_FTP;
int LOG_KERN;
int LOG_LOCAL0;
int LOG_LOCAL1;
int LOG_LOCAL2;
int LOG_LOCAL3;
int LOG_LOCAL4;
int LOG_LOCAL5;
int LOG_LOCAL6;
int LOG_LOCAL7;
int LOG_LPR;
int LOG_MAIL;
int LOG_NEWS;
int LOG_SYSLOG;
int LOG_USER;
int LOG_UUCP;
int /*<<< orphan*/ strcasecmp(char *, char const *);
int /*<<< orphan*/ strncasecmp(char const *, char *, int);
int zlog_get_facility_from_str(const char *facility) {
  int fa = LOG_SYSLOG;
  if (!strncasecmp(facility, "LOG_", 4)) {
    facility += 4;
  }
  if (!strcasecmp("KERN", facility)) {
    fa = LOG_KERN;
  };
  if (!strcasecmp("USER", facility)) {
    fa = LOG_USER;
  };
  if (!strcasecmp("MAIL", facility)) {
    fa = LOG_MAIL;
  };
  if (!strcasecmp("DAEMON", facility)) {
    fa = LOG_DAEMON;
  };
  if (!strcasecmp("AUTH", facility)) {
    fa = LOG_AUTH;
  };
  if (!strcasecmp("SYSLOG", facility)) {
    fa = LOG_SYSLOG;
  };
  if (!strcasecmp("LPR", facility)) {
    fa = LOG_LPR;
  };
  if (!strcasecmp("NEWS", facility)) {
    fa = LOG_NEWS;
  };
  if (!strcasecmp("UUCP", facility)) {
    fa = LOG_UUCP;
  };
  if (!strcasecmp("CRON", facility)) {
    fa = LOG_CRON;
  };
  if (!strcasecmp("AUTHPRIV", facility)) {
    fa = LOG_AUTHPRIV;
  };
  if (!strcasecmp("FTP", facility)) {
    fa = LOG_FTP;
  };
  if (!strcasecmp("LOCAL0", facility)) {
    fa = LOG_LOCAL0;
  };
  if (!strcasecmp("LOCAL1", facility)) {
    fa = LOG_LOCAL1;
  };
  if (!strcasecmp("LOCAL2", facility)) {
    fa = LOG_LOCAL2;
  };
  if (!strcasecmp("LOCAL3", facility)) {
    fa = LOG_LOCAL3;
  };
  if (!strcasecmp("LOCAL4", facility)) {
    fa = LOG_LOCAL4;
  };
  if (!strcasecmp("LOCAL5", facility)) {
    fa = LOG_LOCAL5;
  };
  if (!strcasecmp("LOCAL6", facility)) {
    fa = LOG_LOCAL6;
  };
  if (!strcasecmp("LOCAL7", facility)) {
    fa = LOG_LOCAL7;
  };
  return fa;
}


x86 assembly (clang, -O0):
<zlog_get_facility_from_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1162 <zlog_get_facility_from_str+0x42>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1187 <zlog_get_facility_from_str+0x67>
mov    0x2de6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11ac <zlog_get_facility_from_str+0x8c>
mov    0x2e41(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe58(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11d1 <zlog_get_facility_from_str+0xb1>
mov    0x2d84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe38(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11f6 <zlog_get_facility_from_str+0xd6>
mov    0x2def(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe1a(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    121b <zlog_get_facility_from_str+0xfb>
mov    0x2d9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xdfa(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1240 <zlog_get_facility_from_str+0x120>
mov    0x2d5d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xddc(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1265 <zlog_get_facility_from_str+0x145>
mov    0x2d40(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xdbb(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    128a <zlog_get_facility_from_str+0x16a>
mov    0x2d53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xd9b(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    12af <zlog_get_facility_from_str+0x18f>
mov    0x2c9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xd7b(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    12d4 <zlog_get_facility_from_str+0x1b4>
mov    0x2c71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xd5b(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    12f9 <zlog_get_facility_from_str+0x1d9>
mov    0x2c6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xd3f(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    131e <zlog_get_facility_from_str+0x1fe>
mov    0x2c57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xd1e(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1343 <zlog_get_facility_from_str+0x223>
mov    0x2c7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xd00(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1368 <zlog_get_facility_from_str+0x248>
mov    0x2c15(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xce2(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    138d <zlog_get_facility_from_str+0x26d>
mov    0x2c40(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xcc4(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    13b2 <zlog_get_facility_from_str+0x292>
mov    0x2bdb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xca6(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    13d7 <zlog_get_facility_from_str+0x2b7>
mov    0x2bee(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xc88(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    13fc <zlog_get_facility_from_str+0x2dc>
mov    0x2b89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xc6a(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1421 <zlog_get_facility_from_str+0x301>
mov    0x2bb4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xc4c(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1446 <zlog_get_facility_from_str+0x326>
mov    0x2b4f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zlog_get_facility_from_str>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2e6a(%rip),%rax
mov    (%rax),%r14d
lea    0xec8(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rbx,%rcx,4),%rbx
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
mov    %r14d,%ebp
test   %eax,%eax
jne    116c <zlog_get_facility_from_str+0x4c>
mov    0x2dfe(%rip),%rax
mov    (%rax),%ebp
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1188 <zlog_get_facility_from_str+0x68>
mov    0x2e62(%rip),%rax
mov    (%rax),%ebp
lea    0xe80(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    11a4 <zlog_get_facility_from_str+0x84>
mov    0x2dae(%rip),%rax
mov    (%rax),%ebp
lea    0xe69(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    11c0 <zlog_get_facility_from_str+0xa0>
mov    0x2e22(%rip),%rax
mov    (%rax),%ebp
lea    0xe54(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    11dc <zlog_get_facility_from_str+0xbc>
mov    0x2dd6(%rip),%rax
mov    (%rax),%ebp
lea    0xe3d(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
cmove  %r14d,%ebp
lea    0xe2f(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    120d <zlog_get_facility_from_str+0xed>
mov    0x2d95(%rip),%rax
mov    (%rax),%ebp
lea    0xe17(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1229 <zlog_get_facility_from_str+0x109>
mov    0x2db1(%rip),%rax
mov    (%rax),%ebp
lea    0xe00(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1245 <zlog_get_facility_from_str+0x125>
mov    0x2d05(%rip),%rax
mov    (%rax),%ebp
lea    0xde9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1261 <zlog_get_facility_from_str+0x141>
mov    0x2ce1(%rip),%rax
mov    (%rax),%ebp
lea    0xdd2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    127d <zlog_get_facility_from_str+0x15d>
mov    0x2ce5(%rip),%rax
mov    (%rax),%ebp
lea    0xdbf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1299 <zlog_get_facility_from_str+0x179>
mov    0x2cd9(%rip),%rax
mov    (%rax),%ebp
lea    0xda7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    12b5 <zlog_get_facility_from_str+0x195>
mov    0x2d05(%rip),%rax
mov    (%rax),%ebp
lea    0xd92(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    12d1 <zlog_get_facility_from_str+0x1b1>
mov    0x2ca9(%rip),%rax
mov    (%rax),%ebp
lea    0xd7d(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    12ed <zlog_get_facility_from_str+0x1cd>
mov    0x2cdd(%rip),%rax
mov    (%rax),%ebp
lea    0xd68(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1309 <zlog_get_facility_from_str+0x1e9>
mov    0x2c81(%rip),%rax
mov    (%rax),%ebp
lea    0xd53(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1325 <zlog_get_facility_from_str+0x205>
mov    0x2c9d(%rip),%rax
mov    (%rax),%ebp
lea    0xd3e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1341 <zlog_get_facility_from_str+0x221>
mov    0x2c41(%rip),%rax
mov    (%rax),%ebp
lea    0xd29(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    135d <zlog_get_facility_from_str+0x23d>
mov    0x2c75(%rip),%rax
mov    (%rax),%ebp
lea    0xd14(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1379 <zlog_get_facility_from_str+0x259>
mov    0x2c19(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@LOG_SYSLOG = global i32 0
@.str = [5 x i8] c"LOG_\00"
@.str.1 = [5 x i8] c"KERN\00"
@LOG_KERN = global i32 0
@.str.2 = [5 x i8] c"USER\00"
@LOG_USER = global i32 0
@.str.3 = [5 x i8] c"MAIL\00"
@LOG_MAIL = global i32 0
@.str.4 = [7 x i8] c"DAEMON\00"
@LOG_DAEMON = global i32 0
@.str.5 = [5 x i8] c"AUTH\00"
@LOG_AUTH = global i32 0
@.str.6 = [7 x i8] c"SYSLOG\00"
@.str.7 = [4 x i8] c"LPR\00"
@LOG_LPR = global i32 0
@.str.8 = [5 x i8] c"NEWS\00"
@LOG_NEWS = global i32 0
@.str.9 = [5 x i8] c"UUCP\00"
@LOG_UUCP = global i32 0
@.str.10 = [5 x i8] c"CRON\00"
@LOG_CRON = global i32 0
@.str.11 = [9 x i8] c"AUTHPRIV\00"
@LOG_AUTHPRIV = global i32 0
@.str.12 = [4 x i8] c"FTP\00"
@LOG_FTP = global i32 0
@.str.13 = [7 x i8] c"LOCAL0\00"
@LOG_LOCAL0 = global i32 0
@.str.14 = [7 x i8] c"LOCAL1\00"
@LOG_LOCAL1 = global i32 0
@.str.15 = [7 x i8] c"LOCAL2\00"
@LOG_LOCAL2 = global i32 0
@.str.16 = [7 x i8] c"LOCAL3\00"
@LOG_LOCAL3 = global i32 0
@.str.17 = [7 x i8] c"LOCAL4\00"
@LOG_LOCAL4 = global i32 0
@.str.18 = [7 x i8] c"LOCAL5\00"
@LOG_LOCAL5 = global i32 0
@.str.19 = [7 x i8] c"LOCAL6\00"
@LOG_LOCAL6 = global i32 0
@.str.20 = [7 x i8] c"LOCAL7\00"
@LOG_LOCAL7 = global i32 0
define i32 @zlog_get_facility_from_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @LOG_SYSLOG
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @strncasecmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 4
store i8* %10, i8** %2
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %2
%13 = call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = load i32, i32* @LOG_KERN
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %11
%18 = load i8*, i8** %2
%19 = call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = icmp ne i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %17
%22 = load i32, i32* @LOG_USER
store i32 %22, i32* %3
br label %23
23: ; preds = %21, %17
%24 = load i8*, i8** %2
%25 = call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = load i32, i32* @LOG_MAIL
store i32 %28, i32* %3
br label %29
29: ; preds = %27, %23
%30 = load i8*, i8** %2
%31 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %29
%34 = load i32, i32* @LOG_DAEMON
store i32 %34, i32* %3
br label %35
35: ; preds = %33, %29
%36 = load i8*, i8** %2
%37 = call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %36)
%38 = icmp ne i32 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %35
%40 = load i32, i32* @LOG_AUTH
store i32 %40, i32* %3
br label %41
41: ; preds = %39, %35
%42 = load i8*, i8** %2
%43 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %42)
%44 = icmp ne i32 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %41
%46 = load i32, i32* @LOG_SYSLOG
store i32 %46, i32* %3
br label %47
47: ; preds = %45, %41
%48 = load i8*, i8** %2
%49 = call i32 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %48)
%50 = icmp ne i32 %49, 0
br i1 %50, label %53, label %51
51: ; preds = %47
%52 = load i32, i32* @LOG_LPR
store i32 %52, i32* %3
br label %53
53: ; preds = %51, %47
%54 = load i8*, i8** %2
%55 = call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %54)
%56 = icmp ne i32 %55, 0
br i1 %56, label %59, label %57
57: ; preds = %53
%58 = load i32, i32* @LOG_NEWS
store i32 %58, i32* %3
br label %59
59: ; preds = %57, %53
%60 = load i8*, i8** %2
%61 = call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* %60)
%62 = icmp ne i32 %61, 0
br i1 %62, label %65, label %63
63: ; preds = %59
%64 = load i32, i32* @LOG_UUCP
store i32 %64, i32* %3
br label %65
65: ; preds = %63, %59
%66 = load i8*, i8** %2
%67 = call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %66)
%68 = icmp ne i32 %67, 0
br i1 %68, label %71, label %69
69: ; preds = %65
%70 = load i32, i32* @LOG_CRON
store i32 %70, i32* %3
br label %71
71: ; preds = %69, %65
%72 = load i8*, i8** %2
%73 = call i32 @strcasecmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* %72)
%74 = icmp ne i32 %73, 0
br i1 %74, label %77, label %75
75: ; preds = %71
%76 = load i32, i32* @LOG_AUTHPRIV
store i32 %76, i32* %3
br label %77
77: ; preds = %75, %71
%78 = load i8*, i8** %2
%79 = call i32 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %78)
%80 = icmp ne i32 %79, 0
br i1 %80, label %83, label %81
81: ; preds = %77
%82 = load i32, i32* @LOG_FTP
store i32 %82, i32* %3
br label %83
83: ; preds = %81, %77
%84 = load i8*, i8** %2
%85 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* %84)
%86 = icmp ne i32 %85, 0
br i1 %86, label %89, label %87
87: ; preds = %83
%88 = load i32, i32* @LOG_LOCAL0
store i32 %88, i32* %3
br label %89
89: ; preds = %87, %83
%90 = load i8*, i8** %2
%91 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i8* %90)
%92 = icmp ne i32 %91, 0
br i1 %92, label %95, label %93
93: ; preds = %89
%94 = load i32, i32* @LOG_LOCAL1
store i32 %94, i32* %3
br label %95
95: ; preds = %93, %89
%96 = load i8*, i8** %2
%97 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %96)
%98 = icmp ne i32 %97, 0
br i1 %98, label %101, label %99
99: ; preds = %95
%100 = load i32, i32* @LOG_LOCAL2
store i32 %100, i32* %3
br label %101
101: ; preds = %99, %95
%102 = load i8*, i8** %2
%103 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* %102)
%104 = icmp ne i32 %103, 0
br i1 %104, label %107, label %105
105: ; preds = %101
%106 = load i32, i32* @LOG_LOCAL3
store i32 %106, i32* %3
br label %107
107: ; preds = %105, %101
%108 = load i8*, i8** %2
%109 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* %108)
%110 = icmp ne i32 %109, 0
br i1 %110, label %113, label %111
111: ; preds = %107
%112 = load i32, i32* @LOG_LOCAL4
store i32 %112, i32* %3
br label %113
113: ; preds = %111, %107
%114 = load i8*, i8** %2
%115 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i8* %114)
%116 = icmp ne i32 %115, 0
br i1 %116, label %119, label %117
117: ; preds = %113
%118 = load i32, i32* @LOG_LOCAL5
store i32 %118, i32* %3
br label %119
119: ; preds = %117, %113
%120 = load i8*, i8** %2
%121 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i8* %120)
%122 = icmp ne i32 %121, 0
br i1 %122, label %125, label %123
123: ; preds = %119
%124 = load i32, i32* @LOG_LOCAL6
store i32 %124, i32* %3
br label %125
125: ; preds = %123, %119
%126 = load i8*, i8** %2
%127 = call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i8* %126)
%128 = icmp ne i32 %127, 0
br i1 %128, label %131, label %129
129: ; preds = %125
%130 = load i32, i32* @LOG_LOCAL7
store i32 %130, i32* %3
br label %131
131: ; preds = %129, %125
%132 = load i32, i32* %3
ret i32 %132
}

LLVM IR (-O2):
@LOG_SYSLOG = global i32 0
@.str = [5 x i8] c"LOG_\00"
@.str.1 = [5 x i8] c"KERN\00"
@LOG_KERN = global i32 0
@.str.2 = [5 x i8] c"USER\00"
@LOG_USER = global i32 0
@.str.3 = [5 x i8] c"MAIL\00"
@LOG_MAIL = global i32 0
@.str.4 = [7 x i8] c"DAEMON\00"
@LOG_DAEMON = global i32 0
@.str.5 = [5 x i8] c"AUTH\00"
@LOG_AUTH = global i32 0
@.str.6 = [7 x i8] c"SYSLOG\00"
@.str.7 = [4 x i8] c"LPR\00"
@LOG_LPR = global i32 0
@.str.8 = [5 x i8] c"NEWS\00"
@LOG_NEWS = global i32 0
@.str.9 = [5 x i8] c"UUCP\00"
@LOG_UUCP = global i32 0
@.str.10 = [5 x i8] c"CRON\00"
@LOG_CRON = global i32 0
@.str.11 = [9 x i8] c"AUTHPRIV\00"
@LOG_AUTHPRIV = global i32 0
@.str.12 = [4 x i8] c"FTP\00"
@LOG_FTP = global i32 0
@.str.13 = [7 x i8] c"LOCAL0\00"
@LOG_LOCAL0 = global i32 0
@.str.14 = [7 x i8] c"LOCAL1\00"
@LOG_LOCAL1 = global i32 0
@.str.15 = [7 x i8] c"LOCAL2\00"
@LOG_LOCAL2 = global i32 0
@.str.16 = [7 x i8] c"LOCAL3\00"
@LOG_LOCAL3 = global i32 0
@.str.17 = [7 x i8] c"LOCAL4\00"
@LOG_LOCAL4 = global i32 0
@.str.18 = [7 x i8] c"LOCAL5\00"
@LOG_LOCAL5 = global i32 0
@.str.19 = [7 x i8] c"LOCAL6\00"
@LOG_LOCAL6 = global i32 0
@.str.20 = [7 x i8] c"LOCAL7\00"
@LOG_LOCAL7 = global i32 0
define i32 @zlog_get_facility_from_str(i8* nocapture %0) {
%2 = load i32, i32* @LOG_SYSLOG
%3 = tail call i32 @strncasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i64 4, i64 0
%6 = getelementptr i8, i8* %0, i64 %5
%7 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = icmp eq i32 %7, 0
%9 = load i32, i32* @LOG_KERN
%10 = select i1 %8, i32 %9, i32 %2
%11 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%12 = icmp eq i32 %11, 0
%13 = load i32, i32* @LOG_USER
%14 = select i1 %12, i32 %13, i32 %10
%15 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%16 = icmp eq i32 %15, 0
%17 = load i32, i32* @LOG_MAIL
%18 = select i1 %16, i32 %17, i32 %14
%19 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%20 = icmp eq i32 %19, 0
%21 = load i32, i32* @LOG_DAEMON
%22 = select i1 %20, i32 %21, i32 %18
%23 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%24 = icmp eq i32 %23, 0
%25 = load i32, i32* @LOG_AUTH
%26 = select i1 %24, i32 %25, i32 %22
%27 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %6)
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i32 %2, i32 %26
%30 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%31 = icmp eq i32 %30, 0
%32 = load i32, i32* @LOG_LPR
%33 = select i1 %31, i32 %32, i32 %29
%34 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%35 = icmp eq i32 %34, 0
%36 = load i32, i32* @LOG_NEWS
%37 = select i1 %35, i32 %36, i32 %33
%38 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* %6)
%39 = icmp eq i32 %38, 0
%40 = load i32, i32* @LOG_UUCP
%41 = select i1 %39, i32 %40, i32 %37
%42 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %6)
%43 = icmp eq i32 %42, 0
%44 = load i32, i32* @LOG_CRON
%45 = select i1 %43, i32 %44, i32 %41
%46 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* %6)
%47 = icmp eq i32 %46, 0
%48 = load i32, i32* @LOG_AUTHPRIV
%49 = select i1 %47, i32 %48, i32 %45
%50 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %6)
%51 = icmp eq i32 %50, 0
%52 = load i32, i32* @LOG_FTP
%53 = select i1 %51, i32 %52, i32 %49
%54 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* %6)
%55 = icmp eq i32 %54, 0
%56 = load i32, i32* @LOG_LOCAL0
%57 = select i1 %55, i32 %56, i32 %53
%58 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i8* %6)
%59 = icmp eq i32 %58, 0
%60 = load i32, i32* @LOG_LOCAL1
%61 = select i1 %59, i32 %60, i32 %57
%62 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* %6)
%63 = icmp eq i32 %62, 0
%64 = load i32, i32* @LOG_LOCAL2
%65 = select i1 %63, i32 %64, i32 %61
%66 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* %6)
%67 = icmp eq i32 %66, 0
%68 = load i32, i32* @LOG_LOCAL3
%69 = select i1 %67, i32 %68, i32 %65
%70 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* %6)
%71 = icmp eq i32 %70, 0
%72 = load i32, i32* @LOG_LOCAL4
%73 = select i1 %71, i32 %72, i32 %69
%74 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i8* %6)
%75 = icmp eq i32 %74, 0
%76 = load i32, i32* @LOG_LOCAL5
%77 = select i1 %75, i32 %76, i32 %73
%78 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i8* %6)
%79 = icmp eq i32 %78, 0
%80 = load i32, i32* @LOG_LOCAL6
%81 = select i1 %79, i32 %80, i32 %77
%82 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i8* %6)
%83 = icmp eq i32 %82, 0
%84 = load i32, i32* @LOG_LOCAL7
%85 = select i1 %83, i32 %84, i32 %81
ret i32 %85
}