#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*/ srand(int);
int /*<<< orphan*/ test_genericity();
int /*<<< orphan*/ test_lookup_pop(int);
int /*<<< orphan*/ test_merge_with_push(int);
int /*<<< orphan*/ test_merge_with_update(int);
int /*<<< orphan*/ test_push_pop(int);
int /*<<< orphan*/ test_split(int);
int /*<<< orphan*/ test_unref(int);
int main() {
  srand(10);
  printf("\n*************************\nTesting PUSH - POP  :\n\n");
  test_push_pop(10);
  printf("\n*************************\nTesting LOOKUP - POP  :\n\n");
  test_lookup_pop(10);
  printf("\n*************************\nTesting MERGE (after PUSHes):\n\n");
  test_merge_with_push(10);
  printf("\n*************************\nTesting MERGE (after UPDATEs)  :\n\n");
  test_merge_with_update(10);
  printf("\n*************************\nTesting SPLIT :\n\n");
  test_split(10);
  printf("\n*************************\nTesting UNREF :\n\n");
  test_unref(10);
  printf("\n*************************\nTesting the genericity :\n\n");
  test_genericity();
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1060 <srand@plt>
lea    0xe50(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1050 <test_push_pop@plt>
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1090 <test_lookup_pop@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <test_merge_with_push@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   10b0 <test_merge_with_update@plt>
lea    0xed9(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1080 <test_split@plt>
lea    0xef0(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1070 <test_unref@plt>
lea    0xf07(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   10a0 <test_genericity@plt>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1060 <srand@plt>
lea    0xe5e(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1050 <test_push_pop@plt>
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1090 <test_lookup_pop@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <test_merge_with_push@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   10b0 <test_merge_with_update@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1080 <test_split@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1070 <test_unref@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10a0 <test_genericity@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"\0A*************************\0ATesting PUSH - POP :\0A\0A\00"
@.str.1 = [53 x i8] c"\0A*************************\0ATesting LOOKUP - POP :\0A\0A\00"
@.str.2 = [59 x i8] c"\0A*************************\0ATesting MERGE (after PUSHes):\0A\0A\00"
@.str.3 = [62 x i8] c"\0A*************************\0ATesting MERGE (after UPDATEs) :\0A\0A\00"
@.str.4 = [45 x i8] c"\0A*************************\0ATesting SPLIT :\0A\0A\00"
@.str.5 = [45 x i8] c"\0A*************************\0ATesting UNREF :\0A\0A\00"
@.str.6 = [54 x i8] c"\0A*************************\0ATesting the genericity :\0A\0A\00"
@.str.7 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @srand(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @test_push_pop(i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @test_lookup_pop(i32 10)
%7 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @test_merge_with_push(i32 10)
%9 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @test_merge_with_update(i32 10)
%11 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @test_split(i32 10)
%13 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @test_unref(i32 10)
%15 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 (...) @test_genericity()
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [50 x i8] c"\0A*************************\0ATesting PUSH - POP :\0A\00"
@str.8 = [52 x i8] c"\0A*************************\0ATesting LOOKUP - POP :\0A\00"
@str.9 = [58 x i8] c"\0A*************************\0ATesting MERGE (after PUSHes):\0A\00"
@str.10 = [61 x i8] c"\0A*************************\0ATesting MERGE (after UPDATEs) :\0A\00"
@str.11 = [44 x i8] c"\0A*************************\0ATesting SPLIT :\0A\00"
@str.12 = [44 x i8] c"\0A*************************\0ATesting UNREF :\0A\00"
@str.13 = [53 x i8] c"\0A*************************\0ATesting the genericity :\0A\00"
@str.14 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @srand(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @test_push_pop(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.8, i64 0, i64 0))
%5 = tail call i32 @test_lookup_pop(i32 10)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.9, i64 0, i64 0))
%7 = tail call i32 @test_merge_with_push(i32 10)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.10, i64 0, i64 0))
%9 = tail call i32 @test_merge_with_update(i32 10)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.11, i64 0, i64 0))
%11 = tail call i32 @test_split(i32 10)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.12, i64 0, i64 0))
%13 = tail call i32 @test_unref(i32 10)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.13, i64 0, i64 0))
%15 = tail call i32 (...) @test_genericity()
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
ret i32 0
}