#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 */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void replaceEvents(char *event) {
  if (strcmp(event, "open,creat,link,symlink,truncate,ftruncate,mknod,rename,"
                    "truncate64,ftruncate64,access") == 0) {
    strncpy(event, "File_Read_Write", 256);
  } else if (strcmp(event, "unlink,rmdir") == 0) {
    strncpy(event, "File_Remove", 256);
  } else if (strcmp(event, "execve") == 0) {
    strncpy(event, "Process_Events", 256);
  } else if (strcmp(event, "chmod,chown,lchown,fchmod,fchown,fchown32,lchown32,"
                           "chown32") == 0) {
    strncpy(event, "File_Attrib", 256);
  } else if (strcmp(event,
                    "mount,umount,umount2,settimeofday,swapon,swapoff,reboot,"
                    "setdomainname,create_module,delete_module,quotactl") ==
             0) {
    strncpy(event, "Admin_Events", 256);
  } else if (strcmp(event, "socketcall") == 0) {
    strncpy(event, "Socket_Events", 256);
  } else if (strcmp(event, "login_auth,login_start,logout") == 0) {
    strncpy(event, "Logon_Logoff", 256);
  } else if (strcmp(event, "acct_mgmt") == 0) {
    strncpy(event, "User_Events", 256);
  }
}


x86 assembly (clang, -O0):
<replaceEvents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1160 <replaceEvents+0x40>
mov    -0x8(%rbp),%rdi
lea    0xf05(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
jmp    12ea <replaceEvents+0x1ca>
mov    -0x8(%rbp),%rdi
lea    0xefb(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1194 <replaceEvents+0x74>
mov    -0x8(%rbp),%rdi
lea    0xeee(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
jmp    12e5 <replaceEvents+0x1c5>
mov    -0x8(%rbp),%rdi
lea    0xee0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c8 <replaceEvents+0xa8>
mov    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
jmp    12e0 <replaceEvents+0x1c0>
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11fc <replaceEvents+0xdc>
mov    -0x8(%rbp),%rdi
lea    0xee3(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
jmp    12db <replaceEvents+0x1bb>
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1230 <replaceEvents+0x110>
mov    -0x8(%rbp),%rdi
lea    0xf26(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
jmp    12d6 <replaceEvents+0x1b6>
mov    -0x8(%rbp),%rdi
lea    0xf19(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1264 <replaceEvents+0x144>
mov    -0x8(%rbp),%rdi
lea    0xf0a(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
jmp    12d1 <replaceEvents+0x1b1>
mov    -0x8(%rbp),%rdi
lea    0xefe(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1298 <replaceEvents+0x178>
mov    -0x8(%rbp),%rdi
lea    0xf02(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
jmp    12cc <replaceEvents+0x1ac>
mov    -0x8(%rbp),%rdi
lea    0xef5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12c7 <replaceEvents+0x1a7>
mov    -0x8(%rbp),%rdi
lea    0xee5(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
jmp    12cc <replaceEvents+0x1ac>
jmp    12d1 <replaceEvents+0x1b1>
jmp    12d6 <replaceEvents+0x1b6>
jmp    12db <replaceEvents+0x1bb>
jmp    12e0 <replaceEvents+0x1c0>
jmp    12e5 <replaceEvents+0x1c5>
jmp    12ea <replaceEvents+0x1ca>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replaceEvents>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11cb <replaceEvents+0xab>
lea    0xf26(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11d4 <replaceEvents+0xb4>
lea    0xf27(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11dd <replaceEvents+0xbd>
lea    0xf29(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11e6 <replaceEvents+0xc6>
lea    0xf5c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11ef <replaceEvents+0xcf>
lea    0xfc0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11f8 <replaceEvents+0xd8>
lea    0xfc5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1201 <replaceEvents+0xe1>
lea    0xfdc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     120a <replaceEvents+0xea>
pop    %rbx
ret
lea    0xe84(%rip),%rsi
jmp    1211 <replaceEvents+0xf1>
lea    0xe98(%rip),%rsi
jmp    1211 <replaceEvents+0xf1>
lea    0xea2(%rip),%rsi
jmp    1211 <replaceEvents+0xf1>
lea    0xee3(%rip),%rsi
jmp    1211 <replaceEvents+0xf1>
lea    0xf51(%rip),%rsi
jmp    1211 <replaceEvents+0xf1>
lea    0xf60(%rip),%rsi
jmp    1211 <replaceEvents+0xf1>
lea    0xf83(%rip),%rsi
jmp    1211 <replaceEvents+0xf1>
lea    0xf91(%rip),%rsi
mov    %rbx,%rdi
mov    $0x100,%edx
pop    %rbx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@.str = [86 x i8] c"open,creat,link,symlink,truncate,ftruncate,mknod,rename,truncate64,ftruncate64,access\00"
@.str.1 = [16 x i8] c"File_Read_Write\00"
@.str.2 = [13 x i8] c"unlink,rmdir\00"
@.str.3 = [12 x i8] c"File_Remove\00"
@.str.4 = [7 x i8] c"execve\00"
@.str.5 = [15 x i8] c"Process_Events\00"
@.str.6 = [59 x i8] c"chmod,chown,lchown,fchmod,fchown,fchown32,lchown32,chown32\00"
@.str.7 = [12 x i8] c"File_Attrib\00"
@.str.8 = [107 x i8] c"mount,umount,umount2,settimeofday,swapon,swapoff,reboot,setdomainname,create_module,delete_module,quotactl\00"
@.str.9 = [13 x i8] c"Admin_Events\00"
@.str.10 = [11 x i8] c"socketcall\00"
@.str.11 = [14 x i8] c"Socket_Events\00"
@.str.12 = [30 x i8] c"login_auth,login_start,logout\00"
@.str.13 = [13 x i8] c"Logon_Logoff\00"
@.str.14 = [10 x i8] c"acct_mgmt\00"
@.str.15 = [12 x i8] c"User_Events\00"
define void @replaceEvents(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strncpy(i8* %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 256)
br label %65
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = call i32 @strncpy(i8* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 256)
br label %64
16: ; preds = %9
%17 = load i8*, i8** %2
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i8*, i8** %2
%22 = call i32 @strncpy(i8* %21, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 256)
br label %63
23: ; preds = %16
%24 = load i8*, i8** %2
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i8*, i8** %2
%29 = call i32 @strncpy(i8* %28, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 256)
br label %62
30: ; preds = %23
%31 = load i8*, i8** %2
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.8, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %30
%35 = load i8*, i8** %2
%36 = call i32 @strncpy(i8* %35, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 256)
br label %61
37: ; preds = %30
%38 = load i8*, i8** %2
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = load i8*, i8** %2
%43 = call i32 @strncpy(i8* %42, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), i32 256)
br label %60
44: ; preds = %37
%45 = load i8*, i8** %2
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %44
%49 = load i8*, i8** %2
%50 = call i32 @strncpy(i8* %49, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 256)
br label %59
51: ; preds = %44
%52 = load i8*, i8** %2
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %51
%56 = load i8*, i8** %2
%57 = call i32 @strncpy(i8* %56, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i32 256)
br label %58
58: ; preds = %55, %51
br label %59
59: ; preds = %58, %48
br label %60
60: ; preds = %59, %41
br label %61
61: ; preds = %60, %34
br label %62
62: ; preds = %61, %27
br label %63
63: ; preds = %62, %20
br label %64
64: ; preds = %63, %13
br label %65
65: ; preds = %64, %6
ret void
}

LLVM IR (-O2):
@.str = [86 x i8] c"open,creat,link,symlink,truncate,ftruncate,mknod,rename,truncate64,ftruncate64,access\00"
@.str.1 = [16 x i8] c"File_Read_Write\00"
@.str.2 = [13 x i8] c"unlink,rmdir\00"
@.str.3 = [12 x i8] c"File_Remove\00"
@.str.4 = [7 x i8] c"execve\00"
@.str.5 = [15 x i8] c"Process_Events\00"
@.str.6 = [59 x i8] c"chmod,chown,lchown,fchmod,fchown,fchown32,lchown32,chown32\00"
@.str.7 = [12 x i8] c"File_Attrib\00"
@.str.8 = [107 x i8] c"mount,umount,umount2,settimeofday,swapon,swapoff,reboot,setdomainname,create_module,delete_module,quotactl\00"
@.str.9 = [13 x i8] c"Admin_Events\00"
@.str.10 = [11 x i8] c"socketcall\00"
@.str.11 = [14 x i8] c"Socket_Events\00"
@.str.12 = [30 x i8] c"login_auth,login_start,logout\00"
@.str.13 = [13 x i8] c"Logon_Logoff\00"
@.str.14 = [10 x i8] c"acct_mgmt\00"
@.str.15 = [12 x i8] c"User_Events\00"
define void @replaceEvents(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %25, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %25, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %25, label %10
10: ; preds = %7
%11 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %25, label %13
13: ; preds = %10
%14 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.8, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %25, label %16
16: ; preds = %13
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %25, label %19
19: ; preds = %16
%20 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22, %19, %16, %13, %10, %7, %4, %1
%26 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), %1 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), %10 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), %13 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), %16 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), %19 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), %22 ]
%27 = tail call i32 @strncpy(i8* %0, i8* %26, i32 256)
br label %28
28: ; preds = %25, %22
ret void
}