// File: /workspace/github_cpp_makefile_star2_O3/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 0x224a(%rip), %rdx      # 0x80b5
leaq -0x1b0(%rbp), %rbx
movq %rbx, %rdi
callq 0x52ba
movq (%rbx), %rsi
leaq 0x22bf(%rip), %rdx      # 0x8143
leaq -0x1a0(%rbp), %rbx
movq %rbx, %rdi
callq 0x52ba
movq (%rbx), %rbx
leaq 0x2257(%rip), %rsi      # 0x80f4
movq %rbx, %rdi
callq 0x2290
testl %eax, %eax
je 0x5fdf
leaq 0x2248(%rip), %rsi      # 0x80fc
movq %rbx, %rdi
callq 0x2290
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x6185
movq -0x1a8(%rbp), %rsi
leaq 0x226c(%rip), %rdx      # 0x8143
leaq -0xc0(%rbp), %rbx
movq %rbx, %rdi
callq 0x52ba
movq (%rbx), %rbx
leaq 0x2213(%rip), %rsi      # 0x8103
movq %rbx, %rdi
callq 0x2290
testl %eax, %eax
je 0x6199
leaq 0x2204(%rip), %rsi      # 0x810b
movq %rbx, %rdi
callq 0x2290
movl $0x1, %ecx
testl %eax, %eax
jne 0x6185
movq -0xb8(%rbp), %rsi
leaq -0x100(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %rsi, -0x58(%rbp)
callq 0x6894
leaq -0xb0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x6576
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5f69
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 0x2f1c
movq -0x48(%rbp), %rbx
subq -0x50(%rbp), %rbx
sarq $0x3, %rbx
movabsq $-0x71c71c71c71c71c7, %rax # imm = 0x8E38E38E38E38E39
imulq %rax, %rbx
movq %r15, %rdi
callq 0x2f54
cmpq %r13, %rbx
jbe 0x6325
movq %r15, %rdi
movq %r12, %rsi
callq 0x2f1c
movq -0x50(%rbp), %rsi
addq %r14, %rsi
leaq 0x5627(%rip), %rdi      # 0xb5f0
callq 0x2f92
movq %r15, %rdi
callq 0x2f54
incq %r13
addq $0x48, %r14
jmp 0x5f7a
movq -0x198(%rbp), %rsi
leaq -0x140(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x6894
leaq -0xb0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x6576
leaq -0x130(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6028
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2230
movq 0x55f9(%rip), %rbx      # 0xb628
movq 0x55ea(%rip), %r15      # 0xb620
cmpq %r15, %rbx
jne 0x604e
callq 0x5493
movq 0x55e1(%rip), %rbx      # 0xb628
movq 0x55d2(%rip), %r15      # 0xb620
leaq -0x178(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x48(%rbx), %rsi
movq -0x40(%rbx), %rdx
addq %rsi, %rdx
leaq -0x188(%rbp), %rdi
callq 0x311a
subq %r15, %rbx
movq -0x28(%r15,%rbx), %rax
leaq -0x160(%rbp), %rdi
movq %rax, -0x8(%rdi)
leaq -0x150(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x20(%r15,%rbx), %rsi
movq -0x18(%r15,%rbx), %rdx
addq %rsi, %rdx
callq 0x311a
leaq 0x207e(%rip), %rsi      # 0x8126
leaq -0x50(%rbp), %rdi
leaq -0x188(%rbp), %rdx
callq 0x69ac
movq -0x160(%rbp), %rdi
cmpq %r12, %rdi
je 0x60d3
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x188(%rbp), %rdi
cmpq %r14, %rdi
je 0x60ee
movq -0x178(%rbp), %rsi
incq %rsi
callq 0x2230
leaq 0x552b(%rip), %rdi      # 0xb620
movq 0x552c(%rip), %rsi      # 0xb628
addq $-0x48, %rsi
movq %rsi, 0x5521(%rip)      # 0xb628
callq 0x34b2
leaq -0xb0(%rbp), %rdi
callq 0x2ac4
movq -0x50(%rbp), %rsi
movl $0x64, %edx
movl %eax, %edi
xorl %ecx, %ecx
callq 0x2140
movl %eax, 0x5160(%rip)      # 0xb290
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6149
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
leaq -0x70(%rbp), %rdi
callq 0x2f54
leaq -0x88(%rbp), %rbx
movq %rbx, %rdi
callq 0x2f54
movq -0x28(%rbx), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x6180
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 0x5438(%rip), %rsi      # 0xb5d8
cmpq %rsi, 0x5439(%rip)      # 0xb5e0
je 0x61f0
xorl %r14d, %r14d
leaq 0x543d(%rip), %rbx      # 0xb5f0
movabsq $-0x71c71c71c71c71c7, %r15 # imm = 0x8E38E38E38E38E39
xorl %r12d, %r12d
addq %r14, %rsi
movq %rbx, %rdi
callq 0x2f92
incq %r12
movq 0x540b(%rip), %rax      # 0xb5e0
movq 0x53fc(%rip), %rsi      # 0xb5d8
subq %rsi, %rax
sarq $0x3, %rax
imulq %r15, %rax
addq $0x48, %r14
cmpq %r12, %rax
ja 0x61c0
leaq 0x53e1(%rip), %rdi      # 0xb5d8
callq 0x6c48
movq -0xb8(%rbp), %rsi
leaq -0x120(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x6894
leaq -0xb0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x6576
leaq 0x530b(%rip), %rdi      # 0xb538
leaq -0xb0(%rbp), %rbx
movq %rbx, %rsi
callq 0x2280
movq 0x20(%rbx), %rax
movq %rax, 0x5311(%rip)      # 0xb558
leaq -0x88(%rbp), %rbx
movups 0x530b(%rip), %xmm0     # 0xb560
movq 0x5314(%rip), %rax      # 0xb570
movups (%rbx), %xmm1
movups %xmm1, 0x52fa(%rip)     # 0xb560
movq 0x10(%rbx), %rcx
movq %rcx, 0x52ff(%rip)      # 0xb570
leaq -0x50(%rbp), %r14
movups %xmm0, (%r14)
movq %rax, 0x10(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
xorl %r12d, %r12d
movq %r12, 0x10(%rbx)
movq %r14, %rdi
callq 0x2f54
leaq -0x70(%rbp), %r15
movups 0x52db(%rip), %xmm0     # 0xb578
movq 0x52e4(%rip), %rax      # 0xb588
movups (%r15), %xmm1
movups %xmm1, 0x52c9(%rip)     # 0xb578
movq 0x10(%r15), %rcx
movq %rcx, 0x52ce(%rip)      # 0xb588
movups %xmm0, (%r14)
movq %rax, 0x10(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %r12, 0x10(%r15)
leaq -0x50(%rbp), %rdi
callq 0x2f54
movq %r15, %rdi
callq 0x2f54
movq %rbx, %rdi
callq 0x2f54
movq -0x40(%r15), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x6305
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2230
leaq -0x110(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6180
movq -0x110(%rbp), %rsi
jmp 0x6178
leaq -0xb0(%rbp), %rdi
callq 0x2ac4
movl %eax, %edi
callq 0x2370
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rsi
callq 0x6894
leaq -0xe0(%rbp), %rdi
callq 0x66bf
leaq -0xd0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6377
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2230
movq 0x52c2(%rip), %rax      # 0xb640
cmpq 0x52b3(%rip), %rax      # 0xb638
je 0x63a8
leaq -0x70(%rbp), %rdi
callq 0x2f54
leaq -0x88(%rbp), %r14
movq %r14, %rdi
callq 0x2f54
movq -0x28(%r14), %rdi
jmp 0x6165
movl $0x1, %edi
callq 0x2270
movq %rax, %rbx
leaq -0xd0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64ad
movq -0xd0(%rbp), %rsi
jmp 0x6490
jmp 0x64aa
movq %rax, %rbx
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64b9
movq -0xf0(%rbp), %rsi
jmp 0x646d
jmp 0x6477
movq %rax, %rbx
leaq -0x110(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64b9
movq -0x110(%rbp), %rsi
jmp 0x646d
jmp 0x6477
jmp 0x64aa
jmp 0x64aa
movq %rax, %rbx
leaq -0x188(%rbp), %rdi
callq 0x306e
jmp 0x64ad
movq %rax, %rbx
movq -0x188(%rbp), %rdi
cmpq %r14, %rdi
je 0x64ad
movq -0x178(%rbp), %rsi
jmp 0x6490
jmp 0x64aa
movq %rax, %rbx
leaq -0x130(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64b9
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x64b9
movq %rax, %rbx
jmp 0x64b9
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64ad
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x64ad
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2f54
jmp 0x64ad
jmp 0x64aa
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x6816
movq %rbx, %rdi
callq 0x2320