#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 Kit_TruthWordNum(int);
int Kit_TruthIsEqual(unsigned *pIn0, unsigned *pIn1, int nVars) {
  int w;
  for (w = Kit_TruthWordNum(nVars) - 1; w >= 0; w--)
    if (pIn0[w] != pIn1[w])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<Kit_TruthIsEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <Kit_TruthWordNum@plt>
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     1176 <Kit_TruthIsEqual+0x66>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1163 <Kit_TruthIsEqual+0x53>
movl   $0x0,-0x4(%rbp)
jmp    117d <Kit_TruthIsEqual+0x6d>
jmp    1168 <Kit_TruthIsEqual+0x58>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1131 <Kit_TruthIsEqual+0x21>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_TruthIsEqual>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
call   1030 <Kit_TruthWordNum@plt>
mov    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %eax,%eax
jle    114a <Kit_TruthIsEqual+0x3a>
mov    -0x4(%rbx,%rax,4),%ecx
lea    -0x1(%rax),%rdx
cmp    -0x4(%r14,%rax,4),%ecx
mov    %rdx,%rax
je     1130 <Kit_TruthIsEqual+0x20>
xor    %eax,%eax
jmp    114f <Kit_TruthIsEqual+0x3f>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @Kit_TruthIsEqual(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @Kit_TruthWordNum(i32 %2)
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %11, %3
%7 = phi i64 [ %8, %11 ], [ %5, %3 ]
%8 = add nsw i64 %7, -1
%9 = trunc i64 %7 to i32
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = getelementptr inbounds i32, i32* %0, i64 %8
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 %8
%15 = load i32, i32* %14
%16 = icmp eq i32 %13, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11
%18 = phi i32 [ 0, %11 ], [ 1, %6 ]
ret i32 %18
}