// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::BibopFreeCache::add(void*)
inline bool add(void * addr) {
							// Check if this buffer has reached full capacity...
							if(_numFreeObjects == _capacity) {
									#ifdef USE_GLOBAL_FREE_CACHE
									// Attempt to donate up to half of the
									// local buffer's items to the global buffer
									if(_myGlobalFreeCache) {
											int i;

											_myGlobalFreeCache->acquireLock();
											for(i = 0; i < (_capacity >> 1); i++) {
													if(!_myGlobalFreeCache->add(getNext())) {
															break;
													}
											}
											_myGlobalFreeCache->releaseLock();
											PRDBG("donated %d objects to global cache", i);
											// If i==0, the global free cache is also at full capacity
											if(i == 0) {
													FATAL("global and local free cache out of capacity");
											}
									} else {
											// If we are a global buffer and we're full,
											// simply return false back to the caller
											return false;
									}
									#else
									// If the global free cache is not in use and the local
									// buffer is full, print an error and return false
									PRERR("local free cache out of capacity: dropping object %p", addr);
									return false;
									#endif
							}

							*(void **)_head = addr;
							_head += POINTER_SIZE;
							if(_head == _endaddr) {
									// do wrap-around on _head
									_head = _startaddr;
							}

							_numFreeObjects++;

							/*
							// DEBUG: internal consistency check
							long count = (_endaddr - _startaddr) / sizeof(void *);
							if(_head > _tail) {
									count = (_head - _tail) / sizeof(void *);
							} else if(_head < _tail) {
									count = ((_endaddr - _tail) + (_head - _startaddr)) / sizeof(void *);
							}
							PRDBG("freeCache->add(%p): this=%p, _numFreeObjects=%lu, count=%ld, _capacity=%lu, _start=0x%lx, _end=0x%lx",
											addr, this, _numFreeObjects, count, _capacity, _startaddr, _endaddr);
							if(_numFreeObjects != count) {
									FATAL("freeCache->add(%p): this=%p, _numFreeObjects=%lu, count=%ld, _capacity=%lu, _start=0x%lx, _end=0x%lx",
													addr, this,  _numFreeObjects, count, _capacity, _startaddr, _endaddr);
							}
							*/

							if(_head == _tail) {
									PRDBG("free cache is now full");
									if(_numFreeObjects != _capacity) {
											PRERR("_numFreeObjects = %lu, _capacity = %lu", _numFreeObjects, _capacity);
									}
									assert(_numFreeObjects == _capacity);
							}

							return true;
					}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq 0x28(%rdi), %r12
movq 0x38(%rdi), %r13
cmpq %r12, %r13
je 0x7c7b
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq %r14, (%rax)
addq $0x8, %rax
movq %rax, 0x18(%rdi)
cmpq 0x10(%rdi), %rax
jne 0x7b83
movq 0x8(%rbx), %rax
movq %rax, 0x18(%rbx)
leaq 0x1(%r13), %rcx
movq %rcx, 0x38(%rbx)
cmpq 0x20(%rbx), %rax
jne 0x7cd9
callq 0x4200
movq %rax, %r15
callq 0x4280
movq %rax, %r14
leaq 0x28f6(%rip), %rdx      # 0xa4a2
leaq 0x19c7(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %rax, %rcx
movl $0x122, %r9d            # imm = 0x122
xorl %eax, %eax
callq 0x4560
callq 0x4200
movq %rax, %r15
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4100
movq 0x38(%rbx), %rax
cmpq 0x28(%rbx), %rax
je 0x7cd9
callq 0x4200
leaq 0x28d1(%rip), %rdx      # 0xa4d9
leaq 0x196b(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
movq %r14, %rcx
movl $0x124, %r9d            # imm = 0x124
xorl %eax, %eax
pushq 0x28(%rbx)
pushq 0x38(%rbx)
callq 0x4560
popq %rcx
popq %rdx
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 0x38(%rbx), %rax
cmpq 0x28(%rbx), %rax
je 0x7cd9
leaq 0x28c1(%rip), %rdi      # 0xa524
leaq 0x1910(%rip), %rsi      # 0x957a
leaq 0x28d0(%rip), %rcx      # 0xa541
movl $0x126, %edx            # imm = 0x126
callq 0x4220
callq 0x4200
movq %rax, %rbx
callq 0x4280
subq $0x8, %rsp
leaq 0x27b6(%rip), %rdx      # 0xa449
leaq 0x18e0(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %rax, %rcx
movl $0x103, %r9d            # imm = 0x103
xorl %eax, %eax
pushq %r14
callq 0x4560
popq %rcx
popq %rdx
callq 0x4200
movq %rax, %rbx
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4100
cmpq %r12, %r13
setne %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop