// File: /workspace/github_cpp_makefile_star2_O1/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, %r13
callq 0x41e0
movq %rax, %r15
callq 0x4250
movq %rax, %rbp
leaq 0x2abc(%rip), %rdx      # 0x9e2c
leaq 0x2203(%rip), %r8       # 0x957a
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(%r13), %rax
movq 0x38(%rax), %r14
callq 0x41e0
testq %r14, %r14
je 0x741c
leaq 0x2a9e(%rip), %rdx      # 0x9e6b
leaq 0x21a6(%rip), %r8       # 0x957a
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(%r13), %rax
movq %rax, 0x8(%rsp)
jmp 0x746c
leaq 0x2a8b(%rip), %rdx      # 0x9eae
leaq 0x2150(%rip), %r8       # 0x957a
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 %r13, 0x8(%rsp)
movq 0x5aad(%rip), %rax      # 0xcf20
movl 0x8(%rax), %ecx
shrl $0x2, %ecx
cmpl %ecx, 0x2c(%r13)
jbe 0x761d
xorl %r14d, %r14d
movl %ecx, 0x4(%rsp)
movq %rbp, 0x10(%rsp)
movq 0x58(%r13), %rax
movl %r14d, %r12d
cmpq $0x0, (%rax,%r12,8)
je 0x74a5
incl %r14d
jmp 0x7613
movq %r13, %r15
movq 0x8(%rsp), %r13
movq (%r13), %rax
movq %r13, %rdi
callq *(%rax)
movq %rax, %rbx
callq 0x41e0
leaq (,%r12,8), %r10
addq 0x58(%r15), %r10
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
leaq 0x2a16(%rip), %rdx      # 0x9eef
movq %rbp, %rcx
leaq 0x2097(%rip), %r8       # 0x957a
movl $0x237, %r9d            # imm = 0x237
xorl %eax, %eax
pushq %r13
movq %r15, %r13
pushq %r10
pushq %r14
pushq %rbx
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(%r13), %rax
movq %rbx, (%rax,%r12,8)
testq %rbx, %rbx
je 0x75b5
movq 0x59e5(%rip), %rax      # 0xcf20
movl 0x8(%rax), %eax
shrl $0x3, %eax
bsrl %eax, %ecx
movl %r14d, %r12d
shrl %cl, %r12d
callq 0x41e0
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
leaq 0x2a42(%rip), %rdx      # 0x9fa0
movq 0x10(%rsp), %rbp
movq %rbp, %rcx
leaq 0x200d(%rip), %r8       # 0x957a
movl $0x246, %r9d            # imm = 0x246
xorl %eax, %eax
pushq %r14
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(%r13,%r12,4)
decl 0x2c(%r13)
incl %r14d
jmp 0x760f
callq 0x41e0
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
leaq 0x2986(%rip), %rdx      # 0x9f4f
movq 0x10(%rsp), %rbp
movq %rbp, %rcx
leaq 0x1fa2(%rip), %r8       # 0x957a
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
movq %r13, 0x8(%rsp)
movl 0x4(%rsp), %ecx
cmpl %ecx, 0x2c(%r13)
ja 0x748f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq