// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xd8, %rsp
movl $0x0, 0xd4(%rsp)
movl %edi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x19f0
leaq 0x98(%rsp), %rdi
callq 0x19f0
movl $0x0, 0x94(%rsp)
cmpl $0x4, 0x94(%rsp)
je 0x14da
leaq -0x15b(%rip), %rsi      # 0x1300
leaq 0x88(%rsp), %rdi
callq 0x1a30
jmp 0x146a
leaq 0xb0(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x1a00
jmp 0x1481
leaq 0x88(%rsp), %rdi
callq 0x1af0
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x1446
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x1753
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x1af0
jmp 0x1753
movl $0x0, 0x78(%rsp)
cmpl $0x4, 0x78(%rsp)
je 0x1547
leaq -0x190(%rip), %rsi      # 0x1360
leaq 0x70(%rsp), %rdi
callq 0x1a30
jmp 0x14fc
leaq 0x98(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x1a00
jmp 0x1510
leaq 0x70(%rsp), %rdi
callq 0x1af0
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x14e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x1af0
jmp 0x1753
movq 0x5a8a(%rip), %rdi      # 0x6fd8
leaq 0x2aaf(%rip), %rsi      # 0x4004
callq 0x10e0
jmp 0x155c
leaq 0xb0(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0x1b10
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rdi
callq 0x1b40
movq %rax, 0x58(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1b70
testb $0x1, %al
jne 0x159c
jmp 0x15c5
leaq 0x60(%rsp), %rdi
callq 0x1bb0
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1160
jmp 0x15b7
jmp 0x15b9
leaq 0x60(%rsp), %rdi
callq 0x1bc0
jmp 0x1587
movq 0x5a0c(%rip), %rdi      # 0x6fd8
leaq 0x2a47(%rip), %rsi      # 0x401a
callq 0x10e0
jmp 0x15da
movb $0x1, 0x5b8f(%rip)      # 0x7170
movq 0x59f0(%rip), %rdi      # 0x6fd8
leaq 0x2a42(%rip), %rsi      # 0x4031
callq 0x10e0
jmp 0x15f6
leaq 0x98(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
callq 0x1b10
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rdi
callq 0x1b40
movq %rax, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x1b70
testb $0x1, %al
jne 0x1636
jmp 0x165f
leaq 0x40(%rsp), %rdi
callq 0x1bb0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0x1160
jmp 0x1651
jmp 0x1653
leaq 0x40(%rsp), %rdi
callq 0x1bc0
jmp 0x1621
movq 0x5972(%rip), %rdi      # 0x6fd8
leaq 0x29d8(%rip), %rsi      # 0x4045
callq 0x10e0
jmp 0x1674
movq 0x595d(%rip), %rdi      # 0x6fd8
leaq 0x29e0(%rip), %rsi      # 0x4062
callq 0x10e0
movq %rax, 0x28(%rsp)
jmp 0x168e
movq 0x28(%rsp), %rdi
movl 0x5a53(%rip), %esi      # 0x70ec
callq 0x1170
movq %rax, 0x20(%rsp)
jmp 0x16a5
movq 0x20(%rsp), %rdi
leaq 0x29bb(%rip), %rsi      # 0x406c
callq 0x10e0
movq %rax, 0x18(%rsp)
jmp 0x16bd
movq 0x18(%rsp), %rdi
movq 0x58f7(%rip), %rsi      # 0x6fc0
callq 0x1100
jmp 0x16d0
movq 0x5901(%rip), %rdi      # 0x6fd8
leaq 0x2998(%rip), %rsi      # 0x4076
callq 0x10e0
movq %rax, 0x10(%rsp)
jmp 0x16ea
movq 0x10(%rsp), %rdi
movl 0x59fb(%rip), %esi      # 0x70f0
callq 0x1170
movq %rax, 0x8(%rsp)
jmp 0x1701
movq 0x8(%rsp), %rdi
leaq 0x295f(%rip), %rsi      # 0x406c
callq 0x10e0
movq %rax, (%rsp)
jmp 0x1718
movq (%rsp), %rdi
movq 0x589d(%rip), %rsi      # 0x6fc0
callq 0x1100
jmp 0x172a
leaq 0x98(%rsp), %rdi
callq 0x1be0
leaq 0xb0(%rsp), %rdi
callq 0x1be0
movl 0xd4(%rsp), %eax
addq $0xd8, %rsp
retq
leaq 0x98(%rsp), %rdi
callq 0x1be0
leaq 0xb0(%rsp), %rdi
callq 0x1be0
movq 0x80(%rsp), %rdi
callq 0x1180
nopw (%rax,%rax)