// File: /workspace/github_cpp_makefile_star2_O1/HQarroum[P]thread-pool/examples/one-producer-many-consumers/./../../includes/concurrent_queue.hpp
// Function: unsigned long moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::ExplicitProducer::dequeue_bulk<std::function<void ()>*>(std::function<void ()>*&, unsigned long)
size_t dequeue_bulk(It& itemFirst, size_t max)
		{
			auto tail = this->tailIndex.load(std::memory_order_relaxed);
			auto overcommit = this->dequeueOvercommit.load(std::memory_order_relaxed);
			auto desiredCount = static_cast<size_t>(tail - (this->dequeueOptimisticCount.load(std::memory_order_relaxed) - overcommit));
			if (details::circular_less_than<size_t>(0, desiredCount)) {
				desiredCount = desiredCount < max ? desiredCount : max;
				std::atomic_thread_fence(std::memory_order_acquire);
				
				auto myDequeueCount = this->dequeueOptimisticCount.fetch_add(desiredCount, std::memory_order_relaxed);
				
				tail = this->tailIndex.load(std::memory_order_acquire);
				auto actualCount = static_cast<size_t>(tail - (myDequeueCount - overcommit));
				if (details::circular_less_than<size_t>(0, actualCount)) {
					actualCount = desiredCount < actualCount ? desiredCount : actualCount;
					if (actualCount < desiredCount) {
						this->dequeueOvercommit.fetch_add(desiredCount - actualCount, std::memory_order_release);
					}
					
					// Get the first index. Note that since there's guaranteed to be at least actualCount elements, this
					// will never exceed tail.
					auto firstIndex = this->headIndex.fetch_add(actualCount, std::memory_order_acq_rel);
					
					// Determine which block the first element is in
					auto localBlockIndex = blockIndex.load(std::memory_order_acquire);
					auto localBlockIndexHead = localBlockIndex->front.load(std::memory_order_acquire);
					
					auto headBase = localBlockIndex->entries[localBlockIndexHead].base;
					auto firstBlockBaseIndex = firstIndex & ~static_cast<index_t>(BLOCK_SIZE - 1);
					auto offset = static_cast<size_t>(static_cast<typename std::make_signed<index_t>::type>(firstBlockBaseIndex - headBase) / BLOCK_SIZE);
					auto indexIndex = (localBlockIndexHead + offset) & (localBlockIndex->size - 1);
					
					// Iterate the blocks and dequeue
					auto index = firstIndex;
					do {
						auto firstIndexInBlock = index;
						index_t endIndex = (index & ~static_cast<index_t>(BLOCK_SIZE - 1)) + static_cast<index_t>(BLOCK_SIZE);
						endIndex = details::circular_less_than<index_t>(firstIndex + static_cast<index_t>(actualCount), endIndex) ? firstIndex + static_cast<index_t>(actualCount) : endIndex;
						auto block = localBlockIndex->entries[indexIndex].block;
						if (MOODYCAMEL_NOEXCEPT_ASSIGN(T, T&&, details::deref_noexcept(itemFirst) = std::move((*(*block)[index])))) {
							while (index != endIndex) {
								auto& el = *((*block)[index]);
								*itemFirst++ = std::move(el);
								el.~T();
								++index;
							}
						}
						else {
							MOODYCAMEL_TRY {
								while (index != endIndex) {
									auto& el = *((*block)[index]);
									*itemFirst = std::move(el);
									++itemFirst;
									el.~T();
									++index;
								}
							}
							MOODYCAMEL_CATCH (...) {
								// It's too late to revert the dequeue, but we can make sure that all
								// the dequeued objects are properly destroyed and the block index
								// (and empty count) are properly updated before we propagate the exception
								do {
									block = localBlockIndex->entries[indexIndex].block;
									while (index != endIndex) {
										(*block)[index++]->~T();
									}
									block->ConcurrentQueue::Block::template set_many_empty<explicit_context>(firstIndexInBlock, static_cast<size_t>(endIndex - firstIndexInBlock));
									indexIndex = (indexIndex + 1) & (localBlockIndex->size - 1);
									
									firstIndexInBlock = index;
									endIndex = (index & ~static_cast<index_t>(BLOCK_SIZE - 1)) + static_cast<index_t>(BLOCK_SIZE);
									endIndex = details::circular_less_than<index_t>(firstIndex + static_cast<index_t>(actualCount), endIndex) ? firstIndex + static_cast<index_t>(actualCount) : endIndex;
								} while (index != firstIndex + actualCount);
								
								MOODYCAMEL_RETHROW;
							}
						}
						block->ConcurrentQueue::Block::template set_many_empty<explicit_context>(firstIndexInBlock, static_cast<size_t>(endIndex - firstIndexInBlock));
						indexIndex = (indexIndex + 1) & (localBlockIndex->size - 1);
					} while (index != firstIndex + actualCount);
					
					return actualCount;
				}
				else {
					// Wasn't anything to dequeue after all; make the effective dequeue count eventually consistent
					this->dequeueOvercommit.fetch_add(desiredCount, std::memory_order_release);
				}
			}
			
			return 0;
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq 0x20(%rdi), %rcx
movq 0x38(%rdi), %r8
movq 0x30(%rdi), %rsi
movq %r8, %rax
subq %rsi, %rax
addq %rcx, %rax
testq %rax, %rax
jle 0x498a
cmpq %rdx, %rax
cmovbq %rax, %rdx
movq %rdx, %rax
lock
xaddq %rax, 0x30(%rdi)
movq 0x20(%rdi), %rcx
subq %rax, %r8
addq %rcx, %r8
testq %r8, %r8
jle 0x4980
movq %r8, %r9
movq %r8, 0x10(%rsp)
cmpq %r8, %rdx
cmovbq %rdx, %r9
jbe 0x4843
subq %r9, %rdx
lock
addq %rdx, 0x38(%rdi)
movq %r9, %rbp
lock
xaddq %rbp, 0x28(%rdi)
movq 0x58(%rdi), %rdi
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
movq %rax, %rdx
shlq $0x4, %rdx
movq %rbp, %rsi
andq $-0x20, %rsi
subq (%rcx,%rdx), %rsi
movq (%rdi), %r8
shrq $0x5, %rsi
addq %rax, %rsi
decq %r8
andq %rsi, %r8
movq %r9, 0x8(%rsp)
leaq (%r9,%rbp), %rsi
movabsq $-0x8000000000000000, %r9 # imm = 0x8000000000000000
movq %rbp, %rax
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rbp, %r12
andq $-0x20, %r12
addq $0x20, %r12
movq %rsi, %rcx
subq %r12, %rcx
cmpq %r9, %rcx
cmovaq %rsi, %r12
movq 0x10(%rdi), %rcx
movq %r8, %rdx
shlq $0x4, %rdx
movq 0x8(%rcx,%rdx), %r13
cmpq %r12, %rbp
je 0x4932
movq %r8, 0x30(%rsp)
movq %rbp, 0x28(%rsp)
movl %ebp, %r14d
andl $0x1f, %r14d
shll $0x5, %r14d
leaq (%r14,%r13), %r15
movq (%rbx), %rdi
leaq 0x20(%rdi), %rax
movq %rax, (%rbx)
movq %r15, %rsi
callq 0x4c62
movq 0x10(%r13,%r14), %rax
testq %rax, %rax
je 0x4909
movq %r15, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq *%rax
incq %rbp
cmpq %rbp, %r12
jne 0x48d1
movq %r12, %rax
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %r8
movq 0x18(%rsp), %rsi
movabsq $-0x8000000000000000, %r9 # imm = 0x8000000000000000
movq 0x28(%rsp), %rbp
movq %rbp, %rcx
subq %r12, %rcx
je 0x495c
andl $0x1f, %ebp
subq %rbp, %r13
addq $0x430, %r13            # imm = 0x430
movb (%r13,%rcx), %dl
testb $0x1, %dl
jne 0x499b
movb $0x1, (%r13,%rcx)
incq %rcx
jne 0x4947
incq %r8
movq (%rdi), %rcx
decq %rcx
andq %rcx, %r8
movq %rax, %rbp
cmpq %rsi, %rax
jne 0x489a
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rax
jmp 0x4985
lock
addq %rdx, 0x38(%rdi)
testq %r8, %r8
jg 0x498c
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2986(%rip), %rdi      # 0x7328
leaq 0x2695(%rip), %rsi      # 0x703e
leaq 0x29ab(%rip), %rcx      # 0x735b
movl $0x642, %edx            # imm = 0x642
callq 0x3150
movq %rax, %rdi
callq 0x3b0b