#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 */
scalar_t__ aliasfunction(char const *);
int /*<<< orphan*/ strcmp(char const *, char *);
int strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char *, int);
scalar_t__ varargsfunction(char const *, char const *);
int ishandleddifferently(const char *proto, const char *funcname) {
  if (varargsfunction(proto, funcname))
    return 1;
  if (aliasfunction(funcname))
    return 1;
  if (strlen(funcname) == 6 && !strncmp(funcname, "DoPkt", 5) &&
      funcname[5] >= '0' && funcname[6] <= '4')
    return 1;
  return !strcmp(funcname, "ReportMouse1");
}


x86 assembly (clang, -O0):
<ishandleddifferently>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <varargsfunction@plt>
cmp    $0x0,%rax
je     1183 <ishandleddifferently+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1220 <ishandleddifferently+0xd0>
mov    -0x18(%rbp),%rdi
call   1070 <aliasfunction@plt>
cmp    $0x0,%rax
je     11a2 <ishandleddifferently+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1220 <ishandleddifferently+0xd0>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x6,%eax
jne    1200 <ishandleddifferently+0xb0>
mov    -0x18(%rbp),%rdi
lea    0xe41(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1200 <ishandleddifferently+0xb0>
mov    -0x18(%rbp),%rax
movsbl 0x5(%rax),%eax
cmp    $0x30,%eax
jl     1200 <ishandleddifferently+0xb0>
mov    -0x18(%rbp),%rax
movsbl 0x6(%rax),%eax
cmp    $0x34,%eax
jg     1200 <ishandleddifferently+0xb0>
movl   $0x1,-0x4(%rbp)
jmp    1220 <ishandleddifferently+0xd0>
mov    -0x18(%rbp),%rdi
lea    0xdfb(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishandleddifferently>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <varargsfunction@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    11ba <ishandleddifferently+0x6a>
mov    %rbx,%rdi
call   1070 <aliasfunction@plt>
test   %rax,%rax
jne    11ba <ishandleddifferently+0x6a>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x6,%eax
jne    11a3 <ishandleddifferently+0x53>
lea    0xe7a(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    11a3 <ishandleddifferently+0x53>
cmpb   $0x30,0x5(%rbx)
jl     11a3 <ishandleddifferently+0x53>
cmpb   $0x35,0x6(%rbx)
jl     11ba <ishandleddifferently+0x6a>
lea    0xe5c(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"DoPkt\00"
@.str.1 = [13 x i8] c"ReportMouse1\00"
define i32 @ishandleddifferently(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i64 @varargsfunction(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %43
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = call i64 @aliasfunction(i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %3
br label %43
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = call i32 @strlen(i8* %17)
%19 = icmp eq i32 %18, 6
br i1 %19, label %20, label %37
20: ; preds = %16
%21 = load i8*, i8** %5
%22 = call i32 @strncmp(i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%23 = icmp ne i32 %22, 0
br i1 %23, label %37, label %24
24: ; preds = %20
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i64 5
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp sge i32 %28, 48
br i1 %29, label %30, label %37
30: ; preds = %24
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i64 6
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp sle i32 %34, 52
br i1 %35, label %36, label %37
36: ; preds = %30
store i32 1, i32* %3
br label %43
37: ; preds = %30, %24, %20, %16
%38 = load i8*, i8** %5
%39 = call i32 @strcmp(i8* %38, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%40 = icmp ne i32 %39, 0
%41 = xor i1 %40, true
%42 = zext i1 %41 to i32
store i32 %42, i32* %3
br label %43
43: ; preds = %37, %36, %15, %10
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@.str = [6 x i8] c"DoPkt\00"
@.str.1 = [13 x i8] c"ReportMouse1\00"
define i32 @ishandleddifferently(i8* %0, i8* %1) {
%3 = tail call i64 @varargsfunction(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %26
5: ; preds = %2
%6 = tail call i64 @aliasfunction(i8* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = tail call i32 @strlen(i8* %1)
%10 = icmp eq i32 %9, 6
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = tail call i32 @strncmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = getelementptr inbounds i8, i8* %1, i64 5
%16 = load i8, i8* %15
%17 = icmp sgt i8 %16, 47
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = getelementptr inbounds i8, i8* %1, i64 6
%20 = load i8, i8* %19
%21 = icmp slt i8 %20, 53
br i1 %21, label %26, label %22
22: ; preds = %18, %14, %11, %8
%23 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
%25 = zext i1 %24 to i32
br label %26
26: ; preds = %18, %5, %2, %22
%27 = phi i32 [ %25, %22 ], [ 1, %2 ], [ 1, %5 ], [ 1, %18 ]
ret i32 %27
}