// File: /workspace/github_c_makefile_star2_O1/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 0x2b25(%rip), %rbx      # 0x3fd8
leaq 0xb4a(%rip), %rsi       # 0x2004
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x1100
leaq 0xb51(%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      # 0x13dc
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1864
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1d6e
cmpq $0x0, 0x8(%rsp)
jne 0x1756
decl %ebp
jne 0x152e
movl $0x4, %ebp
leaq -0x139(%rip), %rbx      # 0x1427
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1864
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d6e
cmpq $0x0, 0x8(%rsp)
jne 0x1756
decl %ebp
jne 0x156a
movq 0x2a41(%rip), %rdi      # 0x3fd8
leaq 0xa8a(%rip), %rsi       # 0x2028
movl $0x15, %edx
callq 0x1100
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
cmpq %r14, %rbx
je 0x15c5
movq %rbx, %rdi
callq 0x1120
addq $0x8, %rbx
jmp 0x15b2
movq 0x2a0c(%rip), %rdi      # 0x3fd8
leaq 0xa6b(%rip), %rsi       # 0x203e
movl $0x16, %edx
callq 0x1100
movb $0x1, %al
xchgb %al, 0x2aef(%rip)       # 0x40d4
movq 0x29ec(%rip), %rdi      # 0x3fd8
leaq 0xa62(%rip), %rsi       # 0x2055
movl $0x13, %edx
callq 0x1100
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
cmpq %r14, %rbx
je 0x161a
movq %rbx, %rdi
callq 0x1120
addq $0x8, %rbx
jmp 0x1607
movq 0x29b7(%rip), %rdi      # 0x3fd8
leaq 0xa41(%rip), %rsi       # 0x2069
movl $0x1c, %edx
callq 0x1100
movq 0x299f(%rip), %rdi      # 0x3fd8
leaq 0xa46(%rip), %rsi       # 0x2086
movl $0x9, %edx
callq 0x1100
movl 0x2a7c(%rip), %esi      # 0x40cc
movq 0x2981(%rip), %rdi      # 0x3fd8
callq 0x1130
movq %rax, %rbx
leaq 0xa2a(%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 0x2937(%rip), %rdi      # 0x3fd8
leaq 0x9f2(%rip), %rsi       # 0x209a
movl $0x9, %edx
callq 0x1100
movl 0x2a18(%rip), %esi      # 0x40d0
movq 0x2919(%rip), %rdi      # 0x3fd8
callq 0x1130
movq %rax, %rbx
leaq 0x9c2(%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 0x18de
leaq 0x30(%rsp), %rdi
callq 0x18de
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1737
jmp 0x1737
jmp 0x1737
jmp 0x1737
jmp 0x172f
jmp 0x1737
cmpq $0x0, 0x8(%rsp)
jne 0x1756
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x18de
leaq 0x30(%rsp), %rdi
callq 0x18de
movq %rbx, %rdi
callq 0x1140
callq 0x1040
nop