// File: HQarroum[P]thread-pool/examples/one-producer-many-consumers/./../../includes/concurrent_queue.hpp
// Function: bool moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::ImplicitProducer::insert_block_index_entry<(moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::AllocationMode)0>(moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::ImplicitProducer::BlockIndexEntry*&, unsigned long)
inline bool insert_block_index_entry(BlockIndexEntry*& idxEntry, index_t blockStartIndex)
		{
			auto localBlockIndex = blockIndex.load(std::memory_order_relaxed);		// We're the only writer thread, relaxed is OK
			if (localBlockIndex == nullptr) {
				return false;  // this can happen if new_block_index failed in the constructor
			}
			size_t newTail = (localBlockIndex->tail.load(std::memory_order_relaxed) + 1) & (localBlockIndex->capacity - 1);
			idxEntry = localBlockIndex->index[newTail];
			if (idxEntry->key.load(std::memory_order_relaxed) == INVALID_BLOCK_BASE ||
				idxEntry->value.load(std::memory_order_relaxed) == nullptr) {
				
				idxEntry->key.store(blockStartIndex, std::memory_order_relaxed);
				localBlockIndex->tail.store(newTail, std::memory_order_release);
				return true;
			}
			
			// No room in the old block index, try to allocate another one!
			MOODYCAMEL_CONSTEXPR_IF (allocMode == CannotAlloc) {
				return false;
			}
			else if (!new_block_index()) {
				return false;
			}
			localBlockIndex = blockIndex.load(std::memory_order_relaxed);
			newTail = (localBlockIndex->tail.load(std::memory_order_relaxed) + 1) & (localBlockIndex->capacity - 1);
			idxEntry = localBlockIndex->index[newTail];
			assert(idxEntry->key.load(std::memory_order_relaxed) == INVALID_BLOCK_BASE);
			idxEntry->key.store(blockStartIndex, std::memory_order_relaxed);
			localBlockIndex->tail.store(newTail, std::memory_order_release);
			return true;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0xf0(%rbp)
movq %rsi, -0xf8(%rbp)
movq %rdx, -0x100(%rbp)
movq -0xf0(%rbp), %rdi
movq %rdi, -0x118(%rbp)
addq $0x60, %rdi
xorl %esi, %esi
callq 0xb160
movq %rax, -0x108(%rbp)
cmpq $0x0, -0x108(%rbp)
jne 0x15766
movb $0x0, -0xe1(%rbp)
jmp 0x15d14
movq -0x108(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x128(%rbp)
movl -0xc(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x11c(%rbp)
decl %eax
subl $0x2, %eax
jb 0x157c6
jmp 0x157a9
movl -0x11c(%rbp), %eax
subl $0x5, %eax
je 0x157d6
jmp 0x157b6
movq -0x128(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x157e4
movq -0x128(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x157e4
movq -0x128(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
incq %rax
movq -0x108(%rbp), %rcx
movq (%rcx), %rcx
decq %rcx
andq %rcx, %rax
movq %rax, -0x110(%rbp)
movq -0x108(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x110(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0xf8(%rbp), %rax
movq %rcx, (%rax)
movq -0xf8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x138(%rbp)
movl -0x24(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x12c(%rbp)
decl %eax
subl $0x2, %eax
jb 0x15881
jmp 0x15864
movl -0x12c(%rbp), %eax
subl $0x5, %eax
je 0x15891
jmp 0x15871
movq -0x138(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x1589f
movq -0x138(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x1589f
movq -0x138(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x1, -0x30(%rbp)
je 0x158c5
movq -0xf8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
xorl %esi, %esi
callq 0x6210
cmpq $0x0, %rax
jne 0x15a12
movq -0xf8(%rbp), %rax
movq (%rax), %rcx
movq -0x100(%rbp), %rax
movq %rcx, -0x68(%rbp)
movq %rax, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x148(%rbp)
movl -0x74(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x78(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0x13c(%rbp)
movq -0x70(%rbp), %rcx
movq %rcx, -0x80(%rbp)
subl $0x3, %eax
je 0x15935
jmp 0x15918
movl -0x13c(%rbp), %eax
subl $0x5, %eax
je 0x15945
jmp 0x15925
movq -0x148(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x15953
movq -0x148(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x15953
movq -0x148(%rbp), %rcx
movq -0x80(%rbp), %rax
xchgq %rax, (%rcx)
movq -0x108(%rbp), %rcx
addq $0x8, %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0x88(%rbp)
movq %rax, -0x90(%rbp)
movl $0x3, -0x94(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x158(%rbp)
movl -0x94(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x98(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0x14c(%rbp)
movq -0x90(%rbp), %rcx
movq %rcx, -0xa0(%rbp)
subl $0x3, %eax
je 0x159e2
jmp 0x159c2
movl -0x14c(%rbp), %eax
subl $0x5, %eax
je 0x159f5
jmp 0x159cf
movq -0x158(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x15a06
movq -0x158(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x15a06
movq -0x158(%rbp), %rcx
movq -0xa0(%rbp), %rax
xchgq %rax, (%rcx)
movb $0x1, -0xe1(%rbp)
jmp 0x15d14
movq -0x118(%rbp), %rdi
callq 0x14eb0
testb $0x1, %al
jne 0x15a2e
movb $0x0, -0xe1(%rbp)
jmp 0x15d14
movq -0x118(%rbp), %rdi
addq $0x60, %rdi
xorl %esi, %esi
callq 0xb160
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x168(%rbp)
movl -0x3c(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x15c(%rbp)
decl %eax
subl $0x2, %eax
jb 0x15aa7
jmp 0x15a8a
movl -0x15c(%rbp), %eax
subl $0x5, %eax
je 0x15ab7
jmp 0x15a97
movq -0x168(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x15ac5
movq -0x168(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x15ac5
movq -0x168(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
incq %rax
movq -0x108(%rbp), %rcx
movq (%rcx), %rcx
decq %rcx
andq %rcx, %rax
movq %rax, -0x110(%rbp)
movq -0x108(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x110(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0xf8(%rbp), %rax
movq %rcx, (%rax)
movq -0xf8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x178(%rbp)
movl -0x54(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x58(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x16c(%rbp)
decl %eax
subl $0x2, %eax
jb 0x15b62
jmp 0x15b45
movl -0x16c(%rbp), %eax
subl $0x5, %eax
je 0x15b72
jmp 0x15b52
movq -0x178(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x15b80
movq -0x178(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x15b80
movq -0x178(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
cmpq $0x1, -0x60(%rbp)
jne 0x15b89
jmp 0x15ba8
leaq 0x3501(%rip), %rdi      # 0x19091
leaq 0x280f(%rip), %rsi      # 0x183a6
movl $0xb60, %edx            # imm = 0xB60
leaq 0x3532(%rip), %rcx      # 0x190d5
callq 0x3180
movq -0xf8(%rbp), %rax
movq (%rax), %rcx
movq -0x100(%rbp), %rax
movq %rcx, -0xa8(%rbp)
movq %rax, -0xb0(%rbp)
movl $0x0, -0xb4(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x188(%rbp)
movl -0xb4(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0xb8(%rbp)
movl -0xb4(%rbp), %eax
movl %eax, -0x17c(%rbp)
movq -0xb0(%rbp), %rcx
movq %rcx, -0xc0(%rbp)
subl $0x3, %eax
je 0x15c36
jmp 0x15c16
movl -0x17c(%rbp), %eax
subl $0x5, %eax
je 0x15c49
jmp 0x15c23
movq -0x188(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x15c5a
movq -0x188(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x15c5a
movq -0x188(%rbp), %rcx
movq -0xc0(%rbp), %rax
xchgq %rax, (%rcx)
movq -0x108(%rbp), %rcx
addq $0x8, %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0xc8(%rbp)
movq %rax, -0xd0(%rbp)
movl $0x3, -0xd4(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x198(%rbp)
movl -0xd4(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0xd8(%rbp)
movl -0xd4(%rbp), %eax
movl %eax, -0x18c(%rbp)
movq -0xd0(%rbp), %rcx
movq %rcx, -0xe0(%rbp)
subl $0x3, %eax
je 0x15ce9
jmp 0x15cc9
movl -0x18c(%rbp), %eax
subl $0x5, %eax
je 0x15cfc
jmp 0x15cd6
movq -0x198(%rbp), %rax
movq -0xe0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x15d0d
movq -0x198(%rbp), %rax
movq -0xe0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x15d0d
movq -0x198(%rbp), %rcx
movq -0xe0(%rbp), %rax
xchgq %rax, (%rcx)
movb $0x1, -0xe1(%rbp)
movb -0xe1(%rbp), %al
andb $0x1, %al
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop