#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_duplicate_numbers();
int /*<<< orphan*/ test_empty_input();
int /*<<< orphan*/ test_negative_numbers();
int /*<<< orphan*/ test_one_element();
int /*<<< orphan*/ test_two_elements();
void main() {
  int counter = 0;
  if (!test_empty_input()) {
    counter++;
    printf("Empty input test failed!\n");
  }
  if (!test_one_element()) {
    counter++;
    printf("One element test failed!\n");
  }
  if (!test_two_elements()) {
    counter++;
    printf("Two elements test failed!\n");
  }
  if (!test_negative_numbers()) {
    counter++;
    printf("Negative numbers test failed!\n");
  }
  if (!test_duplicate_numbers()) {
    counter++;
    printf("Duplicate numbers test failed!\n");
  }
  printf("%d tests failed.\n", counter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_empty_input@plt>
cmp    $0x0,%eax
jne    1196 <main+0x36>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1080 <test_one_element@plt>
cmp    $0x0,%eax
jne    11bd <main+0x5d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test_two_elements@plt>
cmp    $0x0,%eax
jne    11e4 <main+0x84>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <test_negative_numbers@plt>
cmp    $0x0,%eax
jne    120b <main+0xab>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test_duplicate_numbers@plt>
cmp    $0x0,%eax
jne    1232 <main+0xd2>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <test_empty_input@plt>
test   %eax,%eax
jne    118f <main+0x1f>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
xor    %eax,%eax
call   1090 <test_one_element@plt>
test   %eax,%eax
jne    11a9 <main+0x39>
add    $0x1,%ebx
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <test_two_elements@plt>
test   %eax,%eax
jne    11c3 <main+0x53>
add    $0x1,%ebx
lea    0xe86(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <test_negative_numbers@plt>
test   %eax,%eax
jne    11dd <main+0x6d>
add    $0x1,%ebx
lea    0xe86(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test_duplicate_numbers@plt>
test   %eax,%eax
jne    11f7 <main+0x87>
add    $0x1,%ebx
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe02(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Empty input test failed!\0A\00"
@.str.1 = [26 x i8] c"One element test failed!\0A\00"
@.str.2 = [27 x i8] c"Two elements test failed!\0A\00"
@.str.3 = [31 x i8] c"Negative numbers test failed!\0A\00"
@.str.4 = [32 x i8] c"Duplicate numbers test failed!\0A\00"
@.str.5 = [18 x i8] c"%d tests failed.\0A\00"
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_empty_input()
%3 = icmp ne i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %4, %0
%9 = call i32 (...) @test_one_element()
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %11, %8
%16 = call i32 (...) @test_two_elements()
%17 = icmp ne i32 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %18, %15
%23 = call i32 (...) @test_negative_numbers()
%24 = icmp ne i32 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %22
%26 = load i32, i32* %1
%27 = add nsw i32 %26, 1
store i32 %27, i32* %1
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %29
29: ; preds = %25, %22
%30 = call i32 (...) @test_duplicate_numbers()
%31 = icmp ne i32 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %29
%33 = load i32, i32* %1
%34 = add nsw i32 %33, 1
store i32 %34, i32* %1
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %36
36: ; preds = %32, %29
%37 = load i32, i32* %1
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %37)
ret void
}

LLVM IR (-O2):
@.str.5 = [18 x i8] c"%d tests failed.\0A\00"
@str = [25 x i8] c"Empty input test failed!\00"
@str.6 = [25 x i8] c"One element test failed!\00"
@str.7 = [26 x i8] c"Two elements test failed!\00"
@str.8 = [30 x i8] c"Negative numbers test failed!\00"
@str.9 = [31 x i8] c"Duplicate numbers test failed!\00"
define void @main() {
%1 = tail call i32 (...) @test_empty_input()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ 0, %0 ], [ 1, %3 ]
%7 = tail call i32 (...) @test_one_element()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = add nuw nsw i32 %6, 1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
br label %12
12: ; preds = %9, %5
%13 = phi i32 [ %6, %5 ], [ %10, %9 ]
%14 = tail call i32 (...) @test_two_elements()
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = add nuw nsw i32 %13, 1
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.7, i64 0, i64 0))
br label %19
19: ; preds = %16, %12
%20 = phi i32 [ %13, %12 ], [ %17, %16 ]
%21 = tail call i32 (...) @test_negative_numbers()
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = add nuw nsw i32 %20, 1
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.8, i64 0, i64 0))
br label %26
26: ; preds = %23, %19
%27 = phi i32 [ %20, %19 ], [ %24, %23 ]
%28 = tail call i32 (...) @test_duplicate_numbers()
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = add nuw nsw i32 %27, 1
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.9, i64 0, i64 0))
br label %33
33: ; preds = %30, %26
%34 = phi i32 [ %27, %26 ], [ %31, %30 ]
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %34)
ret void
}