LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./xthread.hh
// Function: xthread::allocThreadIndex()
int allocThreadIndex() {
    int index = -1;

		if(_aliveThreads == MAX_ALIVE_THREADS) {
				FATAL("maximum concurrent thread limit reached (%d)", MAX_ALIVE_THREADS);
		}

    thread_t* thread;
		if(_aliveThreads++ == _threadIndex) {
			index = _threadIndex++;
      thread = getThread(index);
			thread->available = false;
		} else {
			for(int i = 0; i <= _threadIndex; i++) {
      	thread = getThread(i);
      	if(thread->available) {
        	thread->available = false;
					index = i;
					break;
				}
			}
		}
    return index;
  }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movslq 0x38(%rdi), %rax
cmpq $0x80, %rax
je 0x6f52
leal 0x1(%rax), %edx
movl %edx, 0x38(%rdi)
movslq 0x4(%rdi), %rcx
cmpl %ecx, %eax
jne 0x6f28
movl %edx, 0x4(%rdi)
imulq $0x1028, %rax, %rcx     # imm = 0x1028
addq %rcx, %rdi
addq $0x40, %rdi
jmp 0x6f49
addq $0x40, %rdi
xorl %edx, %edx
pushq $-0x1
popq %rax
cmpq %rcx, %rdx
jg 0x6f4c
cmpb $0x1, (%rdi)
je 0x6f47
incq %rdx
addq $0x1028, %rdi           # imm = 0x1028
jmp 0x6f31
movl %edx, %eax
movb $0x0, (%rdi)
addq $0x10, %rsp
popq %rbx
retq
callq 0x4200
movq %rax, %rbx
callq 0x4280
movl $0x80, (%rsp)
leaq 0x2cbf(%rip), %rdx      # 0x9c2c
leaq 0x2c83(%rip), %r8       # 0x9bf7
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %rax, %rcx
movl $0x90, %r9d
xorl %eax, %eax
callq 0x4560
callq 0x4200
movq %rax, %rbx
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4100
pushq $-0x1
popq %rdi
callq 0x43e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./xthread.hh
// Function: xthread::initializeCurrentThread(thread*)
void initializeCurrentThread(thread_t * thread) {
		SRAND(time(NULL));
		thread->tid = syscall(__NR_gettid);
		#ifndef CUSTOMIZED_STACK
		setThreadIndex(thread->index);
		#endif
		// Adding the thread's pthreadt.
		thread->pthreadt = pthread_self();
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
xorl %edi, %edi
callq 0x42b0
movl %eax, %edi
callq 0x4310
movl $0xba, %edi
xorl %eax, %eax
callq 0x4040
movl %eax, 0x4(%rbx)
movl 0x10(%rbx), %ebp
leaq 0x6f9a(%rip), %rdi      # 0xdf80
callq 0x45c0
movl %ebp, (%rax)
callq 0x4280
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./hashmap.hh
// Function: HashMap<void*, int, HeapAllocator>::insertEntry(HashMap<void*, int, HeapAllocator>::HashEntry*, void* const&, unsigned long, int)
void insertEntry(struct HashEntry* head, const KeyType& key, size_t keylen, ValueType value) {
    // Check whether the first entry is empty or not.
    // Create an entry
    struct Entry* entry = createNewEntry(key, keylen, value);
    listInsertTail(&entry->list, &head->list);
    head->count++;
    /*
		PRINF("insertEntry entry %p at head %p, headcount %ld\n", entry, head, head->count);
    PRINF("insertEntry entry %p, entrynext %p, at head %p hear->list %p headlist->next %p\n", entry,
          entry->list.next, head, &head->list, head->list.next);
	*/
  }

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq %rdx, %rsi
movq %rcx, %rdx
movl %r8d, %ecx
callq 0x45d0
movq (%rbx), %rcx
movq %rbx, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
movq %rax, (%rbx)
incq 0x10(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./hashmap.hh
// Function: HashMap<void*, int, HeapAllocator>::createNewEntry(void* const&, unsigned long, int)
struct Entry* createNewEntry(const KeyType& key, size_t keylen, ValueType value) {
    struct Entry* entry = (struct Entry*)SourceHeap::allocate(sizeof(struct Entry));

    // Initialize this new entry.
    entry->initialize(key, keylen, value);
    return entry;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq 0x6eea(%rip), %rax      # 0xdf28
pushq $0x28
popq %rdi
callq *(%rax)
movq (%r15), %rcx
movq %rax, (%rax)
movq %rax, 0x8(%rax)
movq %rcx, 0x10(%rax)
movslq %r14d, %rcx
movq %rcx, 0x18(%rax)
movl %ebx, 0x20(%rax)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::BibopObjCache::malloc()
void * malloc() {
					// TODO: change how this repopulation threshold is calculated
					// Ex: cache size = 256, half cache size = 128, bag size = 32MB (yes, very small);
					// only 64 objects exist in each 512KB class; thus, we would never reach the cache
					// allowance of used objects until something bad has happened (segfault, doubly-
					// allocated objects, etc.)   -- SAS
					if(_numUsedObjects > BIBOP_HALF_CACHE_SIZE) {
							// Pull in free objects from the free cache
							//PRDBG("out of objects in the cache; need to repopulate from free cache");
							repopulate();
					}

					//#pragma message "doReplacement turned off"
					//bool doReplacement = false;
					bool doReplacement = true;
					uintptr_t object = getRandomObject(doReplacement);

    			#ifdef USE_CANARY
					// We must install the canary prior to marking the object as in-use,
					// otherwise another thread performing neighbor checking could
					// identify the object as in-use, but will raise a false alarm
					// due to the missing canary value.
					char * canary = (char *)object + _classSize - 1;
					*canary = CANARY_SENTINEL;
    			#endif

					// Mark the object as in-use in the shadow memory
					if(!markObjectUsed(object)) {
							FATAL("object 0x%lx already set as in-use", object);
					}

					PRDBG("...returning object 0x%lx", object);
					return (void *)object;
			}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq 0x6e2e(%rip), %rax      # 0xdf20
movl 0x8(%rax), %eax
shrl %eax
cmpl %eax, 0x2c(%rdi)
jbe 0x7104
movq %r14, %rdi
callq 0x4490
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x45b0
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x44d0
movl %eax, %ebp
callq 0x4200
movq %rax, %r14
callq 0x4280
testb %bpl, %bpl
je 0x718a
movq %rbx, (%rsp)
leaq 0x2cb6(%rip), %rdx      # 0x9df2
leaq 0x2437(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0x1ae, %r9d            # imm = 0x1AE
xorl %eax, %eax
callq 0x4560
callq 0x4200
movq %rax, %r14
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x4100
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, (%rsp)
leaq 0x2c0f(%rip), %rdx      # 0x9da4
leaq 0x23de(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0x1ab, %r9d            # imm = 0x1AB
xorl %eax, %eax
callq 0x4560
callq 0x4200
movq %rax, %rbx
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4100
pushq $-0x1
popq %rdi
callq 0x43e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::BibopObjCache::markObjectUsed(unsigned long)
bool markObjectUsed(uintptr_t object) {
					shadowObjectInfo * shadowMemAddr = BibopHeap::getInstance().getShadowObjectInfo((void *)object);
					shadowObjectInfo oldSmValue = *shadowMemAddr;
					*shadowMemAddr = ALLOC_SENTINEL;

					return (oldSmValue == FREE_SENTINEL);
			}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x4110
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x4610
cmpb $0x0, (%rax)
movb $0x1, (%rax)
sete %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::BibopObjCache::initialPopulate()
void initialPopulate() {
					unsigned i;

					// Initialize each of the cache region object
					// counters to indicate a full buffer
					for(i = 0; i < NUM_CACHE_REGIONS; i++) {
							_regionCounters[i] = CACHE_REGION_SIZE;
					}

					// Initialize the cache with new objects from top of current subheap
					for(i = 0; i < BibopHeap::_cacheSize; i++) {
							_objects[i] = getNext();

							assert(_objects[i] != NULL);
					}

					// If we decide to place the object cache in mmap'd memory rather than
					// global memory we MUST ensure that unused entries are initialized to
					// zero
					for(i = BibopHeap::_cacheSize; i < BibopHeap::_cacheSize; i++) {
							_objects[i] = NULL;
					}
			}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x654d(%rip), %rax      # 0xdf20
movl 0x8(%rax), %eax
shrl $0x3, %eax
pushq $0xd
popq %rcx
cmpq $0x15, %rcx
je 0x79ea
movl %eax, (%rbx,%rcx,4)
incq %rcx
jmp 0x79dc
xorl %r14d, %r14d
movq 0x657c(%rip), %r15      # 0xdf70
movl (%r15), %eax
cmpq %rax, %r14
jae 0x7a3a
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq 0x58(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
movq 0x58(%rbx), %rax
cmpq $0x0, (%rax,%r14,8)
leaq 0x1(%r14), %r14
jne 0x79f4
leaq 0x2905(%rip), %rdi      # 0xa327
leaq 0x1b51(%rip), %rsi      # 0x957a
leaq 0x290b(%rip), %rcx      # 0xa33b
movl $0x1c1, %edx            # imm = 0x1C1
callq 0x4220
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::getShadowObjectInfo(void*, BibopHeap::PerThreadBag**, void**, BibopHeap::PerThreadBag**)
inline shadowObjectInfo * getShadowObjectInfo(void * addr, PerThreadBag ** bag = NULL,
					void ** objectStart = NULL, PerThreadBag ** ownerBag = NULL) {
		unsigned long offset = (char *)addr - _heapBegin;
    unsigned long localBagOffset = offset & _bagMask;
		unsigned long globalBagNum = offset >> _bagShiftBits;
		unsigned long origOwnerTindex = offset >> _threadShiftBits;
		unsigned long origBagNum = globalBagNum & _numBagsPerSubHeapMask;

		PerThreadBag * origBag = &_threadBag[origOwnerTindex][origBagNum];

		if(bag) {
				unsigned objectSize = _threadMap[origOwnerTindex].getClassSize(origBagNum);
				unsigned currentThread = getThreadIndex(&currentThread);
				unsigned bagNum = _threadMap[currentThread].getBagNum(objectSize);
				*bag = &_threadBag[currentThread][bagNum];
		}

		if(ownerBag) {
				*ownerBag = origBag;
		}

		if(objectStart) {
				unsigned long objectStartOffset = localBagOffset & ~origBag->classMask;
				*objectStart = (void *)(_heapBegin + origBag->startOffset + objectStartOffset);
		}

		shadowObjectInfo * shadowinfo = (shadowObjectInfo *)(origBag->startShadowMem);

		shadowObjectInfo * retval = &shadowinfo[localBagOffset >> origBag->shiftBits];
		//PRDBG("getShadowObjectInfo(%p) == smAddr %p, local bag offset = 0x%lx, shift bits = %zu",
		//				addr, retval, localBagOffset, origBag->shiftBits);
		return retval;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r12
movq %rcx, %r13
movq %rdi, %r15
subq (%rdi), %rsi
movq 0x6587(%rip), %rax      # 0xdfe8
movq (%rax), %r14
andq %rsi, %r14
movq 0x64fa(%rip), %rax      # 0xdf68
movb (%rax), %cl
movq %rsi, %rax
shrq %cl, %rax
movb 0x38(%rdi), %cl
shrq %cl, %rsi
andq 0x40(%rdi), %rax
movq %rsi, %rcx
shlq $0xb, %rcx
leaq (%rdi,%rcx), %rbp
addq $0x1980, %rbp           # imm = 0x1980
movq %rax, %rbx
shlq $0x7, %rbx
testq %rdx, %rdx
je 0x7b01
leaq 0x1980(%r15), %rcx
movq %rcx, 0x10(%rsp)
movl %eax, %eax
imulq $0x32, %rsi, %rcx
addq %r15, %rcx
addq $0x4c, %rcx
movzbl 0x22(%rax,%rcx), %eax
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
leaq 0x64b3(%rip), %rdi      # 0xdf80
callq 0x45c0
movl (%rax), %eax
imulq $0x32, %rax, %rcx
addq %r15, %rcx
addq $0x4c, %rcx
movq (%rsp), %rdx
movzbl (%rdx,%rcx), %ecx
shll $0x7, %ecx
shlq $0xb, %rax
addq 0x10(%rsp), %rax
addq %rcx, %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
addq %rbx, %rbp
testq %r12, %r12
je 0x7b0d
movq %rbp, (%r12)
testq %r13, %r13
je 0x7b2a
movq 0x28(%rbp), %rax
notq %rax
andq %r14, %rax
movq (%r15), %rcx
addq 0x38(%rbp), %rcx
addq %rax, %rcx
movq %rcx, (%r13)
movb 0x30(%rbp), %cl
shrq %cl, %r14
addq 0x40(%rbp), %r14
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./hashmap.hh
// Function: HashMap<void*, BigHeap::bigObjectStatus*, HeapAllocator>::find(void* const&, unsigned long, BigHeap::bigObjectStatus**)
bool find(const KeyType& key, size_t keylen, ValueType* value) {
    assert(_initialized == true);
    size_t hindex = hashIndex(key, keylen);
    struct HashEntry* first = getHashEntry(hindex);
    struct Entry* entry = getEntry(first, key, keylen);
    bool isFound = false;

    if(entry) {
      *value = entry->value;
      isFound = true;
    }

    return isFound;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
je 0x7d4a
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rsi), %rdi
movq %rdx, %rsi
callq *0x28(%r12)
xorl %edx, %edx
divq 0x10(%r12)
imulq $0x18, %rdx, %rsi
addq 0x8(%r12), %rsi
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x44e0
testq %rax, %rax
je 0x7d38
movq 0x20(%rax), %rcx
movq %rcx, (%rbx)
testq %rax, %rax
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1f33(%rip), %rdi      # 0x9c84
leaq 0x1f41(%rip), %rsi      # 0x9c99
leaq 0x280e(%rip), %rcx      # 0xa56d
movl $0x8b, %edx
callq 0x4220
nop
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./hashmap.hh
// Function: HashMap<void*, BigHeap::bigObjectStatus*, HeapAllocator>::getEntry(HashMap<void*, BigHeap::bigObjectStatus*, HeapAllocator>::HashEntry*, void* const&, unsigned long)
struct Entry* getEntry(struct HashEntry* first, const KeyType& key, size_t keylen) {
    struct Entry* entry = (struct Entry*)first->getFirstEntry();
    struct Entry* result = NULL;

    // Check all _entries with the same hindex.
    int count = first->count;
    // PRINF("getEntry count is %d\n", count);
    while(count > 0) {
      if(entry->keylen == keylen && _keycmp(entry->key, key, keylen)) {
        result = entry;
        break;
      }

      entry = entry->nextEntry();
      count--;
    }

    return result;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movl 0x10(%rsi), %ebp
testl %ebp, %ebp
jle 0x7da6
movq 0x8(%rbx), %rbx
cmpq %r14, 0x18(%rbx)
jne 0x7da2
movq 0x10(%rbx), %rdi
movq (%r15), %rsi
movq %r14, %rdx
callq *0x20(%r12)
testb %al, %al
jne 0x7da8
decl %ebp
jmp 0x7d81
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./hashmap.hh
// Function: HashMap<void*, BigHeap::bigObjectStatus*, HeapAllocator>::erase(void* const&, unsigned long)
bool erase(const KeyType& key, size_t keylen) {
    assert(_initialized == true);
    size_t hindex = hashIndex(key, keylen);
    struct HashEntry* first = getHashEntry(hindex);
    struct Entry* entry;
    bool isFound = false;

    entry = getEntry(first, key, keylen);

    //    PRINF("Erapse the entry key %p entry %p\n", key, entry);
    if(entry) {
      isFound = true;

      // Check whether this entry is the first entry.
      // Remove this entry if existing.
      entry->erase();

      SourceHeap::deallocate(entry);
    }

    first->count--;

    return isFound;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
je 0x7e35
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rsi), %rdi
movq %rdx, %rsi
callq *0x28(%r12)
xorl %edx, %edx
divq 0x10(%r12)
imulq $0x18, %rdx, %rbx
addq 0x8(%r12), %rbx
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x44e0
movq %rax, %r14
testq %rax, %rax
je 0x7e1f
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%rcx)
movq %r14, (%r14)
movq %r14, 0x8(%r14)
movq 0x619e(%rip), %rax      # 0xdfb8
movq %r14, %rdi
callq *(%rax)
testq %r14, %r14
setne %al
decq 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1e48(%rip), %rdi      # 0x9c84
leaq 0x1e56(%rip), %rsi      # 0x9c99
leaq 0x2819(%rip), %rcx      # 0xa663
movl $0xbd, %edx
callq 0x4220
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./bigheap.hh
// Function: BigHeap::getUsableSize(void*)
size_t getUsableSize(void * ptr) {
    bigObjectStatus * objStatus;
    if(!_xmap.find(ptr, sizeof(void *), &objStatus)) {
      return 0;
    }
    return objStatus->usableSize;
  }

// Assembly:
subq $0x18, %rsp
leaq 0x10(%rsp), %rax
movq %rsi, (%rax)
addq $0x10, %rdi
pushq $0x8
popq %rdx
leaq 0x8(%rsp), %rcx
movq %rax, %rsi
callq 0x41e0
testb %al, %al
je 0x7e83
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
jmp 0x7e85
xorl %eax, %eax
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./xthread.hh
// Function: xthread::startThread(void*)
static void * startThread(void * arg) {
    thread_t * current = (thread_t *) arg;

    xthread::getInstance().initializeCurrentThread(current);

		// Actually run this thread using the function call
    void * result = NULL;
    try{
      result = current->startRoutine(current->startArg);
    }
    catch (int err){
      if(err != PTHREADEXIT_CODE){
        throw err;
      }
    }

 	  return result;
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x4240
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4060
movq 0x20(%rbx), %rdi
callq *0x18(%rbx)
popq %rbx
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7fc1
movq %rbx, %rdi
callq 0x4120
movl (%rax), %ebx
cmpl $0x8b6, %ebx            # imm = 0x8B6
jne 0x7f9e
callq 0x4590
xorl %eax, %eax
jmp 0x7f79
pushq $0x4
popq %rdi
callq 0x4150
movl %ebx, (%rax)
movq 0x5f31(%rip), %rsi      # 0xdee0
movq %rax, %rdi
xorl %edx, %edx
callq 0x45e0
movq %rax, %rbx
callq 0x4590
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./hashmap.hh
// Function: HashMap<void*, int, HeapAllocator>::insertIfAbsent(void* const&, unsigned long, int)
bool insertIfAbsent(const KeyType& key, size_t keylen, ValueType value) {
    assert(_initialized == true);
    size_t hindex = hashIndex(key, keylen);
    struct HashEntry* first = getHashEntry(hindex);
    struct Entry* entry;
    bool isFound = true;

    // Check all _entries with the same hindex.
    entry = getEntry(first, key, keylen);
    if(!entry) {
      isFound = false;
      insertEntry(first, key, keylen, value);
    }

    return isFound;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
je 0x8042
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rsi), %rdi
movq %rdx, %rsi
callq *0x28(%r12)
xorl %edx, %edx
divq 0x10(%r12)
imulq $0x18, %rdx, %r13
addq 0x8(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x42a0
movq %rax, %rbp
testq %rax, %rax
jne 0x802d
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
callq 0x42f0
testq %rbp, %rbp
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c3b(%rip), %rdi      # 0x9c84
leaq 0x1c49(%rip), %rsi      # 0x9c99
leaq 0x2889(%rip), %rcx      # 0xa8e0
movl $0xab, %edx
callq 0x4220
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/Query.cc
// Function: NotQuery::eval(TextQuery const&) const
QueryResult
NotQuery::eval(const TextQuery& text) const
{
    // virtual call to eval through the Query operand 
    auto result = query.eval(text);

	// start out with an empty result set
    auto ret_lines = make_shared<set<line_no>>();

	// we have to iterate through the lines on which our operand appears
	auto beg = result.begin(), end = result.end();

    // for each line in the input file, if that line is not in result,
    // add that line number to ret_lines
	auto sz = result.get_file()->size();
    for (size_t n = 0; n != sz; ++n) {
		// if we haven't processed all the lines in result
		// check whether this line is present
		if (beg == end || *beg != n) 
			ret_lines->insert(n);  // if not in result, add this line 
		else if (beg != end) 
			++beg; // otherwise get the next line number in result if there is one
	}
	return QueryResult(rep(), ret_lines, result.get_file());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, -0x40(%rbp)
movq %rsi, -0x48(%rbp)
movq 0x8(%rsi), %rsi
movq (%rsi), %rax
leaq -0xd8(%rbp), %rdi
callq *0x10(%rax)
leaq -0x38(%rbp), %rdi
callq 0x3947
leaq -0xa8(%rbp), %rsi
movq -0x10(%rsi), %rbx
movq 0x18(%rbx), %r12
addq $0x8, %rbx
leaq -0x58(%rbp), %r13
movq %r13, %rdi
callq 0x3ccc
movq (%r13), %rax
movq 0x8(%rax), %r15
subq (%rax), %r15
sarq $0x5, %r15
leaq -0x50(%rbp), %rdi
callq 0x3d18
xorl %r14d, %r14d
movq %r14, -0x58(%rbp)
cmpq %r15, %r14
je 0x35b3
cmpq %rbx, %r12
je 0x359e
cmpq %r14, 0x20(%r12)
jne 0x359e
movq %r12, %rdi
callq 0x3220
movq %rax, %r12
jmp 0x35ae
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x40b4
movq -0x58(%rbp), %r14
incq %r14
jmp 0x357c
movq -0x48(%rbp), %rsi
movq (%rsi), %rax
leaq -0x98(%rbp), %rdi
callq *0x18(%rax)
leaq -0x78(%rbp), %r14
leaq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0x3da8
leaq -0x68(%rbp), %r12
movq %r12, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3ccc
leaq -0x98(%rbp), %rsi
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x3982
leaq -0x60(%rbp), %rdi
callq 0x3d18
leaq -0x70(%rbp), %rdi
callq 0x3d18
leaq -0x98(%rbp), %rdi
callq 0x30e0
leaq -0x30(%rbp), %rdi
callq 0x3d18
leaq -0xd8(%rbp), %rdi
callq 0x39c0
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x3d18
leaq -0x70(%rbp), %rdi
callq 0x3d18
leaq -0x98(%rbp), %rdi
callq 0x30e0
jmp 0x3675
jmp 0x3672
movq %rax, %rbx
jmp 0x367e
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3d18
leaq -0xd8(%rbp), %rdi
callq 0x39c0
movq %rbx, %rdi
callq 0x32f0
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/Query.cc
// Function: AndQuery::eval(TextQuery const&) const
QueryResult
AndQuery::eval(const TextQuery& text) const
{
    // virtual calls through the Query operands to get result sets for the operands
    auto left = lhs.eval(text), right = rhs.eval(text);

	// set to hold the intersection of left and right
    auto ret_lines = make_shared<set<line_no>>();  

    // writes the intersection of two ranges to a destination iterator
    // destination iterator in this call adds elements to ret
    set_intersection(left.begin(), left.end(), 
                   right.begin(), right.end(),
                   inserter(*ret_lines, ret_lines->begin()));
    return QueryResult(rep(), ret_lines, left.get_file());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
movq (%rsi), %rax
leaq -0xa8(%rbp), %rdi
callq *0x10(%rax)
movq 0x18(%r14), %rsi
movq (%rsi), %rax
leaq -0xe8(%rbp), %rdi
movq %r15, %rdx
callq *0x10(%rax)
leaq -0x28(%rbp), %rdi
callq 0x3947
movq -0x88(%rbp), %rsi
movq 0x18(%rsi), %rdi
addq $0x8, %rsi
movq -0xc8(%rbp), %rcx
movq 0x18(%rcx), %rdx
addq $0x8, %rcx
movq -0x28(%rbp), %r8
movq 0x18(%r8), %r9
callq 0x4246
movq (%r14), %rax
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq *0x18(%rax)
leaq -0x48(%rbp), %r14
leaq -0x28(%rbp), %rsi
movq %r14, %rdi
callq 0x3da8
leaq -0x78(%rbp), %rsi
leaq -0x38(%rbp), %r15
movq %r15, %rdi
callq 0x3ccc
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x3982
leaq -0x30(%rbp), %rdi
callq 0x3d18
leaq -0x40(%rbp), %rdi
callq 0x3d18
leaq -0x68(%rbp), %rdi
callq 0x30e0
leaq -0x20(%rbp), %rdi
callq 0x3d18
leaq -0xe8(%rbp), %rdi
callq 0x39c0
leaq -0xa8(%rbp), %rdi
callq 0x39c0
movq %rbx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3d18
leaq -0x40(%rbp), %rdi
callq 0x3d18
leaq -0x68(%rbp), %rdi
callq 0x30e0
jmp 0x37bd
movq %rax, %rbx
jmp 0x37c6
movq %rax, %rbx
jmp 0x37d2
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x3d18
leaq -0xe8(%rbp), %rdi
callq 0x39c0
leaq -0xa8(%rbp), %rdi
callq 0x39c0
movq %rbx, %rdi
callq 0x32f0
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/Query.cc
// Function: OrQuery::eval(TextQuery const&) const
QueryResult
OrQuery::eval(const TextQuery& text) const
{
    // virtual calls through the Query members, lhs and rhs 
	// the calls to eval return the QueryResult for each operand
    auto right = rhs.eval(text), left = lhs.eval(text);  

	// copy the line numbers from the left-hand operand into the result set
	auto ret_lines = 
	     make_shared<set<line_no>>(left.begin(), left.end());

	// insert lines from the right-hand operand
	ret_lines->insert(right.begin(), right.end());
	// return the new QueryResult representing the union of lhs and rhs
    return QueryResult(rep(), ret_lines, left.get_file());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rsi), %rsi
movq (%rsi), %rax
leaq -0xf8(%rbp), %rdi
callq *0x10(%rax)
movq 0x8(%r14), %rsi
movq (%rsi), %rax
leaq -0xb8(%rbp), %rdi
movq %r15, %rdx
callq *0x10(%rax)
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rcx
leaq -0x78(%rbp), %rsi
movq %rcx, (%rsi)
addq $0x8, %rax
leaq -0x70(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x28(%rbp), %rdi
callq 0x39e9
movq -0x28(%rbp), %rdi
movq -0xd8(%rbp), %rdx
movq 0x18(%rdx), %rsi
addq $0x8, %rdx
callq 0x454c
movq (%r14), %rax
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq *0x18(%rax)
leaq -0x48(%rbp), %r14
leaq -0x28(%rbp), %rsi
movq %r14, %rdi
callq 0x3da8
leaq -0x88(%rbp), %rsi
leaq -0x38(%rbp), %r15
movq %r15, %rdi
callq 0x3ccc
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x3982
leaq -0x30(%rbp), %rdi
callq 0x3d18
leaq -0x40(%rbp), %rdi
callq 0x3d18
leaq -0x68(%rbp), %rdi
callq 0x30e0
leaq -0x20(%rbp), %rdi
callq 0x3d18
leaq -0xb8(%rbp), %rdi
callq 0x39c0
leaq -0xf8(%rbp), %rdi
callq 0x39c0
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3d18
leaq -0x40(%rbp), %rdi
callq 0x3d18
leaq -0x68(%rbp), %rdi
callq 0x30e0
jmp 0x391e
movq %rax, %rbx
jmp 0x3927
movq %rax, %rbx
jmp 0x3933
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x3d18
leaq -0xb8(%rbp), %rdi
callq 0x39c0
leaq -0xf8(%rbp), %rdi
callq 0x39c0
movq %rbx, %rdi
callq 0x32f0
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/wordQueryTest.cc
// Function: main
int main(int argc, char **argv)
{
    TextQuery file = get_file(argc, argv);

    // iterate with the user: prompt for a word to find and print results
    do {
        string sought;
        if (!get_word(sought)) break;

        // find all the occurrences of the requested string
        // define synonym for the line_no set 
        Query name(sought);
        const auto results = name.eval(file);
        cout << "\nExecuting Query for: " << name << endl;

        // report no matches
        print(cout, results) << endl;
    } while (true);  // loop indefinitely; the exit is inside the loop
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %rdx
movl %edi, %esi
leaq -0x98(%rbp), %rdi
callq 0x5bd8
leaq -0x58(%rbp), %r15
leaq -0x38(%rbp), %r12
leaq -0xd8(%rbp), %r13
movq 0x59e9(%rip), %rbx      # 0x9fc8
leaq 0x1b42(%rip), %r14      # 0x6128
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %r15, %rdi
callq 0x5cab
testb %al, %al
je 0x4671
movq %r12, %rdi
movq %r15, %rsi
callq 0x46dc
movq -0x38(%rbp), %rsi
movq (%rsi), %rax
movq %r13, %rdi
leaq -0x98(%rbp), %rdx
callq *0x10(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x472d
movq %rax, %rdi
callq 0x3100
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4e3b
movq %rax, %rdi
callq 0x3100
movq %r13, %rdi
callq 0x39c0
leaq -0x30(%rbp), %rdi
callq 0x3d18
movq %r15, %rdi
callq 0x30e0
jmp 0x45e6
leaq -0x58(%rbp), %rdi
callq 0x30e0
leaq -0x98(%rbp), %rdi
callq 0x4782
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x46a1
movq %rax, %rbx
jmp 0x46b5
movq %rax, %rbx
jmp 0x46be
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x39c0
leaq -0x30(%rbp), %rdi
callq 0x3d18
leaq -0x58(%rbp), %rdi
callq 0x30e0
leaq -0x98(%rbp), %rdi
callq 0x4782
movq %rbx, %rdi
callq 0x32f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/examples/TextQuery.cc
// Function: TextQuery::cleanup_str(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string TextQuery::cleanup_str(const string& word)
{
    string ret;
    for (auto it = word.begin(); it != word.end(); ++it) {
        if (!ispunct(*it))
            ret += tolower(*it);
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r14
movb $0x0, 0x10(%rdi)
movq (%rsi), %r13
movq %r13, %r12
movq 0x8(%r14), %rax
addq %r13, %rax
cmpq %rax, %r12
je 0x4c14
movsbl (%r12), %r15d
movl %r15d, %edi
callq 0x3320
testl %eax, %eax
jne 0x4c0f
movl %r15d, %edi
callq 0x3280
movsbl %al, %esi
movq %rbx, %rdi
callq 0x31a0
movq (%r14), %r13
incq %r12
jmp 0x4bdc
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x30e0
movq %r14, %rdi
callq 0x32f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/examples/TextQuery.cc
// Function: TextQuery::query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
QueryResult
TextQuery::query(const string& sought) const
{
	// we'll return a pointer to this set if we don't find sought
	static shared_ptr<set<line_no>> nodata(new set<line_no>);

    // use find and not a subscript to avoid adding words to wm!
    auto loc = wm.find(cleanup_str(sought));

	if (loc == wm.end())
		return QueryResult(sought, nodata, file);  // not found
	else
		return QueryResult(sought, loc->second, file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movb 0x557b(%rip), %al       # 0xa1d8
testb %al, %al
je 0x4d64
leaq 0x10(%r14), %r12
leaq -0x88(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x4bb2
movq %r12, %rdi
movq %r13, %rsi
callq 0x5b4e
movq %rax, %r13
leaq -0x88(%rbp), %rdi
callq 0x30e0
leaq 0x18(%r14), %rax
cmpq %rax, %r13
je 0x4ced
leaq -0xa8(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3260
addq $0x40, %r13
leaq -0x48(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x3da8
leaq -0x38(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x3ccc
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x3982
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %r14
jmp 0x4d3a
leaq -0xc8(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3260
leaq 0x54c2(%rip), %rsi      # 0xa1c8
leaq -0x68(%rbp), %r15
movq %r15, %rdi
callq 0x3da8
leaq -0x58(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x3ccc
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x3982
leaq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %r14
callq 0x3d18
movq %r14, %rdi
callq 0x3d18
movq %r12, %rdi
callq 0x30e0
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x546d(%rip), %rdi      # 0xa1d8
callq 0x3300
testl %eax, %eax
je 0x4c65
pushq $0x30
popq %rdi
callq 0x31e0
movq %rax, %rcx
addq $0x8, %rcx
andl $0x0, 0x8(%rax)
andq $0x0, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
leaq 0x5424(%rip), %rdi      # 0xa1c8
movq %rax, %rsi
callq 0x5986
leaq 0xbe5(%rip), %rdi       # 0x5998
leaq 0x540e(%rip), %rsi      # 0xa1c8
leaq 0x53e7(%rip), %rdx      # 0xa1a8
callq 0x31b0
leaq 0x540b(%rip), %rdi      # 0xa1d8
callq 0x3150
jmp 0x4c65
movq %rax, %rbx
leaq 0x53f7(%rip), %rdi      # 0xa1d8
callq 0x3140
jmp 0x4e33
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x3d18
leaq -0x60(%rbp), %rdi
callq 0x3d18
leaq -0xc8(%rbp), %rdi
jmp 0x4e2e
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3d18
leaq -0x40(%rbp), %rdi
callq 0x3d18
leaq -0xa8(%rbp), %rdi
jmp 0x4e2e
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x32f0
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/examples/TextQuery.cc
// Function: print(std::ostream&, QueryResult const&)
ostream &print(ostream& os, const QueryResult& qr)
{
    // if the word was found, print the count and all occurrences
    os << qr.sought << " occurs " << qr.lines->size() << " "
       << make_plural(qr.lines->size(), "time", "s") << endl;

    // print each line in which the word appeared
	for (auto num : *qr.lines) // for every element in the set
		// don't confound the user with text lines starting at 0
        os << "\t(line " << num + 1 << ") "
		   << *(qr.file->begin() + num) << endl;

	return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
movq %rdi, -0x38(%rbp)
callq 0x31c0
leaq 0x1329(%rip), %rsi      # 0x6188
movq %rax, %rdi
callq 0x31d0
movq 0x20(%rbx), %rcx
movq 0x28(%rcx), %rsi
movq %rax, %rdi
callq 0x3160
leaq 0x1323(%rip), %rsi      # 0x61a1
movq %rax, %rdi
callq 0x31d0
movq %rax, %r14
movq %rbx, %r15
movq 0x20(%rbx), %rax
movq 0x28(%rax), %r12
leaq 0x12f6(%rip), %rsi      # 0x6191
leaq -0x78(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0x30c0
leaq 0x12e7(%rip), %rsi      # 0x6196
leaq -0x58(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x30c0
leaq -0x98(%rbp), %rdi
leaq -0x78(%rbp), %rdx
leaq -0x58(%rbp), %rcx
movq %r12, %rsi
callq 0x51aa
leaq -0x98(%rbp), %rsi
movq %r14, %rdi
callq 0x31c0
movq %rax, %rdi
callq 0x3100
leaq -0x98(%rbp), %rdi
callq 0x30e0
leaq -0x58(%rbp), %rdi
callq 0x30e0
leaq -0x78(%rbp), %rdi
callq 0x30e0
movq 0x20(%r15), %r14
movq 0x18(%r14), %r12
addq $0x8, %r14
leaq 0x1285(%rip), %r13      # 0x61a0
cmpq %r14, %r12
je 0x4f77
movq 0x20(%r12), %rbx
movq -0x38(%rbp), %rdi
leaq 0x1268(%rip), %rsi      # 0x6198
callq 0x31d0
leaq 0x1(%rbx), %rsi
movq %rax, %rdi
callq 0x3160
movq %rax, %rdi
movq %r13, %rsi
callq 0x31d0
movq 0x30(%r15), %rcx
shlq $0x5, %rbx
addq (%rcx), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31c0
movq %rax, %rdi
callq 0x3100
movq %r12, %rdi
callq 0x3220
movq %rax, %r12
jmp 0x4f1b
movq -0x38(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4fa3
movq %rax, %rbx
jmp 0x4fac
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x30e0
leaq -0x58(%rbp), %rdi
callq 0x30e0
leaq -0x78(%rbp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x32f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/examples/TextQuery.cc
// Function: TextQuery::display_map()
void TextQuery::display_map()
{
    auto iter = wm.cbegin(), iter_end = wm.cend();

    // for each word in the map
    for ( ; iter != iter_end; ++iter) {
        cout << "word: " << iter->first << " {";

        // fetch location vector as a const reference to avoid copying it
        auto text_locs = iter->second;
        auto loc_iter = text_locs->cbegin(),
                        loc_iter_end = text_locs->cend();

        // print all line numbers for this word
        while (loc_iter != loc_iter_end)
        {
            cout << *loc_iter;

            if (++loc_iter != loc_iter_end)
                 cout << ", ";

         }

         cout << "}\n";  // end list of output this word
    }
    cout << endl;  // finished printing entire map
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x28(%rdi), %r15
addq $0x18, %rdi
movq %rdi, -0x30(%rbp)
movq 0x4fe6(%rip), %r12      # 0x9fc8
leaq 0x11c4(%rip), %r13      # 0x61ad
cmpq -0x30(%rbp), %r15
je 0x508c
movq %r12, %rdi
leaq 0x11a6(%rip), %rsi      # 0x61a3
callq 0x31d0
leaq 0x20(%r15), %rsi
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
leaq 0x1192(%rip), %rsi      # 0x61aa
callq 0x31d0
leaq 0x40(%r15), %rsi
leaq -0x40(%rbp), %rdi
callq 0x3da8
movq -0x40(%rbp), %r14
movq 0x18(%r14), %rbx
addq $0x8, %r14
cmpq %r14, %rbx
je 0x5064
movq 0x20(%rbx), %rsi
movq %r12, %rdi
callq 0x3160
movq %rbx, %rdi
callq 0x3220
movq %rax, %rbx
cmpq %r14, %rax
je 0x5036
movq %r12, %rdi
movq %r13, %rsi
callq 0x31d0
jmp 0x5036
movq %r12, %rdi
leaq 0x1142(%rip), %rsi      # 0x61b0
callq 0x31d0
leaq -0x38(%rbp), %rdi
callq 0x3d18
movq %r15, %rdi
callq 0x3220
movq %rax, %r15
jmp 0x4fe9
movq 0x4f35(%rip), %rdi      # 0x9fc8
callq 0x3100
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x50a9
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x3d18
movq %rbx, %rdi
callq 0x32f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/get_print.cc
// Function: get_file(int, char**)
TextQuery get_file(int argc, char **argv)
{
    // get a file to read from which user will query words
	ifstream infile;
	if (argc == 2)
    	infile.open(argv[1]);
    if (!infile) {
        throw runtime_error("No input file!");
    }

    return TextQuery(infile);  // builds query map
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
leaq -0x220(%rbp), %rdi
callq 0x3210
cmpl $0x2, %r15d
jne 0x5c16
movq 0x8(%r14), %rsi
leaq -0x220(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3130
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x200(%rbp,%rax)
jne 0x5c57
leaq -0x220(%rbp), %rsi
movq %rbx, %rdi
callq 0x49a0
leaq -0x220(%rbp), %rdi
callq 0x3070
movq %rbx, %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x3110
movq %rax, %rbx
leaq 0x62b(%rip), %rsi       # 0x6294
movq %rax, %rdi
callq 0x30b0
movq 0x4378(%rip), %rsi      # 0x9ff0
movq 0x4339(%rip), %rdx      # 0x9fb8
movq %rbx, %rdi
callq 0x32e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x3180
jmp 0x5c97
movq %rax, %r14
leaq -0x220(%rbp), %rdi
callq 0x3070
movq %r14, %rdi
callq 0x32f0
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/get_print.cc
// Function: get_word(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool get_word(string &s1)
{
    cout << "enter a word to search for, or q to quit: ";
    cin >> s1;
    if (!cin || s1 == "q") return false;
    else return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x430c(%rip), %rdi      # 0x9fc8
leaq 0x5e0(%rip), %rsi       # 0x62a3
callq 0x31d0
movq 0x4309(%rip), %r14      # 0x9fd8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3240
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r14,%rax)
je 0x5ced
xorl %eax, %eax
jmp 0x5cfe
leaq 0x5da(%rip), %rsi       # 0x62ce
movq %rbx, %rdi
callq 0x5d7a
xorb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/get_print.cc
// Function: get_words(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool get_words(string &s1, string &s2)
{

    // iterate with the user: prompt for a word to find and print results
    cout << "enter two words to search for, or q to quit: ";
    cin  >> s1;

    // stop if hit eof on input or a "q" is entered
    if (!cin || s1 == "q") return false;
    cin >> s2;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x42ae(%rip), %rdi      # 0x9fc8
leaq 0x5af(%rip), %rsi       # 0x62d0
callq 0x31d0
movq 0x42ab(%rip), %r15      # 0x9fd8
movq %r15, %rdi
movq %r14, %rsi
callq 0x3240
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r15,%rax)
jne 0x5d5a
leaq 0x580(%rip), %rsi       # 0x62ce
movq %r14, %rdi
callq 0x5d7a
testb %al, %al
je 0x5d67
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x426a(%rip), %rdi      # 0x9fd8
movq %rbx, %rsi
callq 0x3240
movb $0x1, %al
jmp 0x5d5c
// File: /workspace/github_cpp_makefile_star2_O2/integeruser[P]GA3C-cpp/src/ga3c.cc
// Function: select_action(std::shared_ptr<Environment>, float, std::vector<float, std::allocator<float>> const&)
action_t select_action(std::shared_ptr<Environment> env, float epsilon, const std::vector<float>& policy)
{
    const bool should_explore = std::uniform_real_distribution<float>(0.0f, 1.0f)(random_engine) < epsilon;
    if (should_explore) {
        // perform a random action
        return env->sample();
    }
    else {
        // perform an action according to the current policy
        return std::discrete_distribution<action_t>(policy.cbegin(), policy.cend())(random_engine);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movss %xmm0, 0x4(%rsp)
movq %rdi, %r14
movsd 0x3b39(%rip), %xmm0     # 0x6010
leaq 0x8(%rsp), %rdi
movsd %xmm0, (%rdi)
leaq 0xa101(%rip), %rsi      # 0xc5e8
callq 0x2f6c
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2505
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %rbx
jmp 0x2535
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x3ede
leaq 0xa0c8(%rip), %rsi      # 0xc5e8
movq %rbx, %rdi
callq 0x2f74
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x39cc
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x39cc
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/integeruser[P]GA3C-cpp/src/ga3c.cc
// Function: extract_accumulated_experience(std::deque<std::tuple<std::vector<float, std::allocator<float>>, long, float, std::vector<float, std::allocator<float>>, bool>, std::allocator<std::tuple<std::vector<float, std::allocator<float>>, long, float, std::vector<float, std::allocator<float>>, bool>>>&, float)
training_experience_t extract_accumulated_experience(memory_t& memory, float next_state_value)
{
    assert(not memory.empty());
    const auto n = std::min<uint32_t>(N_STEP_RETURN, memory.size());

    // pick experience at time step t
    uint32_t t = 0;
    const auto curr_state = std::get<0>(memory[t]);
    const auto action = std::get<1>(memory[t]);

    // and calculate its n-step return (until time step t+n)
    float n_step_return = 0.0f;
    for (; t < n; ++t) {
        const auto reward = std::get<2>(memory[t]);
        n_step_return += std::pow(GAMMA, t)*reward;
    }
    const auto done = std::get<4>(memory[n-1]);
    if (not done) { n_step_return += std::pow(GAMMA, n)*next_state_value; }

    memory.pop_front();
    return training_experience_t{curr_state, action, n_step_return};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movss %xmm0, 0x4(%rsp)
movq 0x30(%rsi), %rax
cmpq 0x10(%rsi), %rax
je 0x268a
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsi), %r15
movq %rsi, %rdi
callq 0x2f7c
cmpl $0x8, %eax
pushq $0x8
popq %rbp
cmovbl %eax, %ebp
xorl %r12d, %r12d
movq %r15, %rdi
xorl %esi, %esi
callq 0x44ba
leaq 0x30(%rax), %rsi
leaq 0x10(%rsp), %rdi
callq 0x2f8c
movq %r15, %rdi
xorl %esi, %esi
callq 0x44ba
movq 0x28(%rax), %r13
xorps %xmm0, %xmm0
movss %xmm0, (%rsp)
cmpq %r12, %rbp
je 0x260b
movq %r15, %rdi
movq %r12, %rsi
callq 0x44ba
movl %r12d, %ecx
cvtsi2sd %rcx, %xmm1
cvtss2sd 0x20(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x3a62(%rip), %xmm0     # 0x6050
callq 0x22a0
cvtss2sd (%rsp), %xmm1
mulsd 0x8(%rsp), %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
incq %r12
jmp 0x25be
leal -0x1(%rbp), %esi
movq %r15, %rdi
callq 0x44ba
cmpb $0x0, (%rax)
jne 0x2648
cvtsi2sd %ebp, %xmm1
movsd 0x3a29(%rip), %xmm0     # 0x6050
callq 0x22a0
cvtss2sd 0x4(%rsp), %xmm1
cvtss2sd (%rsp), %xmm2
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%rsp)
movq %r14, %rdi
callq 0x2fda
movss (%rsp), %xmm0
movss %xmm0, (%rbx)
movq %r13, 0x8(%rbx)
movq %rbx, %rdi
addq $0x10, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2f8c
leaq 0x10(%rsp), %rdi
callq 0x3d6e
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x39e7(%rip), %rdi      # 0x6078
leaq 0x39f3(%rip), %rsi      # 0x608b
leaq 0x39f8(%rip), %rcx      # 0x6097
pushq $0x3d
popq %rdx
callq 0x20e0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3d6e
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/integeruser[P]GA3C-cpp/src/ga3c.cc
// Function: trainer()
void trainer()
{
    while (num_training_experiences < MAX_NUM_TRAINING_EXPERIENCES) {
        const auto batch_size = std::min(BATCH_SIZE, MAX_NUM_TRAINING_EXPERIENCES-num_training_experiences);

        auto batch = std::vector<training_experience_t>(batch_size);
        for (uint32_t i = 0; i < batch.size(); ++i) {
            batch[i] = training_experiences_queue.pop();
        }
        fit(batch);
        num_training_experiences += batch_size;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x30(%rsp), %rbx
leaq 0x20(%rsp), %r15
pushq $0x28
popq %rbp
leaq 0x8556(%rip), %r12      # 0xb1b0
leaq 0x852b(%rip), %rax      # 0xb18c
movl (%rax), %r13d
subl 0x85ed(%rip), %r13d     # 0xb258
jbe 0x2cec
cmpl $0x20, %r13d
pushq $0x20
popq %rax
cmovael %eax, %r13d
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x3288
xorl %eax, %eax
movl %eax, %r14d
movq 0x10(%rsp), %rax
subq 0x8(%rsp), %rax
cqto
idivq %rbp
cmpq %r14, %rax
jbe 0x2ccb
movq %r15, %rdi
movq %r12, %rsi
callq 0x32da
imulq $0x28, %r14, %rdi
addq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x3364
movq %rbx, %rdi
callq 0x3d6e
leal 0x1(%r14), %eax
jmp 0x2c8a
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x2af3
addl %r13d, 0x8579(%rip)     # 0xb258
movq %r14, %rdi
callq 0x337a
jmp 0x2c5a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2cfd
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x337a
movq %rbx, %rdi
callq 0x22b0