// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x60(%rdi), %r15
testq %r15, %r15
je 0x6820
movq (%r15), %r14
jmp 0x6823
xorl %r14d, %r14d
testq %r15, %r15
movq 0x58(%rbx), %r12
movq %r14, %r13
cmoveq %r12, %r13
movq %r13, %rbp
shlq $0x4, %rbp
leaq 0x36(,%r12,8), %rdi
addq %rbp, %rdi
callq 0x32c0
testq %rax, %rax
je 0x68f1
leaq 0x28(%rax), %rcx
negl %ecx
andl $0x7, %ecx
addq %rax, %rcx
addq $0x28, %rcx
addq %rcx, %rbp
testq %r15, %r15
je 0x6899
movq 0x8(%r15), %rdx
movq (%r15), %rsi
movq 0x18(%r15), %rdi
decq %rsi
xorl %r8d, %r8d
movq %rdx, %r9
incq %r9
andq %rsi, %r9
movq (%rdi,%r9,8), %r10
movq %r10, (%rbp,%r8,8)
incq %r8
cmpq %rdx, %r9
jne 0x687d
cmpq %r8, %r14
jne 0x6906
movl %ebp, %edx
negl %edx
andl $0x7, %edx
addq %rbp, %rdx
testq %r13, %r13
je 0x68c8
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, %r13
jne 0x68b1
movq %r15, 0x20(%rax)
movq %rcx, 0x10(%rax)
movq %rdx, 0x18(%rax)
movq %r12, (%rax)
decq %r14
leaq -0x1(%r12), %rcx
andq %r14, %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x60(%rbx)
addq %r12, %r12
movq %r12, 0x58(%rbx)
testq %rax, %rax
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10dc(%rip), %rdi      # 0x79e9
leaq 0x7ca(%rip), %rsi       # 0x70de
leaq 0x10e0(%rip), %rcx      # 0x79fb
movl $0xb9d, %edx            # imm = 0xB9D
callq 0x3150
nop