#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_empty_input();
int /*<<< orphan*/ test_no_duplicates();
int /*<<< orphan*/ test_only_duplicates();
int /*<<< orphan*/ test_with_duplicates();
void main() {
  int counter = 0;
  if (!test_empty_input()) {
    printf("Empty input test failed!\n");
    counter++;
  }
  if (!test_no_duplicates()) {
    printf("No duplicates test failed!\n");
    counter++;
  }
  if (!test_with_duplicates()) {
    printf("With duplicates test failed!\n");
    counter++;
  }
  if (!test_only_duplicates()) {
    printf("Only duplicates test failed!\n");
    counter++;
  }
  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   1060 <test_empty_input@plt>
cmp    $0x0,%eax
jne    1186 <main+0x36>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_no_duplicates@plt>
cmp    $0x0,%eax
jne    11ad <main+0x5d>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_with_duplicates@plt>
cmp    $0x0,%eax
jne    11d4 <main+0x84>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_only_duplicates@plt>
cmp    $0x0,%eax
jne    11fb <main+0xab>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe6d(%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   1070 <test_empty_input@plt>
test   %eax,%eax
jne    117f <main+0x1f>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
xor    %eax,%eax
call   1060 <test_no_duplicates@plt>
test   %eax,%eax
jne    1199 <main+0x39>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1080 <test_with_duplicates@plt>
test   %eax,%eax
jne    11b3 <main+0x53>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1050 <test_only_duplicates@plt>
test   %eax,%eax
jne    11cd <main+0x6d>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
lea    0xe2c(%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 = [28 x i8] c"No duplicates test failed!\0A\00"
@.str.2 = [30 x i8] c"With duplicates test failed!\0A\00"
@.str.3 = [30 x i8] c"Only duplicates test failed!\0A\00"
@.str.4 = [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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
br label %8
8: ; preds = %4, %0
%9 = call i32 (...) @test_no_duplicates()
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %15
15: ; preds = %11, %8
%16 = call i32 (...) @test_with_duplicates()
%17 = icmp ne i32 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %1
br label %22
22: ; preds = %18, %15
%23 = call i32 (...) @test_only_duplicates()
%24 = icmp ne i32 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%27 = load i32, i32* %1
%28 = add nsw i32 %27, 1
store i32 %28, i32* %1
br label %29
29: ; preds = %25, %22
%30 = load i32, i32* %1
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %30)
ret void
}

LLVM IR (-O2):
@.str.4 = [18 x i8] c"%d tests failed!\0A\00"
@str = [25 x i8] c"Empty input test failed!\00"
@str.5 = [27 x i8] c"No duplicates test failed!\00"
@str.6 = [29 x i8] c"With duplicates test failed!\00"
@str.7 = [29 x i8] c"Only duplicates 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_no_duplicates()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%11 = add nuw nsw i32 %6, 1
br label %12
12: ; preds = %9, %5
%13 = phi i32 [ %6, %5 ], [ %11, %9 ]
%14 = tail call i32 (...) @test_with_duplicates()
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%18 = add nuw nsw i32 %13, 1
br label %19
19: ; preds = %16, %12
%20 = phi i32 [ %13, %12 ], [ %18, %16 ]
%21 = tail call i32 (...) @test_only_duplicates()
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.7, i64 0, i64 0))
%25 = add nuw nsw i32 %20, 1
br label %26
26: ; preds = %23, %19
%27 = phi i32 [ %20, %19 ], [ %25, %23 ]
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %27)
ret void
}