#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*/ Utils_tokenizeMessage(char const *, char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int Control_ErrorType(const char *msg, char *user, char *data) {
  char type[8];
  if (!Utils_tokenizeMessage(msg, type, user, data))
    return 12;
  if (0 == strcmp(type, "ERRUSERC"))
    return 80;
  if (0 == strcmp(type, "ERRADRI"))
    return 81;
  if (0 == strcmp(type, "ERR_BIND"))
    return 82;
  return 12;
}


x86 assembly (clang, -O0):
<Control_ErrorType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <Utils_tokenizeMessage@plt>
cmp    $0x0,%eax
jne    115e <Control_ErrorType+0x3e>
movl   $0xc,-0x4(%rbp)
jmp    11e3 <Control_ErrorType+0xc3>
lea    -0x28(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1188 <Control_ErrorType+0x68>
movl   $0x50,-0x4(%rbp)
jmp    11e3 <Control_ErrorType+0xc3>
lea    -0x28(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11b2 <Control_ErrorType+0x92>
movl   $0x51,-0x4(%rbp)
jmp    11e3 <Control_ErrorType+0xc3>
lea    -0x28(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11dc <Control_ErrorType+0xbc>
movl   $0x52,-0x4(%rbp)
jmp    11e3 <Control_ErrorType+0xc3>
movl   $0xc,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Control_ErrorType>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rsp,%rsi
call   1030 <Utils_tokenizeMessage@plt>
test   %eax,%eax
je     117c <Control_ErrorType+0x5c>
lea    0xec6(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1183 <Control_ErrorType+0x63>
lea    0xebb(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     118a <Control_ErrorType+0x6a>
lea    0xeaf(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
mov    $0x52,%ecx
mov    $0xc,%eax
cmove  %ecx,%eax
pop    %rcx
ret
mov    $0xc,%eax
pop    %rcx
ret
mov    $0x50,%eax
pop    %rcx
ret
mov    $0x51,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"ERRUSERC\00"
@.str.1 = [8 x i8] c"ERRADRI\00"
@.str.2 = [9 x i8] c"ERR_BIND\00"
define i32 @Control_ErrorType(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [8 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %5
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = call i32 @Utils_tokenizeMessage(i8* %9, i8* %10, i8* %11, i8* %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %3
store i32 12, i32* %4
br label %32
16: ; preds = %3
%17 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 0, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 80, i32* %4
br label %32
21: ; preds = %16
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 0, %23
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 81, i32* %4
br label %32
26: ; preds = %21
%27 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp eq i64 0, %28
br i1 %29, label %30, label %31
30: ; preds = %26
store i32 82, i32* %4
br label %32
31: ; preds = %26
store i32 12, i32* %4
br label %32
32: ; preds = %31, %30, %25, %20, %15
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
@.str = [9 x i8] c"ERRUSERC\00"
@.str.1 = [8 x i8] c"ERRADRI\00"
@.str.2 = [9 x i8] c"ERR_BIND\00"
define i32 @Control_ErrorType(i8* %0, i8* %1, i8* %2) {
%4 = alloca [8 x i8]
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%6 = call i32 @Utils_tokenizeMessage(i8* %0, i8* %5, i8* %1, i8* %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %3
%9 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8
%12 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i32 82, i32 12
br label %18
18: ; preds = %14, %11, %8, %3
%19 = phi i32 [ 12, %3 ], [ 80, %8 ], [ 81, %11 ], [ %17, %14 ]
ret i32 %19
}