LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/MemTable.cc
// Function: MemTable::get[abi:cxx11](unsigned long)
LsmValue MemTable::get(LsmKey k) {

    Node* p = head;

    while (p) {
        while (p->next && p->next->key < k)
            p = p->next;
        if (p->next && k == p->next->key)
            return p->next->value;
        p = p->down;
    }

    return "";
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rax
testq %rax, %rax
je 0x7209
movq %rax, %rcx
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x7203
cmpq %rdx, (%rax)
jb 0x71e8
testq %rax, %rax
je 0x7203
cmpq %rdx, (%rax)
je 0x7227
movq 0x30(%rcx), %rax
jmp 0x71e3
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x8e13(%rip), %rdx      # 0x1002a
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x561a
movq %rbx, %rax
popq %rbx
retq
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x558a
jmp 0x7222
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/MemTable.cc
// Function: MemTable::del(unsigned long)
bool MemTable::del(LsmKey k) {

    Node* p = head;
    bool find = false;

    while (p) {
        while (p->next && p->next->key < k)
            p = p->next;
        if (p->next && k == p->next->key) {
            if (p->next->value == DELETE_SIGN)
                return false;
            find = true;
            Node *delNode = p->next;
            p->next = delNode->next;
            delete delNode;
        }
        p = p->down;
    }

    while (head && !head->next) {   // delete empty layer
        Node* delHead = head;
        head = head->down;
        delete delHead;
    }

    return find;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x72e0
movq %rsi, %r14
xorl %ebp, %ebp
leaq 0x900f(%rip), %r15      # 0x10279
movq %rdi, %r13
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x72d5
cmpq %r14, (%rdi)
jb 0x726a
testq %rdi, %rdi
je 0x72d5
cmpq %r14, (%rdi)
jne 0x72d5
addq $0x8, %rdi
movq %r15, %rsi
callq 0x30a0
testl %eax, %eax
je 0x7334
movq 0x28(%r13), %r12
movq 0x28(%r12), %rax
movq %rax, 0x28(%r13)
movb $0x1, %bpl
testq %r12, %r12
je 0x72d5
movq 0x8(%r12), %rdi
leaq 0x18(%r12), %rax
cmpq %rax, %rdi
je 0x72c8
movq (%rax), %rsi
incq %rsi
callq 0x3280
movl $0x38, %esi
movq %r12, %rdi
callq 0x3280
movq 0x30(%r13), %rdi
testq %rdi, %rdi
jne 0x726a
jmp 0x7317
xorl %ebp, %ebp
jmp 0x7317
cmpq $0x0, 0x28(%r14)
jne 0x731f
movq 0x30(%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x730a
movq (%rax), %rsi
incq %rsi
callq 0x3280
movl $0x38, %esi
movq %r14, %rdi
callq 0x3280
movq (%rbx), %r14
testq %r14, %r14
jne 0x72e4
andb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x731f
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::KVStore(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
KVStore::KVStore(const std::string &dir): KVStoreAPI(dir)
{
    if (!utils::dirExists(dir))
        utils::mkdir(dir.c_str());

    memTable = make_shared<MemTable>();
    memTableSize = HEADER_SIZE + BLOOM_FILTER_SIZE;
    ssTables = unordered_map<size_t, shared_ptr<vector<SSTPtr>>>();
    ssTables[0] = make_shared<vector<SSTPtr>>();
    timeStamp = 1;

    readAllSSTsFromDisk();
    detectAndHandleOverflow();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xd7ea(%rip), %rax      # 0x15ca8
movq %rax, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
leaq 0x20(%rdi), %r14
leaq 0x50(%rdi), %rax
movq %rax, 0x20(%rdi)
movq $0x1, 0x28(%rdi)
movups %xmm0, 0x30(%rdi)
movl $0x3f800000, 0x40(%rdi) # imm = 0x3F800000
movups %xmm0, 0x48(%rdi)
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rsi), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x558a
movq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %r12
movq %r12, %rsi
callq 0x3220
testl %eax, %eax
sete %al
movl 0x18(%r12), %ebp
shrl $0xe, %ebp
andl $0x1, %ebp
andb %al, %bpl
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x8544
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3280
testb %bpl, %bpl
jne 0x8551
movq (%r15), %rdi
callq 0x86ae
leaq 0x38(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x30(%rsp), %rsi
leaq 0xf(%rsp), %rdx
callq 0xd66e
movaps 0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x30(%rsp)
movq 0x10(%rbx), %rdi
movups %xmm0, 0x8(%rbx)
testq %rdi, %rdi
je 0x858c
callq 0x7d9e
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x859b
callq 0x7d9e
movl $0x2820, 0x18(%rbx)     # imm = 0x2820
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rax
movaps %xmm0, -0x30(%rax)
movaps %xmm0, -0x10(%rax)
movaps %xmm0, -0x20(%rax)
movq $0x0, (%rax)
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x3528
leaq 0x30(%rsp), %rdi
callq 0xd2d6
movl $0x28, %edi
callq 0x3270
movq %rax, %r15
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r15)
leaq 0xd743(%rip), %rax      # 0x15d50
movq %rax, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
xorl %eax, %eax
movq %rax, 0x20(%r15)
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movq %r14, %rdi
callq 0xd740
movq %r15, %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x8(%rax), %rdi
movq %r15, 0x8(%rax)
testq %rdi, %rdi
je 0x864a
callq 0x7d9e
movq $0x1, 0x58(%rbx)
movq %rbx, %rdi
callq 0x8944
movq %rbx, %rdi
callq 0x923a
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
movq %r15, %rdi
callq 0x7d9e
jmp 0x8690
jmp 0x868d
movq %rax, %rdi
callq 0x5208
jmp 0x868d
movq %rax, %r12
movq %r14, %rdi
callq 0xd2d6
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x86a6
callq 0x7d9e
movq %r12, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::detectAndHandleOverflow()
void KVStore::detectAndHandleOverflow() {
    if (levelOverflow(0))
        compact0();

    size_t levelNumber = ssTables.size();
    for (size_t level = 1; level < levelNumber; ++level) {
        uint32_t overflowNumber = levelOverflow(level);
        if (!overflowNumber)
            break;
        compact(level, overflowNumber);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r15
movq $0x0, (%r15)
leaq 0x20(%rdi), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0xe3ca
movq (%rax), %rax
movq 0x8(%rax), %r12
subq (%rax), %r12
movq (%r15), %rax
incq %rax
movq %rax, %xmm1
punpckldq 0x7132(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x713a(%rip), %xmm1     # 0x103c0
shrq $0x4, %r12
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x3210
cvttsd2si %xmm0, %rax
cmpl %eax, %r12d
jle 0x92ad
movq %rbx, %rdi
callq 0xa06a
movq 0x38(%rbx), %rbp
cmpq $0x2, %rbp
jb 0x932a
movl $0x1, %r15d
movq %rsp, %r12
movq %r15, (%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0xe3ca
movq (%rax), %rax
movq 0x8(%rax), %r13
subq (%rax), %r13
shrq $0x4, %r13
movq (%rsp), %rax
incq %rax
movq %rax, %xmm1
punpckldq 0x70bf(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x70c7(%rip), %xmm1     # 0x103c0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x3210
cvttsd2si %xmm0, %rax
subl %eax, %r13d
jle 0x932a
movq %rbx, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0xa2ec
incq %r15
cmpq %r15, %rbp
jne 0x92c0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::put(unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void KVStore::put(uint64_t key, const std::string &s)
{
    if (memTableOverflow(s)) {
        memToDisk();

        // Update states
        memTable->reset();
        memTableSize = HEADER_SIZE + BLOOM_FILTER_SIZE;

        detectAndHandleOverflow();
    }

    memTable->put(key, s);
    memTableSize += (DATA_INDEX_SIZE + s.size());
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl 0x18(%rdi), %eax
addl $0xc, %eax
addq 0x8(%rdx), %rax
cmpq $0x200001, %rax         # imm = 0x200001
jb 0x9438
movq %rbx, %rdi
callq 0x9388
movq 0x8(%rbx), %rdi
callq 0x6e7e
movl $0x2820, 0x18(%rbx)     # imm = 0x2820
movq %rbx, %rdi
callq 0x923a
movq 0x8(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x6f4e
movl 0x8(%r14), %eax
movl 0x18(%rbx), %ecx
addl %ecx, %eax
addl $0xc, %eax
movl %eax, 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::get[abi:cxx11](unsigned long)
std::string KVStore::get(uint64_t key)
{
    LsmValue memValue = memTable->get(key);
    if (memValue == DELETE_SIGN)
        return "";
    if (memValue.length() != 0)
        return memValue;

    LsmValue sstValue = getValueFromDisk(key);
    if (sstValue == DELETE_SIGN)
        return "";
    return sstValue;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x71dc
leaq 0x6ddd(%rip), %rsi      # 0x10279
movq %r12, %rdi
callq 0x30a0
testl %eax, %eax
je 0x94d5
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x94f3
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
leaq 0x38(%rsp), %rcx
movq -0x10(%rcx), %rsi
cmpq %rcx, %rsi
je 0x953b
movq %rsi, (%rbx)
movq 0x38(%rsp), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x9541
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x6b47(%rip), %rdx      # 0x1002a
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x561a
jmp 0x95ab
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x961e
leaq 0x6d6f(%rip), %rsi      # 0x10279
leaq 0x8(%rsp), %rdi
callq 0x30a0
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
testl %eax, %eax
je 0x955a
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x956e
movq %rdx, (%rbx)
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x9574
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, 0x8(%rbx)
movq %rcx, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
jmp 0x95ab
leaq 0x6ac9(%rip), %rdx      # 0x1002a
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x561a
jmp 0x9590
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x95ab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x95c6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x95fa
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x95fa
jmp 0x95f7
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9615
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::del(unsigned long)
bool KVStore::del(uint64_t key)
{
    LsmValue value = get(key);
    bool find = (value.length() != 0) && (value != DELETE_SIGN);
    memTable->put(key, DELETE_SIGN);
    return find;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq *0x8(%rax)
cmpq $0x0, 0x8(%rbx)
je 0x9a32
leaq 0x6858(%rip), %rsi      # 0x10279
leaq 0x28(%rsp), %rdi
callq 0x30a0
testl %eax, %eax
setne %bl
jmp 0x9a34
xorl %ebx, %ebx
movq 0x8(%r15), %r15
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x6830(%rip), %rsi      # 0x10279
leaq 0x6832(%rip), %rdx      # 0x10282
leaq 0x8(%rsp), %rdi
callq 0x561a
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x6f4e
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x9a81
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9a9c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x9ac9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x9ac9
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9ae4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::reset()
void KVStore::reset()
{
    clearDisk();
    memTable->reset();
    memTableSize = HEADER_SIZE + BLOOM_FILTER_SIZE;
    ssTables.clear();
    ssTables[0] = make_shared<vector<SSTPtr>>();
    timeStamp = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x9b9e
movq 0x8(%rbx), %rdi
callq 0x6e7e
movl $0x2820, 0x18(%rbx)     # imm = 0x2820
leaq 0x20(%rbx), %r15
movq %r15, %rdi
callq 0xd2fc
movl $0x28, %edi
callq 0x3270
movq %rax, %r14
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r14)
leaq 0xc215(%rip), %rax      # 0x15d50
movq %rax, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
xorl %eax, %eax
movq %rax, 0x20(%r14)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0xd740
movq %r14, %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x8(%rax), %rdi
movq %r14, 0x8(%rax)
testq %rdi, %rdi
je 0x9b78
callq 0x7d9e
movq $0x1, 0x58(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x7d9e
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::clearDisk()
void KVStore::clearDisk() {
    size_t levelNumber = ssTables.size();
    for (size_t level = 0; level < levelNumber; ++level) {
        vector<SSTPtr> levelSSTs = *ssTables[level];
        for (const auto& sst : levelSSTs)
            utils::rmfile(sst->getFilename().c_str());
        string dir = "./data/level-" + to_string(level);
        utils::rmdir(dir.c_str());
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, 0x10(%rsp)
movq 0x38(%rdi), %rax
movq $0x0, 0x8(%rsp)
movq %rax, 0x58(%rsp)
testq %rax, %rax
je 0x9d85
addq $0x20, 0x10(%rsp)
leaq 0x28(%rsp), %r15
leaq 0x48(%rsp), %r13
leaq 0x60(%rsp), %r14
leaq 0x38(%rsp), %r12
leaq 0x18(%rsp), %rbp
movq %r13, %rbx
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe3ca
movq (%rax), %rsi
movq %r14, %rdi
callq 0xcfe4
movq 0x60(%rsp), %r14
movq 0x68(%rsp), %r13
cmpq %r13, %r14
je 0x9c49
movq (%r14), %rsi
movq %rbp, %rdi
callq 0x5cf4
movq 0x18(%rsp), %rdi
callq 0x3130
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x9c43
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x10, %r14
jmp 0x9c12
movq 0x8(%rsp), %r14
movl $0x1, %esi
cmpq $0xa, %r14
movq %rbx, %r13
jb 0x9cab
movl $0x4, %esi
movq %r14, %rcx
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
cmpq $0x63, %rcx
jbe 0x9ca4
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x9ca9
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x9cab
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x9c6e
addl $-0x3, %esi
jmp 0x9cab
addl $-0x2, %esi
jmp 0x9cab
decl %esi
movl %esi, %esi
movq %r13, 0x38(%rsp)
movq %r12, %rdi
xorl %edx, %edx
callq 0x32c0
movq 0x38(%rsp), %rdi
movl 0x40(%rsp), %esi
movq %r14, %rdx
callq 0x6a22
movl $0xd, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x64ac(%rip), %rcx      # 0x1018d
callq 0x32a0
movq %r15, 0x18(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x60(%rsp), %r14
je 0x9d0e
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0x9d15
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x9d44
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x18(%rsp), %rdi
callq 0x3100
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x9d65
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
movq %r14, %rdi
callq 0xcf40
movq 0x8(%rsp), %rax
incq %rax
movq %rax, 0x8(%rsp)
cmpq 0x58(%rsp), %rax
jb 0x9beb
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9db2
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x9db5
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x9db5
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xcf40
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::levelOverflow(unsigned long)
uint32_t KVStore::levelOverflow(size_t level) {
    int currentNumber = ssTables[level]->size();
    int maxNumber = (uint32_t)pow(2, level + 1);
    int overflowNumber = currentNumber - maxNumber;
    return overflowNumber > 0 ? overflowNumber : 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsp, %rbx
movq %rsi, (%rbx)
addq $0x20, %rdi
movq %rbx, %rsi
callq 0xe3ca
movq (%rax), %rax
movq 0x8(%rax), %r14
subq (%rax), %r14
movq (%rbx), %rax
incq %rax
movq %rax, %xmm1
punpckldq 0x637d(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x6385(%rip), %xmm1     # 0x103c0
shrq $0x4, %r14
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x3210
cvttsd2si %xmm0, %rax
subl %eax, %r14d
xorl %eax, %eax
testl %r14d, %r14d
cmovgl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::compact(unsigned long, unsigned int)
void KVStore::compact(size_t upperLevel, uint32_t overflowNumber) {

    // New the lower level if it does not exist.
    size_t lowerLevel = upperLevel + 1;
    if (!ssTables.count(lowerLevel)) {
        ssTables[lowerLevel] = make_shared<vector<SSTPtr>>();
    }

    // Find the SSTs possessing the smallest time stamps or minimum keys.
    vector<SSTPtr> compactSSTs = getCompactSSTs(upperLevel, overflowNumber);

    // Compact the SSTs one by one.
    for (const auto& compactSST : compactSSTs)
        compactOneSST(compactSST, lowerLevel);

    // Reconstruct the upper level.
    reconstructUpperLevel(upperLevel, compactSSTs);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1(%rsi), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0x20(%rdi), %r12
movq %r12, %rdi
callq 0xe64c
testq %rax, %rax
jne 0xa377
movl $0x28, %edi
callq 0x3270
movq %rax, %r15
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r15)
leaq 0xba13(%rip), %rax      # 0x15d50
movq %rax, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
movq $0x0, 0x20(%r15)
movq %rsp, %rsi
movq %r12, %rdi
callq 0xe3ca
movq %r15, %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x8(%rax), %rdi
movq %r15, 0x8(%rax)
testq %rdi, %rdi
je 0xa377
callq 0x7d9e
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0xaf90
movq (%r12), %r15
movq 0x8(%r12), %r12
cmpq %r12, %r15
je 0xa3af
movq (%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0xb06c
addq $0x10, %r15
jmp 0xa395
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb2c2
leaq 0x8(%rsp), %rdi
callq 0xcf40
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x7d9e
jmp 0xa3f2
jmp 0xa3e5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xcf40
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::sstBinarySearch(std::vector<std::shared_ptr<SSTable>, std::allocator<std::shared_ptr<SSTable>>> const&, unsigned long, unsigned int, unsigned int)
uint32_t KVStore::sstBinarySearch(const vector<SSTPtr> &SSTs, LsmKey key,
                                  uint32_t left, uint32_t right) {
    if (left >= right) {
        if (right && SSTs[right]->getMinKey() > key)
            right--;
        return right;
    }

    uint32_t mid = left + (right - left) / 2;
    LsmKey midMinKey = SSTs[mid]->getMinKey();

    if (key < midMinKey)
        return sstBinarySearch(SSTs, key, left, mid ? mid - 1 : mid);
    if (key > midMinKey)
        return sstBinarySearch(SSTs, key, mid + 1, right);
    return mid;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
movl %ebp, %r12d
subl %r15d, %r12d
jbe 0xa450
shrl %r12d
addl %r15d, %r12d
movq (%r14), %rax
movq %r12, %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rdi
callq 0x6910
cmpq %rbx, %rax
jbe 0xa446
subl $0x1, %r12d
cmovbl %r13d, %r12d
movl %r12d, %ebp
jmp 0xa413
jae 0xa474
incl %r12d
movl %r12d, %r15d
jmp 0xa413
testl %ebp, %ebp
je 0xa471
movl %ebp, %eax
movq (%r14), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rdi
callq 0x6910
cmpq %rax, %rbx
sbbl $0x0, %ebp
movl %ebp, %r12d
jmp 0xa474
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::getCompact0Range(unsigned long&, unsigned long&)
void KVStore::getCompact0Range(LsmKey& minKey, LsmKey& maxKey) {
    vector<SSTPtr> L0SSTs = *ssTables[0];
    minKey = min(min(L0SSTs[0]->getMinKey(), L0SSTs[1]->getMinKey()),
                 L0SSTs[2]->getMinKey());
    maxKey = max(max(L0SSTs[0]->getMaxKey(), L0SSTs[1]->getMaxKey()),
                 L0SSTs[2]->getMaxKey());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
addq $0x20, %rdi
leaq 0x20(%rsp), %rsi
movq $0x0, (%rsi)
callq 0xd740
movq (%rax), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xcfe4
movq (%r15), %rax
movq (%rax), %rdi
callq 0x6910
movq %rax, %r15
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x6910
movq %rax, %r12
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x6910
cmpq %r15, %r12
cmovbq %r12, %r15
cmpq %r15, %rax
cmovbq %rax, %r15
movq %r15, (%r14)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x6916
movq %rax, %r14
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x6916
movq %rax, %r15
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x6916
cmpq %r15, %r14
cmovaq %r14, %r15
cmpq %rax, %r15
cmovbeq %rax, %r15
movq %r15, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0xcf40
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xa55a
jmp 0xa55a
jmp 0xa55a
jmp 0xa55a
jmp 0xa55a
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xcf40
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::getOverlapSSTs(unsigned long, unsigned long, unsigned long, long&, long&)
vector<SSTPtr> KVStore::getOverlapSSTs(LsmKey minKey, LsmKey maxKey, size_t level,
                                       int64_t& minOverlapIndex, int64_t& maxOverlapIndex) {

    vector<SSTPtr> overlapSSTs;

    if (ssTables[level]->empty())
        return overlapSSTs;

    vector<SSTPtr> levelSSTs = *ssTables[level];
    uint32_t length = levelSSTs.size();

    uint32_t leftIndex = sstBinarySearch(levelSSTs, minKey, 0, length - 1);

    if (levelSSTs[leftIndex]->getMaxKey() < minKey)
        if ((leftIndex == length - 1)
            || (leftIndex < length - 1 && levelSSTs[leftIndex+1]->getMinKey() > maxKey))
            return overlapSSTs;

    minOverlapIndex = leftIndex;
    maxOverlapIndex = 1 + sstBinarySearch(levelSSTs, maxKey, 0, length - 1);

    for (uint32_t i = minOverlapIndex; i < maxOverlapIndex; ++i)
        overlapSSTs.push_back(levelSSTs[i]);

    return overlapSSTs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %r8, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
addq $0x20, %r13
movq %r13, %rdi
callq 0xe3ca
movq (%rax), %rax
movq (%rax), %rcx
cmpq 0x8(%rax), %rcx
je 0xa68c
movq %r15, (%rsp)
leaq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0xe3ca
movq (%rax), %rsi
leaq 0x8(%rsp), %rdi
callq 0xcfe4
leaq 0x8(%rsp), %rdi
movq 0x8(%rdi), %r13
subq (%rdi), %r13
shrq $0x4, %r13
decl %r13d
movq %r12, %rsi
xorl %edx, %edx
movl %r13d, %ecx
callq 0xa3fa
movl %eax, %ebp
movl %eax, %r15d
movq 0x8(%rsp), %rax
movq %r15, %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rdi
callq 0x6916
cmpq %r12, %rax
jae 0xa63d
cmpl %r13d, %ebp
je 0xa682
jae 0xa63d
incl %ebp
movq 0x8(%rsp), %rax
shlq $0x4, %rbp
movq (%rax,%rbp), %rdi
callq 0x6910
cmpq (%rsp), %rax
ja 0xa682
movq %r15, (%r14)
leaq 0x8(%rsp), %rdi
movq (%rsp), %rsi
xorl %edx, %edx
movl %r13d, %ecx
callq 0xa3fa
movq 0x60(%rsp), %r15
incl %eax
movq %rax, (%r15)
movl (%r14), %esi
cmpq %rax, %rsi
jae 0xa682
leal 0x1(%rsi), %ebp
shlq $0x4, %rsi
addq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xcea8
movl %ebp, %esi
incl %ebp
cmpq %rsi, (%r15)
jg 0xa668
leaq 0x8(%rsp), %rdi
callq 0xcf40
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa6a0
movq %rax, %r14
jmp 0xa6b4
jmp 0xa6a7
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xcf40
movq %rbx, %rdi
callq 0xcf40
movq %r14, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::getCompactionData[abi:cxx11](std::vector<std::shared_ptr<SSTable>, std::allocator<std::shared_ptr<SSTable>>> const&)
KVPair KVStore::getCompactionData(const vector<SSTPtr>& SSTs) {

    // Sort the SSTs according to their time tokens so that the value of the same key
    // in a newer SST will always overwrite the previous one.

    auto sortByTimeStamp = [](const SSTPtr& sstA, const SSTPtr& sstB) {
        return sstA->getTimeStamp() < sstB->getTimeStamp();
    };

    vector<SSTPtr> tempSSTs(SSTs);
    sort(tempSSTs.begin(), tempSSTs.end(), sortByTimeStamp);

    KVPair sstData;
    for (const auto& sst : tempSSTs)
        sst->getValuesFromDisk(sstData);

    return sstData;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0xcfe4
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0xa747
movq %r14, %r12
subq %r15, %r12
movq %r12, %rax
sarq $0x4, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0xc834
cmpq $0x101, %r12            # imm = 0x101
jl 0xa73c
leaq 0x100(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xcd24
cmpq %r14, %r12
je 0xa747
movq %r12, %rdi
callq 0xcdaf
addq $0x10, %r12
jmp 0xa729
movq %r15, %rdi
movq %r14, %rsi
callq 0xcd24
leaq 0x30(%rbx), %rax
movq %rax, (%rbx)
movq $0x1, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movl $0x3f800000, 0x20(%rbx) # imm = 0x3F800000
movups %xmm0, 0x28(%rbx)
movq (%rsp), %r14
movq 0x8(%rsp), %r15
cmpq %r15, %r14
je 0xa787
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x66ae
addq $0x10, %r14
jmp 0xa771
movq %rsp, %rdi
callq 0xcf40
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xa7a0
movq %rax, %r14
jmp 0xa7b0
movq %rax, %r14
movq %rbx, %rdi
callq 0xd5b2
movq %rsp, %rdi
callq 0xcf40
movq %r14, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::reconstructLowerLevelDisk(long, long, unsigned long)
void KVStore::reconstructLowerLevelDisk(int64_t minOverlapIndex, int64_t maxOverlapIndex, size_t lowerLevel) {

    if (minOverlapIndex == -1 && maxOverlapIndex == -1)
        return;

    vector<SSTPtr> previousSSTs = *ssTables[lowerLevel];
    for (uint32_t i = minOverlapIndex; i < maxOverlapIndex; ++i)
        removeSSTFromDisk(previousSSTs[i]);

}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %rax
andq %rsi, %rax
cmpq $-0x1, %rax
je 0xa827
movq %rdx, %rbx
movq %rsi, %r14
addq $0x20, %rdi
leaq 0x8(%rsp), %rsi
callq 0xe3ca
movq (%rax), %rsi
leaq 0x10(%rsp), %rdi
callq 0xcfe4
movl %r14d, %edi
cmpq %rbx, %rdi
jge 0xa81d
incl %r14d
shlq $0x4, %rdi
addq 0x10(%rsp), %rdi
callq 0xc778
movl %r14d, %edi
incl %r14d
cmpq %rbx, %rdi
jl 0xa804
leaq 0x10(%rsp), %rdi
callq 0xcf40
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xcf40
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::reconstructL0()
void KVStore::reconstructL0() {
    vector<SSTPtr> L0SST = *ssTables[0];
    for (const auto& sst : L0SST)
        removeSSTFromDisk(sst);
    ssTables[0]->clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
addq $0x20, %rbx
movq %rsp, %rsi
movq $0x0, (%rsi)
movq %rbx, %rdi
callq 0xd740
movq (%rax), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xcfe4
movq (%r15), %r14
movq 0x8(%r15), %r15
cmpq %r15, %r14
je 0xaf4a
movq %r14, %rdi
callq 0xc778
addq $0x10, %r14
jmp 0xaf37
movq %rsp, %rsi
movq $0x0, (%rsi)
movq %rbx, %rdi
callq 0xd740
movq (%rax), %rdi
callq 0xd274
leaq 0x8(%rsp), %rdi
callq 0xcf40
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0xaf7a
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xcf40
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::getCompactSSTs(unsigned long, unsigned int)
vector<SSTPtr> KVStore::getCompactSSTs(size_t level, uint32_t overflowNumber) {

    vector<SSTPtr> levelSSTs = *ssTables[level];
    SSTTimeStampPriorComparator sstComparator;
    sort(levelSSTs.begin(), levelSSTs.end(), sstComparator);

    vector<SSTPtr> compactSSTs;
    for (uint32_t i = 0; i < overflowNumber; ++i)
        compactSSTs.push_back(levelSSTs[i]);

    return compactSSTs;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rdx, (%rax)
leaq 0x20(%rsi), %rdi
movq %rax, %rsi
callq 0xe3ca
movq (%rax), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xcfe4
movq (%r15), %r14
movq 0x8(%r15), %r15
cmpq %r15, %r14
je 0xaffc
movq %r15, %rax
subq %r14, %rax
sarq $0x4, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0xeb24
movq %r14, %rdi
movq %r15, %rsi
callq 0xebd7
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
testl %ebp, %ebp
je 0xb031
movl %ebp, %r14d
shlq $0x4, %r14
xorl %r15d, %r15d
movq 0x8(%rsp), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0xcea8
addq $0x10, %r15
cmpq %r15, %r14
jne 0xb018
leaq 0x8(%rsp), %rdi
callq 0xcf40
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0xb059
movq %rax, %r14
movq %rbx, %rdi
callq 0xcf40
leaq 0x8(%rsp), %rdi
callq 0xcf40
movq %r14, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::reconstructUpperLevel(unsigned long, std::vector<std::shared_ptr<SSTable>, std::allocator<std::shared_ptr<SSTable>>> const&)
void KVStore::reconstructUpperLevel(size_t upperLevel, const vector<SSTPtr> &compactSSTs) {
    vector<SSTPtr> levelSSTs = *ssTables[upperLevel];
    for (const auto& compactSST : compactSSTs) {
        auto delIt = find(ssTables[upperLevel]->begin(), ssTables[upperLevel]->end(), compactSST);
        if (delIt != ssTables[upperLevel]->end()) {
            removeSSTFromDisk(*delIt);
            ssTables[upperLevel]->erase(delIt);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r15
movq %rdi, %rbx
movq %rsp, %rax
movq %rsi, (%rax)
addq $0x20, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe3ca
movq (%rax), %rsi
leaq 0x8(%rsp), %rdi
callq 0xcfe4
movq (%r15), %r14
movq 0x8(%r15), %r13
cmpq %r13, %r14
je 0xb372
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe3ca
movq (%rax), %rax
movq (%rax), %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe3ca
movq (%rax), %rax
movq 0x8(%rax), %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0xf779
movq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe3ca
movq (%rax), %rax
cmpq 0x8(%rax), %r12
je 0xb369
movq %r12, %rdi
callq 0xc778
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe3ca
movq (%rax), %rdi
movq %r12, %rsi
callq 0xf818
addq $0x10, %r14
cmpq %r13, %r14
jne 0xb306
leaq 0x8(%rsp), %rdi
callq 0xcf40
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0xb38c
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xcf40
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::getMaxTimeStamp(std::shared_ptr<SSTable> const&, std::vector<std::shared_ptr<SSTable>, std::allocator<std::shared_ptr<SSTable>>> const&)
TimeStamp KVStore::getMaxTimeStamp(const SSTPtr& oneSST, const vector<SSTPtr> &SSTs) {
    TimeStamp maxTimeStamp = oneSST->getTimeStamp();
    for (const auto& SST : SSTs) {
        TimeStamp currentTimeStamp = SST->getTimeStamp();
        if (currentTimeStamp > maxTimeStamp)
            maxTimeStamp = currentTimeStamp;
    }
    return maxTimeStamp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq (%rdi), %rdi
callq 0x690a
movq %rax, %rbx
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0xb43a
movq (%r15), %rdi
callq 0x690a
cmpq %rbx, %rax
cmovaq %rax, %rbx
addq $0x10, %r15
jmp 0xb420
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/xx01cyx[P]LSM-Tree/./SSTable.h
// Function: SSTTimeStampPriorComparator::operator()(std::shared_ptr<SSTable> const&, std::shared_ptr<SSTable> const&)
bool operator() (const SSTPtr& sst1, const SSTPtr& sst2) {
        TimeStamp stamp1 = sst1->getTimeStamp();
        TimeStamp stamp2 = sst2->getTimeStamp();
        LsmKey minKey1 = sst1->getMinKey();
        LsmKey minKey2 = sst2->getMinKey();
        if (stamp1 != stamp2)
            return stamp1 < stamp2;
        return minKey1 < minKey2;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq (%rsi), %rdi
callq 0x690a
movq %rax, %r15
movq (%rbx), %rdi
callq 0x690a
movq %rax, %r12
movq (%r14), %rdi
callq 0x6910
movq %rax, %r14
movq (%rbx), %rdi
callq 0x6910
xorl %ecx, %ecx
cmpq %rax, %r14
setb %cl
xorl %eax, %eax
cmpq %r12, %r15
setb %al
cmovnel %eax, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Computer-Kids-Club[P]screenshare-pro-backend/base64.c
// Function: base64_encode_blockend(char*, base64_encodestate*)
int base64_encode_blockend(char *code_out, base64_encodestate *state_in) {
    char *codechar = code_out;

    switch (state_in->step) {
        case step_B:
            *codechar++ = base64_encode_value(state_in->result);
            *codechar++ = '=';
            *codechar++ = '=';
            break;
        case step_C:
            *codechar++ = base64_encode_value(state_in->result);
            *codechar++ = '=';
            break;
        case step_A:
            break;
    }
    *codechar++ = '\n';

    return codechar - code_out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rsi), %ecx
cmpl $0x2, %ecx
je 0x5dc8
movq %rdi, %rax
cmpl $0x1, %ecx
jne 0x5df0
movsbq 0x4(%rsi), %rax
movb $0x3d, %cl
cmpq $0x3f, %rax
jg 0x5db7
leaq 0x1796(%rip), %rcx      # 0x754a
movb (%rax,%rcx), %cl
movb %cl, (%rdi)
leaq 0x2(%rdi), %rcx
movb $0x3d, 0x1(%rdi)
movl $0x3, %eax
jmp 0x5dea
movsbq 0x4(%rsi), %rcx
movb $0x3d, %al
cmpq $0x3f, %rcx
jg 0x5ddf
leaq 0x176e(%rip), %rax      # 0x754a
movb (%rcx,%rax), %al
leaq 0x1(%rdi), %rcx
movb %al, (%rdi)
movl $0x2, %eax
addq %rdi, %rax
movb $0x3d, (%rcx)
movb $0xa, (%rax)
subl %edi, %eax
incl %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/Computer-Kids-Club[P]screenshare-pro-backend/sha1.c
// Function: SHA1Result(SHA1Context*)
int SHA1Result(SHA1Context *context)
{

    if (context->Corrupted)
    {
        return 0;
    }

    if (!context->Computed)
    {
        SHA1PadMessage(context);
        context->Computed = 1;
    }

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %ebx, %ebx
cmpl $0x0, 0x64(%rdi)
jne 0x627a
movq %rdi, %r14
movl $0x1, %ebx
cmpl $0x0, 0x60(%rdi)
jne 0x627a
movq %r14, %rdi
callq 0x6281
movl $0x1, 0x60(%r14)
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Computer-Kids-Club[P]screenshare-pro-backend/sha1.c
// Function: SHA1PadMessage(SHA1Context*)
void SHA1PadMessage(SHA1Context *context)
{
    /*
     *  Check to see if the current message block is too small to hold
     *  the initial padding bits and length.  If so, we will pad the
     *  block, process it, and then continue padding into a second
     *  block.
     */
    if (context->Message_Block_Index > 55)
    {
        context->Message_Block[context->Message_Block_Index++] = 0x80;
        while(context->Message_Block_Index < 64)
        {
            context->Message_Block[context->Message_Block_Index++] = 0;
        }

        SHA1ProcessMessageBlock(context);

        while(context->Message_Block_Index < 56)
        {
            context->Message_Block[context->Message_Block_Index++] = 0;
        }
    }
    else
    {
        context->Message_Block[context->Message_Block_Index++] = 0x80;
        while(context->Message_Block_Index < 56)
        {
            context->Message_Block[context->Message_Block_Index++] = 0;
        }
    }

    /*
     *  Store the message length as the last 8 octets
     */
    context->Message_Block[56] = (context->Length_High >> 24) & 0xFF;
    context->Message_Block[57] = (context->Length_High >> 16) & 0xFF;
    context->Message_Block[58] = (context->Length_High >> 8) & 0xFF;
    context->Message_Block[59] = (context->Length_High) & 0xFF;
    context->Message_Block[60] = (context->Length_Low >> 24) & 0xFF;
    context->Message_Block[61] = (context->Length_Low >> 16) & 0xFF;
    context->Message_Block[62] = (context->Length_Low >> 8) & 0xFF;
    context->Message_Block[63] = (context->Length_Low) & 0xFF;

    SHA1ProcessMessageBlock(context);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x5c(%rdi), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x5c(%rdi)
cmpq $0x38, %rax
jl 0x62e3
movb $-0x80, 0x1c(%rbx,%rax)
movl 0x5c(%rbx), %eax
cmpl $0x3f, %eax
jg 0x62bc
leal 0x1(%rax), %ecx
movl %ecx, 0x5c(%rbx)
cltq
movb $0x0, 0x1c(%rbx,%rax)
movl 0x5c(%rbx), %eax
cmpl $0x40, %eax
jl 0x62a7
movq %rbx, %rdi
callq 0x639c
movl 0x5c(%rbx), %eax
cmpl $0x37, %eax
jg 0x6305
leal 0x1(%rax), %ecx
movl %ecx, 0x5c(%rbx)
cltq
movb $0x0, 0x1c(%rbx,%rax)
movl 0x5c(%rbx), %eax
cmpl $0x38, %eax
jl 0x62cc
jmp 0x6305
movb $-0x80, 0x1c(%rbx,%rax)
movl 0x5c(%rbx), %eax
cmpl $0x37, %eax
jg 0x6305
leal 0x1(%rax), %ecx
movl %ecx, 0x5c(%rbx)
cltq
movb $0x0, 0x1c(%rbx,%rax)
movl 0x5c(%rbx), %eax
cmpl $0x38, %eax
jl 0x62f0
movl 0x14(%rbx), %eax
movl 0x18(%rbx), %ecx
bswapl %ecx
movl %ecx, 0x54(%rbx)
bswapl %eax
movl %eax, 0x58(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x639c
// File: /workspace/github_cpp_makefile_star2_O1/Computer-Kids-Club[P]screenshare-pro-backend/sha1.c
// Function: SHA1Input(SHA1Context*, unsigned char const*, unsigned int)
void SHA1Input(     SHA1Context         *context,
                    const unsigned char *message_array,
                    unsigned            length)
{
    if (!length)
    {
        return;
    }

    if (context->Computed || context->Corrupted)
    {
        context->Corrupted = 1;
        return;
    }

    while(length-- && !context->Corrupted)
    {
        context->Message_Block[context->Message_Block_Index++] =
                                                (*message_array & 0xFF);

        context->Length_Low += 8;
        /* Force it to 32 bits */
        context->Length_Low &= 0xFFFFFFFF;
        if (context->Length_Low == 0)
        {
            context->Length_High++;
            /* Force it to 32 bits */
            context->Length_High &= 0xFFFFFFFF;
            if (context->Length_High == 0)
            {
                /* Message is too long */
                context->Corrupted = 1;
            }
        }

        if (context->Message_Block_Index == 64)
        {
            SHA1ProcessMessageBlock(context);
        }

        message_array++;
    }
}

// Assembly:
testl %edx, %edx
je 0x6350
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x60(%rdi)
jne 0x6341
cmpl $0x0, 0x64(%rbx)
je 0x6351
movl $0x1, 0x64(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r14
movl %edx, %r15d
xorl %r12d, %r12d
cmpl $0x0, 0x64(%rbx)
jne 0x6348
movb (%r14,%r12), %al
movslq 0x5c(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x5c(%rbx)
movb %al, 0x1c(%rbx,%rcx)
addl $0x8, 0x14(%rbx)
jne 0x6384
incl 0x18(%rbx)
jne 0x6384
movl $0x1, 0x64(%rbx)
cmpl $0x40, 0x5c(%rbx)
jne 0x6392
movq %rbx, %rdi
callq 0x639c
incq %r12
cmpl %r12d, %r15d
jne 0x635a
jmp 0x6348
// File: /workspace/github_cpp_makefile_star2_O1/Computer-Kids-Club[P]screenshare-pro-backend/utils.cpp
// Function: get_file_contents[abi:cxx11](char const*)
std::string get_file_contents(const char *filename) {
    std::ifstream in(filename, std::ios::in | std::ios::binary);
    if (in) {
        return (std::string((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>()));
    }
    throw(errno);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, %rbx
leaq -0x218(%rbp), %r14
movq %r14, %rdi
movl $0xc, %edx
callq 0x2350
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1f8(%rbp,%rax)
jne 0x6645
movq -0x130(%rbp,%rax), %rsi
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x6686
leaq -0x218(%rbp), %rdi
callq 0x2090
movq %rbx, %rax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
movl $0x4, %edi
callq 0x2120
movq %rax, %rbx
callq 0x2030
movl (%rax), %eax
movl %eax, (%rbx)
movq 0x3966(%rip), %rsi      # 0x9fc8
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2310
jmp 0x666e
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O1/Computer-Kids-Club[P]screenshare-pro-backend/websocket.c
// Function: ws_compute_handshake(char const*, char*, unsigned long*)
int ws_compute_handshake(const char *key, char *out, size_t *out_sz) {
    unsigned char *buffer, sha1_output[20];
    char magic[] = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
    SHA1Context ctx;
    base64_encodestate b64_ctx;
    int pos, i;

    // websocket handshake
    size_t key_sz = key ? strlen(key) : 0, buffer_sz = key_sz + sizeof(magic) - 1;
    buffer = (unsigned char *)calloc(buffer_sz, 1);

    // concatenate key and guid in buffer
    memcpy(buffer, key, key_sz);
    memcpy(buffer + key_sz, magic, sizeof(magic) - 1);

    // compute sha-1
    SHA1Reset(&ctx);
    SHA1Input(&ctx, buffer, buffer_sz);
    SHA1Result(&ctx);
    for (i = 0; i < 5; ++i) {  // put in correct byte order before memcpy.
        ctx.Message_Digest[i] = ntohl(ctx.Message_Digest[i]);
    }
    memcpy(sha1_output, (unsigned char *)ctx.Message_Digest, 20);

    // encode `sha1_output' in base 64, into `out'.
    base64_init_encodestate(&b64_ctx);
    pos = base64_encode_block((const char *)sha1_output, 20, out, &b64_ctx);
    base64_encode_blockend(out + pos, &b64_ctx);

    // compute length, without \n
    *out_sz = strlen(out);
    if (out[*out_sz - 1] == '\n')
        (*out_sz)--;

    free(buffer);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, -0x30(%rbp)
movq %rsi, %r14
movq %rdi, %r12
testq %rdi, %rdi
je 0x6a08
movq %r12, %rdi
callq 0x2100
movq %rax, %rbx
jmp 0x6a0a
xorl %ebx, %ebx
leaq 0x24(%rbx), %r13
movl $0x1, %esi
movq %r13, %rdi
callq 0x2170
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x21b0
movaps 0xb7d(%rip), %xmm0      # 0x75b0
movups %xmm0, (%r15,%rbx)
movaps 0xb81(%rip), %xmm0      # 0x75c0
movups %xmm0, 0x10(%r15,%rbx)
movl $0x31314235, 0x20(%r15,%rbx) # imm = 0x31314235
leaq -0xb8(%rbp), %rbx
movq %rbx, %rdi
callq 0x6224
movq %rbx, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x6323
movq %rbx, %rdi
callq 0x624d
xorl %eax, %eax
movl -0xb8(%rbp,%rax,4), %ecx
bswapl %ecx
movl %ecx, -0xb8(%rbp,%rax,4)
incq %rax
cmpq $0x5, %rax
jne 0x6a75
movl -0xa8(%rbp), %eax
leaq -0x50(%rbp), %rbx
movl %eax, 0x10(%rbx)
movups -0xb8(%rbp), %xmm0
movaps %xmm0, (%rbx)
leaq -0x3c(%rbp), %r12
movq %r12, %rdi
callq 0x5c2c
movq %rbx, %rdi
movl $0x14, %esi
movq %r14, %rdx
movq %r12, %rcx
callq 0x5c59
movslq %eax, %rdi
addq %r14, %rdi
movq %r12, %rsi
callq 0x5d8d
movq %r14, %rdi
callq 0x2100
movq -0x30(%rbp), %rcx
movq %rax, (%rcx)
cmpb $0xa, -0x1(%r14,%rax)
jne 0x6aef
decq %rax
movq %rax, (%rcx)
movq %r15, %rdi
callq 0x2260
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: overlap(PolyLine const&, PolyLine const&)
static int orientation(const PointType &p, const PointType &q, const PointType &r)
{
    // See https://www.geeksforgeeks.org/orientation-3-ordered-points/
    // for details of below formula.
    double val =
            (q.y - p.y) * (r.x - q.x) -
            (q.x - p.x) * (r.y - q.y);
  
    if (val == 0.0) return 0;  // colinear
    //if (abs(val) <= 1e-7f) return 0;  // colinear
  
    return (val > 0) ? 1: 2; // clock or counterclock wise
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movss (%rsi), %xmm1
movss 0x4(%rsi), %xmm0
movaps %xmm0, %xmm5
subss 0x4(%rdi), %xmm5
movss 0x8(%rsi), %xmm2
subss %xmm1, %xmm2
movaps %xmm1, %xmm4
subss (%rdi), %xmm4
movss 0xc(%rsi), %xmm3
subss %xmm0, %xmm3
mulss %xmm3, %xmm4
mulss %xmm2, %xmm5
subss %xmm4, %xmm5
xorps %xmm4, %xmm4
ucomiss %xmm4, %xmm5
jne 0x4cfb
jp 0x4cfb
movq %rdi, %r14
subss 0xc(%rdi), %xmm0
subss 0x8(%rdi), %xmm1
mulss %xmm1, %xmm3
mulss %xmm2, %xmm0
subss %xmm3, %xmm0
ucomiss %xmm4, %xmm0
jne 0x4cfb
jp 0x4cfb
movq %rsi, %rbx
leaq 0x8(%r14), %r15
movq %rsi, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2465
movb $0x1, %bpl
testb %al, %al
jne 0x4cfd
leaq 0x8(%rbx), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2465
testb %al, %al
jne 0x4cfd
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2465
testb %al, %al
jne 0x4cfd
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2465
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq