// File: /workspace/github_cpp_makefile_star2_O3/dlbeer[P]summary_map/test_rbt.cpp
// Function: main
int main(int argc, char **argv)
{
    const char *path = "/usr/share/dict/words";

    if (argc > 1)
	path = argv[1];

    std::cout << "Loading words from " << path << '\n';

    test_vector vec;
    test_map m;

    load_words(path, vec, 1000);
    assert(vec.size() == 1000);
    check_absent(m, vec, 0, vec.size());

    std::cout << "Inserting...\n";
    shuffle(vec, 1);

    for (unsigned int i = 0; i < vec.size(); i++) {
	m.insert(vec[i]);
	assert(m.size() == i + 1);
	m.check();
    }

    check_present(m, vec, 0, vec.size());

    std::cout << "Removing some...\n";
    shuffle(vec, 2);

    for (int i = vec.size() - 1; i >= (signed)vec.size() / 2; i--) {
	m.erase(vec[i].first);
	assert(m.size() == (unsigned)i);
	m.check();
    }

    check_present(m, vec, 0, vec.size() / 2);
    check_absent(m, vec, vec.size() / 2, vec.size());

    std::cout << "Adding some...\n";

    for (unsigned int i = vec.size() / 2; i < vec.size(); i++) {
	m.insert(vec[i]);
	assert(m.size() == i + 1);
	m.check();
    }

    check_present(m, vec, 0, vec.size());

    std::cout << "Removing...\n";
    shuffle(vec, 3);

    for (int i = vec.size() - 1; i >= 0; i--) {
	m.erase(vec[i].first);
	assert(m.size() == (unsigned)i);
	m.check();
    }

    check_absent(m, vec, 0, vec.size());

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
cmpl $0x1, %edi
jle 0x2382
movq 0x8(%rsi), %rbx
movq 0x4c8b(%rip), %r14      # 0x6fd8
leaq 0x1cc6(%rip), %rsi      # 0x401a
movl $0x13, %edx
movq %r14, %rdi
callq 0x2150
testq %rbx, %rbx
jne 0x23a1
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x2190
xorl %ebx, %ebx
jmp 0x23bb
movq 0x4c4f(%rip), %rdi      # 0x6fd8
leaq 0x1c8a(%rip), %rsi      # 0x401a
movl $0x13, %edx
callq 0x2150
leaq 0x1c63(%rip), %rbx      # 0x4004
movq %rbx, %rdi
callq 0x2090
movq 0x4c28(%rip), %rdi      # 0x6fd8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2150
leaq 0x40(%rsp), %rsi
movb $0xa, (%rsi)
movq 0x4c0e(%rip), %rdi      # 0x6fd8
movl $0x1, %edx
callq 0x2150
xorl %eax, %eax
movq %rsp, %rsi
movq %rax, 0x10(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
movl $0x0, 0x10(%rcx)
movups %xmm0, 0x18(%rcx)
movups %xmm0, 0x28(%rcx)
movq %rax, 0x38(%rcx)
movq %rbx, %rdi
movl $0x3e8, %edx            # imm = 0x3E8
callq 0x33dc
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x9c40, %rax           # imm = 0x9C40
jne 0x281e
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
xorl %edx, %edx
movl $0x3e8, %ecx            # imm = 0x3E8
callq 0x287c
movq 0x4b95(%rip), %rdi      # 0x6fd8
leaq 0x1c1b(%rip), %rsi      # 0x4065
movl $0xd, %edx
callq 0x2150
movq %rsp, %rdi
movl $0x1, %ebx
movl $0x1, %esi
callq 0x355c
leaq 0x28(%rsp), %r13
leaq 0x18(%rsp), %r15
leaq 0x40(%rsp), %r12
leal -0x1(%rbx), %eax
movq (%rsp), %r14
movq 0x8(%rsp), %rdx
subq %r14, %rdx
sarq $0x3, %rdx
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rdx
cmpq %rax, %rdx
jbe 0x2513
leaq (%rax,%rax,4), %rbp
movq %r13, 0x18(%rsp)
movq (%r14,%rbp,8), %rsi
movq 0x8(%r14,%rbp,8), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2b60
leaq (%r14,%rbp,8), %rax
movl 0x20(%rax), %eax
movl %eax, 0x38(%rsp)
movq %r12, %rdi
leaq 0x42(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %r15, %rcx
callq 0x2c3c
testb $0x1, %dl
je 0x24e5
incq 0x90(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x24f4
callq 0x2110
movl %ebx, %eax
cmpq %rax, 0x90(%rsp)
jne 0x27a2
incl %ebx
movq %r12, %rdi
callq 0x29de
jmp 0x2475
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x28ef
movq 0x4ab1(%rip), %rdi      # 0x6fd8
leaq 0x1b57(%rip), %rsi      # 0x4085
movl $0x11, %edx
callq 0x2150
movq %rsp, %rdi
movl $0x2, %esi
callq 0x355c
movq 0x8(%rsp), %rax
subq (%rsp), %rax
shrq $0x3, %rax
imull $0xcccccccd, %eax, %ebx # imm = 0xCCCCCCCD
decl %ebx
leaq 0x40(%rsp), %r15
movq (%rsp), %rax
movq 0x8(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rdx
movl %edx, %ecx
shrl $0x1f, %ecx
addl %edx, %ecx
sarl %ecx
cmpl %ecx, %ebx
jl 0x25b9
movslq %ebx, %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rsi
movq %r15, %rdi
callq 0x2a4a
movl %ebx, %eax
cmpq %rax, 0x90(%rsp)
jne 0x27c1
decl %ebx
movq %r15, %rdi
callq 0x29de
jmp 0x255f
shrq %rdx
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x28ef
movq %rsp, %rsi
movq 0x8(%rsi), %rcx
subq (%rsi), %rcx
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rcx
movq %rcx, %rdx
shrq %rdx
leaq 0x40(%rsp), %rdi
callq 0x287c
movq 0x49dc(%rip), %rdi      # 0x6fd8
leaq 0x1aac(%rip), %rsi      # 0x40af
movl $0xf, %edx
callq 0x2150
movq 0x8(%rsp), %rbx
subq (%rsp), %rbx
shrq $0x3, %rbx
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rbx
shrq %rbx
leaq 0x18(%rsp), %r15
leaq 0x40(%rsp), %r12
movl %ebx, %ebx
movq (%rsp), %r14
movq 0x8(%rsp), %rdx
subq %r14, %rdx
sarq $0x3, %rdx
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rdx
cmpq %rbx, %rdx
jbe 0x26d0
leaq (%rbx,%rbx,4), %rbp
movq %r13, 0x18(%rsp)
movq (%r14,%rbp,8), %rsi
movq 0x8(%r14,%rbp,8), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2b60
leaq (%r14,%rbp,8), %rax
movl 0x20(%rax), %eax
movl %eax, 0x38(%rsp)
movq %r12, %rdi
leaq 0x42(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %r15, %rcx
callq 0x2c3c
testb $0x1, %dl
je 0x26a4
incq 0x90(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x26b3
callq 0x2110
incl %ebx
cmpq %rbx, 0x90(%rsp)
jne 0x27e0
movq %r12, %rdi
callq 0x29de
jmp 0x2635
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x28ef
movq 0x48f4(%rip), %rdi      # 0x6fd8
leaq 0x19d4(%rip), %rsi      # 0x40bf
movl $0xc, %edx
callq 0x2150
movq %rsp, %rdi
movl $0x3, %esi
callq 0x355c
movq 0x8(%rsp), %rax
subq (%rsp), %rax
shrq $0x3, %rax
imull $0xcccccccd, %eax, %r14d # imm = 0xCCCCCCCD
decq %r14
leaq 0x40(%rsp), %rbx
movq (%rsp), %rax
testl %r14d, %r14d
js 0x275c
movl %r14d, %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
leaq (%r15,%r15,4), %rcx
leaq (%rax,%rcx,8), %rsi
movq %rbx, %rdi
callq 0x2a4a
cmpq %r15, 0x90(%rsp)
jne 0x27ff
decq %r14
movq %rbx, %rdi
callq 0x29de
jmp 0x271e
movq %rsp, %rsi
movq 0x8(%rsi), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xcccccccd, %ecx, %ecx # imm = 0xCCCCCCCD
leaq 0x40(%rsp), %rdi
xorl %edx, %edx
callq 0x287c
leaq 0x40(%rsp), %rdi
callq 0x2a7e
movq %rsp, %rdi
callq 0x2aac
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18ca(%rip), %rdi      # 0x4073
leaq 0x1891(%rip), %rsi      # 0x4041
leaq 0x1897(%rip), %rcx      # 0x404e
movl $0x44, %edx
callq 0x20b0
leaq 0x18cf(%rip), %rdi      # 0x4097
leaq 0x1872(%rip), %rsi      # 0x4041
leaq 0x1878(%rip), %rcx      # 0x404e
movl $0x4f, %edx
callq 0x20b0
leaq 0x188c(%rip), %rdi      # 0x4073
leaq 0x1853(%rip), %rsi      # 0x4041
leaq 0x1859(%rip), %rcx      # 0x404e
movl $0x5a, %edx
callq 0x20b0
leaq 0x1891(%rip), %rdi      # 0x4097
leaq 0x1834(%rip), %rsi      # 0x4041
leaq 0x183a(%rip), %rcx      # 0x404e
movl $0x65, %edx
callq 0x20b0
leaq 0x1809(%rip), %rdi      # 0x402e
leaq 0x1815(%rip), %rsi      # 0x4041
leaq 0x181b(%rip), %rcx      # 0x404e
movl $0x3c, %edx
callq 0x20b0
jmp 0x285f
jmp 0x285f
jmp 0x285f
jmp 0x2849
jmp 0x285f
jmp 0x285f
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x2862
callq 0x2110
jmp 0x2862
jmp 0x285f
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2a7e
movq %rsp, %rdi
callq 0x2aac
movq %rbx, %rdi
callq 0x21a0