#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 *, unsigned int, unsigned int, ...);
bool _assertUIntArrayEquals(unsigned int *expected, unsigned int *actual,
                            int length, int line) {
  int i;
  if (length <= 0) {
    printf("assertUIntArrayEquals 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("assertUIntArrayEquals FAILED, line: %i, on index %i with array "
             "length %i\n",
             line, i, length);
      printf("expected: %i, actual: %i\n", expected[i], actual[i]);
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<_assertUIntArrayEquals>:
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 <_assertUIntArrayEquals+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    11e0 <_assertUIntArrayEquals+0xd0>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11d9 <_assertUIntArrayEquals+0xc9>
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     11c6 <_assertUIntArrayEquals+0xb6>
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),%esi
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11e0 <_assertUIntArrayEquals+0xd0>
jmp    11cb <_assertUIntArrayEquals+0xbb>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1157 <_assertUIntArrayEquals+0x47>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assertUIntArrayEquals>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    114a <_assertUIntArrayEquals+0x3a>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%eax
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx,%rbp,4),%edx
cmp    (%r14,%rbp,4),%edx
jne    1158 <_assertUIntArrayEquals+0x48>
add    $0x1,%rbp
cmp    %rbp,%rax
jne    1130 <_assertUIntArrayEquals+0x20>
mov    $0x1,%r15d
jmp    1184 <_assertUIntArrayEquals+0x74>
lea    0xeaf(%rip),%rdi
xor    %r15d,%r15d
mov    %ecx,%esi
jmp    117d <_assertUIntArrayEquals+0x6d>
lea    0xeeb(%rip),%rdi
xor    %r15d,%r15d
mov    %ecx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx,%rbp,4),%esi
mov    (%r14,%rbp,4),%edx
lea    0xf17(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [74 x i8] c"assertUIntArrayEquals FAILED, line: %i, negative or zero array length: %i\00"
@.str.1 = [74 x i8] c"assertUIntArrayEquals FAILED, line: %i, on index %i with array length %i\0A\00"
@.str.2 = [26 x i8] c"expected: %i, actual: %i\0A\00"
define i32 @_assertUIntArrayEquals(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*, i32, i32, ...) @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 %55
17: ; preds = %4
store i32 0, i32* %10
br label %18
18: ; preds = %51, %17
%19 = load i32, i32* %10
%20 = load i32, i32* %8
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %54
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 %50
34: ; preds = %22
%35 = load i32, i32* %9
%36 = load i32, i32* %10
%37 = load i32, i32* %8
%38 = call i32 (i8*, i32, i32, ...) @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 = load i32*, i32** %7
%45 = load i32, i32* %10
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i32, i32* %44, i64 %46
%48 = load i32, i32* %47
%49 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %43, i32 %48)
store i32 0, i32* %5
br label %55
50: ; preds = %22
br label %51
51: ; preds = %50
%52 = load i32, i32* %10
%53 = add nsw i32 %52, 1
store i32 %53, i32* %10
br label %18
54: ; preds = %18
store i32 1, i32* %5
br label %55
55: ; preds = %54, %34, %13
%56 = load i32, i32* %5
ret i32 %56
}

LLVM IR (-O2):
@.str = [74 x i8] c"assertUIntArrayEquals FAILED, line: %i, negative or zero array length: %i\00"
@.str.1 = [74 x i8] c"assertUIntArrayEquals FAILED, line: %i, on index %i with array length %i\0A\00"
@.str.2 = [26 x i8] c"expected: %i, actual: %i\0A\00"
define i32 @_assertUIntArrayEquals(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*, i32, i32, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %2)
br label %29
10: ; preds = %6, %26
%11 = phi i64 [ 0, %6 ], [ %27, %26 ]
%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 %26, 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*, i32, i32, ...) @printf(i8* 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 = load i32, i32* %21
%25 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %24)
br label %29
26: ; preds = %10
%27 = add nuw nsw i64 %11, 1
%28 = icmp eq i64 %27, %7
br i1 %28, label %29, label %10
29: ; preds = %26, %17, %8
%30 = phi i32 [ 0, %8 ], [ 0, %17 ], [ 1, %26 ]
ret i32 %30
}