// File: /workspace/github_cpp_makefile_star2_O1/HQarroum[P]thread-pool/examples/one-producer-many-consumers/./../../includes/concurrent_queue.hpp
// Function: moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::ImplicitProducer::new_block_index()
bool new_block_index()
		{
			auto prev = blockIndex.load(std::memory_order_relaxed);
			size_t prevCapacity = prev == nullptr ? 0 : prev->capacity;
			auto entryCount = prev == nullptr ? nextBlockIndexCapacity : prevCapacity;
			auto raw = static_cast<char*>((Traits::malloc)(
				sizeof(BlockIndexHeader) +
				std::alignment_of<BlockIndexEntry>::value - 1 + sizeof(BlockIndexEntry) * entryCount +
				std::alignment_of<BlockIndexEntry*>::value - 1 + sizeof(BlockIndexEntry*) * nextBlockIndexCapacity));
			if (raw == nullptr) {
				return false;
			}
			
			auto header = new (raw) BlockIndexHeader;
			auto entries = reinterpret_cast<BlockIndexEntry*>(details::align_for<BlockIndexEntry>(raw + sizeof(BlockIndexHeader)));
			auto index = reinterpret_cast<BlockIndexEntry**>(details::align_for<BlockIndexEntry*>(reinterpret_cast<char*>(entries) + sizeof(BlockIndexEntry) * entryCount));
			if (prev != nullptr) {
				auto prevTail = prev->tail.load(std::memory_order_relaxed);
				auto prevPos = prevTail;
				size_t i = 0;
				do {
					prevPos = (prevPos + 1) & (prev->capacity - 1);
					index[i++] = prev->index[prevPos];
				} while (prevPos != prevTail);
				assert(i == prevCapacity);
			}
			for (size_t i = 0; i != entryCount; ++i) {
				new (entries + i) BlockIndexEntry;
				entries[i].key.store(INVALID_BLOCK_BASE, std::memory_order_relaxed);
				index[prevCapacity + i] = entries + i;
			}
			header->prev = prev;
			header->entries = entries;
			header->index = index;
			header->capacity = nextBlockIndexCapacity;
			header->tail.store((prevCapacity - 1) & (nextBlockIndexCapacity - 1), std::memory_order_relaxed);
			
			blockIndex.store(header, std::memory_order_release);
			
			nextBlockIndexCapacity <<= 1;
			
			return true;
		}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %r15
testq %r15, %r15
je 0x64c0
movq (%r15), %r14
jmp 0x64c3
xorl %r14d, %r14d
testq %r15, %r15
movq 0x58(%rbx), %rax
movq %r14, %r12
cmoveq %rax, %r12
movq %r12, %r13
shlq $0x4, %r13
leaq 0x36(,%rax,8), %rdi
addq %r13, %rdi
callq 0x32c0
testq %rax, %rax
je 0x6590
leaq 0x28(%rax), %rcx
negl %ecx
andl $0x7, %ecx
addq %rax, %rcx
addq $0x28, %rcx
addq %rcx, %r13
testq %r15, %r15
je 0x6538
movq 0x8(%r15), %rdx
movq (%r15), %rsi
decq %rsi
xorl %edi, %edi
movq %rdx, %r8
incq %r8
andq %rsi, %r8
movq 0x18(%r15), %r9
movq (%r9,%r8,8), %r9
movq %r9, (%r13,%rdi,8)
incq %rdi
cmpq %rdx, %r8
jne 0x6518
cmpq %rdi, %r14
jne 0x65a0
movl %r13d, %edx
negl %edx
andl $0x7, %edx
addq %r13, %rdx
testq %r12, %r12
je 0x6568
leaq (%rdx,%r14,8), %rsi
xorl %edi, %edi
movq %rcx, %r8
movq $0x1, (%r8)
movq %r8, (%rsi,%rdi,8)
incq %rdi
addq $0x10, %r8
cmpq %rdi, %r12
jne 0x6551
movq %r15, 0x20(%rax)
movq %rcx, 0x10(%rax)
movq %rdx, 0x18(%rax)
movq 0x58(%rbx), %rcx
movq %rcx, (%rax)
decq %r14
decq %rcx
andq %r14, %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x60(%rbx)
shlq 0x58(%rbx)
testq %rax, %rax
setne %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x13a2(%rip), %rdi      # 0x7949
leaq 0xa90(%rip), %rsi       # 0x703e
leaq 0x13a6(%rip), %rcx      # 0x795b
movl $0xb9d, %edx            # imm = 0xB9D
callq 0x3150
nop