#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*/ fprintf(int /*<<< orphan*/, char *, char const *, size_t,
                           char *, char *);
int /*<<< orphan*/ stderr;
bool assert_equal_bool_arrays(const bool *const arr_a, const bool *const arr_b,
                              const size_t size, const char *arr_a_name) {
  bool equality = true;
  for (size_t i = 0; i < size; ++i) {
    if (arr_a[i] != arr_b[i]) {
      fprintf(stderr, "%s[%zu] = %s instead of %s\n", arr_a_name, i,
              arr_a[i] ? "true" : "false", arr_b[i] ? "true" : "false");
      equality = false;
    }
  }
  return equality;
}


x86 assembly (clang, -O0):
<assert_equal_bool_arrays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    11db <assert_equal_bool_arrays+0xcb>
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x30(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     11c5 <assert_equal_bool_arrays+0xb5>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rsi
mov    (%rax,%rsi,4),%esi
lea    0xe9d(%rip),%r8
lea    0xe91(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r8
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rsi
mov    (%rax,%rsi,4),%esi
lea    0xe7d(%rip),%r9
lea    0xe71(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r9
lea    0xe47(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
jmp    11ca <assert_equal_bool_arrays+0xba>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1137 <assert_equal_bool_arrays+0x27>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_equal_bool_arrays>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,(%rsp)
test   %rdx,%rdx
je     1197 <assert_equal_bool_arrays+0x87>
mov    %rdx,%r13
mov    %rsi,%r15
mov    %rdi,%r12
mov    $0x1,%eax
xor    %ebx,%ebx
lea    0xee6(%rip),%rbp
lea    0xeda(%rip),%r14
jmp    1159 <assert_equal_bool_arrays+0x49>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %rbx,%r13
je     119c <assert_equal_bool_arrays+0x8c>
mov    (%r12,%rbx,4),%edx
mov    (%r15,%rbx,4),%ecx
cmp    %ecx,%edx
je     1150 <assert_equal_bool_arrays+0x40>
test   %edx,%edx
mov    %r14,%r8
cmove  %rbp,%r8
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
test   %ecx,%ecx
mov    %r14,%r9
cmove  %rbp,%r9
lea    0xe79(%rip),%rsi
mov    (%rsp),%rdx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
xor    %eax,%eax
jmp    1150 <assert_equal_bool_arrays+0x40>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"%s[%zu] = %s instead of %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @assert_equal_bool_arrays(i32* %0, i32* %1, i64 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i64
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
store i32 1, i32* %9
store i64 0, i64* %10
br label %11
11: ; preds = %45, %4
%12 = load i64, i64* %10
%13 = load i64, i64* %7
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %48
15: ; preds = %11
%16 = load i32*, i32** %5
%17 = load i64, i64* %10
%18 = getelementptr inbounds i32, i32* %16, i64 %17
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
%21 = load i64, i64* %10
%22 = getelementptr inbounds i32, i32* %20, i64 %21
%23 = load i32, i32* %22
%24 = icmp ne i32 %19, %23
br i1 %24, label %25, label %44
25: ; preds = %15
%26 = load i32, i32* @stderr
%27 = load i8*, i8** %8
%28 = load i64, i64* %10
%29 = load i32*, i32** %5
%30 = load i64, i64* %10
%31 = getelementptr inbounds i32, i32* %29, i64 %30
%32 = load i32, i32* %31
%33 = icmp ne i32 %32, 0
%34 = zext i1 %33 to i64
%35 = select i1 %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%36 = load i32*, i32** %6
%37 = load i64, i64* %10
%38 = getelementptr inbounds i32, i32* %36, i64 %37
%39 = load i32, i32* %38
%40 = icmp ne i32 %39, 0
%41 = zext i1 %40 to i64
%42 = select i1 %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%43 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %27, i64 %28, i8* %35, i8* %42)
store i32 0, i32* %9
br label %44
44: ; preds = %25, %15
br label %45
45: ; preds = %44
%46 = load i64, i64* %10
%47 = add i64 %46, 1
store i64 %47, i64* %10
br label %11
48: ; preds = %11
%49 = load i32, i32* %9
ret i32 %49
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"%s[%zu] = %s instead of %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @assert_equal_bool_arrays(i32* nocapture %0, i32* nocapture %1, i64 %2, i8* %3) {
%5 = icmp eq i64 %2, 0
br i1 %5, label %6, label %8
6: ; preds = %23, %4
%7 = phi i32 [ 1, %4 ], [ %24, %23 ]
ret i32 %7
8: ; preds = %4, %23
%9 = phi i64 [ %25, %23 ], [ 0, %4 ]
%10 = phi i32 [ %24, %23 ], [ 1, %4 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %9
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %9
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
br i1 %15, label %23, label %16
16: ; preds = %8
%17 = load i32, i32* @stderr
%18 = icmp eq i32 %12, 0
%19 = select i1 %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%20 = icmp eq i32 %14, 0
%21 = select i1 %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%22 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3, i64 %9, i8* %19, i8* %21)
br label %23
23: ; preds = %8, %16
%24 = phi i32 [ 0, %16 ], [ %10, %8 ]
%25 = add nuw i64 %9, 1
%26 = icmp eq i64 %25, %2
br i1 %26, label %6, label %8
}