LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x7f32
movq 0x8(%rbx), %rdi
callq 0x5f0c
movl $0x2820, 0x18(%rbx)     # imm = 0x2820
leaq 0x20(%rbx), %r14
movq %r14, %rdi
callq 0xa832
movq %rsp, %rdi
callq 0xa44a
leaq 0x10(%rsp), %rsi
andq $0x0, (%rsi)
movq %r14, %rdi
callq 0xad0a
movq %rsp, %rsi
movq %rax, %rdi
callq 0xb188
leaq 0x8(%rsp), %rdi
callq 0x6932
movq $0x1, 0x58(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6932
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq %rax, 0x8(%rsp)
addq $0x20, %rbx
xorl %eax, %eax
leaq 0x10(%rsp), %r15
leaq 0x48(%rsp), %r12
leaq 0x28(%rsp), %rbp
movq %rax, (%rsp)
cmpq 0x8(%rsp), %rax
jae 0x8005
movq %rbx, %rdi
movq %rsp, %rsi
callq 0xbc36
movq (%rax), %rsi
movq %r15, %rdi
callq 0xa5bc
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %r14
cmpq %r14, %r13
je 0x7fb9
movq (%r13), %rsi
movq %rbp, %rdi
callq 0x533e
movq 0x28(%rsp), %rdi
callq 0x3110
movq %rbp, %rdi
callq 0x34a8
addq $0x10, %r13
jmp 0x7f90
movq (%rsp), %rsi
movq %r12, %rdi
callq 0x5964
movq %rbp, %rdi
leaq 0x61e3(%rip), %rsi      # 0xe1b2
movq %r12, %rdx
callq 0x5940
movq %r12, %rdi
callq 0x34a8
movq 0x28(%rsp), %rdi
callq 0x30d0
movq %rbp, %rdi
callq 0x34a8
movq %r15, %rdi
callq 0xa552
movq (%rsp), %rax
incq %rax
jmp 0x7f61
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x34a8
jmp 0x8028
jmp 0x8025
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa552
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::readSSTFromDisk(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long)
SSTPtr KVStore::readSSTFromDisk(const string& filename, size_t level) {
    SSTHeader sstHeader;
    bool* byteArray = new bool[BLOOM_FILTER_SIZE];
    vector<DataIndex> dataIndexes;

    ifstream sstFile(filename, ios::binary | ios::in);
    if (!sstFile) {
        cerr << "Cannot open file `" << filename << "`." << endl;
        exit(-1);
    }

    sstFile.read((char*)&sstHeader, HEADER_SIZE);
    sstFile.read((char*)byteArray, BLOOM_FILTER_SIZE);

    uint64_t keyNumber = sstHeader.keyNumber;
    for (uint32_t i = 0; i < keyNumber; ++i) {
        DataIndex dataIndex;
        sstFile.read((char*)&dataIndex, DATA_INDEX_SIZE);
        dataIndexes.push_back(dataIndex);
    }

    BloomFilter bloomFilter(byteArray);
    SSTPtr sst = make_shared<SSTable>(level, sstHeader, bloomFilter, dataIndexes);
    return sst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rsi, %r15
movq %rdi, 0x40(%rsp)
movq %rdx, 0x48(%rsp)
movl $0x2800, %edi           # imm = 0x2800
callq 0x3030
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
leaq 0x70(%rsp), %rdi
pushq $0xc
popq %rdx
movq %r15, %rsi
callq 0x33d0
movq 0x70(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x90(%rsp,%rax)
jne 0x8163
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
pushq $0x20
popq %rdx
callq 0x32a0
leaq 0x70(%rsp), %rdi
movl $0x2800, %edx           # imm = 0x2800
movq 0x8(%rsp), %rsi
callq 0x32a0
xorl %ebx, %ebx
movq 0x58(%rsp), %r14
leaq 0x70(%rsp), %r15
leaq 0x10(%rsp), %r12
pushq $0xc
popq %r13
leaq 0x20(%rsp), %rbp
movl %ebx, %eax
cmpq %rax, %r14
jbe 0x8100
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x32a0
movq %rbp, %rdi
movq %r12, %rsi
callq 0x6896
incl %ebx
jmp 0x80dc
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x4cc6
leaq 0x48(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x20(%rsp), %r8
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0xa595
leaq 0x10(%rsp), %rdi
callq 0x4cf4
leaq 0x70(%rsp), %rdi
callq 0x3070
leaq 0x20(%rsp), %rdi
callq 0x5a44
movq %rbx, %rax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xce86(%rip), %rdi      # 0x14ff0
leaq 0x602b(%rip), %rsi      # 0xe19c
callq 0x3230
movq %rax, %rdi
movq %r15, %rsi
callq 0x31e0
leaq 0x6027(%rip), %rsi      # 0xe1af
movq %rax, %rdi
callq 0x3230
movq %rax, %rdi
callq 0x3120
pushq $-0x1
popq %rdi
callq 0x3280
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4cf4
jmp 0x81bb
jmp 0x81b8
movq %rax, %rbx
jmp 0x81c5
jmp 0x81b8
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x3070
leaq 0x20(%rsp), %rdi
callq 0x5a44
movq %rbx, %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xbc36
movq (%rax), %rax
movq 0x8(%rax), %r14
subq (%rax), %r14
movq (%rbx), %rax
incq %rax
movq %rax, %xmm1
punpckldq 0x61a3(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x61ab(%rip), %xmm1     # 0xe3f0
shrq $0x4, %r14
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x31f0
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_O2/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), %r15
movq %r15, %rdi
callq 0xbfd4
testq %rax, %rax
jne 0x84ed
leaq 0x8(%rsp), %rdi
callq 0xa44a
movq %rsp, %rsi
movq %r15, %rdi
callq 0xbc36
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xb188
leaq 0x10(%rsp), %rdi
callq 0x6932
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x9040
movq (%r12), %r15
movq 0x8(%r12), %r12
cmpq %r12, %r15
je 0x8525
movq (%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x90ea
addq $0x10, %r15
jmp 0x850b
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x92d0
leaq 0x8(%rsp), %rdi
callq 0xa552
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x6932
jmp 0x856a
jmp 0x855d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xa552
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8638
shrl %r12d
addl %r15d, %r12d
movq (%r14), %rax
movq %r12, %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rdi
callq 0x57f8
cmpq %rbx, %rax
jbe 0x862e
subl $0x1, %r12d
cmovbl %r13d, %r12d
movl %r12d, %ebp
jmp 0x85fb
jae 0x865c
incl %r12d
movl %r12d, %r15d
jmp 0x85fb
testl %ebp, %ebp
je 0x8659
movl %ebp, %eax
movq (%r14), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rdi
callq 0x57f8
cmpq %rax, %rbx
sbbl $0x0, %ebp
movl %ebp, %r12d
jmp 0x865c
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_O2/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
andq $0x0, (%rsi)
callq 0xad0a
movq (%rax), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5bc
movq (%r15), %rax
movq (%rax), %rdi
callq 0x57f8
movq %rax, %r15
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x57f8
movq %rax, %r12
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x57f8
cmpq %r15, %r12
cmovbq %r12, %r15
cmpq %r15, %rax
cmovbq %rax, %r15
movq %r15, (%r14)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x57fe
movq %rax, %r14
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x57fe
movq %rax, %r15
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x57fe
cmpq %r15, %r14
cmovaq %r14, %r15
cmpq %rax, %r15
cmovbeq %rax, %r15
movq %r15, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0xa552
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x873f
jmp 0x873f
jmp 0x873f
jmp 0x873f
jmp 0x873f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xa552
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/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)
andq $0x0, 0x10(%rdi)
addq $0x20, %r13
movq %r13, %rdi
callq 0xbc36
movq (%rax), %rax
movq (%rax), %rcx
cmpq 0x8(%rax), %rcx
je 0x8808
movq %r15, (%rsp)
leaq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0xbc36
movq (%rax), %rsi
leaq 0x8(%rsp), %rdi
callq 0xa5bc
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 0x85e2
movl %eax, %ebp
movl %eax, %r15d
movq 0x8(%rsp), %rax
movq %r15, %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rdi
callq 0x57fe
cmpq %r12, %rax
jae 0x8838
cmpl %r13d, %ebp
jne 0x881a
leaq 0x8(%rsp), %rdi
callq 0xa552
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jae 0x8838
movq %r15, %rax
shlq $0x4, %rax
movq 0x8(%rsp), %rcx
movq 0x10(%rax,%rcx), %rdi
callq 0x57f8
cmpq (%rsp), %rax
ja 0x87fe
movq %r15, (%r14)
leaq 0x8(%rsp), %rdi
movq (%rsp), %rsi
xorl %edx, %edx
movl %r13d, %ecx
callq 0x85e2
movq 0x60(%rsp), %r15
incl %eax
movq %rax, (%r15)
movl (%r14), %r14d
movl %r14d, %r14d
cmpq %r14, %rax
jle 0x87fe
movq %r14, %rsi
shlq $0x4, %rsi
addq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xa4a8
incl %r14d
movq (%r15), %rax
jmp 0x885b
jmp 0x8881
movq %rax, %r14
jmp 0x8895
jmp 0x8888
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xa552
movq %rbx, %rdi
callq 0xa552
movq %r14, %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xa5bc
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0x8929
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 0x9ee1
cmpq $0x101, %r12            # imm = 0x101
jl 0x891e
leaq 0x100(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xa314
cmpq %r14, %r12
je 0x8929
movq %r12, %rdi
callq 0xa3b4
addq $0x10, %r12
jmp 0x890b
movq %r15, %rdi
movq %r14, %rsi
callq 0xa314
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 0x8969
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x5614
addq $0x10, %r14
jmp 0x8953
movq %rsp, %rdi
callq 0xa552
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x8982
movq %rax, %r14
jmp 0x8992
movq %rax, %r14
movq %rbx, %rdi
callq 0xaa82
movq %rsp, %rdi
callq 0xa552
movq %r14, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8a03
movq %rdx, %rbx
movq %rsi, %r14
addq $0x20, %rdi
leaq 0x8(%rsp), %rsi
callq 0xbc36
movq (%rax), %rsi
leaq 0x10(%rsp), %rdi
callq 0xa5bc
movl %r14d, %r14d
cmpq %rbx, %r14
jge 0x89f9
movq %r14, %rdi
shlq $0x4, %rdi
addq 0x10(%rsp), %rdi
callq 0x9e64
incl %r14d
jmp 0x89db
leaq 0x10(%rsp), %rdi
callq 0xa552
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa552
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/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
andq $0x0, (%rsi)
movq %rbx, %rdi
callq 0xad0a
movq (%rax), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xa5bc
movq (%r15), %r14
movq 0x8(%r15), %r15
cmpq %r15, %r14
je 0x8ffd
movq %r14, %rdi
callq 0x9e64
addq $0x10, %r14
jmp 0x8fea
movq %rsp, %rsi
andq $0x0, (%rsi)
movq %rbx, %rdi
callq 0xad0a
movq (%rax), %rdi
callq 0xa6ee
leaq 0x8(%rsp), %rdi
callq 0xa552
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x902a
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xa552
movq %rbx, %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xbc36
movq (%rax), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xa5bc
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0xc43f
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rbx)
movups %xmm0, (%rbx)
movl %ebp, %r14d
shlq $0x4, %r14
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x90af
movq 0x8(%rsp), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0xa4a8
addq $0x10, %r15
jmp 0x9094
leaq 0x8(%rsp), %rdi
callq 0xa552
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x90d7
movq %rax, %r14
movq %rbx, %rdi
callq 0xa552
leaq 0x8(%rsp), %rdi
callq 0xa552
movq %r14, %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O2/xx01cyx[P]LSM-Tree/kvstore.cc
// Function: KVStore::compactOneSST(std::shared_ptr<SSTable> const&, unsigned long)
void KVStore::compactOneSST(const SSTPtr& sst, size_t lowerLevel) {

    int64_t minOverlapIndex = -1;
    int64_t maxOverlapIndex = -1;
    vector<SSTPtr> overlapSSTs = getOverlapSSTs(sst->getMinKey(), sst->getMaxKey(), lowerLevel,
                                                minOverlapIndex, maxOverlapIndex);

    KVPair data = getCompactionData(sst, overlapSSTs);

    reconstructLowerLevelDisk(minOverlapIndex, maxOverlapIndex, lowerLevel);

    TimeStamp maxTimeStamp = getMaxTimeStamp(sst, overlapSSTs);
    vector<SSTPtr> mergedSSTs;

    if (overlapSSTs.empty())                 // no overlapping
        mergedSSTs.push_back(generateNewSST(sst->getKeys(), data, lowerLevel, maxTimeStamp));
    else                                     // does overlap
        mergedSSTs = mergeAndWriteToDisk(sst, overlapSSTs, maxTimeStamp, data);

    reconstructLowerLevelMemory(minOverlapIndex, maxOverlapIndex, mergedSSTs, lowerLevel);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
leaq 0x78(%rsp), %r15
orq $-0x1, (%r15)
leaq 0x70(%rsp), %rbp
orq $-0x1, (%rbp)
movq (%rsi), %rdi
callq 0x57f8
movq %rax, %r12
movq (%r13), %rdi
callq 0x57fe
movq %rbp, (%rsp)
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
movq %rbx, %r8
movq %r15, %r9
callq 0x8754
leaq 0x80(%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x93a8
movq 0x78(%rsp), %r15
movq 0x70(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x89a2
leaq 0x30(%rsp), %rsi
movq %r13, %rdi
callq 0x940c
movq %rax, %rbp
xorps %xmm0, %xmm0
andq $0x0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x38(%rsp), %rax
je 0x91df
leaq 0x48(%rsp), %rdi
leaq 0x30(%rsp), %rcx
leaq 0x80(%rsp), %r9
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %r8
callq 0x99e2
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %r13
movq %r13, %rsi
callq 0xc3ee
movq %r13, %rdi
callq 0xa552
jmp 0x922d
movq (%r13), %rsi
leaq 0x48(%rsp), %rdi
callq 0x581c
leaq 0x60(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x80(%rsp), %rdx
movq %rbx, %rcx
movq %rbp, %r8
callq 0x944a
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xc2e2
leaq 0x68(%rsp), %rdi
callq 0x6932
leaq 0x48(%rsp), %rdi
callq 0x4be4
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %r8
callq 0x8df0
leaq 0x10(%rsp), %rdi
callq 0xa552
leaq 0x80(%rsp), %rdi
callq 0xaa82
leaq 0x30(%rsp), %rdi
callq 0xa552
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x6932
jmp 0x9288
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x4be4
jmp 0x929b
jmp 0x9298
jmp 0x9298
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa552
jmp 0x92ac
jmp 0x92a9
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xaa82
leaq 0x30(%rsp), %rdi
callq 0xa552
movq %rbx, %rdi
callq 0x3440
movq %rax, %rbx
jmp 0x92b9
// File: /workspace/github_cpp_makefile_star2_O2/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, %r12
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movq %rsi, (%r14)
addq $0x20, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc36
movq (%rax), %rsi
movq %rsp, %rdi
callq 0xa5bc
movq (%r12), %r15
movq 0x8(%r12), %r13
cmpq %r13, %r15
je 0x937c
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc36
movq (%rax), %rax
movq (%rax), %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc36
movq (%rax), %rax
movq 0x8(%rax), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0xd207
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc36
movq (%rax), %rax
cmpq 0x8(%rax), %r12
je 0x9376
movq %r12, %rdi
callq 0x9e64
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc36
movq (%rax), %rdi
movq %r12, %rsi
callq 0xa6f6
addq $0x10, %r15
jmp 0x930e
movq %rsp, %rdi
callq 0xa552
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x9394
movq %rax, %rbx
movq %rsp, %rdi
callq 0xa552
movq %rbx, %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x57f2
movq %rax, %rbx
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0x9440
movq (%r15), %rdi
callq 0x57f2
cmpq %rbx, %rax
cmovaq %rax, %rbx
addq $0x10, %r15
jmp 0x9426
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x57f2
movq %rax, %r15
movq (%rbx), %rdi
callq 0x57f2
movq %rax, %r12
movq (%r14), %rdi
callq 0x57f8
movq %rax, %r14
movq (%rbx), %rdi
callq 0x57f8
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_O2/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 0x59c2
movq %rdi, %rax
cmpl $0x1, %ecx
jne 0x59ef
movsbq 0x4(%rsi), %rax
movb $0x3d, %cl
cmpq $0x3f, %rax
jg 0x59ac
leaq 0x1ba1(%rip), %rcx      # 0x754a
movb (%rax,%rcx), %cl
movb %cl, (%rdi)
leaq 0x2(%rdi), %rcx
movb $0x3d, 0x1(%rdi)
movabsq $0x3, %rax
jmp 0x59e9
movsbq 0x4(%rsi), %rcx
movb $0x3d, %al
cmpq $0x3f, %rcx
jg 0x59d9
leaq 0x1b74(%rip), %rax      # 0x754a
movb (%rcx,%rax), %al
leaq 0x1(%rdi), %rcx
movb %al, (%rdi)
movabsq $0x2, %rax
addq %rdi, %rax
movb $0x3d, (%rcx)
movb $0xa, (%rax)
subl %edi, %eax
incl %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5d49
movq %rdi, %r14
pushq $0x1
popq %rbx
cmpl $0x0, 0x60(%rdi)
jne 0x5d49
movq %r14, %rdi
callq 0x5d50
movl $0x1, 0x60(%r14)
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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)
movb $-0x80, %cl
cmpq $0x37, %rax
jg 0x5d8b
cltq
movb %cl, 0x1c(%rbx,%rax)
movl 0x5c(%rbx), %eax
cmpl $0x37, %eax
jg 0x5db8
leal 0x1(%rax), %ecx
movl %ecx, 0x5c(%rbx)
xorl %ecx, %ecx
jmp 0x5d6b
leal 0x1(%rax), %ecx
movl %ecx, 0x5c(%rbx)
xorl %ecx, %ecx
movb %cl, 0x1c(%rbx,%rax)
movslq 0x5c(%rbx), %rax
cmpq $0x3f, %rax
jle 0x5d83
movq %rbx, %rdi
callq 0x5e4f
movslq 0x5c(%rbx), %rax
cmpq $0x37, %rax
jg 0x5db8
leal 0x1(%rax), %ecx
movl %ecx, 0x5c(%rbx)
movb $0x0, 0x1c(%rbx,%rax)
jmp 0x5da1
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 0x5e4f
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5e03
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x60(%rdi)
jne 0x5df4
cmpl $0x0, 0x64(%rbx)
je 0x5e04
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 %r12d, %r15d
je 0x5dfb
cmpl $0x0, 0x64(%rbx)
jne 0x5dfb
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 0x5e3c
incl 0x18(%rbx)
jne 0x5e3c
movl $0x1, 0x64(%rbx)
cmpl $0x40, 0x5c(%rbx)
jne 0x5e4a
movq %rbx, %rdi
callq 0x5e4f
incq %r12
jmp 0x5e0d
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0xc
popq %rdx
movq %r14, %rdi
callq 0x23b0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1f8(%rbp,%rax)
jne 0x60d6
movq -0x130(%rbp,%rax), %rsi
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
pushq $-0x1
popq %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
movl %edx, %r8d
callq 0x6114
leaq -0x218(%rbp), %rdi
callq 0x20a0
movq %rbx, %rax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x4
popq %rdi
callq 0x2140
movq %rax, %rbx
callq 0x2030
movl (%rax), %eax
movl %eax, (%rbx)
movq 0x4ed7(%rip), %rsi      # 0xafc8
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2370
jmp 0x60fd
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6304
movq %r12, %rdi
callq 0x2100
movq %rax, %rbx
jmp 0x6306
xorl %ebx, %ebx
leaq 0x24(%rbx), %r13
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0x21a0
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x21e0
movaps 0x1283(%rip), %xmm0     # 0x75b0
movups %xmm0, (%r15,%rbx)
movaps 0x1287(%rip), %xmm0     # 0x75c0
movups %xmm0, 0x10(%r15,%rbx)
movl $0x31314235, 0x20(%r15,%rbx) # imm = 0x31314235
leaq -0xb8(%rbp), %rbx
movq %rbx, %rdi
callq 0x5cf8
movq %rbx, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x5dd6
movq %rbx, %rdi
callq 0x5d1e
xorl %eax, %eax
cmpq $0x5, %rax
je 0x638a
movl -0xb8(%rbp,%rax,4), %ecx
bswapl %ecx
movl %ecx, -0xb8(%rbp,%rax,4)
incq %rax
jmp 0x636f
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 0x5824
pushq $0x14
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x5851
movslq %eax, %rdi
addq %r14, %rdi
movq %r12, %rsi
callq 0x5982
movq %r14, %rdi
callq 0x2100
movq -0x30(%rbp), %rcx
movq %rax, (%rcx)
cmpb $0xa, -0x1(%r14,%rax)
jne 0x63e9
decq %rax
movq %rax, (%rcx)
movq %r15, %rdi
callq 0x2270
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_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: between(vec const&, vec const&, vec const&)
static bool between(const PointType &p, const PointType &a, const PointType &b)
{
    // if this point is not collinear with a and b
    // then it cannot be between this two points
    if (!collinearVecs(p, a, b))
        return false;
    
    auto &_x = p.x;
    auto &_y = p.y;
    
    return
        ((a.x <= _x && _x <= b.x) && (a.y <= _y && _y <= b.y)) ||
        ((b.x <= _x && _x <= a.x) && (b.y <= _y && _y <= a.y));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
callq 0x743b
testb %al, %al
je 0x23ee
movss (%rbx), %xmm2
movss (%r15), %xmm0
ucomiss %xmm2, %xmm0
movss (%r14), %xmm1
jb 0x23d5
ucomiss %xmm0, %xmm1
jb 0x23d5
movss 0x4(%r15), %xmm3
ucomiss 0x4(%rbx), %xmm3
jb 0x23d5
movss 0x4(%r14), %xmm4
movb $0x1, %al
ucomiss %xmm3, %xmm4
jae 0x23f0
xorl %eax, %eax
ucomiss %xmm0, %xmm2
jb 0x23f0
ucomiss %xmm1, %xmm0
jb 0x23f0
movss 0x4(%r15), %xmm0
ucomiss 0x4(%r14), %xmm0
jae 0x23f6
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movss 0x4(%rbx), %xmm1
ucomiss %xmm0, %xmm1
setae %al
jmp 0x23f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: doIntersect(vec const&, vec const&, vec const&, vec const&)
static bool doIntersect(const PointType &p1, const PointType &q1, const PointType &p2, const PointType &q2)
{
    // Find the four orientations needed for general and
    // special cases
    int o1 = orientation(p1, q1, p2);
    int o2 = orientation(p1, q1, q2);
    int o3 = orientation(p2, q2, p1);
    int o4 = orientation(p2, q2, q1);
  
    // General case
    if (o1 != o2 && o3 != o4)
        return true;
  
    // Special Cases
    // p1, q1 and p2 are colinear and p2 lies on segment p1q1
    if (o1 == 0 && onSegment(p1, p2, q1)) return true;
  
    // p1, q1 and q2 are colinear and q2 lies on segment p1q1
    if (o2 == 0 && onSegment(p1, q2, q1)) return true;
  
    // p2, q2 and p1 are colinear and p1 lies on segment p2q2
    if (o3 == 0 && onSegment(p2, p1, q2)) return true;
  
     // p2, q2 and q1 are colinear and q1 lies on segment p2q2
    if (o4 == 0 && onSegment(p2, q1, q2)) return true;
  
    return false; // Doesn't fall in any of the above cases
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %rbp
movq %rdi, %r12
callq 0x7448
movl %eax, 0x14(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x7448
movl %eax, %r15d
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x7448
movl %eax, %ebx
movq %r14, 0x8(%rsp)
movq %r14, %rdi
movq %rbp, %r14
movq %r13, (%rsp)
movq %r13, %rsi
movq %rbp, %rdx
callq 0x7448
movl 0x14(%rsp), %edi
movl %eax, %esi
cmpl %r15d, %edi
setne %al
movl %ebx, 0x10(%rsp)
cmpl %esi, %ebx
setne %cl
movb $0x1, %dl
testb %cl, %al
jne 0x250d
testl %edi, %edi
jne 0x24b0
movq %r12, %rdi
movl %esi, %ebp
movq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0x7490
movl %ebp, %esi
movb $0x1, %dl
testb %al, %al
jne 0x250d
testl %r15d, %r15d
jne 0x24ce
movq %r12, %rdi
movl %esi, %ebp
movq (%rsp), %rsi
movq %r14, %rdx
callq 0x7490
movl %ebp, %esi
movb $0x1, %dl
testb %al, %al
jne 0x250d
cmpl $0x0, 0x10(%rsp)
jne 0x24f0
movq 0x8(%rsp), %rdi
movl %esi, %ebp
movq %r12, %rsi
movq (%rsp), %rdx
callq 0x7490
movl %ebp, %esi
movb $0x1, %dl
testb %al, %al
jne 0x250d
testl %esi, %esi
jne 0x250b
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq (%rsp), %rdx
callq 0x7490
movb $0x1, %dl
testb %al, %al
jne 0x250d
xorl %edx, %edx
movl %edx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: iComparePointOrder(vec const&, vec const&)
static int iComparePointOrder(const PointType &p1, const PointType &p2)
{
    if (p1.y < p2.y)
        return -1;
    else if (p1.y == p2.y)
    {
        if (p1.x < p2.x)
            return -1;
        else if (p1.x == p2.x)
            return 0;
    }
    // p1 is greater than p2
    return 1;
}

// Assembly:
movss 0x4(%rdi), %xmm0
movss 0x4(%rsi), %xmm1
pushq $-0x1
popq %rax
ucomiss %xmm0, %xmm1
ja 0x2714
ucomiss %xmm1, %xmm0
jne 0x2715
jp 0x2715
movss (%rdi), %xmm0
movss (%rsi), %xmm1
ucomiss %xmm0, %xmm1
ja 0x2714
xorl %eax, %eax
ucomiss %xmm1, %xmm0
jne 0x2715
jp 0x2715
retq
pushq $0x1
popq %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyLine::HasCommonIdxPoints(PolyLine const&) const
bool PolyLine::HasCommonIdxPoints(const PolyLine &line) const
{
    return
        aIdx == line.aIdx ||
        aIdx == line.bIdx ||
        bIdx == line.aIdx ||
        bIdx == line.bIdx;
}

// Assembly:
movl 0x80(%rdi), %r8d
movl 0x80(%rsi), %ecx
movb $0x1, %al
cmpl %ecx, %r8d
je 0x274b
movl 0x84(%rsi), %edx
cmpl %edx, %r8d
je 0x274b
movl 0x84(%rdi), %eax
cmpl %ecx, %eax
sete %cl
cmpl %edx, %eax
sete %al
orb %cl, %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyDetector::newLine(unsigned int, unsigned int, PolyLine&)
PolyLine PolyDetector::newLine(uint32_t i, uint32_t j, PolyLine &origLine)
{
    PolyLine l;
    
    l.aIdx = origLine.intersections[i];
    l.bIdx = origLine.intersections[j];
    l.a = intersectionPoints[l.aIdx];
    l.b = intersectionPoints[l.bIdx];
    l.origLine = origLine.id;
    l.lastDissolveStep = origLine.lastDissolveStep;
    l.attr0 = origLine.attr0;
    l.calcCenter();
    
    return l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %r14
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
callq 0x86f0
movl %r15d, %eax
movq 0x10(%r14), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x80(%rbx)
movl %ebp, %edx
movl (%rcx,%rdx,4), %ecx
movl %ecx, 0x84(%rbx)
movq 0xc8(%r12), %rdx
movq (%rdx,%rax,8), %rax
movq %rax, (%rbx)
movq (%rdx,%rcx,8), %rax
movq %rax, 0x8(%rbx)
movl 0x60(%r14), %eax
movl %eax, 0x6c(%rbx)
movl 0x88(%r14), %eax
movl %eax, 0x88(%rbx)
movl 0x70(%r14), %eax
movl %eax, 0x70(%rbx)
movq %rbx, %rdi
callq 0x2868
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyLine::calcCenter()
void PolyLine::calcCenter()
{
    CalculateFirstAndLastPoint();
    center = a;
    center.add(b);
    center.mul(0.5f);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x4530
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
addps %xmm0, %xmm1
mulps 0xa79c(%rip), %xmm1     # 0xd020
movlps %xmm1, 0x58(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyDetector::RemoveZeroLengthLines()
void PolyDetector::RemoveZeroLengthLines(void)
{
    for (auto it = origLines.begin(); it != origLines.end(); )
    {
        if (!pointsDiffer(it->a, it->b)) // find a zero length line
            it = origLines.erase(it);
        else
            ++it;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movq 0x18(%rdi), %rax
movss 0xa143(%rip), %xmm2     # 0xd060
cmpq 0x20(%rbx), %rax
je 0x2f5c
movss (%rax), %xmm0
subss 0x8(%rax), %xmm0
movss 0x4(%rax), %xmm1
subss 0xc(%rax), %xmm1
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
ucomiss %xmm2, %xmm0
jb 0x2f4f
addq $0x90, %rax
jmp 0x2f1d
movq %r14, %rdi
movq %rax, %rsi
callq 0x8758
jmp 0x2f15
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyDetector::addPointToLine(unsigned int, unsigned int)
bool PolyDetector::addPointToLine(uint32_t pid, uint32_t lid)
{
    auto &v = pointToLines[pid];
    if (std::find(v.begin(), v.end(), lid) == v.end())
    {
        v.push_back(lid);
        return true;
    }
    return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rax
movl %esi, (%rax)
leaq 0x8(%rsp), %r14
movl %edx, (%r14)
addq $0xe0, %rdi
movq %rax, %rsi
callq 0x875e
movq %rax, %rbx
movq (%rax), %rdi
movq 0x8(%rax), %rsi
movq %r14, %rdx
callq 0x9d20
movq %rax, %r14
movq 0x8(%rbx), %r15
cmpq %r15, %rax
jne 0x4520
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x87ac
cmpq %r15, %r14
sete %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyLine::CalculateFirstAndLastPoint()
void PolyLine::CalculateFirstAndLastPoint()
{
    if (!bComparePointOrder(a, b))
    {
        std::swap(a.x, b.x);
        std::swap(a.y, b.y);
        
        std::swap(aIdx, bIdx);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x8(%rdi), %rsi
callq 0x4562
testb %al, %al
jne 0x4560
movups (%rbx), %xmm0
shufps $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movups %xmm0, (%rbx)
movq 0x80(%rbx), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x80(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyDetector::SortLines()
void PolyDetector::SortLines(void)
{
    for (auto &line : lines)
    {
        if (!line.ignore)
            line.CalculateFirstAndLastPoint();
    }
    std::sort(lines.begin(), lines.end(), PolyLine::bCompareLineOrder);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %r14
movq 0x38(%rdi), %r15
cmpq %r15, %r14
je 0x459b
cmpb $0x0, 0x74(%r14)
jne 0x4592
movq %r14, %rdi
callq 0x4530
addq $0x90, %r14
jmp 0x457e
movq 0x30(%rbx), %rdi
movq 0x38(%rbx), %rsi
leaq -0x1fae(%rip), %rdx     # 0x25fc
popq %rbx
popq %r14
popq %r15
jmp 0x9f12
// File: /workspace/github_cpp_makefile_star2_O2/realuptime[P]PolyDetector/PolyDetector.cpp
// Function: PolyLine::neighToString[abi:cxx11](PolyDetector&, unsigned int*) const
std::string PolyLine::neighToString(PolyDetector &pd, uint32_t *retNNeigh) const
{
    auto search = pd._neighbors.find(id);
    if (search == pd._neighbors.end())
        return "[]";
    std::string str;
    uint32_t nNeigh = 0;
    for (auto &n : search->second)
    {
        auto l = pd.findLine(n);
        if (l)
        {
            str += std::to_string(n) + " ";
            nNeigh++;
        }
    }
    if (!str.empty())
        str.pop_back();
    if (retNNeigh)
        *retNNeigh = nNeigh;
    return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
leaq 0x68(%rdx), %rdi
addq $0x60, %rsi
callq 0xac48
leaq 0x70(%r15), %rcx
cmpq %rcx, %rax
je 0x4690
movq %r14, 0x10(%rsp)
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
andq $0x0, 0x8(%rbx)
movq %rbx, 0x8(%rsp)
movb $0x0, 0x10(%rbx)
movq 0x28(%rax), %rbx
movq 0x30(%rax), %rbp
xorl %r13d, %r13d
leaq 0x38(%rsp), %r12
leaq 0x18(%rsp), %r14
cmpq %rbp, %rbx
je 0x466d
movl (%rbx), %esi
movq %r15, %rdi
pushq $0x1
popq %rdx
callq 0x46ec
testq %rax, %rax
je 0x4667
movl (%rbx), %esi
movq %r12, %rdi
callq 0x87e9
movq %r14, %rdi
movq %r12, %rsi
leaq 0x9416(%rip), %rdx      # 0xda58
callq 0x87ca
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x20b0
movq %r12, %rdi
callq 0x20b0
incl %r13d
addq $0x4, %rbx
jmp 0x4614
movq 0x8(%rsp), %rbx
cmpq $0x0, 0x8(%rbx)
je 0x4681
movq %rbx, %rdi
callq 0x2180
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x46a4
movl %r13d, (%rax)
jmp 0x46a4
leaq 0x90b7(%rip), %rsi      # 0xd74e
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x2090
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x20b0
jmp 0x46ca
jmp 0x46d6
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x20b0
jmp 0x46d9
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x2200
nop