#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 */
struct message {
  int dummy;
};
struct mansession {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ProxyAddServer(struct mansession *, struct message *);
int /*<<< orphan*/ ProxyDropServer(struct mansession *, struct message *);
int /*<<< orphan*/ ProxyListIOHandlers(struct mansession *);
int /*<<< orphan*/ ProxyListServers(struct mansession *);
int /*<<< orphan*/ ProxyListSessions(struct mansession *);
int /*<<< orphan*/ ProxyLogoff(struct mansession *, struct message *);
int /*<<< orphan*/ ProxySetAutoFilter(struct mansession *, struct message *);
int /*<<< orphan*/ ProxySetOutputFormat(struct mansession *, struct message *);
int /*<<< orphan*/ proxyerror_do(struct mansession *, char *);
int /*<<< orphan*/ strcasecmp(char *, char *);
void *proxyaction_do(char *proxyaction, struct message *m,
                     struct mansession *s) {
  if (!strcasecmp(proxyaction, "SetOutputFormat"))
    ProxySetOutputFormat(s, m);
  else if (!strcasecmp(proxyaction, "SetAutoFilter"))
    ProxySetAutoFilter(s, m);
  else if (!strcasecmp(proxyaction, "ListSessions"))
    ProxyListSessions(s);
  else if (!strcasecmp(proxyaction, "AddServer"))
    ProxyAddServer(s, m);
  else if (!strcasecmp(proxyaction, "DropServer"))
    ProxyDropServer(s, m);
  else if (!strcasecmp(proxyaction, "ListServers"))
    ProxyListServers(s);
  else if (!strcasecmp(proxyaction, "ListIOHandlers"))
    ProxyListIOHandlers(s);
  else if (!strcasecmp(proxyaction, "Logoff"))
    ProxyLogoff(s, m);
  else
    proxyerror_do(s, "Invalid Proxy Action");
  return 0;
}


x86 assembly (clang, -O0):
<proxyaction_do>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe41(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11df <proxyaction_do+0x3f>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <ProxySetOutputFormat@plt>
jmp    1333 <proxyaction_do+0x193>
mov    -0x8(%rbp),%rdi
lea    0xe26(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    120a <proxyaction_do+0x6a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <ProxySetAutoFilter@plt>
jmp    132e <proxyaction_do+0x18e>
mov    -0x8(%rbp),%rdi
lea    0xe09(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1231 <proxyaction_do+0x91>
mov    -0x18(%rbp),%rdi
call   1060 <ProxyListSessions@plt>
jmp    1329 <proxyaction_do+0x189>
mov    -0x8(%rbp),%rdi
lea    0xdef(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    125c <proxyaction_do+0xbc>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10a0 <ProxyAddServer@plt>
jmp    1324 <proxyaction_do+0x184>
mov    -0x8(%rbp),%rdi
lea    0xdce(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1287 <proxyaction_do+0xe7>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10c0 <ProxyDropServer@plt>
jmp    131f <proxyaction_do+0x17f>
mov    -0x8(%rbp),%rdi
lea    0xdae(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    12ae <proxyaction_do+0x10e>
mov    -0x18(%rbp),%rdi
call   1050 <ProxyListServers@plt>
jmp    131a <proxyaction_do+0x17a>
mov    -0x8(%rbp),%rdi
lea    0xd93(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    12d5 <proxyaction_do+0x135>
mov    -0x18(%rbp),%rdi
call   1090 <ProxyListIOHandlers@plt>
jmp    1315 <proxyaction_do+0x175>
mov    -0x8(%rbp),%rdi
lea    0xd7b(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1300 <proxyaction_do+0x160>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10b0 <ProxyLogoff@plt>
jmp    1310 <proxyaction_do+0x170>
mov    -0x18(%rbp),%rdi
lea    0xd57(%rip),%rsi
call   1040 <proxyerror_do@plt>
jmp    1315 <proxyaction_do+0x175>
jmp    131a <proxyaction_do+0x17a>
jmp    131f <proxyaction_do+0x17f>
jmp    1324 <proxyaction_do+0x184>
jmp    1329 <proxyaction_do+0x189>
jmp    132e <proxyaction_do+0x18e>
jmp    1333 <proxyaction_do+0x193>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proxyaction_do>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xe4b(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1264 <proxyaction_do+0xc4>
lea    0xe47(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1271 <proxyaction_do+0xd1>
lea    0xe3e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     127e <proxyaction_do+0xde>
lea    0xe34(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1288 <proxyaction_do+0xe8>
lea    0xe27(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1295 <proxyaction_do+0xf5>
lea    0xe1f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     12a2 <proxyaction_do+0x102>
lea    0xe18(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     12ac <proxyaction_do+0x10c>
lea    0xe14(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     12b6 <proxyaction_do+0x116>
lea    0xe08(%rip),%rsi
mov    %r15,%rdi
call   1040 <proxyerror_do@plt>
jmp    12c1 <proxyaction_do+0x121>
mov    %r15,%rdi
mov    %r14,%rsi
call   1080 <ProxySetOutputFormat@plt>
jmp    12c1 <proxyaction_do+0x121>
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <ProxySetAutoFilter@plt>
jmp    12c1 <proxyaction_do+0x121>
mov    %r15,%rdi
call   1060 <ProxyListSessions@plt>
jmp    12c1 <proxyaction_do+0x121>
mov    %r15,%rdi
mov    %r14,%rsi
call   10a0 <ProxyAddServer@plt>
jmp    12c1 <proxyaction_do+0x121>
mov    %r15,%rdi
mov    %r14,%rsi
call   10c0 <ProxyDropServer@plt>
jmp    12c1 <proxyaction_do+0x121>
mov    %r15,%rdi
call   1050 <ProxyListServers@plt>
jmp    12c1 <proxyaction_do+0x121>
mov    %r15,%rdi
call   1090 <ProxyListIOHandlers@plt>
jmp    12c1 <proxyaction_do+0x121>
mov    %r15,%rdi
mov    %r14,%rsi
call   10b0 <ProxyLogoff@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.message = type { i32 }
%struct.mansession = type { i32 }
@.str = [16 x i8] c"SetOutputFormat\00"
@.str.1 = [14 x i8] c"SetAutoFilter\00"
@.str.2 = [13 x i8] c"ListSessions\00"
@.str.3 = [10 x i8] c"AddServer\00"
@.str.4 = [11 x i8] c"DropServer\00"
@.str.5 = [12 x i8] c"ListServers\00"
@.str.6 = [15 x i8] c"ListIOHandlers\00"
@.str.7 = [7 x i8] c"Logoff\00"
@.str.8 = [21 x i8] c"Invalid Proxy Action\00"
define i8* @proxyaction_do(i8* %0, %struct.message* %1, %struct.mansession* %2) {
%4 = alloca i8*
%5 = alloca %struct.message*
%6 = alloca %struct.mansession*
store i8* %0, i8** %4
store %struct.message* %1, %struct.message** %5
store %struct.mansession* %2, %struct.mansession** %6
%7 = load i8*, i8** %4
%8 = call i32 @strcasecmp(i8* %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load %struct.mansession*, %struct.mansession** %6
%12 = load %struct.message*, %struct.message** %5
%13 = call i32 @ProxySetOutputFormat(%struct.mansession* %11, %struct.message* %12)
br label %77
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = call i32 @strcasecmp(i8* %15, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i32 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load %struct.mansession*, %struct.mansession** %6
%20 = load %struct.message*, %struct.message** %5
%21 = call i32 @ProxySetAutoFilter(%struct.mansession* %19, %struct.message* %20)
br label %76
22: ; preds = %14
%23 = load i8*, i8** %4
%24 = call i32 @strcasecmp(i8* %23, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %22
%27 = load %struct.mansession*, %struct.mansession** %6
%28 = call i32 @ProxyListSessions(%struct.mansession* %27)
br label %75
29: ; preds = %22
%30 = load i8*, i8** %4
%31 = call i32 @strcasecmp(i8* %30, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp ne i32 %31, 0
br i1 %32, label %37, label %33
33: ; preds = %29
%34 = load %struct.mansession*, %struct.mansession** %6
%35 = load %struct.message*, %struct.message** %5
%36 = call i32 @ProxyAddServer(%struct.mansession* %34, %struct.message* %35)
br label %74
37: ; preds = %29
%38 = load i8*, i8** %4
%39 = call i32 @strcasecmp(i8* %38, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%40 = icmp ne i32 %39, 0
br i1 %40, label %45, label %41
41: ; preds = %37
%42 = load %struct.mansession*, %struct.mansession** %6
%43 = load %struct.message*, %struct.message** %5
%44 = call i32 @ProxyDropServer(%struct.mansession* %42, %struct.message* %43)
br label %73
45: ; preds = %37
%46 = load i8*, i8** %4
%47 = call i32 @strcasecmp(i8* %46, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp ne i32 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %45
%50 = load %struct.mansession*, %struct.mansession** %6
%51 = call i32 @ProxyListServers(%struct.mansession* %50)
br label %72
52: ; preds = %45
%53 = load i8*, i8** %4
%54 = call i32 @strcasecmp(i8* %53, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%55 = icmp ne i32 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %52
%57 = load %struct.mansession*, %struct.mansession** %6
%58 = call i32 @ProxyListIOHandlers(%struct.mansession* %57)
br label %71
59: ; preds = %52
%60 = load i8*, i8** %4
%61 = call i32 @strcasecmp(i8* %60, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%62 = icmp ne i32 %61, 0
br i1 %62, label %67, label %63
63: ; preds = %59
%64 = load %struct.mansession*, %struct.mansession** %6
%65 = load %struct.message*, %struct.message** %5
%66 = call i32 @ProxyLogoff(%struct.mansession* %64, %struct.message* %65)
br label %70
67: ; preds = %59
%68 = load %struct.mansession*, %struct.mansession** %6
%69 = call i32 @proxyerror_do(%struct.mansession* %68, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
br label %70
70: ; preds = %67, %63
br label %71
71: ; preds = %70, %56
br label %72
72: ; preds = %71, %49
br label %73
73: ; preds = %72, %41
br label %74
74: ; preds = %73, %33
br label %75
75: ; preds = %74, %26
br label %76
76: ; preds = %75, %18
br label %77
77: ; preds = %76, %10
ret i8* null
}

LLVM IR (-O2):
%struct.message = type { i32 }
%struct.mansession = type { i32 }
@.str = [16 x i8] c"SetOutputFormat\00"
@.str.1 = [14 x i8] c"SetAutoFilter\00"
@.str.2 = [13 x i8] c"ListSessions\00"
@.str.3 = [10 x i8] c"AddServer\00"
@.str.4 = [11 x i8] c"DropServer\00"
@.str.5 = [12 x i8] c"ListServers\00"
@.str.6 = [15 x i8] c"ListIOHandlers\00"
@.str.7 = [7 x i8] c"Logoff\00"
@.str.8 = [21 x i8] c"Invalid Proxy Action\00"
define noalias i8* @proxyaction_do(i8* nocapture %0, %struct.message* %1, %struct.mansession* %2) {
%4 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @ProxySetOutputFormat(%struct.mansession* %2, %struct.message* %1)
br label %45
8: ; preds = %3
%9 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @ProxySetAutoFilter(%struct.mansession* %2, %struct.message* %1)
br label %45
13: ; preds = %8
%14 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = tail call i32 @ProxyListSessions(%struct.mansession* %2)
br label %45
18: ; preds = %13
%19 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 @ProxyAddServer(%struct.mansession* %2, %struct.message* %1)
br label %45
23: ; preds = %18
%24 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = tail call i32 @ProxyDropServer(%struct.mansession* %2, %struct.message* %1)
br label %45
28: ; preds = %23
%29 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = tail call i32 @ProxyListServers(%struct.mansession* %2)
br label %45
33: ; preds = %28
%34 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = tail call i32 @ProxyListIOHandlers(%struct.mansession* %2)
br label %45
38: ; preds = %33
%39 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = tail call i32 @ProxyLogoff(%struct.mansession* %2, %struct.message* %1)
br label %45
43: ; preds = %38
%44 = tail call i32 @proxyerror_do(%struct.mansession* %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
br label %45
45: ; preds = %11, %21, %31, %41, %43, %36, %26, %16, %6
ret i8* null
}