// File: 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
subq $0xce0, %rsp            # imm = 0xCE0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xcfe8(%rip), %rdi      # 0x126a8
callq 0x8eb0
leaq 0xcff4(%rip), %rdi      # 0x126c0
callq 0x8eb0
leaq 0xcfb8(%rip), %rdi      # 0x12690
callq 0x8eb0
leaq 0xcff4(%rip), %rdi      # 0x126d8
callq 0x8ed0
cmpl $0x4, -0x8(%rbp)
je 0x570e
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x7921(%rip), %rdi      # 0xd01e
movb $0x0, %al
callq 0x3050
movl $0x1, %edi
callq 0x3350
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x33e0
movl %eax, %esi
leaq 0xcdb4(%rip), %rdi      # 0x124d8
callq 0x75d0
leaq -0x30(%rbp), %rdi
callq 0x33a0
leaq -0x238(%rbp), %rdi
callq 0x3340
jmp 0x5740
leaq -0x450(%rbp), %rdi
callq 0x3340
jmp 0x574e
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x238(%rbp), %rdi
movl $0x8, %edx
callq 0x3200
jmp 0x5769
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x450(%rbp), %rdi
movl $0x8, %edx
callq 0x3200
jmp 0x5784
leaq -0x238(%rbp), %rdi
callq 0x3410
movb %al, -0xab1(%rbp)
jmp 0x5798
movb -0xab1(%rbp), %al
testb $0x1, %al
jne 0x57a4
jmp 0x57c4
leaq -0x450(%rbp), %rdi
callq 0x3410
movb %al, -0xab2(%rbp)
jmp 0x57b8
movb -0xab2(%rbp), %al
testb $0x1, %al
jne 0x583f
jmp 0x57c4
leaq 0x7893(%rip), %rdi      # 0xd05e
xorl %eax, %eax
callq 0x3050
jmp 0x57d4
leaq -0x238(%rbp), %rdi
callq 0x30b0
jmp 0x57e2
leaq -0x450(%rbp), %rdi
callq 0x30b0
jmp 0x57f0
movl $0x1, %edi
callq 0x3350
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x75ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x75a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x7594
jmp 0x5841
leaq -0x238(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x30a0
movq %rax, -0xac0(%rbp)
jmp 0x585a
movq -0xac0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3380
movb %al, -0xac1(%rbp)
jmp 0x5878
movb -0xac1(%rbp), %al
testb $0x1, %al
jne 0x5887
jmp 0x5c5f
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x34c0
movq %rax, -0xad0(%rbp)
jmp 0x589d
movq -0xad0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x71, %eax
jne 0x5a12
leaq -0x30(%rbp), %rdi
callq 0x3170
movq %rax, %rsi
leaq 0x77ad(%rip), %rdx      # 0xd070
leaq -0x460(%rbp), %rdi
callq 0x76f0
jmp 0x58d1
movq -0x458(%rbp), %rax
movq %rax, -0xae0(%rbp)
leaq -0x481(%rbp), %rdi
movq %rdi, -0xad8(%rbp)
callq 0x3450
movq -0xae0(%rbp), %rsi
movq -0xad8(%rbp), %rdx
leaq -0x480(%rbp), %rdi
callq 0x8ef0
jmp 0x590e
leaq -0x481(%rbp), %rdi
callq 0x3300
leaq -0x4f0(%rbp), %rdi
leaq -0x480(%rbp), %rsi
callq 0x3180
jmp 0x592f
leaq -0x4d0(%rbp), %rdi
leaq -0x4f0(%rbp), %rsi
movl $0x62, %edx
movl $0x1, %ecx
callq 0x38d0
jmp 0x594e
leaq -0x4f0(%rbp), %rdi
callq 0x31f0
leaq 0xcd47(%rip), %rdi      # 0x126a8
leaq -0x4d0(%rbp), %rsi
callq 0x4210
jmp 0x596f
leaq -0x4d0(%rbp), %rdi
callq 0x4460
leaq -0x480(%rbp), %rdi
callq 0x31f0
jmp 0x5c5a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x481(%rbp), %rdi
callq 0x3300
jmp 0x7594
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x5a01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x4f0(%rbp), %rdi
callq 0x31f0
jmp 0x5a01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x4d0(%rbp), %rdi
callq 0x4460
leaq -0x480(%rbp), %rdi
callq 0x31f0
jmp 0x7594
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x34c0
movq %rax, -0xae8(%rbp)
jmp 0x5a28
movq -0xae8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x73, %eax
jne 0x5c58
leaq -0x30(%rbp), %rdi
callq 0x3170
movq %rax, %rsi
leaq 0x7622(%rip), %rdx      # 0xd070
leaq -0x460(%rbp), %rdi
callq 0x76f0
jmp 0x5a5c
movq -0x458(%rbp), %rax
movq %rax, -0xaf8(%rbp)
leaq -0x511(%rbp), %rdi
movq %rdi, -0xaf0(%rbp)
callq 0x3450
movq -0xaf8(%rbp), %rsi
movq -0xaf0(%rbp), %rdx
leaq -0x510(%rbp), %rdi
callq 0x8ef0
jmp 0x5a99
leaq -0x511(%rbp), %rdi
callq 0x3300
movq -0x458(%rbp), %rax
movq %rax, -0xb08(%rbp)
leaq -0x539(%rbp), %rdi
movq %rdi, -0xb00(%rbp)
callq 0x3450
movq -0xb08(%rbp), %rsi
movq -0xb00(%rbp), %rdx
leaq -0x538(%rbp), %rdi
callq 0x8ef0
jmp 0x5ae2
leaq -0x538(%rbp), %rdi
movl $0x5f, %esi
callq 0x7760
movl %eax, -0xb0c(%rbp)
jmp 0x5afb
leaq -0x538(%rbp), %rdi
callq 0x31f0
leaq -0x539(%rbp), %rdi
callq 0x3300
movl -0xb0c(%rbp), %eax
movl %eax, -0x518(%rbp)
leaq -0x5a8(%rbp), %rdi
leaq -0x510(%rbp), %rsi
callq 0x3180
jmp 0x5b34
movl -0x518(%rbp), %ecx
leaq -0x588(%rbp), %rdi
leaq -0x5a8(%rbp), %rsi
movl $0x62, %edx
callq 0x38d0
jmp 0x5b54
leaq -0x5a8(%rbp), %rdi
callq 0x31f0
leaq 0xcb41(%rip), %rdi      # 0x126a8
leaq -0x588(%rbp), %rsi
callq 0x4210
jmp 0x5b75
leaq -0x588(%rbp), %rdi
callq 0x4460
leaq -0x510(%rbp), %rdi
callq 0x31f0
jmp 0x5c58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x511(%rbp), %rdi
callq 0x3300
jmp 0x7594
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x5be7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x538(%rbp), %rdi
callq 0x31f0
leaq -0x539(%rbp), %rdi
callq 0x3300
jmp 0x5c47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x5c47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x5a8(%rbp), %rdi
callq 0x31f0
jmp 0x5c47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x588(%rbp), %rdi
callq 0x4460
leaq -0x510(%rbp), %rdi
callq 0x31f0
jmp 0x7594
jmp 0x5c5a
jmp 0x5841
jmp 0x5c61
leaq -0x450(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x30a0
movq %rax, -0xb18(%rbp)
jmp 0x5c7a
movq -0xb18(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3380
movb %al, -0xb19(%rbp)
jmp 0x5c98
movb -0xb19(%rbp), %al
testb $0x1, %al
jne 0x5ca7
jmp 0x5d4d
leaq -0x610(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3180
jmp 0x5cb9
leaq -0x5f0(%rbp), %rdi
leaq -0x610(%rbp), %rsi
movl $0x77, %edx
xorl %ecx, %ecx
callq 0x38d0
jmp 0x5cd5
leaq -0x610(%rbp), %rdi
callq 0x31f0
leaq 0xc9d8(%rip), %rdi      # 0x126c0
leaq -0x5f0(%rbp), %rsi
callq 0x4210
jmp 0x5cf6
leaq -0x5f0(%rbp), %rdi
callq 0x4460
jmp 0x5c61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x610(%rbp), %rdi
callq 0x31f0
jmp 0x7594
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x5f0(%rbp), %rdi
callq 0x4460
jmp 0x7594
leaq 0xc954(%rip), %rsi      # 0x126a8
leaq -0x640(%rbp), %rdi
callq 0x4340
jmp 0x5d62
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x33e0
movl %eax, %edx
leaq -0x628(%rbp), %rdi
leaq -0x640(%rbp), %rsi
callq 0x77e0
jmp 0x5d86
leaq 0xc91b(%rip), %rdi      # 0x126a8
leaq -0x628(%rbp), %rsi
movq %rsi, -0xb28(%rbp)
callq 0x4430
movq -0xb28(%rbp), %rdi
callq 0x41b0
leaq -0x640(%rbp), %rdi
callq 0x41b0
leaq 0xc901(%rip), %rsi      # 0x126c0
leaq -0x670(%rbp), %rdi
callq 0x4340
jmp 0x5dcd
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x33e0
movl %eax, %edx
leaq -0x658(%rbp), %rdi
leaq -0x670(%rbp), %rsi
callq 0x77e0
jmp 0x5df1
leaq 0xc8c8(%rip), %rdi      # 0x126c0
leaq -0x658(%rbp), %rsi
callq 0x4430
leaq -0x658(%rbp), %rdi
callq 0x41b0
leaq -0x670(%rbp), %rdi
callq 0x41b0
leaq 0xc485(%rip), %rax      # 0x122a8
movq %rax, -0x680(%rbp)
movl $0x0, -0x674(%rbp)
movl -0x674(%rbp), %eax
cmpq $0x10, %rax
jae 0x5eac
movq -0x680(%rbp), %rax
movl -0x674(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0x674(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x674(%rbp)
jmp 0x5e34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x640(%rbp), %rdi
callq 0x41b0
jmp 0x7594
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x670(%rbp), %rdi
callq 0x41b0
jmp 0x7594
jmp 0x5eae
jmp 0x5eb0
leaq 0xc621(%rip), %rsi      # 0x124d8
movl 0xc61b(%rip), %ecx      # 0x124d8
movl %ecx, %edx
addl $0x3f, %edx
testl %ecx, %ecx
movl %ecx, %eax
cmovsl %edx, %eax
movl %eax, %edx
andl $-0x40, %edx
subl %edx, %ecx
movb %cl, %r8b
sarl $0x6, %eax
movslq %eax, %rcx
leaq 0xc3c8(%rip), %rax      # 0x122a8
movq (%rax,%rcx,8), %rdx
movb %r8b, %dil
btsq %rdi, %rdx
movq %rdx, (%rax,%rcx,8)
leaq 0xc3aa(%rip), %rdi      # 0x122a0
callq 0x8fa0
movq %rax, -0xb30(%rbp)
jmp 0x5f04
movq -0xb30(%rbp), %rax
movl (%rax), %eax
movl %eax, 0xc38d(%rip)      # 0x122a0
movb 0xc40f(%rip), %al       # 0x12328
xorb $-0x1, %al
testb $0x1, %al
jne 0x5f24
jmp 0x7567
movups 0xc3ed(%rip), %xmm0     # 0x12318
movups %xmm0, 0xc63e(%rip)     # 0x12570
movups 0xc3cf(%rip), %xmm0     # 0x12308
movups %xmm0, 0xc620(%rip)     # 0x12560
movups 0xc3b1(%rip), %xmm0     # 0x122f8
movups %xmm0, 0xc602(%rip)     # 0x12550
movups 0xc393(%rip), %xmm0     # 0x122e8
movups %xmm0, 0xc5e4(%rip)     # 0x12540
movups 0xc375(%rip), %xmm0     # 0x122d8
movups %xmm0, 0xc5c6(%rip)     # 0x12530
movups 0xc357(%rip), %xmm0     # 0x122c8
movups %xmm0, 0xc5a8(%rip)     # 0x12520
movups 0xc339(%rip), %xmm0     # 0x122b8
movups %xmm0, 0xc58a(%rip)     # 0x12510
movups 0xc31b(%rip), %xmm0     # 0x122a8
movups %xmm0, 0xc56c(%rip)     # 0x12500
leaq 0xc565(%rip), %rsi      # 0x12500
movups 0xc2de(%rip), %xmm0     # 0x12280
movups %xmm0, 0xc547(%rip)     # 0x124f0
leaq 0xc540(%rip), %r8       # 0x124f0
movl 0xc2ea(%rip), %edi      # 0x122a0
incl %edi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x32b0
movl %eax, -0xb34(%rbp)
jmp 0x5fcc
movl -0xb34(%rbp), %eax
movl %eax, -0x684(%rbp)
cmpl $0x0, -0x684(%rbp)
jge 0x5ff6
leaq 0x708a(%rip), %rdi      # 0xd072
xorl %eax, %eax
callq 0x3050
jmp 0x5ff1
jmp 0x7567
movl 0xc4dc(%rip), %eax      # 0x124d8
movl $0x40, %ecx
cltd
idivl %ecx
movslq %eax, %rcx
leaq 0xc4f2(%rip), %rax      # 0x12500
movq (%rax,%rcx,8), %rax
movq %rax, -0xb40(%rbp)
movl 0xc4b9(%rip), %eax      # 0x124d8
movl $0x40, %ecx
cltd
idivl %ecx
movq -0xb40(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x6759
movl $0x10, -0x688(%rbp)
movl 0xc480(%rip), %edi      # 0x124d8
leaq 0xc481(%rip), %rsi      # 0x124e0
leaq -0x688(%rbp), %rdx
callq 0x3120
movl %eax, -0xb44(%rbp)
jmp 0x6073
movl -0xb44(%rbp), %eax
movl %eax, 0xc45d(%rip)      # 0x124dc
cmpl $0x0, %eax
jge 0x6089
jmp 0x7567
leaq 0x6ff3(%rip), %rdi      # 0xd083
xorl %eax, %eax
callq 0x3050
jmp 0x6099
movb $0x0, -0x689(%rbp)
movb $0x0, -0x68a(%rbp)
movb -0x689(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x60b8
jmp 0x6387
leaq 0xc281(%rip), %rdi      # 0x12340
xorl %esi, %esi
movl $0xc8, %edx
callq 0x31c0
movl $0x0, 0xc257(%rip)      # 0x1232c
cmpl $0x0, 0xc250(%rip)      # 0x1232c
jg 0x610f
movl 0xc3f8(%rip), %edi      # 0x124dc
leaq 0xc255(%rip), %rsi      # 0x12340
movl $0x14, %edx
xorl %ecx, %ecx
callq 0x3130
movq %rax, -0xb50(%rbp)
jmp 0x6100
movq -0xb50(%rbp), %rax
movl %eax, 0xc21f(%rip)      # 0x1232c
jmp 0x60d5
leaq 0x70f5(%rip), %rdi      # 0xd20b
leaq 0xc223(%rip), %rsi      # 0x12340
xorl %eax, %eax
callq 0x3050
jmp 0x6126
leaq 0xc5ab(%rip), %rdi      # 0x126d8
callq 0x8fe0
cmpq $0x1, %rax
jae 0x61ca
leaq 0x6f5d(%rip), %rdi      # 0xd0a0
xorl %eax, %eax
callq 0x3050
jmp 0x614c
movb $0x79, 0xc2bd(%rip)     # 0x12410
leaq 0x6f59(%rip), %rdi      # 0xd0b3
xorl %eax, %eax
callq 0x3050
jmp 0x6163
movl 0xc373(%rip), %edi      # 0x124dc
leaq 0xc2a0(%rip), %rsi      # 0x12410
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x31a0
movq %rax, -0xb58(%rbp)
jmp 0x6185
movq -0xb58(%rbp), %rax
movl %eax, 0xc19e(%rip)      # 0x12330
cmpl $0x0, 0xc197(%rip)      # 0x12330
jg 0x61b5
leaq 0x6f2a(%rip), %rdi      # 0xd0cc
xorl %eax, %eax
callq 0x3050
jmp 0x61ab
movl $0x1, %edi
callq 0x3350
movb -0x689(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x689(%rbp)
jmp 0x6382
leaq 0x6f18(%rip), %rdi      # 0xd0e9
xorl %eax, %eax
callq 0x3050
jmp 0x61da
movb $0x0, -0x68a(%rbp)
movl $0x0, -0x690(%rbp)
movslq -0x690(%rbp), %rax
movq %rax, -0xb60(%rbp)
leaq 0xc4d8(%rip), %rdi      # 0x126d8
callq 0x8fe0
movq %rax, %rcx
movq -0xb60(%rbp), %rax
cmpq %rcx, %rax
jae 0x62fe
movslq -0x690(%rbp), %rsi
leaq 0xc4b2(%rip), %rdi      # 0x126d8
callq 0x9010
movq %rax, %rsi
leaq -0x6b0(%rbp), %rdi
callq 0x3c30
jmp 0x623c
leaq -0x6b0(%rbp), %rdi
leaq 0xc0f6(%rip), %rsi      # 0x12340
callq 0x3110
movl %eax, -0xb64(%rbp)
leaq -0x6b0(%rbp), %rdi
callq 0x31f0
movl -0xb64(%rbp), %eax
cmpl $0x0, %eax
jne 0x62e8
movb $0x6e, 0xc19d(%rip)     # 0x12410
movl $0x0, 0xc0b3(%rip)      # 0x12330
leaq 0x6e7b(%rip), %rdi      # 0xd0ff
xorl %eax, %eax
callq 0x3050
jmp 0x628d
movl 0xc249(%rip), %edi      # 0x124dc
leaq 0xc176(%rip), %rsi      # 0x12410
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x31a0
movq %rax, -0xb70(%rbp)
jmp 0x62af
movq -0xb70(%rbp), %rax
movl %eax, 0xc074(%rip)      # 0x12330
cmpl $0x0, 0xc06d(%rip)      # 0x12330
jg 0x62df
leaq 0x6e4b(%rip), %rdi      # 0xd117
xorl %eax, %eax
callq 0x3050
jmp 0x62d5
movl $0x1, %edi
callq 0x3350
movb $0x1, -0x68a(%rbp)
jmp 0x62fe
jmp 0x62ea
movl -0x690(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x690(%rbp)
jmp 0x61eb
testb $0x1, -0x68a(%rbp)
jne 0x6380
movb $0x79, 0xc102(%rip)     # 0x12410
leaq 0x6d9e(%rip), %rdi      # 0xd0b3
xorl %eax, %eax
callq 0x3050
jmp 0x631e
movl 0xc1b8(%rip), %edi      # 0x124dc
leaq 0xc0e5(%rip), %rsi      # 0x12410
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x31a0
movq %rax, -0xb78(%rbp)
jmp 0x6340
movq -0xb78(%rbp), %rax
movl %eax, 0xbfe3(%rip)      # 0x12330
cmpl $0x0, 0xbfdc(%rip)      # 0x12330
jg 0x6370
leaq 0x6d6f(%rip), %rdi      # 0xd0cc
xorl %eax, %eax
callq 0x3050
jmp 0x6366
movl $0x1, %edi
callq 0x3350
movb -0x689(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x689(%rbp)
jmp 0x6382
jmp 0x60a7
leaq 0x6da0(%rip), %rdi      # 0xd12e
xorl %eax, %eax
callq 0x3050
jmp 0x6397
leaq -0x6d1(%rbp), %rdi
movq %rdi, -0xb80(%rbp)
callq 0x3450
movq -0xb80(%rbp), %rdx
leaq 0xbf88(%rip), %rsi      # 0x12340
leaq -0x6d0(%rbp), %rdi
callq 0x8ef0
jmp 0x63c6
leaq -0x6d1(%rbp), %rdi
callq 0x3300
leaq -0x750(%rbp), %rdi
leaq -0x6d0(%rbp), %rsi
callq 0x3180
jmp 0x63e7
movl 0xc0ef(%rip), %edx      # 0x124dc
leaq -0x730(%rbp), %rdi
leaq -0x750(%rbp), %rsi
callq 0x3b80
jmp 0x6402
leaq -0x750(%rbp), %rdi
callq 0x31f0
leaq 0xc2c3(%rip), %rdi      # 0x126d8
leaq -0x730(%rbp), %rsi
callq 0x9030
jmp 0x6423
leaq 0x6d16(%rip), %rdi      # 0xd140
xorl %eax, %eax
callq 0x3050
jmp 0x6433
movl $0x0, -0x754(%rbp)
cmpl $0xa, -0x754(%rbp)
jge 0x66bc
movl $0x0, 0xbedc(%rip)      # 0x12330
leaq 0xc265(%rip), %rdi      # 0x126c0
callq 0x4280
cmpq $0x0, %rax
jne 0x64e3
callq 0x7960
jmp 0x646d
jmp 0x64e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x6d1(%rbp), %rdi
callq 0x3300
jmp 0x7594
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6748
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x750(%rbp), %rdi
callq 0x31f0
jmp 0x6748
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x673c
leaq 0xc1d6(%rip), %rdi      # 0x126c0
movq %rdi, -0xb88(%rbp)
callq 0x4280
movq -0xb88(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x42b0
movq %rax, %rsi
leaq -0x7c0(%rbp), %rdi
callq 0x42d0
jmp 0x6519
leaq -0x778(%rbp), %rdi
movl $0x64, %esi
leaq -0x7c0(%rbp), %rdx
callq 0x7a00
jmp 0x6533
leaq -0x7c0(%rbp), %rdi
callq 0x4460
leaq 0xc192(%rip), %rdi      # 0x126d8
movq %rdi, -0xba0(%rbp)
callq 0x8fe0
movq -0xba0(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x9010
movq %rax, -0xb98(%rbp)
leaq 0xc14e(%rip), %rdi      # 0x126c0
movq %rdi, -0xb90(%rbp)
callq 0x4280
movq -0xb90(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x42b0
movq %rax, %rsi
leaq -0x808(%rbp), %rdi
callq 0x42d0
jmp 0x65a1
movq -0xb98(%rbp), %rdi
leaq -0x808(%rbp), %rsi
callq 0x3d30
jmp 0x65b6
leaq -0x808(%rbp), %rdi
callq 0x4460
leaq 0xc0f7(%rip), %rdi      # 0x126c0
callq 0x90a0
movl 0xbf08(%rip), %eax      # 0x124dc
movl %eax, -0xbac(%rbp)
leaq -0x778(%rbp), %rdi
callq 0x3170
movl -0xbac(%rbp), %edi
movq %rax, %rsi
movl $0x64, %edx
xorl %ecx, %ecx
callq 0x31a0
movq %rax, -0xba8(%rbp)
jmp 0x6604
movq -0xba8(%rbp), %rax
movl %eax, 0xbd1f(%rip)      # 0x12330
cmpl $0x0, 0xbd18(%rip)      # 0x12330
jg 0x668b
leaq 0x6b35(%rip), %rdi      # 0xd156
xorl %eax, %eax
callq 0x3050
jmp 0x662a
movl $0x1, %edi
callq 0x3350
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x7c0(%rbp), %rdi
callq 0x4460
jmp 0x673c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x66ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x808(%rbp), %rdi
callq 0x4460
jmp 0x66ab
leaq -0x778(%rbp), %rdi
callq 0x31f0
movl -0x754(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x754(%rbp)
jmp 0x643d
leaq -0x778(%rbp), %rdi
callq 0x31f0
jmp 0x673c
leaq 0xbe19(%rip), %rsi      # 0x124dc
movl 0xbe13(%rip), %ecx      # 0x124dc
movl %ecx, %edx
addl $0x3f, %edx
testl %ecx, %ecx
movl %ecx, %eax
cmovsl %edx, %eax
movl %eax, %edx
andl $-0x40, %edx
subl %edx, %ecx
movb %cl, %r8b
sarl $0x6, %eax
movslq %eax, %rcx
leaq 0xbbbc(%rip), %rax      # 0x122a8
movq (%rax,%rcx,8), %rdx
movb %r8b, %dil
btsq %rdi, %rdx
movq %rdx, (%rax,%rcx,8)
leaq 0xbb9e(%rip), %rdi      # 0x122a0
callq 0x8fa0
movq %rax, -0xbb8(%rbp)
jmp 0x6710
movq -0xbb8(%rbp), %rax
movl (%rax), %eax
movl %eax, 0xbb81(%rip)      # 0x122a0
leaq -0x730(%rbp), %rdi
callq 0x8df0
leaq -0x6d0(%rbp), %rdi
callq 0x31f0
jmp 0x7562
leaq -0x730(%rbp), %rdi
callq 0x8df0
leaq -0x6d0(%rbp), %rdi
callq 0x31f0
jmp 0x7594
leaq 0xbf78(%rip), %rdi      # 0x126d8
callq 0x8fe0
cmpq $0x3, %rax
jbe 0x7560
leaq -0x828(%rbp), %rdi
callq 0x33a0
movslq 0xbf6e(%rip), %rcx      # 0x126f0
movl %ecx, %eax
imulq $0x55555556, %rcx, %rdx # imm = 0x55555556
movq %rdx, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rdx
addl %ecx, %edx
movl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
movl %eax, -0xbbc(%rbp)
je 0x67ce
jmp 0x67a9
movl -0xbbc(%rbp), %eax
subl $0x1, %eax
je 0x6a0e
jmp 0x67ba
movl -0xbbc(%rbp), %eax
subl $0x2, %eax
je 0x6bd6
jmp 0x7542
leaq 0x6994(%rip), %rdi      # 0xd169
xorl %eax, %eax
callq 0x3050
jmp 0x67de
leaq 0xbef3(%rip), %rsi      # 0x126d8
leaq -0x858(%rbp), %rdi
callq 0x90d0
jmp 0x67f3
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x33e0
movl %eax, %edx
movl 0xbee8(%rip), %eax      # 0x126f0
subl %eax, %edx
leaq -0x840(%rbp), %rdi
leaq -0x858(%rbp), %rsi
callq 0x7b70
jmp 0x681f
leaq 0xbeb2(%rip), %rdi      # 0x126d8
movq %rdi, -0xbc8(%rbp)
leaq -0x840(%rbp), %rsi
movq %rsi, -0xbd0(%rbp)
callq 0x91c0
movq -0xbd0(%rbp), %rdi
callq 0x8e50
leaq -0x858(%rbp), %rdi
callq 0x8e50
movq -0xbc8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9010
movq %rax, %rsi
leaq 0xbd0e(%rip), %rdi      # 0x12580
callq 0x91f0
jmp 0x6879
leaq 0xbd00(%rip), %rsi      # 0x12580
leaq -0x898(%rbp), %rdi
callq 0x3c30
jmp 0x688e
leaq -0x878(%rbp), %rdi
movl $0x6a, %esi
leaq -0x898(%rbp), %rdx
callq 0x7cf0
jmp 0x68a8
leaq -0x828(%rbp), %rdi
leaq -0x878(%rbp), %rsi
callq 0x3360
leaq -0x878(%rbp), %rdi
callq 0x31f0
leaq -0x898(%rbp), %rdi
callq 0x31f0
movl $0x0, -0x89c(%rbp)
movslq -0x89c(%rbp), %rax
movq %rax, -0xbd8(%rbp)
leaq 0xbde6(%rip), %rdi      # 0x126d8
callq 0x8fe0
movq %rax, %rcx
movq -0xbd8(%rbp), %rax
cmpq %rcx, %rax
jae 0x69fa
movslq -0x89c(%rbp), %rsi
leaq 0xbdc0(%rip), %rdi      # 0x126d8
callq 0x9010
movq %rax, %rdi
callq 0x3c80
movl %eax, -0xbdc(%rbp)
jmp 0x692d
leaq -0x828(%rbp), %rdi
callq 0x3170
movl -0xbdc(%rbp), %edi
movq %rax, %rsi
movl $0x64, %edx
xorl %ecx, %ecx
callq 0x31a0
movq %rax, -0xbe8(%rbp)
jmp 0x6957
movq -0xbe8(%rbp), %rax
movl %eax, 0xb9cc(%rip)      # 0x12330
cmpl $0x0, 0xb9c5(%rip)      # 0x12330
jg 0x69e4
leaq 0x6808(%rip), %rdi      # 0xd17c
xorl %eax, %eax
callq 0x3050
jmp 0x697d
movl $0x1, %edi
callq 0x3350
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x7552
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x858(%rbp), %rdi
callq 0x8e50
jmp 0x7552
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x898(%rbp), %rdi
callq 0x31f0
jmp 0x7552
jmp 0x69e6
movl -0x89c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x89c(%rbp)
jmp 0x68dd
movl 0xbcf0(%rip), %eax      # 0x126f0
addl $0x1, %eax
movl %eax, 0xbce7(%rip)      # 0x126f0
jmp 0x7544
leaq 0xbc93(%rip), %rdi      # 0x126a8
callq 0x4280
cmpq $0x0, %rax
jne 0x6a29
callq 0x7f30
jmp 0x6a27
jmp 0x6a29
leaq 0x676d(%rip), %rdi      # 0xd19d
xorl %eax, %eax
callq 0x3050
jmp 0x6a39
leaq 0xbc68(%rip), %rdi      # 0x126a8
movq %rdi, -0xbf0(%rbp)
callq 0x4280
movq -0xbf0(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x42b0
movq %rax, %rsi
leaq 0xbbc8(%rip), %rdi      # 0x12630
callq 0x9260
jmp 0x6a6f
leaq 0xbc32(%rip), %rdi      # 0x126a8
callq 0x90a0
leaq 0xbbae(%rip), %rsi      # 0x12630
leaq -0x908(%rbp), %rdi
callq 0x42d0
jmp 0x6a90
leaq -0x8c0(%rbp), %rdi
movl $0x70, %esi
leaq -0x908(%rbp), %rdx
callq 0x7a00
jmp 0x6aaa
leaq -0x828(%rbp), %rdi
leaq -0x8c0(%rbp), %rsi
callq 0x3360
leaq -0x8c0(%rbp), %rdi
callq 0x31f0
leaq -0x908(%rbp), %rdi
callq 0x4460
movl $0x0, -0x90c(%rbp)
movslq -0x90c(%rbp), %rax
movq %rax, -0xbf8(%rbp)
leaq 0xbbe4(%rip), %rdi      # 0x126d8
callq 0x8fe0
movq %rax, %rcx
movq -0xbf8(%rbp), %rax
cmpq %rcx, %rax
jae 0x6bc2
movslq -0x90c(%rbp), %rsi
leaq 0xbbbe(%rip), %rdi      # 0x126d8
callq 0x9010
movq %rax, %rdi
callq 0x3c80
movl %eax, -0xbfc(%rbp)
jmp 0x6b2f
leaq -0x828(%rbp), %rdi
callq 0x3170
movl -0xbfc(%rbp), %edi
movq %rax, %rsi
movl $0x12c, %edx            # imm = 0x12C
xorl %ecx, %ecx
callq 0x31a0
movq %rax, -0xc08(%rbp)
jmp 0x6b59
movq -0xc08(%rbp), %rax
movl %eax, 0xb7ca(%rip)      # 0x12330
cmpl $0x0, 0xb7c3(%rip)      # 0x12330
jg 0x6bac
leaq 0x663f(%rip), %rdi      # 0xd1b5
xorl %eax, %eax
callq 0x3050
jmp 0x6b7f
movl $0x1, %edi
callq 0x3350
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x908(%rbp), %rdi
callq 0x4460
jmp 0x7552
jmp 0x6bae
movl -0x90c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90c(%rbp)
jmp 0x6adf
movl 0xbb28(%rip), %eax      # 0x126f0
addl $0x1, %eax
movl %eax, 0xbb1f(%rip)      # 0x126f0
jmp 0x7544
leaq 0xba9b(%rip), %rdi      # 0x12678
callq 0x8eb0
movl $0x1, -0x910(%rbp)
movslq -0x910(%rbp), %rax
movq %rax, -0xc10(%rbp)
leaq 0xbad7(%rip), %rdi      # 0x126d8
callq 0x8fe0
movq %rax, %rcx
movq -0xc10(%rbp), %rax
cmpq %rcx, %rax
jae 0x6e33
movl $0x0, -0x914(%rbp)
movl -0x914(%rbp), %eax
cmpl 0xba25(%rip), %eax      # 0x12654
jge 0x6e1d
leaq 0xb704(%rip), %rdi      # 0x12340
xorl %esi, %esi
movl $0xc8, %edx
callq 0x31c0
movl $0x0, 0xb6da(%rip)      # 0x1232c
cmpl $0x0, 0xb6d3(%rip)      # 0x1232c
jg 0x6caf
movslq -0x910(%rbp), %rsi
leaq 0xba6f(%rip), %rdi      # 0x126d8
callq 0x9010
movq %rax, %rdi
callq 0x3c80
movl %eax, -0xc14(%rbp)
jmp 0x6c7e
movl -0xc14(%rbp), %edi
leaq 0xb6b5(%rip), %rsi      # 0x12340
movl $0x64, %edx
xorl %ecx, %ecx
callq 0x3130
movq %rax, -0xc20(%rbp)
jmp 0x6ca0
movq -0xc20(%rbp), %rax
movl %eax, 0xb67f(%rip)      # 0x1232c
jmp 0x6c52
movl -0x910(%rbp), %eax
movl %eax, -0xc2c(%rbp)
leaq -0x939(%rbp), %rdi
movq %rdi, -0xc28(%rbp)
callq 0x3450
movq -0xc28(%rbp), %rdx
leaq 0xb664(%rip), %rsi      # 0x12340
leaq -0x938(%rbp), %rdi
callq 0x8ef0
jmp 0x6cea
leaq -0x938(%rbp), %rdi
callq 0x3170
movl -0xc2c(%rbp), %esi
movq %rax, %rdx
leaq 0x64ca(%rip), %rdi      # 0xd1d0
xorl %eax, %eax
callq 0x3050
jmp 0x6d0f
leaq -0x938(%rbp), %rdi
callq 0x31f0
leaq -0x939(%rbp), %rdi
callq 0x3300
leaq -0x961(%rbp), %rdi
movq %rdi, -0xc38(%rbp)
callq 0x3450
movq -0xc38(%rbp), %rdx
leaq 0xb5f8(%rip), %rsi      # 0x12340
leaq -0x960(%rbp), %rdi
callq 0x8ef0
jmp 0x6d56
leaq 0xb91b(%rip), %rsi      # 0x12678
leaq -0x960(%rbp), %rdi
callq 0x8090
jmp 0x6d6b
leaq -0x960(%rbp), %rdi
callq 0x31f0
leaq -0x961(%rbp), %rdi
callq 0x3300
movl -0x914(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x914(%rbp)
jmp 0x6c23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6dc9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x938(%rbp), %rdi
callq 0x31f0
leaq -0x939(%rbp), %rdi
callq 0x3300
jmp 0x7552
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6e0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x960(%rbp), %rdi
callq 0x31f0
leaq -0x961(%rbp), %rdi
callq 0x3300
jmp 0x7552
jmp 0x6e1f
movl -0x910(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x910(%rbp)
jmp 0x6bec
leaq 0x63ab(%rip), %rdi      # 0xd1e5
xorl %eax, %eax
callq 0x3050
jmp 0x6e43
leaq -0x9a9(%rbp), %rdi
movq %rdi, -0xc40(%rbp)
callq 0x3450
movq -0xc40(%rbp), %rdx
leaq 0x6564(%rip), %rsi      # 0xd3c8
leaq -0x9a8(%rbp), %rdi
callq 0x8ef0
jmp 0x6e72
leaq -0x988(%rbp), %rdi
movl $0x6e, %esi
leaq -0x9a8(%rbp), %rdx
callq 0x7cf0
jmp 0x6e8c
leaq -0x828(%rbp), %rdi
movq %rdi, -0xc48(%rbp)
leaq -0x988(%rbp), %rsi
movq %rsi, -0xc50(%rbp)
callq 0x3360
movq -0xc50(%rbp), %rdi
callq 0x31f0
leaq -0x9a8(%rbp), %rdi
callq 0x31f0
leaq -0x9a9(%rbp), %rdi
callq 0x3300
movq -0xc48(%rbp), %rdi
callq 0x3170
movq %rax, %rsi
leaq 0x6315(%rip), %rdi      # 0xd1fc
xorl %eax, %eax
callq 0x3050
jmp 0x6ef0
leaq 0xb689(%rip), %rdi      # 0x12580
callq 0x3c80
movl %eax, -0xc54(%rbp)
jmp 0x6f04
leaq -0x828(%rbp), %rdi
callq 0x3170
movl -0xc54(%rbp), %edi
movq %rax, %rsi
movl $0x64, %edx
xorl %ecx, %ecx
callq 0x31a0
movq %rax, -0xc60(%rbp)
jmp 0x6f2e
movq -0xc60(%rbp), %rax
movl %eax, 0xb3f5(%rip)      # 0x12330
cmpl $0x0, 0xb3ee(%rip)      # 0x12330
jg 0x6fa1
leaq 0x62c4(%rip), %rdi      # 0xd20f
xorl %eax, %eax
callq 0x3050
jmp 0x6f54
movl $0x1, %edi
callq 0x3350
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6f90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x9a8(%rbp), %rdi
callq 0x31f0
leaq -0x9a9(%rbp), %rdi
callq 0x3300
jmp 0x7552
leaq 0x6288(%rip), %rdi      # 0xd230
xorl %eax, %eax
callq 0x3050
jmp 0x6fb1
movl $0x0, -0x9b0(%rbp)
movslq -0x9b0(%rbp), %rax
movq %rax, -0xc68(%rbp)
leaq 0xb6a8(%rip), %rdi      # 0x12678
callq 0x4280
movq %rax, %rcx
movq -0xc68(%rbp), %rax
cmpq %rcx, %rax
jae 0x712c
movslq -0x9b0(%rbp), %rsi
leaq 0xb682(%rip), %rdi      # 0x12678
callq 0x42b0
movq %rax, %rsi
leaq -0xa18(%rbp), %rdi
callq 0x42d0
jmp 0x700c
leaq -0x9d0(%rbp), %rdi
movl $0x6e, %esi
leaq -0xa18(%rbp), %rdx
callq 0x7a00
jmp 0x7026
leaq -0x828(%rbp), %rdi
movq %rdi, -0xc70(%rbp)
leaq -0x9d0(%rbp), %rsi
movq %rsi, -0xc78(%rbp)
callq 0x3360
movq -0xc78(%rbp), %rdi
callq 0x31f0
leaq -0xa18(%rbp), %rdi
callq 0x4460
movq -0xc70(%rbp), %rdi
callq 0x3170
movq %rax, %rsi
leaq 0x61cf(%rip), %rdi      # 0xd244
xorl %eax, %eax
callq 0x3050
jmp 0x707e
leaq 0xb4fb(%rip), %rdi      # 0x12580
callq 0x3c80
movl %eax, -0xc7c(%rbp)
jmp 0x7092
leaq -0x828(%rbp), %rdi
callq 0x3170
movl -0xc7c(%rbp), %edi
movq %rax, %rsi
movl $0x64, %edx
xorl %ecx, %ecx
callq 0x31a0
movq %rax, -0xc88(%rbp)
jmp 0x70bc
movq -0xc88(%rbp), %rax
movl %eax, 0xb267(%rip)      # 0x12330
cmpl $0x0, 0xb260(%rip)      # 0x12330
jg 0x7116
leaq 0x618e(%rip), %rdi      # 0xd267
xorl %eax, %eax
callq 0x3050
jmp 0x70e2
movl -0x9b0(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x9b0(%rbp)
jmp 0x7116
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0xa18(%rbp), %rdi
callq 0x4460
jmp 0x7552
jmp 0x7118
movl -0x9b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9b0(%rbp)
jmp 0x6fbb
leaq 0x6155(%rip), %rdi      # 0xd288
xorl %eax, %eax
callq 0x3050
jmp 0x713c
movl $0x1, -0xa1c(%rbp)
movslq -0xa1c(%rbp), %rax
movq %rax, -0xc90(%rbp)
leaq 0xb57d(%rip), %rdi      # 0x126d8
callq 0x8fe0
movq %rax, %rcx
movq -0xc90(%rbp), %rax
cmpq %rcx, %rax
jae 0x72cb
movl $0x0, -0xa20(%rbp)
movl -0xa20(%rbp), %eax
cmpl 0xb4cb(%rip), %eax      # 0x12654
jge 0x72b5
leaq 0xb1aa(%rip), %rdi      # 0x12340
xorl %esi, %esi
movl $0xc8, %edx
callq 0x31c0
movl $0x0, 0xb180(%rip)      # 0x1232c
cmpl $0x0, 0xb179(%rip)      # 0x1232c
jg 0x7209
movslq -0xa1c(%rbp), %rsi
leaq 0xb515(%rip), %rdi      # 0x126d8
callq 0x9010
movq %rax, %rdi
callq 0x3c80
movl %eax, -0xc94(%rbp)
jmp 0x71d8
movl -0xc94(%rbp), %edi
leaq 0xb15b(%rip), %rsi      # 0x12340
movl $0x64, %edx
xorl %ecx, %ecx
callq 0x3130
movq %rax, -0xca0(%rbp)
jmp 0x71fa
movq -0xca0(%rbp), %rax
movl %eax, 0xb125(%rip)      # 0x1232c
jmp 0x71ac
leaq -0xa41(%rbp), %rdi
movq %rdi, -0xca8(%rbp)
callq 0x3450
movq -0xca8(%rbp), %rdx
leaq 0xb116(%rip), %rsi      # 0x12340
leaq -0xa40(%rbp), %rdi
callq 0x8ef0
jmp 0x7238
leaq -0xa40(%rbp), %rdi
callq 0x8430
jmp 0x7246
leaq -0xa40(%rbp), %rdi
callq 0x31f0
leaq -0xa41(%rbp), %rdi
callq 0x3300
movl -0xa20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa20(%rbp)
jmp 0x717d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x72a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0xa40(%rbp), %rdi
callq 0x31f0
leaq -0xa41(%rbp), %rdi
callq 0x3300
jmp 0x7552
jmp 0x72b7
movl -0xa1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa1c(%rbp)
jmp 0x7146
leaq 0x5fce(%rip), %rdi      # 0xd2a0
xorl %eax, %eax
callq 0x3050
jmp 0x72db
movl $0x0, 0xb047(%rip)      # 0x1232c
leaq 0xb054(%rip), %rdi      # 0x12340
xorl %esi, %esi
movl $0xc8, %edx
callq 0x31c0
cmpl $0x0, 0xb02d(%rip)      # 0x1232c
jg 0x7346
leaq 0xb278(%rip), %rdi      # 0x12580
callq 0x3c80
movl %eax, -0xcac(%rbp)
jmp 0x7315
movl -0xcac(%rbp), %edi
leaq 0xb01e(%rip), %rsi      # 0x12340
movl $0x64, %edx
xorl %ecx, %ecx
callq 0x3130
movq %rax, -0xcb8(%rbp)
jmp 0x7337
movq -0xcb8(%rbp), %rax
movl %eax, 0xafe8(%rip)      # 0x1232c
jmp 0x72f8
leaq -0xa69(%rbp), %rdi
movq %rdi, -0xcc0(%rbp)
callq 0x3450
movq -0xcc0(%rbp), %rdx
leaq 0xafd9(%rip), %rsi      # 0x12340
leaq -0xa68(%rbp), %rdi
callq 0x8ef0
jmp 0x7375
leaq -0xa68(%rbp), %rdi
callq 0x8430
jmp 0x7383
leaq -0xa68(%rbp), %rdi
callq 0x31f0
leaq -0xa69(%rbp), %rdi
callq 0x3300
movl $0x1, -0xa70(%rbp)
movslq -0xa70(%rbp), %rax
movq %rax, -0xcc8(%rbp)
leaq 0xb31e(%rip), %rdi      # 0x126d8
callq 0x8fe0
movq %rax, %rcx
movq -0xcc8(%rbp), %rax
cmpq %rcx, %rax
jae 0x7531
leaq 0xb1ff(%rip), %rsi      # 0x125d8
leaq -0xab0(%rbp), %rdi
callq 0x3c30
jmp 0x73e7
leaq -0xa90(%rbp), %rdi
movl $0x77, %esi
leaq -0xab0(%rbp), %rdx
callq 0x7cf0
jmp 0x7401
leaq -0xab0(%rbp), %rdi
callq 0x31f0
movslq -0xa70(%rbp), %rsi
leaq 0xb2bd(%rip), %rdi      # 0x126d8
callq 0x9010
movq %rax, %rdi
callq 0x3c80
movl %eax, -0xccc(%rbp)
jmp 0x7430
leaq -0xa90(%rbp), %rdi
callq 0x3170
movl -0xccc(%rbp), %edi
movq %rax, %rsi
movl $0x64, %edx
xorl %ecx, %ecx
callq 0x31a0
movq %rax, -0xcd8(%rbp)
jmp 0x745a
movq -0xcd8(%rbp), %rax
movl %eax, 0xaec9(%rip)      # 0x12330
cmpl $0x0, 0xaec2(%rip)      # 0x12330
jg 0x7511
leaq 0x5e51(%rip), %rdi      # 0xd2cc
xorl %eax, %eax
callq 0x3050
jmp 0x7484
movl $0x1, %edi
callq 0x3350
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x74c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0xa68(%rbp), %rdi
callq 0x31f0
leaq -0xa69(%rbp), %rdi
callq 0x3300
jmp 0x7552
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0xab0(%rbp), %rdi
callq 0x31f0
jmp 0x7552
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0xa90(%rbp), %rdi
callq 0x31f0
jmp 0x7552
leaq -0xa90(%rbp), %rdi
callq 0x31f0
movl -0xa70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa70(%rbp)
jmp 0x73a5
movl 0xb1b9(%rip), %eax      # 0x126f0
addl $0x1, %eax
movl %eax, 0xb1b0(%rip)      # 0x126f0
jmp 0x7544
jmp 0x7544
leaq -0x828(%rbp), %rdi
callq 0x31f0
jmp 0x7560
leaq -0x828(%rbp), %rdi
callq 0x31f0
jmp 0x7594
jmp 0x7562
jmp 0x5f13
leaq -0x450(%rbp), %rdi
callq 0x30f0
leaq -0x238(%rbp), %rdi
callq 0x30f0
leaq -0x30(%rbp), %rdi
callq 0x31f0
movl -0x4(%rbp), %eax
addq $0xce0, %rsp            # imm = 0xCE0
popq %rbp
retq
leaq -0x450(%rbp), %rdi
callq 0x30f0
leaq -0x238(%rbp), %rdi
callq 0x30f0
leaq -0x30(%rbp), %rdi
callq 0x31f0
movq -0x240(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)