// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::BibopObjCache::getRandomObject(bool)
uintptr_t getRandomObject(bool doReplacement = false) {
					unsigned index;
					//unsigned numTries = 1;
					void * object;

					// Obtain a random number between [0, opts.bibop_cache_size)
					index = getRandomNumber() & BIBOP_CACHE_SIZE_MASK;
					object = _objects[index];

					PRDBG("trying object %p at index %d...", object, index);
					// Find the next sequential cache region with objects available for use
					if(!object) {
							int i;
							unsigned cacheRegionNumber = index >> CACHE_REGION_SIZE_SHIFT_BITS;
							unsigned tryRegionNumber;

							PRDBG(" ... didn't work, current region = %d, searching regions...", cacheRegionNumber);
							for(i = cacheRegionNumber; i < cacheRegionNumber + NUM_CACHE_REGIONS; i++) {
									tryRegionNumber = i & NUM_CACHE_REGIONS_MASK;
									//numTries++;
									if(_regionCounters[tryRegionNumber] == UNINITIALIZED_CACHE_REGION) {
											initialPopulate();
											break;
									} else if(_regionCounters[tryRegionNumber] > 0) {
											PRDBG(" ... using region = %d, has %d objects", tryRegionNumber, _regionCounters[tryRegionNumber]);
											break;
									} else {
											PRDBG(" ... region %d has no objects, moving on...", tryRegionNumber);
									}
							}

							// Attempt to use a "random" object from this region
							// (add +1 to index in order to avoid rehecking the same object if the
							// same cache region is chosen by the for-loop above).
							index = (tryRegionNumber << CACHE_REGION_SIZE_SHIFT_BITS) + ((index + 1) & CACHE_REGION_SIZE_MASK);
							object = _objects[index];
							PRDBG("	...trying first object (%p) in region %d, has index %d...", object, tryRegionNumber, index);

							// Now walk through the region's objects to find an available one
							// (that is, if the first object is unavailable)...
							//numTries++;
							while(!object) {
									PRDBG("cache conflict on index %u (object = %p, num used=%d); trying next item...",
													index, object, _numUsedObjects);

									// Try the next adjacent index, wrapping around if necessary...
									index++;
									if((index & CACHE_REGION_SIZE_MASK) == 0) {
											index = tryRegionNumber << CACHE_REGION_SIZE_SHIFT_BITS;
									}

									object = _objects[index];
									//numTries++;
							}
					}
					unsigned currentRegion = index >> CACHE_REGION_SIZE_SHIFT_BITS;
					//PRINT("numTries %u numAvailObjs %u curRegion %d regionObjects %d",
					//				numTries, (BibopHeap::_cacheSize - _numUsedObjects), currentRegion, _regionCounters[currentRegion]);

					// If desired, we will replace the randomly selected object with a
					// fresh object from the free cache, if one is available to use.
					if(doReplacement && (_freeCache->getNumObjects() > 0)) {
							PRDBG("freecache has free objects, doing replacement of cache index %u", index);
							_objects[index] = _freeCache->getNext();
					} else {
							// mark the object as NULL in _objects array to indicate
							// it is no longer available
							PRDBG("writing NULL to used cache index: cache @ %p, entry @ %p equals %p; index=%u",
											_objects, &_objects[index], _objects[index], index);
							_objects[index] = NULL;
							_numUsedObjects++;
							
							PRDBG("_regionCounters[%d]-- (index = %d)", currentRegion, index);
							_regionCounters[currentRegion]--;
							assert(_regionCounters[currentRegion] >= 0);
					}

					PRDBG("getRandomObject() returning %p", object);
					return (uintptr_t)object;
			}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, 0x14(%rsp)
movq %rdi, %r15
callq 0x40a0
movq 0x58d3(%rip), %rbx      # 0xcf20
movl 0x8(%rbx), %r14d
decl %r14d
andl %eax, %r14d
movq %r15, (%rsp)
movq 0x58(%r15), %rax
movq (%rax,%r14,8), %r15
callq 0x41e0
movq %rax, %r12
callq 0x4250
movq %rax, %r13
leaq 0x2969(%rip), %rdx      # 0x9fe3
leaq 0x1ef9(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %r12, %rdi
movq %rax, %rcx
movl $0x25c, %r9d            # imm = 0x25C
xorl %eax, %eax
pushq %r14
pushq %r15
callq 0x4490
addq $0x10, %rsp
callq 0x41e0
movq %rax, %r12
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x40f0
testq %r15, %r15
movq %r13, 0x8(%rsp)
je 0x76d8
movq %rbx, %r13
jmp 0x78ce
movl 0x8(%rbx), %eax
shrl $0x3, %eax
bsrl %eax, %ecx
movl %r14d, %ebp
shrl %cl, %ebp
callq 0x41e0
subq $0x8, %rsp
leaq 0x292d(%rip), %rdx      # 0xa023
leaq 0x1e7d(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
movq %r13, %rcx
movl $0x263, %r9d            # imm = 0x263
xorl %eax, %eax
pushq %rbp
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
cmpl $-0x9, %ebp
movq (%rsp), %rbx
ja 0x7835
xorl %r15d, %r15d
leal (%r15,%rbp), %r12d
andl $0x7, %r12d
movl 0x34(%rbx,%r12,4), %eax
testl %eax, %eax
jne 0x77c7
callq 0x41e0
subq $0x8, %rsp
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
leaq 0x294e(%rip), %rdx      # 0xa0c6
movq 0x10(%rsp), %rcx
leaq 0x1df6(%rip), %r8       # 0x957a
movl $0x26e, %r9d            # imm = 0x26E
xorl %eax, %eax
pushq %r12
callq 0x4490
addq $0x10, %rsp
callq 0x41e0
movq %rax, %r13
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r13, %rsi
movq %rax, %rdx
callq 0x40f0
incl %r15d
cmpl $0x8, %r15d
jne 0x774f
jmp 0x7835
cmpl $-0x1, %eax
jne 0x77d6
movq %rbx, %rdi
callq 0x4450
jmp 0x7835
callq 0x41e0
movl 0x34(%rbx,%r12,4), %r10d
leaq 0x2898(%rip), %rdx      # 0xa07f
leaq 0x1d8c(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
movq 0x8(%rsp), %rcx
movl $0x26b, %r9d            # imm = 0x26B
xorl %eax, %eax
pushq %r10
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
movq 0x56e4(%rip), %rax      # 0xcf20
movl 0x8(%rax), %ebp
shrl $0x3, %ebp
bsrl %ebp, %ecx
movl %r12d, %eax
shll %cl, %eax
incl %r14d
decl %ebp
andl %r14d, %ebp
addl %eax, %ebp
movq 0x58(%rbx), %rax
movq (%rax,%rbp,8), %r15
callq 0x41e0
subq $0x8, %rsp
leaq 0x28a6(%rip), %rdx      # 0xa112
leaq 0x1d07(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
movq 0x10(%rsp), %rcx
movl $0x277, %r9d            # imm = 0x277
xorl %eax, %eax
pushq %rbp
pushq %r12
pushq %r15
callq 0x4490
addq $0x20, %rsp
callq 0x41e0
movq %rax, %r14
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x40f0
testq %r15, %r15
je 0x7abf
movl %ebp, %r14d
movq 0x5652(%rip), %r13      # 0xcf20
movq (%rsp), %rbx
movl 0x8(%r13), %eax
shrl $0x3, %eax
bsrl %eax, %ecx
movl %r14d, %ebp
shrl %cl, %ebp
cmpb $0x0, 0x14(%rsp)
je 0x796f
movq 0x8(%rbx), %rax
cmpq $0x0, 0x38(%rax)
je 0x796f
callq 0x41e0
subq $0x8, %rsp
leaq 0x28d1(%rip), %rdx      # 0xa1d8
leaq 0x1c6c(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
movq 0x10(%rsp), %r13
movq %r13, %rcx
movl $0x291, %r9d            # imm = 0x291
xorl %eax, %eax
pushq %r14
callq 0x4490
addq $0x10, %rsp
callq 0x41e0
movq %rax, %r12
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x40f0
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
callq *(%rax)
movq 0x58(%rbx), %rcx
movl %r14d, %edx
movq %rax, (%rcx,%rdx,8)
jmp 0x7a53
callq 0x41e0
movq 0x58(%rbx), %r10
movl %r14d, %ecx
movq %rcx, (%rsp)
leaq (%r10,%rcx,8), %r11
leaq 0x28ae(%rip), %rdx      # 0xa238
leaq 0x1be9(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
movq 0x8(%rsp), %r12
movq %r12, %rcx
movl $0x297, %r9d            # imm = 0x297
xorl %eax, %eax
pushq %r14
pushq (%r11)
pushq %r11
pushq %r10
callq 0x4490
addq $0x20, %rsp
callq 0x41e0
movq %rax, %r13
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r13, %rsi
movq %r12, %r13
movq %rax, %rdx
callq 0x40f0
movq 0x58(%rbx), %rax
movq (%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
incl 0x2c(%rbx)
callq 0x41e0
leaq 0x28a3(%rip), %rdx      # 0xa2a5
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
movq %r12, %rcx
leaq 0x1b66(%rip), %r8       # 0x957a
movl $0x29b, %r9d            # imm = 0x29B
xorl %eax, %eax
pushq %r14
pushq %rbp
callq 0x4490
addq $0x10, %rsp
callq 0x41e0
movq %rax, %r12
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x40f0
movl %ebp, %eax
decl 0x34(%rbx,%rax,4)
callq 0x41e0
subq $0x8, %rsp
leaq 0x2885(%rip), %rdx      # 0xa2e8
leaq 0x1b10(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
movq %r13, %rcx
movl $0x2a0, %r9d            # imm = 0x2A0
xorl %eax, %eax
pushq %r15
callq 0x4490
addq $0x10, %rsp
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x545a(%rip), %r13      # 0xcf20
movq (%rsp), %rbx
callq 0x41e0
movl 0x2c(%rbx), %r10d
subq $0x8, %rsp
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
leaq 0x2687(%rip), %rdx      # 0xa16d
movq 0x10(%rsp), %rcx
leaq 0x1a88(%rip), %r8       # 0x957a
movl $0x27e, %r9d            # imm = 0x27E
xorl %eax, %eax
pushq %r10
pushq %r15
pushq %rbp
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
incl %ebp
movl 0x8(%r13), %eax
shrl $0x3, %eax
bsrl %eax, %ecx
movl %r12d, %r14d
shll %cl, %r14d
decl %eax
testl %ebp, %eax
cmovnel %ebp, %r14d
movq 0x58(%rbx), %rax
movq (%rax,%r14,8), %r15
movl %r14d, %ebp
testq %r15, %r15
je 0x7aca
jmp 0x78d2