// File: Doug0855[P]TigerZone/main.cpp
// Function: roundProtocol(Client&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int)
void roundProtocol(Client &client, std::string &message_list, int rounds)
{
	int round_id;
	std::string message;
	std::string TERMINATE_ROUND = "END OF ROUND " + std::to_string(rounds) + " OF " + std::to_string(rounds);
	message = getMesssage(client, message_list);
	std::cout << GREEN << "Server sent: " << RESET << message << std::endl;

	while (message != TERMINATE_ROUND)
	{
		if (message.compare(0,1,"B") == 0) //executing a new round
		{
			std::cout << "	BEGINNING ROUND..." << std::endl;
			round_id = stoi(message.substr(12,message.find(" OF")-12));
			matchProtocol(client, message_list); // pass message reference
			message = getMesssage(client, message_list);
			std::cout << GREEN << "Server sent: " << RESET << message << std::endl;
		}
		else if (message.compare(0,1,"E") == 0) //waiting for the next round to begin
		{
			std::cout << "	END OF ROUND...WAITING FOR THE NEXT MATCH" << std::endl;
			message = getMesssage(client, message_list);
			std::cout << GREEN << "Server sent: " << RESET << message << std::endl;
		}
		else //hopefully this is never reached
		{
			std::cout << "	ERROR: previous message could not be processed correctly. Message skipped!" << std::endl;
			std::cout << "		ERROR message: " << message << std::endl;
			message = getMesssage(client, message_list);
			std::cout << GREEN << "Server sent: " << RESET << message << std::endl;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x33c0
movl -0x14(%rbp), %esi
leaq -0xb8(%rbp), %rdi
callq 0x8b80
jmp 0x6430
leaq 0x22da7(%rip), %rsi     # 0x291de
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x8b30
jmp 0x644c
leaq 0x22d99(%rip), %rdx     # 0x291ec
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x8ae0
jmp 0x6465
movl -0x14(%rbp), %esi
leaq -0xe8(%rbp), %rdi
callq 0x8b80
jmp 0x6476
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
callq 0x8a10
jmp 0x648c
leaq -0xe8(%rbp), %rdi
callq 0x3210
leaq -0x78(%rbp), %rdi
callq 0x3210
leaq -0x98(%rbp), %rdi
callq 0x3210
leaq -0xb8(%rbp), %rdi
callq 0x3210
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x108(%rbp), %rdi
callq 0x4070
jmp 0x64cf
leaq -0x38(%rbp), %rdi
leaq -0x108(%rbp), %rsi
movq %rsi, -0x198(%rbp)
callq 0x3360
movq -0x198(%rbp), %rdi
callq 0x3210
movq 0x30abf(%rip), %rdi     # 0x36fb8
leaq 0x22b46(%rip), %rsi     # 0x29046
callq 0x32b0
movq %rax, -0x190(%rbp)
jmp 0x650e
movq -0x190(%rbp), %rdi
leaq 0x22b52(%rip), %rsi     # 0x2906e
callq 0x32b0
movq %rax, -0x1a0(%rbp)
jmp 0x652a
movq -0x1a0(%rbp), %rdi
leaq 0x22b1a(%rip), %rsi     # 0x29052
callq 0x32b0
movq %rax, -0x1a8(%rbp)
jmp 0x6546
movq -0x1a8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3290
movq %rax, -0x1b0(%rbp)
jmp 0x655f
movq -0x1b0(%rbp), %rdi
movq 0x30a3b(%rip), %rsi     # 0x36fa8
callq 0x32e0
jmp 0x6574
jmp 0x6576
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x87c0
testb $0x1, %al
jne 0x658c
jmp 0x6a5b
leaq 0x22f6a(%rip), %rcx     # 0x294fd
xorl %eax, %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
movl $0x1, %edx
callq 0x3390
movl %eax, -0x1b4(%rbp)
jmp 0x65ad
movl -0x1b4(%rbp), %eax
cmpl $0x0, %eax
jne 0x67fb
movq 0x309f5(%rip), %rdi     # 0x36fb8
leaq 0x22c27(%rip), %rsi     # 0x291f1
callq 0x32b0
movq %rax, -0x1c0(%rbp)
jmp 0x65d8
movq -0x1c0(%rbp), %rdi
movq 0x309c2(%rip), %rsi     # 0x36fa8
callq 0x32e0
jmp 0x65ed
leaq 0x22c11(%rip), %rsi     # 0x29205
xorl %eax, %eax
movl %eax, %edx
leaq -0x38(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x3540
movq -0x1c8(%rbp), %rsi
movq %rax, %rcx
addq $-0xc, %rcx
leaq -0x128(%rbp), %rdi
movl $0xc, %edx
callq 0x32d0
jmp 0x6629
xorl %eax, %eax
movl %eax, %esi
leaq -0x128(%rbp), %rdi
movl $0xa, %edx
callq 0x8ca0
movl %eax, -0x1cc(%rbp)
jmp 0x6646
movl -0x1cc(%rbp), %eax
movl %eax, -0x18(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x3210
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x51b0
jmp 0x666a
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x148(%rbp), %rdi
callq 0x4070
jmp 0x6680
leaq -0x38(%rbp), %rdi
leaq -0x148(%rbp), %rsi
movq %rsi, -0x1e0(%rbp)
callq 0x3360
movq -0x1e0(%rbp), %rdi
callq 0x3210
movq 0x3090e(%rip), %rdi     # 0x36fb8
leaq 0x22995(%rip), %rsi     # 0x29046
callq 0x32b0
movq %rax, -0x1d8(%rbp)
jmp 0x66bf
movq -0x1d8(%rbp), %rdi
leaq 0x229a1(%rip), %rsi     # 0x2906e
callq 0x32b0
movq %rax, -0x1e8(%rbp)
jmp 0x66db
movq -0x1e8(%rbp), %rdi
leaq 0x22969(%rip), %rsi     # 0x29052
callq 0x32b0
movq %rax, -0x1f0(%rbp)
jmp 0x66f7
movq -0x1f0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3290
movq %rax, -0x1f8(%rbp)
jmp 0x6710
movq -0x1f8(%rbp), %rdi
movq 0x3088a(%rip), %rsi     # 0x36fa8
callq 0x32e0
jmp 0x6725
jmp 0x6a56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x6a7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x67b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x67a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x679b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x3210
leaq -0x78(%rbp), %rdi
callq 0x3210
leaq -0x98(%rbp), %rdi
callq 0x3210
leaq -0xb8(%rbp), %rdi
callq 0x3210
jmp 0x6a7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x6a76
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x3210
jmp 0x6a76
leaq 0x22d4c(%rip), %rcx     # 0x2954e
xorl %eax, %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
movl $0x1, %edx
callq 0x3390
movl %eax, -0x1fc(%rbp)
jmp 0x681c
movl -0x1fc(%rbp), %eax
cmpl $0x0, %eax
jne 0x691c
movq 0x30786(%rip), %rdi     # 0x36fb8
leaq 0x229d0(%rip), %rsi     # 0x29209
callq 0x32b0
movq %rax, -0x208(%rbp)
jmp 0x6847
movq -0x208(%rbp), %rdi
movq 0x30753(%rip), %rsi     # 0x36fa8
callq 0x32e0
jmp 0x685c
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x168(%rbp), %rdi
callq 0x4070
jmp 0x6872
leaq -0x38(%rbp), %rdi
leaq -0x168(%rbp), %rsi
movq %rsi, -0x218(%rbp)
callq 0x3360
movq -0x218(%rbp), %rdi
callq 0x3210
movq 0x3071c(%rip), %rdi     # 0x36fb8
leaq 0x227a3(%rip), %rsi     # 0x29046
callq 0x32b0
movq %rax, -0x210(%rbp)
jmp 0x68b1
movq -0x210(%rbp), %rdi
leaq 0x227af(%rip), %rsi     # 0x2906e
callq 0x32b0
movq %rax, -0x220(%rbp)
jmp 0x68cd
movq -0x220(%rbp), %rdi
leaq 0x22777(%rip), %rsi     # 0x29052
callq 0x32b0
movq %rax, -0x228(%rbp)
jmp 0x68e9
movq -0x228(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3290
movq %rax, -0x230(%rbp)
jmp 0x6902
movq -0x230(%rbp), %rdi
movq 0x30698(%rip), %rsi     # 0x36fa8
callq 0x32e0
jmp 0x6917
jmp 0x6a54
movq 0x30695(%rip), %rdi     # 0x36fb8
leaq 0x22856(%rip), %rsi     # 0x29180
callq 0x32b0
movq %rax, -0x238(%rbp)
jmp 0x6938
movq -0x238(%rbp), %rdi
movq 0x30662(%rip), %rsi     # 0x36fa8
callq 0x32e0
jmp 0x694d
movq 0x30664(%rip), %rdi     # 0x36fb8
leaq 0x22871(%rip), %rsi     # 0x291cc
callq 0x32b0
movq %rax, -0x240(%rbp)
jmp 0x6969
movq -0x240(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3290
movq %rax, -0x248(%rbp)
jmp 0x6982
movq -0x248(%rbp), %rdi
movq 0x30618(%rip), %rsi     # 0x36fa8
callq 0x32e0
jmp 0x6997
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x188(%rbp), %rdi
callq 0x4070
jmp 0x69ad
leaq -0x38(%rbp), %rdi
leaq -0x188(%rbp), %rsi
movq %rsi, -0x258(%rbp)
callq 0x3360
movq -0x258(%rbp), %rdi
callq 0x3210
movq 0x305e1(%rip), %rdi     # 0x36fb8
leaq 0x22668(%rip), %rsi     # 0x29046
callq 0x32b0
movq %rax, -0x250(%rbp)
jmp 0x69ec
movq -0x250(%rbp), %rdi
leaq 0x22674(%rip), %rsi     # 0x2906e
callq 0x32b0
movq %rax, -0x260(%rbp)
jmp 0x6a08
movq -0x260(%rbp), %rdi
leaq 0x2263c(%rip), %rsi     # 0x29052
callq 0x32b0
movq %rax, -0x268(%rbp)
jmp 0x6a24
movq -0x268(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3290
movq %rax, -0x270(%rbp)
jmp 0x6a3d
movq -0x270(%rbp), %rdi
movq 0x3055d(%rip), %rsi     # 0x36fa8
callq 0x32e0
jmp 0x6a52
jmp 0x6a54
jmp 0x6a56
jmp 0x6576
leaq -0x58(%rbp), %rdi
callq 0x3210
leaq -0x38(%rbp), %rdi
callq 0x3210
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
leaq -0x58(%rbp), %rdi
callq 0x3210
leaq -0x38(%rbp), %rdi
callq 0x3210
movq -0xc0(%rbp), %rdi
callq 0x34f0
nopw %cs:(%rax,%rax)