// File: HQarroum[P]thread-pool/examples/one-producer-many-consumers/./../../includes/concurrent_queue.hpp
// Function: moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::ExplicitProducer::new_block_index(unsigned long)
bool new_block_index(size_t numberOfFilledSlotsToExpose)
		{
			auto prevBlockSizeMask = pr_blockIndexSize - 1;
			
			// Create the new block
			pr_blockIndexSize <<= 1;
			auto newRawPtr = static_cast<char*>((Traits::malloc)(sizeof(BlockIndexHeader) + std::alignment_of<BlockIndexEntry>::value - 1 + sizeof(BlockIndexEntry) * pr_blockIndexSize));
			if (newRawPtr == nullptr) {
				pr_blockIndexSize >>= 1;		// Reset to allow graceful retry
				return false;
			}
			
			auto newBlockIndexEntries = reinterpret_cast<BlockIndexEntry*>(details::align_for<BlockIndexEntry>(newRawPtr + sizeof(BlockIndexHeader)));
			
			// Copy in all the old indices, if any
			size_t j = 0;
			if (pr_blockIndexSlotsUsed != 0) {
				auto i = (pr_blockIndexFront - pr_blockIndexSlotsUsed) & prevBlockSizeMask;
				do {
					newBlockIndexEntries[j++] = pr_blockIndexEntries[i];
					i = (i + 1) & prevBlockSizeMask;
				} while (i != pr_blockIndexFront);
			}
			
			// Update everything
			auto header = new (newRawPtr) BlockIndexHeader;
			header->size = pr_blockIndexSize;
			header->front.store(numberOfFilledSlotsToExpose - 1, std::memory_order_relaxed);
			header->entries = newBlockIndexEntries;
			header->prev = pr_blockIndexRaw;		// we link the new block to the old one so we can free it later
			
			pr_blockIndexFront = j;
			pr_blockIndexEntries = newBlockIndexEntries;
			pr_blockIndexRaw = newRawPtr;
			blockIndex.store(header, std::memory_order_release);
			
			return true;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
movq 0x68(%rax), %rcx
subq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movq 0x68(%rax), %rcx
shlq %rcx
movq %rcx, 0x68(%rax)
movq 0x68(%rax), %rdi
shlq $0x4, %rdi
addq $0x27, %rdi
callq 0x5b10
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x14396
movq -0x70(%rbp), %rax
movq 0x68(%rax), %rcx
shrq %rcx
movq %rcx, 0x68(%rax)
movb $0x0, -0x21(%rbp)
jmp 0x1450d
movq -0x48(%rbp), %rdi
addq $0x20, %rdi
callq 0x39f0
movq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
cmpq $0x0, 0x60(%rax)
je 0x1442c
movq -0x70(%rbp), %rcx
movq 0x70(%rcx), %rax
subq 0x60(%rcx), %rax
andq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x70(%rbp), %rax
movq 0x78(%rax), %rcx
movq -0x60(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq -0x58(%rbp), %rdx
movq %rdx, %rsi
addq $0x1, %rsi
movq %rsi, -0x58(%rbp)
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rax
addq $0x1, %rax
andq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x70(%rbp), %rcx
movq -0x60(%rbp), %rax
cmpq 0x70(%rcx), %rax
jne 0x143d1
jmp 0x1442c
movq -0x70(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, -0x68(%rbp)
movq 0x68(%rax), %rcx
movq -0x68(%rbp), %rax
movq %rcx, (%rax)
movq -0x68(%rbp), %rcx
addq $0x8, %rcx
movq -0x38(%rbp), %rax
decq %rax
movq %rcx, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movl -0x14(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x20(%rbp)
subl $0x3, %eax
je 0x144a5
jmp 0x1448e
movl -0x74(%rbp), %eax
subl $0x5, %eax
je 0x144b2
jmp 0x14498
movq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x144bd
movq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x144bd
movq -0x80(%rbp), %rcx
movq -0x20(%rbp), %rax
xchgq %rax, (%rcx)
movq -0x70(%rbp), %rdi
movq -0x50(%rbp), %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x80(%rdi), %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x58(%rbp), %rax
movq %rax, 0x70(%rdi)
movq -0x50(%rbp), %rax
movq %rax, 0x78(%rdi)
movq -0x48(%rbp), %rax
movq %rax, 0x80(%rdi)
addq $0x58, %rdi
movq -0x68(%rbp), %rsi
movl $0x3, %edx
callq 0x14cb0
movb $0x1, -0x21(%rbp)
movb -0x21(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)