#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*/ strncmp(char *, char *, int);
int get_command_num(char *command) {
  if (command && *command) {
    if (!strncmp(command, "NOTICE", 6))
      return 1001;
    else if (!strncmp(command, "QUIT", 4))
      return 1002;
    else if (!strncmp(command, "JOIN", 4))
      return 1003;
    else if (!strncmp(command, "PART", 4))
      return 1004;
    else if (!strncmp(command, "MODE", 4))
      return 1005;
    else if (!strncmp(command, "INVITE", 6))
      return 1006;
    else if (!strncmp(command, "KICK", 4))
      return 1007;
    else if (!strncmp(command, "NICK", 4))
      return 1008;
    else if (!strncmp(command, "PRIVMSG", 7))
      return 1009;
    else if (!strncmp(command, "KILL", 4))
      return 1010;
    else if (!strncmp(command, "PING", 4))
      return 1011;
    else if (!strncmp(command, "ERROR", 5))
      return 1012;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_command_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     136b <get_command_num+0x25b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     136b <get_command_num+0x25b>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1161 <get_command_num+0x51>
movl   $0x3e9,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xe9b(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    118b <get_command_num+0x7b>
movl   $0x3ea,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11b5 <get_command_num+0xa5>
movl   $0x3eb,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xe51(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11df <get_command_num+0xcf>
movl   $0x3ec,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xe2c(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1209 <get_command_num+0xf9>
movl   $0x3ed,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xe07(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1233 <get_command_num+0x123>
movl   $0x3ee,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xde4(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    125d <get_command_num+0x14d>
movl   $0x3ef,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xdbf(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1287 <get_command_num+0x177>
movl   $0x3f0,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xd9a(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    12b1 <get_command_num+0x1a1>
movl   $0x3f1,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xd78(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    12db <get_command_num+0x1cb>
movl   $0x3f2,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xd53(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1305 <get_command_num+0x1f5>
movl   $0x3f3,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
mov    -0x10(%rbp),%rdi
lea    0xd2e(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    132f <get_command_num+0x21f>
movl   $0x3f4,-0x4(%rbp)
jmp    1372 <get_command_num+0x262>
jmp    1334 <get_command_num+0x224>
jmp    1339 <get_command_num+0x229>
jmp    133e <get_command_num+0x22e>
jmp    1343 <get_command_num+0x233>
jmp    1348 <get_command_num+0x238>
jmp    134d <get_command_num+0x23d>
jmp    1352 <get_command_num+0x242>
jmp    1357 <get_command_num+0x247>
jmp    135c <get_command_num+0x24c>
jmp    1361 <get_command_num+0x251>
jmp    1366 <get_command_num+0x256>
jmp    136b <get_command_num+0x25b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_command_num>:
push   %rbx
test   %rdi,%rdi
je     126a <get_command_num+0x15a>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     126a <get_command_num+0x15a>
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     126e <get_command_num+0x15e>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1275 <get_command_num+0x165>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     127c <get_command_num+0x16c>
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1283 <get_command_num+0x173>
lea    0xe79(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     128a <get_command_num+0x17a>
lea    0xe62(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1291 <get_command_num+0x181>
lea    0xe4d(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1298 <get_command_num+0x188>
lea    0xe36(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     129f <get_command_num+0x18f>
lea    0xe1f(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12a6 <get_command_num+0x196>
lea    0xe0b(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12ad <get_command_num+0x19d>
lea    0xdf8(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12b4 <get_command_num+0x1a4>
lea    0xde5(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12bb <get_command_num+0x1ab>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x3e9,%eax
pop    %rbx
ret
mov    $0x3ea,%eax
pop    %rbx
ret
mov    $0x3eb,%eax
pop    %rbx
ret
mov    $0x3ec,%eax
pop    %rbx
ret
mov    $0x3ed,%eax
pop    %rbx
ret
mov    $0x3ee,%eax
pop    %rbx
ret
mov    $0x3ef,%eax
pop    %rbx
ret
mov    $0x3f0,%eax
pop    %rbx
ret
mov    $0x3f1,%eax
pop    %rbx
ret
mov    $0x3f2,%eax
pop    %rbx
ret
mov    $0x3f3,%eax
pop    %rbx
ret
mov    $0x3f4,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"NOTICE\00"
@.str.1 = [5 x i8] c"QUIT\00"
@.str.2 = [5 x i8] c"JOIN\00"
@.str.3 = [5 x i8] c"PART\00"
@.str.4 = [5 x i8] c"MODE\00"
@.str.5 = [7 x i8] c"INVITE\00"
@.str.6 = [5 x i8] c"KICK\00"
@.str.7 = [5 x i8] c"NICK\00"
@.str.8 = [8 x i8] c"PRIVMSG\00"
@.str.9 = [5 x i8] c"KILL\00"
@.str.10 = [5 x i8] c"PING\00"
@.str.11 = [6 x i8] c"ERROR\00"
define i32 @get_command_num(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %83
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %83
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = call i32 @strncmp(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %11
store i32 1001, i32* %2
br label %84
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = call i32 @strncmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %16
store i32 1002, i32* %2
br label %84
21: ; preds = %16
%22 = load i8*, i8** %3
%23 = call i32 @strncmp(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%24 = icmp ne i32 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %21
store i32 1003, i32* %2
br label %84
26: ; preds = %21
%27 = load i8*, i8** %3
%28 = call i32 @strncmp(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
%29 = icmp ne i32 %28, 0
br i1 %29, label %31, label %30
30: ; preds = %26
store i32 1004, i32* %2
br label %84
31: ; preds = %26
%32 = load i8*, i8** %3
%33 = call i32 @strncmp(i8* %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%34 = icmp ne i32 %33, 0
br i1 %34, label %36, label %35
35: ; preds = %31
store i32 1005, i32* %2
br label %84
36: ; preds = %31
%37 = load i8*, i8** %3
%38 = call i32 @strncmp(i8* %37, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 6)
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %36
store i32 1006, i32* %2
br label %84
41: ; preds = %36
%42 = load i8*, i8** %3
%43 = call i32 @strncmp(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4)
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %41
store i32 1007, i32* %2
br label %84
46: ; preds = %41
%47 = load i8*, i8** %3
%48 = call i32 @strncmp(i8* %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%49 = icmp ne i32 %48, 0
br i1 %49, label %51, label %50
50: ; preds = %46
store i32 1008, i32* %2
br label %84
51: ; preds = %46
%52 = load i8*, i8** %3
%53 = call i32 @strncmp(i8* %52, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 7)
%54 = icmp ne i32 %53, 0
br i1 %54, label %56, label %55
55: ; preds = %51
store i32 1009, i32* %2
br label %84
56: ; preds = %51
%57 = load i8*, i8** %3
%58 = call i32 @strncmp(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 4)
%59 = icmp ne i32 %58, 0
br i1 %59, label %61, label %60
60: ; preds = %56
store i32 1010, i32* %2
br label %84
61: ; preds = %56
%62 = load i8*, i8** %3
%63 = call i32 @strncmp(i8* %62, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%64 = icmp ne i32 %63, 0
br i1 %64, label %66, label %65
65: ; preds = %61
store i32 1011, i32* %2
br label %84
66: ; preds = %61
%67 = load i8*, i8** %3
%68 = call i32 @strncmp(i8* %67, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 5)
%69 = icmp ne i32 %68, 0
br i1 %69, label %71, label %70
70: ; preds = %66
store i32 1012, i32* %2
br label %84
71: ; preds = %66
br label %72
72: ; preds = %71
br label %73
73: ; preds = %72
br label %74
74: ; preds = %73
br label %75
75: ; preds = %74
br label %76
76: ; preds = %75
br label %77
77: ; preds = %76
br label %78
78: ; preds = %77
br label %79
79: ; preds = %78
br label %80
80: ; preds = %79
br label %81
81: ; preds = %80
br label %82
82: ; preds = %81
br label %83
83: ; preds = %82, %6, %1
store i32 0, i32* %2
br label %84
84: ; preds = %83, %70, %65, %60, %55, %50, %45, %40, %35, %30, %25, %20, %15
%85 = load i32, i32* %2
ret i32 %85
}

LLVM IR (-O2):
@.str = [7 x i8] c"NOTICE\00"
@.str.1 = [5 x i8] c"QUIT\00"
@.str.2 = [5 x i8] c"JOIN\00"
@.str.3 = [5 x i8] c"PART\00"
@.str.4 = [5 x i8] c"MODE\00"
@.str.5 = [7 x i8] c"INVITE\00"
@.str.6 = [5 x i8] c"KICK\00"
@.str.7 = [5 x i8] c"NICK\00"
@.str.8 = [8 x i8] c"PRIVMSG\00"
@.str.9 = [5 x i8] c"KILL\00"
@.str.10 = [5 x i8] c"PING\00"
@.str.11 = [6 x i8] c"ERROR\00"
define i32 @get_command_num(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %42, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %42, label %6
6: ; preds = %3
%7 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %43, label %9
9: ; preds = %6
%10 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%11 = icmp eq i32 %10, 0
br i1 %11, label %43, label %12
12: ; preds = %9
%13 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%14 = icmp eq i32 %13, 0
br i1 %14, label %43, label %15
15: ; preds = %12
%16 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
%17 = icmp eq i32 %16, 0
br i1 %17, label %43, label %18
18: ; preds = %15
%19 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%20 = icmp eq i32 %19, 0
br i1 %20, label %43, label %21
21: ; preds = %18
%22 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 6)
%23 = icmp eq i32 %22, 0
br i1 %23, label %43, label %24
24: ; preds = %21
%25 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4)
%26 = icmp eq i32 %25, 0
br i1 %26, label %43, label %27
27: ; preds = %24
%28 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%29 = icmp eq i32 %28, 0
br i1 %29, label %43, label %30
30: ; preds = %27
%31 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 7)
%32 = icmp eq i32 %31, 0
br i1 %32, label %43, label %33
33: ; preds = %30
%34 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 4)
%35 = icmp eq i32 %34, 0
br i1 %35, label %43, label %36
36: ; preds = %33
%37 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%38 = icmp eq i32 %37, 0
br i1 %38, label %43, label %39
39: ; preds = %36
%40 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 5)
%41 = icmp eq i32 %40, 0
br i1 %41, label %43, label %42
42: ; preds = %39, %3, %1
br label %43
43: ; preds = %39, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9, %6, %42
%44 = phi i32 [ 0, %42 ], [ 1001, %6 ], [ 1002, %9 ], [ 1003, %12 ], [ 1004, %15 ], [ 1005, %18 ], [ 1006, %21 ], [ 1007, %24 ], [ 1008, %27 ], [ 1009, %30 ], [ 1010, %33 ], [ 1011, %36 ], [ 1012, %39 ]
ret i32 %44
}