#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*/, char *);
scalar_t__ test_binary_search();
scalar_t__ test_insert_remove();
scalar_t__ test_random();
scalar_t__ test_sort();
int main(int argc, char **argv) {
  int _testnum = 1;
  if ((test_insert_remove())) {
    printf("ok %d - %s\n", _testnum++, "insert and remove");
  } else {
    printf("failed %d - %s\n", _testnum++, "insert and remove");
  };
  if ((test_binary_search())) {
    printf("ok %d - %s\n", _testnum++, "binary search");
  } else {
    printf("failed %d - %s\n", _testnum++, "binary search");
  };
  if ((test_sort())) {
    printf("ok %d - %s\n", _testnum++, "sort");
  } else {
    printf("failed %d - %s\n", _testnum++, "sort");
  };
  if ((test_random())) {
    printf("ok %d - %s\n", _testnum++, "random");
  } else {
    printf("failed %d - %s\n", _testnum++, "random");
  };
  return 0;
}


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   $0x1,-0x14(%rbp)
mov    $0x0,%al
call   1070 <test_insert_remove@plt>
cmp    $0x0,%rax
je     11a1 <main+0x51>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe70(%rip),%rdi
lea    0xe75(%rip),%rdx
call   1040 <printf@plt>
jmp    11bf <main+0x6f>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe6b(%rip),%rdi
lea    0xe52(%rip),%rdx
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <test_binary_search@plt>
cmp    $0x0,%rax
je     11f3 <main+0xa3>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe1e(%rip),%rdi
lea    0xe45(%rip),%rdx
call   1040 <printf@plt>
jmp    1211 <main+0xc1>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe19(%rip),%rdi
lea    0xe22(%rip),%rdx
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <test_sort@plt>
cmp    $0x0,%rax
je     1245 <main+0xf5>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xdcc(%rip),%rdi
lea    0xe01(%rip),%rdx
call   1040 <printf@plt>
jmp    1263 <main+0x113>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xdc7(%rip),%rdi
lea    0xdde(%rip),%rdx
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_random@plt>
cmp    $0x0,%rax
je     1297 <main+0x147>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xd7a(%rip),%rdi
lea    0xdb4(%rip),%rdx
call   1040 <printf@plt>
jmp    12b5 <main+0x165>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xd75(%rip),%rdi
lea    0xd91(%rip),%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <test_insert_remove@plt>
test   %rax,%rax
lea    0xeb9(%rip),%r14
lea    0xe94(%rip),%rbx
mov    %rbx,%rdi
cmove  %r14,%rdi
lea    0xe92(%rip),%rdx
mov    $0x1,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <test_binary_search@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmove  %r14,%rdi
lea    0xe92(%rip),%rdx
mov    $0x2,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <test_sort@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmove  %r14,%rdi
lea    0xe7e(%rip),%rdx
mov    $0x3,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <test_random@plt>
test   %rax,%rax
cmove  %r14,%rbx
lea    0xe64(%rip),%rdx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"ok %d - %s\0A\00"
@.str.1 = [18 x i8] c"insert and remove\00"
@.str.2 = [16 x i8] c"failed %d - %s\0A\00"
@.str.3 = [14 x i8] c"binary search\00"
@.str.4 = [5 x i8] c"sort\00"
@.str.5 = [7 x i8] c"random\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = call i64 (...) @test_insert_remove()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
store i32 %11, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %17
13: ; preds = %2
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %13, %9
%18 = call i64 (...) @test_binary_search()
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
%23 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %28
24: ; preds = %17
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %25, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %24, %20
%29 = call i64 (...) @test_sort()
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
%34 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %39
35: ; preds = %28
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
%38 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %39
39: ; preds = %35, %31
%40 = call i64 (...) @test_random()
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
%45 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %50
46: ; preds = %39
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
%49 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %47, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %50
50: ; preds = %46, %42
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"ok %d - %s\0A\00"
@.str.1 = [18 x i8] c"insert and remove\00"
@.str.2 = [16 x i8] c"failed %d - %s\0A\00"
@.str.3 = [14 x i8] c"binary search\00"
@.str.4 = [5 x i8] c"sort\00"
@.str.5 = [7 x i8] c"random\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @test_insert_remove()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i64 (...) @test_binary_search()
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
%10 = tail call i32 @printf(i8* %9, i32 2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i64 (...) @test_sort()
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
%14 = tail call i32 @printf(i8* %13, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%15 = tail call i64 (...) @test_random()
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
%18 = tail call i32 @printf(i8* %17, i32 4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}