LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/db.cc
// Function: database::readValueFromKey(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
opStatus database::readValueFromKey(std::string key, 
                                    int clientSocket) {

  auto t_start = std::chrono::high_resolution_clock::now();

  opStatus status = memtableWrapperObjRef->getValueFromKey(key, clientSocket);
  if(status == opStatus::opFail) {
    // Check SSTables
    status = sstableWrapperObjRef->getValueFromKey(key, clientSocket);
  }

  auto t_end = std::chrono::high_resolution_clock::now();
  double time_elapsed_ms =
    std::chrono::duration<double, std::milli>(t_end - t_start).count();
  std::cout << "Get operation performed in "
            << time_elapsed_ms
            << " ms!"
            << std::endl;
  return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
callq 0x5070
movq %rax, (%rsp)
movq (%r12), %rbx
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x6924
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x16fac
movl %eax, %ebx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x6ffd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5390
cmpl $0x3, %ebx
jne 0x704d
movq 0x8(%r12), %rbx
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x6924
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x19cf4
movl %eax, %ebx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x704d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5390
callq 0x5070
subq (%rsp), %rax
cvtsi2sd %rax, %xmm0
divsd 0x140bd(%rip), %xmm0    # 0x1b120
movsd %xmm0, (%rsp)
movq 0x1ef51(%rip), %r14     # 0x25fc0
leaq 0x140b2(%rip), %rsi     # 0x1b128
movl $0x1b, %edx
movq %r14, %rdi
callq 0x5430
movq %r14, %rdi
movsd (%rsp), %xmm0
callq 0x55c0
movq %rax, %r14
leaq 0x140aa(%rip), %rsi     # 0x1b144
movl $0x4, %edx
movq %rax, %rdi
callq 0x5430
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5370
movsbl %al, %esi
movq %r14, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5280
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
jmp 0x70f1
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x7101
movq (%r14), %rsi
incq %rsi
callq 0x5390
movq %rbx, %rdi
callq 0x5670
nop
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/db.cc
// Function: database::readAllValues(int)
opStatus database::readAllValues(int clientSocket) {
  opStatus memtableStatus = memtableWrapperObjRef->getAllValues(clientSocket);
  if(memtableStatus != opStatus::opSuccess) {
    sendEndMsgToClient(clientSocket);
    return memtableStatus;
  }  
  //List from SSTables
  opStatus sstableStatus = sstableWrapperObjRef->getAllValues(clientSocket);
  if(sstableStatus != opStatus::opSuccess) {
    sendEndMsgToClient(clientSocket);
    return sstableStatus;
  }
  //Sending end message after fetching from memTables and SSTables
  sendEndMsgToClient(clientSocket);

  return opStatus::opSuccess;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x172e8
movl %eax, %ebp
testl %eax, %eax
jne 0x7266
movq 0x8(%r14), %rdi
movl %ebx, %esi
callq 0x19f22
movl %eax, %ebp
movl %ebx, %edi
callq 0x1aa11
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/dbops.cc
// Function: putOp(keyValuePair_t, int, database*)
opStatus putOp(keyValuePair_t keyValuePair, 
               int clientSocket, 
               database* dbObject) {
  std::cout << "Putting key = <"
            << keyValuePair.key << ">, value = <"
            << keyValuePair.value << "> ..." << std::endl;
  return dbObject->writeKeyValuePair(keyValuePair, clientSocket);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
movq 0x1e5e0(%rip), %r12     # 0x25fc0
leaq 0x1391b(%rip), %rsi     # 0x1b302
movl $0xf, %edx
movq %r12, %rdi
callq 0x5430
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r12, %rdi
callq 0x5430
movq %rax, %r12
leaq 0x13905(%rip), %rsi     # 0x1b312
movl $0xc, %edx
movq %rax, %rdi
callq 0x5430
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq %r12, %rdi
callq 0x5430
movq %rax, %r12
leaq 0x138eb(%rip), %rsi     # 0x1b31f
movl $0x5, %edx
movq %rax, %rdi
callq 0x5430
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x5370
movsbl %al, %esi
movq %r12, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5280
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x6924
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
callq 0x6924
movq %rsp, %rsi
movq %r14, %rdi
movl %ebx, %edx
callq 0x6ea6
movl %eax, %ebx
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x7ac9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5390
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x7adf
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5390
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x72be
jmp 0x7b15
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x7b15
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5390
movq %rbx, %rdi
callq 0x5670
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/dbops.cc
// Function: deleteOp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, database*)
opStatus deleteOp(std::string key, int clientSocket, database* dbObject) {
  std::cout << "Deleting key <" 
            << key 
            << "> from the database ... " 
            << std::endl;
  return dbObject->deleteKey(key, clientSocket);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
movq 0x1e072(%rip), %r12     # 0x25fc0
leaq 0x133fe(%rip), %rsi     # 0x1b353
movl $0xe, %edx
movq %r12, %rdi
callq 0x5430
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r12, %rdi
callq 0x5430
movq %rax, %r12
leaq 0x133e7(%rip), %rsi     # 0x1b362
movl $0x18, %edx
movq %rax, %rdi
callq 0x5430
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x5370
movsbl %al, %esi
movq %r12, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5280
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x6924
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x710a
movl %eax, %ebx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7ff7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5390
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x801f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5390
movq %rbx, %rdi
callq 0x5670
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/memtable.cc
// Function: memtable::putKeyValuePair(keyValuePair_t)
void memtable::putKeyValuePair(keyValuePair_t keyValuePair) {
  bool isKeyPresent = this->isKeyPresent(keyValuePair.key);
  table[keyValuePair.key] = keyValuePair.value;
  // Increase size only on addition of a new key, and not on update.
  if(!isKeyPresent) {
    ++size;
  }
  // Log into the journal
  journalWritefd << (unsigned char)(keyValuePair.key.length())
                 << keyValuePair.key.c_str()
                 << (unsigned char)(keyValuePair.value.length())
                 << keyValuePair.value.c_str();
  journalWritefd.flush();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x6924
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1654e
movq %rax, %r15
leaq 0x8(%rbx), %r13
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x15c61
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5390
leaq 0x20(%r14), %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x16054
movq %rax, %rdi
movq %r12, %rsi
callq 0x5220
cmpq %r13, %r15
jne 0x15c83
incl 0x30(%rbx)
addq $0x60, %rbx
movb 0x8(%r14), %al
leaq 0xf(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x5430
movq %rax, %r15
movq (%r14), %r12
testq %r12, %r12
je 0x15cc2
movq %r12, %rdi
callq 0x51c0
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x5430
jmp 0x15cdc
movq (%r15), %rax
movq -0x18(%rax), %rax
movq %r15, %rdi
addq %rax, %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x5620
movb 0x28(%r14), %al
leaq 0xf(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0x5430
movq %rax, %r15
movq 0x20(%r14), %r14
testq %r14, %r14
je 0x15d18
movq %r14, %rdi
callq 0x51c0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x5430
jmp 0x15d32
movq (%r15), %rax
movq -0x18(%rax), %rax
movq %r15, %rdi
addq %rax, %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x5620
movq %rbx, %rdi
callq 0x5280
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x15d62
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5390
movq %rbx, %rdi
callq 0x5670
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/memtable.cc
// Function: memtable::getAllValues(int)
void memtable::getAllValues(int clientSocket) {
  std::map<std::string, std::string>::iterator it;
  for(it=table.begin();it!=table.end();it++){
    std::string ret = it->first+" -------> "+it->second+"\n";
    sendToClient(clientSocket, ret);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, 0x4(%rsp)
movq %rdi, %r14
movq 0x18(%rdi), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x15f61
leaq 0x58(%rsp), %rbx
leaq 0x38(%rsp), %r13
leaq 0x8(%rsp), %r12
leaq 0x68(%rsp), %rbp
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x6924
movq %r12, %rdi
leaq 0x63db(%rip), %rsi      # 0x1c1ed
callq 0x56f0
movq 0x40(%r15), %rsi
movq 0x48(%r15), %rdx
movq %r12, %rdi
callq 0x5100
movq %rbx, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x15e4a
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x15e50
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rdi
leaq 0x556f(%rip), %rsi      # 0x1b3e3
callq 0x56f0
movq %r13, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x15e9c
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x15ea4
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rdi
cmpq %rbx, %rdi
je 0x15ed3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5390
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x15eef
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5390
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x6924
movl 0x4(%rsp), %edi
movq %rbp, %rsi
callq 0x1a9d7
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x15f36
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5390
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x15f4d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5390
movq %r15, %rdi
callq 0x5290
movq %rax, %r15
cmpq %r14, %rax
jne 0x15deb
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x15f75
movq %rax, %r14
jmp 0x15f94
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %rbx, %rdi
je 0x15f94
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5390
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x15fe5
movq 0x18(%rsp), %rsi
jmp 0x15fdd
movq %rax, %r14
jmp 0x15fce
movq %rax, %r14
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x15fce
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5390
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x15fe5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5390
movq %r14, %rdi
callq 0x5670
nop
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/memtableWrapper.cc
// Function: memtableWrapper::memtableWrapper(int)
memtableWrapper::memtableWrapper(int lastMemtableID)
  : writeMutex(PTHREAD_MUTEX_INITIALIZER) {
  // Inserting atleast one memtableObject
  memtable* memtableObjPointer = new memtable(0, 
                                              MAX_MEMTABLE_SIZE, 
                                              lastMemtableID);
  memtableObjPointersList.push_back(memtableObjPointer);
  this->lastMemtableID = lastMemtableID;
  index = memtableObjPointersList.begin();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x30(%rdi)
movq $0x0, 0x40(%rdi)
movl $0x260, %edi            # imm = 0x260
callq 0x5380
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movl $0x3e8, %edx            # imm = 0x3E8
movl %ebp, %ecx
callq 0x156a0
movl $0x18, %edi
callq 0x5380
movq %r15, 0x10(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5080
incq 0x10(%rbx)
movl %ebp, 0x48(%rbx)
movq (%rbx), %rax
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x260, %esi            # imm = 0x260
movq %r15, %rdi
callq 0x5390
jmp 0x16623
movq %rax, %r14
movq (%rbx), %rdi
cmpq %rbx, %rdi
je 0x16640
movq (%rdi), %r15
movl $0x18, %esi
callq 0x5390
movq %r15, %rdi
cmpq %rbx, %r15
jne 0x1662b
movq %r14, %rdi
callq 0x5670
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/memtableWrapper.cc
// Function: memtableWrapper::writeMemtableToDisk(std::_List_iterator<memtable*>, sstableWrapper*, memtableWrapper*)
void memtableWrapper::writeMemtableToDisk(std::list<memtable*>::iterator iter,
    sstableWrapper* sstableWrapperObjRef, memtableWrapper* thisObj) {
  std::cout << "Dumping memtable "
            << "ID: " << (*iter)->memtableID
            << " to disk..." << std::endl;
  sstableWrapperObjRef->dumpMemtableToSSTable(*iter);
  //std::this_thread::sleep_for(std::chrono::seconds(20));
  //Delete index from list.
  memtable* memtableObj = *iter;
  thisObj->memtableObjPointersList.erase(iter);
  // Erase the journal file and then delete the object
  std::remove(memtableObj->journalFilePath.c_str());
  delete memtableObj;
  std::cout << "Dumped memtable." << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq 0xf66f(%rip), %rbx      # 0x25fc0
leaq 0x5a01(%rip), %rsi      # 0x1c359
movl $0x11, %edx
movq %rbx, %rdi
callq 0x5430
leaq 0x59ff(%rip), %rsi      # 0x1c36b
movl $0x4, %edx
movq %rbx, %rdi
callq 0x5430
movq 0x10(%r14), %rax
movl 0x38(%rax), %esi
movq %rbx, %rdi
callq 0x5650
movq %rax, %r13
leaq 0x59de(%rip), %rsi      # 0x1c370
movl $0xb, %edx
movq %rax, %rdi
callq 0x5430
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x5370
movsbl %al, %esi
movq %r13, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5280
movq 0x10(%r14), %rsi
movq %r12, %rdi
callq 0x19560
movq 0x10(%r14), %r12
decq 0x10(%r15)
movq %r14, %rdi
callq 0x55f0
movl $0x18, %esi
movq %r14, %rdi
callq 0x5390
movq 0x40(%r12), %rdi
callq 0x5690
movq %r12, %rdi
callq 0x15fee
movl $0x260, %esi            # imm = 0x260
movq %r12, %rdi
callq 0x5390
leaq 0x5966(%rip), %rsi      # 0x1c37c
movl $0x10, %edx
movq %rbx, %rdi
callq 0x5430
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5050
movq %rax, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5280
nop
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/memtableWrapper.cc
// Function: memtableWrapper::getAllValues(int)
opStatus memtableWrapper::getAllValues(int clientSocket) {
  std::list<memtable*>::iterator iter;
  for(iter = index; iter != memtableObjPointersList.begin(); iter--) {
    (*iter)->getAllValues(clientSocket);
  }
  // Checking in the memtable at the head of the list.
  (*iter)->getAllValues(clientSocket);
  return opStatus::opSuccess;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq 0x18(%rdi), %r15
cmpq %r15, (%rdi)
je 0x1730f
movq %rdi, %r14
movq 0x10(%r15), %rdi
movl %ebx, %esi
callq 0x15dae
movq 0x8(%r15), %r15
cmpq (%r14), %r15
jne 0x172fb
movq 0x10(%r15), %rdi
movl %ebx, %esi
callq 0x15dae
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/memtableWrapper.cc
// Function: memtableWrapper::~memtableWrapper()
memtableWrapper::~memtableWrapper() {
  std::list<memtable*>::iterator iter;
  for(iter = memtableObjPointersList.begin(); 
      iter != memtableObjPointersList.end();
      ++iter) {
    delete *iter;
  }
  memtableObjPointersList.clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r15
cmpq %rdi, %r15
je 0x17358
movq 0x10(%r15), %r14
testq %r14, %r14
je 0x17343
movq %r14, %rdi
callq 0x15fee
movl $0x260, %esi            # imm = 0x260
movq %r14, %rdi
callq 0x5390
movq (%r15), %r15
cmpq %rbx, %r15
jne 0x17332
movq %rbx, %rdi
callq 0x17420
movq (%rbx), %rdi
cmpq %rbx, %rdi
je 0x1737d
movq (%rdi), %r14
movl $0x18, %esi
callq 0x5390
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x17368
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/sstable.cc
// Function: sstable::sstable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
sstable::sstable(std::string filePath, 
                 std::string bloomFilePath,
                 std::string indexFilePath)
  : filePath(filePath),
    no_bytes(0),
    total_blocks(-1){
  
  // Bloom filter object  
  filter = new bloomFilter(bloomFilePath);
  
  struct stat buff;
  // Check if index present
  if(stat(indexFilePath.c_str(), &buff) != -1) {
    loadIndexInMemory();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rcx, %r13
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
leaq 0x38(%rdi), %r15
leaq 0x48(%rdi), %rax
movq %rax, (%rsp)
movq %rax, 0x38(%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x6924
leaq 0x58(%rbx), %r12
movq %r12, %rdi
movq %r15, 0x10(%rsp)
callq 0x5630
movq %r12, 0x8(%rsp)
leaq 0x258(%rbx), %r12
movq %r12, %rdi
callq 0x5630
movq $0x0, 0x458(%rbx)
movl $0xffffffff, 0x460(%rbx) # imm = 0xFFFFFFFF
movl $0x508, %edi            # imm = 0x508
callq 0x5380
movq %rax, %rbp
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0x6924
leaq 0x18(%rsp), %rsi
movq %rbp, %rdi
callq 0x6340
movq %rbp, 0x30(%rbx)
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x176b0
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5390
movq (%r13), %rdi
leaq 0x38(%rsp), %rsi
callq 0x5340
cmpl $-0x1, %eax
je 0x176cb
movq %rbx, %rdi
callq 0x1775e
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1770d
movq %rax, %r13
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x176fe
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5390
jmp 0x176fe
movq %rax, %r13
movl $0x508, %esi            # imm = 0x508
movq %rbp, %rdi
callq 0x5390
jmp 0x17710
movq %rax, %r13
movq %r12, %rdi
callq 0x5560
jmp 0x1771d
movq %rax, %r13
movq 0x8(%rsp), %rdi
callq 0x5560
movq 0x10(%rsp), %rax
movq (%rax), %rdi
cmpq (%rsp), %rdi
je 0x1774e
movq (%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x5390
jmp 0x1774e
movq %rax, %r13
jmp 0x17727
movq %rax, %r13
movq %rbx, %rdi
callq 0x18644
movq %r13, %rdi
callq 0x5670
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/sstableWrapper.cc
// Function: sstableWrapper::getAllValues(int)
opStatus sstableWrapper::getAllValues(int clientSocket) {
  std::list<sstable*>::reverse_iterator iter;
  int count = 0;
  for(iter = sstableObjRefList.rbegin();
      iter != sstableObjRefList.rend();
      ++iter) {
    ++count;
    opStatus ret = (*iter)->getAllValues(clientSocket);
  }
  std::cout << "Listed " << count << " SSTables!" << std::endl;
  return opStatus::opSuccess;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x8(%rdi), %r14
cmpq 0x8(%rdi), %r14
je 0x19f56
movl %esi, %ebp
xorl %ebx, %ebx
movq %r14, %r15
incl %ebx
movq 0x8(%r15), %rax
movq 0x10(%rax), %rdi
movl %ebp, %esi
callq 0x18142
movq 0x8(%r15), %r15
cmpq (%r14), %r15
jne 0x19f3a
jmp 0x19f58
xorl %ebx, %ebx
movq 0xc061(%rip), %r14      # 0x25fc0
leaq 0x263c(%rip), %rsi      # 0x1c5a2
movl $0x7, %edx
movq %r14, %rdi
callq 0x5430
movq %r14, %rdi
movl %ebx, %esi
callq 0x5650
movq %rax, %rbx
leaq 0x2623(%rip), %rsi      # 0x1c5aa
movl $0xa, %edx
movq %rax, %rdi
callq 0x5430
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5280
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/sstableWrapper.cc
// Function: sstableWrapper::~sstableWrapper()
sstableWrapper::~sstableWrapper() {
  std::list<sstable*>::iterator iter;
  for(iter = sstableObjRefList.begin();
      iter != sstableObjRefList.end();
      ++iter) {
    delete *iter;
  }
  delete sstable_no;
  sstableObjRefList.clear(); 
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
movq 0x8(%rdi), %r12
cmpq %rbx, %r12
je 0x1a005
movq 0x10(%r12), %r15
testq %r15, %r15
je 0x19ff2
movq %r15, %rdi
callq 0x18522
movl $0x468, %esi            # imm = 0x468
movq %r15, %rdi
callq 0x5390
movq (%r12), %r12
jmp 0x19fdb
movq (%r14), %rdi
movl $0x4, %esi
callq 0x5390
movq %rbx, %rdi
callq 0x1a044
movq 0x8(%r14), %rdi
cmpq %rbx, %rdi
je 0x1a038
movq (%rdi), %r14
movl $0x18, %esi
callq 0x5390
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x1a023
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/utils.cc
// Function: getKeyValuePair(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
keyValuePair_t getKeyValuePair(std::string inBuffer) {
  int i = 0;
  // Operator
  while(inBuffer[i] != '<') {
    ++i;
  }
  // Key
  std::string key = "";
  ++i;
  while(inBuffer[i] != '>') {
    key += inBuffer[i];
    ++i;
  }
  // Value
  std::string value = "";
  while(inBuffer[i] != '<') {
    ++i;
  }
  ++i;
  while(inBuffer[i] != '>') {
    value += inBuffer[i];
    ++i;
  }
  return keyValuePair_t(key, value);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
xorl %ebp, %ebp
cmpb $0x3c, (%rax,%rbp)
leaq 0x1(%rbp), %rbp
jne 0x1a09c
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x132d(%rip), %rdx      # 0x1b3e4
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %rdx, %rsi
callq 0x736c
movq (%r14), %rax
movb (%rax,%rbp), %al
cmpb $0x3e, %al
je 0x1a0e1
incq %rbp
movsbl %al, %esi
movq %r15, %rdi
callq 0x5310
jmp 0x1a0c7
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x12f3(%rip), %rdx      # 0x1b3e4
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x736c
movq (%r14), %rax
cmpb $0x3c, (%rax,%rbp)
leaq 0x1(%rbp), %rbp
jne 0x1a101
leaq 0x8(%rsp), %r15
movq (%r14), %rax
movb (%rax,%rbp), %al
cmpb $0x3e, %al
je 0x1a12a
incq %rbp
movsbl %al, %esi
movq %r15, %rdi
callq 0x5310
jmp 0x1a110
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x6924
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x6924
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
callq 0x72f4
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a193
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5390
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x1a1aa
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5390
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a1c1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5390
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a1d8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5390
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a20c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5390
jmp 0x1a20c
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x1a22c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5390
jmp 0x1a22c
jmp 0x1a229
jmp 0x1a245
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a248
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5390
jmp 0x1a248
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a25f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5390
movq %rbx, %rdi
callq 0x5670
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/dbengine/utils.cc
// Function: getKey(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string getKey(std::string inBuffer) {
  int i = 0;
  // Operator
  while(inBuffer[i] != '<') {
    ++i;
  }
  // Key
  std::string key = "";
  ++i;
  while(inBuffer[i] != '>') {
    key += inBuffer[i];
    ++i;
  }
  return key;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
xorl %r12d, %r12d
cmpb $0x3c, (%rax,%r12)
leaq 0x1(%r12), %r12
jne 0x1a27b
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
leaq 0x114f(%rip), %rdx      # 0x1b3e4
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x736c
movq (%r14), %rax
movb (%rax,%r12), %al
cmpb $0x3e, %al
je 0x1a2bb
incq %r12
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5310
jmp 0x1a2a0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x1a2e0
movq (%r15), %rsi
incq %rsi
callq 0x5390
movq %r14, %rdi
callq 0x5670
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/serverCode/server.cc
// Function: thread_function(void*)
void* thread_function(void* arg) {
  int* pclient;
  while(true) {
    pclient = NULL;

    pthread_mutex_lock(&mutex);
    if(conn_queue.size() == 0) {
      // The thread waits until it is signaled to wake up. The lock (mutex) is
      // also released meanwhile, and when signaled the thread first acquires
      // lock and then only returns here to continue execution.
      pthread_cond_wait(&condition_var, &mutex);
    }
    // Now there is a request in the queue to be handled.
    pclient = conn_queue.front();
    conn_queue.pop();
    pthread_mutex_unlock(&mutex);

    if(pclient != NULL) {
      handle_connection(pclient);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xc3d7(%rip), %rbx      # 0x268c0
leaq 0xc3f8(%rip), %r14      # 0x268e8
leaq 0xc379(%rip), %r15      # 0x26870
movq %rbx, %rdi
callq 0x5550
movq 0xc3b2(%rip), %rax      # 0x268b8
movq %rax, %rcx
subq 0xc388(%rip), %rcx      # 0x26898
shrq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
movq 0xc37d(%rip), %rdx      # 0x268a0
subq 0xc37e(%rip), %rdx      # 0x268a8
shlq $0x6, %rcx
sarq $0x3, %rdx
addq %rcx, %rdx
movq 0xc354(%rip), %rcx      # 0x26890
movq 0xc33d(%rip), %rax      # 0x26880
subq %rax, %rcx
sarq $0x3, %rcx
addq %rdx, %rcx
jne 0x1a561
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5580
movq 0xc31f(%rip), %rax      # 0x26880
movq (%rax), %r12
movq %r15, %rdi
callq 0x1af3a
movq %rbx, %rdi
callq 0x52c0
testq %r12, %r12
je 0x1a4f7
movq %r12, %rdi
callq 0x1a59b
jmp 0x1a4f7
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/serverCode/server.cc
// Function: sendWelcomeMessage(int)
void sendWelcomeMessage(int client_socket) {
  std::string welcome;
  
  welcome = "*************************************************************\n";
  welcome += "*                Welcome to myDB Engine                     *\n";
  welcome += "*        Created by : Prakhar Sinha, Shorya Jain            *\n";
  welcome += "*        (Type exit to terminate the connection)            *\n";
  welcome += "*************************************************************\n"; 
  
  write(client_socket, &welcome[0], strlen(welcome.c_str()));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x1d19(%rip), %rcx      # 0x1c648
movq %rsp, %rdi
movl $0x3e, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x55b0
leaq 0x1d3f(%rip), %rsi      # 0x1c687
movq %rsp, %rdi
callq 0x56f0
leaq 0x1d6f(%rip), %rsi      # 0x1c6c6
movq %rsp, %rdi
callq 0x56f0
leaq 0x1d9f(%rip), %rsi      # 0x1c705
movq %rsp, %rdi
callq 0x56f0
leaq 0x1cd3(%rip), %rsi      # 0x1c648
movq %rsp, %rdi
callq 0x56f0
movq (%rsp), %r14
movq %r14, %rdi
callq 0x51c0
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x5140
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1a9ac
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5390
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1a9cf
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5390
movq %rbx, %rdi
callq 0x5670
// File: /workspace/github_cpp_makefile_star2_O3/prakhar2808[P]DBEngine/serverCode/server.cc
// Function: sendGoodByeMessage(int)
void sendGoodByeMessage(int client_socket) {
  std::string goodBye;
  
  goodBye = "*************************************************************\n";
  goodBye += "*                       Good Bye!                           *\n";
  goodBye += "*************************************************************\n";

  write(client_socket, &goodBye[0], strlen(goodBye.c_str()));  
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x1b98(%rip), %rcx      # 0x1c648
movq %rsp, %rdi
movl $0x3e, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x55b0
leaq 0x1c7b(%rip), %rsi      # 0x1c744
movq %rsp, %rdi
callq 0x56f0
leaq 0x1b70(%rip), %rsi      # 0x1c648
movq %rsp, %rdi
callq 0x56f0
movq (%rsp), %r14
movq %r14, %rdi
callq 0x51c0
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x5140
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1ab0f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5390
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1ab32
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5390
movq %rbx, %rdi
callq 0x5670
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::fill_cache(unsigned int, unsigned int, PACKET*)
void CACHE::fill_cache(uint32_t set, uint32_t way, PACKET *packet)
{
#ifdef SANITY_CHECK
    if (cache_type == IS_ITLB) {
        if (packet->data == 0)
            assert(0);
    }

    if (cache_type == IS_DTLB) {
        if (packet->data == 0)
            assert(0);
    }

    if (cache_type == IS_STLB) {
        if (packet->data == 0)
            assert(0);
    }
#endif
    if (block[set][way].prefetch && (block[set][way].used == 0))
        STATS.pf_useless++;

    if (block[set][way].valid == 0)
        block[set][way].valid = 1;
    block[set][way].dirty = 0;
    block[set][way].prefetch = (packet->type == PREFETCH) ? 1 : 0;
    block[set][way].used = 0;

    if (block[set][way].prefetch)
        STATS.pf_fill++;

    block[set][way].delta = packet->delta;
    block[set][way].depth = packet->depth;
    block[set][way].signature = packet->signature;
    block[set][way].confidence = packet->confidence;

    block[set][way].tag = packet->address;
    block[set][way].address = packet->address;
    block[set][way].full_addr = packet->full_addr;
    block[set][way].data = packet->data;
    block[set][way].cpu = packet->cpu;
    block[set][way].instr_id = packet->instr_id;

    DP ( if (warmup_complete[packet->cpu]) {
    cout << "[" << NAME << "] " << __func__ << " set: " << set << " way: " << way;
    cout << " lru: " << block[set][way].lru << " tag: " << hex << block[set][way].tag << " full_addr: " << block[set][way].full_addr;
    cout << " data: " << block[set][way].data << dec << endl; });
}

// Assembly:
pushq %rax
movzbl 0x73a4(%rdi), %eax
cmpl $0x2, %eax
je 0x4092
cmpl $0x1, %eax
je 0x4069
testl %eax, %eax
jne 0x40a0
cmpq $0x0, 0x360(%rcx)
jne 0x40a0
leaq 0x10016(%rip), %rdi     # 0x14067
leaq 0x10011(%rip), %rsi     # 0x14069
leaq 0x100c5(%rip), %rcx     # 0x14124
movl $0x337, %edx            # imm = 0x337
callq 0x3160
cmpq $0x0, 0x360(%rcx)
jne 0x40a0
leaq 0xffed(%rip), %rdi      # 0x14067
leaq 0xffe8(%rip), %rsi      # 0x14069
leaq 0x1009c(%rip), %rcx     # 0x14124
movl $0x33c, %edx            # imm = 0x33C
callq 0x3160
cmpq $0x0, 0x360(%rcx)
je 0x4137
movq 0x7390(%rdi), %rax
movl %esi, %esi
movq (%rax,%rsi,8), %rax
movl %edx, %edx
leaq (%rdx,%rdx,4), %rdx
shlq $0x4, %rdx
leaq (%rax,%rdx), %rsi
cmpb $0x0, 0x1(%rax,%rdx)
je 0x40cf
cmpb $0x0, 0x3(%rsi)
jne 0x40cf
incq 0x102d8(%rdi)
cmpb $0x0, (%rsi)
jne 0x40d7
movb $0x1, (%rsi)
xorl %esi, %esi
movb %sil, 0x2(%rax,%rdx)
cmpb $0x2, 0x32f(%rcx)
sete 0x1(%rax,%rdx)
movb %sil, 0x3(%rax,%rdx)
jne 0x40f8
incq 0x102e0(%rdi)
movups 0x18(%rcx), %xmm0
movups %xmm0, 0x4(%rax,%rdx)
movups 0x340(%rcx), %xmm0
movlps %xmm0, 0x28(%rax,%rdx)
movups %xmm0, 0x18(%rax,%rdx)
movq 0x360(%rcx), %rsi
movq %rsi, 0x30(%rax,%rdx)
movl 0x330(%rcx), %esi
movq %rsi, 0x38(%rax,%rdx)
movq 0x368(%rcx), %rcx
movq %rcx, 0x40(%rax,%rdx)
popq %rax
retq
leaq 0xff29(%rip), %rdi      # 0x14067
leaq 0xff24(%rip), %rsi      # 0x14069
leaq 0xffd8(%rip), %rcx      # 0x14124
movl $0x341, %edx            # imm = 0x341
callq 0x3160
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::add_mshr(PACKET*)
void CACHE::add_mshr(PACKET *packet)
{
    uint32_t index = 0;

    // search mshr
    for (index=0; index<MSHR_SIZE; index++) {
        if (MSHR.entry[index].address == 0) {
            
            memcpy(&MSHR.entry[index], packet, sizeof(PACKET));
            MSHR.entry[index].returned = INFLIGHT;
            MSHR.occupancy++;

            DP ( if (warmup_complete[packet->cpu]) {
            cout << "[" << NAME << "_MSHR] " << __func__ << " instr_id: " << packet->instr_id;
            cout << " address: " << hex << packet->address << " full_addr: " << packet->full_addr << dec;
            cout << " index: " << index << " occupancy: " << MSHR.occupancy << endl; });

            break;
        }
    }
}

// Assembly:
movl 0x7388(%rdi), %eax
testq %rax, %rax
je 0x4bc6
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xca20(%rdi), %rdi
imulq $0x380, %rax, %rax      # imm = 0x380
xorl %r14d, %r14d
cmpq $0x0, 0x340(%rdi,%r14)
je 0x4b9c
addq $0x380, %r14            # imm = 0x380
cmpq %r14, %rax
jne 0x4b83
jmp 0x4bbf
addq %r14, %rdi
movl $0x380, %edx            # imm = 0x380
callq 0x31c0
movq 0xca20(%rbx), %rax
movb $0x1, 0x32c(%rax,%r14)
incl 0xc9bc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::operate()
void CACHE::operate()
{
    handle_fill();
    handle_writeback();
    handle_read();

    if (PQ.occupancy && (RQ.occupancy == 0))
        handle_prefetch();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x392c
movq %rbx, %rdi
callq 0x4156
movq %rbx, %rdi
callq 0x4bc8
cmpl $0x0, 0xad1c(%rbx)
je 0x5916
cmpl $0x0, 0x907c(%rbx)
jne 0x5916
movq %rbx, %rdi
popq %rbx
jmp 0x54b2
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::invalidate_entry(unsigned long)
int CACHE::invalidate_entry(uint64_t inval_addr)
{
    uint32_t set = get_set(inval_addr);
    int match_way = -1;

    if (NUM_SET < set) {
        cerr << "[" << NAME << "_ERROR] " << __func__ << " invalid set index: " << set << " NUM_SET: " << NUM_SET;
        cerr << " inval_addr: " << hex << inval_addr << dec << endl;
        assert(0);
    }

    // invalidate
    for (uint32_t way=0; way<NUM_WAY; way++) {
        if (block[set][way].valid && (block[set][way].tag == inval_addr)) {

            block[set][way].valid = 0;

            match_way = way;

            DP ( if (warmup_complete[cpu]) {
            cout << "[" << NAME << "] " << __func__ << " inval_addr: " << hex << inval_addr;  
            cout << " tag: " << block[set][way].tag << " data: " << block[set][way].data << dec;
            cout << " set: " << set << " way: " << way << " lru: " << block[set][way].lru << " cycle: " << current_core_cycle[cpu] << endl; });

            break;
        }
    }

    return match_way;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x7370(%rdi), %edi
callq 0x9203
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shll %cl, %edx
notl %edx
movl %ebx, %ebp
andl %edx, %ebp
cmpl %ebp, 0x7370(%r14)
jb 0x59cf
movl 0x7374(%r14), %ecx
testq %rcx, %rcx
je 0x59c4
movq 0x7390(%r14), %rdx
movl %ebp, %esi
movq (%rdx,%rsi,8), %rsi
xorl %edx, %edx
cmpb $0x0, (%rsi)
je 0x59b1
cmpq %rbx, 0x28(%rsi)
je 0x59bf
incq %rdx
addq $0x50, %rsi
cmpq %rdx, %rcx
jne 0x59a6
jmp 0x59c4
movb $0x0, (%rsi)
movl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x1461a(%rip), %r15     # 0x19ff0
leaq 0xe6b3(%rip), %rsi      # 0x14090
movq %r15, %rdi
callq 0x3250
leaq 0x7350(%r14), %rsi
movq %rax, %rdi
callq 0x31e0
leaq 0xf31b(%rip), %rsi      # 0x14d16
movq %rax, %rdi
callq 0x3250
leaq 0xe7b9(%rip), %rsi      # 0x141c3
movq %rax, %rdi
callq 0x3250
leaq 0xe74a(%rip), %rsi      # 0x14163
movq %rax, %rdi
callq 0x3250
movq %rax, %rdi
movl %ebp, %esi
callq 0x32d0
leaq 0xe746(%rip), %rsi      # 0x14178
movq %rax, %rdi
callq 0x3250
movl 0x7370(%r14), %esi
movq %rax, %rdi
callq 0x32d0
leaq 0xe784(%rip), %rsi      # 0x141d4
movq %r15, %rdi
callq 0x3250
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3090
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
callq 0x3110
leaq 0xe5cb(%rip), %rdi      # 0x14067
leaq 0xe5c6(%rip), %rsi      # 0x14069
leaq 0xe738(%rip), %rcx      # 0x141e2
movl $0x389, %edx            # imm = 0x389
callq 0x3160
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::prefetch_line(unsigned long, unsigned long, unsigned long, int)
int CACHE::prefetch_line(uint64_t ip, uint64_t base_addr, uint64_t pf_addr, int fill_level)
{
    if (PQ.occupancy < PQ.SIZE) {
        if ((base_addr>>PAGE_SHIFT) == (pf_addr>>PAGE_SHIFT)) {
            
            PACKET pf_packet;
            pf_packet.fill_level = fill_level;
            pf_packet.cpu = cpu;
            //pf_packet.data_index = LQ.entry[lq_index].data_index;
            //pf_packet.lq_index = lq_index;
            pf_packet.address = pf_addr >> LOG2_BLOCK_SIZE;
            pf_packet.full_addr = pf_addr;
            //pf_packet.instr_id = LQ.entry[lq_index].instr_id;
            //pf_packet.rob_index = LQ.entry[lq_index].rob_index;
            pf_packet.ip = ip;
            pf_packet.type = PREFETCH;
            pf_packet.event_cycle = current_core_cycle[cpu];

            // give a dummy 0 as the IP of a prefetch
            add_pq(&pf_packet);

            return 1;
        }
    }

    return 0;
}

// Assembly:
xorq %rcx, %rdx
xorl %eax, %eax
cmpq $0xfff, %rdx            # imm = 0xFFF
ja 0x61b0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movq %rcx, %r14
movq %rdi, %rbx
movl 0xad08(%rdi), %ecx
cmpl %ecx, 0xad1c(%rdi)
jae 0x619f
movl %r8d, %ebp
movq %rsi, %r15
xorl %r13d, %r13d
leaq 0x20(%rsp), %r12
movl %r13d, -0x15(%r12)
movl %r13d, -0x18(%r12)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, -0x10(%r12)
movl $0x314, %edx            # imm = 0x314
movq %r12, %rdi
xorl %esi, %esi
callq 0x3130
pxor %xmm0, %xmm0
movdqu %xmm0, 0x31c(%r12)
movdqu %xmm0, 0x32c(%r12)
movl %r13d, 0x33c(%r12)
movdqu %xmm0, 0x348(%r12)
movl %ebp, -0x10(%r12)
movl 0x7348(%rbx), %eax
movl %eax, 0x318(%r12)
movq %r14, %rcx
shrq $0x6, %rcx
movq %rcx, 0x328(%r12)
movq %r14, 0x330(%r12)
movq %r15, 0x358(%r12)
movl $0x2ffff00, 0x314(%r12) # imm = 0x2FFFF00
leaq 0x7ad40(%rip), %rcx     # 0x80ec0
movq (%rcx,%rax,8), %rax
movq %rax, 0x360(%r12)
movq (%rbx), %rax
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq *0x10(%rax)
movl $0x1, %eax
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::kpc_prefetch_line(unsigned long, unsigned long, int, int, int, int, int)
int CACHE::kpc_prefetch_line(uint64_t base_addr, uint64_t pf_addr, int fill_level, int delta, int depth, int signature, int confidence)
{
    if (PQ.occupancy < PQ.SIZE) {
        if ((base_addr>>PAGE_SHIFT) == (pf_addr>>PAGE_SHIFT)) {
            
            PACKET pf_packet;
            pf_packet.fill_level = fill_level;
            pf_packet.cpu = cpu;
            //pf_packet.data_index = LQ.entry[lq_index].data_index;
            //pf_packet.lq_index = lq_index;
            pf_packet.address = pf_addr >> LOG2_BLOCK_SIZE;
            pf_packet.full_addr = pf_addr;
            //pf_packet.instr_id = LQ.entry[lq_index].instr_id;
            //pf_packet.rob_index = LQ.entry[lq_index].rob_index;
            pf_packet.ip = 0;
            pf_packet.type = PREFETCH;
            pf_packet.delta = delta;
            pf_packet.depth = depth;
            pf_packet.signature = signature;
            pf_packet.confidence = confidence;
            pf_packet.event_cycle = current_core_cycle[cpu];

            // give a dummy 0 as the IP of a prefetch
            add_pq(&pf_packet);

            STATS.pf_issued++;

            return 1;
        }
    }

    return 0;
}

// Assembly:
xorq %rdx, %rsi
xorl %eax, %eax
cmpq $0xfff, %rsi            # imm = 0xFFF
ja 0x62f0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movl %ecx, %r12d
movq %rdi, %rbx
movl 0xad08(%rdi), %ecx
cmpl %ecx, 0xad1c(%rdi)
jae 0x62df
movq %rdx, %r15
leaq 0x30(%rsp), %r13
movw $0xff00, 0x304(%r13)    # imm = 0xFF00
xorl %ebp, %ebp
movl %ebp, -0x28(%r13)
movl %ebp, -0x25(%r13)
movb $-0x1, 0x306(%r13)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, -0x20(%r13)
movl $0x304, %edx            # imm = 0x304
movq %r13, %rdi
xorl %esi, %esi
movl %r9d, 0x4(%rsp)
movl %r8d, %r14d
callq 0x3130
pxor %xmm0, %xmm0
movdqu %xmm0, 0x30c(%r13)
movdqu %xmm0, 0x31c(%r13)
movl %ebp, 0x32c(%r13)
movdqu %xmm0, 0x338(%r13)
movl %r12d, -0x20(%r13)
movl 0x7348(%rbx), %eax
movl %eax, 0x308(%r13)
movq %r15, %rcx
shrq $0x6, %rcx
movq %rcx, 0x318(%r13)
movq %r15, 0x320(%r13)
movq $0x0, 0x348(%r13)
movb $0x2, 0x307(%r13)
movl %r14d, -0x10(%r13)
movl 0x4(%rsp), %ecx
movl %ecx, -0xc(%r13)
movl 0x3c0(%rsp), %ecx
movl %ecx, -0x8(%r13)
movl 0x3c8(%rsp), %ecx
movl %ecx, -0x4(%r13)
leaq 0x7ac06(%rip), %rcx     # 0x80ec0
movq (%rcx,%rax,8), %rax
movq %rax, 0x350(%r13)
movq (%rbx), %rax
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq *0x10(%rax)
incq 0x102c8(%rbx)
movl $0x1, %eax
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::get_occupancy(unsigned char)
uint32_t CACHE::get_occupancy(uint8_t queue_type)
{
    if (queue_type == 0)
        return MSHR.occupancy;
    else if (queue_type == 1)
        return RQ.occupancy;
    else if (queue_type == 2)
        return WQ.occupancy;
    else if (queue_type == 3)
        return PQ.occupancy;

    return 0;
}

// Assembly:
cmpl $0x3, %esi
ja 0x6803
movl %esi, %eax
leaq 0xd862(%rip), %rcx      # 0x14040
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0xc9bc(%rdi), %eax
retq
movl 0x73dc(%rdi), %eax
retq
movl 0xad1c(%rdi), %eax
retq
movl 0x907c(%rdi), %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/cache.cc
// Function: CACHE::get_size(unsigned char)
uint32_t CACHE::get_size(uint8_t queue_type)
{
    if (queue_type == 0)
        return MSHR.SIZE;
    else if (queue_type == 1)
        return RQ.SIZE;
    else if (queue_type == 2)
        return WQ.SIZE;
    else if (queue_type == 3)
        return PQ.SIZE;

    return 0;
}

// Assembly:
cmpl $0x3, %esi
ja 0x6839
movl %esi, %eax
leaq 0xd83c(%rip), %rcx      # 0x14050
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0xc9a8(%rdi), %eax
retq
movl 0x73c8(%rdi), %eax
retq
movl 0xad08(%rdi), %eax
retq
movl 0x9068(%rdi), %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/main.cc
// Function: lg2(int)
int lg2(int n)
{
    int i, m = n, c = -1;
    for (i=0; m; i++) {
        m /= 2;
        c++;
    }
    return c;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %edi, %edi
je 0x9220
movl %edi, %ecx
shrl $0x1f, %ecx
addl %edi, %ecx
sarl %ecx
incl %eax
incl %edi
cmpl $0x2, %edi
movl %ecx, %edi
ja 0x920e
retq
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/dram_controller.cc
// Function: MEMORY_CONTROLLER::update_process_cycle(PACKET_QUEUE*)
void MEMORY_CONTROLLER::update_process_cycle(PACKET_QUEUE *queue)
{
    // update next_process_cycle
    uint64_t min_cycle = UINT64_MAX;
    uint32_t min_index = queue->SIZE;
    for (uint32_t i=0; i<queue->SIZE; i++) {
        if (queue->entry[i].scheduled && (queue->entry[i].event_cycle < min_cycle)) {
            min_cycle = queue->entry[i].event_cycle;
            min_index = i;
        }
    }
    
    queue->next_process_cycle = min_cycle;
    queue->next_process_index = min_index;
    if (min_index < queue->SIZE) {

        DP (if (warmup_complete[queue->entry[min_index].cpu]) {
        cout << "[" << queue->NAME << "] " <<  __func__ << " instr_id: " << queue->entry[min_index].instr_id;
        cout << " address: " << hex << queue->entry[min_index].address << " full_addr: " << queue->entry[min_index].full_addr;
        cout << " data: " << queue->entry[min_index].data << dec << " num_returned: " << queue->num_returned;
        cout << " event: " << queue->entry[min_index].event_cycle << " current: " << current_core_cycle[queue->entry[min_index].cpu] << " next: " << queue->next_process_cycle << endl; });
    }
}

// Assembly:
movl 0x20(%rsi), %eax
testq %rax, %rax
je 0xb8ef
movq 0x98(%rsi), %rdi
addq $0x2, %rdi
movq $-0x1, %rcx
xorl %r8d, %r8d
movl %eax, %edx
cmpb $0x0, (%rdi)
je 0xb8de
movq 0x376(%rdi), %r9
cmpq %rcx, %r9
cmovbq %r9, %rcx
cmovbl %r8d, %edx
incq %r8
addq $0x380, %rdi            # imm = 0x380
cmpq %r8, %rax
jne 0xb8c7
jmp 0xb8f8
xorl %edx, %edx
movq $-0x1, %rcx
movq %rcx, 0x58(%rsi)
movl %edx, 0x44(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/NishadSaraf[P]Championship-Simulator/src/dram_controller.cc
// Function: MEMORY_CONTROLLER::get_occupancy(unsigned char)
uint32_t MEMORY_CONTROLLER::get_occupancy(uint8_t queue_type)
{
    if (queue_type == 1)
        return RQ.occupancy;
    else if (queue_type == 2)
        return WQ.occupancy;

    return 0;
}

// Assembly:
cmpl $0x2, %esi
je 0xc21f
xorl %eax, %eax
cmpl $0x1, %esi
jne 0xc225
movl 0x9f2c(%rdi), %eax
retq
movl 0x828c(%rdi), %eax
retq