// File: /workspace/github_cpp_makefile_star2_O1/Doug0855[P]TigerZone/main.cpp
// Function: authenticationProtocol(Client&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string authenticationProtocol(Client &client, std::string tournament_password, std::string username, std::string password)
{ //This protocol is called only to authenticate the client to the server.

	std::string message, message_to_send, player_id;
	std::string message_list = "";
	message = getMesssage(client, message_list);
	std::cout << GREEN << "Server sent: " << RESET << message << std::endl;

	if ( message == "THIS IS SPARTA!") //message to send tournament password
	{
		message_to_send = "JOIN " + tournament_password + "\r\n";
		std::cout << RED << "	We sent: " << RESET << message_to_send << std::endl;
		client.sendMessage(message_to_send);
	}
	else
	{
		std::cout << "ERROR: first message from server is: " << message;
		client.sendMessage("ILLEGAL MESSAGE SENT BY SERVER");
	}

	message = getMesssage(client, message_list);
	std::cout << GREEN << "Server sent: " << RESET << message << std::endl;
	if ( message == "HELLO!") //message to send team username and password
	{
		message_to_send = "I AM " + username + " " + password + "\r\n";
		std::cout << RED << "	We sent: " << RESET << message_to_send << std::endl;
		client.sendMessage(message_to_send);
	}
	else
	{
		std::cout << "ERROR: second message from server is: " << message;
		client.sendMessage("ILLEGAL MESSAGE SENT BY SERVER");
	}

	message = getMesssage(client, message_list); //last authentication message giving player id back
	std::cout << GREEN << "Server sent: " << RESET << message << std::endl;
	player_id = message.substr(8,message.find(" PLEASE")-8);
	std::cout << "	Player ID returned is: " << player_id << std::endl;
	return player_id;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %r8, %r15
movq %rcx, -0xe0(%rbp)
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x60(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x80(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x10(%rdi), %rcx
movq %rcx, -0xd8(%rbp)
movq %rcx, (%rdi)
movq %rax, 0x8(%rdi)
movb %al, 0x10(%rdi)
leaq -0xc0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x10a3b(%rip), %rdx     # 0x18795
leaq -0xd0(%rbp), %rdi
movq %rdx, %rsi
callq 0x9e42
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rdx
movq %r14, %rsi
callq 0x40d1
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %r12
movq %r12, %rsi
callq 0x32b0
movq (%r12), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x7d9e
callq 0x3200
movq 0x17223(%rip), %rdi     # 0x1efc8
leaq 0x102b6(%rip), %rsi     # 0x18062
movl $0x5, %edx
callq 0x3280
movq 0x1720b(%rip), %rdi     # 0x1efc8
leaq 0x102c6(%rip), %rsi     # 0x1808a
movl $0xd, %edx
callq 0x3280
movq 0x171f3(%rip), %rdi     # 0x1efc8
leaq 0x10292(%rip), %rsi     # 0x1806e
movl $0x4, %edx
callq 0x3280
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x171d3(%rip), %rdi     # 0x1efc8
callq 0x3280
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0x10495(%rip), %rsi     # 0x182c0
leaq -0x70(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x7ea5
movq 0x17189(%rip), %rdi     # 0x1efc8
leaq 0x10490(%rip), %rsi     # 0x182d6
movl $0x25, %edx
callq 0x3280
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x17169(%rip), %rdi     # 0x1efc8
callq 0x3280
leaq -0x150(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x10485(%rip), %rsi     # 0x182fc
leaq 0x1049c(%rip), %rdx     # 0x1831a
leaq -0x160(%rbp), %rdi
callq 0x9e42
leaq -0x160(%rbp), %rsi
movq %r14, %rdi
callq 0xf404
movq -0x160(%rbp), %rdi
jmp 0x8013
leaq 0x10424(%rip), %rsi     # 0x182d0
leaq -0xb0(%rbp), %rdi
movq %r13, %rdx
callq 0x8d7c
leaq 0x108d1(%rip), %rsi     # 0x18793
leaq -0xb0(%rbp), %rdi
callq 0x3420
leaq -0x40(%rbp), %r13
movq %r13, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7ef2
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x7efa
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x50(%rbp), %r12
movq %rdx, 0x8(%r12)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x90(%rbp), %rdi
movq %r12, %rsi
callq 0x32b0
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x7f33
callq 0x3200
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f48
callq 0x3200
movq 0x17079(%rip), %rdi     # 0x1efc8
leaq 0x1015e(%rip), %rsi     # 0x180b4
movl $0x5, %edx
callq 0x3280
movq 0x17061(%rip), %rdi     # 0x1efc8
leaq 0x1014c(%rip), %rsi     # 0x180ba
movl $0xa, %edx
callq 0x3280
movq 0x17049(%rip), %rdi     # 0x1efc8
leaq 0x100e8(%rip), %rsi     # 0x1806e
movl $0x4, %edx
callq 0x3280
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq 0x17023(%rip), %rdi     # 0x1efc8
callq 0x3280
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq -0x170(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0x180(%rbp), %rdi
callq 0x9da8
leaq -0x180(%rbp), %rsi
movq %r14, %rdi
callq 0xf404
movq -0x180(%rbp), %rdi
cmpq %r12, %rdi
je 0x801d
callq 0x3200
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rdx
movq %r14, %rsi
callq 0x40d1
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %r12
movq %r12, %rsi
callq 0x32b0
movq (%r12), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x8052
callq 0x3200
movq 0x16f6f(%rip), %rdi     # 0x1efc8
leaq 0x10002(%rip), %rsi     # 0x18062
movl $0x5, %edx
callq 0x3280
movq 0x16f57(%rip), %rdi     # 0x1efc8
leaq 0x10012(%rip), %rsi     # 0x1808a
movl $0xd, %edx
callq 0x3280
movq 0x16f3f(%rip), %rdi     # 0x1efc8
leaq 0xffde(%rip), %rsi      # 0x1806e
movl $0x4, %edx
callq 0x3280
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x16f1f(%rip), %rdi     # 0x1efc8
callq 0x3280
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0x1023c(%rip), %rsi     # 0x1831b
leaq -0x70(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x8158
movq 0x16ed5(%rip), %rdi     # 0x1efc8
leaq 0x1022e(%rip), %rsi     # 0x18328
movl $0x26, %edx
callq 0x3280
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x16eb5(%rip), %rdi     # 0x1efc8
callq 0x3280
leaq -0x110(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x101d2(%rip), %rsi     # 0x182fc
leaq 0x101e9(%rip), %rdx     # 0x1831a
leaq -0x120(%rbp), %rdi
callq 0x9e42
leaq -0x120(%rbp), %rsi
movq %r14, %rdi
callq 0xf404
movq -0x120(%rbp), %rdi
jmp 0x83b1
leaq 0x101c3(%rip), %rsi     # 0x18322
leaq -0x1a0(%rbp), %rdi
movq -0xe0(%rbp), %rdx
movq %rbx, -0x30(%rbp)
callq 0x8d7c
leaq 0x10552(%rip), %rsi     # 0x186cf
leaq -0x1a0(%rbp), %rdi
callq 0x3420
leaq -0xf0(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x81b6
movq %rdx, -0x100(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xf0(%rbp)
jmp 0x81be
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x100(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
callq 0x30c0
leaq -0xa0(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x8215
movq %rdx, -0xb0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa0(%rbp)
jmp 0x821c
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0xb0(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10552(%rip), %rsi     # 0x18793
callq 0x3420
leaq -0x40(%rbp), %r12
movq %r12, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
movq %r15, %rbx
cmpq %rcx, %rdx
je 0x826d
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x8275
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0x50(%rbp), %r15
movq %rdx, 0x8(%r15)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x90(%rbp), %rdi
movq %r15, %rsi
callq 0x32b0
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x82ac
callq 0x3200
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x82bd
callq 0x3200
movq -0x100(%rbp), %rdi
cmpq %r13, %rdi
movq -0x30(%rbp), %rbx
je 0x82d2
callq 0x3200
leaq -0x190(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x82e7
callq 0x3200
movq 0x16cda(%rip), %rdi     # 0x1efc8
leaq 0xfdbf(%rip), %rsi      # 0x180b4
movl $0x5, %edx
callq 0x3280
movq 0x16cc2(%rip), %rdi     # 0x1efc8
leaq 0xfdad(%rip), %rsi      # 0x180ba
movl $0xa, %edx
callq 0x3280
movq 0x16caa(%rip), %rdi     # 0x1efc8
leaq 0xfd49(%rip), %rsi      # 0x1806e
movl $0x4, %edx
callq 0x3280
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq 0x16c84(%rip), %rdi     # 0x1efc8
callq 0x3280
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq -0x130(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x9da8
leaq -0x140(%rbp), %rsi
movq %r14, %rdi
callq 0xf404
movq -0x140(%rbp), %rdi
cmpq %r15, %rdi
je 0x83bb
callq 0x3200
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rdx
movq %r14, %rsi
callq 0x40d1
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %r14
movq %r14, %rsi
callq 0x32b0
movq (%r14), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x83ef
callq 0x3200
movq 0x16bd2(%rip), %rdi     # 0x1efc8
leaq 0xfc65(%rip), %rsi      # 0x18062
movl $0x5, %edx
callq 0x3280
movq 0x16bba(%rip), %rdi     # 0x1efc8
leaq 0xfc75(%rip), %rsi      # 0x1808a
movl $0xd, %edx
callq 0x3280
movq 0x16ba2(%rip), %rdi     # 0x1efc8
leaq 0xfc41(%rip), %rsi      # 0x1806e
movl $0x4, %edx
callq 0x3280
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x16b82(%rip), %rdi     # 0x1efc8
callq 0x3280
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xfed3(%rip), %rsi      # 0x1834f
leaq -0x70(%rbp), %r14
movl $0x7, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x33e0
leaq -0x8(%rax), %rcx
leaq -0x50(%rbp), %rdi
movl $0x8, %edx
movq %r14, %rsi
callq 0x3240
leaq -0x50(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32b0
movq (%r14), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x84c4
callq 0x3200
movq 0x16afd(%rip), %rdi     # 0x1efc8
leaq 0xfe85(%rip), %rsi      # 0x18357
movl $0x18, %edx
callq 0x3280
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x16ade(%rip), %rdi     # 0x1efc8
callq 0x3280
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x8531
callq 0x3200
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x8546
callq 0x3200
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x8558
callq 0x3200
movq %rbx, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x140(%rbp), %rdi
jmp 0x85ec
movq %rax, %r14
movq -0xb0(%rbp), %rdi
cmpq %r15, %rdi
je 0x8592
callq 0x3200
jmp 0x8592
movq %rax, %r14
movq -0x100(%rbp), %rdi
cmpq %r13, %rdi
je 0x85a8
callq 0x3200
jmp 0x85a8
movq %rax, %r14
leaq -0x190(%rbp), %rax
jmp 0x85d1
jmp 0x8626
movq %rbx, -0x30(%rbp)
movq %rax, %r14
movq -0x180(%rbp), %rdi
jmp 0x8603
movq %rbx, -0x30(%rbp)
movq %rax, %r14
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x8608
jmp 0x8629
jmp 0x8622
movq %rbx, -0x30(%rbp)
movq %rax, %r14
movq -0x120(%rbp), %rdi
cmpq %r15, %rdi
jne 0x8608
jmp 0x8629
jmp 0x8622
movq %rbx, -0x30(%rbp)
movq %rax, %r14
movq -0x160(%rbp), %rdi
cmpq %r12, %rdi
je 0x8629
callq 0x3200
jmp 0x8629
jmp 0x8622
jmp 0x8622
jmp 0x8622
jmp 0x8622
jmp 0x8622
movq %rbx, -0x30(%rbp)
movq %rax, %r14
jmp 0x8641
movq %rbx, -0x30(%rbp)
movq %rax, %r14
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x8641
callq 0x3200
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0xd8(%rbp), %rdi
je 0x8656
callq 0x3200
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x866b
callq 0x3200
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x867d
callq 0x3200
movq %r14, %rdi
callq 0x33f0