LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: getLocalHost[abi:cxx11]()
string getLocalHost() {
	string ret = "";

    struct ifaddrs * ifAddrStruct=NULL;
    struct ifaddrs * ifa=NULL;
    void * tmpAddrPtr=NULL;

    getifaddrs(&ifAddrStruct);

    for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next) {
        if (!ifa->ifa_addr) {
            continue;
        }
        if (ifa->ifa_addr->sa_family == AF_INET) { // check it is IP4
            // is a valid IP4 Address
            tmpAddrPtr=&((struct sockaddr_in *)ifa->ifa_addr)->sin_addr;
            char addressBuffer[INET_ADDRSTRLEN];
            inet_ntop(AF_INET, tmpAddrPtr, addressBuffer, INET_ADDRSTRLEN);
            //printf("%s IP Address %s\n", ifa->ifa_name, addressBuffer);

            string temp = string(addressBuffer);
            string lo = "127.0.0.1";
            if (temp.compare(0, lo.size(), lo)!=0) {
            	ret = temp;
            	break;
            }

        } else if (ifa->ifa_addr->sa_family == AF_INET6) { // check it is IP6
            // is a valid IP6 Address
            tmpAddrPtr=&((struct sockaddr_in6 *)ifa->ifa_addr)->sin6_addr;
            char addressBuffer[INET6_ADDRSTRLEN];
            inet_ntop(AF_INET6, tmpAddrPtr, addressBuffer, INET6_ADDRSTRLEN);
            //printf("%s IP Address %s\n", ifa->ifa_name, addressBuffer);
        }
    }
    if (ifAddrStruct!=NULL) freeifaddrs(ifAddrStruct);

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
leaq 0x808f(%rip), %rsi      # 0xc09b
leaq 0x40(%rsp), %r14
movq %rdi, 0x10(%rsp)
movq %r14, %rdx
callq 0x915a
leaq 0x18(%rsp), %r15
andq $0x0, (%r15)
movq %r15, %rdi
callq 0x3670
leaq 0x70(%rsp), %rbx
leaq 0x20(%rsp), %r12
leaq 0x7fef(%rip), %r13      # 0xc02f
leaq 0xf(%rsp), %rbp
movq (%r15), %r15
testq %r15, %r15
je 0x40f7
movq 0x18(%r15), %rsi
testq %rsi, %rsi
je 0x4045
movzwl (%rsi), %eax
cmpl $0xa, %eax
je 0x40bd
cmpl $0x2, %eax
jne 0x4045
addq $0x4, %rsi
pushq $0x2
popq %rdi
movq %rbx, %rdx
pushq $0x10
popq %rcx
callq 0x33b0
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x915a
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x915a
movq 0x28(%rsp), %rdx
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rcx
callq 0x3460
testl %eax, %eax
jne 0x40d4
movq %r12, %rdi
callq 0x36e8
movq %r14, %rdi
callq 0x36e8
jmp 0x4045
addq $0x8, %rsi
pushq $0xa
popq %rdi
movq %r14, %rdx
pushq $0x2e
popq %rcx
callq 0x33b0
jmp 0x4045
leaq 0x40(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x31e0
leaq 0x20(%rsp), %rdi
callq 0x36e8
leaq 0x40(%rsp), %rdi
callq 0x36e8
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x4106
callq 0x3600
movq 0x10(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x411f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x36e8
jmp 0x4131
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x36e8
jmp 0x4140
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: mkdirRecursive(char const*)
void mkdirRecursive(const char *dir) {
        char tmp[256];
        char *p = NULL;
        size_t len;

        snprintf(tmp, sizeof(tmp),"%s",dir);
        len = strlen(tmp);
        if(tmp[len - 1] == '/')
                tmp[len - 1] = 0;
        for(p = tmp + 1; *p; p++)
                if(*p == '/') {
                        *p = 0;
                        mkdir(tmp, S_IRWXU);
                        *p = '/';
                }
        mkdir(tmp, S_IRWXU);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %rcx
leaq 0x7ed2(%rip), %rdx      # 0xc039
xorl %ebp, %ebp
movq %rsp, %rbx
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3580
movq %rbx, %rdi
callq 0x3170
movzbl -0x1(%rax,%rbx), %ecx
cmpb $0x2f, %cl
cmovel %ebp, %ecx
movb %cl, -0x1(%rax,%rbx)
leaq 0x1(%rsp), %r14
movzbl (%r14), %eax
cmpl $0x2f, %eax
je 0x41a6
testl %eax, %eax
jne 0x41bb
jmp 0x41c0
movb $0x0, (%r14)
movq %rbx, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x31a0
movb $0x2f, (%r14)
incq %r14
jmp 0x4197
movq %rsp, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x31a0
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: writeFile(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>>)
bool writeFile(string dir, string fileName, string content) {
	mkdirRecursive(dir.c_str());
	ofstream file;
	string fullPath = dir + fileName;
	file.open(fullPath.c_str(), ios::out | ios::trunc);
	if (file.is_open()) {
		file << content;
		file.close();
		return true;
	} else {
		return false;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
callq 0x4152
leaq 0x28(%rsp), %rdi
callq 0x35d0
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x9195
movq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
pushq $0x30
popq %rdx
callq 0x3060
leaq 0x98(%rsp), %rdi
callq 0x30c0
movl %eax, %ebp
testb %al, %al
je 0x424d
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x3300
leaq 0x28(%rsp), %rdi
callq 0x34b0
leaq 0x8(%rsp), %rdi
callq 0x36e8
leaq 0x28(%rsp), %rdi
callq 0x34e0
movl %ebp, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4283
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x36e8
leaq 0x28(%rsp), %rdi
callq 0x34e0
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: readFile(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 readFile(string path, string &content) {
	std::ifstream file(path.c_str(), std::ifstream::in);
	if (file.is_open()) {
		std::stringstream buffer;
		buffer << file.rdbuf();
		content = buffer.str();
		file.close();
		return true;
	} else {
		return false;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x3b0, %rsp            # imm = 0x3B0
movq %rsi, %r14
movq (%rdi), %rsi
leaq 0x1a8(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x3650
leaq 0x220(%rsp), %rdi
callq 0x30c0
movl %eax, %ebx
testb %al, %al
je 0x4320
leaq 0x20(%rsp), %rdi
callq 0x3230
leaq 0x30(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0x30b0
leaq 0x38(%rsp), %rsi
movq %rsp, %rdi
callq 0x3550
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3410
movq %r15, %rdi
callq 0x36e8
leaq 0x1a8(%rsp), %rdi
callq 0x30a0
leaq 0x20(%rsp), %rdi
callq 0x3260
leaq 0x1a8(%rsp), %rdi
callq 0x30f0
movl %ebx, %eax
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbx
popq %r14
popq %r15
retq
jmp 0x4343
movq %rax, %rbx
jmp 0x4350
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3260
leaq 0x1a8(%rsp), %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: readFile(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 readFile(string path, int offset, int length, string &content) {
	std::ifstream file(path.c_str(), std::ifstream::in);
	if (file.is_open()) {
		char *buffer = new char [length];
		file.seekg(offset);
		file.read (buffer,length);

		std::stringstream ss;
		ss << buffer;
		content = ss.str();

		file.close();
		delete []buffer;
		return true;
	} else {
		return false;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x3b0, %rsp            # imm = 0x3B0
movq %rcx, %r14
movl %edx, %r15d
movl %esi, %ebp
movq (%rdi), %rsi
leaq 0x20(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x3650
leaq 0x98(%rsp), %rdi
callq 0x30c0
movl %eax, %ebx
testb %al, %al
je 0x4432
movslq %r15d, %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
movslq %ebp, %rsi
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
callq 0x3430
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3420
leaq 0x228(%rsp), %rdi
callq 0x3230
leaq 0x238(%rsp), %rdi
movq %r15, %rsi
callq 0x3360
leaq 0x240(%rsp), %rsi
movq %rsp, %rdi
callq 0x3550
movq %rsp, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x3410
movq %r12, %rdi
callq 0x36e8
leaq 0x20(%rsp), %rdi
callq 0x30a0
movq %r15, %rdi
callq 0x3440
leaq 0x228(%rsp), %rdi
callq 0x3260
leaq 0x20(%rsp), %rdi
callq 0x30f0
movl %ebx, %eax
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4452
jmp 0x4464
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0x3260
jmp 0x4467
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: readFileToLines(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 readFileToLines(string path, vector<string> &content) {
	std::ifstream file(path.c_str(), std::ifstream::in);
	if (file.is_open()) {
		std::string line;
		while (std::getline(file, line)) {
			content.push_back(line);
		}

		file.close();
		return true;
	} else {
		return false;
	}

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %r14
movq (%rdi), %rsi
leaq 0x20(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x3650
leaq 0x98(%rsp), %rdi
callq 0x30c0
movl %eax, %ebx
testb %al, %al
je 0x44fe
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x20(%rsp), %r15
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3090
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x44ec
movq %r14, %rdi
movq %r12, %rsi
callq 0x9022
jmp 0x44c6
leaq 0x20(%rsp), %rdi
callq 0x30a0
movq %rsp, %rdi
callq 0x36e8
leaq 0x20(%rsp), %rdi
callq 0x30f0
movl %ebx, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x451b
movq %rax, %rbx
movq %rsp, %rdi
callq 0x36e8
leaq 0x20(%rsp), %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: readFileByLineNumber(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 readFileByLineNumber(string path, int offset, int length, string &content) {
	std::ifstream file(path.c_str(), std::ifstream::in);
	if (file.is_open()) {
		int lines_count =0;
		std::string line;
		std::stringstream ss;
		while (std::getline(file , line)) {
			if (lines_count >= offset && lines_count < offset + length) {
				ss << line << endl;
			}
			++lines_count;
			if (lines_count >= offset+length) break;
		}
		content = ss.str();
		file.close();
		return true;
	} else {
		return false;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rcx, %r14
movl %edx, %ebp
movl %esi, %r15d
movq (%rdi), %rsi
leaq 0x1e0(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x3650
leaq 0x258(%rsp), %rdi
callq 0x30c0
movl %eax, %ebx
testb %al, %al
je 0x4648
movq %r14, 0x10(%rsp)
movb %bl, 0xf(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x58(%rsp), %rdi
callq 0x3230
addl %r15d, %ebp
xorl %ebx, %ebx
leaq 0x68(%rsp), %r12
leaq 0x1e0(%rsp), %r13
leaq 0x18(%rsp), %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x3090
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x45fa
cmpl %r15d, %ebx
setge %al
cmpl %ebp, %ebx
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x45f4
movq %r12, %rdi
movq %r14, %rsi
callq 0x3300
movq %rax, %rdi
callq 0x31b0
incl %ebx
cmpl %ebp, %ebx
jl 0x45b6
leaq 0x70(%rsp), %rsi
leaq 0x38(%rsp), %rdi
callq 0x3550
leaq 0x38(%rsp), %r14
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x3410
movq %r14, %rdi
callq 0x36e8
leaq 0x1e0(%rsp), %rdi
callq 0x30a0
leaq 0x58(%rsp), %rdi
callq 0x3260
leaq 0x18(%rsp), %rdi
callq 0x36e8
movb 0xf(%rsp), %bl
leaq 0x1e0(%rsp), %rdi
callq 0x30f0
movl %ebx, %eax
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4672
jmp 0x4672
movq %rax, %rbx
jmp 0x467f
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3260
leaq 0x18(%rsp), %rdi
callq 0x36e8
leaq 0x1e0(%rsp), %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: getFileLength(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, long&)
bool getFileLength(string path,  long &size) {
	std::ifstream file(path.c_str(), std::ifstream::ate | std::ifstream::binary);
	if (file.is_open()) {
		size = file.tellg();
		file.close();
		return true;
	} else {
		return false;
	}
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq (%rdi), %rsi
movq %rsp, %rdi
pushq $0x6
popq %rdx
callq 0x3650
leaq 0x78(%rsp), %rdi
callq 0x30c0
movl %eax, %ebp
testb %al, %al
je 0x46db
movq %rsp, %rdi
callq 0x35f0
movq %rax, (%rbx)
movq %rsp, %rdi
callq 0x30a0
movq %rsp, %rdi
callq 0x30f0
movl %ebp, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %rbp
retq
jmp 0x46f1
movq %rax, %rbx
movq %rsp, %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x38, %rsp
movl %esi, %ecx
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movb $0x0, 0x20(%r14)
leaq 0x7845(%rip), %rdx      # 0xc03c
pushq $0x21
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x3580
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x915a
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x38, %rsp
movq %rsi, %rcx
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movb $0x0, 0x20(%r14)
leaq 0x77f6(%rip), %rdx      # 0xc03f
pushq $0x21
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x3580
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x915a
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movslq 0x8(%rsi), %rax
movq %rax, 0x10(%rsp)
movslq 0x8(%rdx), %rax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
movq %rcx, %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x36d0
movq %rax, %r13
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x36d0
movq %rax, %r14
cmpq $-0x1, %rax
je 0x48e6
cmpq %r14, %r13
jae 0x48d8
incl %ebp
addq 0x10(%rsp), %r13
jmp 0x48a2
cmpl $0x2, %ebp
jl 0x48e6
decl %ebp
addq 0x8(%rsp), %r14
jmp 0x48a2
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/include/Utils.hpp
// Function: splitStringByDelimitationCouple(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>>)
vector<string> splitStringByDelimitationCouple(string str, string delim_l, string delim_r) {
	vector<string> vs;
	string::size_type pos1 = 0;
	string::size_type pos2 = 0;
	int len_l = delim_l.length(), len_r = delim_r.length();
	pos2 = findDelimitationCouplePosition(str, delim_l, delim_r, pos1);
	while (pos2 != string::npos) {
		vs.push_back(str.substr(pos1+len_l, pos2-pos1-len_l));
		pos1 = pos2 + len_r;
		pos2 = findDelimitationCouplePosition(str, delim_l, delim_r, pos1);
	}
	return vs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movq %rdi, 0x10(%rsp)
movups %xmm0, (%rdi)
movq 0x8(%rdx), %r14
movq %rcx, 0x18(%rsp)
movq 0x8(%rcx), %rbp
leaq 0x58(%rsp), %rdi
movq %rsi, 0x20(%rsp)
callq 0x3490
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0x3490
movq %r14, 0x8(%rsp)
movq %rbx, 0x30(%rsp)
leaq 0xd8(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x3490
xorl %r13d, %r13d
leaq 0x58(%rsp), %rbx
leaq 0x38(%rsp), %r14
leaq 0xd8(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x4871
movq %rax, %r12
movq %r15, %rdi
callq 0x36e8
movq %r14, %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x36e8
movslq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
movslq %ebp, %rax
movq %rax, 0x28(%rsp)
leaq 0xb8(%rsp), %rbp
leaq 0x98(%rsp), %rbx
leaq 0x78(%rsp), %r14
leaq 0xf8(%rsp), %r15
cmpq $-0x1, %r12
je 0x4a6a
addq 0x8(%rsp), %r13
movq %r12, %rcx
subq %r13, %rcx
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
movq %r13, %rdx
callq 0x3390
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x9c84
movq %rbp, %rdi
callq 0x36e8
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x3490
movq %r14, %rdi
movq 0x30(%rsp), %rsi
callq 0x3490
movq %r15, %rdi
movq 0x18(%rsp), %rsi
callq 0x3490
movq %r12, %r13
addq 0x28(%rsp), %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x4871
movq %rax, %r12
movq %r15, %rdi
callq 0x36e8
movq %r14, %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x36e8
jmp 0x49d0
movq 0x10(%rsp), %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x36e8
jmp 0x4a93
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x4ac5
jmp 0x4acc
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x4ac5
jmp 0x4acc
movq %rax, %rbx
jmp 0x4abd
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x36e8
leaq 0x98(%rsp), %rdi
callq 0x36e8
jmp 0x4acf
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x904e
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq (%rdi), %rdi
callq 0x3510
movq %rax, %r14
testq %rax, %rax
je 0x4b5d
leaq 0x8(%rsp), %r15
leaq 0x7(%rsp), %r12
movq %r14, %rdi
callq 0x3520
testq %rax, %rax
je 0x4b55
cmpb $0x2e, 0x13(%rax)
jne 0x4b2e
cmpb $0x0, 0x14(%rax)
je 0x4b09
cmpb $0x2e, 0x14(%rax)
jne 0x4b2e
cmpb $0x0, 0x15(%rax)
je 0x4b09
addq $0x13, %rax
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x915a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9022
movq %r15, %rdi
callq 0x36e8
jmp 0x4b09
movq %r14, %rdi
callq 0x3590
testq %r14, %r14
setne %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq (%rdi), %rdi
callq 0x3510
movq %rax, %rbx
testq %rax, %rax
je 0x4c31
leaq 0x10(%rsp), %r12
leaq 0xf(%rsp), %r13
movq %rbx, %rdi
callq 0x3520
testq %rax, %rax
je 0x4c15
cmpb $0x2e, 0x13(%rax)
jne 0x4bda
cmpb $0x0, 0x14(%rax)
je 0x4bb5
cmpb $0x2e, 0x14(%rax)
jne 0x4bda
cmpb $0x0, 0x15(%rax)
je 0x4bb5
addq $0x13, %rax
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x915a
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x36d0
cmpq 0x18(%rsp), %rax
jae 0x4c0b
movq %r15, %rdi
movq %r12, %rsi
callq 0x9022
movq %r12, %rdi
callq 0x36e8
jmp 0x4bb5
movq %rbx, %rdi
callq 0x3590
testq %rbx, %rbx
setne %al
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x740b(%rip), %rdi      # 0xc043
callq 0x32d0
jmp 0x4c1d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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
movsbl (%rcx), %edx
testl %edx, %edx
je 0x4c6a
imull $0x65, %eax, %eax
incq %rcx
addl %edx, %eax
jmp 0x4c59
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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, 0xd6f4(%rip)      # 0x12380
jg 0x4cff
movq %rdi, %rbx
leaq 0xd728(%rip), %rdi      # 0x123c0
callq 0x34d0
movq 0xd334(%rip), %rdi      # 0x11fd8
leaq 0x75af(%rip), %rsi      # 0xc25a
callq 0x3360
movq %rax, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0x3f41
movq %r14, %rdi
movq %r15, %rsi
callq 0x3300
leaq 0x7381(%rip), %rsi      # 0xc051
movq %rax, %rdi
callq 0x3360
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3300
movq %rax, %rdi
callq 0x31b0
movq %rsp, %rdi
callq 0x36e8
leaq 0xd6c6(%rip), %rdi      # 0x123c0
callq 0x3280
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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, 0xd654(%rip)      # 0x12380
jg 0x4d9f
movq %rdi, %rbx
leaq 0xd688(%rip), %rdi      # 0x123c0
callq 0x34d0
movq 0xd294(%rip), %rdi      # 0x11fd8
leaq 0x750f(%rip), %rsi      # 0xc25a
callq 0x3360
movq %rax, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0x3f41
movq %r14, %rdi
movq %r15, %rsi
callq 0x3300
leaq 0x72ee(%rip), %rsi      # 0xc05e
movq %rax, %rdi
callq 0x3360
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3300
movq %rax, %rdi
callq 0x31b0
movq %rsp, %rdi
callq 0x36e8
leaq 0xd626(%rip), %rdi      # 0x123c0
callq 0x3280
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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, 0xd5b4(%rip)      # 0x12380
jg 0x4e3f
movq %rdi, %rbx
leaq 0xd5e8(%rip), %rdi      # 0x123c0
callq 0x34d0
movq 0xd1f4(%rip), %rdi      # 0x11fd8
leaq 0x746f(%rip), %rsi      # 0xc25a
callq 0x3360
movq %rax, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0x3f41
movq %r14, %rdi
movq %r15, %rsi
callq 0x3300
leaq 0x7259(%rip), %rsi      # 0xc069
movq %rax, %rdi
callq 0x3360
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3300
movq %rax, %rdi
callq 0x31b0
movq %rsp, %rdi
callq 0x36e8
leaq 0xd586(%rip), %rdi      # 0x123c0
callq 0x3280
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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, 0xd514(%rip)      # 0x12380
jg 0x4edf
movq %rdi, %rbx
leaq 0xd548(%rip), %rdi      # 0x123c0
callq 0x34d0
movq 0xd154(%rip), %rdi      # 0x11fd8
leaq 0x73cf(%rip), %rsi      # 0xc25a
callq 0x3360
movq %rax, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0x3f41
movq %r14, %rdi
movq %r15, %rsi
callq 0x3300
leaq 0x71c3(%rip), %rsi      # 0xc073
movq %rax, %rdi
callq 0x3360
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3300
movq %rax, %rdi
callq 0x31b0
movq %rsp, %rdi
callq 0x36e8
leaq 0xd4e6(%rip), %rdi      # 0x123c0
callq 0x3280
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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, 0xd474(%rip)      # 0x12380
jg 0x4f7f
movq %rdi, %rbx
leaq 0xd4a8(%rip), %rdi      # 0x123c0
callq 0x34d0
movq 0xd0b4(%rip), %rdi      # 0x11fd8
leaq 0x732f(%rip), %rsi      # 0xc25a
callq 0x3360
movq %rax, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0x3f41
movq %r14, %rdi
movq %r15, %rsi
callq 0x3300
leaq 0x7130(%rip), %rsi      # 0xc080
movq %rax, %rdi
callq 0x3360
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3300
movq %rax, %rdi
callq 0x31b0
movq %rsp, %rdi
callq 0x36e8
leaq 0xd446(%rip), %rdi      # 0x123c0
callq 0x3280
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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
movq 0x70(%rdi), %r15
leaq 0x60(%rdi), %r13
pushq $0x20
popq %r14
cmpq %r13, %r15
je 0x50c0
movq 0x40(%r15), %r12
testq %r12, %r12
je 0x50a8
movq %r12, %rdi
callq 0x36e8
movq %r12, %rdi
movq %r14, %rsi
callq 0x3380
movq %r15, %rdi
callq 0x3220
movq %rax, %r15
jmp 0x5092
leaq 0x58(%rbx), %rdi
callq 0x9d7a
movq 0xa0(%rbx), %r15
leaq 0x90(%rbx), %r13
pushq $0x18
popq %r14
cmpq %r13, %r15
je 0x5109
movq 0x40(%r15), %r12
testq %r12, %r12
je 0x50f1
movq %r12, %rdi
callq 0x904e
movq %r12, %rdi
movq %r14, %rsi
callq 0x3380
movq %r15, %rdi
callq 0x3220
movq %rax, %r15
jmp 0x50db
addq $0x88, %rbx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x9da8
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xd0(%rdi), %r15
leaq 0xc0(%rdi), %r13
pushq $0x18
popq %r14
cmpq %r13, %r15
je 0x5198
xorl %ebp, %ebp
movl %ebp, %ebp
movq 0x28(%r15), %rax
movq 0x30(%r15), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rbp, %rdx
jbe 0x5182
movq (%rax,%rbp,8), %r12
testq %r12, %r12
je 0x5173
movq %r12, %rdi
callq 0x904e
movq %r12, %rdi
movq %r14, %rsi
callq 0x3380
incl %ebp
jmp 0x5149
cmpq %rax, %rcx
je 0x518b
movq %rax, 0x30(%r15)
movq %r15, %rdi
callq 0x3220
movq %rax, %r15
jmp 0x5142
addq $0xb8, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9dd6
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x400058, %rsp         # imm = 0x400058
movq %rsi, %rbx
movl %edi, %ebp
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
andq $0x0, 0x10(%r14)
movaps %xmm0, (%r14)
leaq 0x50(%rsp), %r15
leaq 0x30(%rsp), %r12
leaq 0xf(%rsp), %r13
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
testq %rax, %rax
jle 0x5233
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x915a
movq %r14, %rdi
movq %r12, %rsi
callq 0x9c84
movq %r12, %rdi
callq 0x36e8
jmp 0x51eb
leaq 0x6e61(%rip), %rsi      # 0xc09b
movq %rbx, %rdi
callq 0x36a0
xorl %r14d, %r14d
movl %r14d, %r14d
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r14, %rax
jbe 0x5275
movq %r14, %rax
shlq $0x5, %rax
addq %rax, %rsi
movq %rbx, %rdi
callq 0x36b0
incl %r14d
jmp 0x5245
leaq 0x10(%rsp), %rdi
callq 0x904e
addq $0x400058, %rsp         # imm = 0x400058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x52a6
jmp 0x52a6
jmp 0x52a6
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x36e8
jmp 0x52a9
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x904e
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x28, %rsp
leaq 0x6dc2(%rip), %rsi      # 0xc08b
pushq $0x10
popq %rdx
xorl %ecx, %ecx
callq 0x31c0
movq %rax, %rbx
testl %ebx, %ebx
jns 0x5305
leaq 0x6dbb(%rip), %rsi      # 0xc09c
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x915a
movq %r14, %rdi
callq 0x4efc
leaq 0x8(%rsp), %rdi
callq 0x36e8
testl %ebx, %ebx
setns %al
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x70, %rsp
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x30(%rsp), %rdi
callq 0x3490
leaq 0x30(%rsp), %rsi
leaq 0x50(%rsp), %r9
movl %r14d, %edx
movl %ebp, %ecx
movq %rbx, %r8
callq 0x550a
movl %eax, %ebx
leaq 0x30(%rsp), %rdi
callq 0x36e8
testb %bl, %bl
jne 0x573c
leaq 0x6afd(%rip), %rsi      # 0xc216
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x915a
leaq 0x10(%rsp), %rdi
callq 0x4efc
leaq 0x10(%rsp), %rdi
callq 0x36e8
leaq 0x50(%rsp), %rdi
callq 0x36e8
movl %ebx, %eax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x5765
jmp 0x576c
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x36e8
jmp 0x576f
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5ae1(%rip), %rsi      # 0xc09b
movq %r14, %rdi
callq 0x91d8
testb %al, %al
je 0x65fe
leaq 0x5bf0(%rip), %rsi      # 0xc1bd
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x915a
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x31c0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x36e8
jmp 0x6611
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x31c0
movq %rax, %rbx
testl %ebx, %ebx
jns 0x663f
leaq 0x5ca8(%rip), %rsi      # 0xc2c4
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x915a
leaq 0x8(%rsp), %rdi
callq 0x4efc
leaq 0x8(%rsp), %rdi
callq 0x36e8
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x664b
jmp 0x665a
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x36e8
jmp 0x665d
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3500
movq (%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x5782
xorl %edi, %edi
callq 0x3620
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movb $0x0, 0xbd04(%rip)      # 0x123a0
xorl %edi, %edi
xorl %esi, %esi
callq 0x3500
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %r15
pushq $0x5
popq %r12
cmpb $0x1, 0xbdb3(%rip)      # 0x12470
je 0x66f5
movl %ebp, %edi
callq 0x3270
movq (%rbx), %r13
movq 0x8(%rbx), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x915a
movq %r13, %rdi
movq %r14, %rsi
callq 0x6720
movq %r14, %rdi
callq 0x36e8
movl %r12d, %edi
callq 0x3270
jmp 0x66b6
movb $0x0, 0xbd74(%rip)      # 0x12470
movb $0x1, 0xbc9d(%rip)      # 0x123a0
xorl %edi, %edi
callq 0x3620
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3230
leaq 0x58(%rsp), %rdi
leaq 0x5da0(%rip), %rsi      # 0xc4e8
callq 0x3360
leaq 0xf0(%r14), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x3300
leaq 0x5e30(%rip), %rsi      # 0xc596
movq %rax, %rdi
callq 0x3360
movl 0x130(%r14), %esi
movq %rax, %rdi
callq 0x35e0
leaq 0x5d93(%rip), %rsi      # 0xc517
movq %rax, %rdi
callq 0x3360
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3300
leaq 0x60(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x3550
leaq 0x28(%rsp), %rdi
callq 0x4c7c
leaq 0x28(%rsp), %rdi
callq 0x36e8
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x3490
movl 0x130(%r14), %edx
leaq 0x8(%rsp), %rsi
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x56c0
leaq 0x8(%rsp), %rdi
callq 0x36e8
leaq 0x48(%rsp), %rdi
callq 0x3260
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x6810
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x36e8
jmp 0x681c
jmp 0x6819
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3260
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: SunwayMRHelper::start(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int)
void SunwayMRHelper::start(string masterAddr, int masterListenPort, int threads, int memory) {
	this->masterAddr = masterAddr;
	this->masterListenPort = masterListenPort;
	this->threads = threads;
	this->memory = memory;
	this->localAddr = getLocalHost();

	if (localAddr == "") {
		Logging::logError("SunwayMRHelper: failed to obtain local IP address.");
		exit(1);
	} else {
		stringstream ipinfo;
		ipinfo << "SunwayMRHelper: local IP is " << localAddr;
		Logging::logInfo(ipinfo.str());
	}

	Logging::logInfo("SunwayMRHelper: starting listening");
	listening = init();
	if (!listening) {
		Logging::logError("SunwayMRHelper: failed to start listening.");
		exit(1);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rdi, %rbx
addq $0xf0, %rdi
callq 0x31e0
movl %r15d, 0x130(%rbx)
movl %r14d, 0x134(%rbx)
movl %ebp, 0x138(%rbx)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x3ff4
leaq 0x110(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3410
movq %r15, %rdi
callq 0x36e8
leaq 0x5392(%rip), %rsi      # 0xc09b
movq %r14, %rdi
callq 0x91d8
testb %al, %al
jne 0x6dae
leaq 0x20(%rsp), %rdi
callq 0x3230
leaq 0x30(%rsp), %rdi
leaq 0x5681(%rip), %rsi      # 0xc3b0
callq 0x3360
movq %rax, %rdi
movq %r14, %rsi
callq 0x3300
leaq 0x38(%rsp), %rsi
movq %rsp, %rdi
callq 0x3550
movq %rsp, %rdi
callq 0x4dbc
movq %rsp, %rdi
callq 0x36e8
leaq 0x20(%rsp), %rdi
callq 0x3260
leaq 0x5694(%rip), %rsi      # 0xc401
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x915a
leaq 0x20(%rsp), %rdi
callq 0x4dbc
leaq 0x20(%rsp), %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x6e3e
movb %al, 0x188(%rbx)
testb %al, %al
je 0x6dce
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x55c8(%rip), %rsi      # 0xc37d
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x915a
leaq 0x20(%rsp), %rdi
callq 0x4efc
jmp 0x6dec
leaq 0x564f(%rip), %rsi      # 0xc424
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x915a
leaq 0x20(%rsp), %rdi
callq 0x4efc
leaq 0x20(%rsp), %rdi
callq 0x36e8
pushq $0x1
popq %rdi
callq 0x3400
jmp 0x6e06
jmp 0x6e06
jmp 0x6e15
jmp 0x6e15
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x36e8
jmp 0x6e36
movq %rax, %rbx
jmp 0x6e36
movq %rax, %rbx
movq %rsp, %rdi
callq 0x36e8
jmp 0x6e2c
jmp 0x6e29
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3260
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
addq $0x110, %rdi            # imm = 0x110
leaq 0xf0(%rbx), %rsi
callq 0x906f
testb %al, %al
je 0x6ea8
leaq 0x58ef(%rip), %rsi      # 0xc756
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r14, %rdi
callq 0x915a
movq %r14, %rdi
callq 0x4dbc
leaq 0x10(%rsp), %rdi
callq 0x36e8
movl 0x130(%rbx), %esi
movl %esi, 0x13c(%rbx)
movq %rbx, %rdi
callq 0x80f2
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x4e21, %edi           # imm = 0x4E21
movl $0x752f, %esi           # imm = 0x752F
callq 0x3fba
movl %eax, %esi
xorl %ebp, %ebp
movl %esi, 0x13c(%rbx)
movq %rbx, %rdi
callq 0x80f2
testb %al, %al
jne 0x6e9f
cmpl $0x63, %ebp
ja 0x6e9f
incl %ebp
movl 0x13c(%rbx), %esi
addl $0x3, %esi
jmp 0x6ebb
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x36e8
movq %rbx, %rdi
callq 0x3610
// File: /workspace/github_cpp_makefile_star2_O2/sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: SunwayMRHelper::setLocalResouce(int, int)
void SunwayMRHelper::setLocalResouce(int threads, int memory) {

	// send repeatedly
	stringstream ss;
	ss << threads << " " << memory << " " << listenPort;
	stringstream info;
	info << "SunwayMRHelper: set local resource: thread: "
			<< threads << " memory: " << memory
			<< " listenPort: " << listenPort;
	Logging::logInfo(info.str());

	int v = 0;
	struct thread_data *data = new thread_data (*this, ss.str().c_str(), v);

	//pthread_cancel(sendResourceInfoThread);
	if (!xyz_send_host_resource_info_thread_canceled_flag) {
		xyz_send_host_resource_info_thread_cancel_flag = true;
		while (!xyz_send_host_resource_info_thread_canceled_flag);
	}
	int rc = pthread_create(&sendResourceInfoThread, NULL, sendHostResourceInfoToMasterRepeatedly, (void *)data);
	if (rc){
		Logging::logError("SunwayMRHelper: SunwayMRHelper: failed to create thread to send host resource info.");
		exit(1);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x340, %rsp            # imm = 0x340
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x1b8(%rsp), %rdi
callq 0x3230
leaq 0x1c8(%rsp), %rdi
movl %r14d, %esi
callq 0x35e0
leaq 0x5603(%rip), %rsi      # 0xc58e
movq %rax, %rdi
callq 0x3360
movq %rax, %rdi
movl %ebp, %esi
callq 0x35e0
leaq 0x55ea(%rip), %rsi      # 0xc58e
movq %rax, %rdi
callq 0x3360
movl 0x13c(%rbx), %esi
movq %rax, %rdi
callq 0x35e0
leaq 0x30(%rsp), %rdi
callq 0x3230
leaq 0x40(%rsp), %rdi
leaq 0x547f(%rip), %rsi      # 0xc44f
callq 0x3360
movq %rax, %rdi
movl %r14d, %esi
callq 0x35e0
leaq 0x5495(%rip), %rsi      # 0xc47c
movq %rax, %rdi
callq 0x3360
movq %rax, %rdi
movl %ebp, %esi
callq 0x35e0
leaq 0x5486(%rip), %rsi      # 0xc486
movq %rax, %rdi
callq 0x3360
movl 0x13c(%rbx), %esi
movq %rax, %rdi
callq 0x35e0
leaq 0x48(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x3550
leaq 0x10(%rsp), %rdi
callq 0x4dbc
leaq 0x10(%rsp), %rdi
callq 0x36e8
pushq $0x18
popq %rdi
callq 0x3370
movq %rax, %r14
leaq 0x1d0(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x3550
leaq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq %rbx, (%r14)
movq %rax, 0x8(%r14)
andl $0x0, 0x10(%r14)
callq 0x36e8
addq $0x190, %rbx            # imm = 0x190
leaq -0x9f9(%rip), %rdx      # 0x6684
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
callq 0x3640
testl %eax, %eax
jne 0x70b1
leaq 0x30(%rsp), %rdi
callq 0x3260
leaq 0x1b8(%rsp), %rdi
callq 0x3260
addq $0x340, %rsp            # imm = 0x340
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x53dc(%rip), %rsi      # 0xc494
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x915a
leaq 0x10(%rsp), %rdi
callq 0x4efc
leaq 0x10(%rsp), %rdi
callq 0x36e8
pushq $0x1
popq %rdi
callq 0x3400
jmp 0x70f9
jmp 0x7111
movq %rax, %rbx
pushq $0x18
popq %rsi
movq %r14, %rdi
callq 0x3380
jmp 0x7114
jmp 0x7111
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x36e8
jmp 0x7114
jmp 0x7111
jmp 0x710c
movq %rax, %rbx
jmp 0x711e
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3260
leaq 0x1b8(%rsp), %rdi
callq 0x3260
movq %rbx, %rdi
callq 0x3610
nop