#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*/ UNITTEST_SET_ALL_SUITE();
int /*<<< orphan*/ simple_unittest_free();
int /*<<< orphan*/ simple_unittest_init();
int /*<<< orphan*/ simple_unittest_set_total_size(int);
int simple_unittest_suite_run_all();
int simple_unittest_suite_run_by_name(char *);
int main(int argc, char *argv[]) {
  int ret = 0;
  simple_unittest_init();
  UNITTEST_SET_ALL_SUITE();
  if (argc > 1) {
    simple_unittest_set_total_size(argc - 1);
    for (int i = 1; i < argc; i++) {
      ret = simple_unittest_suite_run_by_name(argv[i]);
    }
  } else {
    ret = simple_unittest_suite_run_all();
  }
  simple_unittest_free();
  return ret;
}


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)
mov    $0x0,%al
call   1040 <simple_unittest_init@plt>
mov    $0x0,%al
call   1070 <UNITTEST_SET_ALL_SUITE@plt>
cmpl   $0x1,-0x8(%rbp)
jle    11da <main+0x7a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1080 <simple_unittest_set_total_size@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d5 <main+0x75>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <simple_unittest_suite_run_by_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a7 <main+0x47>
jmp    11e4 <main+0x84>
mov    $0x0,%al
call   1050 <simple_unittest_suite_run_all@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <simple_unittest_free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%r14d
xor    %eax,%eax
call   1040 <simple_unittest_init@plt>
xor    %eax,%eax
call   1070 <UNITTEST_SET_ALL_SUITE@plt>
cmp    $0x2,%r14d
jl     11b4 <main+0x54>
lea    -0x1(%r14),%edi
call   1080 <simple_unittest_set_total_size@plt>
mov    %r14d,%r14d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
call   1030 <simple_unittest_suite_run_by_name@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11a0 <main+0x40>
jmp    11bb <main+0x5b>
xor    %eax,%eax
call   1050 <simple_unittest_suite_run_all@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <simple_unittest_free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
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
%8 = call i32 (...) @simple_unittest_init()
%9 = call i32 (...) @UNITTEST_SET_ALL_SUITE()
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %31
12: ; preds = %2
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = call i32 @simple_unittest_set_total_size(i32 %14)
store i32 1, i32* %7
br label %16
16: ; preds = %27, %12
%17 = load i32, i32* %7
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 @simple_unittest_suite_run_by_name(i8* %25)
store i32 %26, i32* %6
br label %27
27: ; preds = %20
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %16
30: ; preds = %16
br label %33
31: ; preds = %2
%32 = call i32 (...) @simple_unittest_suite_run_all()
store i32 %32, i32* %6
br label %33
33: ; preds = %31, %30
%34 = call i32 (...) @simple_unittest_free()
%35 = load i32, i32* %6
ret i32 %35
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @simple_unittest_init()
%4 = tail call i32 (...) @UNITTEST_SET_ALL_SUITE()
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = tail call i32 @simple_unittest_set_total_size(i32 %7)
%9 = zext i32 %0 to i64
br label %10
10: ; preds = %6, %10
%11 = phi i64 [ 1, %6 ], [ %15, %10 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 @simple_unittest_suite_run_by_name(i8* %13)
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %9
br i1 %16, label %19, label %10
17: ; preds = %2
%18 = tail call i32 (...) @simple_unittest_suite_run_all()
br label %19
19: ; preds = %10, %17
%20 = phi i32 [ %18, %17 ], [ %14, %10 ]
%21 = tail call i32 (...) @simple_unittest_free()
ret i32 %20
}