// File: HQarroum[P]thread-pool/examples/one-producer-many-consumers/./../../includes/concurrent_queue.hpp
// Function: moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::FreeList<moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::Block>::add_knowing_refcount_is_zero(moodycamel::ConcurrentQueue<std::function<void ()>, moodycamel::ConcurrentQueueDefaultTraits>::Block*)
inline void add_knowing_refcount_is_zero(N* node)
		{
			// Since the refcount is zero, and nobody can increase it once it's zero (except us, and we run
			// only one copy of this method per node at a time, i.e. the single thread case), then we know
			// we can safely change the next pointer of the node; however, once the refcount is back above
			// zero, then other threads could increase it (happens under heavy contention, when the refcount
			// goes to zero in between a load and a refcount increment of a node in try_get, then back up to
			// something non-zero, then the refcount increment is done by the other thread) -- so, if the CAS
			// to add the node to the actual list fails, decrease the refcount and leave the add operation to
			// the next thread who puts the refcount back at zero (which could be us, hence the loop).
			auto head = freeListHead.load(std::memory_order_relaxed);
			while (true) {
				node->freeListNext.store(head, std::memory_order_relaxed);
				node->freeListRefs.store(1, std::memory_order_release);
				if (!freeListHead.compare_exchange_strong(head, node, std::memory_order_release, std::memory_order_relaxed)) {
					// Hmm, the add failed, but we can only try again when the refcount goes back to zero
					if (node->freeListRefs.fetch_add(SHOULD_BE_ON_FREELIST - 1, std::memory_order_release) == 1) {
						continue;
					}
				}
				return;
			}
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq %rdi, -0x50(%rbp)
xorl %esi, %esi
callq 0x6210
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
addq $0x438, %rdi            # imm = 0x438
movq -0x48(%rbp), %rsi
xorl %edx, %edx
callq 0xb0a0
movq -0x40(%rbp), %rax
addq $0x430, %rax            # imm = 0x430
movq %rax, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
movl $0x3, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x10(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x58d0
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, -0x18(%rbp)
subl $0x3, %eax
je 0xb345
jmp 0xb330
movl -0x54(%rbp), %eax
subl $0x5, %eax
je 0xb350
jmp 0xb33a
movq -0x60(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xb359
movq -0x60(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xb359
movq -0x60(%rbp), %rcx
movl -0x18(%rbp), %eax
xchgl %eax, (%rcx)
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %rsi
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0xb430
testb $0x1, %al
jne 0xb423
movq -0x40(%rbp), %rax
addq $0x430, %rax            # imm = 0x430
movq %rax, -0x20(%rbp)
movl $0x7fffffff, -0x24(%rbp) # imm = 0x7FFFFFFF
movl $0x3, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0x28(%rbp), %eax
movl -0x24(%rbp), %ecx
movl %ecx, -0x2c(%rbp)
decl %eax
movl %eax, %ecx
movq %rcx, -0x68(%rbp)
subl $0x4, %eax
ja 0xb3c8
movq -0x68(%rbp), %rax
leaq 0xcde1(%rip), %rcx      # 0x181a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x70(%rbp), %rcx
movl -0x2c(%rbp), %eax
lock
xaddl %eax, (%rcx)
movl %eax, -0x30(%rbp)
jmp 0xb416
movq -0x70(%rbp), %rcx
movl -0x2c(%rbp), %eax
lock
xaddl %eax, (%rcx)
movl %eax, -0x30(%rbp)
jmp 0xb416
movq -0x70(%rbp), %rcx
movl -0x2c(%rbp), %eax
lock
xaddl %eax, (%rcx)
movl %eax, -0x30(%rbp)
jmp 0xb416
movq -0x70(%rbp), %rcx
movl -0x2c(%rbp), %eax
lock
xaddl %eax, (%rcx)
movl %eax, -0x30(%rbp)
jmp 0xb416
movq -0x70(%rbp), %rcx
movl -0x2c(%rbp), %eax
lock
xaddl %eax, (%rcx)
movl %eax, -0x30(%rbp)
cmpl $0x1, -0x30(%rbp)
jne 0xb421
jmp 0xb2d3
jmp 0xb423
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)