LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
callq 0x4190
movq %rax, %rdi
callq 0x4660
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x6ca0
movb $0x0, -0x1(%rbp)
jmp 0x6d7a
jmp 0x6ca2
movq -0x20(%rbp), %rdi
callq 0x4670
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x6d6d
movq -0x28(%rbp), %rdi
addq $0x13, %rdi
leaq 0x1399f(%rip), %rsi     # 0x1a667
callq 0x45d0
cmpl $0x0, %eax
je 0x6ceb
movq -0x28(%rbp), %rdi
addq $0x13, %rdi
leaq 0x13985(%rip), %rsi     # 0x1a666
callq 0x45d0
cmpl $0x0, %eax
jne 0x6ced
jmp 0x6ca2
movq -0x28(%rbp), %rax
addq $0x13, %rax
movq %rax, -0x70(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x47a0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0xe8d0
jmp 0x6d19
leaq -0x49(%rbp), %rdi
callq 0x4470
movq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0xe290
jmp 0x6d31
leaq -0x48(%rbp), %rdi
callq 0x4878
jmp 0x6ca2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x4470
jmp 0x6d85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4878
jmp 0x6d85
movq -0x20(%rbp), %rdi
callq 0x46f0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x4780
nop
// File: 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
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdx, -0x70(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
callq 0x4190
movq %rax, %rdi
callq 0x4660
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x6dd7
leaq 0x1325e(%rip), %rdi     # 0x1a027
callq 0x4340
movb $0x0, -0x1(%rbp)
jmp 0x6ee3
jmp 0x6dd9
movq -0x28(%rbp), %rdi
callq 0x4670
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x6ed6
movq -0x30(%rbp), %rdi
addq $0x13, %rdi
leaq 0x13868(%rip), %rsi     # 0x1a667
callq 0x45d0
cmpl $0x0, %eax
je 0x6e22
movq -0x30(%rbp), %rdi
addq $0x13, %rdi
leaq 0x1384e(%rip), %rsi     # 0x1a666
callq 0x45d0
cmpl $0x0, %eax
jne 0x6e24
jmp 0x6dd9
movq -0x30(%rbp), %rax
addq $0x13, %rax
movq %rax, -0x80(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x47a0
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0xe8d0
jmp 0x6e50
leaq -0x51(%rbp), %rdi
callq 0x4470
movq -0x70(%rbp), %rsi
leaq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x4860
movq %rax, -0x88(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4650
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
jae 0x6ec8
movq -0x18(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xe290
jmp 0x6e98
jmp 0x6ec8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x4470
jmp 0x6ef1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4878
jmp 0x6ef1
leaq -0x50(%rbp), %rdi
callq 0x4878
jmp 0x6dd9
movq -0x28(%rbp), %rdi
callq 0x46f0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x4780
nopw (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
callq 0x4190
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x6f44
imull $0x65, -0x10(%rbp), %eax
movq -0x18(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movsbl (%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x10(%rbp)
jmp 0x6f1e
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x1, 0x1e4b5(%rip)     # 0x25448
jge 0x7045
leaq 0x1e4e8(%rip), %rdi     # 0x25488
callq 0x4610
movq 0x1e02c(%rip), %rdi     # 0x24fd8
leaq 0x1328b(%rip), %rsi     # 0x1a23e
callq 0x43f0
movq %rax, -0x50(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x56e0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x4380
movq %rax, -0x40(%rbp)
jmp 0x6fdc
movq -0x40(%rbp), %rdi
leaq 0x1304e(%rip), %rsi     # 0x1a035
callq 0x43f0
movq %rax, -0x58(%rbp)
jmp 0x6ff2
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x4380
movq %rax, -0x60(%rbp)
jmp 0x7005
movq -0x60(%rbp), %rdi
movq 0x1dfb0(%rip), %rsi     # 0x24fc0
callq 0x4440
jmp 0x7017
leaq -0x28(%rbp), %rdi
callq 0x4878
leaq 0x1e461(%rip), %rdi     # 0x25488
callq 0x42d0
jmp 0x7045
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4878
jmp 0x704b
addq $0x60, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x4780
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x2, 0x1e3d5(%rip)     # 0x25448
jge 0x7125
leaq 0x1e408(%rip), %rdi     # 0x25488
callq 0x4610
movq 0x1df4c(%rip), %rdi     # 0x24fd8
leaq 0x131ab(%rip), %rsi     # 0x1a23e
callq 0x43f0
movq %rax, -0x50(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x56e0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x4380
movq %rax, -0x40(%rbp)
jmp 0x70bc
movq -0x40(%rbp), %rdi
leaq 0x12f7b(%rip), %rsi     # 0x1a042
callq 0x43f0
movq %rax, -0x58(%rbp)
jmp 0x70d2
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x4380
movq %rax, -0x60(%rbp)
jmp 0x70e5
movq -0x60(%rbp), %rdi
movq 0x1ded0(%rip), %rsi     # 0x24fc0
callq 0x4440
jmp 0x70f7
leaq -0x28(%rbp), %rdi
callq 0x4878
leaq 0x1e381(%rip), %rdi     # 0x25488
callq 0x42d0
jmp 0x7125
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4878
jmp 0x712b
addq $0x60, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x4780
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x3, 0x1e2f5(%rip)     # 0x25448
jge 0x7205
leaq 0x1e328(%rip), %rdi     # 0x25488
callq 0x4610
movq 0x1de6c(%rip), %rdi     # 0x24fd8
leaq 0x130cb(%rip), %rsi     # 0x1a23e
callq 0x43f0
movq %rax, -0x50(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x56e0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x4380
movq %rax, -0x40(%rbp)
jmp 0x719c
movq -0x40(%rbp), %rdi
leaq 0x12ea6(%rip), %rsi     # 0x1a04d
callq 0x43f0
movq %rax, -0x58(%rbp)
jmp 0x71b2
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x4380
movq %rax, -0x60(%rbp)
jmp 0x71c5
movq -0x60(%rbp), %rdi
movq 0x1ddf0(%rip), %rsi     # 0x24fc0
callq 0x4440
jmp 0x71d7
leaq -0x28(%rbp), %rdi
callq 0x4878
leaq 0x1e2a1(%rip), %rdi     # 0x25488
callq 0x42d0
jmp 0x7205
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4878
jmp 0x720b
addq $0x60, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x4780
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x4, 0x1e215(%rip)     # 0x25448
jge 0x72e5
leaq 0x1e248(%rip), %rdi     # 0x25488
callq 0x4610
movq 0x1dd8c(%rip), %rdi     # 0x24fd8
leaq 0x12feb(%rip), %rsi     # 0x1a23e
callq 0x43f0
movq %rax, -0x50(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x56e0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x4380
movq %rax, -0x40(%rbp)
jmp 0x727c
movq -0x40(%rbp), %rdi
leaq 0x12dd0(%rip), %rsi     # 0x1a057
callq 0x43f0
movq %rax, -0x58(%rbp)
jmp 0x7292
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x4380
movq %rax, -0x60(%rbp)
jmp 0x72a5
movq -0x60(%rbp), %rdi
movq 0x1dd10(%rip), %rsi     # 0x24fc0
callq 0x4440
jmp 0x72b7
leaq -0x28(%rbp), %rdi
callq 0x4878
leaq 0x1e1c1(%rip), %rdi     # 0x25488
callq 0x42d0
jmp 0x72e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4878
jmp 0x72eb
addq $0x60, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x4780
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x5, 0x1e135(%rip)     # 0x25448
jge 0x73c5
leaq 0x1e168(%rip), %rdi     # 0x25488
callq 0x4610
movq 0x1dcac(%rip), %rdi     # 0x24fd8
leaq 0x12f0b(%rip), %rsi     # 0x1a23e
callq 0x43f0
movq %rax, -0x50(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x56e0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x4380
movq %rax, -0x40(%rbp)
jmp 0x735c
movq -0x40(%rbp), %rdi
leaq 0x12cfd(%rip), %rsi     # 0x1a064
callq 0x43f0
movq %rax, -0x58(%rbp)
jmp 0x7372
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x4380
movq %rax, -0x60(%rbp)
jmp 0x7385
movq -0x60(%rbp), %rdi
movq 0x1dc30(%rip), %rsi     # 0x24fc0
callq 0x4440
jmp 0x7397
leaq -0x28(%rbp), %rdi
callq 0x4878
leaq 0x1e0e1(%rip), %rdi     # 0x25488
callq 0x42d0
jmp 0x73c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4878
jmp 0x73cb
addq $0x60, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x4780
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x10(%rbp), %rdi
callq 0xeb80
movq -0x40(%rbp), %rdi
addq $0x58, %rdi
callq 0xeba0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x40(%rbp), %rdi
addq $0x58, %rdi
callq 0xec00
movq %rax, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xebd0
testb $0x1, %al
jne 0x754a
jmp 0x7585
leaq -0x10(%rbp), %rdi
callq 0xec30
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x7578
movq -0x48(%rbp), %rdi
callq 0x4878
movq -0x48(%rbp), %rdi
movl $0x20, %esi
callq 0x4410
jmp 0x757a
leaq -0x10(%rbp), %rdi
callq 0xec50
jmp 0x7526
movq -0x40(%rbp), %rdi
addq $0x58, %rdi
callq 0xec80
leaq -0x28(%rbp), %rdi
callq 0xeca0
movq -0x40(%rbp), %rdi
addq $0x88, %rdi
callq 0xecc0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x40(%rbp), %rdi
addq $0x88, %rdi
callq 0xed20
movq %rax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xecf0
testb $0x1, %al
jne 0x75de
jmp 0x7619
leaq -0x28(%rbp), %rdi
callq 0xed50
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x760c
movq -0x50(%rbp), %rdi
callq 0xe390
movq -0x50(%rbp), %rdi
movl $0x18, %esi
callq 0x4410
jmp 0x760e
leaq -0x28(%rbp), %rdi
callq 0xed70
jmp 0x75b7
movq -0x40(%rbp), %rdi
addq $0x88, %rdi
callq 0xeda0
addq $0x50, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x10(%rbp), %rdi
callq 0xedc0
movq -0x30(%rbp), %rdi
addq $0xb8, %rdi
callq 0xede0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rdi
addq $0xb8, %rdi
callq 0xee40
movq %rax, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xee10
testb $0x1, %al
jne 0x7693
jmp 0x7730
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq %rax, -0x38(%rbp)
leaq -0x10(%rbp), %rdi
callq 0xee70
movq %rax, %rdi
addq $0x8, %rdi
callq 0xee90
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0x770d
leaq -0x10(%rbp), %rdi
callq 0xee70
movq %rax, %rdi
addq $0x8, %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0xeeb0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x7700
movq -0x40(%rbp), %rdi
callq 0xe390
movq -0x40(%rbp), %rdi
movl $0x18, %esi
callq 0x4410
jmp 0x7702
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x769a
leaq -0x10(%rbp), %rdi
callq 0xee70
movq %rax, %rdi
addq $0x8, %rdi
callq 0xeed0
leaq -0x10(%rbp), %rdi
callq 0xeef0
jmp 0x7669
movq -0x30(%rbp), %rdi
addq $0xb8, %rdi
callq 0xef20
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0xb0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x400000, -0x14(%rbp)  # imm = 0x400000
movl -0x14(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x20(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x90(%rbp)
movq %rcx, %rsp
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xe370
jmp 0x77a5
movq -0x90(%rbp), %rdi
movslq -0x14(%rbp), %rdx
xorl %esi, %esi
movl %esi, -0x9c(%rbp)
callq 0x4210
movq -0x90(%rbp), %rsi
movl -0x9c(%rbp), %ecx
movl -0x4(%rbp), %edi
movl -0x14(%rbp), %eax
decl %eax
movslq %eax, %rdx
callq 0x4160
movq %rax, -0x98(%rbp)
jmp 0x77e3
movq -0x98(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jg 0x780b
jmp 0x78a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x792b
movq -0x50(%rbp), %rcx
movq -0x30(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x30(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x47a0
movq -0x90(%rbp), %rsi
movq -0xa8(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0xe8d0
jmp 0x7846
leaq -0x48(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xea80
jmp 0x7855
leaq -0x80(%rbp), %rdi
callq 0x4878
leaq -0x81(%rbp), %rdi
callq 0x4470
jmp 0x77a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x7892
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4878
leaq -0x81(%rbp), %rdi
callq 0x4470
jmp 0x792b
movq -0x10(%rbp), %rdi
leaq 0x127d1(%rip), %rsi     # 0x1a07f
callq 0x45a0
jmp 0x78b5
movl $0x0, -0x88(%rbp)
movl -0x88(%rbp), %eax
movq %rax, -0xb0(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xe3f0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jae 0x7916
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0xef40
movq %rax, %rsi
movq -0x10(%rbp), %rdi
callq 0x4540
jmp 0x7903
jmp 0x7905
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x78bf
leaq -0x48(%rbp), %rdi
callq 0xe390
movq -0x20(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0xe390
movq -0x58(%rbp), %rdi
callq 0x4780
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x8(%rbp)
leaq 0x1271d(%rip), %rax     # 0x1a06f
movq %rax, -0x10(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x41b0
movl -0x5c(%rbp), %edi
movq -0x58(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x41f0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x79fb
leaq -0x39(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x47a0
movq -0x68(%rbp), %rdx
leaq 0x126e1(%rip), %rsi     # 0x1a080
leaq -0x38(%rbp), %rdi
callq 0xe8d0
jmp 0x79aa
leaq -0x38(%rbp), %rdi
callq 0x7300
jmp 0x79b5
leaq -0x38(%rbp), %rdi
callq 0x4878
leaq -0x39(%rbp), %rdi
callq 0x4470
movb $0x0, -0x1(%rbp)
jmp 0x79ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x79f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4878
leaq -0x39(%rbp), %rdi
callq 0x4470
jmp 0x7a0a
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x4780
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rsi, -0xa8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x45c0
movq -0xa8(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x41a0
jmp 0x81ca
movq -0xb0(%rbp), %rdi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %r8
leaq -0x68(%rbp), %rsi
leaq -0x48(%rbp), %r9
callq 0x7e20
movb %al, -0xb1(%rbp)
jmp 0x81f0
movb -0xb1(%rbp), %al
xorb $-0x1, %al
movb %al, -0xb2(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4878
movb -0xb2(%rbp), %al
testb $0x1, %al
jne 0x8216
jmp 0x82d4
leaq -0x99(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x47a0
movq -0xc0(%rbp), %rdx
leaq 0x11fc3(%rip), %rsi     # 0x1a1fa
leaq -0x98(%rbp), %rdi
callq 0xe8d0
jmp 0x8245
leaq -0x98(%rbp), %rdi
callq 0x7300
jmp 0x8253
leaq -0x98(%rbp), %rdi
callq 0x4878
leaq -0x99(%rbp), %rdi
callq 0x4470
movb $0x0, -0x1(%rbp)
movl $0x1, -0xa0(%rbp)
jmp 0x82e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x82f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4878
jmp 0x82f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x82c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4878
leaq -0x99(%rbp), %rdi
callq 0x4470
jmp 0x82f9
movb $0x1, -0x1(%rbp)
movl $0x1, -0xa0(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4878
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xc0, %rsp
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x4878
movq -0x70(%rbp), %rdi
callq 0x4780
nopl (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x104ab(%rip), %rsi     # 0x1a07f
callq 0xef60
testb $0x1, %al
jne 0x9be2
jmp 0x9ca3
leaq -0x39(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x47a0
movq -0x80(%rbp), %rdx
leaq 0x105a7(%rip), %rsi     # 0x1a1a1
leaq -0x38(%rbp), %rdi
callq 0xe8d0
jmp 0x9c05
leaq -0x39(%rbp), %rdi
callq 0x4470
movl -0x4(%rbp), %eax
movl %eax, -0x94(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x4190
movq -0xa0(%rbp), %rdi
movq %rax, -0x90(%rbp)
callq 0x4650
movl -0x94(%rbp), %edi
movq -0x90(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x41f0
movq %rax, -0x88(%rbp)
jmp 0x9c5a
movq -0x88(%rbp), %rax
movl %eax, -0x14(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4878
jmp 0x9cdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x4470
jmp 0x9d64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4878
jmp 0x9d64
movl -0x4(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4190
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4650
movl -0xac(%rbp), %edi
movq -0xa8(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x41f0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x9d5b
leaq -0x71(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x47a0
movq -0xb8(%rbp), %rdx
leaq 0x105a5(%rip), %rsi     # 0x1a2a8
leaq -0x70(%rbp), %rdi
callq 0xe8d0
jmp 0x9d0e
leaq -0x70(%rbp), %rdi
callq 0x7300
jmp 0x9d19
leaq -0x70(%rbp), %rdi
callq 0x4878
leaq -0x71(%rbp), %rdi
callq 0x4470
jmp 0x9d5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x9d50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x4878
leaq -0x71(%rbp), %rdi
callq 0x4470
jmp 0x9d64
addq $0xc0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x4780
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x4640
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x8310
xorl %eax, %eax
movl %eax, %edi
callq 0x4790
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, 0x1b6a5(%rip)     # 0x25468
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x4640
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
testb $0x1, 0x1b75b(%rip)     # 0x25538
je 0x9df2
movb $0x0, 0x1b752(%rip)     # 0x25538
movb $0x1, 0x1b67b(%rip)     # 0x25468
jmp 0x9e8d
movl $0x1, %edi
callq 0x42c0
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x60(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x47a0
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0xe8d0
jmp 0x9e2f
movq -0x60(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9ea0
jmp 0x9e3e
leaq -0x30(%rbp), %rdi
callq 0x4878
leaq -0x31(%rbp), %rdi
callq 0x4470
movl $0x5, %edi
callq 0x42c0
jmp 0x9dd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9e82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4878
leaq -0x31(%rbp), %rdi
callq 0x4470
jmp 0x9e96
xorl %eax, %eax
movl %eax, %edi
callq 0x4790
movq -0x40(%rbp), %rdi
callq 0x4780
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rsi, -0x200(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1f8(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x4280
leaq -0x188(%rbp), %rdi
leaq 0x105ed(%rip), %rsi     # 0x1a4cc
callq 0x43f0
movq %rax, -0x1f0(%rbp)
jmp 0x9eed
movq -0x1f0(%rbp), %rdi
movq -0x1f8(%rbp), %rsi
addq $0xf0, %rsi
callq 0x4380
movq %rax, -0x208(%rbp)
jmp 0x9f10
movq -0x208(%rbp), %rdi
leaq 0x1065c(%rip), %rsi     # 0x1a57a
callq 0x43f0
movq %rax, -0x210(%rbp)
jmp 0x9f2c
movq -0x210(%rbp), %rdi
movq -0x1f8(%rbp), %rax
movl 0x130(%rax), %esi
callq 0x4750
movq %rax, -0x218(%rbp)
jmp 0x9f4e
movq -0x218(%rbp), %rdi
leaq 0x1059f(%rip), %rsi     # 0x1a4fb
callq 0x43f0
movq %rax, -0x220(%rbp)
jmp 0x9f6a
movq -0x200(%rbp), %rsi
movq -0x220(%rbp), %rdi
callq 0x4380
jmp 0x9f7f
leaq -0x1c8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x43e0
jmp 0x9f94
leaq -0x1c8(%rbp), %rdi
callq 0x6f80
jmp 0x9fa2
leaq -0x1c8(%rbp), %rdi
callq 0x4878
movq -0x1f8(%rbp), %rsi
addq $0xf0, %rsi
leaq -0x1e8(%rbp), %rdi
callq 0x41a0
jmp 0x9fca
movq -0x200(%rbp), %r8
movq -0x1f8(%rbp), %rdi
movl 0x130(%rdi), %edx
leaq -0x1e8(%rbp), %rsi
xorl %ecx, %ecx
callq 0x8180
jmp 0x9fee
leaq -0x1e8(%rbp), %rdi
callq 0x4878
leaq -0x198(%rbp), %rdi
callq 0x42b0
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0xa061
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x4878
jmp 0xa061
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x4878
leaq -0x198(%rbp), %rdi
callq 0x42b0
movq -0x1a0(%rbp), %rdi
callq 0x4780
nopl (%rax)
// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x50(%rbp)
movb $0x0, -0x9(%rbp)
movq %rsi, %rdi
addq $0x110, %rdi            # imm = 0x110
addq $0xf0, %rsi
callq 0xe410
testb $0x1, %al
jne 0xaac7
jmp 0xab5d
leaq -0x31(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x47a0
movq -0x58(%rbp), %rdx
leaq 0xfc5b(%rip), %rsi      # 0x1a73a
leaq -0x30(%rbp), %rdi
callq 0xe8d0
jmp 0xaaea
leaq -0x30(%rbp), %rdi
callq 0x7140
jmp 0xaaf5
leaq -0x30(%rbp), %rdi
callq 0x4878
leaq -0x31(%rbp), %rdi
callq 0x4470
movq -0x50(%rbp), %rdi
movl 0x130(%rdi), %eax
movl %eax, 0x13c(%rdi)
movl 0x13c(%rdi), %esi
callq 0xc7b0
andb $0x1, %al
movb %al, -0x9(%rbp)
jmp 0xabdb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xab4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4878
leaq -0x31(%rbp), %rdi
callq 0x4470
jmp 0xabe6
movl $0x4e21, %edi           # imm = 0x4E21
movl $0x752f, %esi           # imm = 0x752F
callq 0x57d0
movq -0x50(%rbp), %rdi
movl %eax, 0x13c(%rdi)
movl 0x13c(%rdi), %esi
callq 0xc7b0
andb $0x1, %al
movb %al, -0x9(%rbp)
movl $0x0, -0x48(%rbp)
xorl %eax, %eax
testb $0x1, -0x9(%rbp)
movb %al, -0x59(%rbp)
jne 0xaba2
cmpl $0x64, -0x48(%rbp)
setl %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0xabab
jmp 0xabd9
movq -0x50(%rbp), %rdi
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movl 0x13c(%rdi), %eax
addl $0x3, %eax
movl %eax, 0x13c(%rdi)
movl 0x13c(%rdi), %esi
callq 0xc7b0
andb $0x1, %al
movb %al, -0x9(%rbp)
jmp 0xab8d
jmp 0xabdb
movb -0x9(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x4780
nop
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rsi, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movb $0x0, -0x11(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movl -0x18(%rbp), %eax
movq %rax, -0x30(%rbp)
addq $0x140, %rdi            # imm = 0x140
callq 0xf900
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jae 0xd5e0
movq -0x20(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
movl -0x18(%rbp), %eax
movl %eax, %esi
callq 0xf930
movq -0x28(%rbp), %rsi
movq %rax, %rdi
callq 0xe410
testb $0x1, %al
jne 0xd555
jmp 0xd5d0
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x3c(%rbp)
addq $0x140, %rdi            # imm = 0x140
movl -0x18(%rbp), %eax
movl %eax, %esi
callq 0xf930
movl -0x3c(%rbp), %edx
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movq -0x28(%rbp), %rax
movl %edx, 0x20(%rcx)
movl 0x24(%rax), %eax
movl %eax, -0x38(%rbp)
addq $0x140, %rdi            # imm = 0x140
movl -0x18(%rbp), %eax
movl %eax, %esi
callq 0xf930
movl -0x38(%rbp), %edx
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movq -0x28(%rbp), %rax
movl %edx, 0x24(%rcx)
movl 0x28(%rax), %eax
movl %eax, -0x34(%rbp)
addq $0x140, %rdi            # imm = 0x140
movl -0x18(%rbp), %eax
movl %eax, %esi
callq 0xf930
movl -0x34(%rbp), %ecx
movl %ecx, 0x28(%rax)
movb $0x1, -0x11(%rbp)
jmp 0xd5e0
jmp 0xd5d2
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xd507
testb $0x1, -0x11(%rbp)
jne 0xd5fa
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0xf870
movq -0x20(%rbp), %rdi
callq 0xd620
movq -0x20(%rbp), %rdi
callq 0xd940
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ArashPartow[P]exprtk/exprtk_benchmark.cpp
// Function: bool load_expression<double, std::allocator<exprtk::expression<double>>, std::deque>(exprtk::symbol_table<double>&, std::deque<exprtk::expression<double>, std::allocator<exprtk::expression<double>>>&)
bool load_expression(exprtk::symbol_table<T>& symbol_table,
                     Sequence<exprtk::expression<T>,Allocator>& expr_seq)
{
   exprtk::parser<double> parser;

   for (std::size_t i = 0; i < global_expression_list_size; ++i)
   {
      exprtk::expression<double> expression;
      expression.register_symbol_table(symbol_table);

      if (!parser.compile(global_expression_list[i],expression))
      {
         printf("[load_expression] - Parser Error: %s\tExpression: %s\n",
                parser.error().c_str(),
                global_expression_list[i].c_str());

         return false;
      }

      expr_seq.push_back(expression);
   }

   return true;
}

// Assembly:
subq $0xb08, %rsp            # imm = 0xB08
movq %rdi, 0xaf8(%rsp)
movq %rsi, 0xaf0(%rsp)
leaq 0x78(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movl $0x7f, %esi
callq 0x1215d0
movq 0x10(%rsp), %rsi
leaq 0x1c8(%rsp), %rdi
callq 0x121700
jmp 0x11f6af
leaq 0x78(%rsp), %rdi
callq 0x121f30
movq $0x0, 0x60(%rsp)
cmpq $0x11, 0x60(%rsp)
jae 0x11f83f
leaq 0x40(%rsp), %rdi
callq 0x121fc0
jmp 0x11f6da
movq 0xaf8(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x122070
jmp 0x11f6ee
movq 0x60(%rsp), %rax
shlq $0x5, %rax
leaq 0x520842(%rip), %rsi    # 0x63ff40
addq %rax, %rsi
leaq 0x1c8(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x122120
movb %al, 0xf(%rsp)
jmp 0x11f719
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x11f7ee
jmp 0x11f727
leaq 0x20(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x1229e0
jmp 0x11f73b
leaq 0x20(%rsp), %rdi
callq 0x115120
movq %rax, (%rsp)
movq 0x60(%rsp), %rax
shlq $0x5, %rax
leaq 0x5207e7(%rip), %rdi    # 0x63ff40
addq %rax, %rdi
callq 0x115120
movq (%rsp), %rsi
movq %rax, %rdx
leaq 0x3453d2(%rip), %rdi    # 0x464b41
xorl %eax, %eax
callq 0x1150b0
jmp 0x11f778
leaq 0x20(%rsp), %rdi
callq 0x115818
movb $0x0, 0xb07(%rsp)
movl $0x1, 0x1c(%rsp)
jmp 0x11f80a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x121f30
jmp 0x11f87a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x11f86d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x11f833
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x115818
jmp 0x11f833
movq 0xaf0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x122aa0
jmp 0x11f802
movl $0x0, 0x1c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x122b00
movl 0x1c(%rsp), %eax
testl %eax, %eax
jne 0x11f84f
jmp 0x11f81e
jmp 0x11f820
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x11f6c2
leaq 0x40(%rsp), %rdi
callq 0x122b00
jmp 0x11f86d
movb $0x1, 0xb07(%rsp)
movl $0x1, 0x1c(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0x122b40
movb 0xb07(%rsp), %al
andb $0x1, %al
addq $0xb08, %rsp            # imm = 0xB08
retq
leaq 0x1c8(%rsp), %rdi
callq 0x122b40
movq 0x70(%rsp), %rdi
callq 0x1154d0
nopw %cs:(%rax,%rax)
nop
// File: ArashPartow[P]exprtk/exprtk_benchmark.cpp
// Function: void run_exprtk_benchmark<double>(double&, double&, exprtk::expression<double>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void run_exprtk_benchmark(T& x, T& y,
                          exprtk::expression<T>& expression,
                          const std::string& expr_string)
{
   T total = T(0);
   unsigned int count = 0;

   exprtk::timer timer;
   timer.start();

   for (x = global_lower_bound_x; x <= global_upper_bound_x; x += global_delta)
   {
      for (y = global_lower_bound_y; y <= global_upper_bound_y; y += global_delta)
      {
         total += expression.value();
         ++count;
      }
   }

   timer.stop();

   if (T(0) != total)
      printf("[exprtk] Total Time:%12.8f  Rate:%14.3fevals/sec Expression: %s\n",
             timer.time(),
             count / timer.time(),
             expr_string.c_str());
   else
      printf("run_exprtk_benchmark() - Error running benchmark for expression: %s\n",expr_string.c_str());
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
movl $0x0, 0x4c(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x122d40
leaq 0x20(%rsp), %rdi
callq 0x122d70
movq 0x70(%rsp), %rax
movsd 0x33f776(%rip), %xmm0   # 0x45f070
movsd %xmm0, (%rax)
movq 0x70(%rsp), %rax
movsd 0x33f76d(%rip), %xmm0   # 0x45f078
ucomisd (%rax), %xmm0
jb 0x11f989
movq 0x68(%rsp), %rax
movsd 0x33f752(%rip), %xmm0   # 0x45f070
movsd %xmm0, (%rax)
movq 0x68(%rsp), %rax
movsd 0x33f749(%rip), %xmm0   # 0x45f078
ucomisd (%rax), %xmm0
jb 0x11f96d
movq 0x60(%rsp), %rdi
callq 0x122d90
addsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
movq 0x68(%rsp), %rax
movsd 0x33f71d(%rip), %xmm0   # 0x45f080
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x11f922
jmp 0x11f96f
movq 0x70(%rsp), %rax
movsd 0x33f704(%rip), %xmm0   # 0x45f080
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x11f8fe
leaq 0x20(%rsp), %rdi
callq 0x122df0
xorps %xmm0, %xmm0
ucomisd 0x50(%rsp), %xmm0
jne 0x11f9a2
jp 0x11f9a2
jmp 0x11fa07
leaq 0x20(%rsp), %rdi
callq 0x122e20
movsd %xmm0, 0x10(%rsp)
movl 0x4c(%rsp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x122e20
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x58(%rsp), %rdi
callq 0x115120
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %rax, %rsi
leaq 0x345178(%rip), %rdi    # 0x464b76
movb $0x2, %al
callq 0x1150b0
jmp 0x11fa22
movq 0x58(%rsp), %rdi
callq 0x115120
movq %rax, %rsi
leaq 0x34519c(%rip), %rdi    # 0x464bb7
movb $0x0, %al
callq 0x1150b0
addq $0x78, %rsp
retq
nopw (%rax,%rax)
// File: ArashPartow[P]exprtk/exprtk_benchmark.cpp
// Function: void run_native_benchmark<double, double (*)(double const&, double const&)>(double&, double&, double (*)(double const&, double const&), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void run_native_benchmark(T& x, T& y, NativeFunction f, const std::string& expr_string)
{
   T total = T(0);
   unsigned int count = 0;

   exprtk::timer timer;
   timer.start();

   for (x = global_lower_bound_x; x <= global_upper_bound_x; x += global_delta)
   {
      for (y = global_lower_bound_y; y <= global_upper_bound_y; y += global_delta)
      {
         total += f(x,y);
         ++count;
      }
   }

   timer.stop();

   if (T(0) != total)
      printf("[native] Total Time:%12.8f  Rate:%14.3fevals/sec Expression: %s\n",
             timer.time(),
             count / timer.time(),
             expr_string.c_str());
   else
      printf("run_native_benchmark() - Error running benchmark for expression: %s\n",expr_string.c_str());
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
movl $0x0, 0x4c(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x122d40
leaq 0x20(%rsp), %rdi
callq 0x122d70
movq 0x70(%rsp), %rax
movsd 0x33f5c6(%rip), %xmm0   # 0x45f070
movsd %xmm0, (%rax)
movq 0x70(%rsp), %rax
movsd 0x33f5bd(%rip), %xmm0   # 0x45f078
ucomisd (%rax), %xmm0
jb 0x11fb40
movq 0x68(%rsp), %rax
movsd 0x33f5a2(%rip), %xmm0   # 0x45f070
movsd %xmm0, (%rax)
movq 0x68(%rsp), %rax
movsd 0x33f599(%rip), %xmm0   # 0x45f078
ucomisd (%rax), %xmm0
jb 0x11fb24
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq *%rax
addsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
movq 0x68(%rsp), %rax
movsd 0x33f566(%rip), %xmm0   # 0x45f080
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x11fad2
jmp 0x11fb26
movq 0x70(%rsp), %rax
movsd 0x33f54d(%rip), %xmm0   # 0x45f080
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x11faae
leaq 0x20(%rsp), %rdi
callq 0x122df0
xorps %xmm0, %xmm0
ucomisd 0x50(%rsp), %xmm0
jne 0x11fb59
jp 0x11fb59
jmp 0x11fbbe
leaq 0x20(%rsp), %rdi
callq 0x122e20
movsd %xmm0, 0x10(%rsp)
movl 0x4c(%rsp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x122e20
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x58(%rsp), %rdi
callq 0x115120
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %rax, %rsi
leaq 0x345047(%rip), %rdi    # 0x464bfc
movb $0x2, %al
callq 0x1150b0
jmp 0x11fbd9
movq 0x58(%rsp), %rdi
callq 0x115120
movq %rax, %rsi
leaq 0x34506b(%rip), %rdi    # 0x464c3d
movb $0x0, %al
callq 0x1150b0
addq $0x78, %rsp
retq
nop
// File: 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:
subq $0x288, %rsp            # imm = 0x288
movq %rdi, 0x278(%rsp)
movq %rsi, 0x270(%rsp)
movq 0x278(%rsp), %rdi
callq 0x115120
movq %rax, %rsi
leaq 0x68(%rsp), %rdi
movl $0x8, %edx
callq 0x115080
movq 0x68(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x68(%rsp,%rax), %rdi
callq 0x115060
movb %al, 0x2f(%rsp)
jmp 0x12080f
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x120819
jmp 0x120845
movq $0x0, 0x280(%rsp)
movl $0x1, 0x58(%rsp)
jmp 0x12094c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
jmp 0x120966
leaq 0x38(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x1152b0
movq 0x20(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x115590
jmp 0x120865
movq $0x0, 0x30(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x115400
movq %rax, 0x18(%rsp)
jmp 0x120884
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x1152f0
movb %al, 0x17(%rsp)
jmp 0x12089e
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x1208ab
jmp 0x12092d
leaq 0x38(%rsp), %rdi
callq 0x115250
testb $0x1, %al
jne 0x1208bb
jmp 0x1208da
jmp 0x12086e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x115818
jmp 0x120966
xorl %eax, %eax
movl %eax, %esi
leaq 0x38(%rsp), %rdi
callq 0x115780
movq %rax, 0x8(%rsp)
jmp 0x1208ef
movq 0x8(%rsp), %rax
movsbl (%rax), %ecx
movl $0x23, %eax
cmpl %ecx, %eax
jne 0x120905
jmp 0x12086e
jmp 0x120907
movq 0x30(%rsp), %rax
incq %rax
movq %rax, 0x30(%rsp)
movq 0x270(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x124360
jmp 0x120928
jmp 0x12086e
movq 0x30(%rsp), %rax
movq %rax, 0x280(%rsp)
movl $0x1, 0x58(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x115818
leaq 0x68(%rsp), %rdi
callq 0x115070
movq 0x280(%rsp), %rax
addq $0x288, %rsp            # imm = 0x288
retq
leaq 0x68(%rsp), %rdi
callq 0x115070
movq 0x60(%rsp), %rdi
callq 0x1154d0
nopw (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl %esi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl 0x1cbaa6(%rip), %eax    # 0x1f4abc
movl 0xc(%rsp), %ecx
subl %ecx, %eax
movl %eax, 0xc(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x8(%rsp)
subl $0x65, %eax
je 0x29060
jmp 0x2902f
movl 0x8(%rsp), %eax
subl $0x67, %eax
jne 0x290ab
jmp 0x2903a
cmpl $0x1, 0x1cba6f(%rip)    # 0x1f4ab0
jg 0x2904f
movl $0x0, 0x1cba63(%rip)    # 0x1f4ab0
jmp 0x2905e
movl 0x1cba5b(%rip), %eax    # 0x1f4ab0
addl $-0x1, %eax
movl %eax, 0x1cba52(%rip)    # 0x1f4ab0
jmp 0x290ab
movl 0x1cba4a(%rip), %eax    # 0x1f4ab0
movl %eax, 0x4(%rsp)
leaq 0x1d1ba7(%rip), %rdi    # 0x1fac18
callq 0x2a760
movl %eax, %ecx
movl 0x4(%rsp), %eax
subl $0x2, %ecx
cmpl %ecx, %eax
jl 0x2909a
leaq 0x1d1b8e(%rip), %rdi    # 0x1fac18
callq 0x2a760
subl $0x1, %eax
movl %eax, 0x1cba18(%rip)    # 0x1f4ab0
jmp 0x290a9
movl 0x1cba10(%rip), %eax    # 0x1f4ab0
addl $0x1, %eax
movl %eax, 0x1cba07(%rip)    # 0x1f4ab0
jmp 0x290ab
movl 0x10(%rsp), %eax
movl %eax, 0x1d22ab(%rip)    # 0x1fb360
movl 0xc(%rsp), %eax
movl %eax, 0x1d22a5(%rip)    # 0x1fb364
callq 0x1813d0
movl %eax, 0x1d22c6(%rip)    # 0x1fb390
callq 0x1791a0
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)