// File: sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: SunwayMRHelper::runApplication(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
void SunwayMRHelper::runApplication(string filePath, bool localMode) {
	// run user application
	string targetHostsFileName = allHostsFileName;
	if (localMode) targetHostsFileName = localHostFileName;

	long appUID = getCurrentTime();
	int fileUID1 = appUID;
	int fileUID2 = appUID + 1;

	string appFileName = fileNameFromPath(filePath);
	string hostsFileName = "hostsFile.lst";

	stringstream filePath2;
	filePath2 << fileSaveDir << targetHostsFileName;

	stringstream fileInfo1, fileInfo2;
	fileInfo1 << fileUID1 << " " << appUID << " " << appFileName;
	fileInfo2 << fileUID2 << " " << appUID << " " << hostsFileName;

	string fileContent1, fileContent2;
	bool rd1 = readFile(filePath, fileContent1);
	if (!rd1) {
		stringstream error1;
		error1 << "SunwayMRHelper: unable to read file: " << filePath;
		Logging::logError(error1.str());
	}
	bool rd2 = readFile(filePath2.str(), fileContent2);
	if (!rd2) {
		stringstream error2;
		error2 << "SunwayMRHelper: unable to read file: " << filePath2.str();
		Logging::logError(error2.str());
	}


	if (!rd1 || !rd2) {
		exit(1);
	}

	// for all hosts in fileContent2
	stringstream ss(fileContent2);
	string line;
	vector<HostResource> tmp;

	bool sendWithFailure = false;
	while(std::getline(ss,line,'\n')){
		vector<string> v = splitString(line, ' ');
		if (v.size() >= 4) {
			string host = v[0];
			int threads = atoi(v[1].c_str());
			int memory = atoi(v[2].c_str());
			int port = atoi(v[3].c_str());
			HostResource hr = {
					host,
					threads,
					memory,
					port
			};
			tmp.push_back(hr);

			string msg1 = fileInfo1.str();
			string reply;
			// send file info 1
			bool sr = sendMessageForReply(host, port, FILE_INFO, msg1, reply);
			if(!sr) {
				sendWithFailure = true;
				stringstream err;
				err << "SunwayMRHelper: failed to send file info[1] to host: " << host << ", " << port << "; info:" << fileInfo1.str();
				Logging::logError(err.str());
			}

			string msg2 = fileInfo2.str();
			// send file info 2
			sr = sendMessageForReply(host, port, FILE_INFO, msg2, reply);
			if(!sr) {
				sendWithFailure = true;
				stringstream err;
				err << "SunwayMRHelper: failed to send file info[2] to host: " << host << ", " << port << "; info:" << fileInfo2.str();
				Logging::logError(err.str());
			}

			// send file content 1
			sr = sendMessageForReply(host, port, fileUID1, fileContent1, reply);
			if(!sr) {
				sendWithFailure = true;
				stringstream err;
				err << "SunwayMRHelper: failed to send file content[1] to host: " << host << ", " << port;
				Logging::logError(err.str());
			}

			// send file content 2
			sr = sendMessageForReply(host, port, fileUID2, fileContent2, reply);
			if(!sr) {
				sendWithFailure = true;
				stringstream err;
				err << "SunwayMRHelper: failed to send file content[2] to host: " << host << ", " << port;
				Logging::logError(err.str());
			}
		}
	}

	if(sendWithFailure) exit(1);

	Logging::logInfo("SunwayMRHelper: sending files succeeded.");
	Logging::logInfo("SunwayMRHelper: starting...");

	string appExecutableName = splitString(appFileName, '.')[0];

	string masterValue = masterAddr;
	if (localMode) masterValue = localAddr;
	stringstream masterInfo;
	masterInfo << "SunwayMRHelper: master is on: " << masterValue;
	Logging::logInfo(masterInfo.str());

	int appListenPort = randomValue(30001, 39999);

	stringstream appDirStream;
	appDirStream << fileSaveDir << appUID << "/";
	string appDir = appDirStream.str();
	stringstream startAppCmd;
	startAppCmd << CXX << " -O2 -g -Wall -fmessage-length=0 "
			<< appDir << appFileName
			<< " -o " << appDir << appExecutableName
			<< " -Itools -Iinclude -Iheaders -pthread -lstdc++ -lm " << endl;
	startAppCmd << appDir <<  appExecutableName << " "
			<< appDir << hostsFileName << " "
			<< masterValue << " " << appListenPort << endl;

	for(unsigned int i=0; i<tmp.size(); i++) {
		string msg = startAppCmd.str();
		sendMessage(tmp[i].host, tmp[i].listenPort, SHELL_COMMAND, msg);
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b10, %rsp           # imm = 0x1B10
movq %rsi, -0x1920(%rbp)
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1918(%rbp)
leaq -0x38(%rbp), %rdi
leaq 0x1a431(%rip), %rsi     # 0x254f8
callq 0x41a0
testb $0x1, -0x11(%rbp)
je 0xb0f7
leaq 0x1a3ff(%rip), %rsi     # 0x254d8
leaq -0x38(%rbp), %rdi
callq 0x4050
jmp 0xb0e4
jmp 0xb0f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc796
callq 0x56a0
movq -0x1920(%rbp), %rsi
movq %rax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x50(%rbp), %eax
incl %eax
movl %eax, -0x58(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4e80
jmp 0xb120
leaq -0x99(%rbp), %rdi
movq %rdi, -0x1928(%rbp)
callq 0x47a0
movq -0x1928(%rbp), %rdx
leaq 0xf3c6(%rip), %rsi      # 0x1a507
leaq -0x98(%rbp), %rdi
callq 0xe8d0
jmp 0xb14f
leaq -0x99(%rbp), %rdi
callq 0x4470
leaq -0x228(%rbp), %rdi
callq 0x4280
jmp 0xb169
leaq -0x218(%rbp), %rdi
leaq 0x1a341(%rip), %rsi     # 0x254b8
callq 0x4380
movq %rax, -0x1930(%rbp)
jmp 0xb185
movq -0x1930(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4380
jmp 0xb197
leaq -0x3b0(%rbp), %rdi
callq 0x4280
jmp 0xb1a5
leaq -0x538(%rbp), %rdi
callq 0x4280
jmp 0xb1b3
leaq -0x3a0(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x4750
movq %rax, -0x1938(%rbp)
jmp 0xb1cb
movq -0x1938(%rbp), %rdi
leaq 0xf399(%rip), %rsi      # 0x1a572
callq 0x43f0
movq %rax, -0x1940(%rbp)
jmp 0xb1e7
movq -0x1940(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x47d0
movq %rax, -0x1948(%rbp)
jmp 0xb200
movq -0x1948(%rbp), %rdi
leaq 0xf364(%rip), %rsi      # 0x1a572
callq 0x43f0
movq %rax, -0x1950(%rbp)
jmp 0xb21c
movq -0x1950(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4380
jmp 0xb22e
leaq -0x528(%rbp), %rdi
movl -0x58(%rbp), %esi
callq 0x4750
movq %rax, -0x1958(%rbp)
jmp 0xb246
movq -0x1958(%rbp), %rdi
leaq 0xf31e(%rip), %rsi      # 0x1a572
callq 0x43f0
movq %rax, -0x1960(%rbp)
jmp 0xb262
movq -0x1960(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x47d0
movq %rax, -0x1968(%rbp)
jmp 0xb27b
movq -0x1968(%rbp), %rdi
leaq 0xf2e9(%rip), %rsi      # 0x1a572
callq 0x43f0
movq %rax, -0x1970(%rbp)
jmp 0xb297
movq -0x1970(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4380
jmp 0xb2ac
leaq -0x558(%rbp), %rdi
callq 0x45c0
leaq -0x578(%rbp), %rdi
callq 0x45c0
movq -0x1920(%rbp), %rsi
leaq -0x5a0(%rbp), %rdi
callq 0x41a0
jmp 0xb2d9
leaq -0x5a0(%rbp), %rdi
leaq -0x558(%rbp), %rsi
callq 0x5dc0
movb %al, -0x1971(%rbp)
jmp 0xb2f4
leaq -0x5a0(%rbp), %rdi
callq 0x4878
movb -0x1971(%rbp), %al
andb $0x1, %al
movb %al, -0x579(%rbp)
testb $0x1, -0x579(%rbp)
jne 0xb460
leaq -0x728(%rbp), %rdi
callq 0x4280
jmp 0xb329
leaq -0x718(%rbp), %rdi
leaq 0xf1de(%rip), %rsi      # 0x1a515
callq 0x43f0
movq %rax, -0x1980(%rbp)
jmp 0xb345
movq -0x1920(%rbp), %rsi
movq -0x1980(%rbp), %rdi
callq 0x4380
jmp 0xb35a
leaq -0x748(%rbp), %rdi
leaq -0x728(%rbp), %rsi
callq 0x43e0
jmp 0xb36f
leaq -0x748(%rbp), %rdi
callq 0x7300
jmp 0xb37d
leaq -0x748(%rbp), %rdi
callq 0x4878
leaq -0x728(%rbp), %rdi
callq 0x42b0
jmp 0xb460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x4470
jmp 0xc78d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc781
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc775
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc769
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc75d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc745
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x5a0(%rbp), %rdi
callq 0x4878
jmp 0xc745
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xb44f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x748(%rbp), %rdi
callq 0x4878
leaq -0x728(%rbp), %rdi
callq 0x42b0
jmp 0xc745
leaq -0x770(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x43e0
jmp 0xb475
leaq -0x770(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x5dc0
movb %al, -0x1981(%rbp)
jmp 0xb490
leaq -0x770(%rbp), %rdi
callq 0x4878
movb -0x1981(%rbp), %al
andb $0x1, %al
movb %al, -0x749(%rbp)
testb $0x1, -0x749(%rbp)
jne 0xb5c2
leaq -0x8f8(%rbp), %rdi
callq 0x4280
jmp 0xb4c5
leaq -0x8e8(%rbp), %rdi
leaq 0xf042(%rip), %rsi      # 0x1a515
callq 0x43f0
movq %rax, -0x1990(%rbp)
jmp 0xb4e1
leaq -0x918(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x43e0
jmp 0xb4f6
movq -0x1990(%rbp), %rdi
leaq -0x918(%rbp), %rsi
callq 0x4380
jmp 0xb50b
leaq -0x918(%rbp), %rdi
callq 0x4878
leaq -0x938(%rbp), %rdi
leaq -0x8f8(%rbp), %rsi
callq 0x43e0
jmp 0xb52c
leaq -0x938(%rbp), %rdi
callq 0x7300
jmp 0xb53a
leaq -0x938(%rbp), %rdi
callq 0x4878
leaq -0x8f8(%rbp), %rdi
callq 0x42b0
jmp 0xb5c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x770(%rbp), %rdi
callq 0x4878
jmp 0xc745
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xb5b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x918(%rbp), %rdi
callq 0x4878
jmp 0xb5b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x938(%rbp), %rdi
callq 0x4878
leaq -0x8f8(%rbp), %rdi
callq 0x42b0
jmp 0xc745
testb $0x1, -0x579(%rbp)
je 0xb5d4
testb $0x1, -0x749(%rbp)
jne 0xb5de
movl $0x1, %edi
callq 0x44e0
movl $0x10, %edi
movl $0x8, %esi
callq 0xea00
movl %eax, -0x1994(%rbp)
jmp 0xb5f5
movl -0x1994(%rbp), %edx
leaq -0xac0(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x46b0
jmp 0xb610
leaq -0xae0(%rbp), %rdi
callq 0x45c0
leaq -0xaf8(%rbp), %rdi
callq 0xf780
movb $0x0, -0xaf9(%rbp)
leaq -0xac0(%rbp), %rdi
leaq -0xae0(%rbp), %rsi
movl $0xa, %edx
callq 0x47f0
movq %rax, -0x19a0(%rbp)
jmp 0xb650
movq -0x19a0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4510
movb %al, -0x19a1(%rbp)
jmp 0xb66e
movb -0x19a1(%rbp), %al
testb $0x1, %al
jne 0xb67d
jmp 0xbfa9
leaq -0xb18(%rbp), %rdi
leaq -0xae0(%rbp), %rsi
movl $0x20, %edx
callq 0x4e00
jmp 0xb697
leaq -0xb18(%rbp), %rdi
callq 0xe3f0
cmpq $0x4, %rax
jb 0xbf87
xorl %eax, %eax
movl %eax, %esi
leaq -0xb18(%rbp), %rdi
callq 0xef40
movq %rax, %rsi
leaq -0xb38(%rbp), %rdi
callq 0x41a0
jmp 0xb6ce
leaq -0xb18(%rbp), %rdi
movq %rdi, -0x19b0(%rbp)
movl $0x1, %esi
callq 0xef40
movq %rax, %rdi
callq 0x4190
movq %rax, %rdi
callq 0x4690
movq -0x19b0(%rbp), %rdi
movl %eax, -0xb3c(%rbp)
movl $0x2, %esi
callq 0xef40
movq %rax, %rdi
callq 0x4190
movq %rax, %rdi
callq 0x4690
movq -0x19b0(%rbp), %rdi
movl %eax, -0xb40(%rbp)
movl $0x3, %esi
callq 0xef40
movq %rax, %rdi
callq 0x4190
movq %rax, %rdi
callq 0x4690
movl %eax, -0xb44(%rbp)
leaq -0xb78(%rbp), %rdi
leaq -0xb38(%rbp), %rsi
callq 0x41a0
jmp 0xb75f
movl -0xb3c(%rbp), %eax
movl %eax, -0xb58(%rbp)
movl -0xb40(%rbp), %eax
movl %eax, -0xb54(%rbp)
movl -0xb44(%rbp), %eax
movl %eax, -0xb50(%rbp)
leaq -0xaf8(%rbp), %rdi
leaq -0xb78(%rbp), %rsi
callq 0xf870
jmp 0xb798
leaq -0xb98(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
callq 0x43e0
jmp 0xb7ad
leaq -0xbb8(%rbp), %rdi
callq 0x45c0
leaq -0xbe0(%rbp), %rdi
leaq -0xb38(%rbp), %rsi
callq 0x41a0
jmp 0xb7ce
movq -0x1918(%rbp), %rdi
movl -0xb44(%rbp), %edx
leaq -0xbe0(%rbp), %rsi
movl $0x1, %ecx
leaq -0xb98(%rbp), %r8
leaq -0xbb8(%rbp), %r9
callq 0x7e20
movb %al, -0x19b1(%rbp)
jmp 0xb802
leaq -0xbe0(%rbp), %rdi
callq 0x4878
movb -0x19b1(%rbp), %al
andb $0x1, %al
movb %al, -0xbb9(%rbp)
testb $0x1, -0xbb9(%rbp)
jne 0xba02
movb $0x1, -0xaf9(%rbp)
leaq -0xd68(%rbp), %rdi
callq 0x4280
jmp 0xb83e
leaq -0xd58(%rbp), %rdi
leaq 0xecef(%rip), %rsi      # 0x1a53b
callq 0x43f0
movq %rax, -0x19c0(%rbp)
jmp 0xb85a
movq -0x19c0(%rbp), %rdi
leaq -0xb38(%rbp), %rsi
callq 0x4380
movq %rax, -0x19c8(%rbp)
jmp 0xb876
movq -0x19c8(%rbp), %rdi
leaq 0xeced(%rip), %rsi      # 0x1a571
callq 0x43f0
movq %rax, -0x19d0(%rbp)
jmp 0xb892
movq -0x19d0(%rbp), %rdi
movl -0xb44(%rbp), %esi
callq 0x4750
movq %rax, -0x19d8(%rbp)
jmp 0xb8ad
movq -0x19d8(%rbp), %rdi
leaq 0xecb9(%rip), %rsi      # 0x1a574
callq 0x43f0
movq %rax, -0x19e0(%rbp)
jmp 0xb8c9
leaq -0xd88(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
callq 0x43e0
jmp 0xb8de
movq -0x19e0(%rbp), %rdi
leaq -0xd88(%rbp), %rsi
callq 0x4380
jmp 0xb8f3
leaq -0xd88(%rbp), %rdi
callq 0x4878
leaq -0xda8(%rbp), %rdi
leaq -0xd68(%rbp), %rsi
callq 0x43e0
jmp 0xb914
leaq -0xda8(%rbp), %rdi
callq 0x7300
jmp 0xb922
leaq -0xda8(%rbp), %rdi
callq 0x4878
leaq -0xd68(%rbp), %rdi
callq 0x42b0
jmp 0xba02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc721
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xbf98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xbf79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xbf6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xbf55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xbe0(%rbp), %rdi
callq 0x4878
jmp 0xbf55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xb9f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xd88(%rbp), %rdi
callq 0x4878
jmp 0xb9f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xda8(%rbp), %rdi
callq 0x4878
leaq -0xd68(%rbp), %rdi
callq 0x42b0
jmp 0xbf55
leaq -0xdc8(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x43e0
jmp 0xba17
leaq -0xde8(%rbp), %rdi
leaq -0xb38(%rbp), %rsi
callq 0x41a0
jmp 0xba2c
movq -0x1918(%rbp), %rdi
movl -0xb44(%rbp), %edx
leaq -0xde8(%rbp), %rsi
movl $0x1, %ecx
leaq -0xdc8(%rbp), %r8
leaq -0xbb8(%rbp), %r9
callq 0x7e20
movb %al, -0x19e1(%rbp)
jmp 0xba60
movb -0x19e1(%rbp), %al
andb $0x1, %al
movb %al, -0xbb9(%rbp)
leaq -0xde8(%rbp), %rdi
callq 0x4878
testb $0x1, -0xbb9(%rbp)
jne 0xbc19
movb $0x1, -0xaf9(%rbp)
leaq -0xf70(%rbp), %rdi
callq 0x4280
jmp 0xba9c
leaq -0xf60(%rbp), %rdi
leaq 0xead2(%rip), %rsi      # 0x1a57c
callq 0x43f0
movq %rax, -0x19f0(%rbp)
jmp 0xbab8
movq -0x19f0(%rbp), %rdi
leaq -0xb38(%rbp), %rsi
callq 0x4380
movq %rax, -0x19f8(%rbp)
jmp 0xbad4
movq -0x19f8(%rbp), %rdi
leaq 0xea8f(%rip), %rsi      # 0x1a571
callq 0x43f0
movq %rax, -0x1a00(%rbp)
jmp 0xbaf0
movq -0x1a00(%rbp), %rdi
movl -0xb44(%rbp), %esi
callq 0x4750
movq %rax, -0x1a08(%rbp)
jmp 0xbb0b
movq -0x1a08(%rbp), %rdi
leaq 0xea5b(%rip), %rsi      # 0x1a574
callq 0x43f0
movq %rax, -0x1a10(%rbp)
jmp 0xbb27
leaq -0xf90(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x43e0
jmp 0xbb3c
movq -0x1a10(%rbp), %rdi
leaq -0xf90(%rbp), %rsi
callq 0x4380
jmp 0xbb51
leaq -0xf90(%rbp), %rdi
callq 0x4878
leaq -0xfb0(%rbp), %rdi
leaq -0xf70(%rbp), %rsi
callq 0x43e0
jmp 0xbb72
leaq -0xfb0(%rbp), %rdi
callq 0x7300
jmp 0xbb80
leaq -0xfb0(%rbp), %rdi
callq 0x4878
leaq -0xf70(%rbp), %rdi
callq 0x42b0
jmp 0xbc19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xbf49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xde8(%rbp), %rdi
callq 0x4878
jmp 0xbf49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xbc08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xf90(%rbp), %rdi
callq 0x4878
jmp 0xbc08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xfb0(%rbp), %rdi
callq 0x4878
leaq -0xf70(%rbp), %rdi
callq 0x42b0
jmp 0xbf49
leaq -0xfd0(%rbp), %rdi
leaq -0xb38(%rbp), %rsi
callq 0x41a0
jmp 0xbc2e
movq -0x1918(%rbp), %rdi
movl -0xb44(%rbp), %edx
movl -0x54(%rbp), %ecx
leaq -0xfd0(%rbp), %rsi
leaq -0x558(%rbp), %r8
leaq -0xbb8(%rbp), %r9
callq 0x7e20
movb %al, -0x1a11(%rbp)
jmp 0xbc60
movb -0x1a11(%rbp), %al
andb $0x1, %al
movb %al, -0xbb9(%rbp)
leaq -0xfd0(%rbp), %rdi
callq 0x4878
testb $0x1, -0xbb9(%rbp)
jne 0xbd95
movb $0x1, -0xaf9(%rbp)
leaq -0x1158(%rbp), %rdi
callq 0x4280
jmp 0xbc9c
leaq -0x1148(%rbp), %rdi
leaq 0xe908(%rip), %rsi      # 0x1a5b2
callq 0x43f0
movq %rax, -0x1a20(%rbp)
jmp 0xbcb8
movq -0x1a20(%rbp), %rdi
leaq -0xb38(%rbp), %rsi
callq 0x4380
movq %rax, -0x1a28(%rbp)
jmp 0xbcd4
movq -0x1a28(%rbp), %rdi
leaq 0xe88f(%rip), %rsi      # 0x1a571
callq 0x43f0
movq %rax, -0x1a30(%rbp)
jmp 0xbcf0
movq -0x1a30(%rbp), %rdi
movl -0xb44(%rbp), %esi
callq 0x4750
jmp 0xbd04
leaq -0x1178(%rbp), %rdi
leaq -0x1158(%rbp), %rsi
callq 0x43e0
jmp 0xbd19
leaq -0x1178(%rbp), %rdi
callq 0x7300
jmp 0xbd27
leaq -0x1178(%rbp), %rdi
callq 0x4878
leaq -0x1158(%rbp), %rdi
callq 0x42b0
jmp 0xbd95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xfd0(%rbp), %rdi
callq 0x4878
jmp 0xbf49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xbd84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1178(%rbp), %rdi
callq 0x4878
leaq -0x1158(%rbp), %rdi
callq 0x42b0
jmp 0xbf49
leaq -0x1198(%rbp), %rdi
leaq -0xb38(%rbp), %rsi
callq 0x41a0
jmp 0xbdaa
movq -0x1918(%rbp), %rdi
movl -0xb44(%rbp), %edx
movl -0x58(%rbp), %ecx
leaq -0x1198(%rbp), %rsi
leaq -0x578(%rbp), %r8
leaq -0xbb8(%rbp), %r9
callq 0x7e20
movb %al, -0x1a31(%rbp)
jmp 0xbddc
movb -0x1a31(%rbp), %al
andb $0x1, %al
movb %al, -0xbb9(%rbp)
leaq -0x1198(%rbp), %rdi
callq 0x4878
testb $0x1, -0xbb9(%rbp)
jne 0xbf0b
movb $0x1, -0xaf9(%rbp)
leaq -0x1320(%rbp), %rdi
callq 0x4280
jmp 0xbe18
leaq -0x1310(%rbp), %rdi
leaq 0xe7c5(%rip), %rsi      # 0x1a5eb
callq 0x43f0
movq %rax, -0x1a40(%rbp)
jmp 0xbe34
movq -0x1a40(%rbp), %rdi
leaq -0xb38(%rbp), %rsi
callq 0x4380
movq %rax, -0x1a48(%rbp)
jmp 0xbe50
movq -0x1a48(%rbp), %rdi
leaq 0xe713(%rip), %rsi      # 0x1a571
callq 0x43f0
movq %rax, -0x1a50(%rbp)
jmp 0xbe6c
movq -0x1a50(%rbp), %rdi
movl -0xb44(%rbp), %esi
callq 0x4750
jmp 0xbe80
leaq -0x1340(%rbp), %rdi
leaq -0x1320(%rbp), %rsi
callq 0x43e0
jmp 0xbe95
leaq -0x1340(%rbp), %rdi
callq 0x7300
jmp 0xbea3
leaq -0x1340(%rbp), %rdi
callq 0x4878
leaq -0x1320(%rbp), %rdi
callq 0x42b0
jmp 0xbf0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1198(%rbp), %rdi
callq 0x4878
jmp 0xbf49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xbefd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1340(%rbp), %rdi
callq 0x4878
leaq -0x1320(%rbp), %rdi
callq 0x42b0
jmp 0xbf49
leaq -0xdc8(%rbp), %rdi
callq 0x4878
leaq -0xbb8(%rbp), %rdi
callq 0x4878
leaq -0xb98(%rbp), %rdi
callq 0x4878
leaq -0xb78(%rbp), %rdi
callq 0xf8e0
leaq -0xb38(%rbp), %rdi
callq 0x4878
jmp 0xbf87
leaq -0xdc8(%rbp), %rdi
callq 0x4878
leaq -0xbb8(%rbp), %rdi
callq 0x4878
leaq -0xb98(%rbp), %rdi
callq 0x4878
leaq -0xb78(%rbp), %rdi
callq 0xf8e0
leaq -0xb38(%rbp), %rdi
callq 0x4878
jmp 0xbf98
leaq -0xb18(%rbp), %rdi
callq 0xe390
jmp 0xb62f
leaq -0xb18(%rbp), %rdi
callq 0xe390
jmp 0xc721
testb $0x1, -0xaf9(%rbp)
je 0xbfbc
movl $0x1, %edi
callq 0x44e0
leaq -0x1361(%rbp), %rdi
movq %rdi, -0x1a58(%rbp)
callq 0x47a0
movq -0x1a58(%rbp), %rdx
leaq 0xe647(%rip), %rsi      # 0x1a624
leaq -0x1360(%rbp), %rdi
callq 0xe8d0
jmp 0xbfeb
leaq -0x1360(%rbp), %rdi
callq 0x7140
jmp 0xbff9
leaq -0x1360(%rbp), %rdi
callq 0x4878
leaq -0x1361(%rbp), %rdi
callq 0x4470
leaq -0x1389(%rbp), %rdi
movq %rdi, -0x1a60(%rbp)
callq 0x47a0
movq -0x1a60(%rbp), %rdx
leaq 0xe61b(%rip), %rsi      # 0x1a64d
leaq -0x1388(%rbp), %rdi
callq 0xe8d0
jmp 0xc040
leaq -0x1388(%rbp), %rdi
callq 0x7140
jmp 0xc04e
leaq -0x1388(%rbp), %rdi
callq 0x4878
leaq -0x1389(%rbp), %rdi
callq 0x4470
leaq -0x13c8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0x2e, %edx
callq 0x4e00
jmp 0xc07d
xorl %eax, %eax
movl %eax, %esi
leaq -0x13c8(%rbp), %rdi
callq 0xef40
movq %rax, %rsi
leaq -0x13b0(%rbp), %rdi
callq 0x41a0
jmp 0xc09e
leaq -0x13c8(%rbp), %rdi
callq 0xe390
movq -0x1918(%rbp), %rsi
addq $0xf0, %rsi
leaq -0x13e8(%rbp), %rdi
callq 0x41a0
jmp 0xc0c6
testb $0x1, -0x11(%rbp)
je 0xc19e
movq -0x1918(%rbp), %rsi
addq $0x110, %rsi            # imm = 0x110
leaq -0x13e8(%rbp), %rdi
callq 0x4050
jmp 0xc0ec
jmp 0xc19e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc117
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1360(%rbp), %rdi
callq 0x4878
leaq -0x1361(%rbp), %rdi
callq 0x4470
jmp 0xc721
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc14e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1388(%rbp), %rdi
callq 0x4878
leaq -0x1389(%rbp), %rdi
callq 0x4470
jmp 0xc721
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x13c8(%rbp), %rdi
callq 0xe390
jmp 0xc721
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc715
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc709
leaq -0x1570(%rbp), %rdi
callq 0x4280
jmp 0xc1ac
leaq -0x1560(%rbp), %rdi
leaq 0xe4af(%rip), %rsi      # 0x1a669
callq 0x43f0
movq %rax, -0x1a68(%rbp)
jmp 0xc1c8
movq -0x1a68(%rbp), %rdi
leaq -0x13e8(%rbp), %rsi
callq 0x4380
jmp 0xc1dd
leaq -0x1590(%rbp), %rdi
leaq -0x1570(%rbp), %rsi
callq 0x43e0
jmp 0xc1f2
leaq -0x1590(%rbp), %rdi
callq 0x7140
jmp 0xc200
leaq -0x1590(%rbp), %rdi
callq 0x4878
movl $0x7531, %edi           # imm = 0x7531
movl $0x9c3f, %esi           # imm = 0x9C3F
callq 0x57d0
movl %eax, -0x1594(%rbp)
leaq -0x1720(%rbp), %rdi
callq 0x4280
jmp 0xc22f
leaq -0x1710(%rbp), %rdi
leaq 0x1927b(%rip), %rsi     # 0x254b8
callq 0x4380
movq %rax, -0x1a70(%rbp)
jmp 0xc24b
movq -0x1a70(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x47d0
movq %rax, -0x1a78(%rbp)
jmp 0xc264
movq -0x1a78(%rbp), %rdi
leaq 0xe0a0(%rip), %rsi      # 0x1a312
callq 0x43f0
jmp 0xc279
leaq -0x1740(%rbp), %rdi
leaq -0x1720(%rbp), %rsi
callq 0x43e0
jmp 0xc28e
leaq -0x18c8(%rbp), %rdi
callq 0x4280
jmp 0xc29c
leaq -0x18b8(%rbp), %rdi
leaq 0x1926e(%rip), %rsi     # 0x25518
callq 0x4380
movq %rax, -0x1a80(%rbp)
jmp 0xc2b8
movq -0x1a80(%rbp), %rdi
leaq 0xe3c2(%rip), %rsi      # 0x1a688
callq 0x43f0
movq %rax, -0x1a88(%rbp)
jmp 0xc2d4
movq -0x1a88(%rbp), %rdi
leaq -0x1740(%rbp), %rsi
callq 0x4380
movq %rax, -0x1a90(%rbp)
jmp 0xc2f0
movq -0x1a90(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4380
movq %rax, -0x1a98(%rbp)
jmp 0xc309
movq -0x1a98(%rbp), %rdi
leaq 0xe393(%rip), %rsi      # 0x1a6aa
callq 0x43f0
movq %rax, -0x1aa0(%rbp)
jmp 0xc325
movq -0x1aa0(%rbp), %rdi
leaq -0x1740(%rbp), %rsi
callq 0x4380
movq %rax, -0x1aa8(%rbp)
jmp 0xc341
movq -0x1aa8(%rbp), %rdi
leaq -0x13b0(%rbp), %rsi
callq 0x4380
movq %rax, -0x1ab0(%rbp)
jmp 0xc35d
movq -0x1ab0(%rbp), %rdi
leaq 0xe344(%rip), %rsi      # 0x1a6af
callq 0x43f0
movq %rax, -0x1ab8(%rbp)
jmp 0xc379
movq -0x1ab8(%rbp), %rdi
movq 0x18c39(%rip), %rsi     # 0x24fc0
callq 0x4440
jmp 0xc38e
leaq -0x18b8(%rbp), %rdi
leaq -0x1740(%rbp), %rsi
callq 0x4380
movq %rax, -0x1ac0(%rbp)
jmp 0xc3aa
movq -0x1ac0(%rbp), %rdi
leaq -0x13b0(%rbp), %rsi
callq 0x4380
movq %rax, -0x1ac8(%rbp)
jmp 0xc3c6
movq -0x1ac8(%rbp), %rdi
leaq 0xe19e(%rip), %rsi      # 0x1a572
callq 0x43f0
movq %rax, -0x1ad0(%rbp)
jmp 0xc3e2
movq -0x1ad0(%rbp), %rdi
leaq -0x1740(%rbp), %rsi
callq 0x4380
movq %rax, -0x1ad8(%rbp)
jmp 0xc3fe
movq -0x1ad8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4380
movq %rax, -0x1ae0(%rbp)
jmp 0xc41a
movq -0x1ae0(%rbp), %rdi
leaq 0xe14a(%rip), %rsi      # 0x1a572
callq 0x43f0
movq %rax, -0x1ae8(%rbp)
jmp 0xc436
movq -0x1ae8(%rbp), %rdi
leaq -0x13e8(%rbp), %rsi
callq 0x4380
movq %rax, -0x1af0(%rbp)
jmp 0xc452
movq -0x1af0(%rbp), %rdi
leaq 0xe112(%rip), %rsi      # 0x1a572
callq 0x43f0
movq %rax, -0x1af8(%rbp)
jmp 0xc46e
movq -0x1af8(%rbp), %rdi
movl -0x1594(%rbp), %esi
callq 0x4750
movq %rax, -0x1b00(%rbp)
jmp 0xc489
movq -0x1b00(%rbp), %rdi
movq 0x18b29(%rip), %rsi     # 0x24fc0
callq 0x4440
jmp 0xc49e
movl $0x0, -0x18cc(%rbp)
movl -0x18cc(%rbp), %eax
movq %rax, -0x1b08(%rbp)
leaq -0xaf8(%rbp), %rdi
callq 0xf900
movq %rax, %rcx
movq -0x1b08(%rbp), %rax
cmpq %rcx, %rax
jae 0xc60a
leaq -0x18f0(%rbp), %rdi
leaq -0x18c8(%rbp), %rsi
callq 0x43e0
jmp 0xc4e9
movl -0x18cc(%rbp), %eax
movl %eax, %esi
leaq -0xaf8(%rbp), %rdi
callq 0xf930
movq %rax, %rsi
leaq -0x1910(%rbp), %rdi
callq 0x41a0
jmp 0xc50e
movl -0x18cc(%rbp), %eax
movl %eax, %esi
leaq -0xaf8(%rbp), %rdi
callq 0xf930
movq -0x1918(%rbp), %rdi
movl 0x28(%rax), %edx
leaq -0x1910(%rbp), %rsi
movl $0x2, %ecx
leaq -0x18f0(%rbp), %r8
callq 0x8180
jmp 0xc546
leaq -0x1910(%rbp), %rdi
callq 0x4878
leaq -0x18f0(%rbp), %rdi
callq 0x4878
movl -0x18cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18cc(%rbp)
jmp 0xc4a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc6fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1590(%rbp), %rdi
callq 0x4878
jmp 0xc6fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc6f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc6e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc6d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc5f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1910(%rbp), %rdi
callq 0x4878
leaq -0x18f0(%rbp), %rdi
callq 0x4878
jmp 0xc6d9
leaq -0x18c8(%rbp), %rdi
callq 0x42b0
leaq -0x1740(%rbp), %rdi
callq 0x4878
leaq -0x1720(%rbp), %rdi
callq 0x42b0
leaq -0x1570(%rbp), %rdi
callq 0x42b0
leaq -0x13e8(%rbp), %rdi
callq 0x4878
leaq -0x13b0(%rbp), %rdi
callq 0x4878
leaq -0xaf8(%rbp), %rdi
callq 0xf7e0
leaq -0xae0(%rbp), %rdi
callq 0x4878
leaq -0xac0(%rbp), %rdi
callq 0x42b0
leaq -0x578(%rbp), %rdi
callq 0x4878
leaq -0x558(%rbp), %rdi
callq 0x4878
leaq -0x538(%rbp), %rdi
callq 0x42b0
leaq -0x3b0(%rbp), %rdi
callq 0x42b0
leaq -0x228(%rbp), %rdi
callq 0x42b0
leaq -0x98(%rbp), %rdi
callq 0x4878
leaq -0x78(%rbp), %rdi
callq 0x4878
leaq -0x38(%rbp), %rdi
callq 0x4878
addq $0x1b10, %rsp           # imm = 0x1B10
popq %rbp
retq
leaq -0x18c8(%rbp), %rdi
callq 0x42b0
leaq -0x1740(%rbp), %rdi
callq 0x4878
leaq -0x1720(%rbp), %rdi
callq 0x42b0
leaq -0x1570(%rbp), %rdi
callq 0x42b0
leaq -0x13e8(%rbp), %rdi
callq 0x4878
leaq -0x13b0(%rbp), %rdi
callq 0x4878
leaq -0xaf8(%rbp), %rdi
callq 0xf7e0
leaq -0xae0(%rbp), %rdi
callq 0x4878
leaq -0xac0(%rbp), %rdi
callq 0x42b0
leaq -0x578(%rbp), %rdi
callq 0x4878
leaq -0x558(%rbp), %rdi
callq 0x4878
leaq -0x538(%rbp), %rdi
callq 0x42b0
leaq -0x3b0(%rbp), %rdi
callq 0x42b0
leaq -0x228(%rbp), %rdi
callq 0x42b0
leaq -0x98(%rbp), %rdi
callq 0x4878
leaq -0x78(%rbp), %rdi
callq 0x4878
leaq -0x38(%rbp), %rdi
callq 0x4878
movq -0x40(%rbp), %rdi
callq 0x4780
nopl (%rax,%rax)