LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./hashmap.hh
// Function: HashMap<void*, int, HeapAllocator>::initialize(unsigned long (*)(void*, unsigned long), bool (*)(void*, void*, unsigned long), unsigned long)
void initialize(hashFuncPtr hfunc, keycmpFuncPtr kcmp, const size_t size = 4096) {
    _entries = NULL;
    _bucketsUsed = 0;
    _buckets = size;

    if(hfunc == NULL || kcmp == NULL) {
      //PRINF("Hashfunc or kcmp should not be null\n");
      abort();
    }

    // Initialize those functions.
    _hashfunc = hfunc;
    _keycmp = kcmp;

    // Allocated predefined size.
    _entries = (struct HashEntry*)SourceHeap::allocate(size * sizeof(struct HashEntry));
    //    PRINF("hashmap initialization at %p pid %d index %d\n", &_initialized,getpid(),
    // getThreadIndex());
    //    PRINF("hashmap initialization _entries %p\n", _entries);

    // Initialize all of these _entries.
    struct HashEntry* entry;
    for(size_t i = 0; i < size; i++) {
      entry = getHashEntry(i);
      entry->initialize();
    }
    _initialized = true;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movq %rax, 0x18(%rdi)
movq %rcx, 0x10(%rdi)
testq %rsi, %rsi
je 0x6fa1
testq %rdx, %rdx
je 0x6fa1
movq %rcx, %rbx
movq %rdi, %r14
movq %rsi, 0x28(%rdi)
movq %rdx, 0x20(%rdi)
leaq (,%rcx,8), %rax
leaq (%rax,%rax,2), %rdi
movq 0x5fd1(%rip), %rax      # 0xcf28
callq *(%rax)
movq %rax, 0x8(%r14)
testq %rbx, %rbx
je 0x6f95
movq 0x10(%r14), %rax
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movq 0x8(%r14), %rdi
addq %rdx, %rdi
cmpq %rsi, %rax
cmovbeq %rcx, %rdi
movq $0x0, 0x10(%rdi)
movq %rdi, (%rdi)
movq %rdi, 0x8(%rdi)
incq %rsi
addq $0x18, %rdx
cmpq %rsi, %rbx
jne 0x6f6c
movb $0x1, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x4170
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./hashfuncs.hh
// Function: HashFuncs::hashAddr(void*, unsigned long)
static size_t hashAddr(void* addr, size_t) {
    unsigned long key = (unsigned long)addr;
    key ^= (key << 15) ^ 0xcd7dcd7d;
    key ^= (key >> 10);
    key ^= (key << 3);
    key ^= (key >> 6);
    key ^= (key << 2) + (key << 14);
    key ^= (key >> 16);
    return key;
  }

// Assembly:
movq %rdi, %rax
shlq $0xf, %rax
xorq %rdi, %rax
movl $0xcd7dcd7d, %ecx       # imm = 0xCD7DCD7D
xorq %rax, %rcx
movq %rcx, %rax
shrq $0xa, %rax
xorq %rcx, %rax
leaq (,%rax,8), %rcx
xorq %rax, %rcx
movq %rcx, %rax
shrq $0x6, %rax
xorq %rcx, %rax
movq %rax, %rcx
shlq $0xe, %rcx
leaq (%rcx,%rax,4), %rcx
xorq %rax, %rcx
movq %rcx, %rax
shrq $0x10, %rax
xorq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./hashmap.hh
// Function: HashMap<void*, int, HeapAllocator>::insert(void* const&, unsigned long, int)
void insert(const KeyType& key, size_t keylen, ValueType value) {
    if(_initialized != true) {
      //PRINT("process %d index %d: initialized at  %p hashmap is not true\n", getpid(),
      //      getThreadIndex(), &_initialized);
    }

    assert(_initialized == true);
    size_t hindex = hashIndex(key, keylen);
    // PRINF("Insert entry:  before inserting\n");
    struct HashEntry* first = getHashEntry(hindex);

    // PRINF("Insert entry: key %p\n", key);
    insertEntry(first, key, keylen, value);
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
je 0x7079
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)
movq 0x8(%r12), %rax
leaq (%rdx,%rdx,2), %rcx
leaq (%rax,%rcx,8), %r12
movq 0x5ef2(%rip), %rax      # 0xcf28
movl $0x28, %edi
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)
movq (%r12), %rcx
movq %r12, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
movq %rax, (%r12)
incq 0x10(%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x2c04(%rip), %rdi      # 0x9c84
leaq 0x2c12(%rip), %rsi      # 0x9c99
leaq 0x2c18(%rip), %rcx      # 0x9ca6
movl $0x9f, %edx
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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
movl 0x38(%rdi), %eax
cmpl $0x80, %eax
je 0x7102
leal 0x1(%rax), %ecx
movl %ecx, 0x38(%rdi)
movl 0x4(%rdi), %ecx
cmpl %ecx, %eax
jne 0x70cd
movslq %ecx, %rax
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rdi)
imulq $0x1028, %rax, %rax     # imm = 0x1028
addq %rax, %rdi
addq $0x40, %rdi
jmp 0x70f7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
js 0x70fc
addq $0x40, %rdi
incq %rcx
xorl %edx, %edx
cmpb $0x1, (%rdi)
je 0x70f5
incq %rdx
addq $0x1028, %rdi           # imm = 0x1028
cmpq %rdx, %rcx
jne 0x70df
jmp 0x70fc
movl %edx, %ecx
movb $0x0, (%rdi)
movl %ecx, %eax
addq $0x10, %rsp
popq %rbx
retq
callq 0x41e0
movq %rax, %rbx
callq 0x4250
movl $0x80, (%rsp)
leaq 0x2b0f(%rip), %rdx      # 0x9c2c
leaq 0x2ad3(%rip), %r8       # 0x9bf7
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %rax, %rcx
movl $0x90, %r9d
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x4370
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4270
movl %eax, %edi
callq 0x42c0
movl $0xba, %edi
xorl %eax, %eax
callq 0x4040
movl %eax, 0x4(%rbx)
movl 0x10(%rbx), %ebp
leaq 0x5de6(%rip), %rdi      # 0xcf80
callq 0x44f0
movl %ebp, (%rax)
callq 0x4250
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5cce(%rip), %rax      # 0xcf20
movl 0x8(%rax), %eax
shrl %eax
cmpl %eax, 0x2c(%rdi)
jbe 0x7264
movq %r14, %rdi
callq 0x43e0
movq %r14, %rdi
movl $0x1, %esi
callq 0x44e0
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x4420
movl %eax, %ebp
callq 0x41e0
movq %rax, %r14
callq 0x4250
testb %bpl, %bpl
je 0x72ee
movq %rbx, (%rsp)
leaq 0x2b54(%rip), %rdx      # 0x9df2
leaq 0x22d5(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0x1ae, %r9d            # imm = 0x1AE
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %r14
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x40f0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, (%rsp)
leaq 0x2aab(%rip), %rdx      # 0x9da4
leaq 0x227a(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0x1ab, %r9d            # imm = 0x1AB
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x4370
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4100
subq (%rax), %rbx
movq 0x5475(%rip), %rcx      # 0xcfe8
movq (%rcx), %rdx
andq %rbx, %rdx
movq 0x53e8(%rip), %rcx      # 0xcf68
movb (%rcx), %cl
movq %rbx, %rsi
shrq %cl, %rsi
movb 0x38(%rax), %cl
shrq %cl, %rbx
andq 0x40(%rax), %rsi
shlq $0xb, %rbx
addq %rax, %rbx
shlq $0x7, %rsi
movb 0x19b0(%rsi,%rbx), %cl
shrq %cl, %rdx
movq 0x19c0(%rsi,%rbx), %rax
cmpb $0x0, (%rax,%rdx)
movb $0x1, (%rax,%rdx)
sete %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5355(%rip), %rax      # 0xcf20
movl 0x8(%rax), %eax
shrl $0x3, %eax
movl $0xd, %ecx
movl %eax, (%rbx,%rcx,4)
incq %rcx
cmpq $0x15, %rcx
jne 0x7bd6
movq 0x5387(%rip), %r14      # 0xcf70
cmpl $0x0, (%r14)
je 0x7c15
xorl %r15d, %r15d
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq 0x58(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x58(%rbx), %rax
cmpq $0x0, (%rax,%r15,8)
je 0x7c1b
incq %r15
cmpl (%r14), %r15d
jb 0x7bf2
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2705(%rip), %rdi      # 0xa327
leaq 0x1951(%rip), %rsi      # 0x957a
leaq 0x270b(%rip), %rcx      # 0xa33b
movl $0x1c1, %edx            # imm = 0x1C1
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
je 0x7e80
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rsi), %rdi
movq %rdx, %rsi
callq *0x28(%r12)
xorl %r13d, %r13d
xorl %edx, %edx
divq 0x10(%r12)
movq 0x8(%r12), %rax
leaq (%rdx,%rdx,2), %rcx
movl 0x10(%rax,%rcx,8), %ebp
testl %ebp, %ebp
jle 0x7e5f
leaq (%rax,%rcx,8), %r13
incl %ebp
movq 0x8(%r13), %r13
cmpq %r14, 0x18(%r13)
jne 0x7e55
movq 0x10(%r13), %rdi
movq (%r15), %rsi
movq %r14, %rdx
callq *0x20(%r12)
testb %al, %al
jne 0x7e5f
decl %ebp
cmpl $0x1, %ebp
jg 0x7e38
xorl %r13d, %r13d
testq %r13, %r13
je 0x7e6b
movq 0x20(%r13), %rax
movq %rax, (%rbx)
testq %r13, %r13
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1dfd(%rip), %rdi      # 0x9c84
leaq 0x1e0b(%rip), %rsi      # 0x9c99
leaq 0x26d8(%rip), %rcx      # 0xa56d
movl $0x8b, %edx
callq 0x4200
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
je 0x7f50
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rsi), %rdi
movq %rdx, %rsi
callq *0x28(%r12)
xorl %ebx, %ebx
xorl %edx, %edx
divq 0x10(%r12)
movq 0x8(%r12), %rax
leaq (%rdx,%rdx,2), %rcx
leaq (%rax,%rcx,8), %r13
movl 0x10(%r13), %ebp
testl %ebp, %ebp
jle 0x7f11
incl %ebp
movq %r13, %rbx
movq 0x8(%rbx), %rbx
cmpq %r14, 0x18(%rbx)
jne 0x7f08
movq 0x10(%rbx), %rdi
movq (%r15), %rsi
movq %r14, %rdx
callq *0x20(%r12)
testb %al, %al
jne 0x7f11
decl %ebp
cmpl $0x1, %ebp
jg 0x7eeb
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x7f37
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%rcx)
movq %rbx, (%rbx)
movq %rbx, 0x8(%rbx)
movq 0x5086(%rip), %rax      # 0xcfb8
movq %rbx, %rdi
callq *(%rax)
testq %rbx, %rbx
setne %al
decq 0x10(%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d2d(%rip), %rdi      # 0x9c84
leaq 0x1d3b(%rip), %rsi      # 0x9c99
leaq 0x26fe(%rip), %rcx      # 0xa663
movl $0xbd, %edx
callq 0x4200
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4210
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 0x8077
movq %rbx, %rdi
callq 0x4110
movl (%rax), %ebx
cmpl $0x8b6, %ebx            # imm = 0x8B6
jne 0x8052
callq 0x44c0
xorl %eax, %eax
jmp 0x802d
movl $0x4, %edi
callq 0x4140
movl %ebx, (%rax)
movq 0x4e7b(%rip), %rsi      # 0xcee0
movq %rax, %rdi
xorl %edx, %edx
callq 0x4500
movq %rax, %rbx
callq 0x44c0
movq %rbx, %rdi
callq 0x4510
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movl %ecx, 0x4(%rsp)
cmpb $0x0, (%rdi)
je 0x8155
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rsi), %rdi
movq %rdx, %rsi
callq *0x28(%r12)
xorl %r13d, %r13d
xorl %edx, %edx
divq 0x10(%r12)
movq 0x8(%r12), %rax
leaq (%rdx,%rdx,2), %rcx
leaq (%rax,%rcx,8), %rbp
movl 0x10(%rbp), %ebx
testl %ebx, %ebx
jle 0x80fd
incl %ebx
movq %rbp, %r13
movq 0x8(%r13), %r13
cmpq %r14, 0x18(%r13)
jne 0x80ec
movq 0x10(%r13), %rdi
movq (%r15), %rsi
movq %r14, %rdx
callq *0x20(%r12)
testb %al, %al
jne 0x80f6
decl %ebx
cmpl $0x1, %ebx
jg 0x80cf
xorl %r13d, %r13d
testq %r13, %r13
setne %r13b
testb %r13b, %r13b
jne 0x8143
movq 0x4e1f(%rip), %rax      # 0xcf28
movl $0x28, %edi
callq *(%rax)
movq (%r15), %rcx
movq %rax, (%rax)
movq %rax, 0x8(%rax)
movq %rcx, 0x10(%rax)
movslq %r14d, %rcx
movq %rcx, 0x18(%rax)
movl 0x4(%rsp), %ecx
movl %ecx, 0x20(%rax)
movq (%rbp), %rcx
movq %rbp, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
movq %rax, (%rbp)
incq 0x10(%rbp)
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b28(%rip), %rdi      # 0x9c84
leaq 0x1b36(%rip), %rsi      # 0x9c99
leaq 0x2776(%rip), %rcx      # 0xa8e0
movl $0xab, %edx
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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), %r12
movq %r12, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
cmpq $0x0, 0x8(%rsi)
je 0x525a
movq %rsi, %r14
movq (%rsi), %r13
movsbl (%r13), %r15d
movl %r15d, %edi
callq 0x3330
testl %eax, %eax
jne 0x524b
movl %r15d, %edi
callq 0x3280
movsbl %al, %esi
movq %rbx, %rdi
callq 0x31a0
incq %r13
movq (%r14), %rax
addq 0x8(%r14), %rax
cmpq %rax, %r13
jne 0x5227
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
cmpq %r12, %rdi
je 0x5283
movq (%r12), %rsi
incq %rsi
callq 0x31e0
movq %r14, %rdi
callq 0x32e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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), %r14
addq $0x18, %rdi
movq %rdi, -0x38(%rbp)
cmpq %rdi, %r14
je 0x5949
movq 0x475f(%rip), %r15      # 0x9fc8
leaq 0x1965(%rip), %r13      # 0x71d5
movl $0x6, %edx
movq %r15, %rdi
leaq 0x194c(%rip), %rsi      # 0x71cb
callq 0x3220
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq %r15, %rdi
callq 0x3220
movl $0x2, %edx
movq %rax, %rdi
leaq 0x192f(%rip), %rsi      # 0x71d2
callq 0x3220
movq 0x40(%r14), %r12
movq 0x48(%r14), %rax
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x58d6
movq 0x4700(%rip), %rax      # 0x9fc0
cmpb $0x0, (%rax)
je 0x58ce
movq -0x30(%rbp), %rax
incl 0x8(%rax)
jmp 0x58d6
movq -0x30(%rbp), %rax
lock
incl 0x8(%rax)
movq 0x18(%r12), %rbx
addq $0x8, %r12
cmpq %r12, %rbx
je 0x5912
movq 0x20(%rbx), %rsi
movq %r15, %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3230
movq %rax, %rbx
cmpq %r12, %rax
je 0x58df
movl $0x2, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x3220
jmp 0x58df
movl $0x2, %edx
movq %r15, %rdi
leaq 0x18b7(%rip), %rsi      # 0x71d8
callq 0x3220
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x5934
callq 0x447c
movq %r14, %rdi
callq 0x3230
movq %rax, %r14
cmpq -0x38(%rbp), %rax
jne 0x5870
movq 0x4678(%rip), %rbx      # 0x9fc8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3140
jmp 0x5987
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x5998
callq 0x447c
movq %rbx, %rdi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6550
movq 0x8(%r14), %rsi
leaq -0x220(%rbp), %rdi
movl $0x8, %edx
callq 0x3100
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x200(%rbp,%rax)
jne 0x6591
leaq -0x220(%rbp), %rsi
movq %rbx, %rdi
callq 0x4f38
leaq -0x220(%rbp), %rdi
callq 0x3060
movq %rbx, %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x30e0
movq %rax, %rbx
leaq 0xd17(%rip), %rsi       # 0x72bc
movq %rax, %rdi
callq 0x30c0
movq 0x3a3c(%rip), %rsi      # 0x9ff0
movq 0x39fd(%rip), %rdx      # 0x9fb8
movq %rbx, %rdi
callq 0x32d0
movq %rax, %r14
movq %rbx, %rdi
callq 0x3170
jmp 0x65d3
movq %rax, %r14
leaq -0x220(%rbp), %rdi
callq 0x3060
movq %r14, %rdi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x39d0(%rip), %rdi      # 0x9fc8
leaq 0xccc(%rip), %rsi       # 0x72cb
movl $0x2a, %edx
callq 0x3220
movq 0x39c8(%rip), %r14      # 0x9fd8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3250
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r14,%rax)
je 0x662e
xorl %eax, %eax
jmp 0x6642
leaq 0xcc1(%rip), %rsi       # 0x72f6
movq %rbx, %rdi
callq 0x3080
testl %eax, %eax
setne %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x396a(%rip), %rdi      # 0x9fc8
leaq 0xc93(%rip), %rsi       # 0x72f8
movl $0x2d, %edx
callq 0x3220
movq 0x3962(%rip), %r15      # 0x9fd8
movq %r15, %rdi
movq %r14, %rsi
callq 0x3250
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r15,%rax)
je 0x6694
xorl %eax, %eax
jmp 0x66b8
leaq 0xc5b(%rip), %rsi       # 0x72f6
movq %r14, %rdi
callq 0x3080
testl %eax, %eax
je 0x6690
movq 0x392a(%rip), %rdi      # 0x9fd8
movq %rbx, %rsi
callq 0x3250
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
leaq 0x8fd2(%rip), %rdi      # 0xb5e8
callq 0x4322
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2636
movq (%r14), %rdi
movq (%rdi), %rax
addq $0x38, %rsp
popq %rbx
popq %r14
jmpq *0x10(%rax)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x4466
leaq 0x8f97(%rip), %rsi      # 0xb5e8
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x488c
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2676
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x268d
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35f4
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O1/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
movl 0x6fe3(%rip), %eax      # 0xa258
leaq 0x6f10(%rip), %rcx      # 0xa18c
movl (%rcx), %r14d
cmpl %r14d, %eax
jae 0x337f
leaq 0x8(%rsp), %rbx
leaq 0x20(%rsp), %r12
leaq 0x6f17(%rip), %r13      # 0xa1b0
movabsq $-0x3333333333333333, %r15 # imm = 0xCCCCCCCCCCCCCCCD
subl %eax, %r14d
cmpl $0x20, %r14d
movl $0x20, %eax
cmovael %eax, %r14d
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x38fa
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
je 0x334a
movl $0x1, %ebx
xorl %ebp, %ebp
movq %r12, %rdi
movq %r13, %rsi
callq 0x3982
movq 0x8(%rsp), %rax
leaq (,%rbp,4), %rcx
addq %rbp, %rcx
leaq (%rax,%rcx,8), %rbp
addq $0x10, %rbp
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
callq 0x4b52
movq 0x28(%rsp), %rax
movq %rax, -0x8(%rbp)
movss 0x20(%rsp), %xmm0
movss %xmm0, -0x10(%rbp)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x332f
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movl %ebx, %ebp
movq 0x10(%rsp), %rax
subq 0x8(%rsp), %rax
sarq $0x3, %rax
imulq %r15, %rax
incl %ebx
cmpq %rbp, %rax
ja 0x32d4
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x3090
addl %r14d, 0x6efa(%rip)     # 0xa258
movq %rbx, %rdi
callq 0x3a54
movl 0x6eec(%rip), %eax      # 0xa258
leaq 0x6e19(%rip), %rcx      # 0xa18c
movl (%rcx), %r14d
cmpl %r14d, %eax
jb 0x32a3
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3390
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3a54
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O1/integeruser[P]GA3C-cpp/src/ga3c.cc
// Function: train(std::shared_ptr<Model>, std::vector<std::shared_ptr<Environment>, std::allocator<std::shared_ptr<Environment>>> const&)
void train(std::shared_ptr<Model> model, const std::vector<std::shared_ptr<Environment>>& environments)
{
    assert(BATCH_SIZE >= 0);

    assert(N_STEP_RETURN >= 1);
    assert(GAMMA >= 0.0f and GAMMA <= 1.0f);

    assert(EPSILON_START >= 0.0f and EPSILON_START <= 1.0f);
    assert(EPSILON_END   >= 0.0f and EPSILON_END   <= 1.0f and EPSILON_END <= EPSILON_START);

    assert(NUM_AGENTS >= 0);
    assert(MAX_NUM_TRAINING_EXPERIENCES >= 0);

    shared_model = model;
    assert(environments.size() == NUM_AGENTS);

    // start the trainer and the agents
    auto trainer_thread = std::thread(trainer);
    auto agents_threads = std::vector<std::thread>(NUM_AGENTS);
    for (uint32_t id = 0; id < NUM_AGENTS; ++id) {
        agents_threads[id] = std::thread(agent, id, environments[id]);
    }

    // and wait for them to finish
    for (uint32_t id = 0; id < NUM_AGENTS; ++id) {
        agents_threads[id].join();
    }
    trainer_thread.join();
    assert(num_training_experiences == MAX_NUM_TRAINING_EXPERIENCES);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq (%rdi), %rax
movq %rax, 0x6de1(%rip)      # 0xa1a0
leaq 0x8(%rdi), %rsi
leaq 0x6dde(%rip), %rdi      # 0xa1a8
callq 0x42dc
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x4, %rax
leaq 0x6da7(%rip), %r13      # 0xa188
movl (%r13), %ecx
cmpq %rcx, %rax
jne 0x34d8
leaq -0x194(%rip), %rsi      # 0x3261
leaq 0x8(%rsp), %rdi
callq 0x3aa2
movl (%r13), %esi
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3b1c
movl $0x0, 0x4(%rsp)
cmpl $0x0, (%r13)
je 0x3474
xorl %eax, %eax
leaq -0xaac(%rip), %r14      # 0x297e
leaq 0x10(%rsp), %r15
leaq 0x4(%rsp), %r12
movl %eax, %ecx
shlq $0x4, %rcx
addq (%rbx), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3b94
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpq $0x0, (%rcx,%rax,8)
jne 0x353c
movq 0x10(%rsp), %rdx
movq %rdx, (%rcx,%rax,8)
incl %eax
movl %eax, 0x4(%rsp)
cmpl (%r13), %eax
jb 0x3434
cmpl $0x0, (%r13)
je 0x349d
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x18(%rsp), %rdi
addq %rbx, %rdi
callq 0x2290
incq %r14
movl (%r13), %eax
addq $0x8, %rbx
cmpq %rax, %r14
jb 0x3480
leaq 0x8(%rsp), %rdi
callq 0x2290
movl 0x6dab(%rip), %eax      # 0xa258
leaq 0x6cd8(%rip), %rcx      # 0xa18c
cmpl (%rcx), %eax
jne 0x34f7
leaq 0x18(%rsp), %rdi
callq 0x3c4e
cmpq $0x0, 0x8(%rsp)
jne 0x353c
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x2c51(%rip), %rdi      # 0x6130
leaq 0x2b8d(%rip), %rsi      # 0x6073
leaq 0x2bed(%rip), %rcx      # 0x60da
movl $0xb7, %edx
callq 0x20d0
leaq 0x2c54(%rip), %rdi      # 0x6152
leaq 0x2b6e(%rip), %rsi      # 0x6073
leaq 0x2bce(%rip), %rcx      # 0x60da
movl $0xc5, %edx
callq 0x20d0
jmp 0x351f
movq %rax, %rbx
jmp 0x352c
jmp 0x351f
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3c4e
cmpq $0x0, 0x8(%rsp)
jne 0x353c
movq %rbx, %rdi
callq 0x22b0
callq 0x2040
nop
// File: /workspace/github_cpp_makefile_star2_O1/integeruser[P]GA3C-cpp/include/queue.h
// Function: Queue<std::tuple<std::vector<float, std::allocator<float>>, long, float>>::pop()
T pop()
        {
            std::unique_lock<std::mutex> lock(this->mutex);
            this->condition.wait(lock, [=] { return !this->queue.empty(); });
            T rc(std::move(this->queue.back()));
            this->queue.pop_back();
            return rc;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %rsi, (%r15)
movb $0x0, 0x8(%r15)
movq %r15, %rdi
callq 0x4f96
movb $0x1, 0x8(%r15)
movq 0x88(%r14), %rax
cmpq 0x68(%r14), %rax
jne 0x39db
leaq 0x28(%r14), %r15
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2050
movq 0x88(%r14), %rax
cmpq 0x68(%r14), %rax
je 0x39c3
movq 0x88(%r14), %rax
cmpq 0x90(%r14), %rax
jne 0x39fb
movq 0xa0(%r14), %rcx
movl $0x1e0, %eax            # imm = 0x1E0
addq -0x8(%rcx), %rax
addq $0x58, %r14
movl -0x28(%rax), %ecx
movl %ecx, (%rbx)
movq -0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movq -0x18(%rax), %rcx
movq %rcx, 0x10(%rbx)
movq -0x10(%rax), %rcx
movq %rcx, 0x18(%rbx)
movq -0x8(%rax), %rcx
movq %rcx, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, -0x18(%rax)
movq $0x0, -0x8(%rax)
movq %r14, %rdi
callq 0x5704
leaq 0x8(%rsp), %rdi
callq 0x4f80
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/integeruser[P]GA3C-cpp/src/main.cc
// Function: main
int main(int argc, char const *argv[])
{
    const auto start = std::chrono::steady_clock::now();

    // train the model
    auto model = std::make_shared<Model>();
    std::vector<std::shared_ptr<Environment>> environments;
    for (uint32_t id = 0; id < NUM_AGENTS; ++id) {
        auto env = std::make_shared<Environment>();
        environments.push_back(env);
    }
    train(model, environments);

    const auto end = std::chrono::steady_clock::now();
    const std::chrono::duration<float> duration_s = end-start;
    std::cout << "Training finished in " << duration_s.count() << " seconds" << std::endl;

    // save the trained model
    model->save();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
callq 0x21e0
movq %rax, 0x48(%rsp)
movl $0x18, %edi
callq 0x21b0
movq %rax, 0x8(%rsp)
movabsq $0x100000001, %rbp      # imm = 0x100000001
movq %rbp, 0x8(%rax)
leaq 0x438c(%rip), %rcx      # 0x9c50
movq %rcx, (%rax)
leaq 0x4432(%rip), %rcx      # 0x9d00
movq %rax, 0x50(%rsp)
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
cmpl $0x0, 0x4899(%rip)      # 0xa188
je 0x5961
xorl %r15d, %r15d
leaq 0x443d(%rip), %rbx      # 0x9d38
leaq 0x4486(%rip), %r14      # 0x9d88
leaq 0x30(%rsp), %r12
leaq 0x10(%rsp), %r13
movq $0x0, 0x10(%rsp)
movl $0x18, %edi
callq 0x21b0
movq %rbp, 0x8(%rax)
movq %rbx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r14, 0x10(%rax)
movq %rax, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x5a9a
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5955
callq 0x3c8a
incl %r15d
cmpl 0x4829(%rip), %r15d     # 0xa188
jb 0x590c
movq 0x50(%rsp), %r14
addq $0x10, %r14
movq %r14, 0x20(%rsp)
movq 0x8(%rsp), %rbx
movq %rbx, 0x28(%rsp)
movq 0x4650(%rip), %rax      # 0x9fd0
cmpb $0x0, (%rax)
je 0x598a
incl 0x8(%rbx)
jmp 0x598e
lock
incl 0x8(%rbx)
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x33a5
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x59ac
callq 0x3c8a
callq 0x21e0
movq %rax, %r12
movq 0x461d(%rip), %rdi      # 0x9fd8
leaq 0x922(%rip), %rsi       # 0x62e4
movl $0x15, %edx
callq 0x21d0
subq 0x48(%rsp), %r12
xorps %xmm0, %xmm0
cvtsi2ss %r12, %xmm0
divss 0x8ff(%rip), %xmm0      # 0x62e0
cvtss2sd %xmm0, %xmm0
movq 0x45ec(%rip), %rdi      # 0x9fd8
callq 0x2250
movq %rax, %r15
leaq 0x8ff(%rip), %rsi       # 0x62fa
movl $0x8, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x30(%rsp), %rdi
callq 0x5ada
movq %rbx, %rdi
callq 0x3c8a
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x28(%rsp), %rdi
jmp 0x5a74
jmp 0x5a67
movq %rax, %r14
jmp 0x5a7e
movq %rax, %r14
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5a7e
callq 0x3c8a
leaq 0x30(%rsp), %rdi
callq 0x5ada
movq 0x8(%rsp), %rdi
callq 0x3c8a
movq %r14, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/attacks.cpp
// Function: make_rocc(int, unsigned long, int)
bitboard make_rocc(int index, bitboard mask, int bits) {
	bitboard output = 0;

	for (int i = 0; i < bits; ++i) {
		if ((index >> i) & 1) {
			/* The ith bit in mask should be passed to result. */

			int currentbit = -1;
			for (int maskpos = 0; maskpos < 64; ++maskpos) {
				if ((mask >> maskpos) & 1) {
					if (++currentbit == i) {
						/* Pass this bit on! */
						output |= (1ULL << maskpos);
					}
				}
			}
		}
	}

	return output;
}

// Assembly:
xorl %r8d, %r8d
testl %edx, %edx
jle 0x5914
pushq %rbx
xorl %r9d, %r9d
xorl %eax, %eax
btl %r9d, %edi
jae 0x590a
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl $0x1, %r11d
shlq %cl, %r11
leal 0x1(%r10), %ebx
cmpl %r9d, %ebx
cmovneq %r8, %r11
btq %rcx, %rsi
cmovaeq %r8, %r11
cmovael %r10d, %ebx
orq %r11, %rax
incq %rcx
movl %ebx, %r10d
cmpq $0x40, %rcx
jne 0x58db
incl %r9d
cmpl %edx, %r9d
jne 0x58cd
popq %rbx
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/bitboard.cpp
// Function: neocortex::bb::to_string[abi:cxx11](unsigned long)
std::string bb::to_string(bitboard inp) {
	std::string output;

	for (int r = 7; r >= 0; --r) {
		for (int f = 0; f < 8; ++f) {
			if (bb::mask(square::at(r, f)) & inp) {
				output += '1';
			} else {
				output += '.';
			}
		}

		output += '\n';
	}

	return output;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movl $0x7, %r12d
movl $0x38, %r13d
xorl %ebp, %ebp
movl %ebp, %eax
orl %r12d, %eax
testl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
jne 0x5dda
leal (%r13,%rbp), %eax
xorl %ecx, %ecx
btq %rax, %r14
setb %cl
leal (%rcx,%rcx,2), %esi
addl $0x2e, %esi
movq %rbx, %rdi
callq 0x4240
incq %rbp
cmpq $0x8, %rbp
jne 0x5d80
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4240
addq $-0x8, %r13
subq $0x1, %r12
jae 0x5d7e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11ce8(%rip), %rdi     # 0x17ac9
leaq 0x11c8e(%rip), %rsi     # 0x17a76
leaq 0x11d09(%rip), %rcx     # 0x17af8
movl $0x22, %edx
callq 0x4190
jmp 0x5dfb
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x5e11
movq (%r15), %rsi
incq %rsi
callq 0x42b0
movq %r14, %rdi
callq 0x44f0
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/board.cpp
// Function: neocortex::Board::to_uci[abi:cxx11]()
std::string Board::to_uci() {
	std::string output;

	int null_count = 0;

	for (int r = 7; r >= 0; --r) {
		for (int f = 0; f < 8; ++f) {
			int sq = square::at(r, f);

			if (state[sq] == piece::null) {
				null_count++;
			} else {
				if (null_count > 0) {
					output += '0' + null_count;
					null_count = 0;
				}

				output += piece::get_uci(state[sq]);
			}
		}

		if (null_count > 0) {
			output += '0' + null_count;
			null_count = 0;
		}

		if (r) output += '/';
	}

	return output;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
addq $0x128, %r14            # imm = 0x128
xorl %r12d, %r12d
movl $0x7, %ebp
movq %rbp, %r13
xorl %ebp, %ebp
movl %ebp, %eax
orl %r13d, %eax
testl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
jne 0x6744
cmpl $-0x1, (%r14,%rbp,4)
je 0x66eb
testl %r12d, %r12d
jle 0x66d5
addb $0x30, %r12b
movsbl %r12b, %esi
movq %rbx, %rdi
callq 0x4240
xorl %r12d, %r12d
movl (%r14,%rbp,4), %edi
callq 0x8314
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4240
jmp 0x66ee
incl %r12d
incq %rbp
cmpq $0x8, %rbp
jne 0x66a6
testl %r12d, %r12d
jle 0x670f
addb $0x30, %r12b
movsbl %r12b, %esi
movq %rbx, %rdi
callq 0x4240
xorl %r12d, %r12d
movq %r13, %rbp
subq $0x1, %rbp
jb 0x6725
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x4240
addq $-0x20, %r14
testq %r13, %r13
jne 0x66a1
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1137e(%rip), %rdi     # 0x17ac9
leaq 0x11324(%rip), %rsi     # 0x17a76
leaq 0x1139f(%rip), %rcx     # 0x17af8
movl $0x22, %edx
callq 0x4190
jmp 0x6765
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x677b
movq (%r15), %rsi
incq %rsi
callq 0x42b0
movq %r14, %rdi
callq 0x44f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/board.cpp
// Function: neocortex::Board::to_pretty[abi:cxx11]()
std::string Board::to_pretty() {
	std::string output;

	for (int r = 7; r >= 0; --r) {
		for (int f = 0; f < 8; ++f) {
			int sq = square::at(r, f);

			if (state[sq] == piece::null) {
				output += '.';
			} else {
				output += piece::get_uci(state[sq]);
			}
		}

		output += '\n';
	}

	return output;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
addq $0x128, %r14            # imm = 0x128
movl $0x7, %r12d
xorl %r13d, %r13d
movl %r13d, %eax
orl %r12d, %eax
testl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
jne 0x680d
movl (%r14,%r13,4), %edi
cmpl $-0x1, %edi
je 0x67d3
callq 0x8314
jmp 0x67d5
movb $0x2e, %al
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4240
incq %r13
cmpq $0x8, %r13
jne 0x67b6
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4240
addq $-0x20, %r14
subq $0x1, %r12
jae 0x67b3
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x112b5(%rip), %rdi     # 0x17ac9
leaq 0x1125b(%rip), %rsi     # 0x17a76
leaq 0x112d6(%rip), %rcx     # 0x17af8
movl $0x22, %edx
callq 0x4190
jmp 0x682e
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x6844
movq (%r15), %rsi
incq %rsi
callq 0x42b0
movq %r14, %rdi
callq 0x44f0
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/board.cpp
// Function: neocortex::Board::guard_value(int)
int Board::guard_value(int sq) {
	int val = 0;
	bitboard att = attacks_on(sq);

	while (att) {
		val += eval::GUARD_VALUES[state[bb::poplsb(att)]];
	}

	return val;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x684c
testq %rax, %rax
je 0x6996
movq %rax, %rdx
xorl %eax, %eax
leaq 0x11ef0(%rip), %rsi     # 0x18860
movq %rdx, %rdi
bsfq %rdx, %rcx
movl $0x1, %r8d
shlq %cl, %r8
btcq %rcx, %rdi
movslq 0x48(%rbx,%rcx,4), %rcx
addl (%rsi,%rcx,4), %eax
cmpq %rdx, %r8
movq %rdi, %rdx
jne 0x6973
jmp 0x6998
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/board.cpp
// Function: neocortex::Board::mask_is_attacked(unsigned long, int)
bool Board::mask_is_attacked(bitboard mask, int col) {
	bitboard opp = color_occ[col];

	while (mask) {
		if (attacks_on(bb::poplsb(mask)) & opp) return true;
	}

	return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movslq %edx, %rax
movq 0x8(%rdi,%rax,8), %r15
movq %r14, %r12
testq %r14, %r14
je 0x69d0
bsfq %r12, %rsi
movq %r12, %r14
btcq %rsi, %r14
movq %rbx, %rdi
callq 0x684c
testq %r15, %rax
je 0x69b0
testq %r12, %r12
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/board.cpp
// Function: neocortex::Board::all_spans(int)
bitboard Board::all_spans(int col) {
	bitboard out = 0;
	bitboard pawns = piece_occ[piece::PAWN] & color_occ[col];

	while (pawns) {
		int p = bb::poplsb(pawns);

		out |= attacks::pawn_attackspans(col, p);
		out |= attacks::pawn_frontspans(col, p);
	}

	return out;
}

// Assembly:
movslq %esi, %rdx
movq 0x8(%rdi,%rdx,8), %rsi
andq 0x18(%rdi), %rsi
je 0x6a2f
xorl %eax, %eax
shlq $0x9, %rdx
leaq 0x1b793(%rip), %rdi     # 0x22190
addq %rdx, %rdi
addq 0x1a5a1(%rip), %rdx     # 0x20fa8
movq %rsi, %r8
bsfq %rsi, %rcx
movl $0x1, %r9d
shlq %cl, %r9
btcq %rcx, %r8
shll $0x3, %ecx
orq (%rcx,%rdi), %rax
orq (%rcx,%rdx), %rax
cmpq %rsi, %r9
movq %r8, %rsi
jne 0x6a0a
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/board.cpp
// Function: neocortex::Board::front_spans(int)
bitboard Board::front_spans(int col) {
	bitboard out = 0;
	bitboard pawns = piece_occ[piece::PAWN] & color_occ[col];

	while (pawns) {
		int p = bb::poplsb(pawns);

		out |= attacks::pawn_frontspans(col, p);
	}

	return out;
}

// Assembly:
movslq %esi, %rdx
movq 0x8(%rdi,%rdx,8), %rsi
andq 0x18(%rdi), %rsi
je 0x6a6e
xorl %eax, %eax
shlq $0x9, %rdx
addq 0x1a55b(%rip), %rdx     # 0x20fa8
movq %rsi, %rdi
bsfq %rsi, %rcx
movl $0x1, %r8d
shlq %cl, %r8
btcq %rcx, %rdi
orq (%rdx,%rcx,8), %rax
cmpq %rsi, %r8
movq %rdi, %rsi
jne 0x6a50
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/board.cpp
// Function: neocortex::Board::attack_spans(int)
bitboard Board::attack_spans(int col) {
	bitboard out = 0;
	bitboard pawns = piece_occ[piece::PAWN] & color_occ[col];

	while (pawns) {
		int p = bb::poplsb(pawns);

		out |= attacks::pawn_attackspans(col, p);
	}

	return out;
}

// Assembly:
movslq %esi, %rdx
movq 0x8(%rdi,%rdx,8), %rsi
andq 0x18(%rdi), %rsi
je 0x6aae
xorl %eax, %eax
shlq $0x9, %rdx
addq 0x1a553(%rip), %rdx     # 0x20fe0
movq %rsi, %rdi
bsfq %rsi, %rcx
movl $0x1, %r8d
shlq %cl, %r8
btcq %rcx, %rdi
orq (%rdx,%rcx,8), %rax
cmpq %rsi, %r8
movq %rdi, %rsi
jne 0x6a90
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/board.cpp
// Function: neocortex::Board::isolated_pawns(int)
bitboard Board::isolated_pawns(int col) {
	bitboard pawns = piece_occ[piece::PAWN] & color_occ[col];
	bitboard out = 0ULL;

	while (pawns) {
		int p = bb::poplsb(pawns);

		if (!(bb::neighbor_files(p) & pawns)) {
			out |= bb::mask(p);
		}
	}
	
	return out;
}

// Assembly:
movslq %esi, %rax
movq 0x8(%rdi,%rax,8), %rdx
andq 0x18(%rdi), %rdx
je 0x6af6
xorl %eax, %eax
leaq 0x23ec7(%rip), %rsi     # 0x2a990
movq %rdx, %rdi
bsfq %rdx, %rcx
movl $0x1, %r8d
shlq %cl, %r8
btcq %rcx, %rdi
testq %rdi, (%rsi,%rcx,8)
movl $0x0, %ecx
cmoveq %r8, %rcx
orq %rcx, %rax
cmpq %rdx, %r8
movq %rdi, %rdx
jne 0x6acc
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/board.cpp
// Function: neocortex::Board::backward_pawns(int)
bitboard Board::backward_pawns(int col) {
	bitboard pawns = piece_occ[piece::PAWN] & color_occ[col];
	bitboard stops = bb::shift(pawns, (col == piece::WHITE) ? NORTH : SOUTH);

	bitboard opp_pawns = piece_occ[piece::PAWN] & color_occ[!col];
	bitboard opp_attacks = bb::shift(opp_pawns & ~FILE_A, (col == piece::WHITE) ? NORTHWEST : SOUTHWEST);

	opp_attacks |= bb::shift(opp_pawns & ~FILE_H, (col == piece::WHITE) ? NORTHEAST : SOUTHEAST);

	stops &= ~attack_spans(col);
	stops &= opp_attacks;

	return bb::shift(stops, (col == piece::WHITE) ? SOUTH : NORTH);
}

// Assembly:
movq 0x18(%rdi), %r8
movslq %esi, %r9
xorl %ecx, %ecx
testl %r9d, %r9d
sete %cl
movq 0x8(%rdi,%r9,8), %rax
movq 0x8(%rdi,%rcx,8), %rdi
andq %r8, %rax
je 0x6b4e
pushq %rbx
xorl %edx, %edx
shlq $0x9, %r9
addq 0x1a4ba(%rip), %r9      # 0x20fe0
movq %rax, %r11
movq %rax, %r10
bsfq %r11, %rcx
movl $0x1, %ebx
shlq %cl, %rbx
btcq %rcx, %r10
orq (%r9,%rcx,8), %rdx
cmpq %r11, %rbx
movq %r10, %r11
jne 0x6b2c
notq %rdx
popq %rbx
jmp 0x6b55
movq $-0x1, %rdx
andq %r8, %rdi
movabsq $0x7f7f7f7f7f7f7f7f, %rcx # imm = 0x7F7F7F7F7F7F7F7F
andq %rdi, %rcx
movq %rcx, %r8
shrq $0x7, %r8
shlq $0x9, %rcx
movabsq $-0x101010101010102, %r9 # imm = 0xFEFEFEFEFEFEFEFE
andq %rdi, %r9
movq %r9, %rdi
shrq $0x9, %rdi
orq %r8, %rdi
shlq $0x7, %r9
orq %rcx, %r9
movq %rax, %rcx
shlq $0x8, %rcx
shrq $0x8, %rax
testl %esi, %esi
cmovneq %rdi, %r9
cmoveq %rcx, %rax
andq %rdx, %rax
andq %r9, %rax
movq %rax, %rcx
shlq $0x8, %rcx
shrq $0x8, %rax
testl %esi, %esi
cmovneq %rcx, %rax
retq
nop