LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/nGramSearch.cpp
// Function: snugglefish::nGramSearch::nGramSearch(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
nGramSearch::nGramSearch( uint32_t ngramLength, string indexFileName, uint32_t threads)
    :nGramBase(ngramLength, indexFileName),numThreads(threads) {

    masterFile = new smFile(baseFileName, ngramLength);

    if (!masterFile->exists()){
        //some error
    }else{
        masterFile->open('r');
    }


    numIndexFiles = masterFile->getNumIndexFiles();
    numFiles = masterFile->getNumFiles();
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
leaq -0x58(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %r12
movq %r12, %rdi
callq 0x7096
movq %rbx, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x7700
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x7a99
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x5290
movl %r14d, 0x38(%rbx)
movl $0x58, %edi
callq 0x5280
movq %rax, %r14
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x7096
movzbl %r15b, %edx
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0xa240
movq %r14, 0x40(%rbx)
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x7af4
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x5290
movq 0x40(%rbx), %r14
movq %r14, %rdi
callq 0x9aea
testb %al, %al
je 0x7b0e
movq 0x40(%rbx), %rdi
movl $0x72, %esi
callq 0xa438
movq 0x40(%rbx), %rax
movl 0x48(%rax), %ecx
movl %ecx, 0x48(%rbx)
movl 0x4c(%rax), %eax
movl %eax, 0x4c(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x7b4a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x5290
jmp 0x7b4a
movq %rax, %r15
movl $0x58, %esi
movq %r14, %rdi
callq 0x5290
jmp 0x7b6a
movq %rax, %r15
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
jne 0x7b7a
jmp 0x7b86
movq %rax, %r15
movq 0x8(%rbx), %rdi
addq $0x18, %rbx
movq %rbx, %r13
cmpq %rbx, %rdi
je 0x7b86
movq (%r13), %rsi
incq %rsi
callq 0x5290
movq %r15, %rdi
callq 0x54e0
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/nGramSearch.cpp
// Function: snugglefish::nGramSearch::stringToNGrams(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<uint64_t>* nGramSearch::stringToNGrams(string searchString){
    uint64_t nGram;
    vector <uint64_t>* ngrams = new vector<uint64_t>;


    for(size_t i = 0; i + ngramLength - 1 < searchString.length(); i++){
        nGram = 0;
        for(size_t j = 0; j < ngramLength; j++){
	    // (1 << (8*j)) is equivalent to pow(256,j)
            nGram += (unsigned char)searchString[i+j] * (1 << (8*j));
        }
        ngrams->push_back(nGram);
    }

    return ngrams;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x5280
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movb 0x28(%r14), %al
movzbl %al, %edx
leaq -0x1(%rdx), %rcx
cmpq 0x8(%rbx), %rcx
jae 0x7c94
xorl %r13d, %r13d
leaq -0x30(%rbp), %r12
movq $0x0, -0x30(%rbp)
testq %rdx, %rdx
je 0x7c59
movq (%rbx), %rsi
addq %r13, %rsi
shlq $0x3, %rdx
xorl %ecx, %ecx
xorl %edi, %edi
movzbl (%rsi), %r8d
shll %cl, %r8d
movslq %r8d, %r8
addq %r8, %rdi
movq %rdi, -0x30(%rbp)
addq $0x8, %rcx
incq %rsi
cmpq %rcx, %rdx
jne 0x7c3a
jmp 0x7c5b
xorl %edi, %edi
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x7c72
movq %rdi, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%r15)
jmp 0x7c81
movq %r15, %rdi
movq %r12, %rdx
callq 0x83a8
movb 0x28(%r14), %al
leaq 0x1(%r13), %rcx
movzbl %al, %edx
addq %rdx, %r13
cmpq 0x8(%rbx), %r13
movq %rcx, %r13
jb 0x7c1f
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/nGramSearch.cpp
// Function: snugglefish::nGramSearch::orderNGrams[abi:cxx11](snugglefish::indexSet*, std::vector<unsigned long, std::allocator<unsigned long>> const&)
list< pair<uint64_t, size_t> > nGramSearch::orderNGrams(indexSet* index, const vector<uint64_t> & nGramQuery){
    bool nomatch = false;
    list< pair<uint64_t, size_t> > queryList;
    for(uint32_t j = 0; j < nGramQuery.size(); j++){
        size_t numfiles = index->getNGramCount(nGramQuery[j]);
        //index_entry* index_table = (index_entry*) (indexEntries + (nGramQuery[j] * (INDEX_ENTRY_SIZE)));

        if(numfiles == 0){
            nomatch = true;
            break;
            //No Files Match
        }

        if(queryList.empty()){
            queryList.push_back(pair<uint64_t,size_t>(nGramQuery[j], numfiles));
        }else{
            bool placed = false;
            for (list< pair<uint64_t, size_t> >::iterator it = queryList.begin(); 
              it != queryList.end(); it++ ){
                if((*it).second > numfiles){
                    queryList.insert(it, pair<uint64_t, size_t>(nGramQuery[j], numfiles));
                    placed = true;
                    break;
                }
            }
            if (!placed){
                queryList.push_back(pair<uint64_t,size_t>(nGramQuery[j], numfiles));
            }
        }
    }

    if (nomatch){
        queryList.clear();
    }

    return queryList;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x38(%rbp)
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
movq $0x0, 0x10(%rdi)
movq (%rdx), %rax
cmpq %rax, 0x8(%rdx)
je 0x819b
movq %rdx, %r14
xorl %r15d, %r15d
movq %rdx, -0x30(%rbp)
movq (%rax,%r15,8), %rsi
movq -0x38(%rbp), %rdi
callq 0xa20e
movq %rax, %r12
testq %rax, %rax
je 0x8193
movq (%rbx), %r13
cmpq %rbx, %r13
je 0x8125
cmpq %r12, 0x18(%r13)
ja 0x814b
movq (%r13), %r13
cmpq %rbx, %r13
jne 0x80f5
movq (%r14), %rax
movq (%rax,%r15,8), %r14
movl $0x20, %edi
callq 0x5280
movq %r14, 0x10(%rax)
movq %r12, 0x18(%rax)
movq %rax, %rdi
movq %rbx, %rsi
jmp 0x816a
movq (%r14), %rax
movq (%rax,%r15,8), %r13
movl $0x20, %edi
callq 0x5280
movq %r13, 0x10(%rax)
movq %r12, 0x18(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5060
jmp 0x8173
movq (%r14), %rax
movq (%rax,%r15,8), %r14
movl $0x20, %edi
callq 0x5280
movq %r14, 0x10(%rax)
movq %r12, 0x18(%rax)
movq %rax, %rdi
movq %r13, %rsi
callq 0x5060
movq -0x30(%rbp), %r14
incq 0x10(%rbx)
incl %r15d
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x80d4
jmp 0x819b
movq %rbx, %rdi
callq 0x836c
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x81b3
jmp 0x81b3
jmp 0x81b3
movq %rax, %r14
movq (%rbx), %rdi
cmpq %rbx, %rdi
je 0x81d3
movq (%rdi), %r15
movl $0x20, %esi
callq 0x5290
movq %r15, %rdi
cmpq %rbx, %r15
jne 0x81be
movq %r14, %rdi
callq 0x54e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/nGramIndex.cpp
// Function: snugglefish::nGramIndex::~nGramIndex()
nGramIndex::~nGramIndex(){
    
	this->flushAll();
	for(uint64_t i = 0; i < maxNgram; i++){
		delete this->output_buffer[i].elements;
	}
	delete[] output_buffer;    

    delete masterFile;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x877c
cmpq $0x0, 0x30(%rbx)
je 0x8715
xorl %r15d, %r15d
movq 0x40(%rbx), %rax
movq %r15, %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %r14
testq %r14, %r14
je 0x86ff
movq (%r14), %rdi
cmpq %r14, %rdi
je 0x86ff
movq (%rdi), %r12
movl $0x18, %esi
callq 0x5290
movq %r12, %rdi
cmpq %r14, %r12
jne 0x86ea
movl $0x18, %esi
movq %r14, %rdi
callq 0x5290
incq %r15
cmpq 0x30(%rbx), %r15
jb 0x86cd
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x8723
callq 0x5340
movq 0x70(%rbx), %r14
testq %r14, %r14
je 0x8734
movq %r14, %rdi
callq 0xa278
movl $0x58, %esi
movq %r14, %rdi
callq 0x5290
leaq 0x50(%rbx), %rdi
callq 0x6f9a
movq 0x8(%rbx), %rdi
addq $0x18, %rbx
cmpq %rbx, %rdi
je 0x876a
movq (%rbx), %rsi
incq %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5290
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x7007
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/nGramIndex.cpp
// Function: snugglefish::nGramIndex::flushAll()
void nGramIndex::flushAll(){
    flushing = true;
    if(fileNameList.size()){
        ngram_t_indexfcount num_files = fileNameList.size();
        //By updating the master file last, this set can be queried
        //while creating a new index set
        flushIndex(num_files);
        flushMaster();

        numSessionFilesProcessed += num_files;
    }
    flushing = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movb $0x1, 0x69(%rdi)
movq 0x58(%rdi), %r14
subq 0x50(%rdi), %r14
je 0x87b5
sarq $0x5, %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x88f6
movq %rbx, %rdi
callq 0x8a14
movl %r14d, %eax
addq %rax, 0x80(%rbx)
movb $0x0, 0x69(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/nGramIndex.cpp
// Function: snugglefish::nGramIndex::addNGrams(std::vector<unsigned int, std::allocator<unsigned int>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void nGramIndex::addNGrams(vector<uint32_t>* nGramList, string filename){
    //POSIX basename may modify argument so create a copy
    char* temp_filename = new char[filename.length() + 1];
    strncpy(temp_filename, filename.c_str(), filename.length() + 1);
    filename = basename(temp_filename);
    delete[] temp_filename;

    ngram_t_fidtype file_id = numFilesProcessed++;
    fileNameList.push_back(filename);

    // Insert ngram into the list, add the new node to the memory usage variable,
    // and check if the maximum memory has been used, and if so, indicate that the
    // nGrams should be flushed to disk
    for(uint32_t i = 0; i < nGramList->size(); i++){
        uint32_t nGram = (*nGramList)[i];
        output_buffer[nGram].elements_size++;
        output_buffer[nGram].elements->push_back(file_id);

        buffer_memory_usage += BUFFER_NODE_SIZE; //Add size of node

        if(buffer_memory_usage >= bufferMax){ 
            flush = true;
        }
    }

    //We cleanup the memory
    delete nGramList;

    if (flush){
        flushAll();
        flush = false;
    }


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdx), %r13
incq %r13
movq %r13, %rdi
callq 0x5030
movq %rax, %r12
movq (%r15), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0x5120
movq %r12, %rdi
callq 0x54c0
movq %rax, %r13
movq 0x8(%r15), %rax
movq %rax, -0x30(%rbp)
movq %r13, %rdi
callq 0x50f0
movq %r15, %rdi
xorl %esi, %esi
movq -0x30(%rbp), %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x5410
movq %r12, %rdi
callq 0x5340
movq 0x78(%rbx), %r12
leaq 0x1(%r12), %rax
movq %rax, 0x78(%rbx)
leaq 0x50(%rbx), %rdi
movq %r15, %rsi
callq 0x6eba
movq (%r14), %rdi
cmpq %rdi, 0x8(%r14)
je 0x88b6
movl $0x1, %r13d
xorl %eax, %eax
movl (%rdi,%rax,4), %eax
movq 0x40(%rbx), %rcx
shlq $0x4, %rax
incq (%rcx,%rax)
movq 0x8(%rcx,%rax), %r15
movl $0x18, %edi
callq 0x5280
movl %r12d, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x5060
incq 0x10(%r15)
movq 0x48(%rbx), %rax
addq $0x1c, %rax
movq %rax, 0x48(%rbx)
cmpq 0x38(%rbx), %rax
jb 0x889d
movb $0x1, 0x68(%rbx)
movl %r13d, %eax
movq (%r14), %rdi
movq 0x8(%r14), %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
incl %r13d
cmpq %rax, %rcx
ja 0x8856
testq %rdi, %rdi
je 0x88c7
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x5290
movl $0x18, %esi
movq %r14, %rdi
callq 0x5290
cmpb $0x1, 0x68(%rbx)
jne 0x88e6
movq %rbx, %rdi
callq 0x877c
movb $0x0, 0x68(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/nGramIndex.cpp
// Function: snugglefish::nGramIndex::flushIndex(unsigned int)
void nGramIndex::flushIndex(ngram_t_indexfcount num_files){
    //Create the files
    indexSet* tIndex = new indexSet(baseFileName.c_str(), masterFile->getNumIndexFiles(), ngramLength);
    tIndex->create(num_files);

    uint64_t bytes_flushed = 0;

    for(uint32_t i = 0; i < maxNgram; i++){ //iterate through every ngram
        bytes_flushed += output_buffer[i].elements_size * sizeof(ngram_t_fidtype);
        tIndex->addNGrams(i, this->output_buffer[i].elements);
        output_buffer[i].elements_size = 0;

        if (output_buffer[i].elements->size() != 0)
            cout << "Not Zero" << endl;
    }

    buffer_memory_usage = 0;

    tIndex->close();
    delete tIndex;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %r14
movl $0x68, %edi
callq 0x5280
movq %rax, %rbx
movq 0x8(%r14), %rsi
movq 0x70(%r14), %rax
movl 0x48(%rax), %edx
movzbl 0x28(%r14), %ecx
movq %rbx, %rdi
callq 0x9b14
movq %rbx, %rdi
movl %r15d, %esi
callq 0x9c56
cmpq $0x0, 0x30(%r14)
je 0x89c9
xorl %r13d, %r13d
movq 0x6661(%rip), %r15      # 0xefb0
xorl %r12d, %r12d
movq 0x40(%r14), %rax
shlq $0x4, %r13
movq 0x8(%rax,%r13), %rdx
movq %rbx, %rdi
movl %r12d, %esi
callq 0xa15e
movq 0x40(%r14), %rax
movq $0x0, (%rax,%r13)
movq 0x8(%rax,%r13), %rax
cmpq $0x0, 0x10(%rax)
je 0x89bd
movl $0x8, %edx
movq %r15, %rdi
leaq 0x2d70(%rip), %rsi      # 0xb701
callq 0x52c0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5260
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x51a0
incl %r12d
movq %r12, %r13
cmpq %r12, 0x30(%r14)
ja 0x8952
movq $0x0, 0x48(%r14)
movq %rbx, %rdi
callq 0x9be2
movq %rbx, %rdi
callq 0x9b58
movl $0x68, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5290
movq %rax, %r14
movl $0x68, %esi
movq %rbx, %rdi
callq 0x5290
movq %r14, %rdi
callq 0x54e0
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/nGramIndex.cpp
// Function: snugglefish::nGramIndex::flushMaster()
void nGramIndex::flushMaster(){
    //Write FileNames to File ID file
    ngram_t_indexfcount num_files = (ngram_t_indexfcount) fileNameList.size();

    if (!num_files){
        return;
    }

    for(unsigned long i = 0; i < num_files; i++){
        masterFile->addFileId(fileNameList[i].c_str());
    }

    //Clear the vector
    fileNameList.clear();

    //Update filid with new value
    masterFile->updateIndexFileCount(masterFile->getNumIndexFiles() + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x58(%rdi), %rax
subq 0x50(%rdi), %rax
shrq $0x5, %rax
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
andq %rax, %r15
je 0x8a80
movq %rdi, %rbx
leaq 0x50(%rdi), %r14
shlq $0x5, %r15
xorl %r12d, %r12d
movq 0x50(%rbx), %rax
movq 0x70(%rbx), %rdi
movq (%rax,%r12), %rsi
callq 0xa544
addq $0x20, %r12
cmpq %r12, %r15
jne 0x8a44
movq 0x50(%rbx), %rsi
movq %r14, %rdi
callq 0x8ab2
movq 0x70(%rbx), %rdi
movl 0x48(%rdi), %esi
incl %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa59c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/fileIndexer.cpp
// Function: snugglefish::fileIndexer::fileIndexer(unsigned char)
fileIndexer::fileIndexer(uint8_t ngramLength):
filesProcessed(0)
{

    if(ngramLength == 3  || ngramLength == 4){
        this->ngramLength = ngramLength;
        this->maxNgram = ((uint64_t) (1) << (8*ngramLength));
        this->pagesize = getpagesize();
    }
    else {
        throw std::runtime_error("Ngram len must be either 3 or 4");
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq $0x0, (%rdi)
leal -0x3(%rsi), %eax
cmpb $0x1, %al
ja 0x8b3f
movq %rdi, %rbx
movzbl %sil, %ecx
movl %ecx, 0x8(%rdi)
shll $0x3, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, 0x10(%rdi)
callq 0x5510
movl %eax, 0x18(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x2bb7(%rip), %rsi      # 0xb70a
movq %rax, %rdi
callq 0x50d0
movq 0x648e(%rip), %rsi      # 0xeff0
movq 0x643f(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/fileIndexer.cpp
// Function: snugglefish::fileIndexer::processNgrams(unsigned char*, unsigned long, bool*)
void fileIndexer::processNgrams(unsigned char* buf, uint64_t fileSize, bool ngramList[]){
    //TODO update with byte array
    uint64_t nGram = 0;
    uint64_t i, j;
    for(i = 0; ((i + this->ngramLength) - 1) < fileSize; i++){
        nGram = 0;
       // creates an ngram using the formula buf[i] + buf[i+1]*256 
       // + buf[i+2]*256*256
        for(j = 0; j < this->ngramLength; j++){
            // (1 <<(8*j)) is equivalent to pow(256,j)
           nGram += (unsigned char)buf[i+j] * (1 << (8*j));
        }
        if(nGram >= this->maxNgram){
            throw std::runtime_error("Ngram greater than maxNgram");
        }
        ngramList[nGram] = 1;
    }

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rcx, %rax
movl 0x8(%rdi), %r8d
leaq -0x1(%r8), %rcx
cmpq %rdx, %rcx
jae 0x8e39
movq 0x10(%rdi), %rdi
subq %r8, %rdx
incq %rdx
movq %r8, %r9
shlq $0x3, %r9
xorl %r10d, %r10d
testl %r8d, %r8d
je 0x8e21
movq %rsi, %rbx
xorl %ecx, %ecx
xorl %r11d, %r11d
movzbl (%rbx), %r14d
shll %cl, %r14d
movslq %r14d, %r14
addq %r14, %r11
addq $0x8, %rcx
incq %rbx
cmpq %rcx, %r9
jne 0x8e06
jmp 0x8e24
xorl %r11d, %r11d
cmpq %rdi, %r11
jae 0x8e3e
movb $0x1, (%rax,%r11)
incq %r10
incq %rsi
cmpq %rdx, %r10
jne 0x8df9
popq %rbx
popq %r14
popq %rbp
retq
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x28f2(%rip), %rsi      # 0xb744
movq %rax, %rdi
callq 0x50d0
movq 0x618f(%rip), %rsi      # 0xeff0
movq 0x6140(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/fileIndexer.cpp
// Function: snugglefish::fileIndexer::processNgrams(unsigned char*, unsigned long)
vector<uint32_t>* fileIndexer::processNgrams(unsigned char* buf, uint64_t fileSize){
    map<uint32_t, bool> ngram_map;

    uint32_t nGram = 0;
    uint32_t i, j;

    for(i = 0; ((i + this->ngramLength) - 1) < fileSize; i++){
        nGram = 0;
        for(j = 0; j < this->ngramLength; j++){
            nGram += (unsigned char)buf[i+j] * (1 << (8*j));
        }
        if(nGram >= this->maxNgram){
            throw std::runtime_error("Ngram greater than maxNgram");
        }
        ngram_map.insert(pair<uint32_t,bool>(nGram, true));
    }

    //We should now have a map of ngrams, turn into a sorted vector
    //TODO pre-allocate vector to do this faster
    vector<uint32_t>* ngramVector = new vector<uint32_t>;
    
    for(map<uint32_t,bool>::iterator it = ngram_map.begin(); it != ngram_map.end() ; it++){
        ngramVector->push_back(it->first);
    }

    return ngramVector;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq -0x58(%rbp), %rax
movl $0x0, (%rax)
xorl %r12d, %r12d
movq %r12, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %r12, 0x20(%rax)
movl 0x8(%rdi), %eax
leal -0x1(%rax), %ecx
cmpq %rdx, %rcx
jae 0x8f28
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x30(%rbp), %r13
testl %eax, %eax
je 0x8ef3
movl %eax, %edx
shlq $0x3, %rdx
xorl %ecx, %ecx
movl %r12d, %esi
xorl %eax, %eax
movl %esi, %edi
movzbl (%r14,%rdi), %edi
shll %cl, %edi
addl %edi, %eax
addq $0x8, %rcx
incl %esi
cmpq %rcx, %rdx
jne 0x8edb
jmp 0x8ef5
xorl %eax, %eax
movl %eax, %ecx
cmpq %rcx, 0x10(%r15)
jbe 0x8f9f
movl %eax, -0x30(%rbp)
movb $0x1, -0x2c(%rbp)
leaq -0x60(%rbp), %rdi
movq %r13, %rsi
callq 0x9196
leal 0x1(%r12), %ecx
movl 0x8(%r15), %eax
addl %eax, %r12d
cmpq %rbx, %r12
movl %ecx, %r12d
jb 0x8eca
movl $0x18, %edi
callq 0x5280
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq -0x48(%rbp), %r14
leaq -0x58(%rbp), %r15
cmpq %r15, %r14
je 0x8f84
leaq 0x20(%r14), %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x8f6c
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x8f74
movq %rbx, %rdi
callq 0x9056
movq %r14, %rdi
callq 0x51b0
movq %rax, %r14
cmpq %r15, %rax
jne 0x8f50
leaq -0x60(%rbp), %rdi
callq 0x8ff8
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x5110
movq %rax, %r14
leaq 0x2791(%rip), %rsi      # 0xb744
movq %rax, %rdi
callq 0x50d0
movq 0x602e(%rip), %rsi      # 0xeff0
movq 0x5fdf(%rip), %rdx      # 0xefa8
movq %r14, %rdi
callq 0x54b0
jmp 0x8fe4
jmp 0x8fe4
jmp 0x8fe4
movq %rax, %rbx
movq %r14, %rdi
callq 0x51d0
jmp 0x8fe7
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x8ff8
movq %rbx, %rdi
callq 0x54e0
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::~file()
file::~file(){
    //File Descriptor is not zero
    if(this->fd){
        this->close();
    }
    
    if (this->filename != NULL){
        free(this->filename);
    }

    if (this->buffer){
        free(this->buffer);
        this->buffer = NULL;
        this->buffersize = this->bufferused = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0xc(%rdi)
je 0x9357
movq %rbx, %rdi
callq 0x9394
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x9364
callq 0x52f0
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x9384
addq $0x20, %rbx
callq 0x52f0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rdi
callq 0x7007
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::close()
bool file::close(){
    if (!this->fd){ // already closed?
        return true;
    }

    this->flush(); 

    //Close the mmap if opened
    if (this->mmapFile){
        munmap(this->mmapFile, this->size); 
        this->mmapFile = 0;
        this->size = 0;
    }

    //Free the write buffer if allocated
    if (this->buffer){
        free(this->buffer);
        this->buffer = NULL;
        this->buffersize = this->bufferused = 0;
    }

    int32_t retval = ::close(this->fd);
    if(retval){//non zero
        cerr << "Error Closing File: " << this->filename << " -- Error: " << strerror(errno) << endl;
        throw runtime_error("Closing File");
    }

    this->fd = 0;

    return true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0xc(%rdi)
je 0x93fa
movq %rdi, %rbx
callq 0x982c
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x93c6
leaq 0x10(%rbx), %r14
movq 0x18(%rbx), %rsi
callq 0x5170
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x93e7
leaq 0x20(%rbx), %r14
callq 0x52f0
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movl 0xc(%rbx), %edi
callq 0x5560
testl %eax, %eax
jne 0x9401
movl $0x0, 0xc(%rbx)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5be0(%rip), %r14      # 0xefe8
leaq 0x23e0(%rip), %rsi      # 0xb7ef
movl $0x14, %edx
movq %r14, %rdi
callq 0x52c0
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x5270
movq %rax, %rbx
leaq 0x1c77(%rip), %rsi      # 0xb0a8
movl $0xb, %edx
movq %rax, %rdi
callq 0x52c0
callq 0x5050
movl (%rax), %edi
callq 0x50a0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5270
movq %rax, %rdi
callq 0x5100
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x2393(%rip), %rsi      # 0xb804
movq %rax, %rdi
callq 0x50d0
movq 0x5b70(%rip), %rsi      # 0xeff0
movq 0x5b21(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::create(unsigned int)
bool file::create(mode_t filemode){

    if (this->bufferparam > 0){
        this->buffersize = this->bufferparam;
        this->buffer = (char*) malloc(buffersize);
    }
    this->fd = ::open(this->filename, O_RDWR | O_CREAT, filemode);
    this->readonly = false;

    if (this->fd <= 0){
        cerr << "Unable to Create File: " << filename << " -- Error: " << strerror(errno) << endl;
        throw runtime_error("Creating File");
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x94c5
movq %rdi, 0x28(%rbx)
callq 0x5360
movq %rax, 0x20(%rbx)
movq (%rbx), %rdi
movl $0x42, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x51e0
movl %eax, 0xc(%rbx)
movb $0x0, 0x8(%rbx)
testl %eax, %eax
jle 0x94e9
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5af8(%rip), %r14      # 0xefe8
leaq 0x2269(%rip), %rsi      # 0xb760
movl $0x17, %edx
movq %r14, %rdi
callq 0x52c0
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x5270
movq %rax, %rbx
leaq 0x1b8f(%rip), %rsi      # 0xb0a8
movl $0xb, %edx
movq %rax, %rdi
callq 0x52c0
callq 0x5050
movl (%rax), %edi
callq 0x50a0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5270
movq %rax, %rdi
callq 0x5100
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x221f(%rip), %rsi      # 0xb778
movq %rax, %rdi
callq 0x50d0
movq 0x5a88(%rip), %rsi      # 0xeff0
movq 0x5a39(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::open(char)
bool file::open(char readwrite){
    switch (readwrite){
        case 'r':
        {    
            this->fd = ::open(this->filename, O_RDONLY);
            this->size = this->get_size();
            this->readonly = true;
            break;
        }
        case 'w':
        {
            if (this->bufferparam > 0){
                this->buffersize = this->bufferparam;
                this->buffer = (char*) malloc(buffersize);
            }
            this->fd = ::open(this->filename, O_RDWR);
            this->readonly = false;
            break;
        }
        default:
            throw runtime_error("Unrecognized read/write mode");
            break;
    }

    if (this->fd <= 0){
        cerr << "Error Opening File: " << this->filename << " -- Error: " << strerror(errno) << endl;
        throw runtime_error("Opening File");
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x77, %esi
je 0x95c6
cmpl $0x72, %esi
jne 0x9677
movq (%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x51e0
movl %eax, 0xc(%rbx)
movq %rbx, %rdi
callq 0x96be
movq %rax, 0x18(%rbx)
movb $0x1, 0x8(%rbx)
movl 0xc(%rbx), %eax
jmp 0x95f2
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x95dc
movq %rdi, 0x28(%rbx)
callq 0x5360
movq %rax, 0x20(%rbx)
movq (%rbx), %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x51e0
movl %eax, 0xc(%rbx)
movb $0x0, 0x8(%rbx)
testl %eax, %eax
jle 0x95fd
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
movq 0x59e4(%rip), %r14      # 0xefe8
leaq 0x2198(%rip), %rsi      # 0xb7a3
movl $0x14, %edx
movq %r14, %rdi
callq 0x52c0
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x5270
movq %rax, %rbx
leaq 0x1a7b(%rip), %rsi      # 0xb0a8
movl $0xb, %edx
movq %rax, %rdi
callq 0x52c0
callq 0x5050
movl (%rax), %edi
callq 0x50a0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5270
movq %rax, %rdi
callq 0x5100
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x214b(%rip), %rsi      # 0xb7b8
movq %rax, %rdi
callq 0x50d0
jmp 0x9693
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x20fb(%rip), %rsi      # 0xb786
movq %rax, %rdi
callq 0x50d0
movq 0x5956(%rip), %rsi      # 0xeff0
movq 0x5907(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
jmp 0x96ab
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::get_size()
const size_t file::get_size(){
    struct stat st;
    size_t filesize = 0;
    if (stat(this->filename, &st) == 0){
       filesize = st.st_size;
    }else{
        throw runtime_error("Statting File");
    } 

    return filesize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq (%rdi), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5250
testl %eax, %eax
jne 0x96ef
movq -0x70(%rbp), %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x2173(%rip), %rsi      # 0xb876
movq %rax, %rdi
callq 0x50d0
movq 0x58de(%rip), %rsi      # 0xeff0
movq 0x588f(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::mmap()
uint8_t* file::mmap(){
    //Open the file first 
    if (this->fd == 0)
        this->open('r');

    if (!this->size)
        return NULL;

    this->mmapFile = (uint8_t*) ::mmap(NULL, this->size, PROT_READ, MAP_SHARED, this->fd, 0);

    if(this->mmapFile == MAP_FAILED){
        cerr << "Error Loading Map for File : " << this->filename<< " -- Error: " << strerror(errno) << endl;
        throw runtime_error("Loading Map");
    }

    return this->mmapFile;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0xc(%rdi)
jne 0x9751
movq %rbx, %rdi
movl $0x72, %esi
callq 0x958a
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0x9812
movl 0xc(%rbx), %r8d
xorl %edi, %edi
movl $0x1, %edx
movl $0x1, %ecx
xorl %r9d, %r9d
callq 0x54f0
movq %rax, 0x10(%rbx)
cmpq $-0x1, %rax
jne 0x9814
movq 0x585d(%rip), %r14      # 0xefe8
leaq 0x2033(%rip), %rsi      # 0xb7c5
movl $0x1d, %edx
movq %r14, %rdi
callq 0x52c0
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x5270
movq %rax, %rbx
leaq 0x18f4(%rip), %rsi      # 0xb0a8
movl $0xb, %edx
movq %rax, %rdi
callq 0x52c0
callq 0x5050
movl (%rax), %edi
callq 0x50a0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5270
movq %rax, %rdi
callq 0x5100
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x1fef(%rip), %rsi      # 0xb7e3
movq %rax, %rdi
callq 0x50d0
movq 0x57ed(%rip), %rsi      # 0xeff0
movq 0x579e(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::flush()
bool file::flush(){
    if(this->readonly){
        return true;
    }

    if (this->bufferused){
        lseek(this->fd, 0, SEEK_END);
        this->real_write(this->fd, (uint8_t*) this->buffer, this->bufferused * sizeof(char));
        this->bufferused = 0;
    }

    return true;
}

// Assembly:
cmpb $0x0, 0x8(%rdi)
jne 0x9872
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x30(%rdi)
je 0x986c
movl 0xc(%rbx), %edi
xorl %esi, %esi
movl $0x2, %edx
callq 0x5540
movl 0xc(%rbx), %esi
movq 0x20(%rbx), %rdx
movq 0x30(%rbx), %rcx
movq %rbx, %rdi
callq 0x9876
movq $0x0, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
movb $0x1, %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::real_write(int, unsigned char*, unsigned long)
bool file::real_write(int fd, uint8_t* data, size_t length){
        ssize_t written = ::write(fd, data, length); 
        if (written == -1){//TODO what if partial write?
            cerr << "Unable to write to file: " << this->filename << " -- Error: " << strerror(errno) << endl;
            throw runtime_error("Write Error");
        }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, %edi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x50b0
cmpq $-0x1, %rax
je 0x989a
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5747(%rip), %r14      # 0xefe8
leaq 0x1f69(%rip), %rsi      # 0xb811
movl $0x19, %edx
movq %r14, %rdi
callq 0x52c0
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x5270
movq %rax, %rbx
leaq 0x17de(%rip), %rsi      # 0xb0a8
movl $0xb, %edx
movq %rax, %rdi
callq 0x52c0
callq 0x5050
movl (%rax), %edi
callq 0x50a0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5270
movq %rax, %rdi
callq 0x5100
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x1f21(%rip), %rsi      # 0xb82b
movq %rax, %rdi
callq 0x50d0
movq 0x56d7(%rip), %rsi      # 0xeff0
movq 0x5688(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::write(unsigned char*, unsigned long)
bool file::write(uint8_t * data, size_t length){
    if (this->readonly){
        throw runtime_error("Write command on read-only file");
    }

    if((this->bufferused + (length)) > this->buffersize) {
        this->flush();

        if (length < this->buffersize){
            memcpy(this->buffer, data, length);
            this->bufferused = length;
        }else{  
            //Data being passed in is larger than buffer, write out directly
            //Seek to the end of the file first
            lseek(this->fd, 0, SEEK_END);
            this->real_write(this->fd, data, length);
        }
    }else{ // just buffer it up
        memcpy(this->buffer + this->bufferused, data, length);
        this->bufferused += length;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x1, 0x8(%rdi)
je 0x99ca
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x30(%rdi), %rdi
leaq (%rdi,%rdx), %rax
cmpq 0x28(%r14), %rax
jbe 0x9986
movq %r14, %rdi
callq 0x982c
cmpq %rbx, 0x28(%r14)
jbe 0x999b
movq 0x20(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x5220
movq %rbx, 0x30(%r14)
jmp 0x99bd
addq 0x20(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x5220
addq %rbx, 0x30(%r14)
jmp 0x99bd
movl 0xc(%r14), %edi
xorl %esi, %esi
movl $0x2, %edx
callq 0x5540
movl 0xc(%r14), %esi
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x9876
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x1e59(%rip), %rsi      # 0xb837
movq %rax, %rdi
callq 0x50d0
movq 0x5603(%rip), %rsi      # 0xeff0
movq 0x55b4(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::write_at(int, unsigned char*, unsigned long)
bool file::write_at(int32_t location, uint8_t * data, size_t length){
    if (this->readonly){
        throw runtime_error("Write command on reaodnly file");
    }

    //Flush before writing at locations
    flush();
    lseek(this->fd, location, SEEK_SET);
    this->real_write(this->fd, data, length * sizeof(uint8_t));

    return true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpb $0x1, 0x8(%rdi)
je 0x9a5d
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %r15
callq 0x982c
movl 0xc(%r15), %edi
movslq %r12d, %rsi
xorl %edx, %edx
callq 0x5540
movl 0xc(%r15), %esi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x9876
movb $0x1, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x1de6(%rip), %rsi      # 0xb857
movq %rax, %rdi
callq 0x50d0
movq 0x5570(%rip), %rsi      # 0xeff0
movq 0x5521(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/indexSet.cpp
// Function: snugglefish::indexSet::~indexSet()
indexSet::~indexSet(){
    if (this->indexFile){
        this->indexFile->close();
        delete this->indexFile;
    }

    if (this->nGramFile){
        this->nGramFile->close();
        delete this->nGramFile;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x9b8c
callq 0x9394
movq (%rbx), %r14
testq %r14, %r14
je 0x9b7f
movq %r14, %rdi
callq 0x9340
movl $0x40, %esi
movq %r14, %rdi
callq 0x5290
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x9bb8
callq 0x9394
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x9bab
movq %r14, %rdi
callq 0x9340
movl $0x40, %esi
movq %r14, %rdi
callq 0x5290
movq 0x28(%rbx), %rdi
addq $0x38, %rbx
cmpq %rbx, %rdi
je 0x9bd4
movq (%rbx), %rsi
incq %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x5290
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0x7007
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/indexSet.cpp
// Function: snugglefish::indexSet::close()
void indexSet::close(){
    if (this->indexFile){
        this->indexFile->close();
        delete this->indexFile;
        this->indexFile = NULL;
    }
    if (this->nGramFile){
        this->nGramFile->close();
        delete this->nGramFile;
        this->nGramFile = NULL;
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x9c1d
callq 0x9394
movq (%rbx), %r14
testq %r14, %r14
je 0x9c09
movq %r14, %rdi
callq 0x9340
movl $0x40, %esi
movq %r14, %rdi
callq 0x5290
movq $0x0, (%rbx)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x9c51
callq 0x9394
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x9c3c
movq %r14, %rdi
callq 0x9340
movl $0x40, %esi
movq %r14, %rdi
callq 0x5290
movq $0x0, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/indexSet.cpp
// Function: snugglefish::indexSet::addNGrams(unsigned int, std::__cxx11::list<unsigned int, std::allocator<unsigned int>>*)
void indexSet::addNGrams(uint32_t ngram, list<ngram_t_fidtype>* files){
    if (!writable || !nGramFile){
        //TODO
    }

    uint32_t size = files->size();
    uint64_t off =  offset;
    uint32_t difference = sizeof(ngram_t_fidtype) * size;

    if (!size){
        off = 0;
    }

    //Pre-emptively add the index information, i.e, offset, numFiles
    addIndexData(off, size);

    while(size > 0){
        nGramFile->write((uint8_t*) (&(files->front())), sizeof(ngram_t_fidtype));
        files->pop_front();
        size--;
    } 

    offset =  offset + difference;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdx), %r14
testl %r14d, %r14d
je 0xa1c5
movq %rdx, %r15
movq 0x60(%rbx), %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0xa118
movl %r14d, %r13d
movq 0x8(%rbx), %rdi
movq (%r15), %rsi
addq $0x10, %rsi
movl $0x4, %edx
callq 0x993c
movq (%r15), %r12
decq 0x10(%r15)
movq %r12, %rdi
callq 0x5450
movl $0x18, %esi
movq %r12, %rdi
callq 0x5290
decl %r13d
jne 0xa18d
jmp 0xa1d1
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xa118
shll $0x2, %r14d
addq %r14, 0x60(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/smFile.cpp
// Function: snugglefish::smFile::create(unsigned short)
void smFile::create(ngram_t_fnlength maxfnLength){
    if (this->exists()){
        cerr << "Unable to create file: " << this->filename << " -- Already Exists" << endl;
        throw runtime_error("Creating File");
    }

    //Create the File
    file::create();
    
    this->endian_check = ENDIAN_CHECK;
    this->version = VERSION;
    this->maxFileNameLength = maxfnLength;
    
    ngram_t_indexcount four_byte_zero = this->numIndexFiles = 0;
    ngram_t_fidtype eight_byte_zero = this->numFiles = 0;

    //Write standard header
    write((uint8_t*) (&(this->endian_check)), ENDIAN_CHECK_FIELD);
    write((uint8_t*) (&(this->version)), VERSION_FIELD);
    write((uint8_t*) (&(this->ngramLength)), NGRAM_SIZE_FIELD);
    write((uint8_t*) (&(this->maxFileNameLength)), MAX_FILENAME_LENGTH_FIELD);
    write((uint8_t*) &four_byte_zero, NUM_INDEX_FILES_FIELD);
    write((uint8_t*) &eight_byte_zero, NUM_FILES_FIELD);

    fileBuffer = (char*) malloc((maxFileNameLength + 1)* sizeof(char));

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
callq 0x9aea
testb %al, %al
jne 0xa3ad
movq %rbx, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x94a2
leaq 0x40(%rbx), %rsi
movl $0x1234567, 0x40(%rbx)  # imm = 0x1234567
leaq 0x44(%rbx), %r13
movb $0x1, 0x44(%rbx)
leaq 0x46(%rbx), %r12
movw %r14w, 0x46(%rbx)
xorl %eax, %eax
movl %eax, 0x48(%rbx)
leaq -0x30(%rbp), %r15
movl %eax, (%r15)
movl %eax, 0x4c(%rbx)
leaq -0x2c(%rbp), %r14
movl %eax, (%r14)
movl $0x4, %edx
movq %rbx, %rdi
callq 0x993c
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x993c
leaq 0x45(%rbx), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x993c
movl $0x2, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x993c
movl $0x4, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x993c
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x993c
movzwl 0x46(%rbx), %edi
incq %rdi
callq 0x5360
movq %rax, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4c34(%rip), %r14      # 0xefe8
leaq 0x1532(%rip), %rsi      # 0xb8ed
movl $0x17, %edx
movq %r14, %rdi
callq 0x52c0
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x5270
movq %rax, %rbx
leaq 0x1528(%rip), %rsi      # 0xb905
movl $0x12, %edx
movq %rax, %rdi
callq 0x52c0
movq %rbx, %rdi
callq 0x5100
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x1372(%rip), %rsi      # 0xb778
movq %rax, %rdi
callq 0x50d0
movq 0x4bdb(%rip), %rsi      # 0xeff0
movq 0x4b8c(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/smFile.cpp
// Function: snugglefish::smFile::open(char)
void smFile::open(char readwrite){
    file::open(readwrite);

    ngram_t_size ngramL;

    read((uint8_t*) (&(this->endian_check)), ENDIAN_CHECK_FIELD);

    if (this->endian_check != ENDIAN_CHECK){
       throw runtime_error("Endian Mismatch"); 
    }

    read((uint8_t*) (&(this->version)), VERSION_FIELD);
    read((uint8_t*) (&ngramL), NGRAM_SIZE_FIELD);

    if (this->ngramLength != ngramL){
       throw runtime_error("N Gram Length Mismatch"); 
    }  

    read((uint8_t*) (&(this->maxFileNameLength)), MAX_FILENAME_LENGTH_FIELD);
    read((uint8_t*) (&(this->numIndexFiles)), NUM_INDEX_FILES_FIELD);
    read((uint8_t*) (&(this->numFiles)), NUM_FILES_FIELD);

    fileBuffer = (char*) malloc((maxFileNameLength + 1)* sizeof(char));

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x958a
leaq 0x40(%rbx), %rsi
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9aa2
cmpl $0x1234567, 0x40(%rbx)  # imm = 0x1234567
jne 0xa4de
leaq 0x44(%rbx), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9aa2
leaq -0x11(%rbp), %r14
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9aa2
movb 0x45(%rbx), %al
cmpb (%r14), %al
jne 0xa4fc
leaq 0x46(%rbx), %rsi
movl $0x2, %edx
movq %rbx, %rdi
callq 0x9aa2
leaq 0x48(%rbx), %rsi
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9aa2
leaq 0x4c(%rbx), %rsi
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9aa2
movzwl 0x46(%rbx), %edi
incq %rdi
callq 0x5360
movq %rax, 0x50(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x1426(%rip), %rsi      # 0xb918
movq %rax, %rdi
callq 0x50d0
jmp 0xa518
movl $0x10, %edi
callq 0x5110
movq %rax, %rbx
leaq 0x1418(%rip), %rsi      # 0xb928
movq %rax, %rdi
callq 0x50d0
movq 0x4ad1(%rip), %rsi      # 0xeff0
movq 0x4a82(%rip), %rdx      # 0xefa8
movq %rbx, %rdi
callq 0x54b0
jmp 0xa530
movq %rax, %r14
movq %rbx, %rdi
callq 0x51d0
movq %r14, %rdi
callq 0x54e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/MITRECND[P]snugglefish/src/smFile.cpp
// Function: snugglefish::smFile::addFileId(char const*)
void smFile::addFileId(const char * fileName){
    strncpy(fileBuffer, fileName, maxFileNameLength);
    write((uint8_t*) fileBuffer, maxFileNameLength * sizeof(char));

    numFiles++;
    //Writing of the numFiles to the file is delayed until a flush
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x50(%rdi), %rdi
movzwl 0x46(%rbx), %edx
callq 0x5120
movq 0x50(%rbx), %rsi
movzwl 0x46(%rbx), %edx
movq %rbx, %rdi
callq 0x993c
incl 0x4c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/emilisb[P]OOP-4/src/main.cpp
// Function: main
int main(int argc, const char * argv[]) {
    for (size_t i = 10000; i <= 100000000; i *= 10) {
        benchmarkInsert(i);
        benchmarkResize(i);
    }

    vector<TestObject> numbers;
    
    TestObject object("hello");
    for (int i = 0; i < 10; i++) {
        numbers.push_back(object);
    }
    
    numbers.erase(numbers.begin(), numbers.begin() + 1);
    
    for (int i = 0; i < numbers.size(); i++) {
        std::cout << numbers.at(i)._value << std::endl;
    }

    std::cout << numbers.size() << std::endl;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl $0x2710, %ebx           # imm = 0x2710
movq %rbx, %rdi
callq 0x230c
movq %rbx, %rdi
callq 0x258e
leaq (%rbx,%rbx), %rax
leaq (%rax,%rax,4), %rax
cmpq $0x989681, %rbx         # imm = 0x989681
movq %rax, %rbx
jb 0x2811
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
xorl %edi, %edi
callq 0x2130
movq %rax, 0x10(%rsp)
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x185f(%rip), %rsi      # 0x40b7
leaq 0x185d(%rip), %rdx      # 0x40bc
leaq 0x20(%rsp), %rdi
callq 0x2f46
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x29f6
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x288f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2140
movl $0xa, %ebp
movq %rsp, %rbx
leaq 0x40(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a82
decl %ebp
jne 0x289c
movq %rsp, %rdi
movq 0x10(%rdi), %rsi
leaq 0x20(%rsi), %rdx
callq 0x2ad4
cmpq $0x0, (%rsp)
je 0x2920
xorl %ebx, %ebx
movq %rsp, %r14
movq 0x36fa(%rip), %r15      # 0x5fc8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2b68
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r15, %rdi
callq 0x2150
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
incq %rbx
movq (%rsp), %rsi
cmpq %rbx, %rsi
ja 0x28ce
jmp 0x2922
xorl %esi, %esi
movq 0x369f(%rip), %rdi      # 0x5fc8
callq 0x20b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
leaq 0x40(%rsp), %rdi
callq 0x2bca
movq %rsp, %rdi
callq 0x2c46
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x29ab
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2140
jmp 0x29ab
movq %rax, %rbx
jmp 0x29ab
jmp 0x299e
jmp 0x299e
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2bca
movq %rsp, %rdi
callq 0x2c46
movq %rbx, %rdi
callq 0x21a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/emilisb[P]OOP-4/src/vector.h
// Function: vector<TestObject, std::allocator<TestObject>>::push_back(TestObject const&)
void push_back(const T& item) {
        if (size() == capacity()) {
            reallocate(capacity() + 1);
        }
        _allocator.construct(end(), item);
        ++_size;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rsi
cmpq 0x8(%rdi), %rsi
jne 0x2aa3
incq %rsi
movq %rbx, %rdi
callq 0x2fdc
movq (%rbx), %rsi
movq 0x10(%rbx), %rax
shlq $0x5, %rsi
leaq (%rax,%rsi), %rdi
addq %rsi, %rax
addq $0x10, %rax
movq %rax, -0x10(%rax)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
callq 0x2ca6
incq (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq