#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*/ bench_old_smaz();
int /*<<< orphan*/ bench_random_compressible();
int /*<<< orphan*/ bench_random_compressible_old();
int /*<<< orphan*/ bench_random_old_smaz();
int /*<<< orphan*/ bench_random_trie();
int /*<<< orphan*/ bench_trie_smaz();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_compress_small_out_buff();
int /*<<< orphan*/ test_null_term();
int /*<<< orphan*/ test_random();
int /*<<< orphan*/ test_strings();
int main(void) {
  printf("\n\nTesting result when using too smaller buffer:\n-------------\n");
  test_compress_small_out_buff();
  printf("\n\nTesting null terminators stay there:\n-------------\n");
  test_null_term();
  printf("\n\nTesting a bunch of predefined strings:\n-------------\n");
  test_strings();
  printf("\n\nTesting a bunch of randomly generated strings:\n-------------\n");
  test_random();
  printf("\n\nBenchmarking old smaz with very compressible "
         "data:\n-------------\n");
  bench_random_compressible_old();
  printf("\n\nBenchmarking new smaz with very compressible "
         "data:\n-------------\n");
  bench_random_compressible();
  printf("\n\nBenchmarking old smaz on war of the worlds:\n-------------\n");
  bench_old_smaz();
  printf("\n\nBenchmarking new smaz on war of the worlds:\n-------------\n");
  bench_trie_smaz();
  printf("\n\nBenchmarking old smaz on random data:\n-------------\n");
  bench_random_old_smaz();
  printf("\n\nBenchmarking new smaz on random data:\n-------------\n");
  bench_random_trie();
  printf("\n\nDone.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe3a(%rip),%rdi
call   1090 <printf@plt>
mov    $0x0,%al
call   10d0 <test_compress_small_out_buff@plt>
lea    0xe66(%rip),%rdi
call   1090 <printf@plt>
mov    $0x0,%al
call   1050 <test_null_term@plt>
lea    0xe89(%rip),%rdi
call   1090 <printf@plt>
mov    $0x0,%al
call   1070 <test_strings@plt>
lea    0xeae(%rip),%rdi
call   1090 <printf@plt>
mov    $0x0,%al
call   1030 <test_random@plt>
lea    0xedb(%rip),%rdi
call   1090 <printf@plt>
mov    $0x0,%al
call   10c0 <bench_random_compressible_old@plt>
lea    0xf0c(%rip),%rdi
call   1090 <printf@plt>
mov    $0x0,%al
call   10b0 <bench_random_compressible@plt>
lea    0xf3d(%rip),%rdi
call   1090 <printf@plt>
mov    $0x0,%al
call   1060 <bench_old_smaz@plt>
lea    0xf67(%rip),%rdi
call   1090 <printf@plt>
mov    $0x0,%al
call   1080 <bench_trie_smaz@plt>
lea    0xf91(%rip),%rdi
call   1090 <printf@plt>
mov    $0x0,%al
call   10a0 <bench_random_old_smaz@plt>
lea    0xfb5(%rip),%rdi
call   1090 <printf@plt>
mov    $0x0,%al
call   1040 <bench_random_trie@plt>
lea    0xfd9(%rip),%rdi
call   1090 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe48(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10d0 <test_compress_small_out_buff@plt>
lea    0xe73(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1050 <test_null_term@plt>
lea    0xe95(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1080 <test_strings@plt>
lea    0xeb9(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1030 <test_random@plt>
lea    0xee5(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10c0 <bench_random_compressible_old@plt>
lea    0xf15(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10b0 <bench_random_compressible@plt>
lea    0xf45(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1070 <bench_old_smaz@plt>
lea    0xf6e(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1090 <bench_trie_smaz@plt>
lea    0xf97(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10a0 <bench_random_old_smaz@plt>
lea    0xfba(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1040 <bench_random_trie@plt>
lea    0xfdd(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"\0A\0ATesting result when using too smaller buffer:\0A-------------\0A\00"
@.str.1 = [54 x i8] c"\0A\0ATesting null terminators stay there:\0A-------------\0A\00"
@.str.2 = [56 x i8] c"\0A\0ATesting a bunch of predefined strings:\0A-------------\0A\00"
@.str.3 = [64 x i8] c"\0A\0ATesting a bunch of randomly generated strings:\0A-------------\0A\00"
@.str.4 = [68 x i8] c"\0A\0ABenchmarking old smaz with very compressible data:\0A-------------\0A\00"
@.str.5 = [68 x i8] c"\0A\0ABenchmarking new smaz with very compressible data:\0A-------------\0A\00"
@.str.6 = [61 x i8] c"\0A\0ABenchmarking old smaz on war of the worlds:\0A-------------\0A\00"
@.str.7 = [61 x i8] c"\0A\0ABenchmarking new smaz on war of the worlds:\0A-------------\0A\00"
@.str.8 = [55 x i8] c"\0A\0ABenchmarking old smaz on random data:\0A-------------\0A\00"
@.str.9 = [55 x i8] c"\0A\0ABenchmarking new smaz on random data:\0A-------------\0A\00"
@.str.10 = [9 x i8] c"\0A\0ADone.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test_compress_small_out_buff()
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @test_null_term()
%6 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @test_strings()
%8 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (...) @test_random()
%10 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (...) @bench_random_compressible_old()
%12 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 (...) @bench_random_compressible()
%14 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.6, i64 0, i64 0))
%15 = call i32 (...) @bench_old_smaz()
%16 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 (...) @bench_trie_smaz()
%18 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.8, i64 0, i64 0))
%19 = call i32 (...) @bench_random_old_smaz()
%20 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%21 = call i32 (...) @bench_random_trie()
%22 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [62 x i8] c"\0A\0ATesting result when using too smaller buffer:\0A-------------\00"
@str.11 = [53 x i8] c"\0A\0ATesting null terminators stay there:\0A-------------\00"
@str.12 = [55 x i8] c"\0A\0ATesting a bunch of predefined strings:\0A-------------\00"
@str.13 = [63 x i8] c"\0A\0ATesting a bunch of randomly generated strings:\0A-------------\00"
@str.14 = [67 x i8] c"\0A\0ABenchmarking old smaz with very compressible data:\0A-------------\00"
@str.15 = [67 x i8] c"\0A\0ABenchmarking new smaz with very compressible data:\0A-------------\00"
@str.16 = [60 x i8] c"\0A\0ABenchmarking old smaz on war of the worlds:\0A-------------\00"
@str.17 = [60 x i8] c"\0A\0ABenchmarking new smaz on war of the worlds:\0A-------------\00"
@str.18 = [54 x i8] c"\0A\0ABenchmarking old smaz on random data:\0A-------------\00"
@str.19 = [54 x i8] c"\0A\0ABenchmarking new smaz on random data:\0A-------------\00"
@str.20 = [8 x i8] c"\0A\0ADone.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_compress_small_out_buff()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.11, i64 0, i64 0))
%4 = tail call i32 (...) @test_null_term()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.12, i64 0, i64 0))
%6 = tail call i32 (...) @test_strings()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 (...) @test_random()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.14, i64 0, i64 0))
%10 = tail call i32 (...) @bench_random_compressible_old()
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.15, i64 0, i64 0))
%12 = tail call i32 (...) @bench_random_compressible()
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.16, i64 0, i64 0))
%14 = tail call i32 (...) @bench_old_smaz()
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.17, i64 0, i64 0))
%16 = tail call i32 (...) @bench_trie_smaz()
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.18, i64 0, i64 0))
%18 = tail call i32 (...) @bench_random_old_smaz()
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.19, i64 0, i64 0))
%20 = tail call i32 (...) @bench_random_trie()
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.20, i64 0, i64 0))
ret i32 0
}