#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_binary_heap_destroy();
int /*<<< orphan*/ test_binary_heap_destroy_free();
int /*<<< orphan*/ test_binary_heap_new();
int /*<<< orphan*/ test_binary_heap_peek();
int /*<<< orphan*/ test_binary_heap_pop();
int /*<<< orphan*/ test_binary_heap_push();
int /*<<< orphan*/ test_binary_heap_resize();
int /*<<< orphan*/ test_binary_heap_traverse();
int main(void) {
  printf("\nTESTS BEGIN\n");
  printf("---------------------------------------------------------------------"
         "------\n\n");
  printf("Running test: test_binary_heap_new()");
  test_binary_heap_new();
  printf("    OK\n");
  printf("Running test: test_binary_heap_resize()");
  test_binary_heap_resize();
  printf("    OK\n");
  printf("Running test: test_binary_heap_push()");
  test_binary_heap_push();
  printf("    OK\n");
  printf("Running test: test_binary_heap_pop()");
  test_binary_heap_pop();
  printf("    OK\n");
  printf("Running test: test_binary_heap_peek()");
  test_binary_heap_peek();
  printf("    OK\n");
  printf("Running test: test_binary_heap_traverse()");
  test_binary_heap_traverse();
  printf("    OK\n");
  printf("Running test: test_binary_heap_destroy()");
  test_binary_heap_destroy();
  printf("    OK\n");
  printf("Running test: test_binary_heap_destroy_free()");
  test_binary_heap_destroy_free();
  printf("    OK\n");
  printf("\n-------------------------------------------------------------------"
         "--------\n");
  printf("TESTS END\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe5a(%rip),%rdi
call   1070 <printf@plt>
lea    0xe5c(%rip),%rdi
call   1070 <printf@plt>
lea    0xe9e(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10b0 <test_binary_heap_new@plt>
lea    0xeb0(%rip),%rdi
call   1070 <printf@plt>
lea    0xeac(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1030 <test_binary_heap_resize@plt>
lea    0xe91(%rip),%rdi
call   1070 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1060 <test_binary_heap_push@plt>
lea    0xe72(%rip),%rdi
call   1070 <printf@plt>
lea    0xebc(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10a0 <test_binary_heap_pop@plt>
lea    0xe53(%rip),%rdi
call   1070 <printf@plt>
lea    0xec2(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1080 <test_binary_heap_peek@plt>
lea    0xe34(%rip),%rdi
call   1070 <printf@plt>
lea    0xec9(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1040 <test_binary_heap_traverse@plt>
lea    0xe15(%rip),%rdi
call   1070 <printf@plt>
lea    0xed4(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1050 <test_binary_heap_destroy@plt>
lea    0xdf6(%rip),%rdi
call   1070 <printf@plt>
lea    0xede(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1090 <test_binary_heap_destroy_free@plt>
lea    0xdd7(%rip),%rdi
call   1070 <printf@plt>
lea    0xeed(%rip),%rdi
call   1070 <printf@plt>
lea    0xf2f(%rip),%rdi
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf97(%rip),%rdi
call   1050 <puts@plt>
lea    0xf98(%rip),%rdi
call   1050 <puts@plt>
lea    0xe40(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
call   10c0 <test_binary_heap_new@plt>
lea    0xfc6(%rip),%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xe43(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
call   1030 <test_binary_heap_resize@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xe50(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
call   1070 <test_binary_heap_push@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xe5b(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
call   10b0 <test_binary_heap_pop@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xe65(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
call   1090 <test_binary_heap_peek@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xe70(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
call   1040 <test_binary_heap_traverse@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xe7f(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
call   1060 <test_binary_heap_destroy@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xe8d(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
call   10a0 <test_binary_heap_destroy_free@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xf01(%rip),%rdi
call   1050 <puts@plt>
lea    0xf42(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0ATESTS BEGIN\0A\00"
@.str.1 = [78 x i8] c"---------------------------------------------------------------------------\0A\0A\00"
@.str.2 = [37 x i8] c"Running test: test_binary_heap_new()\00"
@.str.3 = [8 x i8] c" OK\0A\00"
@.str.4 = [40 x i8] c"Running test: test_binary_heap_resize()\00"
@.str.5 = [38 x i8] c"Running test: test_binary_heap_push()\00"
@.str.6 = [37 x i8] c"Running test: test_binary_heap_pop()\00"
@.str.7 = [38 x i8] c"Running test: test_binary_heap_peek()\00"
@.str.8 = [42 x i8] c"Running test: test_binary_heap_traverse()\00"
@.str.9 = [41 x i8] c"Running test: test_binary_heap_destroy()\00"
@.str.10 = [46 x i8] c"Running test: test_binary_heap_destroy_free()\00"
@.str.11 = [78 x i8] c"\0A---------------------------------------------------------------------------\0A\00"
@.str.12 = [11 x i8] c"TESTS END\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @test_binary_heap_new()
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 (...) @test_binary_heap_resize()
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 (...) @test_binary_heap_push()
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 (...) @test_binary_heap_pop()
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 (...) @test_binary_heap_peek()
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
%20 = call i32 (...) @test_binary_heap_traverse()
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%23 = call i32 (...) @test_binary_heap_destroy()
%24 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
%26 = call i32 (...) @test_binary_heap_destroy_free()
%27 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%28 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.11, i64 0, i64 0))
%29 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [37 x i8] c"Running test: test_binary_heap_new()\00"
@.str.4 = [40 x i8] c"Running test: test_binary_heap_resize()\00"
@.str.5 = [38 x i8] c"Running test: test_binary_heap_push()\00"
@.str.6 = [37 x i8] c"Running test: test_binary_heap_pop()\00"
@.str.7 = [38 x i8] c"Running test: test_binary_heap_peek()\00"
@.str.8 = [42 x i8] c"Running test: test_binary_heap_traverse()\00"
@.str.9 = [41 x i8] c"Running test: test_binary_heap_destroy()\00"
@.str.10 = [46 x i8] c"Running test: test_binary_heap_destroy_free()\00"
@str = [13 x i8] c"\0ATESTS BEGIN\00"
@str.13 = [77 x i8] c"---------------------------------------------------------------------------\0A\00"
@str.21 = [7 x i8] c" OK\00"
@str.22 = [77 x i8] c"\0A---------------------------------------------------------------------------\00"
@str.23 = [10 x i8] c"TESTS END\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.13, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @test_binary_heap_new()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 (...) @test_binary_heap_resize()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%10 = tail call i32 (...) @test_binary_heap_push()
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call i32 (...) @test_binary_heap_pop()
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%16 = tail call i32 (...) @test_binary_heap_peek()
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
%19 = tail call i32 (...) @test_binary_heap_traverse()
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
%21 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%22 = tail call i32 (...) @test_binary_heap_destroy()
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
%24 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
%25 = tail call i32 (...) @test_binary_heap_destroy_free()
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.21, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.22, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.23, i64 0, i64 0))
ret i32 0
}