#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 /*<<< orphan*/ checkHosts();
int /*<<< orphan*/ connect(char *, char *);
int /*<<< orphan*/ disconnect(char *, char *);
int /*<<< orphan*/ dump();
int /*<<< orphan*/ parse(char *, char *, char *);
int /*<<< orphan*/ parseHosts(char *);
int /*<<< orphan*/ *strstr(char *, char *);
void process(char *str) {
  char mac[19];
  char wlan[10];
  if (strstr(str, " authenticated") != NULL) {
    parse(str, mac, wlan);
    connect(mac, wlan);
  } else if (strstr(str, "deauthenticated") != NULL) {
    parse(str, mac, wlan);
    disconnect(mac, wlan);
  } else if (strstr(str, "user.notice root: DUMP") != NULL) {
    dump();
  } else if (strstr(str, "DHCPACK") != NULL) {
    parseHosts(str);
  } else {
    checkHosts();
  }
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     11b9 <process+0x49>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x2a(%rbp),%rdx
call   1050 <parse@plt>
lea    -0x20(%rbp),%rdi
lea    -0x2a(%rbp),%rsi
call   1060 <connect@plt>
jmp    125a <process+0xea>
mov    -0x8(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     11f6 <process+0x86>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x2a(%rbp),%rdx
call   1050 <parse@plt>
lea    -0x20(%rbp),%rdi
lea    -0x2a(%rbp),%rsi
call   1080 <disconnect@plt>
jmp    1255 <process+0xe5>
mov    -0x8(%rbp),%rdi
lea    0xe1e(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     121c <process+0xac>
mov    $0x0,%al
call   1040 <dump@plt>
jmp    1250 <process+0xe0>
mov    -0x8(%rbp),%rdi
lea    0xe0f(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     1244 <process+0xd4>
mov    -0x8(%rbp),%rdi
call   1030 <parseHosts@plt>
jmp    124b <process+0xdb>
mov    $0x0,%al
call   1090 <checkHosts@plt>
jmp    1250 <process+0xe0>
jmp    1255 <process+0xe5>
jmp    125a <process+0xea>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
lea    0xe7d(%rip),%rsi
call   1070 <strstr@plt>
test   %rax,%rax
je     11b2 <process+0x42>
lea    0x10(%rsp),%r14
lea    0x6(%rsp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <parse@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <connect@plt>
jmp    11e9 <process+0x79>
lea    0xe56(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
je     11f3 <process+0x83>
lea    0x10(%rsp),%r14
lea    0x6(%rsp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <parse@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1080 <disconnect@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe25(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
je     1217 <process+0xa7>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <dump@plt>
lea    0xe18(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
je     123c <process+0xcc>
mov    %rbx,%rdi
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <parseHosts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1090 <checkHosts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c" authenticated\00"
@.str.1 = [16 x i8] c"deauthenticated\00"
@.str.2 = [23 x i8] c"user.notice root: DUMP\00"
@.str.3 = [8 x i8] c"DHCPACK\00"
define void @process(i8* %0) {
%2 = alloca i8*
%3 = alloca [19 x i8]
%4 = alloca [10 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @strstr(i8* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%12 = call i32 @parse(i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%15 = call i32 @connect(i8* %13, i8* %14)
br label %46
16: ; preds = %1
%17 = load i8*, i8** %2
%18 = call i32* @strstr(i8* %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load i8*, i8** %2
%22 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 0
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%24 = call i32 @parse(i8* %21, i8* %22, i8* %23)
%25 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 0
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%27 = call i32 @disconnect(i8* %25, i8* %26)
br label %45
28: ; preds = %16
%29 = load i8*, i8** %2
%30 = call i32* @strstr(i8* %29, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp ne i32* %30, null
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (...) @dump()
br label %44
34: ; preds = %28
%35 = load i8*, i8** %2
%36 = call i32* @strstr(i8* %35, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%37 = icmp ne i32* %36, null
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i8*, i8** %2
%40 = call i32 @parseHosts(i8* %39)
br label %43
41: ; preds = %34
%42 = call i32 (...) @checkHosts()
br label %43
43: ; preds = %41, %38
br label %44
44: ; preds = %43, %32
br label %45
45: ; preds = %44, %20
br label %46
46: ; preds = %45, %8
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c" authenticated\00"
@.str.1 = [16 x i8] c"deauthenticated\00"
@.str.2 = [23 x i8] c"user.notice root: DUMP\00"
@.str.3 = [8 x i8] c"DHCPACK\00"
define void @process(i8* %0) {
%2 = alloca [19 x i8]
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @parse(i8* %0, i8* %4, i8* %5)
%10 = call i32 @connect(i8* %4, i8* %5)
br label %29
11: ; preds = %1
%12 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = call i32 @parse(i8* %0, i8* %4, i8* %5)
%16 = call i32 @disconnect(i8* %4, i8* %5)
br label %29
17: ; preds = %11
%18 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 (...) @dump()
br label %29
22: ; preds = %17
%23 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i32* %23, null
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 @parseHosts(i8* %0)
br label %29
27: ; preds = %22
%28 = tail call i32 (...) @checkHosts()
br label %29
29: ; preds = %14, %25, %27, %20, %8
ret void
}