// File: /workspace/github_cpp_makefile_star2_O3/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::BibopObjCache::repopulate()
void repopulate() {
					// Perform an O(n) repopulation of this object cache using
					// freed objects located in the freeCache
					// If there are not enough objects in freeCache to fully perform
					// the repopulation, we should shift to using new objects from the
					// top of the heap (pointed to by _heapTop)

					PRDBG("*** beginning repopulation ***");

					ObjectSource * objSource;
					if(_freeCache->getNumObjects() > 0) {
							PRDBG("\tusing free cache as object source");
							objSource = _freeCache;
					} else {
							PRDBG("\tusing heap top as object source");
							objSource = this;
					}

					unsigned position = 0;
					#pragma message "allocation buffer refill level set to 75%"
					// Fills the cache back up to 75% available (25% used)
					unsigned refill_level = BIBOP_CACHE_SIZE >> 2;
					while(_numUsedObjects > refill_level) {
							if(_objects[position] == NULL) {
									//if((_objects[position] = objSource->getNext()) == NULL) {
									void * popObject = objSource->getNext();
									PRDBG("\t\tfree object %p -> _objects[%d] (cache entry %p, obj src = %p)",
											popObject, position, &_objects[position], objSource);
									// Write the next object from the free cache into this position.
									// If the free cache returned NULL then it is out of objects.
									if((_objects[position] = popObject) == NULL) {
											PRDBG("\t*** switching back to heap top as object source");
											objSource = this;
											// We do not increment position in this case because we want
											// the loop to attempt to fill this position again, but using
											// the heap as the object source instead of the free cache.
									} else {
											// Our object source returned a valid object -- decrement the
											// number of used objects, and increment the array position
											// to proceed with the next item
											//unsigned currentRegion = position & NUM_CACHE_REGIONS_MASK;
											unsigned currentRegion = position >> CACHE_REGION_SIZE_SHIFT_BITS;
											PRDBG("_regionCounters[%d]++ (index = %d)", currentRegion, position);
											_regionCounters[currentRegion]++;
											_numUsedObjects--;
											position++;
									}
							} else {
									// If the object at this position is alive,
									// simply move to the next object...
									position++;
							}
					}
			}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x41e0
movq %rax, %r15
callq 0x4250
movq %rax, %rbp
leaq 0x2b00(%rip), %rdx      # 0x9e3c
leaq 0x2247(%rip), %r8       # 0x958a
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %rax, %rcx
movl $0x223, %r9d            # imm = 0x223
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %r15
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x40f0
movq 0x8(%rbx), %rax
movq 0x38(%rax), %r14
callq 0x41e0
testq %r14, %r14
je 0x73e8
leaq 0x2ae2(%rip), %rdx      # 0x9e7b
leaq 0x21ea(%rip), %r8       # 0x958a
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
movq %rbp, %rcx
movl $0x227, %r9d            # imm = 0x227
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %r15
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x40f0
movq 0x8(%rbx), %rax
movq %rax, 0x8(%rsp)
jmp 0x7438
leaq 0x2acf(%rip), %rdx      # 0x9ebe
leaq 0x2194(%rip), %r8       # 0x958a
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
movq %rbp, %rcx
movl $0x22a, %r9d            # imm = 0x22A
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %r15
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x40f0
movq %rbx, 0x8(%rsp)
movq 0x5ae1(%rip), %rax      # 0xcf20
movl 0x8(%rax), %edx
shrl $0x2, %edx
movl 0x2c(%rbx), %eax
cmpl %edx, %eax
jbe 0x75f4
xorl %r13d, %r13d
movl %edx, 0x4(%rsp)
movq %rbp, 0x10(%rsp)
movq 0x58(%rbx), %rcx
movl %r13d, %r12d
cmpq $0x0, (%rcx,%r12,8)
je 0x7472
incl %r13d
jmp 0x75ec
movq %r13, %r15
movq %rbx, %r13
movq 0x8(%rsp), %rbx
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq %rax, %r14
callq 0x41e0
leaq (,%r12,8), %r10
addq 0x58(%r13), %r10
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
leaq 0x2a57(%rip), %rdx      # 0x9eff
movq %rbp, %rcx
leaq 0x20d8(%rip), %r8       # 0x958a
movl $0x237, %r9d            # imm = 0x237
xorl %eax, %eax
pushq %rbx
movq %r13, %rbx
movq %r15, %r13
pushq %r10
pushq %r15
pushq %r14
callq 0x4490
addq $0x20, %rsp
callq 0x41e0
movq %rax, %r15
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x40f0
movq 0x58(%rbx), %rax
movq %r14, (%rax,%r12,8)
testq %r14, %r14
je 0x758b
movq 0x5a13(%rip), %rax      # 0xcf20
movl 0x8(%rax), %eax
shrl $0x3, %eax
bsrl %eax, %ecx
movl %r13d, %r12d
shrl %cl, %r12d
callq 0x41e0
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
leaq 0x2a80(%rip), %rdx      # 0x9fb0
movq 0x10(%rsp), %rbp
movq %rbp, %rcx
leaq 0x204b(%rip), %r8       # 0x958a
movl $0x246, %r9d            # imm = 0x246
xorl %eax, %eax
pushq %r13
pushq %r12
callq 0x4490
addq $0x10, %rsp
callq 0x41e0
movq %rax, %r15
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x40f0
incl 0x34(%rbx,%r12,4)
movl 0x2c(%rbx), %eax
decl %eax
movl %eax, 0x2c(%rbx)
incl %r13d
jmp 0x75e8
callq 0x41e0
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
leaq 0x29c0(%rip), %rdx      # 0x9f5f
movq 0x10(%rsp), %rbp
movq %rbp, %rcx
leaq 0x1fdc(%rip), %r8       # 0x958a
movl $0x23b, %r9d            # imm = 0x23B
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %r15
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x40f0
movl 0x2c(%rbx), %eax
movq %rbx, 0x8(%rsp)
movl 0x4(%rsp), %edx
cmpl %edx, %eax
ja 0x745c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop