#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__ cmpChrCommunist(char const, char const);
int strnEqlCommunist(const char *s, const char *t, int n) {
  for (; cmpChrCommunist(*s, *t); s++, t++)
    if (*s == '\0' || --n <= 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<strnEqlCommunist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
movsbl %cl,%edi
movsbl (%rax),%esi
call   1030 <cmpChrCommunist@plt>
cmp    $0x0,%rax
je     1192 <strnEqlCommunist+0x82>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <strnEqlCommunist+0x54>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jg     1170 <strnEqlCommunist+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1199 <strnEqlCommunist+0x89>
jmp    1175 <strnEqlCommunist+0x65>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1123 <strnEqlCommunist+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnEqlCommunist>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%r15
movsbl (%rdi),%edi
movsbl (%rsi),%esi
call   1030 <cmpChrCommunist@plt>
test   %rax,%rax
je     116d <strnEqlCommunist+0x5d>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,-0x1(%r15,%rbx,1)
mov    $0x1,%eax
je     116f <strnEqlCommunist+0x5f>
cmp    $0x2,%ebp
jl     116f <strnEqlCommunist+0x5f>
add    $0xffffffff,%ebp
movsbl (%r15,%rbx,1),%edi
movsbl (%r14,%rbx,1),%esi
call   1030 <cmpChrCommunist@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1140 <strnEqlCommunist+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @strnEqlCommunist(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
br label %8
8: ; preds = %26, %3
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = load i8*, i8** %6
%12 = load i8, i8* %11
%13 = call i64 @cmpChrCommunist(i8 signext %10, i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %31
15: ; preds = %8
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %15
%21 = load i32, i32* %7
%22 = add nsw i32 %21, -1
store i32 %22, i32* %7
%23 = icmp sle i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20, %15
store i32 1, i32* %4
br label %32
25: ; preds = %20
br label %26
26: ; preds = %25
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %5
%29 = load i8*, i8** %6
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %6
br label %8
31: ; preds = %8
store i32 0, i32* %4
br label %32
32: ; preds = %31, %24
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
define i32 @strnEqlCommunist(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = load i8, i8* %0
%5 = load i8, i8* %1
%6 = tail call i64 @cmpChrCommunist(i8 signext %4, i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %24, label %8
8: ; preds = %3, %16
%9 = phi i32 [ %17, %16 ], [ %2, %3 ]
%10 = phi i8* [ %19, %16 ], [ %1, %3 ]
%11 = phi i8* [ %18, %16 ], [ %0, %3 ]
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = icmp slt i32 %9, 2
%15 = select i1 %13, i1 true, i1 %14
br i1 %15, label %24, label %16
16: ; preds = %8
%17 = add nsw i32 %9, -1
%18 = getelementptr inbounds i8, i8* %11, i64 1
%19 = getelementptr inbounds i8, i8* %10, i64 1
%20 = load i8, i8* %18
%21 = load i8, i8* %19
%22 = tail call i64 @cmpChrCommunist(i8 signext %20, i8 signext %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %8
24: ; preds = %8, %16, %3
%25 = phi i32 [ 0, %3 ], [ 0, %16 ], [ 1, %8 ]
ret i32 %25
}