#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*/ assert(int /*<<< orphan*/);
scalar_t__ irc_tolower(char const);
int irc_compare_nicks_int(const char *const nick1, const char *const nick2) {
  int i = 0;
  assert(nick1 != NULL);
  assert(nick2 != NULL);
  while (nick1[i] != '\0') {
    if (irc_tolower(nick1[i]) != irc_tolower(nick2[i]))
      return (1);
    i++;
  }
  if (nick2[i] != '\0')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<irc_compare_nicks_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11c0 <irc_compare_nicks_int+0xa0>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <irc_tolower@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <irc_tolower@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     11b2 <irc_compare_nicks_int+0x92>
movl   $0x1,-0x4(%rbp)
jmp    11e8 <irc_compare_nicks_int+0xc8>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115b <irc_compare_nicks_int+0x3b>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11e1 <irc_compare_nicks_int+0xc1>
movl   $0x1,-0x4(%rbp)
jmp    11e8 <irc_compare_nicks_int+0xc8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_compare_nicks_int>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    (%r15),%al
test   %al,%al
je     118c <irc_compare_nicks_int+0x6c>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1040 <irc_tolower@plt>
mov    %rax,%r12
movsbl (%r14,%rbx,1),%edi
call   1040 <irc_tolower@plt>
cmp    %rax,%r12
jne    119a <irc_compare_nicks_int+0x7a>
movzbl 0x1(%r15,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1160 <irc_compare_nicks_int+0x40>
mov    %ebx,%ecx
jmp    118e <irc_compare_nicks_int+0x6e>
xor    %ecx,%ecx
xor    %eax,%eax
cmpb   $0x0,(%r14,%rcx,1)
setne  %al
jmp    119f <irc_compare_nicks_int+0x7f>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @irc_compare_nicks_int(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
store i32 0, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
br label %15
15: ; preds = %38, %2
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %41
23: ; preds = %15
%24 = load i8*, i8** %4
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = call i64 @irc_tolower(i8 signext %28)
%30 = load i8*, i8** %5
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
%34 = load i8, i8* %33
%35 = call i64 @irc_tolower(i8 signext %34)
%36 = icmp ne i64 %29, %35
br i1 %36, label %37, label %38
37: ; preds = %23
store i32 1, i32* %3
br label %51
38: ; preds = %23
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %15
41: ; preds = %15
%42 = load i8*, i8** %5
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %41
store i32 1, i32* %3
br label %51
50: ; preds = %41
store i32 0, i32* %3
br label %51
51: ; preds = %50, %49, %37
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
define i32 @irc_compare_nicks_int(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i8, i8* %0
%10 = icmp eq i8 %9, 0
br i1 %10, label %26, label %11
11: ; preds = %2, %19
%12 = phi i64 [ %20, %19 ], [ 0, %2 ]
%13 = phi i8 [ %22, %19 ], [ %9, %2 ]
%14 = tail call i64 @irc_tolower(i8 signext %13)
%15 = getelementptr inbounds i8, i8* %1, i64 %12
%16 = load i8, i8* %15
%17 = tail call i64 @irc_tolower(i8 signext %16)
%18 = icmp eq i64 %14, %17
br i1 %18, label %19, label %32
19: ; preds = %11
%20 = add nuw i64 %12, 1
%21 = getelementptr inbounds i8, i8* %0, i64 %20
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %11
24: ; preds = %19
%25 = and i64 %20, 4294967295
br label %26
26: ; preds = %24, %2
%27 = phi i64 [ 0, %2 ], [ %25, %24 ]
%28 = getelementptr inbounds i8, i8* %1, i64 %27
%29 = load i8, i8* %28
%30 = icmp ne i8 %29, 0
%31 = zext i1 %30 to i32
br label %32
32: ; preds = %11, %26
%33 = phi i32 [ %31, %26 ], [ 1, %11 ]
ret i32 %33
}