#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__ isspace(char const);
char *strchr(char const *, char);
int strlen(char const *);
int /*<<< orphan*/ strncasecmp(char const *, char const *, int);
int CompareIRCAddressNick(const char *strParams, const char *strNick) {
  int i = strlen(strNick);
  ;
  ;
  if (!strParams || !strNick)
    return 0;
  if (!*strNick)
    return 0;
  if (*strParams == ':')
    strParams++;
  if (!strncasecmp(strParams, strNick, i) && isspace(strParams[i]))
    return 1;
  strParams = strchr(strParams, ' ');
  if (!strParams)
    return 0;
  strParams++;
  if (*strParams == ':')
    strParams++;
  if (!strncasecmp(strParams, strNick, i) && isspace(strParams[i]))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<CompareIRCAddressNick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <CompareIRCAddressNick+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    117e <CompareIRCAddressNick+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    128b <CompareIRCAddressNick+0x14b>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1197 <CompareIRCAddressNick+0x57>
movl   $0x0,-0x4(%rbp)
jmp    128b <CompareIRCAddressNick+0x14b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    11b3 <CompareIRCAddressNick+0x73>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1060 <strncasecmp@plt>
cmp    $0x0,%eax
jne    11f3 <CompareIRCAddressNick+0xb3>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
je     11f3 <CompareIRCAddressNick+0xb3>
movl   $0x1,-0x4(%rbp)
jmp    128b <CompareIRCAddressNick+0x14b>
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    121c <CompareIRCAddressNick+0xdc>
movl   $0x0,-0x4(%rbp)
jmp    128b <CompareIRCAddressNick+0x14b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1244 <CompareIRCAddressNick+0x104>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1060 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1284 <CompareIRCAddressNick+0x144>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
je     1284 <CompareIRCAddressNick+0x144>
movl   $0x1,-0x4(%rbp)
jmp    128b <CompareIRCAddressNick+0x14b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompareIRCAddressNick>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1030 <strlen@plt>
test   %rbp,%rbp
je     11d7 <CompareIRCAddressNick+0x97>
test   %rbx,%rbx
je     11d7 <CompareIRCAddressNick+0x97>
cmpb   $0x0,(%rbx)
je     11d7 <CompareIRCAddressNick+0x97>
mov    %eax,%r14d
xor    %r15d,%r15d
cmpb   $0x3a,0x0(%rbp)
sete   %r15b
add    %rbp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1060 <strncasecmp@plt>
test   %eax,%eax
je     11e4 <CompareIRCAddressNick+0xa4>
mov    %r15,%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11d7 <CompareIRCAddressNick+0x97>
lea    0x1(%rax),%rcx
mov    %rax,%rbp
add    $0x2,%rbp
cmpb   $0x3a,0x1(%rax)
cmovne %rcx,%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1060 <strncasecmp@plt>
test   %eax,%eax
jne    11d7 <CompareIRCAddressNick+0x97>
movslq %r14d,%rax
movsbl 0x0(%rbp,%rax,1),%edi
call   1050 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    11d9 <CompareIRCAddressNick+0x99>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
movslq %r14d,%rax
movsbl (%r15,%rax,1),%edi
call   1050 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    11d9 <CompareIRCAddressNick+0x99>
jmp    1186 <CompareIRCAddressNick+0x46>

LLVM IR (-O0):
define i32 @CompareIRCAddressNick(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %6
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %11, %2
store i32 0, i32* %3
br label %75
15: ; preds = %11
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
%18 = icmp ne i8 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %15
store i32 0, i32* %3
br label %75
20: ; preds = %15
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 58
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
br label %28
28: ; preds = %25, %20
%29 = load i8*, i8** %4
%30 = load i8*, i8** %5
%31 = load i32, i32* %6
%32 = call i32 @strncasecmp(i8* %29, i8* %30, i32 %31)
%33 = icmp ne i32 %32, 0
br i1 %33, label %43, label %34
34: ; preds = %28
%35 = load i8*, i8** %4
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = load i8, i8* %38
%40 = call i64 @isspace(i8 signext %39)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %34
store i32 1, i32* %3
br label %75
43: ; preds = %34, %28
%44 = load i8*, i8** %4
%45 = call i8* @strchr(i8* %44, i8 signext 32)
store i8* %45, i8** %4
%46 = load i8*, i8** %4
%47 = icmp ne i8* %46, null
br i1 %47, label %49, label %48
48: ; preds = %43
store i32 0, i32* %3
br label %75
49: ; preds = %43
%50 = load i8*, i8** %4
%51 = getelementptr inbounds i8, i8* %50, i32 1
store i8* %51, i8** %4
%52 = load i8*, i8** %4
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 58
br i1 %55, label %56, label %59
56: ; preds = %49
%57 = load i8*, i8** %4
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %4
br label %59
59: ; preds = %56, %49
%60 = load i8*, i8** %4
%61 = load i8*, i8** %5
%62 = load i32, i32* %6
%63 = call i32 @strncasecmp(i8* %60, i8* %61, i32 %62)
%64 = icmp ne i32 %63, 0
br i1 %64, label %74, label %65
65: ; preds = %59
%66 = load i8*, i8** %4
%67 = load i32, i32* %6
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %66, i64 %68
%70 = load i8, i8* %69
%71 = call i64 @isspace(i8 signext %70)
%72 = icmp ne i64 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %65
store i32 1, i32* %3
br label %75
74: ; preds = %65, %59
store i32 0, i32* %3
br label %75
75: ; preds = %74, %73, %48, %42, %19, %14
%76 = load i32, i32* %3
ret i32 %76
}

LLVM IR (-O2):
define i32 @CompareIRCAddressNick(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp ne i8* %0, null
%5 = icmp ne i8* %1, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %41
7: ; preds = %2
%8 = load i8, i8* %1
%9 = icmp eq i8 %8, 0
br i1 %9, label %41, label %10
10: ; preds = %7
%11 = load i8, i8* %0
%12 = icmp eq i8 %11, 58
%13 = zext i1 %12 to i64
%14 = getelementptr i8, i8* %0, i64 %13
%15 = tail call i32 @strncasecmp(i8* %14, i8* %1, i32 %3)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %10
%18 = sext i32 %3 to i64
%19 = getelementptr inbounds i8, i8* %14, i64 %18
%20 = load i8, i8* %19
%21 = tail call i64 @isspace(i8 signext %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %41
23: ; preds = %17, %10
%24 = tail call i8* @strchr(i8* %14, i8 signext 32)
%25 = icmp eq i8* %24, null
br i1 %25, label %41, label %26
26: ; preds = %23
%27 = getelementptr inbounds i8, i8* %24, i64 1
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 58
%30 = getelementptr inbounds i8, i8* %24, i64 2
%31 = select i1 %29, i8* %30, i8* %27
%32 = tail call i32 @strncasecmp(i8* %31, i8* %1, i32 %3)
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %26
%35 = sext i32 %3 to i64
%36 = getelementptr inbounds i8, i8* %31, i64 %35
%37 = load i8, i8* %36
%38 = tail call i64 @isspace(i8 signext %37)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %34, %26
br label %41
41: ; preds = %34, %23, %17, %7, %2, %40
%42 = phi i32 [ 0, %40 ], [ 0, %2 ], [ 0, %7 ], [ 1, %17 ], [ 0, %23 ], [ 1, %34 ]
ret i32 %42
}