// File: /workspace/github_c_makefile_star2_O3/KhuramAli[P]JAM-Benchmark/Multi-producer_Multi-consumer_Lock-Synchronized_boost/code07.cpp
// Function: main
int main(int argc, char* argv[])
{
	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
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rbx
movaps %xmm0, (%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq %rax, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movl $0x4, %ebp
leaq -0x13b(%rip), %r14      # 0x134c
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1708
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1b6e
cmpq $0x0, 0x8(%rsp)
jne 0x16b3
decl %ebp
jne 0x148c
movl $0x4, %ebp
leaq -0xee(%rip), %rbx       # 0x13d0
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1708
movq %r15, %rdi
movq %r14, %rsi
callq 0x1b6e
cmpq $0x0, 0x8(%rsp)
jne 0x16b3
decl %ebp
jne 0x14c8
movq 0x2ae3(%rip), %rdi      # 0x3fd8
leaq 0xb08(%rip), %rsi       # 0x2004
movl $0x15, %edx
callq 0x1120
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
cmpq %r14, %rbx
je 0x1523
movq %rbx, %rdi
callq 0x1180
addq $0x8, %rbx
jmp 0x1510
movq 0x2aae(%rip), %rdi      # 0x3fd8
leaq 0xae9(%rip), %rsi       # 0x201a
movl $0x16, %edx
callq 0x1120
movb $0x1, 0x2c3e(%rip)      # 0x4180
movq 0x2a8f(%rip), %rdi      # 0x3fd8
leaq 0xae1(%rip), %rsi       # 0x2031
movl $0x13, %edx
callq 0x1120
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
cmpq %r14, %rbx
je 0x1577
movq %rbx, %rdi
callq 0x1180
addq $0x8, %rbx
jmp 0x1564
movq 0x2a5a(%rip), %rdi      # 0x3fd8
leaq 0xac0(%rip), %rsi       # 0x2045
movl $0x1c, %edx
callq 0x1120
movq 0x2a42(%rip), %rdi      # 0x3fd8
leaq 0xac5(%rip), %rsi       # 0x2062
movl $0x9, %edx
callq 0x1120
movl 0x2b4f(%rip), %esi      # 0x40fc
movq 0x2a24(%rip), %rdi      # 0x3fd8
callq 0x1190
movq %rax, %rbx
leaq 0xaa9(%rip), %rsi       # 0x206c
movl $0x9, %edx
movq %rax, %rdi
callq 0x1120
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10a0
movq 0x29da(%rip), %rdi      # 0x3fd8
leaq 0xa71(%rip), %rsi       # 0x2076
movl $0x9, %edx
callq 0x1120
movl 0x2aeb(%rip), %esi      # 0x4100
movq 0x29bc(%rip), %rdi      # 0x3fd8
callq 0x1190
movq %rax, %rbx
leaq 0xa41(%rip), %rsi       # 0x206c
movl $0x9, %edx
movq %rax, %rdi
callq 0x1120
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10a0
leaq 0x10(%rsp), %rdi
callq 0x1772
leaq 0x30(%rsp), %rdi
callq 0x1772
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1694
jmp 0x1694
jmp 0x1694
jmp 0x1694
jmp 0x168c
jmp 0x1694
cmpq $0x0, 0x8(%rsp)
jne 0x16b3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1772
leaq 0x30(%rsp), %rdi
callq 0x1772
movq %rbx, %rdi
callq 0x11a0
callq 0x1040