// File: /workspace/github_cpp_makefile_star2_O3/muzuka[P]Cards-Against-Humanity-Online/Server.cpp
// Function: main
int main(int argc, char *argv[]) {
	
	blackDeck.clear();
	whiteDeck.clear();
	discard.clear();
	players.clear();
	
	if (argc != 4) {
		printf("Usage: %s <Listening Port> <Black Deck File> <White Deck File>\n", argv[0]);
		exit(1);
	}
	
	initServer(serverSock, atoi(argv[1]));
	
	string line;
	ifstream blackCardReader, whiteCardReader;
	blackCardReader.open(argv[2]);
	whiteCardReader.open(argv[3]);
	
	
	if (!blackCardReader.is_open() || !whiteCardReader.is_open()) {
		printf("File open failed\n");
		blackCardReader.close();
		whiteCardReader.close();
		exit(1);
	}
	
	while(getline(blackCardReader, line)) {
		char* lineDiv[2];
		if (line[0] == 'q') {
			splitString(lineDiv, (char*)line.c_str(), "\"");
			string temp(lineDiv[1]);
			Card nBlack(temp, 'b', 1);
			blackDeck.push_back(nBlack);
		}
		else if (line[0] == 's') {
			splitString(lineDiv, (char*)line.c_str(), "\"");
			string temp(lineDiv[1]);
			int answers = countChars(lineDiv[1], '_');
			Card nBlack(temp, 'b', answers);
			blackDeck.push_back(nBlack);
		}
	}
	
	while (getline(whiteCardReader, line)) {
		Card nWhite(line, 'w', 0);
		whiteDeck.push_back(nWhite);
	}
	
	blackDeck = shuffle(blackDeck, atoi(argv[1]));
	whiteDeck = shuffle(whiteDeck, atoi(argv[1]));
	FD_ZERO(&recvSockSet);
	
	FD_SET(serverSock, &recvSockSet);
	maxDesc = max(maxDesc, serverSock);
	
	while (!terminated) {
		
		memcpy(&tempRecvSockSet, &recvSockSet, sizeof(recvSockSet));
		
		selectTime = timeout;
		int ready = select(maxDesc + 1, &tempRecvSockSet, NULL, NULL, &selectTime);
		if (ready < 0) {
			printf("select() failed\n");
			break;
		}
		
		if (FD_ISSET(serverSock, &tempRecvSockSet)) {
			unsigned int size = sizeof(clientAddr);
			
			if ((clientSock = accept(serverSock, (struct sockaddr *) &clientAddr, &size)) < 0) {
				break;
			}
			printf("A new player has connected.\n");
			
			bool nameOK = false;
			bool foundName = false;
			
			while (!nameOK) {
				
				memset(&inBuffer, 0, sizeof(inBuffer));
				bytesRecv = 0;
				while (bytesRecv <= 0) {
					bytesRecv = recv(clientSock, (char*)&inBuffer, 20, 0);
				}
				printf("%s\n", inBuffer);
				
				if (players.size() < 1) {
					printf("Players is Empty.\n");
					outBuffer[0] = 'y';
					printf("Name hasn't been taken.\n");
					bytesSent = send(clientSock, (char*)&outBuffer, 1, 0);
					if (bytesSent <= 0) {
						printf("Couldn't send confirmation.\n");
						exit(1);
					}
					nameOK = !nameOK;
				}
				else {
					printf("Players isn't empty.\n");
					foundName = false;
					for (int i = 0; i < players.size(); i++) {
						if (players[i].getName().compare(inBuffer) == 0) {
							outBuffer[0] = 'n';
							bytesSent = 0;
							printf("Name is already taken.\n");
							bytesSent = send(clientSock, (char*)&outBuffer, 1, 0);
							if (bytesSent <= 0) {
								printf("Couldn't send denial.\n");
								exit(1);
							}
							foundName = true;
							break;
						}
					}
					if (!foundName) {
						outBuffer[0] = 'y';
						printf("Name hasn't been taken.\n");
						bytesSent = send(clientSock, (char*)&outBuffer, 1, 0);
						if (bytesSent <= 0) {
							printf("Couldn't send confirmation.\n");
							exit(1);
						}
						nameOK = !nameOK;
					}
				}
			}
			printf("Name checks out.\n");
			string n(inBuffer);
			Player newPlayer(n, clientSock);
			players.push_back(newPlayer);
			
			printf("About to send Cards.\n");
			for (int i = 0; i < 10; i++) {
				
				bytesSent = 0;
				if (whiteDeck.size() == 0) {
					refill();
				}
				string out = composeSENDMessage('d', whiteDeck[whiteDeck.size()-1]);
				players[players.size()-1].addCard(whiteDeck[whiteDeck.size()-1]);
				whiteDeck.pop_back();
				bytesSent = send(clientSock, (char*)out.c_str(), 100, 0);
				if (bytesSent <= 0) {
					printf("No Card was sent.\n");
					exit(1);
				}
			}
			
			FD_SET(clientSock, &recvSockSet);
			maxDesc = max(maxDesc, clientSock);
		}
		else {
			if(players.size() > 3) {
				string message;
				switch (step % 3) {
						// Choose judge and NOTIFY the others
					case 0:
						printf("Choosing a judge.\n");
						players = shuffle(players, atoi(argv[1])-step);
						judge = players[0];
						
						message = composeNOTIFYMessage('j', judge.getName());
						for (int i = 0; i < players.size(); i++) {
							bytesSent = send(players[i].getSocket(), (char*)message.c_str(), 100, 0);
							if (bytesSent <= 0) {
								printf("Judge message couldn't be sent.\n");
								exit(1);
							}
						}
						
						step++;
						break;
						// choose black card and POST it
					case 1:
						if (blackDeck.size() == 0) {
							shutdown();
						}
						printf("Choosing a black card.\n");
						blackCard = blackDeck[blackDeck.size() - 1];
						blackDeck.pop_back();
						
						message = composeSENDMessage('p', blackCard);
						for (int i = 0; i < players.size(); i++) {
							bytesSent = send(players[i].getSocket(), (char*)message.c_str(), 300, 0);
							if(bytesSent <= 0) {
								printf("Couldn't post black card.\n");
								exit(1);
							}
						}
						step++;
						break;
						// Handles answers and requests
					case 2:
						answers.clear();
						// Receive answers from others
						for (int i = 1; i < players.size(); i++) {
							for (int j = 0; j < blackCard.numOfAnswers; j++) {
								memset(&inBuffer, 0, sizeof(inBuffer));
								bytesRecv = 0;
								while(bytesRecv <= 0) {
									bytesRecv = recv(players[i].getSocket(), (char*)&inBuffer, 100, 0);
								}
								printf("player %d sent:\n%s.\n", i, (char*)string(inBuffer).c_str());
								parseAnswer(string(inBuffer), answers);
							}
						}
						printf("Received all answers.\n");
						// send expected # of answers to judge
						message = composeNOTIFYMessage('n', string("Server"));
						printf("About to send:\n%s\n", message.c_str());
						bytesSent = send(judge.getSocket(), (char*)message.c_str(), 100, 0);
						if(bytesSent <= 0) {
							printf("Failed to send NOTIFY to judge.\n");
							exit(1);
						}
						printf("Sent answers size.\n");
						// Send answers to judge
						for (int i = 0; i < answers.size(); i++) {
							message = composeSENDMessage('n', answers[i]);
							printf("About to send ANSWER to judge:\n%s\n", message.c_str());
							bytesSent = send(judge.getSocket(), (char*)message.c_str(), 100, 0);
							if(bytesSent <= 0) {
								printf("Failed to send ANSWER to judge.\n");
								i--;
							}
						}
						printf("Sent Answers to judge.\n");
						// Receive requests
						for (int i = 1; i < players.size(); i++) {
							for (int j = 0; j < blackCard.numOfAnswers; j++) {
								memset(&inBuffer, 0, sizeof(inBuffer));
								bytesRecv = 0;
								while (bytesRecv <= 0) {
									bytesRecv = recv(players[i].getSocket(), (char*)&inBuffer, 100, 0);
								}
								parseMessage(string(inBuffer));
							}
						}
						printf("Received all of the requests from clients.\n");

						// receives winner
						bytesRecv = 0;
						memset(&inBuffer, 0, sizeof(inBuffer));
						while (bytesRecv <= 0) {
							bytesRecv = recv(judge.getSocket(), (char*)&inBuffer, 100, 0);
						}
						parseMessage(string(inBuffer));

						// Tell everybody else
						for (int i = 1; i < players.size(); i++) {
							string winningMesssage = composeNOTIFYMessage('w', winner.getName());
							bytesSent = send(players[i].getSocket(), (char*)winningMesssage.c_str(), 100, 0);
							if(bytesSent <= 0) {
								printf("Failed to winner message.\n");
								exit(1);
							}
						}
						step++;
						break;
					default:
						break;
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7b8, %rsp            # imm = 0x7B8
movq %rsi, %r15
movl %edi, %ebx
movq 0x801c(%rip), %rsi      # 0xb608
leaq 0x8015(%rip), %rdi      # 0xb608
callq 0x6c48
movq 0x8021(%rip), %rsi      # 0xb620
leaq 0x801a(%rip), %rdi      # 0xb620
callq 0x6c48
movq 0x7fde(%rip), %rsi      # 0xb5f0
leaq 0x7fd7(%rip), %rdi      # 0xb5f0
callq 0x6c48
movq 0x8013(%rip), %rsi      # 0xb638
leaq 0x800c(%rip), %rdi      # 0xb638
callq 0x6c78
cmpl $0x4, %ebx
jne 0x4d84
movq 0x8(%r15), %rdi
callq 0x22d0
leaq 0x7dee(%rip), %rdi      # 0xb438
movl %eax, %esi
callq 0x51ee
leaq -0xf0(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x7d8(%rbp), %rdi
callq 0x2260
leaq -0x5d0(%rbp), %rdi
callq 0x2260
movq 0x10(%r15), %rsi
leaq -0x7d8(%rbp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x2180
movq 0x18(%r15), %rsi
leaq -0x5d0(%rbp), %rdi
movl $0x8, %edx
callq 0x2180
movq %r15, -0xd8(%rbp)
leaq -0x760(%rbp), %rdi
callq 0x2080
testb %al, %al
je 0x4d5e
leaq -0x558(%rbp), %rdi
callq 0x2080
testb %al, %al
je 0x4d5e
leaq -0xa8(%rbp), %r13
leaq -0x1c0(%rbp), %rbx
movq -0x7d8(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %edx
movq %r14, %rdi
leaq -0x100(%rbp), %rsi
callq 0x2350
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3928
movq -0x100(%rbp), %rsi
movzbl (%rsi), %eax
cmpl $0x73, %eax
je 0x37d6
cmpl $0x71, %eax
jne 0x36e9
leaq -0xd0(%rbp), %rdi
leaq 0x4955(%rip), %rdx      # 0x80a0
callq 0x52ba
movq -0xc8(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %r13, %rdx
callq 0x6894
leaq -0x1d0(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1e0(%rbp), %r15
movq %r15, %rdi
callq 0x311a
movq %r13, %rdi
movq %r15, %rsi
movl $0x62, %edx
movl $0x1, %ecx
callq 0x27c0
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
cmpq %rax, %rdi
je 0x37c2
movq -0x1d0(%rbp), %rsi
incq %rsi
callq 0x2230
leaq 0x7e3f(%rip), %rdi      # 0xb608
movq %r13, %rsi
callq 0x2f92
jmp 0x38cb
movq %rbx, %r15
leaq -0xd0(%rbp), %rdi
leaq 0x48b9(%rip), %rdx      # 0x80a0
callq 0x52ba
movq -0xc8(%rbp), %r12
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x6894
leaq -0x3b0(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x6894
movq -0x3b0(%rbp), %rdi
movq -0x3a8(%rbp), %rax
testq %rax, %rax
je 0x3842
xorl %ecx, %ecx
xorl %r12d, %r12d
xorl %edx, %edx
cmpb $0x5f, (%rdi,%rcx)
sete %dl
addl %edx, %r12d
incq %rcx
cmpq %rcx, %rax
jne 0x382c
jmp 0x3845
xorl %r12d, %r12d
leaq -0x3a0(%rbp), %rax
cmpq %rax, %rdi
je 0x3860
movq -0x3a0(%rbp), %rsi
incq %rsi
callq 0x2230
leaq -0x1b0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rbx
movq %r15, %rdi
callq 0x311a
movq %r13, %rdi
movq %rbx, %rsi
movl $0x62, %edx
movl %r12d, %ecx
callq 0x27c0
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x38b9
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x2230
leaq 0x7d48(%rip), %rdi      # 0xb608
movq %r13, %rsi
callq 0x2f92
movq %r15, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x38e4
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x3906
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x36e9
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x36e9
leaq -0x350(%rbp), %rbx
leaq -0x360(%rbp), %r15
leaq -0xa8(%rbp), %r12
leaq 0x7cdc(%rip), %r13      # 0xb620
movq -0x5d0(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x5d0(%rbp), %r14
addq %r14, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %edx
movq %r14, %rdi
leaq -0x100(%rbp), %rsi
callq 0x2350
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3a23
movq %rbx, -0x360(%rbp)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x311a
movq %r12, %rdi
movq %r15, %rsi
movl $0x77, %edx
xorl %ecx, %ecx
callq 0x27c0
movq -0x360(%rbp), %rdi
cmpq %rbx, %rdi
je 0x39d4
movq -0x350(%rbp), %rsi
incq %rsi
callq 0x2230
movq %r13, %rdi
movq %r12, %rsi
callq 0x2f92
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x39f8
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x3944
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x3944
leaq 0x7bde(%rip), %rsi      # 0xb608
leaq -0x390(%rbp), %rdi
callq 0x2fca
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x22d0
leaq -0x50(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl %eax, %edx
callq 0x531e
movups 0x7ba9(%rip), %xmm0     # 0xb608
movq 0x7bb2(%rip), %rax      # 0xb618
leaq -0x50(%rbp), %rbx
movaps (%rbx), %xmm1
movups %xmm1, 0x7b94(%rip)     # 0xb608
movq 0x10(%rbx), %rcx
movq %rcx, 0x7b99(%rip)      # 0xb618
leaq -0xa8(%rbp), %rdi
movups %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
callq 0x2f54
movq %rbx, %rdi
callq 0x2f54
leaq -0x390(%rbp), %rdi
callq 0x2f54
leaq 0x7b65(%rip), %rsi      # 0xb620
leaq -0x378(%rbp), %rdi
callq 0x2fca
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x22d0
leaq -0x50(%rbp), %rdi
leaq -0x378(%rbp), %rsi
movl %eax, %edx
callq 0x531e
movups 0x7b30(%rip), %xmm0     # 0xb620
movq 0x7b39(%rip), %rax      # 0xb630
movaps (%rbx), %xmm1
movups %xmm1, 0x7b1f(%rip)     # 0xb620
movq 0x10(%rbx), %rcx
movq %rcx, 0x7b24(%rip)      # 0xb630
leaq -0xa8(%rbp), %rdi
movups %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
callq 0x2f54
movq %rbx, %rdi
callq 0x2f54
leaq -0x378(%rbp), %rdi
callq 0x2f54
xorps %xmm0, %xmm0
movups %xmm0, 0x76bd(%rip)     # 0xb208
movups %xmm0, 0x76c6(%rip)     # 0xb218
movups %xmm0, 0x76cf(%rip)     # 0xb228
movups %xmm0, 0x76d8(%rip)     # 0xb238
movups %xmm0, 0x76e1(%rip)     # 0xb248
movups %xmm0, 0x76ea(%rip)     # 0xb258
movups %xmm0, 0x76f3(%rip)     # 0xb268
movups %xmm0, 0x76fc(%rip)     # 0xb278
leaq 0x7685(%rip), %rdi      # 0xb208
movl 0x78af(%rip), %eax      # 0xb438
leal 0x3f(%rax), %edx
testl %eax, %eax
cmovnsl %eax, %edx
movl %edx, %esi
andl $-0x40, %esi
movl %eax, %ecx
subl %esi, %ecx
movl $0x1, %esi
shlq %cl, %rsi
sarl $0x6, %edx
movslq %edx, %rcx
orq %rsi, (%rdi,%rcx,8)
movl 0x764e(%rip), %ecx      # 0xb200
cmpl %eax, %ecx
cmovgl %ecx, %eax
movl %eax, 0x7643(%rip)      # 0xb200
cmpb $0x0, 0x76c4(%rip)      # 0xb288
jne 0x4ccd
leaq 0x76cf(%rip), %r14      # 0xb2a0
leaq -0x50(%rbp), %r12
movl $0x10, %ecx
leaq 0x787f(%rip), %rax      # 0xb460
movq %rax, %rdi
leaq 0x761d(%rip), %rsi      # 0xb208
rep  movsq (%rsi), %es:(%rdi)
movups 0x75e3(%rip), %xmm0     # 0xb1d8
movups %xmm0, 0x7854(%rip)     # 0xb450
movl 0x75fe(%rip), %edi      # 0xb200
incl %edi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x783e(%rip), %r8       # 0xb450
callq 0x2200
testl %eax, %eax
js 0x4cc1
movl 0x7813(%rip), %edi      # 0xb438
leal 0x3f(%rdi), %eax
testl %edi, %edi
cmovnsl %edi, %eax
sarl $0x6, %eax
cltq
leaq 0x7827(%rip), %rcx      # 0xb460
movq (%rcx,%rax,8), %rax
btq %rdi, %rax
jae 0x4164
movl $0x10, -0xdc(%rbp)
leaq 0x77e8(%rip), %rsi      # 0xb440
leaq -0xdc(%rbp), %rdx
callq 0x20e0
movl %eax, 0x77d2(%rip)      # 0xb43c
testl %eax, %eax
js 0x4ccd
leaq 0x464f(%rip), %rdi      # 0x82c8
callq 0x22b0
movl $0xc8, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2170
movl $0x0, 0x75f5(%rip)      # 0xb28c
movl 0x779f(%rip), %edi      # 0xb43c
movl $0x14, %edx
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x20f0
movl %eax, 0x75da(%rip)      # 0xb28c
testl %eax, %eax
jle 0x3c97
movq %r14, %rdi
callq 0x22b0
movq 0x797b(%rip), %rax      # 0xb640
cmpq 0x796c(%rip), %rax      # 0xb638
je 0x4c84
leaq 0x4643(%rip), %rdi      # 0x831c
callq 0x22b0
movq 0x7953(%rip), %rsi      # 0xb638
cmpq %rsi, 0x7954(%rip)      # 0xb640
je 0x3dbb
xorl %r13d, %r13d
xorl %r12d, %r12d
addq %r13, %rsi
leaq -0xa8(%rbp), %rbx
movq %rbx, %rdi
callq 0x2a8e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20c0
movl %eax, %ebx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x3d39
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2230
testl %ebx, %ebx
je 0x3d6e
incq %r12
movq 0x78f9(%rip), %rax      # 0xb640
movq 0x78ea(%rip), %rsi      # 0xb638
subq %rsi, %rax
sarq $0x3, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rcx, %rax
addq $0x58, %r13
cmpq %r12, %rax
ja 0x3cf8
jmp 0x3dbb
movb $0x6e, 0x75fb(%rip)     # 0xb370
movl $0x0, 0x7511(%rip)      # 0xb290
leaq 0x45ab(%rip), %rdi      # 0x8331
callq 0x22b0
movl 0x76ab(%rip), %edi      # 0xb43c
movl $0x1, %edx
leaq 0x75d3(%rip), %rsi      # 0xb370
xorl %ecx, %ecx
callq 0x2140
movl %eax, 0x74e6(%rip)      # 0xb290
testl %eax, %eax
leaq -0x50(%rbp), %r12
jg 0x3c7e
jmp 0x4d55
movb $0x79, 0x75ae(%rip)     # 0xb370
leaq 0x45a7(%rip), %rdi      # 0x8370
callq 0x22b0
movl 0x7668(%rip), %edi      # 0xb43c
movl $0x1, %edx
leaq 0x7590(%rip), %rsi      # 0xb370
xorl %ecx, %ecx
callq 0x2140
leaq -0x50(%rbp), %r12
movl %eax, 0x749f(%rip)      # 0xb290
testl %eax, %eax
jle 0x4d4c
leaq 0x44e4(%rip), %rdi      # 0x82e4
callq 0x22b0
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq %r14, %rdi
callq 0x2130
leaq (%rax,%r14), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x6ca8
leaq -0x190(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1a0(%rbp), %r15
movq %r15, %rdi
callq 0x311a
leaq -0xa8(%rbp), %rbx
movl 0x75e3(%rip), %edx      # 0xb43c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2a0e
movq -0x1a0(%rbp), %rdi
leaq -0x190(%rbp), %rax
cmpq %rax, %rdi
je 0x3e86
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x2230
leaq 0x77ab(%rip), %rdi      # 0xb638
movq %rbx, %rsi
callq 0x68d2
leaq 0x4459(%rip), %rdi      # 0x82f5
callq 0x22b0
movl $0xa, %r13d
movl $0x0, 0x73df(%rip)      # 0xb290
movq 0x7770(%rip), %rbx      # 0xb628
movq 0x7761(%rip), %r12      # 0xb620
cmpq %r12, %rbx
jne 0x3ed7
callq 0x5493
movq 0x7758(%rip), %rbx      # 0xb628
movq 0x7749(%rip), %r12      # 0xb620
leaq -0x2f0(%rbp), %rax
movq %rax, -0x300(%rbp)
movq -0x48(%rbx), %rsi
movq -0x40(%rbx), %rdx
addq %rsi, %rdx
leaq -0x300(%rbp), %rdi
callq 0x311a
subq %r12, %rbx
movq -0x28(%r12,%rbx), %rax
movq %rax, -0x2e0(%rbp)
leaq -0x2c8(%rbp), %rax
movq %rax, -0x2d8(%rbp)
movq -0x20(%r12,%rbx), %rsi
movq -0x18(%r12,%rbx), %rdx
addq %rsi, %rdx
leaq -0x2d8(%rbp), %rdi
callq 0x311a
leaq -0xd0(%rbp), %rdi
leaq 0x41e6(%rip), %rsi      # 0x8126
leaq -0x300(%rbp), %rdx
callq 0x69ac
movq -0x2d8(%rbp), %rdi
leaq -0x2c8(%rbp), %rax
cmpq %rax, %rdi
je 0x3f6e
movq -0x2c8(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x300(%rbp), %rdi
leaq -0x2f0(%rbp), %rax
cmpq %rax, %rdi
je 0x3f90
movq -0x2f0(%rbp), %rsi
incq %rsi
callq 0x2230
movq 0x76a9(%rip), %rbx      # 0xb640
movq 0x768a(%rip), %r12      # 0xb628
movq 0x767b(%rip), %r15      # 0xb620
leaq -0x2a8(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq -0x48(%r12), %rsi
movq -0x40(%r12), %rdx
addq %rsi, %rdx
leaq -0x2b8(%rbp), %rdi
callq 0x311a
subq %r15, %r12
movq -0x28(%r15,%r12), %rax
movq %rax, -0x298(%rbp)
leaq -0x280(%rbp), %rax
movq %rax, -0x290(%rbp)
movq -0x20(%r15,%r12), %rsi
movq -0x18(%r15,%r12), %rdx
addq %rsi, %rdx
leaq -0x290(%rbp), %rdi
callq 0x311a
addq $-0x58, %rbx
movq %rbx, %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x2afa
movq -0x290(%rbp), %rdi
leaq -0x280(%rbp), %rax
cmpq %rax, %rdi
je 0x4037
movq -0x280(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x2b8(%rbp), %rdi
leaq -0x2a8(%rbp), %rax
cmpq %rax, %rdi
je 0x4059
movq -0x2a8(%rbp), %rsi
incq %rsi
callq 0x2230
movq 0x75c8(%rip), %rsi      # 0xb628
addq $-0x48, %rsi
movq %rsi, 0x75bd(%rip)      # 0xb628
leaq 0x75ae(%rip), %rdi      # 0xb620
callq 0x34b2
movl 0x73bf(%rip), %edi      # 0xb43c
movq -0xd0(%rbp), %rsi
movl $0x64, %edx
xorl %ecx, %ecx
callq 0x2140
movl %eax, 0x71fa(%rip)      # 0xb290
testl %eax, %eax
jle 0x4d1b
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
leaq -0x50(%rbp), %r12
je 0x40c4
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2230
decl %r13d
jne 0x3ea7
movl 0x7369(%rip), %eax      # 0xb43c
leal 0x3f(%rax), %edx
testl %eax, %eax
cmovnsl %eax, %edx
movl %edx, %esi
andl $-0x40, %esi
movl %eax, %ecx
subl %esi, %ecx
movl $0x1, %esi
shlq %cl, %rsi
sarl $0x6, %edx
movslq %edx, %rcx
leaq 0x710f(%rip), %rdx      # 0xb208
orq %rsi, (%rdx,%rcx,8)
movl 0x70fd(%rip), %ecx      # 0xb200
cmpl %eax, %ecx
cmovgl %ecx, %eax
movl %eax, 0x70f2(%rip)      # 0xb200
leaq -0x68(%rbp), %rdi
callq 0x2f54
leaq -0x80(%rbp), %rdi
callq 0x2f54
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x4142
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4c75
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x4c75
movq 0x74d5(%rip), %rax      # 0xb640
subq 0x74c6(%rip), %rax      # 0xb638
sarq $0x3, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rcx, %rax
cmpq $0x4, %rax
jb 0x4c75
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq $0x0, -0xa0(%rbp)
movb $0x0, -0x98(%rbp)
movslq 0x749b(%rip), %rax      # 0xb650
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
cmpl $0x2, %eax
je 0x4596
cmpl $0x1, %eax
je 0x43c5
testl %eax, %eax
jne 0x4c4f
leaq 0x40a7(%rip), %rdi      # 0x8296
callq 0x22b0
leaq -0x3c8(%rbp), %rbx
movq %rbx, %rdi
leaq 0x7433(%rip), %rsi      # 0xb638
callq 0x690a
leaq -0xd0(%rbp), %r15
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x22d0
subl 0x7429(%rip), %eax      # 0xb650
movq %r15, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x56fe
leaq -0x50(%rbp), %r12
movups 0x73f9(%rip), %xmm0     # 0xb638
movq 0x7402(%rip), %rax      # 0xb648
movaps -0xd0(%rbp), %xmm1
movups %xmm1, 0x73e4(%rip)     # 0xb638
movq -0xc0(%rbp), %rcx
movq %rcx, 0x73e6(%rip)      # 0xb648
movups %xmm0, -0x50(%rbp)
movq %rax, -0x40(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0xd0(%rbp)
movq $0x0, -0xc0(%rbp)
movq %r12, %rdi
callq 0x6856
movq %r15, %rdi
callq 0x6856
movq %rbx, %rdi
callq 0x6856
movq 0x739a(%rip), %rbx      # 0xb638
leaq 0x723b(%rip), %rdi      # 0xb4e0
movq %rbx, %rsi
callq 0x2160
movq 0x20(%rbx), %rax
movq %rax, 0x7248(%rip)      # 0xb500
leaq 0x28(%rbx), %rsi
leaq 0x7245(%rip), %rdi      # 0xb508
callq 0x6b1e
addq $0x40, %rbx
leaq 0x724d(%rip), %rdi      # 0xb520
movq %rbx, %rsi
callq 0x6b1e
leaq -0x340(%rbp), %rbx
movq %rbx, %rdi
leaq 0x71f4(%rip), %rsi      # 0xb4e0
callq 0x2a8e
movq %r12, %rdi
leaq 0x3e37(%rip), %rsi      # 0x8132
movq %rbx, %rdx
callq 0x69ac
leaq -0xa8(%rbp), %rdi
movq %r12, %rsi
callq 0x2280
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x432b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x340(%rbp), %rdi
leaq -0x330(%rbp), %rax
cmpq %rax, %rdi
je 0x434d
movq -0x330(%rbp), %rsi
incq %rsi
callq 0x2230
movq 0x72e4(%rip), %rdi      # 0xb638
cmpq %rdi, 0x72e5(%rip)      # 0xb640
je 0x4c49
xorl %ebx, %ebx
xorl %r12d, %r12d
addq %rbx, %rdi
callq 0x2ac4
movq -0xa8(%rbp), %rsi
movl $0x64, %edx
movl %eax, %edi
xorl %ecx, %ecx
callq 0x2140
movl %eax, 0x6f07(%rip)      # 0xb290
testl %eax, %eax
jle 0x4d3a
incq %r12
movq 0x72a5(%rip), %rax      # 0xb640
movq 0x7296(%rip), %rdi      # 0xb638
subq %rdi, %rax
sarq $0x3, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rcx, %rax
addq $0x58, %rbx
cmpq %r12, %rax
ja 0x4366
jmp 0x4c49
movq 0x7244(%rip), %rax      # 0xb610
cmpq 0x7235(%rip), %rax      # 0xb608
je 0x4d97
leaq 0x3e85(%rip), %rdi      # 0x8265
callq 0x22b0
movq 0x7224(%rip), %rbx      # 0xb610
leaq -0x48(%rbx), %rsi
leaq 0x7199(%rip), %rdi      # 0xb590
callq 0x2160
movq -0x28(%rbx), %rax
movq %rax, 0x71a9(%rip)      # 0xb5b0
addq $-0x20, %rbx
leaq 0x71a6(%rip), %rdi      # 0xb5b8
movq %rbx, %rsi
callq 0x2160
movq 0x71ef(%rip), %rsi      # 0xb610
addq $-0x48, %rsi
movq %rsi, 0x71e4(%rip)      # 0xb610
leaq 0x71d5(%rip), %rdi      # 0xb608
callq 0x34b2
leaq -0x260(%rbp), %rax
movq %rax, -0x270(%rbp)
movq 0x7143(%rip), %rsi      # 0xb590
movq 0x7144(%rip), %rdx      # 0xb598
addq %rsi, %rdx
leaq -0x270(%rbp), %rdi
callq 0x311a
movq 0x7146(%rip), %rax      # 0xb5b0
movq %rax, -0x250(%rbp)
leaq -0x238(%rbp), %rax
movq %rax, -0x248(%rbp)
movq 0x7132(%rip), %rsi      # 0xb5b8
movq 0x7133(%rip), %rdx      # 0xb5c0
addq %rsi, %rdx
leaq -0x248(%rbp), %rdi
callq 0x311a
movq %r12, %rdi
leaq 0x3c6b(%rip), %rsi      # 0x8111
leaq -0x270(%rbp), %rdx
callq 0x69ac
leaq -0xa8(%rbp), %rdi
movq %r12, %rsi
callq 0x2280
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x44da
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x248(%rbp), %rdi
leaq -0x238(%rbp), %rax
cmpq %rax, %rdi
je 0x44fc
movq -0x238(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x270(%rbp), %rdi
leaq -0x260(%rbp), %rax
cmpq %rax, %rdi
je 0x451e
movq -0x260(%rbp), %rsi
incq %rsi
callq 0x2230
movq 0x7113(%rip), %rdi      # 0xb638
cmpq %rdi, 0x7114(%rip)      # 0xb640
je 0x4c49
xorl %ebx, %ebx
xorl %r12d, %r12d
addq %rbx, %rdi
callq 0x2ac4
movq -0xa8(%rbp), %rsi
movl $0x12c, %edx            # imm = 0x12C
movl %eax, %edi
xorl %ecx, %ecx
callq 0x2140
movl %eax, 0x6d36(%rip)      # 0xb290
testl %eax, %eax
jle 0x4d31
incq %r12
movq 0x70d4(%rip), %rax      # 0xb640
movq 0x70c5(%rip), %rdi      # 0xb638
subq %rdi, %rax
sarq $0x3, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rcx, %rax
addq $0x58, %rbx
cmpq %r12, %rax
ja 0x4537
jmp 0x4c49
movq 0x703b(%rip), %rsi      # 0xb5d8
leaq 0x7034(%rip), %rdi      # 0xb5d8
callq 0x6c48
movq 0x7090(%rip), %rax      # 0xb640
movq 0x7081(%rip), %rcx      # 0xb638
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $0x2e8ba2e8ba2e8ba3, %rsi # imm = 0x2E8BA2E8BA2E8BA3
imulq %rsi, %rdx
cmpq $0x2, %rdx
jb 0x471c
movl $0x1, %ebx
movl 0x6fd0(%rip), %edx      # 0xb5b4
testl %edx, %edx
jle 0x46f8
xorl %r13d, %r13d
movl $0xc8, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2170
movl $0x0, 0x6c84(%rip)      # 0xb28c
imulq $0x58, %rbx, %rdi
addq 0x7025(%rip), %rdi      # 0xb638
callq 0x2ac4
movl $0x64, %edx
movl %eax, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x20f0
movl %eax, 0x6c5d(%rip)      # 0xb28c
testl %eax, %eax
jle 0x4608
leaq -0x40(%rbp), %r15
movq %r15, -0x50(%rbp)
movq %r14, %rdi
callq 0x2130
leaq (%rax,%r14), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x6ca8
movq -0x50(%rbp), %rdx
leaq 0x3a45(%rip), %rdi      # 0x80a2
movl %ebx, %esi
xorl %eax, %eax
callq 0x2040
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x467b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
leaq -0x170(%rbp), %rax
movq %rax, -0x180(%rbp)
movq %r14, %rdi
callq 0x2130
leaq (%rax,%r14), %rdx
leaq -0x180(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6ca8
movq %r15, %rdi
leaq 0x6f27(%rip), %rsi      # 0xb5d8
callq 0x5b8d
movq -0x180(%rbp), %rdi
leaq -0x170(%rbp), %rax
cmpq %rax, %rdi
je 0x46d8
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x2230
incl %r13d
movl 0x6ed3(%rip), %edx      # 0xb5b4
cmpl %edx, %r13d
jl 0x45ef
movq 0x6f4f(%rip), %rax      # 0xb640
movq 0x6f40(%rip), %rcx      # 0xb638
incq %rbx
movq %rax, %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
movabsq $0x2e8ba2e8ba2e8ba3, %rdi # imm = 0x2E8BA2E8BA2E8BA3
imulq %rdi, %rsi
cmpq %rbx, %rsi
ja 0x45e4
leaq 0x3a7d(%rip), %rdi      # 0x81a0
callq 0x22b0
leaq -0x150(%rbp), %rax
movq %rax, -0x160(%rbp)
leaq -0x160(%rbp), %rbx
movq %rbx, %rdi
leaq 0x3a41(%rip), %rsi      # 0x8188
leaq 0x3a40(%rip), %rdx      # 0x818e
callq 0x6ca8
movq %r12, %rdi
movl $0x6e, %esi
movq %rbx, %rdx
callq 0x5873
leaq -0xa8(%rbp), %rdi
movq %r12, %rsi
callq 0x2280
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x478b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
leaq 0x6d3d(%rip), %rbx      # 0xb4e0
je 0x47b4
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0xa8(%rbp), %rsi
leaq 0x38f5(%rip), %rdi      # 0x80b7
xorl %eax, %eax
callq 0x2040
movq %rbx, %rdi
callq 0x2ac4
movq -0xa8(%rbp), %rsi
movl $0x64, %edx
movl %eax, %edi
xorl %ecx, %ecx
callq 0x2140
movl %eax, 0x6aa4(%rip)      # 0xb290
testl %eax, %eax
jle 0x4d9c
leaq 0x39bb(%rip), %rdi      # 0x81b6
callq 0x22b0
movq 0x6dd1(%rip), %r12      # 0xb5d8
cmpq %r12, 0x6dd2(%rip)      # 0xb5e0
je 0x497c
xorl %eax, %eax
xorl %ebx, %ebx
leaq (%rax,%rax,8), %r15
leaq -0x218(%rbp), %rax
movq %rax, -0x228(%rbp)
movq (%r12,%r15,8), %rsi
movq 0x8(%r12,%r15,8), %rdx
addq %rsi, %rdx
leaq -0x228(%rbp), %rdi
callq 0x311a
leaq (%r12,%r15,8), %rax
movq 0x20(%rax), %rcx
movq %rcx, -0x208(%rbp)
leaq -0x1f0(%rbp), %rcx
movq %rcx, -0x200(%rbp)
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rdx
addq %rsi, %rdx
leaq -0x200(%rbp), %rdi
callq 0x311a
leaq -0x50(%rbp), %r12
movq %r12, %rdi
movl $0x6e, %esi
leaq -0x228(%rbp), %rdx
callq 0x556d
leaq -0x40(%rbp), %r15
leaq -0xa8(%rbp), %rdi
movq %r12, %rsi
callq 0x2280
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x48b6
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
leaq 0x6c12(%rip), %r15      # 0xb4e0
je 0x48df
movq -0x1f0(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x228(%rbp), %rdi
leaq -0x218(%rbp), %rax
cmpq %rax, %rdi
je 0x4901
movq -0x218(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0xa8(%rbp), %rsi
leaq 0x37bb(%rip), %rdi      # 0x80ca
xorl %eax, %eax
callq 0x2040
movq %r15, %rdi
callq 0x2ac4
movq -0xa8(%rbp), %rsi
movl $0x64, %edx
movl %eax, %edi
xorl %ecx, %ecx
callq 0x2140
movl %eax, 0x6957(%rip)      # 0xb290
testl %eax, %eax
jg 0x494b
leaq 0x38e1(%rip), %rdi      # 0x8225
callq 0x22b0
decl %ebx
incl %ebx
movslq %ebx, %rax
movq 0x6c89(%rip), %rcx      # 0xb5e0
movq 0x6c7a(%rip), %r12      # 0xb5d8
subq %r12, %rcx
sarq $0x3, %rcx
movabsq $-0x71c71c71c71c71c7, %rdx # imm = 0x8E38E38E38E38E39
imulq %rdx, %rcx
cmpq %rax, %rcx
ja 0x4818
leaq 0x3846(%rip), %rdi      # 0x81c9
callq 0x22b0
movq 0x6cb1(%rip), %rax      # 0xb640
movq 0x6ca2(%rip), %rcx      # 0xb638
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $0x2e8ba2e8ba2e8ba3, %rsi # imm = 0x2E8BA2E8BA2E8BA3
imulq %rsi, %rdx
cmpq $0x2, %rdx
leaq 0x6b27(%rip), %r15      # 0xb4e0
leaq -0x140(%rbp), %r12
jb 0x4ab3
movl $0x1, %ebx
movl 0x6be3(%rip), %edx      # 0xb5b4
testl %edx, %edx
jle 0x4a8f
xorl %r13d, %r13d
movl $0xc8, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2170
movl $0x0, 0x6897(%rip)      # 0xb28c
imulq $0x58, %rbx, %rdi
addq 0x6c38(%rip), %rdi      # 0xb638
callq 0x2ac4
movl $0x64, %edx
movl %eax, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x20f0
movl %eax, 0x6870(%rip)      # 0xb28c
testl %eax, %eax
jle 0x49f5
leaq -0x130(%rbp), %rax
movq %rax, -0x140(%rbp)
movq %r14, %rdi
callq 0x2130
leaq (%rax,%r14), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x6ca8
movq %r12, %rdi
callq 0x5e4d
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x4a6f
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2230
incl %r13d
movl 0x6b3c(%rip), %edx      # 0xb5b4
cmpl %edx, %r13d
jl 0x49dc
movq 0x6bb8(%rip), %rax      # 0xb640
movq 0x6ba9(%rip), %rcx      # 0xb638
incq %rbx
movq %rax, %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
movabsq $0x2e8ba2e8ba2e8ba3, %rdi # imm = 0x2E8BA2E8BA2E8BA3
imulq %rdi, %rsi
cmpq %rbx, %rsi
ja 0x49d1
leaq 0x3726(%rip), %rdi      # 0x81e0
callq 0x22b0
movl $0x0, 0x67c3(%rip)      # 0xb28c
movl $0xc8, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2170
leaq -0x120(%rbp), %rbx
movq %r15, %rdi
callq 0x2ac4
movl $0x64, %edx
movl %eax, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x20f0
movl %eax, 0x678e(%rip)      # 0xb28c
testl %eax, %eax
jle 0x4adf
leaq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
movq %r14, %rdi
callq 0x2130
leaq (%rax,%r14), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6ca8
movq %rbx, %rdi
callq 0x5e4d
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x4b51
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2230
movq 0x6ae8(%rip), %rax      # 0xb640
subq 0x6ad9(%rip), %rax      # 0xb638
sarq $0x3, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rcx, %rax
cmpq $0x2, %rax
jb 0x4c49
movl $0x1, %ebx
movl $0x58, %r13d
leaq -0x320(%rbp), %r15
movq %r15, %rdi
leaq 0x69a1(%rip), %rsi      # 0xb538
callq 0x2a8e
leaq -0x50(%rbp), %rdi
leaq 0x359e(%rip), %rsi      # 0x8145
movq %r15, %rdx
callq 0x69ac
movq -0x320(%rbp), %rdi
leaq -0x310(%rbp), %rax
cmpq %rax, %rdi
je 0x4bd1
movq -0x310(%rbp), %rsi
incq %rsi
callq 0x2230
movq 0x6a60(%rip), %rdi      # 0xb638
addq %r13, %rdi
callq 0x2ac4
movq -0x50(%rbp), %rsi
movl $0x64, %edx
movl %eax, %edi
xorl %ecx, %ecx
callq 0x2140
movl %eax, 0x6698(%rip)      # 0xb290
testl %eax, %eax
jle 0x4d43
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4c19
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
incq %rbx
movq 0x6a1d(%rip), %rax      # 0xb640
subq 0x6a0e(%rip), %rax      # 0xb638
sarq $0x3, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rcx, %rax
addq $0x58, %r13
cmpq %rbx, %rax
ja 0x4b86
incl 0x6a01(%rip)            # 0xb650
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x4c71
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2230
leaq -0x50(%rbp), %r12
cmpb $0x1, 0x660c(%rip)      # 0xb288
jne 0x3bd5
jmp 0x4ccd
leaq 0x36d3(%rip), %rdi      # 0x835e
callq 0x22b0
movb $0x79, 0x66d9(%rip)     # 0xb370
leaq 0x36d2(%rip), %rdi      # 0x8370
callq 0x22b0
movl 0x6793(%rip), %edi      # 0xb43c
movl $0x1, %edx
leaq 0x66bb(%rip), %rsi      # 0xb370
xorl %ecx, %ecx
callq 0x2140
jmp 0x3deb
leaq 0x36dc(%rip), %rdi      # 0x83a4
callq 0x22b0
leaq -0x5d0(%rbp), %rdi
callq 0x20a0
leaq -0x7d8(%rbp), %rdi
callq 0x20a0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x4d07
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2230
xorl %eax, %eax
addq $0x7b8, %rsp            # imm = 0x7B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x35e8(%rip), %rdi      # 0x830a
callq 0x22b0
movl $0x1, %edi
callq 0x2270
leaq 0x3544(%rip), %rdi      # 0x827c
jmp 0x4d22
leaq 0x3567(%rip), %rdi      # 0x82a8
jmp 0x4d22
leaq 0x34c1(%rip), %rdi      # 0x820b
jmp 0x4d22
leaq 0x3635(%rip), %rdi      # 0x8388
jmp 0x4d22
leaq 0x35ec(%rip), %rdi      # 0x8348
jmp 0x4d22
leaq 0x342a(%rip), %rdi      # 0x818f
callq 0x22b0
leaq -0x7d8(%rbp), %rdi
callq 0x2070
leaq -0x5d0(%rbp), %rdi
callq 0x2070
jmp 0x4d27
movq (%r15), %rsi
leaq 0x32d2(%rip), %rdi      # 0x8060
xorl %eax, %eax
callq 0x2040
jmp 0x4d27
callq 0x5a26
leaq 0x34a2(%rip), %rdi      # 0x8245
jmp 0x4d22
movq %rax, %r14
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x518a
movq -0x110(%rbp), %rsi
jmp 0x50bb
jmp 0x5187
movq %rax, %r14
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x518a
movq -0x150(%rbp), %rsi
jmp 0x50bb
jmp 0x5187
jmp 0x5187
movq %rax, %r14
leaq -0x270(%rbp), %rdi
jmp 0x4f43
movq %rax, %r14
movq -0x270(%rbp), %rdi
leaq -0x260(%rbp), %rax
cmpq %rax, %rdi
je 0x518a
movq -0x260(%rbp), %rsi
jmp 0x50bb
jmp 0x5187
movq %rax, %r14
movq -0x340(%rbp), %rdi
leaq -0x330(%rbp), %rax
cmpq %rax, %rdi
je 0x518a
movq -0x330(%rbp), %rsi
jmp 0x50bb
jmp 0x5187
movq %rax, %r14
leaq -0x3c8(%rbp), %rdi
callq 0x6856
jmp 0x518a
jmp 0x5187
movq %rax, %r14
leaq -0x378(%rbp), %rdi
jmp 0x4e9c
jmp 0x513c
movq %rax, %r14
leaq -0x390(%rbp), %rdi
callq 0x2f54
jmp 0x51ac
jmp 0x513c
movq %rax, %r14
jmp 0x51b8
movq %rax, %r14
jmp 0x51c4
jmp 0x5187
jmp 0x513c
jmp 0x513c
jmp 0x5005
jmp 0x513c
jmp 0x513c
jmp 0x5137
movq %rax, %r14
movq -0x1a0(%rbp), %rdi
leaq -0x190(%rbp), %rax
cmpq %rax, %rdi
je 0x5172
movq -0x190(%rbp), %rsi
jmp 0x4ff8
jmp 0x513c
movq %rax, %r14
movq -0x320(%rbp), %rdi
leaq -0x310(%rbp), %rax
cmpq %rax, %rdi
je 0x518a
movq -0x310(%rbp), %rsi
jmp 0x50bb
jmp 0x5187
jmp 0x5187
movq %rax, %r14
leaq -0x228(%rbp), %rdi
callq 0x306e
jmp 0x518a
movq %rax, %r14
movq -0x228(%rbp), %rdi
leaq -0x218(%rbp), %rax
cmpq %rax, %rdi
je 0x518a
movq -0x218(%rbp), %rsi
jmp 0x50bb
jmp 0x513c
movq %rax, %r14
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x518a
movq -0x40(%rbp), %rsi
jmp 0x50bb
jmp 0x4fc3
movq %rax, %r14
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x5172
movq -0x1b0(%rbp), %rsi
jmp 0x4ff8
jmp 0x5005
jmp 0x5005
jmp 0x513c
movq %rax, %r14
leaq -0xa8(%rbp), %rdi
callq 0x306e
jmp 0x5172
movq %rax, %r14
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
cmpq %rax, %rdi
je 0x5172
movq -0x1d0(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x5172
movq %rax, %r14
jmp 0x5172
jmp 0x513c
jmp 0x5187
jmp 0x5187
jmp 0x5187
jmp 0x5187
movq %rax, %r14
leaq -0xa8(%rbp), %rdi
callq 0x306e
jmp 0x51ac
movq %rax, %r14
movq -0x360(%rbp), %rdi
cmpq %rbx, %rdi
je 0x51ac
movq -0x350(%rbp), %rsi
jmp 0x51a4
jmp 0x513c
jmp 0x5137
jmp 0x513c
jmp 0x513c
movq %rax, %r14
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x518a
movq -0x130(%rbp), %rsi
jmp 0x50bb
jmp 0x5187
jmp 0x5187
movq %rax, %r14
movq -0x180(%rbp), %rdi
leaq -0x170(%rbp), %rax
cmpq %rax, %rdi
je 0x518a
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x518a
jmp 0x5187
jmp 0x513c
movq %rax, %r14
leaq -0x2b8(%rbp), %rdi
callq 0x306e
jmp 0x5144
movq %rax, %r14
movq -0x2b8(%rbp), %rdi
leaq -0x2a8(%rbp), %rax
cmpq %rax, %rdi
je 0x5144
movq -0x2a8(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0x5144
movq %rax, %r14
leaq -0x300(%rbp), %rdi
callq 0x306e
jmp 0x5166
movq %rax, %r14
movq -0x300(%rbp), %rdi
leaq -0x2f0(%rbp), %rax
cmpq %rax, %rdi
je 0x5166
movq -0x2f0(%rbp), %rsi
jmp 0x515e
movq %rax, %r14
jmp 0x5166
movq %rax, %r14
jmp 0x51ac
movq %rax, %r14
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x5166
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2230
leaq -0xa8(%rbp), %rdi
callq 0x6816
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x51ac
movq -0x40(%rbp), %rsi
jmp 0x51a4
jmp 0x5187
movq %rax, %r14
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x51ac
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2230
leaq -0x5d0(%rbp), %rdi
callq 0x20a0
leaq -0x7d8(%rbp), %rdi
callq 0x20a0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x51e6
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2230
movq %r14, %rdi
callq 0x2320