// File: /workspace/github_cpp_makefile_star2_O1/muzuka[P]Cards-Against-Humanity-Online/Server.cpp
// Function: parseMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int parseMessage(string message) {
	char* notifyMessage[2]; // [0] has option, [1] has name
	char* messageDiv[2]; // [0] has type and source, [1] has content
	char* getCommand[2]; // [0] has command, [1] has source
	splitString(messageDiv, (char*)message.c_str(), "\n");
	splitString(getCommand, messageDiv[0], " ");
	
	if(strcmp((const char*)getCommand[0], "REQUEST") == 0) {
		Player newP = getPlayer(string(getCommand[1]));
		if (whiteDeck.size() == 0) {
			refill();
		}
		string add = composeSENDMessage('d', whiteDeck[whiteDeck.size() - 1]);
		whiteDeck.pop_back();
		bytesSent = send(newP.getSocket(), (char*)add.c_str(), 100, 0);
		return 1;
	}
	else if(strcmp((const char*)getCommand[0], "NOTIFY") == 0) {
		splitString(notifyMessage, messageDiv[1], " ");
		if (strcmp(notifyMessage[0], "winner:") == 0) {
			for (int i = 0; i < answers.size(); i++) {
				discard.push_back(answers[i]);
			}
			answers.clear();
			winner = getPlayer(string(notifyMessage[1]));
		}
		else if(strcmp(notifyMessage[0], "quit:") == 0) {
			Player temp = getPlayer(string(notifyMessage[1]));
			for(int i = 0; i < temp.getHand().size(); i++) {
				discard.push_back(temp.getHand()[i]);
			}
			close(temp.getSocket());
			deletePlayer(string(notifyMessage[1]));
			if (players.size() == 0)
				exit(1);
		}
		return 1;
	}
	else {
		return -1;
	}
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq (%rdi), %rsi
leaq 0x2225(%rip), %rdx      # 0x80b5
leaq -0x1b0(%rbp), %rbx
movq %rbx, %rdi
callq 0x52e5
movq (%rbx), %rsi
leaq 0x229a(%rip), %rdx      # 0x8143
leaq -0x1a0(%rbp), %rbx
movq %rbx, %rdi
callq 0x52e5
movq (%rbx), %rbx
leaq 0x2232(%rip), %rsi      # 0x80f4
movq %rbx, %rdi
callq 0x2290
testl %eax, %eax
je 0x6004
leaq 0x2223(%rip), %rsi      # 0x80fc
movq %rbx, %rdi
callq 0x2290
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x61a6
movq -0x1a8(%rbp), %rsi
leaq 0x2247(%rip), %rdx      # 0x8143
leaq -0xc0(%rbp), %rbx
movq %rbx, %rdi
callq 0x52e5
movq (%rbx), %rbx
leaq 0x21ee(%rip), %rsi      # 0x8103
movq %rbx, %rdi
callq 0x2290
testl %eax, %eax
je 0x61ba
leaq 0x21df(%rip), %rsi      # 0x810b
movq %rbx, %rdi
callq 0x2290
movl $0x1, %ecx
testl %eax, %eax
jne 0x61a6
movq -0xb8(%rbp), %rsi
leaq -0x100(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %rsi, -0x58(%rbp)
callq 0x68de
leaq -0xb0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x65a7
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5f8e
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2230
xorl %r14d, %r14d
leaq -0x50(%rbp), %r15
leaq -0xb0(%rbp), %r12
xorl %r13d, %r13d
movq %r15, %rdi
movq %r12, %rsi
callq 0x2f5e
movq -0x48(%rbp), %rbx
subq -0x50(%rbp), %rbx
sarq $0x3, %rbx
movabsq $-0x71c71c71c71c71c7, %rax # imm = 0x8E38E38E38E38E39
imulq %rax, %rbx
movq %r15, %rdi
callq 0x2f96
cmpq %r13, %rbx
jbe 0x6356
movq %r15, %rdi
movq %r12, %rsi
callq 0x2f5e
movq -0x50(%rbp), %rsi
addq %r14, %rsi
leaq 0x5602(%rip), %rdi      # 0xb5f0
callq 0x2fd4
movq %r15, %rdi
callq 0x2f96
incq %r13
addq $0x48, %r14
jmp 0x5f9f
movq -0x198(%rbp), %rsi
leaq -0x140(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x68de
leaq -0xb0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x65a7
leaq -0x130(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x604d
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2230
movq 0x55d4(%rip), %rax      # 0xb628
cmpq 0x55c5(%rip), %rax      # 0xb620
jne 0x6062
callq 0x54b8
movq 0x55bf(%rip), %r15      # 0xb628
movq 0x55b0(%rip), %r12      # 0xb620
leaq -0x178(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x48(%r15), %rsi
movq -0x40(%r15), %rdx
addq %rsi, %rdx
leaq -0x188(%rbp), %rdi
callq 0x315c
subq %r12, %r15
movq -0x28(%r12,%r15), %rax
leaq -0x160(%rbp), %rdi
movq %rax, -0x8(%rdi)
leaq -0x150(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x20(%r12,%r15), %rsi
movq -0x18(%r12,%r15), %rdx
addq %rsi, %rdx
callq 0x315c
leaq 0x205d(%rip), %rsi      # 0x8126
leaq -0x50(%rbp), %rdi
leaq -0x188(%rbp), %rdx
callq 0x69f6
movq -0x160(%rbp), %rdi
cmpq %rbx, %rdi
je 0x60f4
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x188(%rbp), %rdi
cmpq %r14, %rdi
je 0x610f
movq -0x178(%rbp), %rsi
incq %rsi
callq 0x2230
leaq 0x550a(%rip), %rdi      # 0xb620
movq 0x550b(%rip), %rsi      # 0xb628
addq $-0x48, %rsi
movq %rsi, 0x5500(%rip)      # 0xb628
callq 0x34f0
leaq -0xb0(%rbp), %rdi
callq 0x2ac4
movq -0x50(%rbp), %rsi
movl $0x64, %edx
movl %eax, %edi
xorl %ecx, %ecx
callq 0x2140
movl %eax, 0x513f(%rip)      # 0xb290
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x616a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
leaq -0x70(%rbp), %rdi
callq 0x2f96
leaq -0x88(%rbp), %rbx
movq %rbx, %rdi
callq 0x2f96
movq -0x28(%rbx), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x61a1
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2230
movl $0x1, %ecx
movl %ecx, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5417(%rip), %rsi      # 0xb5d8
cmpq %rsi, 0x5418(%rip)      # 0xb5e0
je 0x6211
xorl %r14d, %r14d
leaq 0x541c(%rip), %rbx      # 0xb5f0
movabsq $-0x71c71c71c71c71c7, %r15 # imm = 0x8E38E38E38E38E39
xorl %r12d, %r12d
addq %r14, %rsi
movq %rbx, %rdi
callq 0x2fd4
incq %r12
movq 0x53ea(%rip), %rax      # 0xb5e0
movq 0x53db(%rip), %rsi      # 0xb5d8
subq %rsi, %rax
sarq $0x3, %rax
imulq %r15, %rax
addq $0x48, %r14
cmpq %r12, %rax
ja 0x61e1
leaq 0x53c0(%rip), %rdi      # 0xb5d8
callq 0x6c92
movq -0xb8(%rbp), %rsi
leaq -0x120(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x68de
leaq -0xb0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x65a7
leaq 0x52ea(%rip), %rdi      # 0xb538
leaq -0xb0(%rbp), %rbx
movq %rbx, %rsi
callq 0x2280
movq 0x20(%rbx), %rax
movq %rax, 0x52f0(%rip)      # 0xb558
leaq -0x88(%rbp), %rbx
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %r14
movaps %xmm0, (%r14)
movups 0x52df(%rip), %xmm0     # 0xb560
movq 0x52e8(%rip), %rax      # 0xb570
movups (%rbx), %xmm1
movups %xmm1, 0x52ce(%rip)     # 0xb560
movq 0x10(%rbx), %rcx
movq %rcx, 0x52d3(%rip)      # 0xb570
movaps (%r14), %xmm1
movaps %xmm0, (%r14)
movq %rax, 0x10(%r14)
movups %xmm1, (%rbx)
xorl %r12d, %r12d
movq %r12, 0x10(%rbx)
movq %r14, %rdi
callq 0x2f96
leaq -0x70(%rbp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movups 0x52ab(%rip), %xmm0     # 0xb578
movq 0x52b4(%rip), %rax      # 0xb588
movups (%r15), %xmm1
movups %xmm1, 0x5299(%rip)     # 0xb578
movq 0x10(%r15), %rcx
movq %rcx, 0x529e(%rip)      # 0xb588
movaps (%r14), %xmm1
movaps %xmm0, (%r14)
movq %rax, 0x10(%r14)
movups %xmm1, (%r15)
movq %r12, 0x10(%r15)
leaq -0x50(%rbp), %rdi
callq 0x2f96
movq %r15, %rdi
callq 0x2f96
movq %rbx, %rdi
callq 0x2f96
movq -0x40(%r15), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x6336
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2230
leaq -0x110(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61a1
movq -0x110(%rbp), %rsi
jmp 0x6199
leaq -0xb0(%rbp), %rdi
callq 0x2ac4
movl %eax, %edi
callq 0x2370
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rsi
callq 0x68de
leaq -0xe0(%rbp), %rdi
callq 0x6709
leaq -0xd0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x63a8
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2230
movq 0x5291(%rip), %rax      # 0xb640
cmpq 0x5282(%rip), %rax      # 0xb638
je 0x63d9
leaq -0x70(%rbp), %rdi
callq 0x2f96
leaq -0x88(%rbp), %r14
movq %r14, %rdi
callq 0x2f96
movq -0x28(%r14), %rdi
jmp 0x6186
movl $0x1, %edi
callq 0x2270
movq %rax, %rbx
leaq -0xd0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64de
movq -0xd0(%rbp), %rsi
jmp 0x64c1
jmp 0x64db
movq %rax, %rbx
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64ea
movq -0xf0(%rbp), %rsi
jmp 0x649e
jmp 0x64a8
movq %rax, %rbx
leaq -0x110(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64ea
movq -0x110(%rbp), %rsi
jmp 0x649e
jmp 0x64a8
jmp 0x64db
jmp 0x64db
movq %rax, %rbx
leaq -0x188(%rbp), %rdi
callq 0x30b0
jmp 0x64de
movq %rax, %rbx
movq -0x188(%rbp), %rdi
cmpq %r14, %rdi
je 0x64de
movq -0x178(%rbp), %rsi
jmp 0x64c1
jmp 0x64db
movq %rax, %rbx
leaq -0x130(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64ea
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x64ea
movq %rax, %rbx
jmp 0x64ea
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64de
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x64de
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2f96
jmp 0x64de
jmp 0x64db
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x6860
movq %rbx, %rdi
callq 0x2320