// File: /workspace/github_cpp_makefile_star2_O3/m1c0l[P]TCP/server.cpp
// Function: main
int main(int argc, char **argv) {
	if (argc != 3) {
		cerr << "usage: " << argv[0] << " PORT-NUMBER FILENAME" << '\n';
		return 1;
	}

	string port = argv[1];
	string filename = argv[2];

	srand (time(NULL)); //Used to generate random ISN

	//Create UDP socket
	int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
	if (sockfd == -1) {
		perror("socket");
		return 1;
	}

	//Timeout flags and stuff could be set here
	int yes = 1;
	if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) {
		perror("setsockopt");
		return 1;
	}


	sockaddr_in addr, other;
	addr.sin_family = AF_INET;
	addr.sin_port = htons(stoi(port));
	addr.sin_addr.s_addr = htonl(INADDR_ANY);//inet_addr("127.0.0.1");

	memset(addr.sin_zero, '\0', sizeof(addr.sin_zero));

	if (bind(sockfd, (sockaddr*) &addr, sizeof(addr)) == -1) {
		perror("bind");
		return 2;
	}

	socklen_t other_length = sizeof(other);
	TcpMessage received;
	TcpMessage toSend;
	bool hasReceivedSyn = false;
	bool sendFile = false;
	uint16_t seqToSend = rand() % MAX_SEQ_NUM; //The first sync
	uint16_t ackToSend;
	uint16_t ssThresh = MAX_SEQ_NUM;
	ifstream wantedFile;
	string flagsToSend = "";
	for (int packetsSent = 0; true; packetsSent++) {
	    // cerr << "Waiting for something" << endl;
		int r = received.recvfrom(sockfd, &other, other_length);
		if (r == RECV_TIMEOUT) {
			if (hasReceivedSyn) { // client ACK not received; resend SYN-ACK
				printSend("SYN", toSend.seqNum, DATA_SIZE, DATA_SIZE, true);
				toSend.sendto(sockfd, &other, other_length);
				// cerr << "Sending SYN-ACK (retransmit):" << endl;
				toSend.dump();
			}
			continue;
		}

		// cerr << "Packet arrived from" << inet_ntoa(addr.sin_addr)<< ": " << ntohs(other.sin_port) << endl;
		// cerr << "Received:" << endl;
		received.dump();

		clientRecvWindow = received.recvWindow;

		if (!packetsSent) {
			// Set receive timeout of 0.5s
			// Only want to run this code once
			timeval recvTimeval;
			recvTimeval.tv_sec = 0;
			recvTimeval.tv_usec = TIMEOUT * 1000;
			setSocketTimeout(sockfd, recvTimeval);
		}


		//Send SYN-ACK if client is trying to set up connection

		switch (received.flags) {
		case SYN_FLAG:
			printRecv(received.ackNum);
		    if (hasReceivedSyn) {
				// cerr << "Got another SYN, sending SYN-ACK\n";
			}
		    flagsToSend ="SA";
			printSend("SYN", seqToSend, DATA_SIZE, DATA_SIZE, hasReceivedSyn);
		    hasReceivedSyn = true;

		    break;

		case SYN_FLAG | ACK_FLAG:
		    // cerr << "Both SYN and ACK were set by client\n";
		    //exit(1);
		    break;

		case ACK_FLAG:
			printRecv(received.ackNum);
		    if (!hasReceivedSyn) {
				// cerr << "ACK before handshake\n";
				break;
			}
		    flagsToSend = "A";
		    //Time to start sending the file back
		    sendFile = true;

		    break;

		default:
		    // cerr << "Incorrect flags set\n";
		    break;
		}

		// if we're done handshake and are ready to send the file now
		if (sendFile) {
			break;
		}

		ackToSend = incSeqNum(received.seqNum, 1);
		toSend = TcpMessage(seqToSend, ackToSend, clientRecvWindow, flagsToSend);
		toSend.sendto(sockfd, &other, other_length);
		// cerr << "Handshake: sending packet\n";
		toSend.dump();
	}

	char filebuf[DATA_SIZE];
	wantedFile.open(filename);
	if (!wantedFile) {
		perror("fstream open");
		exit(1);
	}

	// if the client sent data, increment ack by that number
	size_t recvLength = received.data.length();
	ackToSend = incSeqNum(received.seqNum, recvLength);
	// increment our sequence number by 1
	seqToSend = incSeqNum(seqToSend, 1);

	double cwnd = DATA_SIZE;
	uint16_t cwndBot = seqToSend;
	uint16_t cwndTop = seqToSend + cwnd;
	bool useSlowStart = true;
	int filepkts = 0;

	uint16_t lastAckExpected = BAD_SEQ_NUM;
	lastAckRecvd = seqToSend;



	/* data */

	while(true) {

		// update receiver/congestion windows
		rwndBot = lastAckRecvd;
		rwndTop = incSeqNum(rwndBot, clientRecvWindow);
		cwndBot = lastAckRecvd;
		cwndTop = incSeqNum(cwndBot, cwnd);

		// remove old packets that are outside receiver window
		auto it = packetsInWindow.begin(); // iterator
		while (it != packetsInWindow.end()) {
			auto curr = it;
			it++;
			uint16_t currSeq = curr->second.seqNum;
			if (!inWindow(currSeq, rwndBot, rwndTop)) {
				packetsInWindow.erase(curr);
			}
		}

		// create new packets
		uint16_t seqToSendEnd = incSeqNum(seqToSend, DATA_SIZE);
		// stop if next packet will be outside rwnd or cwnd
		while (inWindow(seqToSendEnd, cwndBot, cwndTop) &&
			   lastAckExpected == BAD_SEQ_NUM) {

			memset(filebuf, 0, DATA_SIZE);
			wantedFile.read(filebuf, DATA_SIZE);
			streamsize dataSize = wantedFile.gcount();
			toSend = TcpMessage(seqToSend, ackToSend, clientRecvWindow, "A");
			toSend.data = string(filebuf, dataSize);

			// if already in map, we're retransmitting
			bool isRetransmit = packetsInWindow.count(toSend.seqNum);
			// store packet in case retransmission needed
			packetsInWindow[toSend.seqNum] = toSend;
			timestamps[toSend.seqNum] = now();

			seqToSend = incSeqNum(seqToSend, dataSize);
			seqToSendEnd = incSeqNum(seqToSend, DATA_SIZE);

			// send packet
			if (dataSize > 0) {
				printSend("data", toSend.seqNum, cwnd, ssThresh, isRetransmit);
				// cerr << "sending packet " << filepkts << " of file: " << endl;
				toSend.dump();
				toSend.sendto(sockfd, &other, other_length);
				filepkts++;
			}
			// no more data; this packet's seq should be the last ACK
			else {
				lastAckExpected = seqToSend;
				break;
			}

		}

	    int r = getAcks(sockfd, &other, other_length);

		// a old packet timed out; resend it
		if (r == RECV_TIMED_OUT_ALREADY) {
			// no packets in window
			if (timedOutSeq == BAD_SEQ_NUM) {
				// cerr << "!!!!!!!!!!!! no packets in window" << endl;
			}

			// cerr << "retransmit (timed out already)" << endl;
			packetsInWindow[timedOutSeq].dump();
			packetsInWindow[timedOutSeq].sendto(sockfd, &other, other_length);
			timestamps[timedOutSeq] = now();
		}

		// no ACK received
		else if (r == RECV_TIMEOUT) {
			// retransmit last ACKed packet
			if (packetsInWindow.count(lastAckRecvd) == 0) {
				// cerr << "!!!!! packet not in window: " << lastAckRecvd << endl;
				// cerr << "!!!!! should never reach this" << endl;
				for (auto i : packetsInWindow) {
					// cerr << i.first << " ";
				}
				// cerr << endl;
				if (packetsInWindow.size() == 0) {
					// cerr << "packetsInWindow is empty!" << endl;
				}
				continue;
			}
			// cerr << "retransmitting (timeout)" << endl;
			printSend("data", packetsInWindow[lastAckRecvd].seqNum, cwnd, ssThresh, true);
			packetsInWindow[lastAckRecvd].dump();
			packetsInWindow[lastAckRecvd].sendto(sockfd, &other, other_length);
			timestamps[lastAckRecvd] = now();

			// update congestion control
			ssThresh = cwnd / 2;
			if (ssThresh < DATA_SIZE) {
				ssThresh = DATA_SIZE;
			}
			cwnd = DATA_SIZE;
			useSlowStart = true;
		}
		// got an ACK
		else {
			// check if we are done
			// this can only be true after the last packet is sent; otherwise,
			// lastAckExpected has a impossible value
			if (lastAckRecvd == lastAckExpected) {
				break;
			}

			// fast retransmit
			if (lastAckRecvd == previousAck) {
				acksInARow++; 
				if (acksInARow == 4) {
					// cerr << "retransmitting (fast retransmit)" << lastAckRecvd << endl;
					if (packetsInWindow.count(lastAckRecvd) == 0) {
						// cerr << "!!!!! packet not in window: " << lastAckRecvd << endl;
						// cerr << "!!!!! should never reach this" << endl;
						for (auto i : packetsInWindow) {
							// cerr << i.first << " ";
						}
						// cerr << endl;
						if (packetsInWindow.size() == 0) {
							// cerr << "packetsInWindow is empty!" << endl;
						}
						continue;
					}
					printSend("data", packetsInWindow[lastAckRecvd].seqNum, cwnd, ssThresh, true);
					packetsInWindow[lastAckRecvd].dump();
					packetsInWindow[lastAckRecvd].sendto(sockfd, &other, other_length);
					timestamps[lastAckRecvd] = now();
					acksInARow = 0;
					//fast recovery
					//should actually be same logic as timeout retransmit, just without setting useSlowStart
					ssThresh = (cwnd/2 < DATA_SIZE) ? DATA_SIZE : cwnd/2;
					cwnd = ssThresh > clientRecvWindow ? clientRecvWindow : ssThresh;
					useSlowStart = false;
					previousAck = lastAckRecvd;
					continue;
					
				}
			}
			previousAck = lastAckRecvd;
			
			// check if all packets in window were cumulatively ACKed
			if (lastAckRecvd == seqToSend) {
				// cerr << "!!!!!!!!! all packets ACKed" << endl;
			}

			// update congestion control
			if (useSlowStart) {
				cwnd = cwnd + DATA_SIZE;
			}
			else {
				cwnd = cwnd + DATA_SIZE * DATA_SIZE /cwnd;
			}
			if (cwnd > clientRecvWindow) {
				cwnd = clientRecvWindow;
			}
			if (cwnd >= ssThresh) {
				useSlowStart = false;
			}
		}
	}


	// cerr << "out of loop\n";


	/* FIN */

	// reset to 0.5s timeout
	timeval recvTimeval;
	recvTimeval.tv_sec = 0;
	recvTimeval.tv_usec = TIMEOUT * 1000;
	setSocketTimeout(sockfd, recvTimeval);

	bool hasReceivedFin = false;
	bool hasReceivedFinAck = false;
	bool hasSentFin = false;
	bool hasSentAckFin = false;
	int timedWaitTimer = 2 * MAX_SEG_LIFETIME; // milliseconds to wait before closing

	while (timedWaitTimer > 0) {

		/* send FIN if no FIN-ACK received yet */
		if (!hasReceivedFinAck) {
			flagsToSend = "F";
			// Sequence number shouldn't change since we already increased by total data size
			ackToSend = 0; // ACK is invalid this packet
			toSend = TcpMessage(seqToSend, ackToSend, clientRecvWindow, flagsToSend);
			toSend.sendto(sockfd, &other, other_length);
			printSend("FIN", seqToSend, DATA_SIZE, ssThresh, hasSentFin);
			// cerr << "Sending FIN\n";
			toSend.dump();
			hasSentFin = true;
		}

		/* timed wait timer counts down after FIN received */
		if (hasReceivedFin) {
			timedWaitTimer -= TIMEOUT; // wait TIMEOUT msec each loop
		}

		int r = received.recvfrom(sockfd, &other, other_length);
		if (r == RECV_TIMEOUT) {
			// cerr << "Timeout while waiting for FIN-ACK/FIN\n";
			continue;
		}
		clientRecvWindow = received.recvWindow;

		switch(received.flags) {
			// FIN-ACK
			case FIN_FLAG | ACK_FLAG:
				printRecv(received.ackNum);
				// cerr << "Received FIN-ACK\n";
				hasReceivedFinAck = true;
				break;

			// FIN
			case FIN_FLAG:
				printRecv(received.ackNum);
				// cerr << "Received FIN\n";

				flagsToSend = "A";// this is "FIN-ACK" but without FIN flag
				seqToSend = incSeqNum(seqToSend, 1);// increase sequence number by 1
				ackToSend = incSeqNum(received.seqNum, 1); // increase ack by 1
				toSend = TcpMessage(seqToSend, ackToSend, clientRecvWindow, flagsToSend);
				toSend.sendto(sockfd, &other, other_length);
				printSend("data", seqToSend, DATA_SIZE, ssThresh, hasSentAckFin);
				// cerr << "Sending ACK of FIN\n";
				toSend.dump();
				// cerr << "Server received FIN; starting timed wait..." << endl;
				hasReceivedFinAck = true; // assume that client got a FIN
				hasReceivedFin = true;
				hasSentAckFin = true;
				break;

			default:
				// cerr << "Received packet wasn't FIN-ACK or FIN!\n";
				//exit(1);
				break;
		}
		received.dump();
	}

	// cerr << "Shouldn't receive anything else from client now\n";

	close(sockfd);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8b8, %rsp            # imm = 0x8B8
movq %rsi, %rbx
cmpl $0x3, %edi
jne 0x339f
movq 0x8(%rbx), %rsi
leaq 0x278(%rsp), %rdi
leaq 0x4b0(%rsp), %rdx
callq 0x44c0
movq 0x10(%rbx), %rsi
leaq 0x258(%rsp), %rdi
leaq 0x4b0(%rsp), %rdx
callq 0x44c0
xorl %edi, %edi
callq 0x21a0
movl %eax, %edi
callq 0x21b0
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x2070
cmpl $-0x1, %eax
je 0x413d
movl %eax, %r12d
leaq 0x214(%rsp), %rcx
movl $0x1, (%rcx)
movl $0x1, %ebx
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x22e0
cmpl $-0x1, %eax
je 0x4153
movw $0x2, 0x298(%rsp)
movq 0x278(%rsp), %rbx
callq 0x2030
movq %rax, %r14
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x4b0(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x2240
cmpq %rbx, (%r15)
je 0x417a
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x4186
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x4186
testl %ecx, %ecx
jne 0x302d
movl %ebp, (%r14)
rolw $0x8, %ax
leaq 0x298(%rsp), %rsi
movw %ax, 0x2(%rsi)
movl $0x0, 0x4(%rsi)
movq $0x0, 0x8(%rsi)
movl %r12d, %edi
movl $0x10, %edx
callq 0x2060
cmpl $-0x1, %eax
je 0x4164
leaq 0xc0(%rsp), %rdi
callq 0x2738
leaq 0x30(%rsp), %rdi
callq 0x2738
callq 0x2090
movl %eax, %ebx
leaq 0x2a8(%rsp), %rdi
callq 0x21e0
movl %r12d, 0x8(%rsp)
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2001(%rip), %rdx      # 0x50a6
leaq 0x88(%rsp), %rdi
movq %rdx, %rsi
callq 0x2992
movslq %ebx, %rax
imulq $-0x77777777, %rax, %rcx # imm = 0x88888889
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
shrl $0xe, %ecx
addl %edx, %ecx
imull $0x7800, %ecx, %ecx     # imm = 0x7800
subl %ecx, %eax
xorl %r14d, %r14d
leaq 0xb0(%rsp), %r12
movzwl %ax, %eax
movl %eax, 0x10(%rsp)
xorl %ebx, %ebx
leaq 0xc0(%rsp), %rdi
movl 0x8(%rsp), %esi
movq %r12, %rdx
movl $0x10, %ecx
callq 0x2894
cmpl $0x2, %eax
jne 0x31a3
testb $0x1, %bl
je 0x3397
leaq 0x248(%rsp), %r15
movq %r15, 0x238(%rsp)
leaq 0x238(%rsp), %r13
movq %r13, %rdi
leaq 0x1f91(%rip), %rsi      # 0x50c9
leaq 0x1f8d(%rip), %rdx      # 0x50cc
callq 0x2992
movzwl 0x30(%rsp), %esi
movq %r13, %rdi
movl $0x400, %edx            # imm = 0x400
movl $0x400, %ecx            # imm = 0x400
movl $0x1, %r8d
callq 0x2c34
movq 0x238(%rsp), %rdi
cmpq %r15, %rdi
je 0x317e
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x30(%rsp), %rdi
movl 0x8(%rsp), %esi
movq %r12, %rdx
movl $0x10, %ecx
callq 0x2846
leaq 0x30(%rsp), %rdi
callq 0x28fa
jmp 0x3397
leaq 0xc0(%rsp), %rdi
callq 0x28fa
movzwl 0xc4(%rsp), %eax
movw %ax, 0x4ff5(%rip)       # 0x81b4
testl %r14d, %r14d
jne 0x31d4
movl $0x7a120, %edx          # imm = 0x7A120
movl 0x8(%rsp), %edi
xorl %esi, %esi
callq 0x2b07
movzwl 0xc6(%rsp), %eax
cmpl $0x4, %eax
je 0x328c
cmpl $0x2, %eax
jne 0x32a2
movzwl 0xc2(%rsp), %edi
callq 0x2bec
movq 0x90(%rsp), %rdx
movl $0x2, %r8d
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
leaq 0x1eb3(%rip), %rcx      # 0x50cd
callq 0x2280
leaq 0x228(%rsp), %r15
movq %r15, 0x218(%rsp)
leaq 0x218(%rsp), %r13
movq %r13, %rdi
leaq 0x1e88(%rip), %rsi      # 0x50c9
leaq 0x1e84(%rip), %rdx      # 0x50cc
callq 0x2992
movzbl %bl, %r8d
andl $0x1, %r8d
movq %r13, %rdi
movl 0x10(%rsp), %esi
movl $0x400, %edx            # imm = 0x400
movl $0x400, %ecx            # imm = 0x400
callq 0x2c34
movq 0x218(%rsp), %rdi
movb $0x1, %bl
cmpq %r15, %rdi
je 0x32a2
movq 0x228(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x32a2
movzwl 0xc2(%rsp), %edi
callq 0x2bec
testb $0x1, %bl
jne 0x33e5
movzwl 0xc0(%rsp), %edi
movl $0x1, %esi
callq 0x2a28
movl %eax, %r13d
movzwl 0x4ef5(%rip), %r15d     # 0x81b4
leaq 0x200(%rsp), %rax
movq %rax, 0x1f0(%rsp)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1f0(%rsp), %rbp
movq %rbp, %rdi
callq 0x28fc
movzwl %r13w, %edx
movzwl %r15w, %ecx
leaq 0x4b0(%rsp), %rdi
movl 0x10(%rsp), %esi
movq %rbp, %r8
callq 0x255c
movq 0x4b0(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x4b8(%rsp), %rsi
callq 0x2210
movq 0x4b8(%rsp), %rdi
leaq 0x4c8(%rsp), %rax
cmpq %rax, %rdi
je 0x3352
movq 0x4c8(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x3377
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x30(%rsp), %rdi
movl 0x8(%rsp), %esi
movq %r12, %rdx
movl $0x10, %ecx
callq 0x2846
leaq 0x30(%rsp), %rdi
callq 0x28fa
decl %r14d
jmp 0x30eb
movq 0x4c4a(%rip), %r14      # 0x7ff0
leaq 0x1cf2(%rip), %rsi      # 0x509f
movl $0x7, %edx
movq %r14, %rdi
callq 0x21f0
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x40d9
movq %rbx, %rdi
callq 0x20e0
movq 0x4c1b(%rip), %rdi      # 0x7ff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x21f0
jmp 0x40f1
leaq 0x88(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x1cd6(%rip), %rcx      # 0x50ce
movl $0x1, %r8d
xorl %esi, %esi
callq 0x2280
leaq 0x2a8(%rsp), %rdi
leaq 0x258(%rsp), %rsi
movl $0x8, %edx
callq 0x2180
movq 0x2a8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x2c8(%rsp,%rax)
jne 0x4192
movzwl 0xd0(%rsp), %esi
movzwl 0xc0(%rsp), %edi
callq 0x2a28
movl %eax, %ebp
movl 0x10(%rsp), %edi
movl $0x1, %esi
callq 0x2a28
movw %ax, 0x4d4d(%rip)       # 0x81b2
leaq 0x68(%rsp), %r12
movw $0x7800, %cx            # imm = 0x7800
movl %ecx, 0x28(%rsp)
movsd 0x1bd6(%rip), %xmm0     # 0x5050
movb $0x1, %cl
movl %ecx, 0x1c(%rsp)
movw $0xd903, %r13w          # imm = 0xD903
movzwl %bp, %ecx
movl %ecx, 0xec(%rsp)
movsd %xmm0, 0x20(%rsp)
movl %eax, %ebp
movw %ax, 0x4d18(%rip)       # 0x81b6
movzwl 0x4d0f(%rip), %esi      # 0x81b4
movzwl %ax, %edi
callq 0x2a28
movw %ax, 0x4d04(%rip)       # 0x81b8
cvttsd2si 0x20(%rsp), %eax
movzwl 0x4cf1(%rip), %edi      # 0x81b2
movl %eax, 0x2c(%rsp)
movzwl %ax, %esi
movl %edi, 0x10(%rsp)
callq 0x2a28
movl %eax, %ebx
movq 0x4cf6(%rip), %r15      # 0x81d0
testq %r15, %r15
je 0x3515
movq (%r15), %r14
movzwl 0x10(%r15), %edi
movzwl 0x4cc8(%rip), %esi      # 0x81b6
movzwl 0x4cc3(%rip), %edx      # 0x81b8
callq 0x2a3f
testb %al, %al
jne 0x350d
leaq 0x4cbb(%rip), %rdi      # 0x81c0
movq %r15, %rsi
callq 0x48d2
movq %r14, %r15
testq %r14, %r14
jne 0x34df
movzwl %bp, %edi
movl $0x400, %esi            # imm = 0x400
callq 0x2a28
movl %eax, %r15d
movzwl 0x28(%rsp), %eax
movl %eax, 0xc(%rsp)
movzwl %bx, %eax
movl %eax, 0xa8(%rsp)
movzwl %r15w, %edi
movl 0x10(%rsp), %esi
movl 0xa8(%rsp), %edx
callq 0x2a3f
movzwl %r13w, %ecx
cmpl $0xd903, %ecx           # imm = 0xD903
sete %cl
andb %cl, %al
cmpb $0x1, %al
jne 0x37b9
movl $0x400, %edx            # imm = 0x400
leaq 0x4b0(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2100
movl $0x400, %edx            # imm = 0x400
leaq 0x2a8(%rsp), %rdi
movq %rbx, %rsi
callq 0x2220
movq 0x2b0(%rsp), %r14
movzwl 0x4c16(%rip), %ebx      # 0x81b4
leaq 0x1e0(%rsp), %rax
movq %rax, 0x1d0(%rsp)
leaq 0x1d0(%rsp), %r15
movq %r15, %rdi
leaq 0x1b0e(%rip), %rsi      # 0x50ce
leaq 0x1b08(%rip), %rdx      # 0x50cf
callq 0x2992
movzwl %bp, %ebp
movzwl %bx, %ecx
leaq 0x58(%rsp), %rdi
movl %ebp, %esi
movl 0xec(%rsp), %edx
movq %r15, %r8
callq 0x255c
movq 0x58(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x2210
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x361d
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x3642
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %r12, %rbx
movq %r12, 0x58(%rsp)
leaq (%rsp,%r14), %rdx
addq $0x4b0, %rdx            # imm = 0x4B0
leaq 0x58(%rsp), %r15
movq %r15, %rdi
leaq 0x4b0(%rsp), %rsi
callq 0x2992
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x2210
movq 0x58(%rsp), %rdi
cmpq %rbx, %rdi
je 0x368e
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x4b2b(%rip), %rdi      # 0x81c0
leaq 0x30(%rsp), %rsi
callq 0x498c
movq %rax, %rbx
leaq 0x4b17(%rip), %rdi      # 0x81c0
leaq 0x30(%rsp), %rsi
callq 0x49ee
movq 0x30(%rsp), %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, %rdi
leaq 0x38(%rsp), %rsi
callq 0x20f0
callq 0x2b3b
movq %rax, %r15
movq %rdx, %r13
leaq 0x4b1a(%rip), %rdi      # 0x81f8
leaq 0x30(%rsp), %rsi
callq 0x4616
movq %r15, (%rax)
movq %r13, 0x8(%rax)
movzwl %r14w, %esi
movl %ebp, %edi
callq 0x2a28
movl %eax, %ebp
movzwl %ax, %edi
movl $0x400, %esi            # imm = 0x400
callq 0x2a28
testq %r14, %r14
jle 0x37b6
movl %eax, %r15d
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
leaq 0x1b0(%rsp), %r14
movq %r14, %rdi
leaq 0x1963(%rip), %rsi      # 0x509a
leaq 0x1960(%rip), %rdx      # 0x509e
callq 0x2992
xorl %r8d, %r8d
testq %rbx, %rbx
setne %r8b
movzwl 0x30(%rsp), %esi
movq %r14, %rdi
movl 0x2c(%rsp), %edx
movl 0xc(%rsp), %ecx
callq 0x2c34
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x3787
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x30(%rsp), %rdi
callq 0x28fa
movw $0xd903, %r13w          # imm = 0xD903
leaq 0x30(%rsp), %rdi
movl 0x8(%rsp), %esi
leaq 0xb0(%rsp), %rdx
movl $0x10, %ecx
callq 0x2846
jmp 0x3538
movl %ebp, %r13d
movl 0x8(%rsp), %ebx
movl %ebx, %edi
leaq 0xb0(%rsp), %rsi
movl $0x10, %edx
callq 0x2d38
cmpl $0x2, %eax
je 0x384e
cmpl $0x3, %eax
jne 0x3994
leaq 0x49da(%rip), %rdi      # 0x81c0
leaq 0x4a43(%rip), %rsi      # 0x8230
callq 0x49ee
movq %rax, %rdi
callq 0x28fa
leaq 0x49bf(%rip), %rdi      # 0x81c0
leaq 0x4a28(%rip), %rsi      # 0x8230
callq 0x49ee
movq %rax, %rdi
movl %ebx, %esi
leaq 0xb0(%rsp), %rdx
movl $0x10, %ecx
callq 0x2846
callq 0x2b3b
movq %rax, %rbx
movq %rdx, %r14
leaq 0x49c2(%rip), %rdi      # 0x81f8
leaq 0x49f3(%rip), %rsi      # 0x8230
callq 0x4616
movq %rbx, (%rax)
movq %r14, 0x8(%rax)
jmp 0x3b85
leaq 0x496b(%rip), %rdi      # 0x81c0
leaq 0x4956(%rip), %rsi      # 0x81b2
callq 0x498c
testq %rax, %rax
je 0x3b91
leaq 0x120(%rsp), %rax
movq %rax, 0x110(%rsp)
leaq 0x110(%rsp), %rdi
leaq 0x1811(%rip), %rsi      # 0x509a
leaq 0x180e(%rip), %rdx      # 0x509e
callq 0x2992
leaq 0x4924(%rip), %rdi      # 0x81c0
leaq 0x490f(%rip), %rsi      # 0x81b2
callq 0x49ee
movzwl (%rax), %esi
leaq 0x110(%rsp), %rdi
movl 0x2c(%rsp), %edx
movl 0xc(%rsp), %ecx
movl $0x1, %r8d
callq 0x2c34
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x38eb
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x48ce(%rip), %rdi      # 0x81c0
leaq 0x48b9(%rip), %rsi      # 0x81b2
callq 0x49ee
movq %rax, %rdi
callq 0x28fa
leaq 0x48b3(%rip), %rdi      # 0x81c0
leaq 0x489e(%rip), %rsi      # 0x81b2
callq 0x49ee
movq %rax, %rdi
movl %ebx, %esi
leaq 0xb0(%rsp), %rdx
movl $0x10, %ecx
callq 0x2846
callq 0x2b3b
movq %rax, %rbx
movq %rdx, %r14
leaq 0x48b6(%rip), %rdi      # 0x81f8
leaq 0x4869(%rip), %rsi      # 0x81b2
callq 0x4616
movq %rbx, (%rax)
movq %r14, 0x8(%rax)
movsd 0x20(%rsp), %xmm0
mulsd 0x16f5(%rip), %xmm0     # 0x5058
cvttsd2si %xmm0, %ecx
movzwl %cx, %eax
cmpl $0x401, %eax            # imm = 0x401
movl $0x400, %eax            # imm = 0x400
cmovbl %eax, %ecx
movl %ecx, 0x28(%rsp)
movb $0x1, %al
movl %eax, 0x1c(%rsp)
movsd 0x16c7(%rip), %xmm0     # 0x5050
movsd %xmm0, 0x20(%rsp)
jmp 0x3b85
movzwl 0x4817(%rip), %eax      # 0x81b2
cmpw %r13w, %ax
je 0x3c43
cmpw 0x47f6(%rip), %ax       # 0x81a2
jne 0x3b2b
movzwl 0x4879(%rip), %ecx      # 0x8232
incl %ecx
movw %cx, 0x4870(%rip)       # 0x8232
cmpw $0x4, %cx
jne 0x3b2b
leaq 0x47ed(%rip), %rdi      # 0x81c0
leaq 0x47d8(%rip), %rsi      # 0x81b2
callq 0x498c
testq %rax, %rax
je 0x3bea
leaq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0xf0(%rsp), %rdi
leaq 0x1693(%rip), %rsi      # 0x509a
leaq 0x1690(%rip), %rdx      # 0x509e
callq 0x2992
leaq 0x47a6(%rip), %rdi      # 0x81c0
leaq 0x4791(%rip), %rsi      # 0x81b2
callq 0x49ee
movzwl (%rax), %esi
leaq 0xf0(%rsp), %rdi
movl 0x2c(%rsp), %edx
movl 0xc(%rsp), %ecx
movl $0x1, %r8d
callq 0x2c34
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x3a69
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x4750(%rip), %rdi      # 0x81c0
leaq 0x473b(%rip), %rsi      # 0x81b2
callq 0x49ee
movq %rax, %rdi
callq 0x28fa
leaq 0x4735(%rip), %rdi      # 0x81c0
leaq 0x4720(%rip), %rsi      # 0x81b2
callq 0x49ee
movq %rax, %rdi
movl %ebx, %esi
leaq 0xb0(%rsp), %rdx
movl $0x10, %ecx
callq 0x2846
callq 0x2b3b
movq %rax, %rbx
movq %rdx, %r14
leaq 0x4738(%rip), %rdi      # 0x81f8
leaq 0x46eb(%rip), %rsi      # 0x81b2
callq 0x4616
movq %rbx, (%rax)
movq %r14, 0x8(%rax)
movsd 0x20(%rsp), %xmm1
mulsd 0x1577(%rip), %xmm1     # 0x5058
movsd 0x1567(%rip), %xmm0     # 0x5050
maxsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movzwl 0x46bc(%rip), %eax      # 0x81b4
cmpw %cx, %ax
movl %ecx, 0x28(%rsp)
cmovbl %eax, %ecx
movzwl %cx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%rsp)
movw $0x0, 0x4717(%rip)      # 0x8232
movzwl 0x4690(%rip), %eax      # 0x81b2
movw %ax, 0x4679(%rip)       # 0x81a2
jmp 0x3b7d
movw %ax, 0x4670(%rip)       # 0x81a2
movsd 0x1516(%rip), %xmm0     # 0x5050
testb $0x1, 0x1c(%rsp)
jne 0x3b4f
movsd 0x1517(%rip), %xmm0     # 0x5060
divsd 0x20(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
addsd %xmm0, %xmm1
movzwl 0x4654(%rip), %eax      # 0x81b4
cvtsi2sd %eax, %xmm2
minsd %xmm1, %xmm2
xorps %xmm0, %xmm0
cvtsi2sdl 0xc(%rsp), %xmm0
movsd %xmm2, 0x20(%rsp)
ucomisd %xmm0, %xmm2
jb 0x3b85
movl $0x0, 0x1c(%rsp)
movzwl 0x4626(%rip), %eax      # 0x81b2
jmp 0x3497
movq 0x4638(%rip), %rbx      # 0x81d0
testq %rbx, %rbx
je 0x3b85
movzwl 0x8(%rbx), %eax
movw %ax, 0x58(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq 0x78(%rsp), %r14
movq %r14, 0x68(%rsp)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x28fc
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x3be5
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21d0
movq (%rbx), %rbx
jmp 0x3b98
movq 0x45df(%rip), %rbx      # 0x81d0
testq %rbx, %rbx
je 0x3b85
movzwl 0x8(%rbx), %eax
movw %ax, 0x58(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq 0x78(%rsp), %r14
movq %r14, 0x68(%rsp)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x28fc
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x3c3e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21d0
movq (%rbx), %rbx
jmp 0x3bf1
movl $0x7a120, %edx          # imm = 0x7A120
movl %ebx, %edi
xorl %esi, %esi
callq 0x2b07
movl $0x1d4c0, %ebx          # imm = 0x1D4C0
movq $0x0, 0x10(%rsp)
movq $0x0, 0xa8(%rsp)
xorl %r13d, %r13d
testb $0x1, %r13b
jne 0x3dee
movq 0x90(%rsp), %rdx
movl $0x1, %r8d
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
leaq 0x1446(%rip), %rcx      # 0x50dd
callq 0x2280
movzwl 0x4510(%rip), %r15d     # 0x81b4
leaq 0x1a0(%rsp), %rax
movq %rax, 0x190(%rsp)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
leaq 0x190(%rsp), %r12
movq %r12, %rdi
callq 0x28fc
movzwl %bp, %r14d
movzwl %r15w, %ecx
leaq 0x58(%rsp), %rdi
movl %r14d, %esi
xorl %edx, %edx
movq %r12, %r8
callq 0x255c
movq 0x58(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x2210
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x3d26
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x3d4b
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x30(%rsp), %rdi
movl 0x8(%rsp), %esi
leaq 0xb0(%rsp), %rdx
movl $0x10, %ecx
callq 0x2846
leaq 0x180(%rsp), %rax
movq %rax, 0x170(%rsp)
leaq 0x170(%rsp), %r15
movq %r15, %rdi
leaq 0x1357(%rip), %rsi      # 0x50df
leaq 0x1353(%rip), %rdx      # 0x50e2
callq 0x2992
movzbl 0xa8(%rsp), %r8d
andl $0x1, %r8d
movq %r15, %rdi
movl %r14d, %esi
movl $0x400, %edx            # imm = 0x400
movl 0xc(%rsp), %ecx
callq 0x2c34
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x3dda
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x21d0
movb $0x1, %al
movq %rax, 0xa8(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x28fa
leal -0x1f4(%rbx), %eax
testb $0x1, 0x10(%rsp)
cmovnel %eax, %ebx
leaq 0xc0(%rsp), %rdi
movl 0x8(%rsp), %esi
leaq 0xb0(%rsp), %rdx
movl $0x10, %ecx
callq 0x2894
cmpl $0x2, %eax
je 0x4014
movzwl 0xc4(%rsp), %eax
movw %ax, 0x4382(%rip)       # 0x81b4
movzwl 0xc6(%rsp), %eax
cmpl $0x1, %eax
je 0x3e5d
cmpl $0x5, %eax
jne 0x4007
movb $0x1, %r13b
movzwl 0xc2(%rsp), %edi
callq 0x2bec
jmp 0x4007
movzwl 0xc2(%rsp), %edi
callq 0x2bec
movq 0x90(%rsp), %rdx
movl $0x1, %r8d
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
leaq 0x1245(%rip), %rcx      # 0x50ce
callq 0x2280
movzwl %bp, %edi
movl $0x1, %esi
callq 0x2a28
movl %eax, %ebp
movzwl 0xc0(%rsp), %edi
movl $0x1, %esi
callq 0x2a28
movl %eax, %r13d
leaq 0x58(%rsp), %r14
movzwl 0x42f5(%rip), %r15d     # 0x81b4
leaq 0x160(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
leaq 0x150(%rsp), %r12
movq %r12, %rdi
callq 0x28fc
movzwl %bp, %eax
movzwl %r13w, %edx
movzwl %r15w, %ecx
movl %eax, %r15d
movq %r14, %rdi
movl %eax, %esi
movq %r12, %r8
callq 0x255c
movq 0x58(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x2210
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x3f42
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x3f67
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x30(%rsp), %rdi
movl 0x8(%rsp), %esi
leaq 0xb0(%rsp), %rdx
movl $0x10, %ecx
callq 0x2846
leaq 0x140(%rsp), %rax
movq %rax, 0x130(%rsp)
leaq 0x130(%rsp), %r14
movq %r14, %rdi
leaq 0x10f6(%rip), %rsi      # 0x509a
leaq 0x10f3(%rip), %rdx      # 0x509e
callq 0x2992
movzbl 0x10(%rsp), %r8d
andl $0x1, %r8d
movq %r14, %rdi
movl %r15d, %esi
movl $0x400, %edx            # imm = 0x400
movl 0xc(%rsp), %ecx
callq 0x2c34
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x3ff3
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x30(%rsp), %rdi
callq 0x28fa
movb $0x1, %al
movq %rax, 0x10(%rsp)
movb $0x1, %r13b
leaq 0xc0(%rsp), %rdi
callq 0x28fa
testl %ebx, %ebx
jg 0x3c6e
movl 0x8(%rsp), %edi
callq 0x2300
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x404a
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x2a8(%rsp), %rdi
callq 0x2080
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4072
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4093
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21d0
xorl %ebx, %ebx
leaq 0x268(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40b6
movq 0x268(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x288(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4129
movq 0x288(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x4129
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x22b0
movq 0x3ef8(%rip), %rbx      # 0x7ff0
leaq 0xfa8(%rip), %rsi       # 0x50a7
movl $0x15, %edx
movq %rbx, %rdi
callq 0x21f0
leaq 0x4b0(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8b8, %rsp            # imm = 0x8B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf79(%rip), %rdi       # 0x50bd
callq 0x2170
movl $0x1, %ebx
jmp 0x4095
leaq 0xee4(%rip), %rdi       # 0x503e
callq 0x2170
jmp 0x4095
leaq 0xf59(%rip), %rdi       # 0x50c4
callq 0x2170
movl $0x2, %ebx
jmp 0x4095
leaq 0xf62(%rip), %rdi       # 0x50e3
callq 0x2110
leaq 0xf56(%rip), %rdi       # 0x50e3
callq 0x2250
callq 0x235f
jmp 0x43f9
jmp 0x43f9
jmp 0x43f9
jmp 0x43f9
movq %rax, %rbx
jmp 0x4421
movq %rax, %rbx
jmp 0x442e
movq %rax, %rbx
jmp 0x4449
movq %rax, %rbx
jmp 0x446a
movq %rax, %rbx
jmp 0x448b
jmp 0x43f9
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x446a
movl %ebp, (%r14)
jmp 0x446a
jmp 0x43f9
movq %rax, %rbx
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x43fc
movq 0x140(%rsp), %rsi
jmp 0x43e9
jmp 0x43f9
movq %rax, %rbx
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x43fc
movq 0x160(%rsp), %rsi
jmp 0x43e9
jmp 0x43f9
jmp 0x43f9
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x43fc
movq 0x100(%rsp), %rsi
jmp 0x43e9
jmp 0x43f9
jmp 0x43f9
movq %rax, %rbx
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x43fc
movq 0x1a0(%rsp), %rsi
jmp 0x43e9
movq %rax, %rbx
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x43fc
movq 0x180(%rsp), %rsi
jmp 0x43e9
jmp 0x43f9
jmp 0x43f9
movq %rax, %rbx
movq 0x218(%rsp), %rdi
cmpq %r15, %rdi
je 0x43fc
movq 0x228(%rsp), %rsi
jmp 0x43e9
jmp 0x43f9
movq %rax, %rbx
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x43fc
movq 0x120(%rsp), %rsi
jmp 0x43e9
jmp 0x43f9
jmp 0x43f9
movq %rax, %rbx
movq 0x238(%rsp), %rdi
cmpq %r15, %rdi
je 0x43fc
movq 0x248(%rsp), %rsi
jmp 0x43e9
jmp 0x43f9
jmp 0x43f9
jmp 0x43f9
jmp 0x43f9
jmp 0x43f9
movq %rax, %rbx
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x43fc
movq 0x200(%rsp), %rsi
jmp 0x43e9
jmp 0x43f9
jmp 0x43f9
jmp 0x43f9
jmp 0x43f9
jmp 0x43f9
movq %rax, %rbx
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x43fc
movq 0x1c0(%rsp), %rsi
jmp 0x43e9
jmp 0x43f9
jmp 0x43f9
jmp 0x43f9
movq %rax, %rbx
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x43fc
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x43fc
jmp 0x43f9
jmp 0x43f9
jmp 0x43f9
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x4421
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x2a8(%rsp), %rdi
callq 0x2080
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4449
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x446a
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x268(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x448b
movq 0x268(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x288(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x44ac
movq 0x288(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22d0