#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 */
struct bplus_tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bplus_tree_dump(struct bplus_tree *);
int /*<<< orphan*/ bplus_tree_put(struct bplus_tree *, int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void bplus_tree_insert_delete_test(struct bplus_tree *tree) {
  int i, max_key = 100;
  fprintf(stderr, "\n> B+tree insertion and deletion testing...\n");
  fprintf(stderr, "\n-- Insert 1 to %d, dump:\n", max_key);
  for (i = 1; i <= max_key; i++) {
    bplus_tree_put(tree, i, i);
  }
  bplus_tree_dump(tree);
  fprintf(stderr, "\n-- Delete 1 to %d, dump:\n", max_key);
  for (i = 1; i <= max_key; i++) {
    bplus_tree_put(tree, i, 0);
  }
  bplus_tree_dump(tree);
  fprintf(stderr, "\n-- Insert 1 to %d, dump:\n", max_key);
  for (i = 1; i <= max_key; i++) {
    bplus_tree_put(tree, i, i);
  }
  bplus_tree_dump(tree);
  fprintf(stderr, "\n-- Delete %d to 1, dump:\n", max_key);
  while (--i > 0) {
    bplus_tree_put(tree, i, 0);
  }
  bplus_tree_dump(tree);
  fprintf(stderr, "\n-- Insert %d to 1, dump:\n", max_key);
  for (i = max_key; i > 0; i--) {
    bplus_tree_put(tree, i, i);
  }
  bplus_tree_dump(tree);
  fprintf(stderr, "\n-- Delete 1 to %d, dump:\n", max_key);
  for (i = 1; i <= max_key; i++) {
    bplus_tree_put(tree, i, 0);
  }
  bplus_tree_dump(tree);
  fprintf(stderr, "\n-- Insert %d to 1, dump:\n", max_key);
  for (i = max_key; i > 0; i--) {
    bplus_tree_put(tree, i, i);
  }
  bplus_tree_dump(tree);
  fprintf(stderr, "\n-- Delete %d to 1, dump:\n", max_key);
  for (i = max_key; i > 0; i--) {
    bplus_tree_put(tree, i, 0);
  }
  bplus_tree_dump(tree);
}


x86 assembly (clang, -O0):
<bplus_tree_insert_delete_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x64,-0x10(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11a4 <bplus_tree_insert_delete_test+0x74>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <bplus_tree_put@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117b <bplus_tree_insert_delete_test+0x4b>
mov    -0x8(%rbp),%rdi
call   1030 <bplus_tree_dump@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11f6 <bplus_tree_insert_delete_test+0xc6>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <bplus_tree_put@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ce <bplus_tree_insert_delete_test+0x9e>
mov    -0x8(%rbp),%rdi
call   1030 <bplus_tree_dump@plt>
mov    0x2dda(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xe1b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1249 <bplus_tree_insert_delete_test+0x119>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <bplus_tree_put@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1220 <bplus_tree_insert_delete_test+0xf0>
mov    -0x8(%rbp),%rdi
call   1030 <bplus_tree_dump@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    1291 <bplus_tree_insert_delete_test+0x161>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <bplus_tree_put@plt>
jmp    126c <bplus_tree_insert_delete_test+0x13c>
mov    -0x8(%rbp),%rdi
call   1030 <bplus_tree_dump@plt>
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xdd1(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    12e1 <bplus_tree_insert_delete_test+0x1b1>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <bplus_tree_put@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    12ba <bplus_tree_insert_delete_test+0x18a>
mov    -0x8(%rbp),%rdi
call   1030 <bplus_tree_dump@plt>
mov    0x2cef(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xd4b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1333 <bplus_tree_insert_delete_test+0x203>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <bplus_tree_put@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    130b <bplus_tree_insert_delete_test+0x1db>
mov    -0x8(%rbp),%rdi
call   1030 <bplus_tree_dump@plt>
mov    0x2c9d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xd2f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1383 <bplus_tree_insert_delete_test+0x253>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <bplus_tree_put@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    135c <bplus_tree_insert_delete_test+0x22c>
mov    -0x8(%rbp),%rdi
call   1030 <bplus_tree_dump@plt>
mov    0x2c4d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xcc4(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    13d2 <bplus_tree_insert_delete_test+0x2a2>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <bplus_tree_put@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    13ac <bplus_tree_insert_delete_test+0x27c>
mov    -0x8(%rbp),%rdi
call   1030 <bplus_tree_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bplus_tree_insert_delete_test>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ea2(%rip),%r14
mov    (%r14),%edi
lea    0xeb8(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xed4(%rip),%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
call   1040 <bplus_tree_put@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    1170 <bplus_tree_insert_delete_test+0x40>
mov    %rbx,%rdi
call   1030 <bplus_tree_dump@plt>
mov    (%r14),%edi
lea    0xeb2(%rip),%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1040 <bplus_tree_put@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    11b0 <bplus_tree_insert_delete_test+0x80>
mov    %rbx,%rdi
call   1030 <bplus_tree_dump@plt>
mov    (%r14),%edi
lea    0xe57(%rip),%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
call   1040 <bplus_tree_put@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    11f0 <bplus_tree_insert_delete_test+0xc0>
mov    %rbx,%rdi
call   1030 <bplus_tree_dump@plt>
mov    (%r14),%edi
lea    0xe4d(%rip),%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x65,%ebp
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1040 <bplus_tree_put@plt>
cmp    $0x1,%ebp
ja     1230 <bplus_tree_insert_delete_test+0x100>
mov    %rbx,%rdi
call   1030 <bplus_tree_dump@plt>
mov    (%r14),%edi
lea    0xe28(%rip),%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x65,%ebp
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
call   1040 <bplus_tree_put@plt>
cmp    $0x1,%ebp
ja     1270 <bplus_tree_insert_delete_test+0x140>
mov    %rbx,%rdi
call   1030 <bplus_tree_dump@plt>
mov    (%r14),%edi
lea    0xdb2(%rip),%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1040 <bplus_tree_put@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    12b0 <bplus_tree_insert_delete_test+0x180>
mov    %rbx,%rdi
call   1030 <bplus_tree_dump@plt>
mov    (%r14),%edi
lea    0xda8(%rip),%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x65,%ebp
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
call   1040 <bplus_tree_put@plt>
cmp    $0x1,%ebp
ja     12f0 <bplus_tree_insert_delete_test+0x1c0>
mov    %rbx,%rdi
call   1030 <bplus_tree_dump@plt>
mov    (%r14),%edi
lea    0xd4d(%rip),%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x65,%ebp
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1040 <bplus_tree_put@plt>
cmp    $0x1,%ebp
ja     1330 <bplus_tree_insert_delete_test+0x200>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <bplus_tree_dump@plt>

LLVM IR (-O0):
%struct.bplus_tree = type { i32 }
@stderr = global i32 0
@.str = [45 x i8] c"\0A> B+tree insertion and deletion testing...\0A\00"
@.str.1 = [27 x i8] c"\0A-- Insert 1 to %d, dump:\0A\00"
@.str.2 = [27 x i8] c"\0A-- Delete 1 to %d, dump:\0A\00"
@.str.3 = [27 x i8] c"\0A-- Delete %d to 1, dump:\0A\00"
@.str.4 = [27 x i8] c"\0A-- Insert %d to 1, dump:\0A\00"
define void @bplus_tree_insert_delete_test(%struct.bplus_tree* %0) {
%2 = alloca %struct.bplus_tree*
%3 = alloca i32
%4 = alloca i32
store %struct.bplus_tree* %0, %struct.bplus_tree** %2
store i32 100, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i32, i32* %4
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %8)
store i32 1, i32* %3
br label %10
10: ; preds = %19, %1
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%16 = load i32, i32* %3
%17 = load i32, i32* %3
%18 = call i32 @bplus_tree_put(%struct.bplus_tree* %15, i32 %16, i32 %17)
br label %19
19: ; preds = %14
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %10
22: ; preds = %10
%23 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%24 = call i32 @bplus_tree_dump(%struct.bplus_tree* %23)
%25 = load i32, i32* @stderr
%26 = load i32, i32* %4
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %26)
store i32 1, i32* %3
br label %28
28: ; preds = %36, %22
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = icmp sle i32 %29, %30
br i1 %31, label %32, label %39
32: ; preds = %28
%33 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%34 = load i32, i32* %3
%35 = call i32 @bplus_tree_put(%struct.bplus_tree* %33, i32 %34, i32 0)
br label %36
36: ; preds = %32
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %28
39: ; preds = %28
%40 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%41 = call i32 @bplus_tree_dump(%struct.bplus_tree* %40)
%42 = load i32, i32* @stderr
%43 = load i32, i32* %4
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %43)
store i32 1, i32* %3
br label %45
45: ; preds = %54, %39
%46 = load i32, i32* %3
%47 = load i32, i32* %4
%48 = icmp sle i32 %46, %47
br i1 %48, label %49, label %57
49: ; preds = %45
%50 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%51 = load i32, i32* %3
%52 = load i32, i32* %3
%53 = call i32 @bplus_tree_put(%struct.bplus_tree* %50, i32 %51, i32 %52)
br label %54
54: ; preds = %49
%55 = load i32, i32* %3
%56 = add nsw i32 %55, 1
store i32 %56, i32* %3
br label %45
57: ; preds = %45
%58 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%59 = call i32 @bplus_tree_dump(%struct.bplus_tree* %58)
%60 = load i32, i32* @stderr
%61 = load i32, i32* %4
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %67, %57
%64 = load i32, i32* %3
%65 = add nsw i32 %64, -1
store i32 %65, i32* %3
%66 = icmp sgt i32 %65, 0
br i1 %66, label %67, label %71
67: ; preds = %63
%68 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%69 = load i32, i32* %3
%70 = call i32 @bplus_tree_put(%struct.bplus_tree* %68, i32 %69, i32 0)
br label %63
71: ; preds = %63
%72 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%73 = call i32 @bplus_tree_dump(%struct.bplus_tree* %72)
%74 = load i32, i32* @stderr
%75 = load i32, i32* %4
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %75)
%77 = load i32, i32* %4
store i32 %77, i32* %3
br label %78
78: ; preds = %86, %71
%79 = load i32, i32* %3
%80 = icmp sgt i32 %79, 0
br i1 %80, label %81, label %89
81: ; preds = %78
%82 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%83 = load i32, i32* %3
%84 = load i32, i32* %3
%85 = call i32 @bplus_tree_put(%struct.bplus_tree* %82, i32 %83, i32 %84)
br label %86
86: ; preds = %81
%87 = load i32, i32* %3
%88 = add nsw i32 %87, -1
store i32 %88, i32* %3
br label %78
89: ; preds = %78
%90 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%91 = call i32 @bplus_tree_dump(%struct.bplus_tree* %90)
%92 = load i32, i32* @stderr
%93 = load i32, i32* %4
%94 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %93)
store i32 1, i32* %3
br label %95
95: ; preds = %103, %89
%96 = load i32, i32* %3
%97 = load i32, i32* %4
%98 = icmp sle i32 %96, %97
br i1 %98, label %99, label %106
99: ; preds = %95
%100 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%101 = load i32, i32* %3
%102 = call i32 @bplus_tree_put(%struct.bplus_tree* %100, i32 %101, i32 0)
br label %103
103: ; preds = %99
%104 = load i32, i32* %3
%105 = add nsw i32 %104, 1
store i32 %105, i32* %3
br label %95
106: ; preds = %95
%107 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%108 = call i32 @bplus_tree_dump(%struct.bplus_tree* %107)
%109 = load i32, i32* @stderr
%110 = load i32, i32* %4
%111 = call i32 (i32, i8*, ...) @fprintf(i32 %109, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %110)
%112 = load i32, i32* %4
store i32 %112, i32* %3
br label %113
113: ; preds = %121, %106
%114 = load i32, i32* %3
%115 = icmp sgt i32 %114, 0
br i1 %115, label %116, label %124
116: ; preds = %113
%117 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%118 = load i32, i32* %3
%119 = load i32, i32* %3
%120 = call i32 @bplus_tree_put(%struct.bplus_tree* %117, i32 %118, i32 %119)
br label %121
121: ; preds = %116
%122 = load i32, i32* %3
%123 = add nsw i32 %122, -1
store i32 %123, i32* %3
br label %113
124: ; preds = %113
%125 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%126 = call i32 @bplus_tree_dump(%struct.bplus_tree* %125)
%127 = load i32, i32* @stderr
%128 = load i32, i32* %4
%129 = call i32 (i32, i8*, ...) @fprintf(i32 %127, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %128)
%130 = load i32, i32* %4
store i32 %130, i32* %3
br label %131
131: ; preds = %138, %124
%132 = load i32, i32* %3
%133 = icmp sgt i32 %132, 0
br i1 %133, label %134, label %141
134: ; preds = %131
%135 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%136 = load i32, i32* %3
%137 = call i32 @bplus_tree_put(%struct.bplus_tree* %135, i32 %136, i32 0)
br label %138
138: ; preds = %134
%139 = load i32, i32* %3
%140 = add nsw i32 %139, -1
store i32 %140, i32* %3
br label %131
141: ; preds = %131
%142 = load %struct.bplus_tree*, %struct.bplus_tree** %2
%143 = call i32 @bplus_tree_dump(%struct.bplus_tree* %142)
ret void
}

LLVM IR (-O2):
%struct.bplus_tree = type { i32 }
@stderr = global i32 0
@.str = [45 x i8] c"\0A> B+tree insertion and deletion testing...\0A\00"
@.str.1 = [27 x i8] c"\0A-- Insert 1 to %d, dump:\0A\00"
@.str.2 = [27 x i8] c"\0A-- Delete 1 to %d, dump:\0A\00"
@.str.3 = [27 x i8] c"\0A-- Delete %d to 1, dump:\0A\00"
@.str.4 = [27 x i8] c"\0A-- Insert %d to 1, dump:\0A\00"
define void @bplus_tree_insert_delete_test(%struct.bplus_tree* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 100)
br label %6
6: ; preds = %1, %6
%7 = phi i32 [ 1, %1 ], [ %9, %6 ]
%8 = tail call i32 @bplus_tree_put(%struct.bplus_tree* %0, i32 %7, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 101
br i1 %10, label %11, label %6
11: ; preds = %6
%12 = tail call i32 @bplus_tree_dump(%struct.bplus_tree* %0)
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 100)
br label %15
15: ; preds = %11, %15
%16 = phi i32 [ 1, %11 ], [ %18, %15 ]
%17 = tail call i32 @bplus_tree_put(%struct.bplus_tree* %0, i32 %16, i32 0)
%18 = add nuw nsw i32 %16, 1
%19 = icmp eq i32 %18, 101
br i1 %19, label %20, label %15
20: ; preds = %15
%21 = tail call i32 @bplus_tree_dump(%struct.bplus_tree* %0)
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 100)
br label %24
24: ; preds = %20, %24
%25 = phi i32 [ 1, %20 ], [ %27, %24 ]
%26 = tail call i32 @bplus_tree_put(%struct.bplus_tree* %0, i32 %25, i32 %25)
%27 = add nuw nsw i32 %25, 1
%28 = icmp eq i32 %27, 101
br i1 %28, label %29, label %24
29: ; preds = %24
%30 = tail call i32 @bplus_tree_dump(%struct.bplus_tree* %0)
%31 = load i32, i32* @stderr
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 100)
br label %33
33: ; preds = %29, %33
%34 = phi i32 [ 100, %29 ], [ %36, %33 ]
%35 = tail call i32 @bplus_tree_put(%struct.bplus_tree* %0, i32 %34, i32 0)
%36 = add nsw i32 %34, -1
%37 = icmp ugt i32 %34, 1
br i1 %37, label %33, label %38
38: ; preds = %33
%39 = tail call i32 @bplus_tree_dump(%struct.bplus_tree* %0)
%40 = load i32, i32* @stderr
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 100)
br label %42
42: ; preds = %38, %42
%43 = phi i32 [ 100, %38 ], [ %45, %42 ]
%44 = tail call i32 @bplus_tree_put(%struct.bplus_tree* %0, i32 %43, i32 %43)
%45 = add nsw i32 %43, -1
%46 = icmp ugt i32 %43, 1
br i1 %46, label %42, label %47
47: ; preds = %42
%48 = tail call i32 @bplus_tree_dump(%struct.bplus_tree* %0)
%49 = load i32, i32* @stderr
%50 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 100)
br label %51
51: ; preds = %47, %51
%52 = phi i32 [ 1, %47 ], [ %54, %51 ]
%53 = tail call i32 @bplus_tree_put(%struct.bplus_tree* %0, i32 %52, i32 0)
%54 = add nuw nsw i32 %52, 1
%55 = icmp eq i32 %54, 101
br i1 %55, label %56, label %51
56: ; preds = %51
%57 = tail call i32 @bplus_tree_dump(%struct.bplus_tree* %0)
%58 = load i32, i32* @stderr
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 100)
br label %60
60: ; preds = %56, %60
%61 = phi i32 [ 100, %56 ], [ %63, %60 ]
%62 = tail call i32 @bplus_tree_put(%struct.bplus_tree* %0, i32 %61, i32 %61)
%63 = add nsw i32 %61, -1
%64 = icmp ugt i32 %61, 1
br i1 %64, label %60, label %65
65: ; preds = %60
%66 = tail call i32 @bplus_tree_dump(%struct.bplus_tree* %0)
%67 = load i32, i32* @stderr
%68 = tail call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 100)
br label %69
69: ; preds = %65, %69
%70 = phi i32 [ 100, %65 ], [ %72, %69 ]
%71 = tail call i32 @bplus_tree_put(%struct.bplus_tree* %0, i32 %70, i32 0)
%72 = add nsw i32 %70, -1
%73 = icmp ugt i32 %70, 1
br i1 %73, label %69, label %74
74: ; preds = %69
%75 = tail call i32 @bplus_tree_dump(%struct.bplus_tree* %0)
ret void
}