#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*/ expect_cons_bintree_to_make_trees();
int /*<<< orphan*/ expect_insert_bintree_to_work();
int /*<<< orphan*/ expect_iter_bintree_to_work();
int /*<<< orphan*/ expect_map_bintree_to_work();
int /*<<< orphan*/ expect_nil_bintree_can_be_destroyed();
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void bintree_test(int n_repetitions) {
  printf("\tBinary Tree Test Routine");
  for (; n_repetitions > 0; n_repetitions--) {
    expect_nil_bintree_can_be_destroyed();
    expect_cons_bintree_to_make_trees();
    expect_insert_bintree_to_work();
    expect_iter_bintree_to_work();
    expect_map_bintree_to_work();
    printf(".");
    fflush(NULL);
  }
  printf("\n\tBinary Tree Tests Complete.\n");
}


x86 assembly (clang, -O0):
<bintree_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe7e(%rip),%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    11d7 <bintree_test+0x67>
mov    $0x0,%al
call   1070 <expect_nil_bintree_can_be_destroyed@plt>
mov    $0x0,%al
call   1060 <expect_cons_bintree_to_make_trees@plt>
mov    $0x0,%al
call   1090 <expect_insert_bintree_to_work@plt>
mov    $0x0,%al
call   1030 <expect_iter_bintree_to_work@plt>
mov    $0x0,%al
call   1040 <expect_map_bintree_to_work@plt>
lea    0xe5f(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1187 <bintree_test+0x17>
lea    0xe3e(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bintree_test>:
push   %rbx
mov    %edi,%ebx
lea    0xe66(%rip),%rdi
call   1070 <printf@plt>
test   %ebx,%ebx
jle    11ec <bintree_test+0x5c>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1090 <expect_nil_bintree_can_be_destroyed@plt>
xor    %eax,%eax
call   1080 <expect_cons_bintree_to_make_trees@plt>
xor    %eax,%eax
call   10b0 <expect_insert_bintree_to_work@plt>
xor    %eax,%eax
call   1030 <expect_iter_bintree_to_work@plt>
xor    %eax,%eax
call   1060 <expect_map_bintree_to_work@plt>
mov    $0x2e,%edi
call   1040 <putchar@plt>
xor    %edi,%edi
call   10a0 <fflush@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     11b0 <bintree_test+0x20>
lea    0xe27(%rip),%rdi
pop    %rbx
jmp    1050 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\09Binary Tree Test Routine\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [31 x i8] c"\0A\09Binary Tree Tests Complete.\0A\00"
define void @bintree_test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = call i32 (...) @expect_nil_bintree_can_be_destroyed()
%9 = call i32 (...) @expect_cons_bintree_to_make_trees()
%10 = call i32 (...) @expect_insert_bintree_to_work()
%11 = call i32 (...) @expect_iter_bintree_to_work()
%12 = call i32 (...) @expect_map_bintree_to_work()
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @fflush(i32* null)
br label %15
15: ; preds = %7
%16 = load i32, i32* %2
%17 = add nsw i32 %16, -1
store i32 %17, i32* %2
br label %4
18: ; preds = %4
%19 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\09Binary Tree Test Routine\00"
@str = [30 x i8] c"\0A\09Binary Tree Tests Complete.\00"
define void @bintree_test(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %15
4: ; preds = %1, %4
%5 = phi i32 [ %13, %4 ], [ %0, %1 ]
%6 = tail call i32 (...) @expect_nil_bintree_can_be_destroyed()
%7 = tail call i32 (...) @expect_cons_bintree_to_make_trees()
%8 = tail call i32 (...) @expect_insert_bintree_to_work()
%9 = tail call i32 (...) @expect_iter_bintree_to_work()
%10 = tail call i32 (...) @expect_map_bintree_to_work()
%11 = tail call i32 @putchar(i32 46)
%12 = tail call i32 @fflush(i32* null)
%13 = add nsw i32 %5, -1
%14 = icmp ugt i32 %5, 1
br i1 %14, label %4, label %15
15: ; preds = %4, %1
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}