#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 *, ...);
int /*<<< orphan*/ test_all(int *, int *);
int main(int argc, char *argv[]) {
  int failures = 0;
  int successes = 0;
  printf("\x1B[34m"
         "\x1B[1m"
         "Running tests..."
         "\x1B[0m"
         "\n\n");
  test_all(&failures, &successes);
  if (failures == 0) {
    printf("\x1B[32m"
           "\x1B[1m"
           "-------------------------------------"
           "\n               Success\n"
           "-------------------------------------"
           "\n"
           "\x1B[0m");
  } else {
    printf("\x1B[31m"
           "\x1B[1m"
           "-------------------------------------"
           "\n               Failure\n"
           "-------------------------------------"
           "\n"
           "\x1B[0m");
  }
  if (successes > 0) {
    printf("\x1B[32m"
           "%d Tests Successful\n"
           "\x1B[0m",
           successes);
  }
  if (failures > 0) {
    printf("\x1B[31m"
           "%d Tests Failed\n"
           "\x1B[0m",
           failures);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <test_all@plt>
cmpl   $0x0,-0x14(%rbp)
jne    117c <main+0x5c>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118a <main+0x6a>
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
jle    11a5 <main+0x85>
mov    -0x18(%rbp),%esi
lea    0xf64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    11c0 <main+0xa0>
mov    -0x14(%rbp),%esi
lea    0xf67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xfc3(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1060 <test_all@plt>
cmpl   $0x0,(%rsp)
lea    0xe8c(%rip),%rax
lea    0xef6(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    119c <main+0x5c>
lea    0xf4d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%esi
test   %esi,%esi
jle    11b1 <main+0x71>
lea    0xf56(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\1B[34m\1B[1mRunning tests...\1B[0m\0A\0A\00"
@.str.1 = [113 x i8] c"\1B[32m\1B[1m-------------------------------------\0A Success\0A-------------------------------------\0A\1B[0m\00"
@.str.2 = [113 x i8] c"\1B[31m\1B[1m-------------------------------------\0A Failure\0A-------------------------------------\0A\1B[0m\00"
@.str.3 = [30 x i8] c"\1B[32m%d Tests Successful\0A\1B[0m\00"
@.str.4 = [26 x i8] c"\1B[31m%d Tests Failed\0A\1B[0m\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @test_all(i32* %6, i32* %7)
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.1, i64 0, i64 0))
br label %16
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %7
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %16
%23 = load i32, i32* %6
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %25, %22
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str.1 = [113 x i8] c"\1B[32m\1B[1m-------------------------------------\0A Success\0A-------------------------------------\0A\1B[0m\00"
@.str.2 = [113 x i8] c"\1B[31m\1B[1m-------------------------------------\0A Failure\0A-------------------------------------\0A\1B[0m\00"
@.str.3 = [30 x i8] c"\1B[32m%d Tests Successful\0A\1B[0m\00"
@.str.4 = [26 x i8] c"\1B[31m%d Tests Failed\0A\1B[0m\00"
@str = [31 x i8] c"\1B[34m\1B[1mRunning tests...\1B[0m\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%8 = call i32 @test_all(i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.2, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %11)
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %13)
br label %17
17: ; preds = %15, %2
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %18)
br label %22
22: ; preds = %20, %17
%23 = call i32 @putchar(i32 10)
ret i32 0
}