// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xd8, %rsp
movl $0x0, 0xd4(%rsp)
movl %edi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movq 0x7c40(%rip), %rdi      # 0x8fd8
leaq 0x4ca1(%rip), %rsi      # 0x6040
callq 0x10d0
leaq 0x7d25(%rip), %rdi      # 0x90d0
callq 0x1a10
testb $0x1, %al
jne 0x13c7
movq 0x7c1d(%rip), %rdi      # 0x8fd8
leaq 0x4c99(%rip), %rsi      # 0x605b
callq 0x10d0
movq 0x7c0a(%rip), %rdi      # 0x8fd8
leaq 0x4c8b(%rip), %rsi      # 0x6060
callq 0x10d0
movq %rax, %rdi
movq 0x7bdc(%rip), %rsi      # 0x8fc0
callq 0x10f0
leaq 0xb0(%rsp), %rdi
callq 0x1a80
leaq 0x98(%rsp), %rdi
callq 0x1a80
movl $0x0, 0x94(%rsp)
cmpl $0x4, 0x94(%rsp)
je 0x14a2
leaq -0x173(%rip), %rsi      # 0x12b0
leaq 0x88(%rsp), %rdi
callq 0x1ac0
jmp 0x1432
leaq 0xb0(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x1a90
jmp 0x1449
leaq 0x88(%rsp), %rdi
callq 0x1b80
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x140e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x1735
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x1b80
jmp 0x1735
movl $0x0, 0x78(%rsp)
cmpl $0x4, 0x78(%rsp)
je 0x150f
leaq -0x1b8(%rip), %rsi      # 0x1300
leaq 0x70(%rsp), %rdi
callq 0x1ac0
jmp 0x14c4
leaq 0x98(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x1a90
jmp 0x14d8
leaq 0x70(%rsp), %rdi
callq 0x1b80
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x14aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x1b80
jmp 0x1735
movq 0x7ac2(%rip), %rdi      # 0x8fd8
leaq 0x4b4c(%rip), %rsi      # 0x6069
callq 0x10d0
jmp 0x1524
leaq 0xb0(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0x1ba0
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rdi
callq 0x1bd0
movq %rax, 0x58(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1c00
testb $0x1, %al
jne 0x1564
jmp 0x158d
leaq 0x60(%rsp), %rdi
callq 0x1c40
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1110
jmp 0x157f
jmp 0x1581
leaq 0x60(%rsp), %rdi
callq 0x1c50
jmp 0x154f
movq 0x7a44(%rip), %rdi      # 0x8fd8
leaq 0x4ae4(%rip), %rsi      # 0x607f
callq 0x10d0
jmp 0x15a2
leaq 0x7b23(%rip), %rdi      # 0x90cc
movl $0x1, %esi
callq 0x1c70
movq 0x7a1e(%rip), %rdi      # 0x8fd8
leaq 0x4ad5(%rip), %rsi      # 0x6096
callq 0x10d0
jmp 0x15c8
leaq 0x98(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
callq 0x1ba0
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rdi
callq 0x1bd0
movq %rax, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x1c00
testb $0x1, %al
jne 0x1608
jmp 0x1631
leaq 0x40(%rsp), %rdi
callq 0x1c40
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0x1110
jmp 0x1623
jmp 0x1625
leaq 0x40(%rsp), %rdi
callq 0x1c50
jmp 0x15f3
movq 0x79a0(%rip), %rdi      # 0x8fd8
leaq 0x4a6b(%rip), %rsi      # 0x60aa
callq 0x10d0
jmp 0x1646
movq 0x798b(%rip), %rdi      # 0x8fd8
leaq 0x4a73(%rip), %rsi      # 0x60c7
callq 0x10d0
movq %rax, 0x28(%rsp)
jmp 0x1660
leaq 0x7a5d(%rip), %rdi      # 0x90c4
callq 0x1ca0
movq 0x28(%rsp), %rdi
movl %eax, %esi
callq 0x1120
movq %rax, 0x20(%rsp)
jmp 0x167f
movq 0x20(%rsp), %rdi
leaq 0x4a46(%rip), %rsi      # 0x60d1
callq 0x10d0
movq %rax, 0x18(%rsp)
jmp 0x1697
movq 0x18(%rsp), %rdi
movq 0x791d(%rip), %rsi      # 0x8fc0
callq 0x10f0
jmp 0x16aa
movq 0x7927(%rip), %rdi      # 0x8fd8
leaq 0x4a23(%rip), %rsi      # 0x60db
callq 0x10d0
movq %rax, 0x10(%rsp)
jmp 0x16c4
leaq 0x79fd(%rip), %rdi      # 0x90c8
callq 0x1ca0
movq 0x10(%rsp), %rdi
movl %eax, %esi
callq 0x1120
movq %rax, 0x8(%rsp)
jmp 0x16e3
movq 0x8(%rsp), %rdi
leaq 0x49e2(%rip), %rsi      # 0x60d1
callq 0x10d0
movq %rax, (%rsp)
jmp 0x16fa
movq (%rsp), %rdi
movq 0x78bb(%rip), %rsi      # 0x8fc0
callq 0x10f0
jmp 0x170c
leaq 0x98(%rsp), %rdi
callq 0x1d30
leaq 0xb0(%rsp), %rdi
callq 0x1d30
movl 0xd4(%rsp), %eax
addq $0xd8, %rsp
retq
leaq 0x98(%rsp), %rdi
callq 0x1d30
leaq 0xb0(%rsp), %rdi
callq 0x1d30
movq 0x80(%rsp), %rdi
callq 0x1130
nopl (%rax)