// File: /workspace/github_cpp_makefile_star2_O1/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 $0x2, %edi
jl 0x2348
movq 0x8(%rsi), %rbx
jmp 0x234f
leaq 0x1cb5(%rip), %rbx      # 0x4004
movq 0x4c82(%rip), %r14      # 0x6fd8
leaq 0x1cbd(%rip), %rsi      # 0x401a
movl $0x13, %edx
movq %r14, %rdi
callq 0x2150
testq %rbx, %rbx
je 0x238b
movq %rbx, %rdi
callq 0x2090
movq 0x4c5a(%rip), %rdi      # 0x6fd8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2150
jmp 0x23a3
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x2190
leaq 0x40(%rsp), %rsi
movb $0xa, (%rsi)
movq 0x4c26(%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 0x33a8
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x9c40, %rax           # imm = 0x9C40
jne 0x281f
shrq $0x3, %rax
imull $0xcccccccd, %eax, %ecx # imm = 0xCCCCCCCD
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
xorl %edx, %edx
callq 0x287d
movq 0x4ba8(%rip), %rdi      # 0x6fd8
leaq 0x1c2e(%rip), %rsi      # 0x4065
movl $0xd, %edx
callq 0x2150
movq %rsp, %rdi
movl $0x1, %ebx
movl $0x1, %esi
callq 0x3516
leaq 0x28(%rsp), %r13
leaq 0x18(%rsp), %r15
leaq 0x40(%rsp), %r12
leal -0x1(%rbx), %eax
movq (%rsp), %rbp
movq 0x8(%rsp), %rdx
subq %rbp, %rdx
sarq $0x3, %rdx
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rdx
cmpq %rax, %rdx
jbe 0x250c
leaq (%rax,%rax,4), %r14
movq %r13, 0x18(%rsp)
movq (%rbp,%r14,8), %rsi
movq 0x8(%rbp,%r14,8), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2b4c
leaq (,%r14,8), %rax
addq %rbp, %rax
movl 0x20(%rax), %eax
movl %eax, 0x38(%rsp)
movq %r12, %rdi
leaq 0x42(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %r15, %rcx
callq 0x2c22
testb $0x1, %dl
je 0x24de
incq 0x90(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x24ed
callq 0x2110
movl %ebx, %eax
cmpq %rax, 0x90(%rsp)
jne 0x27a3
incl %ebx
movq %r12, %rdi
callq 0x29d0
jmp 0x2462
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x28f0
movq 0x4ab8(%rip), %rdi      # 0x6fd8
leaq 0x1b5e(%rip), %rsi      # 0x4085
movl $0x11, %edx
callq 0x2150
movq %rsp, %rdi
movl $0x2, %esi
callq 0x3516
movq 0x8(%rsp), %rax
subq (%rsp), %rax
shrq $0x3, %rax
imull $0xcccccccd, %eax, %ebx # imm = 0xCCCCCCCD
decl %ebx
leaq 0x40(%rsp), %r14
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 0x25b2
movslq %ebx, %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x2a3c
movl %ebx, %eax
cmpq %rax, 0x90(%rsp)
jne 0x27c2
decl %ebx
movq %r14, %rdi
callq 0x29d0
jmp 0x2558
shrq %rdx
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x28f0
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 0x287d
movq 0x49e3(%rip), %rdi      # 0x6fd8
leaq 0x1ab3(%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), %rbp
movq 0x8(%rsp), %rdx
subq %rbp, %rdx
sarq $0x3, %rdx
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rdx
cmpq %rbx, %rdx
jbe 0x26d1
leaq (%rbx,%rbx,4), %r14
movq %r13, 0x18(%rsp)
movq (%rbp,%r14,8), %rsi
movq 0x8(%rbp,%r14,8), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2b4c
leaq (,%r14,8), %rax
addq %rbp, %rax
movl 0x20(%rax), %eax
movl %eax, 0x38(%rsp)
movq %r12, %rdi
leaq 0x42(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %r15, %rcx
callq 0x2c22
testb $0x1, %dl
je 0x26a5
incq 0x90(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x26b4
callq 0x2110
incl %ebx
cmpq %rbx, 0x90(%rsp)
jne 0x27e1
movq %r12, %rdi
callq 0x29d0
jmp 0x262e
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x28f0
movq 0x48f3(%rip), %rdi      # 0x6fd8
leaq 0x19d3(%rip), %rsi      # 0x40bf
movl $0xc, %edx
callq 0x2150
movq %rsp, %rdi
movl $0x3, %esi
callq 0x3516
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 0x275d
movl %r14d, %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
leaq (%r15,%r15,4), %rcx
leaq (%rax,%rcx,8), %rsi
movq %rbx, %rdi
callq 0x2a3c
cmpq %r15, 0x90(%rsp)
jne 0x2800
decq %r14
movq %rbx, %rdi
callq 0x29d0
jmp 0x271f
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 0x287d
leaq 0x40(%rsp), %rdi
callq 0x2a70
movq %rsp, %rdi
callq 0x2a9e
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18c9(%rip), %rdi      # 0x4073
leaq 0x1890(%rip), %rsi      # 0x4041
leaq 0x1896(%rip), %rcx      # 0x404e
movl $0x44, %edx
callq 0x20b0
leaq 0x18ce(%rip), %rdi      # 0x4097
leaq 0x1871(%rip), %rsi      # 0x4041
leaq 0x1877(%rip), %rcx      # 0x404e
movl $0x4f, %edx
callq 0x20b0
leaq 0x188b(%rip), %rdi      # 0x4073
leaq 0x1852(%rip), %rsi      # 0x4041
leaq 0x1858(%rip), %rcx      # 0x404e
movl $0x5a, %edx
callq 0x20b0
leaq 0x1890(%rip), %rdi      # 0x4097
leaq 0x1833(%rip), %rsi      # 0x4041
leaq 0x1839(%rip), %rcx      # 0x404e
movl $0x65, %edx
callq 0x20b0
leaq 0x1808(%rip), %rdi      # 0x402e
leaq 0x1814(%rip), %rsi      # 0x4041
leaq 0x181a(%rip), %rcx      # 0x404e
movl $0x3c, %edx
callq 0x20b0
jmp 0x2860
jmp 0x2860
jmp 0x2860
jmp 0x284a
jmp 0x2860
jmp 0x2860
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x2863
callq 0x2110
jmp 0x2863
jmp 0x2860
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2a70
movq %rsp, %rdi
callq 0x2a9e
movq %rbx, %rdi
callq 0x21a0