// File: /workspace/github_c_makefile_star2_O2/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 0x2c8b(%rip), %rbx      # 0x3fd8
leaq 0xcec(%rip), %rsi       # 0x2040
movq %rbx, %rdi
callq 0x10d0
leaq 0xcf8(%rip), %rsi       # 0x205b
movq %rbx, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1070
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rbx
andq $0x0, 0x10(%rbx)
movaps %xmm0, (%rbx)
andq $0x0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
pushq $0x4
popq %rbp
leaq -0x10c(%rip), %r14      # 0x128c
leaq 0x8(%rsp), %r15
subl $0x1, %ebp
jb 0x13c2
movq %r15, %rdi
movq %r14, %rsi
callq 0x15ee
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1db2
movq %r15, %rdi
callq 0x1654
jmp 0x139d
pushq $0x4
popq %rbp
leaq -0xf0(%rip), %rbx       # 0x12dc
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r15
subl $0x1, %ebp
jb 0x13fb
movq %r14, %rdi
movq %rbx, %rsi
callq 0x15ee
movq %r15, %rdi
movq %r14, %rsi
callq 0x1db2
movq %r14, %rdi
callq 0x1654
jmp 0x13d6
movq 0x2bd6(%rip), %rdi      # 0x3fd8
leaq 0xc5b(%rip), %rsi       # 0x2064
callq 0x10d0
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
cmpq %r14, %rbx
je 0x142b
movq %rbx, %rdi
callq 0x1100
addq $0x8, %rbx
jmp 0x1418
movq 0x2ba6(%rip), %rdi      # 0x3fd8
leaq 0xc41(%rip), %rsi       # 0x207a
callq 0x10d0
movb $0x1, %al
xchgb %al, 0x2c7e(%rip)       # 0x40c4
movq 0x2b8b(%rip), %rdi      # 0x3fd8
leaq 0xc3d(%rip), %rsi       # 0x2091
callq 0x10d0
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
cmpq %r14, %rbx
je 0x1476
movq %rbx, %rdi
callq 0x1100
addq $0x8, %rbx
jmp 0x1463
movq 0x2b5b(%rip), %rdi      # 0x3fd8
leaq 0xc21(%rip), %rsi       # 0x20a5
callq 0x10d0
movq 0x2b48(%rip), %rdi      # 0x3fd8
leaq 0xc2b(%rip), %rsi       # 0x20c2
callq 0x10d0
movl 0x2c1a(%rip), %esi      # 0x40bc
movq %rax, %rdi
callq 0x1110
leaq 0xc1b(%rip), %rsi       # 0x20cc
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1070
movq 0x2b10(%rip), %rdi      # 0x3fd8
leaq 0xc07(%rip), %rsi       # 0x20d6
callq 0x10d0
movl 0x2be6(%rip), %esi      # 0x40c0
movq %rax, %rdi
callq 0x1110
leaq 0xbe3(%rip), %rsi       # 0x20cc
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1070
leaq 0x10(%rsp), %rdi
callq 0x1662
leaq 0x30(%rsp), %rdi
callq 0x1662
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1524
jmp 0x1524
jmp 0x1524
jmp 0x1524
jmp 0x1529
movq %rax, %rbx
jmp 0x1536
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1654
leaq 0x10(%rsp), %rdi
callq 0x1662
leaq 0x30(%rsp), %rdi
callq 0x1662
movq %rbx, %rdi
callq 0x1120