LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: getFileLineNumber(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, long&)
bool getFileLineNumber(string path,  long &size) {
	std::size_t lines_count =0;
	std::string line;
	std::ifstream file(path.c_str());

	if (file.is_open()) {
		while (std::getline(file , line))
			++lines_count;
		size = lines_count;
		file.close();
		return true;
	} else {
		return false;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %r14
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movq (%rdi), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x3690
leaq 0x98(%rsp), %rdi
callq 0x30c0
movl %eax, %ebx
testb %al, %al
je 0x4d4b
xorl %ebp, %ebp
movq %rsp, %r12
movq 0x20(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3360
movsbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x36a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4d3e
incq %rbp
jmp 0x4d07
movq %rbp, (%r14)
leaq 0x20(%rsp), %rdi
callq 0x30a0
leaq 0x20(%rsp), %rdi
callq 0x30e0
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x4d6b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movl %ebx, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4d86
movq %rax, %rbx
jmp 0x4d93
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x30e0
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x4da9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: num2string[abi:cxx11](int)
string num2string(int val) {
	char buffer [33];
	memset(buffer, 0, sizeof(buffer));
	snprintf(buffer, sizeof(buffer), "%d", val);
	return buffer;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ecx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movb $0x0, 0x20(%r14)
leaq 0x9264(%rip), %rdx      # 0xe03c
movl $0x21, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x35b0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x3180
leaq (%rsp,%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc5c2
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: num2string[abi:cxx11](long)
string num2string(long val) {
	char buffer [33];
	memset(buffer, 0, sizeof(buffer));
	snprintf(buffer, sizeof(buffer), "%ld", val);
	return buffer;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rcx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movb $0x0, 0x20(%r14)
leaq 0x9207(%rip), %rdx      # 0xe03f
movl $0x21, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x35b0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x3180
leaq (%rsp,%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc5c2
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: findDelimitationCouplePosition(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long)
string::size_type findDelimitationCouplePosition(string s, string delim_l, string delim_r, string::size_type pos) {
	string::size_type pos1 = pos;
	string::size_type pos2 = pos;
	int c = 0, len_l = delim_l.length(), len_r = delim_r.length();
	do {
		pos1 = s.find(delim_l, pos1);
		pos2 = s.find(delim_r, pos2);
		if (pos2 == string::npos) break;
		if (pos1 < pos2) {
			c ++;
			pos1 += len_l;
		}
		else {
			c --;
			if (c <= 0) break;
			pos2 += len_r;
		}
	} while (true);
	return pos2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rsi
movq 0x8(%r14), %rcx
movq 0x8(%rdx), %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdx
movq %rcx, %rbp
callq 0x3630
movq %rax, %r12
movq (%rbx), %rsi
movq 0x8(%rbx), %rcx
movq %r15, %rdi
movq %r13, %rdx
callq 0x3630
movq %rax, %r13
cmpq $-0x1, %rax
je 0x4f21
movslq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movslq %ebp, %rax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
cmpq %r13, %r12
jae 0x4ee5
incl %ebp
addq 0x8(%rsp), %r12
jmp 0x4ef1
cmpl $0x2, %ebp
jl 0x4f21
decl %ebp
addq 0x10(%rsp), %r13
movq (%r14), %rsi
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %r12, %rdx
callq 0x3630
movq %rax, %r12
movq (%rbx), %rsi
movq 0x8(%rbx), %rcx
movq %r15, %rdi
movq %r13, %rdx
callq 0x3630
movq %rax, %r13
cmpq $-0x1, %rax
jne 0x4ed7
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: listAllFileNames(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
bool listAllFileNames(string dirname, vector<string> &files) {
	DIR *dp;
	struct dirent *dirp;

	if((dp=opendir(dirname.c_str()))==NULL) {
	    //perror("opendir error");
	    return false;
	}

	while((dirp=readdir(dp))!=NULL) {
	    if((strcmp(dirp->d_name,".")==0)||(strcmp(dirp->d_name,"..")==0))
	                        continue;
	    string _file(dirp->d_name);
	    files.push_back(_file);
	}
	closedir(dp);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq (%rdi), %rdi
callq 0x3540
movq %rax, %r14
testq %rax, %rax
je 0x5360
movq %r14, %rdi
callq 0x3550
testq %rax, %rax
je 0x5358
movq %rax, %rbp
leaq 0x18(%rsp), %r12
leaq 0x93a4(%rip), %r15      # 0xe683
leaq 0x8(%rsp), %r13
addq $0x13, %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x34c0
testl %eax, %eax
je 0x5348
movq %rbp, %rdi
leaq 0x9381(%rip), %rsi      # 0xe682
callq 0x34c0
testl %eax, %eax
je 0x5348
movq %r12, 0x8(%rsp)
movq %rbp, %rdi
callq 0x3180
leaq (%rax,%rbp), %rdx
movq %r13, %rdi
movq %rbp, %rsi
callq 0xc5c2
movq %rbx, %rdi
movq %r13, %rsi
callq 0xbcd6
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5348
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq %r14, %rdi
callq 0x3550
movq %rax, %rbp
testq %rax, %rax
jne 0x52e4
movq %r14, %rdi
callq 0x35c0
testq %r14, %r14
setne %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x538f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: listAllFileNamesContain(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool listAllFileNamesContain(string dirname, vector<string> &files, string contain) {
 	DIR *dp;
 	struct dirent *dirp;

 	if((dp=opendir(dirname.c_str()))==NULL) {
 	    perror("opendir error");
 	    return false;
 	}

 	while((dirp=readdir(dp))!=NULL) {
 	    if((strcmp(dirp->d_name,".")==0)||(strcmp(dirp->d_name,"..")==0))
 	                        continue;
 	    string _file(dirp->d_name);
 	    if(_file.find(contain) < _file.length())
 	    	 files.push_back(_file);
 	}
	closedir(dp);
 	return true;
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, (%rsp)
movq (%rdi), %rdi
callq 0x3540
movq %rax, %rbx
testq %rax, %rax
je 0x5493
movq %rbx, %rdi
callq 0x3550
testq %rax, %rax
je 0x5476
movq %rax, %r15
leaq 0x18(%rsp), %r13
leaq 0x92a3(%rip), %r12      # 0xe683
leaq 0x8(%rsp), %rbp
addq $0x13, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x34c0
testl %eax, %eax
je 0x5462
movq %r15, %rdi
leaq 0x9280(%rip), %rsi      # 0xe682
callq 0x34c0
testl %eax, %eax
je 0x5462
movq %r13, 0x8(%rsp)
movq %r15, %rdi
callq 0x3180
leaq (%rax,%r15), %rdx
movq %rbp, %rdi
movq %r15, %rsi
callq 0xc5c2
movq (%r14), %rsi
movq 0x8(%r14), %rcx
movq %rbp, %rdi
xorl %edx, %edx
callq 0x3630
cmpq 0x10(%rsp), %rax
jae 0x544b
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0xbcd6
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5462
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3550
movq %rax, %r15
testq %rax, %rax
jne 0x53e5
movq %rbx, %rdi
callq 0x35c0
testq %rbx, %rbx
setne %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8ba9(%rip), %rdi      # 0xe043
callq 0x32e0
jmp 0x547e
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x54bb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: hash(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
unsigned int hash(string str, unsigned int seed = 0) {
 	unsigned int hash = seed;
 	const char *s = str.c_str();
 	while (*s) {
 		hash = hash * 101  +  *s++;
 	}
 	return hash;
 }

// Assembly:
movl %esi, %eax
movq (%rdi), %rcx
movb (%rcx), %dl
testb %dl, %dl
je 0x54e2
incq %rcx
imull $0x65, %eax, %esi
movsbl %dl, %eax
addl %esi, %eax
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x54d1
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Logging.hpp
// Function: Logging::logVerbose(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Logging::logVerbose(const string &msg) {
	if (logging_mask < 1) {
		pthread_mutex_lock(&mutex_logging);
		cout << "[" << currentDateTime() << "][VERBOSE]: " << msg << endl;
		pthread_mutex_unlock(&mutex_logging);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
cmpl $0x0, 0xde8c(%rip)      # 0x13390
jg 0x55c5
movq %rdi, %rbx
leaq 0xdebc(%rip), %rdi      # 0x133d0
callq 0x3500
movq 0xdab8(%rip), %r14      # 0x12fd8
leaq 0x8d33(%rip), %rsi      # 0xe25a
movl $0x1, %edx
movq %r14, %rdi
callq 0x3400
movq %rsp, %r15
movq %r15, %rdi
callq 0x4259
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %r14
leaq 0x8af9(%rip), %rsi      # 0xe051
movl $0xc, %edx
movq %rax, %rdi
callq 0x3400
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3360
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3220
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x55b9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0xde10(%rip), %rdi      # 0x133d0
callq 0x3290
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x55ed
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
nop
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Logging.hpp
// Function: Logging::logDebug(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Logging::logDebug(const string &msg) {
	if (logging_mask < 2) {
		pthread_mutex_lock(&mutex_logging);
		cout << "[" << currentDateTime() << "][DEBUG]: " << msg << endl;
		pthread_mutex_unlock(&mutex_logging);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
cmpl $0x1, 0xdd8a(%rip)      # 0x13390
jg 0x56c7
movq %rdi, %rbx
leaq 0xddba(%rip), %rdi      # 0x133d0
callq 0x3500
movq 0xd9b6(%rip), %r14      # 0x12fd8
leaq 0x8c31(%rip), %rsi      # 0xe25a
movl $0x1, %edx
movq %r14, %rdi
callq 0x3400
movq %rsp, %r15
movq %r15, %rdi
callq 0x4259
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %r14
leaq 0x8a04(%rip), %rsi      # 0xe05e
movl $0xa, %edx
movq %rax, %rdi
callq 0x3400
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3360
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3220
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x56bb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0xdd0e(%rip), %rdi      # 0x133d0
callq 0x3290
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x56ef
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
nop
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Logging.hpp
// Function: Logging::logInfo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Logging::logInfo(const string &msg) {
	if (logging_mask < 3) {
		pthread_mutex_lock(&mutex_logging);
		cout << "[" << currentDateTime() << "][INFO]: " << msg << endl;
		pthread_mutex_unlock(&mutex_logging);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
cmpl $0x2, 0xdc88(%rip)      # 0x13390
jg 0x57c9
movq %rdi, %rbx
leaq 0xdcb8(%rip), %rdi      # 0x133d0
callq 0x3500
movq 0xd8b4(%rip), %r14      # 0x12fd8
leaq 0x8b2f(%rip), %rsi      # 0xe25a
movl $0x1, %edx
movq %r14, %rdi
callq 0x3400
movq %rsp, %r15
movq %r15, %rdi
callq 0x4259
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %r14
leaq 0x890d(%rip), %rsi      # 0xe069
movl $0x9, %edx
movq %rax, %rdi
callq 0x3400
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3360
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3220
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x57bd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0xdc0c(%rip), %rdi      # 0x133d0
callq 0x3290
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x57f1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
nop
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Logging.hpp
// Function: Logging::logWarning(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Logging::logWarning(const string &msg) {
	if (logging_mask < 4) {
		pthread_mutex_lock(&mutex_logging);
		cout << "[" << currentDateTime() << "][WARNING]: " << msg << endl;
		pthread_mutex_unlock(&mutex_logging);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
cmpl $0x3, 0xdb86(%rip)      # 0x13390
jg 0x58cb
movq %rdi, %rbx
leaq 0xdbb6(%rip), %rdi      # 0x133d0
callq 0x3500
movq 0xd7b2(%rip), %r14      # 0x12fd8
leaq 0x8a2d(%rip), %rsi      # 0xe25a
movl $0x1, %edx
movq %r14, %rdi
callq 0x3400
movq %rsp, %r15
movq %r15, %rdi
callq 0x4259
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %r14
leaq 0x8815(%rip), %rsi      # 0xe073
movl $0xc, %edx
movq %rax, %rdi
callq 0x3400
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3360
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3220
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x58bf
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0xdb0a(%rip), %rdi      # 0x133d0
callq 0x3290
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x58f3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
nop
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Logging.hpp
// Function: Logging::logError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Logging::logError(const string &msg) {
	if (logging_mask < 5) {
		pthread_mutex_lock(&mutex_logging);
		cout << "[" << currentDateTime() << "][ERROR]: " << msg << endl;
		pthread_mutex_unlock(&mutex_logging);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
cmpl $0x4, 0xda84(%rip)      # 0x13390
jg 0x59cd
movq %rdi, %rbx
leaq 0xdab4(%rip), %rdi      # 0x133d0
callq 0x3500
movq 0xd6b0(%rip), %r14      # 0x12fd8
leaq 0x892b(%rip), %rsi      # 0xe25a
movl $0x1, %edx
movq %r14, %rdi
callq 0x3400
movq %rsp, %r15
movq %r15, %rdi
callq 0x4259
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %r14
leaq 0x8720(%rip), %rsi      # 0xe080
movl $0xa, %edx
movq %rax, %rdi
callq 0x3400
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3360
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3220
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x59c1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0xda08(%rip), %rdi      # 0x133d0
callq 0x3290
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x59f5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
nop
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Messaging.hpp
// Function: Messaging::clearFileCache()
void Messaging::clearFileCache() {
	// file content
	map<string, string* >::iterator it1;
	for(it1=file_cache_bytes.begin(); it1!=file_cache_bytes.end(); ++it1) {
		delete it1->second;
	}
	file_cache_bytes.clear();

	map<string, vector<string>* >::iterator it2;
	for(it2=file_cache_lines.begin(); it2!=file_cache_lines.end(); ++it2) {
		delete it2->second;
	}
	file_cache_lines.clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x58(%rdi), %r14
movq 0x70(%rdi), %r15
leaq 0x60(%rdi), %r13
cmpq %r13, %r15
je 0x5b38
movq 0x40(%r15), %r12
testq %r12, %r12
je 0x5b28
movq (%r12), %rdi
leaq 0x10(%r12), %rax
cmpq %rax, %rdi
je 0x5b1b
movq (%rax), %rsi
incq %rsi
callq 0x3390
movl $0x20, %esi
movq %r12, %rdi
callq 0x3390
movq %r15, %rdi
callq 0x3230
movq %rax, %r15
cmpq %r13, %rax
jne 0x5af9
movq %r14, %rdi
callq 0xccb6
movq 0xa0(%rbx), %r14
leaq 0x90(%rbx), %r12
cmpq %r12, %r14
je 0x5b81
movq 0x40(%r14), %r15
testq %r15, %r15
je 0x5b71
movq %r15, %rdi
callq 0xbd14
movl $0x18, %esi
movq %r15, %rdi
callq 0x3390
movq %r14, %rdi
callq 0x3230
movq %rax, %r14
cmpq %r12, %rax
jne 0x5b53
addq $0x88, %rbx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xcce4
nop
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Messaging.hpp
// Function: Messaging::clearShuffleCache()
void Messaging::clearShuffleCache() {
	// fetch content
	map< long, vector< vector<string>* > >::iterator it3;
	for(it3=fetch_content_local.begin(); it3!=fetch_content_local.end(); ++it3) {
		for (unsigned int i=0; i<it3->second.size(); i++) {
			delete it3->second[i];
		}
		it3->second.clear();
	}
	fetch_content_local.clear();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0xd0(%rdi), %r14
leaq 0xc0(%rdi), %r12
cmpq %r12, %r14
je 0x5c1e
movq 0x28(%r14), %rax
movq 0x30(%r14), %rcx
cmpq %rax, %rcx
je 0x5c05
movl $0x1, %ebp
xorl %edx, %edx
movq (%rax,%rdx,8), %r15
testq %r15, %r15
je 0x5bea
movq %r15, %rdi
callq 0xbd14
movl $0x18, %esi
movq %r15, %rdi
callq 0x3390
movl %ebp, %edx
movq 0x28(%r14), %rax
movq 0x30(%r14), %rcx
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x3, %rsi
incl %ebp
cmpq %rdx, %rsi
ja 0x5bcc
cmpq %rax, %rcx
je 0x5c0e
movq %rax, 0x30(%r14)
movq %r14, %rdi
callq 0x3230
movq %rax, %r14
cmpq %r12, %rax
jne 0x5bb8
addq $0xb8, %rbx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xcd12
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Messaging.hpp
// Function: readSocket(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void readSocket(int socketfd, string &ret) {
	//int MAX_MESSAGE_SIZE = 1024 * 1024 * 1024; // TODO configuration out of code
	int BUFFER_SIZE = 1024 * 1024 * 4; // TODO configuration out of code

	char buffer[BUFFER_SIZE];
	ssize_t total = 0;
	vector<string> strs;
	while (true) { // && total < MAX_MESSAGE_SIZE
		memset(buffer, 0, BUFFER_SIZE);
		ssize_t received = recv(socketfd, buffer, BUFFER_SIZE - 1, 0);

		if(received <= 0) break;

		total += received;
		strs.push_back(buffer);
	}

	ret = "";
	for(unsigned int i = 0; i < strs.size(); i++) {
		ret += strs[i];
	}

//	string::size_type end = ret.find(END_OF_MESSAGE);
//	if (end != string::npos) {
//		total = end;
//		ret = ret.substr(0, end);
//	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400048, %rsp         # imm = 0x400048
movq %rsi, %rbx
movl %edi, %ebp
xorps %xmm0, %xmm0
movq %rsp, %rax
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
leaq 0x30(%rsp), %r14
leaq 0x40(%rsp), %r15
leaq 0x20(%rsp), %r12
movl $0x400000, %edx         # imm = 0x400000
movq %r15, %rdi
xorl %esi, %esi
callq 0x31f0
movl $0x3fffff, %edx         # imm = 0x3FFFFF
movl %ebp, %edi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x3140
movq %rax, %r13
testq %rax, %rax
jle 0x5cda
movq %r14, 0x20(%rsp)
movq %r15, %rdi
callq 0x3180
leaq (%rsp,%rax), %rdx
addq $0x40, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0xc5c2
movq %rsp, %rdi
movq %r12, %rsi
callq 0xcaae
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x5cd5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3390
testq %r13, %r13
jg 0x5c6b
movq 0x8(%rbx), %rdx
leaq 0x83b6(%rip), %rcx      # 0xe09b
movq %rbx, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x3570
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
je 0x5d32
movl $0x1, %ebp
xorl %ecx, %ecx
shlq $0x5, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq %rbx, %rdi
callq 0x3120
movl %ebp, %ecx
movq (%rsp), %rax
movq 0x8(%rsp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x5d04
movq %rsp, %rdi
callq 0xbd14
addq $0x400048, %rsp         # imm = 0x400048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5d6e
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x5d71
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x5d71
jmp 0x5d6e
jmp 0x5d6e
movq %rax, %rbx
movq %rsp, %rdi
callq 0xbd14
movq %rbx, %rdi
callq 0x3650
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Messaging.hpp
// Function: sendEndOfMessage(int)
bool sendEndOfMessage(int socket_fd) {
	const char* ch = END_OF_MESSAGE;
	int rsend = send(socket_fd, ch, strlen(ch), 0);
	if (rsend < 0)
	{
		Logging::logError("Messaging: sendEndOfMessage: send END_OF_MESSAGE, failed to send");
		return false;
	}
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq 0x82fa(%rip), %rsi      # 0xe08b
movl $0x10, %edx
xorl %ecx, %ecx
callq 0x31c0
movq %rax, %rbx
testl %ebx, %ebx
jns 0x5de4
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x82e8(%rip), %rsi      # 0xe09c
leaq 0x8321(%rip), %rdx      # 0xe0dc
movq %rsp, %r14
movq %r14, %rdi
callq 0xc5c2
movq %r14, %rdi
callq 0x58fc
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5de4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
testl %ebx, %ebx
setns %al
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5e0c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Messaging.hpp
// Function: Messaging::sendMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool Messaging::sendMessage(string addr, int targetPort, int msgType, string &msg)
{
	string reply;
	if(!sendMessageForReply(addr, targetPort, msgType, msg, reply)) {
		Logging::logError("Messaging: sendMessage: failed to send");
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xc532
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %r9
movl %r14d, %edx
movl %ebp, %ecx
movq %rbx, %r8
callq 0x607a
movl %eax, %ebx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x63b4
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3390
testb %bl, %bl
jne 0x63f5
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x7e4e(%rip), %rsi      # 0xe216
leaq 0x7e6d(%rip), %rdx      # 0xe23c
movq %rsp, %rdi
callq 0xc5c2
movq %rsp, %rdi
callq 0x58fc
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x63f5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x640c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3390
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x644f
movq 0x10(%rsp), %rsi
jmp 0x6442
jmp 0x644c
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x644f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x644f
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x6466
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/include/Messaging.hpp
// Function: send(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void send(int socket_fd, string &msg) {
	int rsend = 0;
	if(msg == "") {
		string empty_msg = EMPTY_MESSAGE;
		rsend = send(socket_fd, empty_msg.c_str(), empty_msg.length(), 0);
	}
	else {
		rsend = send(socket_fd, msg.c_str(), msg.length(), 0);
	}
	if (rsend < 0) {
		// send failed
		Logging::logError("Messaging::messageHandler: reply FILE_BLOCK_REQUEST, failed to send");
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movl %edi, %ebx
leaq 0x667b(%rip), %rsi      # 0xe09b
movq %r14, %rdi
callq 0x3110
testl %eax, %eax
je 0x7a41
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x31c0
movq %rax, %rbx
jmp 0x7a8f
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x676c(%rip), %rsi      # 0xe1bd
leaq 0x6774(%rip), %rdx      # 0xe1cc
leaq 0x8(%rsp), %rdi
callq 0xc5c2
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x31c0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x7a8f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
testl %ebx, %ebx
jns 0x7ad5
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x6821(%rip), %rsi      # 0xe2c4
leaq 0x685d(%rip), %rdx      # 0xe307
leaq 0x8(%rsp), %rdi
callq 0xc5c2
leaq 0x8(%rsp), %rdi
callq 0x58fc
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x7ad5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x7ae1
jmp 0x7afd
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x7b00
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x7b00
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3650
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: startHelperListening(void*)
void *startHelperListening(void *data) {
	pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
	struct thread_data *my_data;
	my_data = (struct thread_data *)data;
	my_data->helper.listenMessage(my_data->v);

	pthread_exit(NULL);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %edi, %edi
xorl %esi, %esi
callq 0x3530
movq (%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x646e
xorl %edi, %edi
callq 0x3660
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: sendHostResourceInfoToMasterRepeatedly(void*)
void *sendHostResourceInfoToMasterRepeatedly(void *data) {
	xyz_send_host_resource_info_thread_canceled_flag = false;
	pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
	struct thread_data *my_data;
	my_data = (struct thread_data *)data;

	while(true) {
		if (xyz_send_host_resource_info_thread_cancel_flag) {
			xyz_send_host_resource_info_thread_cancel_flag = false;
			xyz_send_host_resource_info_thread_canceled_flag = true;
			break;
		}
		sleep(1);
		my_data->helper.sendHostResourceInfoToMaster(string(my_data->msg));
		sleep(5);
	}

	pthread_exit(NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movb $0x0, 0xb872(%rip)      # 0x133b0
xorl %edi, %edi
xorl %esi, %esi
callq 0x3530
cmpb $0x0, 0xb932(%rip)      # 0x13480
jne 0x7bb0
leaq 0x20(%rsp), %r13
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %r15
movl $0x1, %edi
callq 0x3280
movq (%rbx), %r12
movq 0x8(%rbx), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0xbe6e
movq %r12, %rdi
movq %r14, %rsi
callq 0x7be8
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x7b9d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3390
movl $0x5, %edi
callq 0x3280
cmpb $0x0, 0xb8d2(%rip)      # 0x13480
je 0x7b5f
movb $0x0, 0xb8c9(%rip)      # 0x13480
movb $0x1, 0xb7f2(%rip)      # 0x133b0
xorl %edi, %edi
callq 0x3660
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x7bdf
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
nop
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: SunwayMRHelper::sendHostResourceInfoToMaster(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void SunwayMRHelper::sendHostResourceInfoToMaster(string msg) {
	stringstream ss;
	ss << "SunwayMRHelper: send resource info to master: " << masterAddr << ":"
			<< masterListenPort << ", message: " << msg;
	Logging::logVerbose(ss.str());
	Messaging::sendMessage(masterAddr, masterListenPort, HOST_RESOURCE_INFO, msg);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x48(%rsp), %rdi
callq 0x3240
leaq 0x58(%rsp), %r15
leaq 0x68d8(%rip), %rsi      # 0xe4e8
movl $0x2e, %edx
movq %r15, %rdi
callq 0x3400
movq 0xf0(%r14), %rsi
movq 0xf8(%r14), %rdx
movq %r15, %rdi
callq 0x3400
movq %rax, %r15
leaq 0x6959(%rip), %rsi      # 0xe596
movl $0x1, %edx
movq %rax, %rdi
callq 0x3400
movl 0x130(%r14), %esi
movq %r15, %rdi
callq 0x3610
movq %rax, %r15
leaq 0x68b4(%rip), %rsi      # 0xe517
movl $0xb, %edx
movq %rax, %rdi
callq 0x3400
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r15, %rdi
callq 0x3400
leaq 0x60(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x3590
leaq 0x28(%rsp), %rdi
callq 0x54f4
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7cb3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0xf0(%r14), %rsi
movq 0xf8(%r14), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0xc532
movl 0x130(%r14), %edx
leaq 0x8(%rsp), %rsi
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x633a
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7d04
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xb2a5(%rip), %rsi      # 0x12fb0
leaq 0x48(%rsp), %rdi
callq 0x3260
leaq 0xc8(%rsp), %rdi
callq 0x3150
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7d68
movq 0x18(%rsp), %rsi
jmp 0x7d59
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7d68
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x7d68
jmp 0x7d65
movq %rax, %rbx
movq 0xb241(%rip), %rsi      # 0x12fb0
leaq 0x48(%rsp), %rdi
callq 0x3260
leaq 0xc8(%rsp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3650
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: SunwayMRHelper::init()
bool SunwayMRHelper::init() {
	bool ret = false;

	if (localAddr == masterAddr) {
		Logging::logInfo("SunwayMRHelper: master is self");
		listenPort = masterListenPort;
		ret = initListening(listenPort);

	} else {
		listenPort = randomValue(20001, 29999);
		ret = initListening(listenPort);

		int try_time = 0;
		while (!ret && try_time < 100) {
			try_time++;
			listenPort += 3;

			ret = initListening(listenPort);
		}
	}

	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x118(%rdi), %rdx
cmpq 0xf8(%rdi), %rdx
jne 0x865c
testq %rdx, %rdx
je 0x86b0
movq 0xf0(%rbx), %rsi
movq 0x110(%rbx), %rdi
callq 0x33a0
testl %eax, %eax
je 0x86b0
movl $0x4e21, %edi           # imm = 0x4E21
movl $0x752f, %esi           # imm = 0x752F
callq 0x42e6
movl %eax, 0x13c(%rbx)
movq %rbx, %rdi
movl %eax, %esi
callq 0xa578
testb %al, %al
jne 0x8704
xorl %r14d, %r14d
movl 0x13c(%rbx), %esi
addl $0x3, %esi
movl %esi, 0x13c(%rbx)
movq %rbx, %rdi
callq 0xa578
testb %al, %al
jne 0x8704
leal 0x1(%r14), %ecx
cmpl $0x63, %r14d
movl %ecx, %r14d
jb 0x8686
jmp 0x8704
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x6096(%rip), %rsi      # 0xe756
leaq 0x60ad(%rip), %rdx      # 0xe774
movq %rsp, %r14
movq %r14, %rdi
callq 0xc5c2
movq %r14, %rdi
callq 0x56f8
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x86f0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movl 0x130(%rbx), %esi
movl %esi, 0x13c(%rbx)
movq %rbx, %rdi
callq 0xa578
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x8727
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
nop
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: SunwayMRHelper::initListening(int)
bool SunwayMRHelper::initListening(int port) {
	string msg;
	int listenPort = port;
	struct thread_data *data = new thread_data (*this, "", listenPort);
	pthread_t thread;
	pthread_mutex_init(&mutex_listen_status, NULL);
	pthread_mutex_lock(&mutex_listen_status);
	int rc = pthread_create(&thread, NULL, startHelperListening, (void *)data);
	if (rc){
		Logging::logError("JobScheduler: failed to create thread to listen");
	}

	pthread_mutex_lock(&mutex_listen_status);
	pthread_mutex_unlock(&mutex_listen_status);

	if(getListenStatus() == SUCCESS) {
		setLocalResouce(this->threads, this->memory);
		void *status;
		pthread_join(thread, &status); // always listen

		Logging::logInfo("SunwayMRHelper: listen thread finished");

		return true;
	} else {
		return false;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movl $0x18, %edi
callq 0x3380
movq %rax, %r15
movq %rbx, (%rax)
leaq 0x3ae3(%rip), %rax      # 0xe09b
movq %rax, 0x8(%r15)
movl %ebp, 0x10(%r15)
leaq 0x8(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x3520
movq %r14, %rdi
callq 0x3500
leaq -0x2ad5(%rip), %rdx     # 0x7b08
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rcx
callq 0x3680
testl %eax, %eax
je 0xa62d
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x40ff(%rip), %rsi      # 0xe6ff
leaq 0x4127(%rip), %rdx      # 0xe72e
movq %rsp, %rdi
callq 0xc5c2
movq %rsp, %rdi
callq 0x58fc
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0xa62d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq %r14, %rdi
callq 0x3500
movq %r14, %rdi
callq 0x3290
movl 0xe8(%rbx), %ebp
cmpl $0x1, %ebp
jne 0xa6a8
movl 0x134(%rbx), %esi
movl 0x138(%rbx), %edx
movq %rbx, %rdi
callq 0x87b4
movq 0x20(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x3320
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x40b4(%rip), %rsi      # 0xe72f
leaq 0x40d3(%rip), %rdx      # 0xe755
movq %rsp, %rdi
callq 0xc5c2
movq %rsp, %rdi
callq 0x56f8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0xa6a8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0xa6bf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
cmpl $0x1, %ebp
sete %al
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
jne 0xa6f2
jmp 0xa706
jmp 0xa703
jmp 0xa703
jmp 0xa703
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0xa706
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xa706
jmp 0xa703
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0xa71d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x3650
nop
// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: SunwayMRHelper::update(HostResource)
void SunwayMRHelper::update(HostResource hr) {
	bool updated = false;
	for (unsigned int i=0; i<allResources.size(); i++) {
		if(allResources[i].host == hr.host) {
			allResources[i].threads = hr.threads;
			allResources[i].memory = hr.memory;
			allResources[i].listenPort = hr.listenPort;
			updated = true;
			break;
		}
	}
	if(!updated) {
		allResources.push_back(hr);
	}

	saveLocalHostFile();
	saveAllHostsFile();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq 0x140(%rdi), %r15
movq %rdi, (%rsp)
movq 0x148(%rdi), %rax
subq %r15, %rax
je 0xb1b2
sarq $0x4, %rax
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r12
movq 0x8(%r14), %r13
movl $0x1, %ebp
xorl %eax, %eax
leaq (%rax,%rax,2), %rbx
shlq $0x4, %rbx
movq 0x8(%r15,%rbx), %rdx
cmpq %r13, %rdx
jne 0xb1a9
addq %r15, %rbx
testq %rdx, %rdx
je 0xb1c7
movq (%r14), %rsi
movq (%rbx), %rdi
callq 0x33a0
testl %eax, %eax
je 0xb1c7
movl %ebp, %eax
incl %ebp
cmpq %rax, %r12
ja 0xb180
movq (%rsp), %rbx
leaq 0x140(%rbx), %rdi
movq %r14, %rsi
callq 0xc1a0
jmp 0xb1e0
movl 0x20(%r14), %eax
movl %eax, 0x20(%rbx)
movl 0x24(%r14), %eax
movl %eax, 0x24(%rbx)
movl 0x28(%r14), %eax
movl %eax, 0x28(%rbx)
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0xb1fe
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb50a
// File: /workspace/github_cpp_makefile_star2_O1/ArashPartow[P]exprtk/exprtk_benchmark.cpp
// Function: load_expression_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
inline std::size_t load_expression_file(const std::string& file_name, std::deque<std::string>& expression_list)
{
   std::ifstream stream(file_name.c_str());

   if (!stream) return 0;

   std::string buffer;
   buffer.reserve(1024);
   std::size_t line_count = 0;

   while (std::getline(stream,buffer))
   {
      if (buffer.empty())
         continue;
      else if ('#' == buffer[0])
         continue;

      ++line_count;
      expression_list.push_back(buffer);
   }

   return line_count;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rsi, %rbx
movq (%rdi), %rsi
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x11a050
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x48(%rsp,%rax)
je 0x12240e
xorl %r14d, %r14d
jmp 0x1224a6
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0x8(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x11a410
xorl %r14d, %r14d
leaq 0x8(%rsp), %r12
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x11a540
movsbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x11a030
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x12248f
cmpq $0x0, 0x10(%rsp)
je 0x12243b
movq 0x8(%rsp), %rax
cmpb $0x23, (%rax)
je 0x12243b
incq %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0x124b2c
jmp 0x12243b
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1224a6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x11a0c0
leaq 0x28(%rsp), %rdi
callq 0x11a040
movq %r14, %rax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1224c8
jmp 0x1224c8
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1224e2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x11a0c0
leaq 0x28(%rsp), %rdi
callq 0x11a040
movq %rbx, %rdi
callq 0x11a340
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/mshview/mshview.cpp
// Function: GLUTSpecial(int, int, int)
void GLUTSpecial(int key, int x, int y)
{
  // Invert y coordinate
  y = GLUTwindow_height - y;

  // Process keyboard button event 
  switch(key) {
  case GLUT_KEY_DOWN:
    if (current_mesh <= 1) current_mesh = 0;
    else current_mesh--;
    break;
    
  case GLUT_KEY_UP:
    if (current_mesh >= meshes.NEntries()-2) current_mesh = meshes.NEntries()-1;
    else current_mesh++;
    break;
  }
  
  // Remember mouse position 
  GLUTmouse[0] = x;
  GLUTmouse[1] = y;

  // Remember modifiers 
  GLUTmodifiers = glutGetModifiers();

  // Redraw
  glutPostRedisplay();
}

// Assembly:
movl 0x118c7b(%rip), %eax    # 0x13f9bc
cmpl $0x65, %edi
je 0x26d60
cmpl $0x67, %edi
jne 0x26d83
movl 0x118c5f(%rip), %edi    # 0x13f9b0
leal -0x1(%rdi), %r8d
xorl %ecx, %ecx
cmpl $0x2, %edi
cmovgel %r8d, %ecx
jmp 0x26d7d
movl 0x118c4a(%rip), %edi    # 0x13f9b0
movl 0x11db88(%rip), %ecx    # 0x1448f4
leal -0x2(%rcx), %r8d
cmpl %r8d, %edi
jge 0x26d7b
incl %edi
movl %edi, %ecx
jmp 0x26d7d
decl %ecx
movl %ecx, 0x118c2d(%rip)    # 0x13f9b0
pushq %rax
subl %edx, %eax
movl %esi, 0x11e2a4(%rip)    # 0x145030
movl %eax, 0x11e2a2(%rip)    # 0x145034
callq 0xd3c50
popq %rax
jmp 0xced08
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/mshview/mshview.cpp
// Function: GLUTMainLoop()
void GLUTMainLoop(void)
{
  // Set world origin
  if (initial_world_origin != R3unknown_point) {
    world_origin = initial_world_origin;
  }
  else if (meshes.NEntries() > 0) {
    world_origin = meshes[0]->BBox().Centroid();
  }

  // Run main loop -- never returns 
  glutMainLoop();
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
leaq 0x11d58e(%rip), %rdi    # 0x1448d0
leaq 0x121197(%rip), %rsi    # 0x1484e0
callq 0x75ca4
testl %eax, %eax
je 0x27362
leaq 0x11d59f(%rip), %rdi    # 0x1448f8
leaq 0x11d570(%rip), %rsi    # 0x1448d0
jmp 0x27398
cmpl $0x0, 0x11d58b(%rip)    # 0x1448f4
jle 0x2739d
movq 0x11d576(%rip), %rax    # 0x1448e8
movq (%rax), %rsi
movq 0xf8(%rsi), %rax
addq $0xf8, %rsi
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq *0x68(%rax)
leaq 0x11d563(%rip), %rdi    # 0x1448f8
movq %rbx, %rsi
callq 0x75f1c
callq 0xd1fc7
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/mshview/mshview.cpp
// Function: ReadMeshes(gaps::RNArray<char*> const&)
int
ReadMeshes(const RNArray<char *>& mesh_names)
{
  // Read each mesh
  for (int i = 0; i < mesh_names.NEntries(); i++) {
    char *mesh_name = mesh_names[i];

    // Allocate mesh
    R3Mesh *mesh = new R3Mesh();
    assert(mesh);

    // Read mesh from file
    if (!mesh->ReadFile(mesh_name)) {
      delete mesh;
      return 0;
    }

    // Add mesh to list
    meshes.Insert(mesh);

    // Print statistics
    if (print_verbose) {
      printf("Read mesh from %s ...\n", mesh_name);
      printf("  # Faces = %d\n", mesh->NFaces());
      printf("  # Edges = %d\n", mesh->NEdges());
      printf("  # Vertices = %d\n", mesh->NVertices());
      fflush(stdout);
    }
  }

  // Return number of meshes
  return meshes.NEntries();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0xc(%rdi)
setg %bpl
jle 0x27491
movq %rdi, %rbx
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %r13
movl $0x138, %edi            # imm = 0x138
callq 0x218b0
movq %rax, %r15
movq %rax, %rdi
callq 0x51304
movq (%r15), %rax
movq %r15, %rdi
movq %r13, %rsi
callq *0x180(%rax)
movl %eax, %r12d
testl %eax, %eax
je 0x2746f
movl 0x11d4f5(%rip), %edx    # 0x1448f4
leaq 0x11d4e2(%rip), %rdi    # 0x1448e8
movq %r15, %rsi
callq 0x88046
cmpb $0x1, 0x11dc4f(%rip)    # 0x145064
jne 0x27478
leaq 0xb4e4e(%rip), %rdi     # 0xdc26c
movq %r13, %rsi
xorl %eax, %eax
callq 0x21080
movl 0x34(%r15), %esi
leaq 0xb4e50(%rip), %rdi     # 0xdc283
xorl %eax, %eax
callq 0x21080
movl 0x24(%r15), %esi
leaq 0xb4e4e(%rip), %rdi     # 0xdc293
xorl %eax, %eax
callq 0x21080
movl 0x14(%r15), %esi
leaq 0xb4e4c(%rip), %rdi     # 0xdc2a3
xorl %eax, %eax
callq 0x21080
movq 0x117abb(%rip), %rax    # 0x13ef20
movq (%rax), %rdi
callq 0x21a90
jmp 0x27478
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
testl %r12d, %r12d
je 0x27491
incq %r14
movslq 0xc(%rbx), %rax
cmpq %rax, %r14
setl %bpl
jl 0x273c7
xorl %eax, %eax
testb $0x1, %bpl
jne 0x2749f
movl 0x11d455(%rip), %eax    # 0x1448f4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x138, %esi            # imm = 0x138
movq %r15, %rdi
callq 0x218d0
movq %rbx, %rdi
callq 0x220b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/mshview/mshview.cpp
// Function: main
int main(int argc, char **argv)
{
  // Initialize packages
  if (!R3InitGraphics()) exit(-1);

  // Parse program arguments
  if (!ParseArgs(argc, argv)) exit(-1);

  // Initialize GLUT
  GLUTInit(&argc, argv);

  // Read mesh
  if (!ReadMeshes(mesh_names)) exit(-1);

  // Create viewer
  viewer = CreateBirdsEyeViewer(meshes[0]);
  if (!viewer) exit(-1);

  // Run GLUT interface
  GLUTMainLoop();

  // Return success 
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %rbx
movl %edi, 0x4(%rsp)
callq 0x27b34
testl %eax, %eax
je 0x27af9
movl 0x4(%rsp), %edi
movq %rbx, %rsi
callq 0x274c6
testl %eax, %eax
je 0x27af9
leaq 0x4(%rsp), %rdi
movq %rbx, %rsi
callq 0x271d1
leaq 0x11cea4(%rip), %rdi    # 0x144860
callq 0x273a8
testl %eax, %eax
je 0x27af9
movq 0x11cf18(%rip), %rax    # 0x1448e8
movl $0xf8, %esi
addq (%rax), %rsi
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x6d3e0
movq %rbx, %rdi
callq 0x6da60
mulsd 0xb462b(%rip), %xmm0    # 0xdc020
movsd %xmm0, 0x8(%rsp)
cmpb $0x0, 0x11d666(%rip)    # 0x145068
jne 0x27a57
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x6dc22
movsd 0xb4655(%rip), %xmm0    # 0xdc070
mulsd 0x8(%rsp), %xmm0
leaq 0x11ce78(%rip), %rsi    # 0x1448a0
leaq 0x28(%rsp), %rdi
callq 0x77016
leaq 0x78(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x765d5
leaq 0x11ce3b(%rip), %rdi    # 0x144888
leaq 0x78(%rsp), %rsi
callq 0x75f1c
movsd 0xb45d1(%rip), %xmm2    # 0xdc030
movsd 0x8(%rsp), %xmm3
mulsd %xmm3, %xmm2
mulsd 0xb4607(%rip), %xmm3    # 0xdc078
leaq 0x11ce10(%rip), %rsi    # 0x144888
leaq 0x11ce21(%rip), %rdx    # 0x1448a0
leaq 0x11ce32(%rip), %rcx    # 0x1448b8
leaq 0x78(%rsp), %rdi
movsd 0xb45cd(%rip), %xmm0    # 0xdc060
movapd %xmm0, %xmm1
callq 0x29544
movl 0x117f16(%rip), %ecx    # 0x13f9b8
movl 0x117f13(%rip), %r8d    # 0x13f9bc
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2a27a
movl $0xa8, %edi
callq 0x218b0
movq %rax, %r14
leaq 0x78(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rax, %rdi
callq 0x27bf8
leaq 0x40(%rsp), %rdi
callq 0x6e238
movq %r14, 0x11d4f1(%rip)    # 0x144fd8
callq 0x27336
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21af0
jmp 0x27b1d
movq %rax, %rbx
movl $0xa8, %esi
movq %r14, %rdi
callq 0x218d0
jmp 0x27b20
jmp 0x27b1d
jmp 0x27b1d
jmp 0x27b1d
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6e238
movq %rbx, %rdi
callq 0x220b0
nop