#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*/ printf(char *, ...);
bool _assertBoolArrayEquals(bool *expected, bool *actual, int length,
                            int line) {
  int i;
  if (length <= 0) {
    printf("assertBoolArrayEquals FAILED, line: %i, negative or zero array "
           "length: %i",
           line, length);
    return false;
  }
  for (i = 0; i < length; i++) {
    if (expected[i] != actual[i]) {
      printf("assertBoolArrayEquals FAILED, line: %i, on index %i with array "
             "length %i\n",
             line, i, length);
      printf("expected: %s, actual: %s\n", expected[i] ? "true" : "false",
             actual[i] ? "true" : "false");
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<_assertBoolArrayEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     1150 <_assertBoolArrayEquals+0x40>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    120a <_assertBoolArrayEquals+0xfa>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1203 <_assertBoolArrayEquals+0xf3>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x24(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     11f0 <_assertBoolArrayEquals+0xe0>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xf0b(%rip),%rsi
lea    0xeff(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xeeb(%rip),%rdx
lea    0xedf(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    120a <_assertBoolArrayEquals+0xfa>
jmp    11f5 <_assertBoolArrayEquals+0xe5>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1157 <_assertBoolArrayEquals+0x47>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assertBoolArrayEquals>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    114b <_assertBoolArrayEquals+0x3b>
mov    %rsi,%r15
mov    %rdi,%rbp
mov    %edx,%eax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%rbp,%rbx,4),%edx
cmp    (%r15,%rbx,4),%edx
jne    1160 <_assertBoolArrayEquals+0x50>
add    $0x1,%rbx
cmp    %rbx,%rax
jne    1130 <_assertBoolArrayEquals+0x20>
mov    $0x1,%r14d
jmp    11a8 <_assertBoolArrayEquals+0x98>
lea    0xeae(%rip),%rdi
xor    %r14d,%r14d
mov    %ecx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11a8 <_assertBoolArrayEquals+0x98>
lea    0xee3(%rip),%rdi
xor    %r14d,%r14d
mov    %ecx,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,0x0(%rbp,%rbx,4)
lea    0xf30(%rip),%rax
lea    0xf24(%rip),%rdx
mov    %rdx,%rsi
cmove  %rax,%rsi
cmpl   $0x0,(%r15,%rbx,4)
cmove  %rax,%rdx
lea    0xef3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [74 x i8] c"assertBoolArrayEquals FAILED, line: %i, negative or zero array length: %i\00"
@.str.1 = [74 x i8] c"assertBoolArrayEquals FAILED, line: %i, on index %i with array length %i\0A\00"
@.str.2 = [26 x i8] c"expected: %s, actual: %s\0A\00"
@.str.3 = [5 x i8] c"true\00"
@.str.4 = [6 x i8] c"false\00"
define i32 @_assertBoolArrayEquals(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i32, i32* %8
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = load i32, i32* %9
%15 = load i32, i32* %8
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
store i32 0, i32* %5
br label %61
17: ; preds = %4
store i32 0, i32* %10
br label %18
18: ; preds = %57, %17
%19 = load i32, i32* %10
%20 = load i32, i32* %8
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %60
22: ; preds = %18
%23 = load i32*, i32** %6
%24 = load i32, i32* %10
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = load i32*, i32** %7
%29 = load i32, i32* %10
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = icmp ne i32 %27, %32
br i1 %33, label %34, label %56
34: ; preds = %22
%35 = load i32, i32* %9
%36 = load i32, i32* %10
%37 = load i32, i32* %8
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0), i32 %35, i32 %36, i32 %37)
%39 = load i32*, i32** %6
%40 = load i32, i32* %10
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %39, i64 %41
%43 = load i32, i32* %42
%44 = icmp ne i32 %43, 0
%45 = zext i1 %44 to i64
%46 = select i1 %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%47 = load i32*, i32** %7
%48 = load i32, i32* %10
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i32, i32* %47, i64 %49
%51 = load i32, i32* %50
%52 = icmp ne i32 %51, 0
%53 = zext i1 %52 to i64
%54 = select i1 %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %46, i8* %54)
store i32 0, i32* %5
br label %61
56: ; preds = %22
br label %57
57: ; preds = %56
%58 = load i32, i32* %10
%59 = add nsw i32 %58, 1
store i32 %59, i32* %10
br label %18
60: ; preds = %18
store i32 1, i32* %5
br label %61
61: ; preds = %60, %34, %13
%62 = load i32, i32* %5
ret i32 %62
}

LLVM IR (-O2):
@.str = [74 x i8] c"assertBoolArrayEquals FAILED, line: %i, negative or zero array length: %i\00"
@.str.1 = [74 x i8] c"assertBoolArrayEquals FAILED, line: %i, on index %i with array length %i\0A\00"
@.str.2 = [26 x i8] c"expected: %s, actual: %s\0A\00"
@.str.3 = [5 x i8] c"true\00"
@.str.4 = [6 x i8] c"false\00"
define i32 @_assertBoolArrayEquals(i32* nocapture %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, 1
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = zext i32 %2 to i64
br label %10
8: ; preds = %4
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %2)
br label %33
10: ; preds = %6, %30
%11 = phi i64 [ 0, %6 ], [ %31, %30 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %13, %15
br i1 %16, label %30, label %17
17: ; preds = %10
%18 = trunc i64 %11 to i32
%19 = and i64 %11, 4294967295
%20 = getelementptr inbounds i32, i32* %0, i64 %19
%21 = getelementptr inbounds i32, i32* %1, i64 %19
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %18, i32 %2)
%23 = load i32, i32* %20
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%26 = load i32, i32* %21
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %25, i8* %28)
br label %33
30: ; preds = %10
%31 = add nuw nsw i64 %11, 1
%32 = icmp eq i64 %31, %7
br i1 %32, label %33, label %10
33: ; preds = %30, %17, %8
%34 = phi i32 [ 0, %8 ], [ 0, %17 ], [ 1, %30 ]
ret i32 %34
}