// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd38, %rsp            # imm = 0xD38
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, 0x120(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0xa9b4(%rip), %rsi      # 0x13440
movq 0xa9b5(%rip), %rdx      # 0x13448
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0xc532
movl %ebp, 0xf8(%rsp)
testl %ebp, %ebp
je 0x8abc
leaq 0xa96e(%rip), %rsi      # 0x13420
leaq 0x8(%rsp), %rdi
callq 0x31e0
leaq 0xbb0(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x35d0
imulq $0x3e8, (%r14), %r15    # imm = 0x3E8
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%r14)
movq %rdx, %r14
leaq 0x5533(%rip), %rsi      # 0xe020
movl $0x2, %ecx
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x36f0
leaq 0x1(%rax), %rdx
leaq 0x188(%rsp), %rdi
movq %rbx, %rsi
movq $-0x1, %rcx
callq 0x33b0
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x59f7(%rip), %rsi      # 0xe523
leaq 0x59fd(%rip), %rdx      # 0xe530
leaq 0x28(%rsp), %rdi
callq 0xc5c2
leaq 0xbb0(%rsp), %rdi
callq 0x3240
leaq 0xbc0(%rsp), %rdi
movq 0xa8a7(%rip), %rsi      # 0x13400
movq 0xa8a8(%rip), %rdx      # 0x13408
callq 0x3400
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rdi
callq 0x3400
leaq 0xa28(%rsp), %rdi
callq 0x3240
leaq 0x8a0(%rsp), %rdi
callq 0x3240
movq %r14, %rax
shrq $0x3f, %rax
sarq $0x7, %r14
addq %rax, %r14
addq %r15, %r14
leaq 0xa38(%rsp), %rdi
movq %r14, 0xa8(%rsp)
movl %r14d, %esi
callq 0x3610
movq %rax, %r14
leaq 0x59ca(%rip), %rsi      # 0xe58e
movl $0x1, %edx
movq %rax, %rdi
callq 0x3400
movq %r14, %rdi
movq 0xa8(%rsp), %rsi
callq 0x3340
movq %rax, %r14
leaq 0x59a3(%rip), %rsi      # 0xe58e
movl $0x1, %edx
movq %rax, %rdi
callq 0x3400
movq 0x188(%rsp), %rsi
movq 0x190(%rsp), %rdx
movq %r14, %rdi
callq 0x3400
movq 0xa8(%rsp), %rax
leal 0x1(%rax), %esi
leaq 0x8b0(%rsp), %rdi
movl %esi, 0xfc(%rsp)
callq 0x3610
movq %rax, %r14
leaq 0x5955(%rip), %rsi      # 0xe58e
movl $0x1, %edx
movq %rax, %rdi
callq 0x3400
movq %r14, %rdi
movq 0xa8(%rsp), %rsi
callq 0x3340
movq %rax, %r14
leaq 0x592e(%rip), %rsi      # 0xe58e
movl $0x1, %edx
movq %rax, %rdi
callq 0x3400
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r14, %rdi
callq 0x3400
leaq 0x1f8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xc8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x250(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x240(%rsp), %rdi
callq 0xc532
leaq 0x240(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x46c2
movl %eax, %ebp
movq 0x240(%rsp), %rdi
cmpq %r15, %rdi
je 0x8cfc
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x3390
testb %bpl, %bpl
jne 0x8da1
leaq 0x718(%rsp), %rdi
callq 0x3240
leaq 0x728(%rsp), %r14
leaq 0x5810(%rip), %rsi      # 0xe531
movl $0x25, %edx
movq %r14, %rdi
callq 0x3400
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x3400
leaq 0x730(%rsp), %rsi
leaq 0x280(%rsp), %rdi
callq 0x3590
leaq 0x280(%rsp), %rdi
callq 0x58fc
leaq 0x290(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8d80
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xa229(%rip), %rsi      # 0x12fb0
leaq 0x718(%rsp), %rdi
callq 0x3260
leaq 0x798(%rsp), %rdi
callq 0x3150
leaq 0xbc8(%rsp), %r14
leaq 0x260(%rsp), %rdi
movq %r14, %rsi
callq 0x3590
leaq 0x260(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x46c2
movl %eax, %ebx
leaq 0x270(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8df1
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x3390
testb %bl, %bl
jne 0x8ecb
leaq 0x718(%rsp), %rdi
callq 0x3240
leaq 0x728(%rsp), %r15
leaq 0x571c(%rip), %rsi      # 0xe531
movl $0x25, %edx
movq %r15, %rdi
callq 0x3400
leaq 0x280(%rsp), %rdi
movq %r14, %rsi
callq 0x3590
movq 0x280(%rsp), %rsi
movq 0x288(%rsp), %rdx
movq %r15, %rdi
callq 0x3400
leaq 0x290(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x8e6b
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x730(%rsp), %rsi
leaq 0x280(%rsp), %rdi
callq 0x3590
leaq 0x280(%rsp), %rdi
callq 0x58fc
movq 0x280(%rsp), %rdi
cmpq %r15, %rdi
je 0x8eaa
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xa0ff(%rip), %rsi      # 0x12fb0
leaq 0x718(%rsp), %rdi
callq 0x3260
leaq 0x798(%rsp), %rdi
callq 0x3150
testb %bl, %bpl
je 0x9e50
leaq 0x718(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
movl $0x18, %edx
callq 0x35a0
leaq 0x1d8(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ebp, %ebp
movq %rbp, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x100(%rsp), %rax
movq %rbp, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
leaq 0x280(%rsp), %rax
addq $0x80, %rax
movq %rax, 0xb0(%rsp)
leaq 0xd8(%rsp), %r12
leaq 0x718(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
movl $0xa, %edx
callq 0x36a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x9711
leaq 0x208(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
movl $0x20, %edx
callq 0x3ba5
movq 0x208(%rsp), %rax
movq 0x210(%rsp), %rcx
subq %rax, %rcx
cmpq $0x61, %rcx
jb 0x96ff
movq %r12, %rbx
leaq 0x418(%rsp), %rcx
movq %rcx, 0x408(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x408(%rsp), %rdi
callq 0xc532
movq 0x208(%rsp), %r15
movq 0x20(%r15), %rdi
callq 0x3580
movl %eax, %r13d
movq 0x40(%r15), %rdi
callq 0x3580
movl %eax, %r14d
movq 0x60(%r15), %rdi
callq 0x3580
movl %eax, %r15d
leaq 0x5a0(%rsp), %rax
movq %rax, 0x590(%rsp)
movq 0x408(%rsp), %rsi
movq 0x410(%rsp), %rdx
addq %rsi, %rdx
leaq 0x590(%rsp), %r12
movq %r12, %rdi
callq 0xc532
movl %r13d, 0x5b0(%rsp)
movl %r14d, 0x5b4(%rsp)
movl %r15d, 0x5b8(%rsp)
leaq 0x100(%rsp), %rdi
movq %r12, %rsi
callq 0xc1a0
movq %rbx, %r12
movq %rbx, %rdi
leaq 0xa40(%rsp), %rsi
callq 0x3590
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq $0x0, 0x90(%rsp)
movb $0x0, 0x98(%rsp)
leaq 0x1b8(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movq 0x408(%rsp), %rsi
movq 0x410(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1a8(%rsp), %rbx
movq %rbx, %rdi
callq 0xc532
movq %rbx, %rsi
movl %r15d, %edx
movl $0x1, %ecx
movq %r12, %r8
leaq 0x88(%rsp), %r9
callq 0x607a
movl %eax, %r14d
movq 0x1a8(%rsp), %rdi
leaq 0x1b8(%rsp), %rax
cmpq %rax, %rdi
je 0x90f4
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x3390
testb %r14b, %r14b
jne 0x9214
leaq 0x280(%rsp), %rdi
callq 0x3240
movl $0x35, %edx
leaq 0x290(%rsp), %rdi
leaq 0x5439(%rip), %rsi      # 0xe557
callq 0x3400
leaq 0x48(%rsp), %rbx
movq 0x408(%rsp), %rsi
movq 0x410(%rsp), %rdx
leaq 0x290(%rsp), %rdi
callq 0x3400
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x5436(%rip), %rsi      # 0xe58d
callq 0x3400
movq %r14, %rdi
movl %r15d, %esi
callq 0x3610
movq %rax, %r13
movl $0x7, %edx
movq %rax, %rdi
leaq 0x5417(%rip), %rsi      # 0xe590
callq 0x3400
movq %rbx, %rdi
leaq 0xa40(%rsp), %rsi
callq 0x3590
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r13, %rdi
callq 0x3400
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x91bc
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
leaq 0x298(%rsp), %rsi
callq 0x3590
movq %rbx, %rdi
callq 0x58fc
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x91f0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x280(%rsp), %rdi
movq 0x9db1(%rip), %rsi      # 0x12fb0
callq 0x3260
movq 0xb0(%rsp), %rdi
callq 0x3150
movb $0x1, %bpl
leaq 0x48(%rsp), %rdi
leaq 0x8b8(%rsp), %rsi
callq 0x3590
leaq 0x178(%rsp), %rax
movq %rax, 0x168(%rsp)
movq 0x408(%rsp), %rsi
movq 0x410(%rsp), %rdx
addq %rsi, %rdx
leaq 0x168(%rsp), %rdi
callq 0xc532
leaq 0x168(%rsp), %rsi
movl %r15d, %edx
movl $0x1, %ecx
leaq 0x48(%rsp), %r8
leaq 0x88(%rsp), %r9
callq 0x607a
movl %eax, %r14d
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x92a0
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3390
testb %r14b, %r14b
jne 0x93be
leaq 0x280(%rsp), %rdi
callq 0x3240
leaq 0x68(%rsp), %rbx
movl $0x35, %edx
leaq 0x290(%rsp), %r14
movq %r14, %rdi
leaq 0x52c6(%rip), %rsi      # 0xe598
callq 0x3400
movq 0x408(%rsp), %rsi
movq 0x410(%rsp), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x528c(%rip), %rsi      # 0xe58d
callq 0x3400
movq %r14, %rdi
movl %r15d, %esi
callq 0x3610
movq %rax, %r13
movl $0x7, %edx
movq %rax, %rdi
leaq 0x526d(%rip), %rsi      # 0xe590
callq 0x3400
movq %rbx, %rdi
leaq 0x8b8(%rsp), %rsi
callq 0x3590
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %r13, %rdi
callq 0x3400
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x9366
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
leaq 0x298(%rsp), %rsi
callq 0x3590
movq %rbx, %rdi
callq 0x58fc
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x939a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x280(%rsp), %rdi
movq 0x9c07(%rip), %rsi      # 0x12fb0
callq 0x3260
movq 0xb0(%rsp), %rdi
callq 0x3150
movb $0x1, %bpl
leaq 0x158(%rsp), %rax
movq %rax, 0x148(%rsp)
movq 0x408(%rsp), %rsi
movq 0x410(%rsp), %rdx
addq %rsi, %rdx
leaq 0x148(%rsp), %rdi
callq 0xc532
leaq 0x148(%rsp), %rsi
movl %r15d, %edx
movq 0xa8(%rsp), %rcx
leaq 0x1e8(%rsp), %r8
leaq 0x88(%rsp), %r9
callq 0x607a
movl %eax, %r14d
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x943e
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x3390
testb %r14b, %r14b
jne 0x9507
leaq 0x280(%rsp), %rdi
callq 0x3240
leaq 0x68(%rsp), %rbx
movl $0x38, %edx
leaq 0x290(%rsp), %r14
movq %r14, %rdi
leaq 0x515e(%rip), %rsi      # 0xe5ce
callq 0x3400
movq 0x408(%rsp), %rsi
movq 0x410(%rsp), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x50ee(%rip), %rsi      # 0xe58d
callq 0x3400
movq %r14, %rdi
movl %r15d, %esi
callq 0x3610
movq %rbx, %rdi
leaq 0x298(%rsp), %rsi
callq 0x3590
movq %rbx, %rdi
callq 0x58fc
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x94e3
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x280(%rsp), %rdi
movq 0x9abe(%rip), %rsi      # 0x12fb0
callq 0x3260
movq 0xb0(%rsp), %rdi
callq 0x3150
movb $0x1, %bpl
leaq 0x138(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x408(%rsp), %rsi
movq 0x410(%rsp), %rdx
addq %rsi, %rdx
leaq 0x128(%rsp), %rdi
callq 0xc532
leaq 0x128(%rsp), %rsi
movl %r15d, %edx
movl 0xfc(%rsp), %ecx
leaq 0xb8(%rsp), %r8
leaq 0x88(%rsp), %r9
callq 0x607a
movl %eax, %r14d
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x9586
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x3390
testb %r14b, %r14b
jne 0x964f
leaq 0x280(%rsp), %rdi
callq 0x3240
leaq 0x68(%rsp), %rbx
movl $0x38, %edx
leaq 0x290(%rsp), %r14
movq %r14, %rdi
leaq 0x504f(%rip), %rsi      # 0xe607
callq 0x3400
movq 0x408(%rsp), %rsi
movq 0x410(%rsp), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x4fa6(%rip), %rsi      # 0xe58d
callq 0x3400
movq %r14, %rdi
movl %r15d, %esi
callq 0x3610
movq %rbx, %rdi
leaq 0x298(%rsp), %rsi
callq 0x3590
movq %rbx, %rdi
callq 0x58fc
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x962b
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x280(%rsp), %rdi
movq 0x9976(%rip), %rsi      # 0x12fb0
callq 0x3260
movq 0xb0(%rsp), %rdi
callq 0x3150
movb $0x1, %bpl
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x966b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x9690
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x96b5
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x590(%rsp), %rdi
leaq 0x5a0(%rsp), %rax
cmpq %rax, %rdi
je 0x96da
movq 0x5a0(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x408(%rsp), %rdi
leaq 0x418(%rsp), %rax
cmpq %rax, %rdi
je 0x96ff
movq 0x418(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x208(%rsp), %rdi
callq 0xbd14
jmp 0x8f33
testb $0x1, %bpl
jne 0x9e50
leaq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rbx
movq %rbx, (%rdi)
leaq 0x4f0b(%rip), %rsi      # 0xe640
leaq 0x4f2c(%rip), %rdx      # 0xe668
callq 0xc5c2
leaq 0x280(%rsp), %rdi
callq 0x56f8
movq 0x280(%rsp), %rdi
cmpq %rbx, %rdi
je 0x976b
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x280(%rsp), %rdi
movq %rbx, (%rdi)
leaq 0x4eec(%rip), %rsi      # 0xe669
leaq 0x4f00(%rip), %rdx      # 0xe684
callq 0xc5c2
leaq 0x280(%rsp), %rdi
callq 0x56f8
movq 0x280(%rsp), %rdi
cmpq %rbx, %rdi
je 0x97b3
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x280(%rsp), %rdi
leaq 0x188(%rsp), %rsi
movl $0x2e, %edx
callq 0x3ba5
movq 0x280(%rsp), %rax
leaq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rcx
movq %rcx, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0xc532
leaq 0x280(%rsp), %rdi
callq 0xbd14
leaq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
movq %rax, (%rdi)
movq 0x120(%rsp), %rax
movq 0xf0(%rax), %rsi
movq 0xf8(%rax), %rdx
addq %rsi, %rdx
callq 0xc532
cmpb $0x0, 0xf8(%rsp)
je 0x985b
movq 0x120(%rsp), %rsi
addq $0x110, %rsi            # imm = 0x110
leaq 0x88(%rsp), %rdi
callq 0x31e0
leaq 0x280(%rsp), %rdi
callq 0x3240
leaq 0x290(%rsp), %r14
leaq 0x4e0e(%rip), %rsi      # 0xe685
movl $0x1e, %edx
movq %r14, %rdi
callq 0x3400
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq %r14, %rdi
callq 0x3400
leaq 0x298(%rsp), %rsi
leaq 0x590(%rsp), %rdi
callq 0x3590
leaq 0x590(%rsp), %rdi
callq 0x56f8
movq 0x590(%rsp), %rdi
leaq 0x5a0(%rsp), %rax
cmpq %rax, %rdi
je 0x98e3
movq 0x5a0(%rsp), %rsi
incq %rsi
callq 0x3390
movl $0x7531, %edi           # imm = 0x7531
movl $0x9c3f, %esi           # imm = 0x9C3F
callq 0x42e6
movl %eax, %ebp
leaq 0x590(%rsp), %rdi
callq 0x3240
leaq 0x5a0(%rsp), %rdi
movq 0x9af0(%rip), %rsi      # 0x13400
movq 0x9af1(%rip), %rdx      # 0x13408
callq 0x3400
movq %rax, %rdi
movq 0xa8(%rsp), %rsi
callq 0x3340
leaq 0x49fb(%rip), %rsi      # 0xe32e
movl $0x1, %edx
movq %rax, %rdi
callq 0x3400
leaq 0x5a8(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x3590
leaq 0x408(%rsp), %rdi
callq 0x3240
leaq 0x418(%rsp), %r15
movq 0x9af2(%rip), %rsi      # 0x13460
movq 0x9af3(%rip), %rdx      # 0x13468
movq %r15, %rdi
callq 0x3400
movq %rax, %r12
leaq 0x4d1d(%rip), %rsi      # 0xe6a4
movl $0x21, %edx
movq %rax, %rdi
callq 0x3400
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r12, %rdi
callq 0x3400
movq 0x188(%rsp), %rsi
movq 0x190(%rsp), %rdx
movq %rax, %rdi
callq 0x3400
movq %rax, %r12
leaq 0x4cfe(%rip), %rsi      # 0xe6c6
movl $0x4, %edx
movq %rax, %rdi
callq 0x3400
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r12, %rdi
callq 0x3400
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq %rax, %rdi
callq 0x3400
movq %rax, %r12
leaq 0x4cc2(%rip), %rsi      # 0xe6cb
movl $0x33, %edx
movq %rax, %rdi
callq 0x3400
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3360
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3220
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r15, %rdi
callq 0x3400
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq %rax, %rdi
callq 0x3400
movq %rax, %r15
leaq 0x4b1c(%rip), %rsi      # 0xe58e
movl $0x1, %edx
movq %rax, %rdi
callq 0x3400
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r15, %rdi
callq 0x3400
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rax, %rdi
callq 0x3400
movq %rax, %r15
leaq 0x4ae1(%rip), %rsi      # 0xe58e
movl $0x1, %edx
movq %rax, %rdi
callq 0x3400
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq %r15, %rdi
callq 0x3400
movq %rax, %r15
leaq 0x4ab2(%rip), %rsi      # 0xe58e
movl $0x1, %edx
movq %rax, %rdi
callq 0x3400
movq %r15, %rdi
movl %ebp, %esi
callq 0x3610
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3360
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3220
movq 0x108(%rsp), %rax
cmpq 0x100(%rsp), %rax
je 0x9c12
leaq 0x230(%rsp), %rbp
movl $0x1, %ebx
xorl %r15d, %r15d
leaq 0x68(%rsp), %r12
leaq 0x220(%rsp), %r13
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
movq %r12, %rdi
leaq 0x420(%rsp), %rsi
callq 0x3590
movq 0x100(%rsp), %rax
leaq (%r15,%r15,2), %r15
shlq $0x4, %r15
movq %rbp, 0x220(%rsp)
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xc532
movq 0x100(%rsp), %rax
movl 0x28(%rax,%r15), %edx
movq %r13, %rsi
movl $0x2, %ecx
movq %r12, %r8
callq 0x633a
movq 0x220(%rsp), %rdi
cmpq %rbp, %rdi
je 0x9bd0
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x9bec
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
movl %ebx, %r15d
movq 0x108(%rsp), %rax
subq 0x100(%rsp), %rax
sarq $0x4, %rax
imulq %r14, %rax
incl %ebx
cmpq %r15, %rax
ja 0x9b5a
movq 0x9397(%rip), %rsi      # 0x12fb0
leaq 0x408(%rsp), %rdi
callq 0x3260
leaq 0x488(%rsp), %rdi
callq 0x3150
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x9c4f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x935a(%rip), %r15      # 0x12fb0
leaq 0x590(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3260
movl $0x80, %ebx
addq %rbx, %r14
movq %r14, %rdi
callq 0x3150
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3260
addq %rbx, %r14
movq %r14, %rdi
callq 0x3150
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x9cbc
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
leaq 0x38(%rsp), %r15
je 0x9ce6
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x100(%rsp), %rdi
callq 0xc144
movq 0x1c8(%rsp), %rdi
leaq 0x1d8(%rsp), %rax
cmpq %rax, %rdi
je 0x9d18
movq 0x1d8(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x9291(%rip), %rsi      # 0x12fb0
leaq 0x718(%rsp), %rdi
callq 0x3260
leaq 0x798(%rsp), %rdi
callq 0x3150
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x9d5e
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x1e8(%rsp), %rdi
leaq 0x1f8(%rsp), %rax
cmpq %rax, %rdi
je 0x9d83
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x9226(%rip), %rbx      # 0x12fb0
leaq 0x8a0(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3260
movl $0x80, %r14d
addq %r14, %r12
movq %r12, %rdi
callq 0x3150
leaq 0xa28(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3260
addq %r14, %r12
movq %r12, %rdi
callq 0x3150
leaq 0xbb0(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3260
addq %r14, %r12
movq %r12, %rdi
callq 0x3150
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x9e01
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x198(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
leaq 0x18(%rsp), %rbx
je 0x9e27
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x9e3e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
addq $0xd38, %rsp            # imm = 0xD38
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x3440
jmp 0x9f0e
movq %rax, %r14
movq 0x280(%rsp), %rdi
cmpq %r15, %rdi
jne 0x9ea2
jmp 0x9f8a
jmp 0x9f87
jmp 0x9e8a
jmp 0x9f87
jmp 0x9f87
jmp 0x9fcf
movq %rax, %r14
leaq 0x290(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9f8a
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x9f8a
jmp 0x9f87
jmp 0x9fcf
jmp 0xa014
movq %rax, %r14
jmp 0xa23e
jmp 0xa03b
jmp 0xa021
movq %rax, %r14
movq 0x590(%rsp), %rdi
leaq 0x5a0(%rsp), %rax
cmpq %rax, %rdi
je 0xa27b
movq 0x5a0(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xa27b
jmp 0xa021
movq %rax, %r14
jmp 0xa29c
movq %rax, %r14
jmp 0xa2c1
movq %rax, %r14
leaq 0x280(%rsp), %rdi
callq 0xbd14
jmp 0xa2f1
jmp 0xa2ee
jmp 0x9f3f
jmp 0xa2ee
movq %rax, %r14
movq 0x280(%rsp), %rdi
cmpq %rbx, %rdi
je 0xa2f1
movq 0x290(%rsp), %rsi
jmp 0xa2de
jmp 0xa2ee
jmp 0x9fcf
movq %rax, %r14
leaq 0x270(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9fd2
movq 0x270(%rsp), %rsi
jmp 0x9fc5
jmp 0x9fcf
movq %rax, %r14
movq 0x901f(%rip), %rsi      # 0x12fb0
leaq 0x718(%rsp), %rdi
callq 0x3260
leaq 0x798(%rsp), %rdi
callq 0x3150
jmp 0x9fd2
movq %rax, %r14
movq 0x240(%rsp), %rdi
cmpq %r15, %rdi
je 0x9fd2
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x9fd2
movq %rax, %r14
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
jmp 0xa473
movq %rax, %r14
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
jmp 0xa4de
jmp 0xa029
movq %rax, %r14
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
jmp 0xa520
movq %rax, %r14
leaq 0x18(%rsp), %rbx
jmp 0xa537
movq %rax, %r14
leaq 0x18(%rsp), %rbx
jmp 0xa558
movq %rax, %r14
jmp 0xa27b
movq %rax, %r14
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
jmp 0xa4ff
movq %rax, %r14
jmp 0xa25a
jmp 0xa1bb
jmp 0xa356
jmp 0xa356
jmp 0xa300
jmp 0xa06e
jmp 0xa300
jmp 0xa06e
jmp 0xa300
jmp 0xa06e
jmp 0xa356
jmp 0xa09b
movq %rax, %r14
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xa303
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xa303
jmp 0xa300
movq %rax, %r14
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xa329
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xa329
jmp 0xa326
jmp 0xa326
movq %rax, %r14
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
jmp 0xa4bd
jmp 0xa1bb
movq %rax, %r14
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0xa359
movq 0x158(%rsp), %rsi
jmp 0xa1ae
movq %rax, %r14
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0xa359
movq 0x138(%rsp), %rsi
jmp 0xa1ae
movq %rax, %r14
movq 0x1a8(%rsp), %rdi
leaq 0x1b8(%rsp), %rax
cmpq %rax, %rdi
je 0xa34a
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xa34a
jmp 0xa166
movq %rax, %r14
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
jmp 0xa3c9
movq %rax, %r14
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
jmp 0xa3ee
movq %rax, %r14
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0xa359
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xa359
movq %rax, %r14
jmp 0xa34a
movq %rax, %r14
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
jmp 0xa413
jmp 0xa21a
movq %rax, %r14
jmp 0xa1fc
movq %rax, %r14
movq 0x220(%rsp), %rdi
cmpq %rbp, %rdi
je 0xa1fc
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xa21d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xa21d
movq %rax, %r14
movq 0x8d8c(%rip), %rsi      # 0x12fb0
leaq 0x408(%rsp), %rdi
callq 0x3260
leaq 0x488(%rsp), %rdi
callq 0x3150
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xa25a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x8d4f(%rip), %rsi      # 0x12fb0
leaq 0x590(%rsp), %rdi
callq 0x3260
leaq 0x610(%rsp), %rdi
callq 0x3150
movq 0x8d2e(%rip), %rsi      # 0x12fb0
leaq 0x280(%rsp), %rdi
callq 0x3260
leaq 0x300(%rsp), %rdi
callq 0x3150
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xa2c1
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xa2f1
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xa2f1
jmp 0xa300
jmp 0xa300
jmp 0xa2ee
movq %rax, %r14
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
jmp 0xa420
movq %rax, %r14
movq 0x8ca6(%rip), %rsi      # 0x12fb0
leaq 0x280(%rsp), %rdi
callq 0x3260
leaq 0x300(%rsp), %rdi
callq 0x3150
jmp 0xa359
movq %rax, %r14
movq 0x8c80(%rip), %rsi      # 0x12fb0
leaq 0x280(%rsp), %rdi
callq 0x3260
leaq 0x300(%rsp), %rdi
callq 0x3150
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
jmp 0xa37f
movq %rax, %r14
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r15
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xa37f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xa3a4
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xa3c9
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x590(%rsp), %rdi
leaq 0x5a0(%rsp), %rax
cmpq %rax, %rdi
je 0xa3ee
movq 0x5a0(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x408(%rsp), %rdi
leaq 0x418(%rsp), %rax
cmpq %rax, %rdi
je 0xa413
movq 0x418(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x208(%rsp), %rdi
callq 0xbd14
leaq 0x100(%rsp), %rdi
callq 0xc144
movq 0x1c8(%rsp), %rdi
leaq 0x1d8(%rsp), %rax
cmpq %rax, %rdi
je 0xa452
movq 0x1d8(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x8b57(%rip), %rsi      # 0x12fb0
leaq 0x718(%rsp), %rdi
callq 0x3260
leaq 0x798(%rsp), %rdi
callq 0x3150
leaq 0xc8(%rsp), %rax
movq 0xb8(%rsp), %rdi
cmpq %rax, %rdi
je 0xa498
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x1e8(%rsp), %rdi
leaq 0x1f8(%rsp), %rax
cmpq %rax, %rdi
je 0xa4bd
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x8aec(%rip), %rsi      # 0x12fb0
leaq 0x8a0(%rsp), %rdi
callq 0x3260
leaq 0x920(%rsp), %rdi
callq 0x3150
movq 0x8acb(%rip), %rsi      # 0x12fb0
leaq 0xa28(%rsp), %rdi
callq 0x3260
leaq 0xaa8(%rsp), %rdi
callq 0x3150
movq 0x8aaa(%rip), %rsi      # 0x12fb0
leaq 0xbb0(%rsp), %rdi
callq 0x3260
leaq 0xc30(%rsp), %rdi
callq 0x3150
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xa537
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x198(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa558
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xa56f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq %r14, %rdi
callq 0x3650
nop