// File: /workspace/github_cpp_makefile_star2_O3/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 0x10b73(%rip), %rdx     # 0x18795
leaq -0xd0(%rbp), %rdi
movq %rdx, %rsi
callq 0x9d62
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 0x7c66
callq 0x3200
movq 0x1735b(%rip), %rdi     # 0x1efc8
leaq 0x103ee(%rip), %rsi     # 0x18062
movl $0x5, %edx
callq 0x3280
movq 0x17343(%rip), %rdi     # 0x1efc8
leaq 0x103fe(%rip), %rsi     # 0x1808a
movl $0xd, %edx
callq 0x3280
movq 0x1732b(%rip), %rdi     # 0x1efc8
leaq 0x103ca(%rip), %rsi     # 0x1806e
movl $0x4, %edx
callq 0x3280
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x1730b(%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 0x105cd(%rip), %rsi     # 0x182c0
leaq -0x70(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x7d6d
movq 0x172c1(%rip), %rdi     # 0x1efc8
leaq 0x105c8(%rip), %rsi     # 0x182d6
movl $0x25, %edx
callq 0x3280
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x172a1(%rip), %rdi     # 0x1efc8
callq 0x3280
leaq -0x150(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x105bd(%rip), %rsi     # 0x182fc
leaq 0x105d4(%rip), %rdx     # 0x1831a
leaq -0x160(%rbp), %rdi
callq 0x9d62
leaq -0x160(%rbp), %rsi
movq %r14, %rdi
callq 0xf300
movq -0x160(%rbp), %rdi
jmp 0x7edb
leaq 0x1055c(%rip), %rsi     # 0x182d0
leaq -0xb0(%rbp), %rdi
movq %r13, %rdx
callq 0x8c44
leaq 0x10a09(%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 0x7dba
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x7dc2
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 0x7dfb
callq 0x3200
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7e10
callq 0x3200
movq 0x171b1(%rip), %rdi     # 0x1efc8
leaq 0x10296(%rip), %rsi     # 0x180b4
movl $0x5, %edx
callq 0x3280
movq 0x17199(%rip), %rdi     # 0x1efc8
leaq 0x10284(%rip), %rsi     # 0x180ba
movl $0xa, %edx
callq 0x3280
movq 0x17181(%rip), %rdi     # 0x1efc8
leaq 0x10220(%rip), %rsi     # 0x1806e
movl $0x4, %edx
callq 0x3280
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq 0x1715b(%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 0x9cc4
leaq -0x180(%rbp), %rsi
movq %r14, %rdi
callq 0xf300
movq -0x180(%rbp), %rdi
cmpq %r12, %rdi
je 0x7ee5
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 0x7f1a
callq 0x3200
movq 0x170a7(%rip), %rdi     # 0x1efc8
leaq 0x1013a(%rip), %rsi     # 0x18062
movl $0x5, %edx
callq 0x3280
movq 0x1708f(%rip), %rdi     # 0x1efc8
leaq 0x1014a(%rip), %rsi     # 0x1808a
movl $0xd, %edx
callq 0x3280
movq 0x17077(%rip), %rdi     # 0x1efc8
leaq 0x10116(%rip), %rsi     # 0x1806e
movl $0x4, %edx
callq 0x3280
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x17057(%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 0x10374(%rip), %rsi     # 0x1831b
leaq -0x70(%rbp), %rdi
callq 0x30b0
testl %eax, %eax
je 0x8020
movq 0x1700d(%rip), %rdi     # 0x1efc8
leaq 0x10366(%rip), %rsi     # 0x18328
movl $0x26, %edx
callq 0x3280
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x16fed(%rip), %rdi     # 0x1efc8
callq 0x3280
leaq -0x110(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1030a(%rip), %rsi     # 0x182fc
leaq 0x10321(%rip), %rdx     # 0x1831a
leaq -0x120(%rbp), %rdi
callq 0x9d62
leaq -0x120(%rbp), %rsi
movq %r14, %rdi
callq 0xf300
movq -0x120(%rbp), %rdi
jmp 0x8279
leaq 0x102fb(%rip), %rsi     # 0x18322
leaq -0x1a0(%rbp), %rdi
movq -0xe0(%rbp), %rdx
movq %rbx, -0x30(%rbp)
callq 0x8c44
leaq 0x1068a(%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 0x807e
movq %rdx, -0x100(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xf0(%rbp)
jmp 0x8086
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 0x80dd
movq %rdx, -0xb0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa0(%rbp)
jmp 0x80e4
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 0x1068a(%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 0x8135
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x813d
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 0x8174
callq 0x3200
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x8185
callq 0x3200
movq -0x100(%rbp), %rdi
cmpq %r13, %rdi
movq -0x30(%rbp), %rbx
je 0x819a
callq 0x3200
leaq -0x190(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x81af
callq 0x3200
movq 0x16e12(%rip), %rdi     # 0x1efc8
leaq 0xfef7(%rip), %rsi      # 0x180b4
movl $0x5, %edx
callq 0x3280
movq 0x16dfa(%rip), %rdi     # 0x1efc8
leaq 0xfee5(%rip), %rsi      # 0x180ba
movl $0xa, %edx
callq 0x3280
movq 0x16de2(%rip), %rdi     # 0x1efc8
leaq 0xfe81(%rip), %rsi      # 0x1806e
movl $0x4, %edx
callq 0x3280
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq 0x16dbc(%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 0x9cc4
leaq -0x140(%rbp), %rsi
movq %r14, %rdi
callq 0xf300
movq -0x140(%rbp), %rdi
cmpq %r15, %rdi
je 0x8283
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 0x82b7
callq 0x3200
movq 0x16d0a(%rip), %rdi     # 0x1efc8
leaq 0xfd9d(%rip), %rsi      # 0x18062
movl $0x5, %edx
callq 0x3280
movq 0x16cf2(%rip), %rdi     # 0x1efc8
leaq 0xfdad(%rip), %rsi      # 0x1808a
movl $0xd, %edx
callq 0x3280
movq 0x16cda(%rip), %rdi     # 0x1efc8
leaq 0xfd79(%rip), %rsi      # 0x1806e
movl $0x4, %edx
callq 0x3280
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x16cba(%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 0x1000b(%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 0x838c
callq 0x3200
movq 0x16c35(%rip), %rdi     # 0x1efc8
leaq 0xffbd(%rip), %rsi      # 0x18357
movl $0x18, %edx
callq 0x3280
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x16c16(%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 0x83f9
callq 0x3200
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x840e
callq 0x3200
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x8420
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 0x84b4
movq %rax, %r14
movq -0xb0(%rbp), %rdi
cmpq %r15, %rdi
je 0x845a
callq 0x3200
jmp 0x845a
movq %rax, %r14
movq -0x100(%rbp), %rdi
cmpq %r13, %rdi
je 0x8470
callq 0x3200
jmp 0x8470
movq %rax, %r14
leaq -0x190(%rbp), %rax
jmp 0x8499
jmp 0x84ee
movq %rbx, -0x30(%rbp)
movq %rax, %r14
movq -0x180(%rbp), %rdi
jmp 0x84cb
movq %rbx, -0x30(%rbp)
movq %rax, %r14
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x84d0
jmp 0x84f1
jmp 0x84ea
movq %rbx, -0x30(%rbp)
movq %rax, %r14
movq -0x120(%rbp), %rdi
cmpq %r15, %rdi
jne 0x84d0
jmp 0x84f1
jmp 0x84ea
movq %rbx, -0x30(%rbp)
movq %rax, %r14
movq -0x160(%rbp), %rdi
cmpq %r12, %rdi
je 0x84f1
callq 0x3200
jmp 0x84f1
jmp 0x84ea
jmp 0x84ea
jmp 0x84ea
jmp 0x84ea
jmp 0x84ea
movq %rbx, -0x30(%rbp)
movq %rax, %r14
jmp 0x8509
movq %rbx, -0x30(%rbp)
movq %rax, %r14
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x8509
callq 0x3200
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0xd8(%rbp), %rdi
je 0x851e
callq 0x3200
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x8533
callq 0x3200
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x8545
callq 0x3200
movq %r14, %rdi
callq 0x33f0