// File: HQarroum[P]thread-pool/examples/one-producer-many-consumers/./../../includes/concurrent_queue.hpp
// Function: bool moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::ImplicitProducer::enqueue<(moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::AllocationMode)0, std::function<void ()>>(std::function<void ()>&&)
inline bool enqueue(U&& element)
		{
			index_t currentTailIndex = this->tailIndex.load(std::memory_order_relaxed);
			index_t newTailIndex = 1 + currentTailIndex;
			if ((currentTailIndex & static_cast<index_t>(BLOCK_SIZE - 1)) == 0) {
				// We reached the end of a block, start a new one
				auto head = this->headIndex.load(std::memory_order_relaxed);
				assert(!details::circular_less_than<index_t>(currentTailIndex, head));
				if (!details::circular_less_than<index_t>(head, currentTailIndex + BLOCK_SIZE) || (MAX_SUBQUEUE_SIZE != details::const_numeric_max<size_t>::value && (MAX_SUBQUEUE_SIZE == 0 || MAX_SUBQUEUE_SIZE - BLOCK_SIZE < currentTailIndex - head))) {
					return false;
				}
#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX
				debug::DebugLock lock(mutex);
#endif
				// Find out where we'll be inserting this block in the block index
				BlockIndexEntry* idxEntry;
				if (!insert_block_index_entry<allocMode>(idxEntry, currentTailIndex)) {
					return false;
				}
				
				// Get ahold of a new block
				auto newBlock = this->parent->ConcurrentQueue::template requisition_block<allocMode>();
				if (newBlock == nullptr) {
					rewind_block_index_tail();
					idxEntry->value.store(nullptr, std::memory_order_relaxed);
					return false;
				}
#ifdef MCDBGQ_TRACKMEM
				newBlock->owner = this;
#endif
				newBlock->ConcurrentQueue::Block::template reset_empty<implicit_context>();

				MOODYCAMEL_CONSTEXPR_IF (!MOODYCAMEL_NOEXCEPT_CTOR(T, U, new (static_cast<T*>(nullptr)) T(std::forward<U>(element)))) {
					// May throw, try to insert now before we publish the fact that we have this new block
					MOODYCAMEL_TRY {
						new ((*newBlock)[currentTailIndex]) T(std::forward<U>(element));
					}
					MOODYCAMEL_CATCH (...) {
						rewind_block_index_tail();
						idxEntry->value.store(nullptr, std::memory_order_relaxed);
						this->parent->add_block_to_free_list(newBlock);
						MOODYCAMEL_RETHROW;
					}
				}
				
				// Insert the new block into the index
				idxEntry->value.store(newBlock, std::memory_order_relaxed);
				
				this->tailBlock = newBlock;
				
				MOODYCAMEL_CONSTEXPR_IF (!MOODYCAMEL_NOEXCEPT_CTOR(T, U, new (static_cast<T*>(nullptr)) T(std::forward<U>(element)))) {
					this->tailIndex.store(newTailIndex, std::memory_order_release);
					return true;
				}
			}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x60(%rbp)
movq %rsi, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0xa8(%rbp)
addq $0x20, %rax
movq %rax, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl -0xc(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x94(%rbp)
decl %eax
subl $0x2, %eax
jb 0x13147
jmp 0x1312a
movl -0x94(%rbp), %eax
subl $0x5, %eax
je 0x13157
jmp 0x13137
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x13165
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x13165
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rax
andq $0x1f, %rax
cmpq $0x0, %rax
jne 0x1330c
movq -0xa8(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl -0x24(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0xac(%rbp)
decl %eax
subl $0x2, %eax
jb 0x131eb
jmp 0x131ce
movl -0xac(%rbp), %eax
subl $0x5, %eax
je 0x131fb
jmp 0x131db
movq -0xb8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x13209
movq -0xb8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x13209
movq -0xb8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x3800
xorb $-0x1, %al
testb $0x1, %al
jne 0x13226
jmp 0x13228
jmp 0x13247
leaq 0x5d13(%rip), %rdi      # 0x18f42
leaq 0x5170(%rip), %rsi      # 0x183a6
movl $0x9af, %edx            # imm = 0x9AF
leaq 0x5d3e(%rip), %rcx      # 0x18f80
callq 0x3180
movq -0x80(%rbp), %rdi
movq -0x70(%rbp), %rsi
addq $0x20, %rsi
callq 0x3800
testb $0x1, %al
jne 0x13265
movb $0x0, -0x51(%rbp)
jmp 0x133bc
movq -0xa8(%rbp), %rdi
movq -0x70(%rbp), %rdx
leaq -0x88(%rbp), %rsi
callq 0x15710
testb $0x1, %al
jne 0x13289
movb $0x0, -0x51(%rbp)
jmp 0x133bc
movq -0xa8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x15d30
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x132d5
movq -0xa8(%rbp), %rdi
callq 0x15d90
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0xb0a0
movb $0x0, -0x51(%rbp)
jmp 0x133bc
movq -0x90(%rbp), %rdi
callq 0x15eb0
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
movq -0x90(%rbp), %rsi
xorl %edx, %edx
callq 0xb0a0
movq -0xa8(%rbp), %rax
movq -0x90(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq -0xa8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x70(%rbp), %rsi
callq 0xa830
movq %rax, %rdi
movq -0x68(%rbp), %rsi
callq 0xa9b0
movq -0xa8(%rbp), %rcx
addq $0x20, %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0x38(%rbp)
movq %rax, -0x40(%rbp)
movl $0x3, -0x44(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl -0x44(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x48(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0xbc(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, -0x50(%rbp)
subl $0x3, %eax
je 0x1339a
jmp 0x1337d
movl -0xbc(%rbp), %eax
subl $0x5, %eax
je 0x133aa
jmp 0x1338a
movq -0xc8(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x133b8
movq -0xc8(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x133b8
movq -0xc8(%rbp), %rcx
movq -0x50(%rbp), %rax
xchgq %rax, (%rcx)
movb $0x1, -0x51(%rbp)
movb -0x51(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
nopw (%rax,%rax)