// File: /workspace/github_c_makefile_star2_O3/KhuramAli[P]JAM-Benchmark/Multi-producer_Multi-consumer_Lock-free_boost/code08.cpp
// Function: main
int main(int argc, char* argv[])
{
	std::cout << "boost::lockfree::queue is ";
	if (!queue.is_lock_free())
		std::cout << "not ";
	std::cout << "lockfree" << std::endl;

	std::vector<std::thread> producer_threads;
	std::vector<std::thread> consumer_threads;

	for (int i = 0; i != producer_thread_count; ++i)
		producer_threads.push_back(std::thread(producer));

	for (int i = 0; i != consumer_thread_count; ++i)
		consumer_threads.push_back(std::thread(consumer));

	std::cout << "All threads created.\n";
	for (auto& i : producer_threads) {
		i.join();
	}
	std::cout << "All producers joined.\n";
	done = true;
	std::cout << "joining consumers.\n";
	for (auto& i : consumer_threads) {
		i.join();
	}
	std::cout << "all consumer threads joined\n";

	std::cout << "produced " << producer_count << " objects." << std::endl;
	std::cout << "consumed " << consumer_count << " objects." << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq 0x2c45(%rip), %rbx      # 0x3fd8
leaq 0xc6a(%rip), %rsi       # 0x2004
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x1100
leaq 0xc71(%rip), %rsi       # 0x201f
movl $0x8, %edx
movq %rbx, %rdi
callq 0x1100
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
xorl %eax, %eax
leaq 0x30(%rsp), %rbx
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movq %rax, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movl $0x4, %ebp
leaq -0x14d(%rip), %r14      # 0x12bc
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1744
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1cf0
cmpq $0x0, 0x8(%rsp)
jne 0x1636
decl %ebp
jne 0x140e
movl $0x4, %ebp
leaq -0x139(%rip), %rbx      # 0x1307
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1744
movq %r15, %rdi
movq %r14, %rsi
callq 0x1cf0
cmpq $0x0, 0x8(%rsp)
jne 0x1636
decl %ebp
jne 0x144a
movq 0x2b61(%rip), %rdi      # 0x3fd8
leaq 0xbaa(%rip), %rsi       # 0x2028
movl $0x15, %edx
callq 0x1100
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
cmpq %r14, %rbx
je 0x14a5
movq %rbx, %rdi
callq 0x1120
addq $0x8, %rbx
jmp 0x1492
movq 0x2b2c(%rip), %rdi      # 0x3fd8
leaq 0xb8b(%rip), %rsi       # 0x203e
movl $0x16, %edx
callq 0x1100
movb $0x1, %al
xchgb %al, 0x2c0f(%rip)       # 0x40d4
movq 0x2b0c(%rip), %rdi      # 0x3fd8
leaq 0xb82(%rip), %rsi       # 0x2055
movl $0x13, %edx
callq 0x1100
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
cmpq %r14, %rbx
je 0x14fa
movq %rbx, %rdi
callq 0x1120
addq $0x8, %rbx
jmp 0x14e7
movq 0x2ad7(%rip), %rdi      # 0x3fd8
leaq 0xb61(%rip), %rsi       # 0x2069
movl $0x1c, %edx
callq 0x1100
movq 0x2abf(%rip), %rdi      # 0x3fd8
leaq 0xb66(%rip), %rsi       # 0x2086
movl $0x9, %edx
callq 0x1100
movl 0x2b9c(%rip), %esi      # 0x40cc
movq 0x2aa1(%rip), %rdi      # 0x3fd8
callq 0x1130
movq %rax, %rbx
leaq 0xb4a(%rip), %rsi       # 0x2090
movl $0x9, %edx
movq %rax, %rdi
callq 0x1100
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq 0x2a57(%rip), %rdi      # 0x3fd8
leaq 0xb12(%rip), %rsi       # 0x209a
movl $0x9, %edx
callq 0x1100
movl 0x2b38(%rip), %esi      # 0x40d0
movq 0x2a39(%rip), %rdi      # 0x3fd8
callq 0x1130
movq %rax, %rbx
leaq 0xae2(%rip), %rsi       # 0x2090
movl $0x9, %edx
movq %rax, %rdi
callq 0x1100
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
leaq 0x10(%rsp), %rdi
callq 0x17ae
leaq 0x30(%rsp), %rdi
callq 0x17ae
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1617
jmp 0x1617
jmp 0x1617
jmp 0x1617
jmp 0x160f
jmp 0x1617
cmpq $0x0, 0x8(%rsp)
jne 0x1636
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x17ae
leaq 0x30(%rsp), %rdi
callq 0x17ae
movq %rbx, %rdi
callq 0x1140
callq 0x1040
nop