// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Messaging.hpp
// Function: messageHandler(void*)
void* messageHandler(void *data)
{
	// parse data
	struct xyz_messaging_listen_thread_data_ *td = (struct xyz_messaging_listen_thread_data_ *)data;
	Messaging *m = td->mess;

	string msg;
	readSocket(td->client_sockfd, msg);

	string::size_type pos;
	pos=msg.find('$', 0);
	if (pos !=  string::npos) {
		string typeStr = msg.substr(0, pos);
		int msgType = atoi(typeStr.c_str());
		string msgContent=msg.substr(pos+1);

		if(msgType == FILE_BLOCK_REQUEST) { // reply file block
			vector<string> vs;
			splitString(msgContent, vs, FILE_BLOCK_REQUEST_DELIMITATION);
			if(vs.size() >= 4) {
				string ret;
				string path = vs[0];
				int offset = atoi(vs[1].c_str());
				int length = atoi(vs[2].c_str());
				FileSourceFormat format = static_cast<FileSourceFormat>(atoi(vs[3].c_str()));
				if (format == FILE_SOURCE_FORMAT_BYTE) {

					pthread_mutex_lock(&m->mutex_check_file_cache);
					if (m->file_cache_bytes.find(path) == m->file_cache_bytes.end()) { // check file cache
						string *file_content = new string();
						readFile(path, *file_content);
						m->file_cache_bytes[path] = file_content;
					} 
					pthread_mutex_unlock(&m->mutex_check_file_cache);

					ret = m->file_cache_bytes[path]->substr(offset, length);
				} else {
					pthread_mutex_lock(&m->mutex_check_file_cache);
					if (m->file_cache_lines.find(path) == m->file_cache_lines.end()) { // check file cache
						vector<string> *file_content = new vector<string>();
						readFileToLines(path, *file_content);
						m->file_cache_lines[path] = file_content;
					} 
					pthread_mutex_unlock(&m->mutex_check_file_cache);

					unsigned end_line = offset+length;
					for (unsigned int i=offset; i<end_line && i<m->file_cache_lines[path]->size(); i++) {
						ret += (*m->file_cache_lines[path])[i];
						ret += "\n";
					}
				}
				send(td->client_sockfd, ret);
				close(td->client_sockfd);
			}
		} else if(msgType == FETCH_REQUEST) {

			//cout << "CONTEXT ID: " << SUNWAYMR_CONTEXT_ID << endl;

			vector<string> paras;
			splitString(msgContent, paras, ",");
			if(paras.size() == 2)
			{
				long shuffleID = atol(paras[0].c_str());
				int partitionID = atoi(paras[1].c_str());

				// send back data
				string base_dir = "cache/shuffle/";
				string app_id = num2string(SUNWAYMR_CONTEXT_ID);
			    string shuffle_id = num2string(shuffleID);

			    string dir = app_id.append("/shuffle-") + shuffle_id.append("/");
			    dir = base_dir + dir;
			    vector<string> allFileNames;
				listAllFileNamesContain(dir, allFileNames, "shuffleTaskFile");

				pthread_mutex_lock(&m->mutex_check_file_cache);
				//map< long, vector< vector<string>* > > fetch_content_local; // !global shuffle cache data map(fetch_content) will cause segmentation fault!
				map< long, vector< vector<string>* > >::iterator it = m->fetch_content_local.find(shuffleID);
				if(it == m->fetch_content_local.end())
				{
					// this shuffle has not  been cached, read it
					vector< vector<string>* > vvs;
					for(unsigned int i=0; i<allFileNames.size(); i++)
					{
							string content;
							readFile(dir+allFileNames[i], content);
							vector<string> *lines = new vector<string>();
							splitString(content, *lines, SHUFFLETASK_PARTITION_DELIMITATION);
							vvs.push_back(lines);
					}
					m->fetch_content_local[shuffleID] = vvs;
				}
				pthread_mutex_unlock(&m->mutex_check_file_cache);

				//organize send message
				string senMsg;
				for(unsigned int i=0; i<m->fetch_content_local[shuffleID].size()-1; i++)
					senMsg += (*(m->fetch_content_local[shuffleID][i]))[partitionID] + string(SHUFFLETASK_KV_DELIMITATION);
				senMsg += (*(m->fetch_content_local[shuffleID].back()))[partitionID];

				send(td->client_sockfd, senMsg);
			}
			close(td->client_sockfd);
		} else if(msgType == FILE_INFO || msgType > 999999) { // sunwaymrhelper file sending
			m->messageReceived(td->local_port, td->ip, msgType, msgContent);
			string reply = "0";
			send(td->client_sockfd, reply);
			close(td->client_sockfd);
		} else {
			string reply = "";
			send(td->client_sockfd, reply);
			close(td->client_sockfd);

			m->messageReceived(td->local_port, td->ip, msgType, msgContent);
		}
	} else {
		string reply = "";
		send(td->client_sockfd, reply);
		close(td->client_sockfd);
	}

	pthread_exit(NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq (%rdi), %r14
leaq 0x1e8(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rdi, 0x28(%rsp)
movl 0x30(%rdi), %edi
leaq 0x1d8(%rsp), %rsi
callq 0x5c35
leaq 0x1d8(%rsp), %rdi
movl $0x24, %esi
xorl %edx, %edx
callq 0x34a0
cmpq $-0x1, %rax
jne 0x697b
leaq 0x100(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x7771(%rip), %rdx      # 0xe09b
leaq 0xf0(%rsp), %rdi
movq %rdx, %rsi
callq 0xc5c2
movq 0x28(%rsp), %rbx
movl 0x30(%rbx), %edi
leaq 0xf0(%rsp), %rsi
callq 0x7a0d
movl 0x30(%rbx), %edi
callq 0x36e0
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0x6974
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x3390
xorl %edi, %edi
callq 0x3660
movq %rax, %r15
leaq 0xf0(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x33b0
movq 0xf0(%rsp), %rdi
callq 0x3580
movl %eax, %ebp
incq %r15
leaq 0x1b0(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
movq %r15, %rdx
movq $-0x1, %rcx
callq 0x33b0
cmpl $0x6, %ebp
je 0x6bed
cmpl $0x5, %ebp
jne 0x7076
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
movq $0x0, 0xd0(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7906(%rip), %rsi      # 0xe308
leaq 0x7913(%rip), %rdx      # 0xe31c
leaq 0x8(%rsp), %rdi
callq 0xc5c2
leaq 0x1b0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x399c
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6a49
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xc0(%rsp), %rax
movq 0xc8(%rsp), %rcx
subq %rax, %rcx
cmpq $0x61, %rcx
jb 0x7380
leaq 0x18(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x70(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0xc532
movq 0xc0(%rsp), %rbx
movq 0x20(%rbx), %rdi
callq 0x3580
movl %eax, %r12d
movq 0x40(%rbx), %rdi
callq 0x3580
movl %eax, %r15d
movq 0x60(%rbx), %rdi
callq 0x3580
movl %eax, %ebp
leaq 0x30(%r14), %r13
movq %r13, %rdi
callq 0x3500
testl %ebp, %ebp
jne 0x71ff
leaq 0x58(%r14), %rbp
leaq 0x60(%rsp), %rsi
movq %rbp, %rdi
callq 0xcd40
addq $0x60, %r14
cmpq %r14, %rax
jne 0x6b84
movl $0x20, %edi
callq 0x3380
movq %rax, %r14
addq $0x10, %rax
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
leaq 0x1a0(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0x190(%rsp), %rdi
callq 0xc532
leaq 0x190(%rsp), %rdi
movq %r14, %rsi
callq 0x46c2
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x6b74
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x60(%rsp), %rsi
movq %rbp, %rdi
callq 0xbf10
movq %r14, (%rax)
movq %r13, %rdi
callq 0x3290
leaq 0x60(%rsp), %rsi
movq %rbp, %rdi
callq 0xbf10
movq (%rax), %rsi
movslq %r12d, %rdx
movslq %r15d, %rcx
leaq 0x130(%rsp), %rdi
callq 0x33b0
leaq 0x8(%rsp), %rdi
leaq 0x130(%rsp), %r14
movq %r14, %rsi
callq 0x3450
movq (%r14), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x732e
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x732e
xorps %xmm0, %xmm0
movaps %xmm0, 0x150(%rsp)
movq $0x0, 0x160(%rsp)
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x770a(%rip), %rsi      # 0xe31f
leaq 0x7704(%rip), %rdx      # 0xe320
leaq 0x8(%rsp), %rdi
callq 0xc5c2
leaq 0x1b0(%rsp), %rdi
leaq 0x150(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x399c
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6c57
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x150(%rsp), %rbx
movq 0x158(%rsp), %rax
subq %rbx, %rax
cmpq $0x40, %rax
jne 0x75eb
movq (%rbx), %rdi
callq 0x3430
movq %rax, 0x38(%rsp)
movq 0x20(%rbx), %rdi
callq 0x3580
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x7686(%rip), %rsi      # 0xe321
leaq 0x768d(%rip), %rdx      # 0xe32f
callq 0xc5c2
movq 0xc74a(%rip), %rsi      # 0x133f8
leaq 0x60(%rsp), %rdi
callq 0x4e10
movq 0x38(%rsp), %rsi
leaq 0x130(%rsp), %rdi
callq 0x4e10
leaq 0x765f(%rip), %rsi      # 0xe330
leaq 0x60(%rsp), %rdi
callq 0x36d0
movq %rax, %r15
leaq 0x7649(%rip), %rsi      # 0xe32e
leaq 0x130(%rsp), %rdi
callq 0x36d0
leaq 0xc0(%rsp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xbeab
movq %r14, 0x30(%rsp)
movl %ebx, 0xec(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0xbeab
leaq 0xc0(%rsp), %rdi
leaq 0x40(%rsp), %r15
movq %r15, %rsi
callq 0x3450
movq (%r15), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x6d57
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3390
xorps %xmm0, %xmm0
movaps %xmm0, 0x110(%rsp)
movq $0x0, 0x120(%rsp)
leaq 0x288(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x278(%rsp), %rdi
callq 0xc532
leaq 0x268(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x758c(%rip), %rsi      # 0xe33a
leaq 0x7594(%rip), %rdx      # 0xe349
leaq 0x258(%rsp), %rdi
callq 0xc5c2
leaq 0x278(%rsp), %rdi
leaq 0x110(%rsp), %rsi
leaq 0x258(%rsp), %rdx
callq 0x5397
movq 0x258(%rsp), %rdi
cmpq %r12, %rdi
je 0x6dfc
movq 0x268(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x278(%rsp), %rdi
cmpq %r15, %rdi
je 0x6e19
movq 0x288(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x30(%rsp), %rbx
leaq 0x30(%rbx), %rdi
movq %rdi, 0x1d0(%rsp)
callq 0x3500
movq 0xc8(%rbx), %rdx
leaq 0xc0(%rbx), %rax
movq %rax, %rcx
testq %rdx, %rdx
je 0x6e65
movq 0x38(%rsp), %rsi
movq %rax, %rcx
xorl %edi, %edi
cmpq %rsi, 0x20(%rdx)
setl %dil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rdi,8), %rdx
testq %rdx, %rdx
jne 0x6e4d
movq %rax, %rdx
cmpq %rax, %rcx
je 0x6e7d
movq 0x38(%rsp), %rdx
cmpq 0x20(%rcx), %rdx
cmovlq %rax, %rcx
movq %rcx, %rdx
addq $0xb8, 0x30(%rsp)
cmpq %rax, %rdx
jne 0x6ef4
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq 0x110(%rsp), %rax
cmpq %rax, 0x118(%rsp)
jne 0x738d
leaq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdi
callq 0xc008
leaq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0xc06e
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x6ef4
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x3390
movq 0x1d0(%rsp), %rdi
callq 0x3290
leaq 0x40(%rsp), %rcx
leaq 0x50(%rsp), %rax
movq %rax, (%rcx)
movq $0x0, 0x8(%rcx)
movb $0x0, 0x10(%rcx)
movslq 0xec(%rsp), %rbp
xorl %r12d, %r12d
leaq 0xb0(%rsp), %r13
leaq 0x38(%rsp), %rbx
leaq 0x80(%rsp), %r15
shlq $0x5, %rbp
movq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc008
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movl %r12d, %r12d
sarq $0x3, %rcx
decq %rcx
cmpq %r12, %rcx
jbe 0x750c
movq %r14, %rdi
movq %rbx, %r14
movq %rbx, %rsi
callq 0xc008
movq (%rax), %rax
movq (%rax,%r12,8), %rax
movq (%rax), %rbx
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq %r15, %rdi
leaq 0x73b5(%rip), %rsi      # 0xe34f
leaq 0x73b3(%rip), %rdx      # 0xe354
callq 0xc5c2
movq (%rbx,%rbp), %rcx
movq 0x8(%rbx,%rbp), %r8
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
movq %r13, 0xa0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %r14, %rbx
je 0x6fea
movq %rdx, 0xa0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb0(%rsp)
jmp 0x6ff2
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x30(%rsp), %r14
movq 0x8(%rax), %rdx
movq %rdx, 0xa8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x3120
movq 0xa0(%rsp), %rdi
cmpq %r13, %rdi
je 0x7049
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x706e
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3390
incl %r12d
jmp 0x6f43
cmpl $0x1, %ebp
setne %al
cmpl $0xf4240, %ebp          # imm = 0xF4240
setl %cl
testb %cl, %al
jne 0x7144
movq 0x28(%rsp), %rax
movl 0x8(%rax), %r15d
leaq 0x228(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
leaq 0x218(%rsp), %rdi
callq 0xc532
movq (%r14), %rax
leaq 0x218(%rsp), %rdx
leaq 0x1b0(%rsp), %r8
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %ecx
callq *0x10(%rax)
movq 0x218(%rsp), %rdi
cmpq %r12, %rdi
je 0x70f6
movq 0x228(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x724f(%rip), %rsi      # 0xe355
leaq 0x7249(%rip), %rdx      # 0xe356
leaq 0x8(%rsp), %rdi
callq 0xc5c2
movq 0x28(%rsp), %rbx
movl 0x30(%rbx), %edi
leaq 0x8(%rsp), %rsi
callq 0x7a0d
movl 0x30(%rbx), %edi
callq 0x36e0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
jne 0x71ed
jmp 0x7605
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x6f46(%rip), %rdx      # 0xe09b
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0xc5c2
movq 0x28(%rsp), %rbx
movl 0x30(%rbx), %edi
leaq 0x8(%rsp), %rsi
callq 0x7a0d
movl 0x30(%rbx), %edi
callq 0x36e0
movl 0x8(%rbx), %r15d
leaq 0x208(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
leaq 0x1f8(%rsp), %rdi
callq 0xc532
movq (%r14), %rax
leaq 0x1f8(%rsp), %rdx
leaq 0x1b0(%rsp), %r8
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %ecx
callq *0x10(%rax)
movq 0x1f8(%rsp), %rdi
cmpq %r13, %rdi
je 0x71df
movq 0x208(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7605
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x7605
leaq 0x88(%r14), %rbp
leaq 0x60(%rsp), %rsi
movq %rbp, %rdi
callq 0xd0dc
addq $0x90, %r14
cmpq %r14, %rax
jne 0x72aa
movl $0x18, %edi
callq 0x3380
movq %rax, %r14
leaq 0x180(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq %rax, -0x10(%rax)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0x170(%rsp), %rdi
callq 0xc532
leaq 0x170(%rsp), %rdi
movq %r14, %rsi
callq 0x4930
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x729a
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x60(%rsp), %rsi
movq %rbp, %rdi
callq 0xbf8c
movq %r14, (%rax)
movq %r13, %rdi
callq 0x3290
leal (%r15,%r12), %eax
cmpl %eax, %r12d
jae 0x732e
movl %r12d, %r13d
movq %r13, %rbx
shlq $0x5, %rbx
orq $0x8, %rbx
leaq 0x60(%rsp), %r14
leaq 0x8(%rsp), %r12
movq %rbp, %rdi
movq %r14, %rsi
callq 0xbf8c
movq (%rax), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x5, %rcx
cmpq %r13, %rcx
jbe 0x732e
movq %rbp, %rdi
movq %r14, %rsi
callq 0xbf8c
movq (%rax), %rax
movq (%rax), %rax
movq -0x8(%rax,%rbx), %rsi
movq (%rax,%rbx), %rdx
movq %r12, %rdi
callq 0x3120
movq %r12, %rdi
leaq 0x7000(%rip), %rsi      # 0xe31d
callq 0x36d0
addq $0x20, %rbx
incq %r13
decl %r15d
jne 0x72d3
movq 0x28(%rsp), %rbx
movl 0x30(%rbx), %edi
leaq 0x8(%rsp), %rsi
callq 0x7a0d
movl 0x30(%rbx), %edi
callq 0x36e0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x7364
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7380
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0xc0(%rsp), %rdi
jmp 0x7600
movl $0x1, %r12d
xorl %edx, %edx
leaq 0x238(%rsp), %rbx
leaq 0x40(%rsp), %r15
leaq 0xa0(%rsp), %rbp
leaq 0x50(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
movb $0x0, 0x50(%rsp)
shlq $0x5, %rdx
addq %rax, %rdx
movq %rbx, %r13
movq %rbx, %rdi
leaq 0xc0(%rsp), %rsi
callq 0xbeab
movq %r13, %rdi
movq %r15, %rsi
callq 0x46c2
movq 0x238(%rsp), %rdi
leaq 0x248(%rsp), %rax
cmpq %rax, %rdi
je 0x740c
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x3390
movl $0x18, %edi
callq 0x3380
movq %rax, %r13
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, 0x128(%rsp)
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %rbp, %rdi
leaq 0x6f01(%rip), %rsi      # 0xe34a
leaq 0x6efe(%rip), %rdx      # 0xe34e
callq 0xc5c2
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x399c
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x7488
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0x74b0
movq 0x128(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x88(%rsp)
jmp 0x74c5
leaq 0x80(%rsp), %rdi
leaq 0x128(%rsp), %rdx
callq 0xd478
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x74e1
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3390
movl %r12d, %edx
movq 0x110(%rsp), %rax
movq 0x118(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
incl %r12d
cmpq %rdx, %rcx
ja 0x73aa
jmp 0x6eb8
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0xc008
movq 0x8(%rax), %rax
movq -0x8(%rax), %rax
movq (%rax), %rax
movq (%rax,%rbp), %rsi
movq 0x8(%rax,%rbp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x3120
movq 0x28(%rsp), %rax
movl 0x30(%rax), %edi
leaq 0x40(%rsp), %rsi
callq 0x7a0d
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x7565
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x110(%rsp), %rdi
callq 0xbd14
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7593
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x75b4
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x75cf
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x75eb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x28(%rsp), %rax
movl 0x30(%rax), %edi
callq 0x36e0
leaq 0x150(%rsp), %rdi
callq 0xbd14
leaq 0x1c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7626
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x6964
jmp 0x6974
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x7693
movq 0xb0(%rsp), %rsi
jmp 0x7684
jmp 0x7690
movq %rax, %rbx
movq 0x238(%rsp), %rdi
leaq 0x248(%rsp), %rax
cmpq %rax, %rdi
je 0x7693
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x7693
jmp 0x7690
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x771f
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x771f
jmp 0x7703
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r13, %rdi
je 0x76d8
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x76d8
movq %rax, %rbx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x7706
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x7706
jmp 0x7703
jmp 0x7703
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x7780
movq 0x50(%rsp), %rsi
jmp 0x7773
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x7780
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
jmp 0x7776
movq %rax, %rbx
movq 0x258(%rsp), %rdi
cmpq %r12, %rdi
je 0x775e
movq 0x268(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x775e
movq %rax, %rbx
movq 0x278(%rsp), %rdi
cmpq %r15, %rdi
je 0x7780
movq 0x288(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x7780
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0xbd14
jmp 0x7792
movq %rax, %rbx
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x77b3
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x18(%rsp), %r12
jmp 0x7821
movq %rax, %rbx
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x7899
movq 0x180(%rsp), %rsi
jmp 0x7804
movq %rax, %rbx
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x7899
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x7899
jmp 0x7896
jmp 0x7896
jmp 0x7896
jmp 0x7896
jmp 0x7896
movq %rax, %rbx
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7870
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x7870
movq %rax, %rbx
movq 0x1f8(%rsp), %rdi
cmpq %r13, %rdi
je 0x78fb
movq 0x208(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x78fb
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x791e
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x791e
jmp 0x7896
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x793a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x793a
jmp 0x791b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
jne 0x7905
jmp 0x7975
jmp 0x7916
jmp 0x7958
jmp 0x7937
jmp 0x7958
movq %rax, %rbx
movq 0x218(%rsp), %rdi
cmpq %r12, %rdi
je 0x7975
movq 0x228(%rsp), %rsi
jmp 0x790a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7975
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x7975
jmp 0x7916
movq %rax, %rbx
jmp 0x7975
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x795b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x795b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7968
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x7968
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
jmp 0x7970
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0xbd14
leaq 0x1c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x799d
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x799d
jmp 0x79d6
movq %rax, %rbx
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x79c0
jmp 0x79d9
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0x79d9
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x79d9
jmp 0x79d6
jmp 0x79d6
movq %rax, %rbx
movq 0x1d8(%rsp), %rdi
leaq 0x1e8(%rsp), %rax
cmpq %rax, %rdi
je 0x79fe
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650