#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__ doKeyTests(int /*<<< orphan*/);
int /*<<< orphan*/ prnlog(char *);
int testCipherUtils();
scalar_t__ testElite();
scalar_t__ testMAC();
int unitTests() {
  int errors = testCipherUtils();
  errors += testMAC();
  errors += doKeyTests(0);
  errors += testElite();
  if (errors) {
    prnlog("OBS! There were errors!!!");
  }
  return errors;
}


x86 assembly (clang, -O0):
<unitTests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <testCipherUtils@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1070 <testMAC@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
call   1050 <doKeyTests@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <testElite@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11b4 <unitTests+0x64>
lea    0xe51(%rip),%rdi
call   1030 <prnlog@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unitTests>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <testCipherUtils@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1070 <testMAC@plt>
mov    %rax,%rbx
add    %ebp,%ebx
xor    %edi,%edi
call   1050 <doKeyTests@plt>
mov    %rax,%rbp
add    %ebx,%ebp
xor    %eax,%eax
call   1040 <testElite@plt>
mov    %rax,%rbx
add    %ebp,%ebx
je     118e <unitTests+0x3e>
lea    0xe77(%rip),%rdi
call   1030 <prnlog@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"OBS! There were errors!!!\00"
define i32 @unitTests() {
%1 = alloca i32
%2 = call i32 (...) @testCipherUtils()
store i32 %2, i32* %1
%3 = call i64 (...) @testMAC()
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
%8 = call i64 @doKeyTests(i32 0)
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %1
%13 = call i64 (...) @testElite()
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %1
%18 = load i32, i32* %1
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 @prnlog(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %0
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [26 x i8] c"OBS! There were errors!!!\00"
define i32 @unitTests() {
%1 = tail call i32 (...) @testCipherUtils()
%2 = tail call i64 (...) @testMAC()
%3 = trunc i64 %2 to i32
%4 = add i32 %1, %3
%5 = tail call i64 @doKeyTests(i32 0)
%6 = trunc i64 %5 to i32
%7 = add i32 %4, %6
%8 = tail call i64 (...) @testElite()
%9 = trunc i64 %8 to i32
%10 = add i32 %7, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %0
%13 = tail call i32 @prnlog(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %0
ret i32 %10
}