#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ exit_error(char *);
int /*<<< orphan*/ printf(char *);
scalar_t__ test_all();
int main() {
  printf("\nRUNNING ALL UNIT TESTS ON DATA STRUCTURES.\n\n");
  if (test_all() == 0) {
    printf("\nUNIT TEST COMPLETE - ALL TESTS RETURNED PASSED.\n\n");
  } else {
    exit_error("UNIT TEST FAILED.\n\n");
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <test_all@plt>
cmp    $0x0,%rax
jne    117d <main+0x3d>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    1189 <main+0x49>
lea    0xedd(%rip),%rdi
call   1040 <exit_error@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <test_all@plt>
test   %rax,%rax
jne    1167 <main+0x27>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
jmp    1173 <main+0x33>
lea    0xe92(%rip),%rdi
call   1040 <exit_error@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"\0ARUNNING ALL UNIT TESTS ON DATA STRUCTURES.\0A\0A\00"
@.str.1 = [51 x i8] c"\0AUNIT TEST COMPLETE - ALL TESTS RETURNED PASSED.\0A\0A\00"
@.str.2 = [20 x i8] c"UNIT TEST FAILED.\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @test_all()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @exit_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* @EXIT_SUCCESS
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str.2 = [20 x i8] c"UNIT TEST FAILED.\0A\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [45 x i8] c"\0ARUNNING ALL UNIT TESTS ON DATA STRUCTURES.\0A\00"
@str.3 = [50 x i8] c"\0AUNIT TEST COMPLETE - ALL TESTS RETURNED PASSED.\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 (...) @test_all()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.3, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = tail call i32 @exit_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}