// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x98, %rsp
cmpl $0x2, %edi
jl 0x1305
movq 0x8(%rsi), %rbx
jmp 0x130c
leaq 0x1cf8(%rip), %rbx      # 0x3004
movq 0x4cc5(%rip), %rdi      # 0x5fd8
leaq 0x1d00(%rip), %rsi      # 0x301a
callq 0x1120
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1120
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x1140
movq %rsp, %rsi
andq $0x0, 0x10(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
andl $0x0, 0x10(%rax)
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x28(%rax)
andq $0x0, 0x38(%rax)
movq %rbx, %rdi
movl $0x3e8, %edx            # imm = 0x3E8
callq 0x20e8
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x9c40, %rax           # imm = 0x9C40
jne 0x168e
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
xorl %edx, %edx
movl $0x3e8, %ecx            # imm = 0x3E8
callq 0x16e1
movq 0x4c36(%rip), %rdi      # 0x5fd8
leaq 0x1cbc(%rip), %rsi      # 0x3065
callq 0x1120
movq %rsp, %rdi
pushq $0x1
popq %rbx
movl %ebx, %esi
callq 0x21ec
pushq $0x28
popq %r12
leaq 0x70(%rsp), %r14
leaq 0x18(%rsp), %r15
leal -0x1(%rbx), %ecx
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
cqto
idivq %r12
cmpq %rcx, %rax
jbe 0x141d
imulq $0x28, %rcx, %rax
addq %rax, %rsi
movq %r14, %rdi
callq 0x1834
movq %r15, %rdi
movq %r14, %rsi
callq 0x1814
movq %r14, %rdi
callq 0x10b0
movl %ebx, %eax
cmpq %rax, 0x68(%rsp)
jne 0x1626
incl %ebx
movq %r15, %rdi
callq 0x1852
jmp 0x13c9
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
movl %eax, %edx
callq 0x174e
movq 0x4ba5(%rip), %rdi      # 0x5fd8
leaq 0x1c4b(%rip), %rsi      # 0x3085
callq 0x1120
movq %rsp, %rdi
pushq $0x2
popq %rbx
movl %ebx, %esi
callq 0x21ec
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cqto
idivq %r12
movq %rax, %r14
decl %r14d
leaq 0x18(%rsp), %r15
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
cqto
idivq %r12
movq %rax, %rcx
cltd
idivl %ebx
cmpl %eax, %r14d
jl 0x14ae
movslq %r14d, %rax
imulq $0x28, %rax, %rax
addq %rax, %rsi
movq %r15, %rdi
callq 0x18be
movl %r14d, %eax
cmpq %rax, 0x68(%rsp)
jne 0x163f
decl %r14d
movq %r15, %rdi
callq 0x1852
jmp 0x1465
shrq %rcx
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
movl %ecx, %edx
callq 0x174e
movq %rsp, %rsi
movq 0x8(%rsi), %rax
subq (%rsi), %rax
cqto
idivq %r12
movq %rax, %rdx
shrq %rdx
leaq 0x18(%rsp), %rdi
movl %eax, %ecx
callq 0x16e1
movq 0x4af0(%rip), %rdi      # 0x5fd8
leaq 0x1bc0(%rip), %rsi      # 0x30af
callq 0x1120
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cqto
idivq %r12
movq %rax, %rbx
shrq %rbx
leaq 0x70(%rsp), %r14
leaq 0x18(%rsp), %r15
movl %ebx, %ebx
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
cqto
idivq %r12
cmpq %rbx, %rax
jbe 0x1563
imulq $0x28, %rbx, %rax
addq %rax, %rsi
movq %r14, %rdi
callq 0x1834
movq %r15, %rdi
movq %r14, %rsi
callq 0x1814
movq %r14, %rdi
callq 0x10b0
incl %ebx
cmpq %rbx, 0x68(%rsp)
jne 0x1658
movq %r15, %rdi
callq 0x1852
jmp 0x1512
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
movl %eax, %edx
callq 0x174e
movq 0x4a5f(%rip), %rdi      # 0x5fd8
leaq 0x1b3f(%rip), %rsi      # 0x30bf
callq 0x1120
movq %rsp, %rdi
pushq $0x3
popq %rsi
callq 0x21ec
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cqto
idivq %r12
movl %eax, %r14d
decq %r14
leaq 0x18(%rsp), %rbx
movq (%rsp), %rsi
testl %r14d, %r14d
js 0x15e3
movl %r14d, %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
imulq $0x28, %r15, %rax
addq %rax, %rsi
movq %rbx, %rdi
callq 0x18be
cmpq %r15, 0x68(%rsp)
jne 0x1671
decq %r14
movq %rbx, %rdi
callq 0x1852
jmp 0x15a9
movq %rsp, %rcx
movq 0x8(%rcx), %rax
subq %rsi, %rax
cqto
idivq %r12
leaq 0x18(%rsp), %rdi
movq %rcx, %rsi
xorl %edx, %edx
movl %eax, %ecx
callq 0x16e1
leaq 0x18(%rsp), %rdi
callq 0x18e4
movq %rsp, %rdi
callq 0x190a
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1a46(%rip), %rdi      # 0x3073
leaq 0x1a0d(%rip), %rsi      # 0x3041
leaq 0x1a13(%rip), %rcx      # 0x304e
pushq $0x44
jmp 0x1688
leaq 0x1a51(%rip), %rdi      # 0x3097
leaq 0x19f4(%rip), %rsi      # 0x3041
leaq 0x19fa(%rip), %rcx      # 0x304e
pushq $0x4f
jmp 0x1688
leaq 0x1a14(%rip), %rdi      # 0x3073
leaq 0x19db(%rip), %rsi      # 0x3041
leaq 0x19e1(%rip), %rcx      # 0x304e
pushq $0x5a
jmp 0x1688
leaq 0x1a1f(%rip), %rdi      # 0x3097
leaq 0x19c2(%rip), %rsi      # 0x3041
leaq 0x19c8(%rip), %rcx      # 0x304e
pushq $0x65
popq %rdx
callq 0x10d0
leaq 0x1999(%rip), %rdi      # 0x302e
leaq 0x19a5(%rip), %rsi      # 0x3041
leaq 0x19ab(%rip), %rcx      # 0x304e
pushq $0x3c
jmp 0x1688
jmp 0x16c4
jmp 0x16c4
jmp 0x16c4
jmp 0x16b3
jmp 0x16c4
jmp 0x16c4
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x10b0
jmp 0x16c7
jmp 0x16c4
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x18e4
movq %rsp, %rdi
callq 0x190a
movq %rbx, %rdi
callq 0x11a0