LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/akgupta007[P]DBMS-query-processing-Algotihms/file_manager.cpp
// Function: FileManager::FileManager()
FileManager::FileManager() {
	// intialize manager with a buffer manager
	// thus buffer manager will be hidden from student API access 
	if(FileManagerInstanceCount==1) {
		throw FileManagerInstanceException();
	}
	FileManagerInstanceCount = 1;
	bufferManager = new BufferManager(BUFFER_SIZE);
 
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpl $0x1, 0x46cc(%rip)      # 0x8168
je 0x3ac9
movq %rdi, %rbx
movl $0x1, 0x46bd(%rip)      # 0x8168
pushq $0x78
popq %rdi
callq 0x2180
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rax, %rdi
callq 0x241c
movq %r14, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x20e0
leaq 0x4298(%rip), %rcx      # 0x7d70
movq %rcx, (%rax)
leaq 0x4226(%rip), %rsi      # 0x7d08
movq 0x44f7(%rip), %rdx      # 0x7fe0
movq %rax, %rdi
callq 0x2220
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
movq %rbx, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O2/akgupta007[P]DBMS-query-processing-Algotihms/file_manager.cpp
// Function: FileManager::CreateFile(char const*)
FileHandler FileManager::CreateFile(const char* filename) {
	// open file for writing
	int fd = open(filename,O_CREAT|O_EXCL|O_RDWR,0660); // updated to fail if file already exists
	if(fd==-1) throw InvalidFileException();
	// write out the initial header
	char hdr_buf[FILE_HDR_SIZE];
	memset(hdr_buf,0,FILE_HDR_SIZE);
	FileHdr *hdr= (FileHdr*) hdr_buf;
	hdr->firstFreePage = END_FREE;
	hdr->totalPages = 0;
	write(fd,hdr_buf,FILE_HDR_SIZE);
	close(fd);
	return OpenFile(filename);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, %rdi
movl $0xc2, %esi
movl $0x1b0, %edx            # imm = 0x1B0
xorl %eax, %eax
callq 0x2120
cmpl $-0x1, %eax
je 0x3bbf
movl %eax, %r12d
leaq -0x1030(%rbp), %r13
movl $0x1000, %edx           # imm = 0x1000
movq %r13, %rdi
xorl %esi, %esi
callq 0x2100
orl $-0x1, (%r13)
movl $0x1000, %edx           # imm = 0x1000
movl %r12d, %edi
movq %r13, %rsi
callq 0x2080
movl %r12d, %edi
callq 0x2270
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3be8
movq %rbx, %rax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x20e0
leaq 0x41ca(%rip), %rcx      # 0x7d98
movq %rcx, (%rax)
leaq 0x4148(%rip), %rsi      # 0x7d20
movq 0x4401(%rip), %rdx      # 0x7fe0
movq %rax, %rdi
callq 0x2220
nop
// File: /workspace/github_cpp_makefile_star2_O2/akgupta007[P]DBMS-query-processing-Algotihms/file_manager.cpp
// Function: FileManager::OpenFile(char const*)
FileHandler FileManager::OpenFile(const char *filename) {
	FileHandler fileHandle; 
	// open file 
	fileHandle.fileName = new char[strlen(filename)+1];
	strcpy(fileHandle.fileName, filename);
 

	fileHandle.unix_file_desc = open(filename,O_RDWR);
	if(fileHandle.unix_file_desc==-1) throw InvalidFileException();
	//read header
	fileHandle.hdr.firstFreePage = 0;
	fileHandle.hdr.totalPages = 0;
	int _temp_res = read(fileHandle.unix_file_desc,(char *)&fileHandle.hdr,
            sizeof(FileHdr));
    // update file metadata
    fileHandle.isOpen = true;
    fileHandle.hdrChanged = false;
    fileHandle.bufferManager = bufferManager;
    return fileHandle;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
andw $0x0, 0x10(%rdi)
movq %rsi, %r14
andq $0x0, (%rdi)
movq %rdx, %rdi
callq 0x20b0
leaq 0x1(%rax), %rdi
callq 0x2030
movq %rax, 0x18(%rbx)
movq %rax, %rdi
movq %r15, %rsi
callq 0x2150
pushq $0x2
popq %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2120
movl %eax, 0x14(%rbx)
cmpl $-0x1, %eax
je 0x3c66
leaq 0x8(%rbx), %rsi
andq $0x0, 0x8(%rbx)
pushq $0x8
popq %rdx
movl %eax, %edi
callq 0x21c0
movw $0x1, 0x10(%rbx)
movq (%r14), %rax
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x20e0
leaq 0x4123(%rip), %rcx      # 0x7d98
movq %rcx, (%rax)
leaq 0x40a1(%rip), %rsi      # 0x7d20
movq 0x435a(%rip), %rdx      # 0x7fe0
movq %rax, %rdi
callq 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/akgupta007[P]DBMS-query-processing-Algotihms/file_manager.cpp
// Function: FileManager::CloseFile(FileHandler&)
bool FileManager::CloseFile(FileHandler &fileHandle) {
	if(!fileHandle.isOpen) return false; // if not already open
	if(!fileHandle.FlushPages()) return false; //flush pages to file, if error in flushing all pages , return false
	close(fileHandle.unix_file_desc); // close the file
 

	//update meta data
	fileHandle.isOpen = false;
	fileHandle.bufferManager = NULL;	
	return true;
}

// Assembly:
cmpb $0x1, 0x10(%rsi)
jne 0x3cd1
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x39e8
testb %al, %al
je 0x3cd4
movl 0x14(%rbx), %edi
callq 0x2270
movb $0x0, 0x10(%rbx)
andq $0x0, (%rbx)
movb $0x1, %al
jmp 0x3cd6
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/akgupta007[P]DBMS-query-processing-Algotihms/check.cpp
// Function: getValue[abi:cxx11](char const*)
list<int> getValue(const char *filename){
	ifstream myfile(filename);
	if(!myfile){
		cout<<"could not open file " << filename <<endl;
		exit (0);
	}
	list<int> num;
	int n;
	while(!myfile.eof()){
		myfile >> n;
		num.push_back(n);
	}
	myfile.close();
	return num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x228(%rbp), %r15
pushq $0x8
popq %rdx
movq %r15, %rdi
callq 0x2250
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x208(%rbp,%rax)
jne 0x3e1e
movq %rbx, 0x8(%rbx)
movq %rbx, (%rbx)
andq $0x0, 0x10(%rbx)
leaq -0x228(%rbp), %r14
leaq -0x1c(%rbp), %r15
movq -0x228(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x208(%rbp,%rax)
jne 0x3df5
movq %r14, %rdi
movq %r15, %rsi
callq 0x2110
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2de0
jmp 0x3dc8
leaq -0x228(%rbp), %rdi
callq 0x2050
leaq -0x228(%rbp), %rdi
callq 0x2060
movq %rbx, %rax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x41ab(%rip), %rdi      # 0x7fd0
leaq 0x157c(%rip), %rsi      # 0x53a8
callq 0x2170
movq %rax, %rdi
movq %r14, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
xorl %edi, %edi
callq 0x2190
movq %rax, %r14
jmp 0x3e5d
jmp 0x3e52
movq %rax, %r14
movq %rbx, %rdi
callq 0x2f42
leaq -0x228(%rbp), %rdi
callq 0x2060
movq %r14, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O2/akgupta007[P]DBMS-query-processing-Algotihms/check.cpp
// Function: checkPage(std::__cxx11::list<int, std::allocator<int>>, char*)
list<int> checkPage(list<int> lst, char* pageData){
	int n;
	int num = lst.front();
	list<int> position;
	int i = 0;
	for(; i< PAGE_CONTENT_SIZE/sizeof(int); i++){
		memcpy (&n, &pageData[i*sizeof(int)], sizeof(int));
		if (n == INT_MIN){
			break;
		}
		if (n > num){
			lst.pop_front();
			position.push_back(i);
			i--;
			if(lst.empty()){
				break;
			}
			num = lst.front();
		}
	}
	while( !lst.empty() ){
		position.push_back(i);
		lst.pop_front();
	}
	return position;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movl 0x10(%rax), %esi
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rdx, %r15
xorl %ecx, %ecx
leaq -0x24(%rbp), %r12
movl %ecx, -0x24(%rbp)
cmpl $0x3ff, %ecx            # imm = 0x3FF
jae 0x3ee9
movl %ecx, %edx
movl (%r15,%rdx,4), %edx
movl %edx, %edi
negl %edi
jo 0x3ee9
cmpl %esi, %edx
jle 0x3ee2
movq %r14, %rdi
callq 0x2e84
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2de0
movl -0x24(%rbp), %ecx
decl %ecx
movl %ecx, -0x24(%rbp)
movq (%r14), %rax
cmpq %r14, %rax
je 0x3ee6
movl 0x10(%rax), %esi
incl %ecx
jmp 0x3ea1
movq %r14, %rax
leaq -0x24(%rbp), %r15
cmpq %r14, %rax
je 0x3f0a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2de0
movq %r14, %rdi
callq 0x2e84
movq (%r14), %rax
jmp 0x3eed
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3f1c
movq %rax, %r14
movq %rbx, %rdi
callq 0x2f42
movq %r14, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O2/akgupta007[P]DBMS-query-processing-Algotihms/check.cpp
// Function: InsertValue(int, int, int, FileHandler&)
void InsertValue(int num, int position, int pageNo, FileHandler &fh){
	try{
		PageHandler ph = fh.PageAt(pageNo);
		bool pin = fh.MarkDirty(pageNo);
		char *pageData = ph.GetData();
		int n;
		int max_data = PAGE_CONTENT_SIZE/sizeof(int);
		for(int i = position; i< max_data; i++){
			memcpy (&n, &pageData[i*sizeof(int)], sizeof(int));
			if( n == INT_MIN ){
				if (i == max_data -1){
					fh.UnpinPage(pageNo);
					InsertValue(num, 0, pageNo + 1, fh);
					return;
				}
				else {
					memcpy (&pageData[i*sizeof(int)], &num, sizeof(int));
					memcpy (&pageData[(i+1)*sizeof(int)], &n, sizeof(int));
					break;
				}
			}
			memcpy (&pageData[i*sizeof(int)], &num, sizeof(int));
			num = n;
		}
		return;
	}
	catch(InvalidPageException args){
		//create New Page
		PageHandler ph = fh.NewPage();
		char *pageData = ph.GetData();
		int m = INT_MIN;
		memcpy (&pageData[0], &m, sizeof(int));
		InsertValue(num, 0, ph.GetPageNum(), fh);
		return;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %rbx
movl %edx, %r15d
movl %esi, %r12d
movl %edi, %r14d
leaq -0x38(%rbp), %rdi
movq %rcx, %rsi
callq 0x37f8
movq %rbx, %rdi
movl %r15d, %esi
callq 0x395c
leaq -0x38(%rbp), %rdi
callq 0x3656
movabsq $0x100000000, %rsi      # imm = 0x100000000
movslq %r12d, %rdx
movq %rdx, %rcx
shlq $0x20, %rcx
addq %rsi, %rcx
cmpq $0x3ff, %rdx            # imm = 0x3FF
jge 0x3fdc
movl (%rax,%rdx,4), %edi
movl %edi, %r8d
negl %r8d
jo 0x3fa4
movl %r14d, (%rax,%rdx,4)
incq %rdx
addq %rsi, %rcx
movl %edi, %r14d
jmp 0x3f81
cmpq $0x3fe, %rdx            # imm = 0x3FE
jne 0x3fcd
movq %rbx, %rdi
movl %r15d, %esi
callq 0x38a2
incl %r15d
movl %r14d, %edi
xorl %esi, %esi
movl %r15d, %edx
movq %rbx, %rcx
callq 0x3f2f
jmp 0x3fdc
movl %r14d, (%rax,%rdx,4)
sarq $0x1e, %rcx
movl $0x80000000, (%rax,%rcx) # imm = 0x80000000
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3fef
jmp 0x3fef
jmp 0x3fef
movq %rax, %r15
cmpl $0x1, %edx
jne 0x406a
movq %r15, %rdi
callq 0x21a0
leaq 0x3d42(%rip), %rax      # 0x7d48
movq %rax, -0x28(%rbp)
movq %r15, %rdi
callq 0x20a0
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x38bc
leaq -0x38(%rbp), %rdi
callq 0x3656
movl $0x80000000, (%rax)     # imm = 0x80000000
leaq -0x38(%rbp), %rdi
callq 0x3660
movl %r14d, %edi
xorl %esi, %esi
movl %eax, %edx
movq %rbx, %rcx
callq 0x3f2f
leaq -0x28(%rbp), %rdi
callq 0x2288
callq 0x2200
jmp 0x3fdc
jmp 0x4059
jmp 0x4059
movq %rax, %r15
leaq -0x28(%rbp), %rdi
callq 0x2288
callq 0x2200
movq %r15, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x2f11
// File: /workspace/github_cpp_makefile_star2_O2/akgupta007[P]DBMS-query-processing-Algotihms/check.cpp
// Function: PrintPage(PageHandler)
void PrintPage(PageHandler ph){
	char* data = ph.GetData ();
	int temp_num;
	// Output the all integers
	for(int i=0; i<1022 ; i++){
		memcpy (&temp_num, &data[i*4], sizeof(int));
		cout << i<< "th number: " << temp_num << endl;
		if(temp_num == INT_MIN) break;
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x3656
movq %rax, %rbx
xorl %r14d, %r14d
movq 0x3f36(%rip), %r15      # 0x7fd0
leaq 0x131c(%rip), %r12      # 0x53bd
cmpq $0x3fe, %r14            # imm = 0x3FE
je 0x40df
movl (%rbx,%r14,4), %r13d
movq %r15, %rdi
movl %r14d, %esi
callq 0x2230
movq %rax, %rdi
movq %r12, %rsi
callq 0x2170
movq %rax, %rdi
movl %r13d, %esi
callq 0x2230
movq %rax, %rdi
callq 0x20d0
incq %r14
negl %r13d
jno 0x40a1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/akgupta007[P]DBMS-query-processing-Algotihms/check.cpp
// Function: main
int main(int argc, char* argv[]) {
	//read input file
	
	FileManager fm;
	FileHandler fh;
	
	// Reopen the same file, but for reading this time
	fh = fm.OpenFile (argv[1]);
	
	PageHandler ph_last = fh.LastPage ();
	int total_pages = ph_last.GetPageNum ()+1;
	for(int i = 0; i<total_pages; i++){
		cout<< "Page : "<<i <<endl;
		ph_last = fh.PageAt(i);
		PrintPage(ph_last);
		fh.UnpinPage(i);
	}
	cout<<total_pages<<endl;
	fh.FlushPages();
	fm.CloseFile (fh);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3a8e
leaq -0x80(%rbp), %rdi
callq 0x3668
movq 0x8(%rbx), %rdx
leaq -0x60(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3be8
leaq -0x60(%rbp), %rdi
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
leaq -0x80(%rbp), %rsi
movaps %xmm1, 0x10(%rsi)
movaps %xmm0, (%rsi)
callq 0x375c
leaq -0x60(%rbp), %rdi
callq 0x3660
movl %eax, %r14d
leal 0x1(%r14), %eax
movl %eax, -0x34(%rbp)
xorl %r15d, %r15d
leaq -0x80(%rbp), %r12
leaq -0xa0(%rbp), %r13
leaq -0x60(%rbp), %rbx
cmpl %r14d, %r15d
jg 0x45ad
movq 0x3a82(%rip), %rdi      # 0x7fd0
leaq 0xe74(%rip), %rsi       # 0x53c9
callq 0x2170
movq %rax, %rdi
movl %r15d, %esi
callq 0x2230
movq %rax, %rdi
callq 0x20d0
leaq -0x90(%rbp), %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x37f8
movups -0x90(%rbp), %xmm0
movaps %xmm0, -0x60(%rbp)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x362a
movq %r13, %rdi
callq 0x407a
movq %r12, %rdi
movl %r15d, %esi
callq 0x38a2
incl %r15d
jmp 0x4542
movq 0x3a1c(%rip), %rdi      # 0x7fd0
movl -0x34(%rbp), %esi
callq 0x2230
movq %rax, %rdi
callq 0x20d0
leaq -0x80(%rbp), %rdi
callq 0x39e8
leaq -0x30(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3ca2
leaq -0x30(%rbp), %rdi
callq 0x3b04
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x45fe
jmp 0x45fe
jmp 0x45fe
jmp 0x45fe
jmp 0x45fe
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3b04
movq %rbx, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/server_fail.cpp
// Function: server_shutdown(int)
void server_shutdown (int s)
{
    (void) s;
    cout << "\n";
    cout << "Initiating Server Shutdown...\n";
    cout << "Closing All Connections... ";
    site.close ();
    cout << "\nAll Connections Closed. Exiting...\n\n";
    exit (EXIT_SUCCESS);
}

// Assembly:
pushq %rbx
movq 0x9884(%rip), %rbx      # 0xbfc8
leaq 0x5aa9(%rip), %rsi      # 0x81f4
movq %rbx, %rdi
callq 0x2240
leaq 0x58ce(%rip), %rsi      # 0x8028
movq %rbx, %rdi
callq 0x2240
leaq 0x58de(%rip), %rsi      # 0x8047
movq %rbx, %rdi
callq 0x2240
leaq 0x9aa0(%rip), %rdi      # 0xc218
callq 0x58ba
leaq 0x58df(%rip), %rsi      # 0x8063
movq %rbx, %rdi
callq 0x2240
xorl %edi, %edi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/socket.cpp
// Function: Socket::connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
int Socket::connect (string host, int port)
{
    /* Creating the socket. */
    if ((socketFD = socket (AF_INET, SOCK_STREAM, 0)) < 0)
    {
        int errsv = errno;
        std::cerr << "Cannot Create Socket, Error ";
        std::cerr << errsv << "\n";
        exit (1);
    }
    /* Determining server's IP address. */
    stringstream s1;
    s1 << port;
    int status;
    addrinfo hints;
    addrinfo* servinfo;
    memset (&hints, 0, sizeof (hints));
    hints.ai_family = AF_INET;
    hints.ai_socktype = SOCK_STREAM;
    if ((status = getaddrinfo (host.c_str (), s1.str ().c_str (), &hints,
                               &servinfo)) != 0)
        return -1;

    /* Connecting to the server. */
    return ::connect (socketFD, servinfo->ai_addr, servinfo->ai_addrlen);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1f0, %rsp            # imm = 0x1F0
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x2070
movl %eax, (%rbx)
testl %eax, %eax
js 0x55e9
leaq 0x68(%rsp), %rdi
callq 0x2180
leaq 0x78(%rsp), %rdi
movl %ebp, %esi
callq 0x23a0
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x34(%rsp)
movq (%r14), %r14
leaq 0x80(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x2380
movq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
callq 0x2310
movl %eax, %ebp
leaq 0x10(%rsp), %rdi
callq 0x2100
testl %ebp, %ebp
je 0x55bc
pushq $-0x1
popq %rbx
jmp 0x55d1
movl (%rbx), %edi
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
movl 0x10(%rax), %edx
callq 0x21e0
movl %eax, %ebx
leaq 0x68(%rsp), %rdi
callq 0x21b0
movl %ebx, %eax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbx
popq %r14
popq %rbp
retq
callq 0x2040
movl (%rax), %ebx
movq 0x69f9(%rip), %r14      # 0xbff0
leaq 0x2d8b(%rip), %rsi      # 0x8389
movq %r14, %rdi
callq 0x2240
movq %r14, %rdi
movl %ebx, %esi
callq 0x23a0
leaq 0x2bdd(%rip), %rsi      # 0x81f4
movq %rax, %rdi
callq 0x2240
pushq $0x1
popq %rdi
callq 0x22d0
jmp 0x563a
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2100
jmp 0x563d
jmp 0x563a
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x23b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/socket.cpp
// Function: Socket::recv[abi:cxx11](unsigned long)
string Socket::recv (size_t len)
{
    char* recv_buf = new char[len + 1];
    int recv_len = ::recv (socketFD, recv_buf, len, 0);
    if (recv_len < 0)
        return string ("");
    recv_buf[recv_len] = '\0';
    return string (recv_buf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x1(%rdx), %rdi
callq 0x2030
movq %rax, %r14
movl (%r12), %edi
movq %rax, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x20b0
testl %eax, %eax
js 0x56b7
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x0, (%r14,%rax)
leaq 0x6(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x56c6
leaq 0x2b37(%rip), %rsi      # 0x81f5
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x474a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/socket.cpp
// Function: Socket::bind(int)
int Socket::bind (int port)
{
    /* Creating the socket. */
    if ((socketFD = socket (AF_INET, SOCK_STREAM, 0)) < 0)
    {
        int errsv = errno;
        std::cerr << "Cannot Create Socket, Error ";
        std::cerr << errsv << "\n";
        exit (1);
    }
    sockaddr_in myaddr;
    memset ((char*)&myaddr, 0, sizeof(myaddr));
    myaddr.sin_family = AF_INET;
    myaddr.sin_addr.s_addr = htonl (INADDR_ANY);
    myaddr.sin_port = htons (port);
    return ::bind (socketFD, (sockaddr *)&myaddr, sizeof (myaddr));
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x2070
movl %eax, (%r14)
testl %eax, %eax
js 0x5731
leaq 0x8(%rsp), %rsi
andq $0x0, 0x8(%rsi)
movw $0x2, (%rsi)
andl $0x0, 0x4(%rsi)
rolw $0x8, %bx
movw %bx, 0x2(%rsi)
pushq $0x10
popq %rdx
movl %eax, %edi
callq 0x2050
addq $0x18, %rsp
popq %rbx
popq %r14
retq
callq 0x2040
movl (%rax), %ebx
movq 0x68b1(%rip), %r14      # 0xbff0
leaq 0x2c43(%rip), %rsi      # 0x8389
movq %r14, %rdi
callq 0x2240
movq %r14, %rdi
movl %ebx, %esi
callq 0x23a0
leaq 0x2a95(%rip), %rsi      # 0x81f4
movq %rax, %rdi
callq 0x2240
pushq $0x1
popq %rdi
callq 0x22d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/socket.cpp
// Function: Socket::accept()
Socket Socket::accept ()
{
    sockaddr_storage incoming;
    socklen_t addr_size;
    int tmp_fd = ::accept (socketFD, (sockaddr*)&incoming, &addr_size);
    return (Socket (tmp_fd));
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
movl (%rsi), %edi
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x20a0
movb $0x1, 0x4(%rbx)
movl %eax, (%rbx)
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/socket.cpp
// Function: Socket::getSourceAddr[abi:cxx11]()
string Socket::getSourceAddr ()
{
    char src[INET_ADDRSTRLEN];
    sockaddr_storage tmp;
    socklen_t addr_size = sizeof (sockaddr);
    getsockname (socketFD, (sockaddr*)&tmp, &addr_size);
    sockaddr_in* src_addr = (sockaddr_in*)&tmp;
    inet_ntop (AF_INET, &src_addr->sin_addr, src, sizeof (src));
    return string (src);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %rdx
movl $0x10, (%rdx)
movl (%rsi), %edi
leaq 0x28(%rsp), %rsi
callq 0x2220
leaq 0x2c(%rsp), %rsi
pushq $0x2
popq %rdi
leaq 0x10(%rsp), %r14
pushq $0x10
popq %rcx
movq %r14, %rdx
callq 0x2290
leaq 0xb(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x474a
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/socket.cpp
// Function: Socket::enableBlocking()
int Socket::enableBlocking ()
{
    if (socketFD < 0 && blockingEnabled)
        return -1;

    int flags;
    if ((flags = fcntl (socketFD, F_GETFL, 0)) < 0)
        return -1;

    int rval = fcntl (socketFD, F_SETFL, flags | O_NONBLOCK);
    if (rval < 0)
        return rval;
    else
        blockingEnabled = false;

    return rval;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %edi
pushq $-0x1
popq %rbp
testl %edi, %edi
jns 0x58e7
cmpb $0x0, 0x4(%rbx)
jne 0x5914
pushq $0x3
popq %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x5914
movl (%rbx), %edi
orl $0x800, %eax            # imm = 0x800
pushq $0x4
popq %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x2140
movl %eax, %ebp
testl %eax, %eax
js 0x5914
movb $0x0, 0x4(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/socket.cpp
// Function: Socket::disableBlocking()
int Socket::disableBlocking ()
{
    if (socketFD < 0 && (!blockingEnabled))
        return -1;

    int flags;
    if ((flags = fcntl (socketFD, F_GETFL, 0)) < 0)
        return -1;

    int rval = fcntl (socketFD, F_SETFL, flags & (~O_NONBLOCK));
    if (rval < 0)
        return rval;
    else
        blockingEnabled = true;

    return rval;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %edi
pushq $-0x1
popq %rbp
testl %edi, %edi
jns 0x5933
cmpb $0x1, 0x4(%rbx)
jne 0x5960
pushq $0x3
popq %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
js 0x5960
movl (%rbx), %edi
andl $0x7ffff7ff, %eax       # imm = 0x7FFFF7FF
pushq $0x4
popq %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x2140
movl %eax, %ebp
testl %eax, %eax
js 0x5960
movb $0x1, 0x4(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/message.cpp
// Function: split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, 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>>>>&)
void split(const std::string& line, char delim, std::vector<std::string>& val) {
    std::string::size_type i = 0;
    std::string::size_type j = line.find (delim);

    while (j != std::string::npos)
    {
        val.push_back (line.substr (i, j-i));
        i = ++j;
        j = line.find (delim, j);

        if (j == std::string::npos)
            val.push_back (line.substr (i, line.length ()));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
xorl %r13d, %r13d
xorl %edx, %edx
callq 0x2330
movq %rax, %r12
leaq 0x8(%rsp), %r15
movsbl %bpl, %ebp
cmpq $-0x1, %r12
je 0x5a08
movq %r12, %rcx
subq %r13, %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2270
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5ca0
movq %r15, %rdi
callq 0x2100
movq %r12, %r13
incq %r13
movq %r14, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x2330
movq %rax, %r12
cmpq $-0x1, %rax
jne 0x5998
movq 0x8(%r14), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2270
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5ca0
movq %r15, %rdi
callq 0x2100
jmp 0x5998
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5a19
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/message.cpp
// Function: Message::parseMessage()
void Message::parseMessage ()
{
    std::vector<std::string> m_parsed;
    split (message_str, DELIM, m_parsed);
    this->message = messageIndex (m_parsed[0]);
    this->transaction_id = std::stoi (m_parsed[1]);
    this->site_id = std::stoi (m_parsed[2]);
    this->failed_id = std::stoi (m_parsed[3]);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
addq $0x10, %rdi
pushq $0x2c
popq %rsi
callq 0x596c
movq (%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x2340
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x5c08
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x2100
movq (%rsp), %rdi
addq $0x20, %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x472e
movl %eax, 0x4(%rbx)
movq (%rsp), %rdi
addq $0x40, %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x472e
movl %eax, 0x8(%rbx)
movq (%rsp), %rdi
addq $0x60, %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x472e
movl %eax, 0xc(%rbx)
movq %rsp, %rdi
callq 0x5c7e
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5c7e
movq %rbx, %rdi
callq 0x23b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/rohitrangan[P]3PC/src/message.cpp
// Function: Message::createMessage[abi:cxx11]()
std::string Message::createMessage ()
{
    std::stringstream s;
    s << message_strings[message] << DELIM << transaction_id;
    s << DELIM << site_id << DELIM << failed_id;
    return s.str ();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2180
leaq 0x18(%rsp), %r15
movl (%r14), %eax
shlq $0x5, %rax
leaq 0x66c5(%rip), %rsi      # 0xc240
addq %rax, %rsi
movq %r15, %rdi
callq 0x2200
pushq $0x2c
popq %rsi
movq %rax, %rdi
callq 0x22c0
movl 0x4(%r14), %esi
movq %rax, %rdi
callq 0x23a0
pushq $0x2c
popq %rsi
movq %r15, %rdi
callq 0x22c0
movl 0x8(%r14), %esi
movq %rax, %rdi
callq 0x23a0
pushq $0x2c
popq %rsi
movq %rax, %rdi
callq 0x22c0
movl 0xc(%r14), %esi
movq %rax, %rdi
callq 0x23a0
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x2380
leaq 0x8(%rsp), %rdi
callq 0x21b0
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x23b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/amukherj[P]concurrencyts/./barrier.h
// Function: concurrencyts::barrier_base<concurrencyts::flex_barrier>::arrive_and_wait()
void arrive_and_wait() {
    std::unique_lock<std::mutex> ul{lock};
    allow.wait(ul, [this]()->bool { return count > 0; });
  
    if (--count == 0) {
      ul.unlock();

      auto ffunc = static_cast<T*>(this)->final_func();
      if (ffunc) {
        // run the completion block
        auto tmp_count = ffunc();
        if (tmp_count >= 0) {
          // readjust max_count for next phase of barrier.
          max_count = tmp_count;
        }
      }

      // release all waiting threads
      done.notify_all();
    } else {
      done.wait(ul, [this]()->bool { return count == 0; });
      ul.unlock();
    }
  
    ul.lock();
    if (++released_count == max_count) {
      count = max_count;
      released_count = 0;
      ul.unlock();
      // allow all waiting threads
      allow.notify_all();
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x8(%rdi), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x2770
leaq 0x30(%r14), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2786
decq 0x90(%r14)
je 0x263f
leaq 0x60(%r14), %rdi
movq %rsp, %rsi
movq %r14, %rdx
callq 0x27d8
movq %rsp, %rdi
callq 0x27b2
jmp 0x2667
movq %rsp, %rdi
callq 0x27b2
movq 0xa0(%r14), %rax
testq %rax, %rax
je 0x265e
callq *%rax
testl %eax, %eax
js 0x265e
movl %eax, %eax
movq %rax, (%r14)
leaq 0x60(%r14), %rdi
callq 0x2130
movq %rsp, %rdi
callq 0x2804
movq 0x98(%r14), %rax
incq %rax
movq %rax, 0x98(%r14)
cmpq (%r14), %rax
jne 0x26a4
movq %rax, 0x90(%r14)
andq $0x0, 0x98(%r14)
movq %rsp, %rdi
callq 0x27b2
movq %rbx, %rdi
callq 0x2130
movq %rsp, %rdi
callq 0x282e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x26b8
movq %rax, %rbx
movq %rsp, %rdi
callq 0x282e
movq %rbx, %rdi
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/exprtk_vector_benchmark.cpp
// Function: main
int main(int argc, char* argv[])
{
   const std::size_t vec_size  = ((argc >= 2) ? atoi(argv[1]) : 100000);
   const std::string file_name = ((argc >  3) ? argv[2] : ""          );

   switch (argc)
   {
      case 2 : run_benchmark     <numeric_type>(vec_size          ); break;
      case 3 : run_file_benchmark<numeric_type>(vec_size,file_name); break;
   }

   return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl %edi, %ebx
cmpl $0x1, %edi
jle 0x1135a8
movq %rsi, %r14
movq 0x8(%rsi), %rdi
callq 0x110190
cltq
movq %rax, 0x10(%rsp)
cmpl $0x4, %ebx
jb 0x1135b1
movq 0x10(%r14), %rsi
jmp 0x1135b8
movq $0x186a0, 0x10(%rsp)    # imm = 0x186A0
leaq 0x12fe87(%rip), %rsi    # 0x24343f
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x1136b6
cmpl $0x3, %ebx
je 0x1135dd
cmpl $0x2, %ebx
jne 0x1135ec
leaq 0x10(%rsp), %rdi
callq 0x1136f1
jmp 0x1135ec
leaq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x1137ab
leaq 0x18(%rsp), %rdi
callq 0x110608
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x110608
movq %rbx, %rdi
callq 0x110360
// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/exprtk_vector_benchmark.cpp
// Function: void run_benchmark<double>(unsigned long const&)
void run_benchmark(const std::size_t& vec_size)
{
   T total_time = 0.0;

   for (std::size_t i = 0; i < global_expression_list_size; ++i)
   {
      total_time +=
      run_expression_benchmark<T>(vec_size,
                                  global_expression_list[i].e,
                                  global_expression_list[i].cost);
   }

   unsigned long long total_flops = 0;

   for (std::size_t i = 0; i < global_expression_list_size; ++i)
   {
      total_flops += global_expression_list[i].cost;
   }

   total_flops *= (rounds * vec_size);

   printf("Total Time:%10.7f FLOP: %llu Perf: %7.4fGFLOPS\n",
          total_time,
          total_flops,
          total_flops / (1e9 * total_time));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorpd %xmm2, %xmm2
pushq $0x28
popq %r15
leaq 0x2be724(%rip), %r14    # 0x3d1e30
subq $0x1, %r15
jb 0x113737
movq (%rbx), %rdi
leaq 0x8(%r14), %rsi
movq %r14, %rdx
movsd %xmm2, 0x8(%rsp)
callq 0x1139b7
movsd 0x8(%rsp), %xmm2
addsd %xmm0, %xmm2
addq $0x28, %r14
jmp 0x11370c
xorl %eax, %eax
leaq 0x2be6f0(%rip), %rdx    # 0x3d1e30
xorl %ecx, %ecx
cmpq $0x640, %rax            # imm = 0x640
je 0x113754
addq (%rax,%rdx), %rcx
addq $0x28, %rax
jmp 0x113742
imulq (%rbx), %rcx
imulq $0x7d0, %rcx, %rsi      # imm = 0x7D0
movq %rsi, %xmm0
punpckldq 0x12a8a4(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x12a8ac(%rip), %xmm0   # 0x23e020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x12a8e8(%rip), %xmm0   # 0x23e070
mulsd %xmm2, %xmm0
divsd %xmm0, %xmm1
leaq 0x12fc79(%rip), %rdi    # 0x243410
movapd %xmm2, %xmm0
movb $0x2, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x110080
// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/exprtk_vector_benchmark.cpp
// Function: void run_file_benchmark<double>(unsigned long const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void run_file_benchmark(const std::size_t& vec_size, const std::string& file_name)
{
   std::ifstream stream(file_name.c_str());

   if (!stream)
   {
      printf("run_file_benchmark() - Failed to open file: %s\n",
             file_name.c_str());
      return;
   }

   std::string line;
   std::vector<std::string> expr_list;

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

      expr_list.push_back(line);
   }

   T total_time = T(0);

   for (std::size_t i = 0; i < expr_list.size(); ++i)
   {
      total_time += run_expression_benchmark<T>(vec_size,expr_list[i],0);
   }

   printf("Total Time:%10.7f\n", total_time);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
leaq 0x50(%rsp), %r15
pushq $0x8
popq %rdx
movq %r15, %rdi
callq 0x110050
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x70(%rsp,%rax)
je 0x1137f6
movq (%r14), %rsi
leaq 0x1349ea(%rip), %rdi    # 0x2481d4
xorl %eax, %eax
callq 0x110080
jmp 0x1138d2
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x10(%rsp), %r14
andq $0x0, 0x10(%r14)
xorpd %xmm0, %xmm0
movapd %xmm0, (%r14)
leaq 0x50(%rsp), %r15
leaq 0x30(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1102a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x11385c
cmpq $0x0, 0x38(%rsp)
je 0x113824
movq 0x30(%rsp), %rax
cmpb $0x23, (%rax)
je 0x113824
movq %r14, %rdi
movq %r12, %rsi
callq 0x224724
jmp 0x113824
xorpd %xmm0, %xmm0
xorl %r15d, %r15d
leaq 0x8(%rsp), %r14
xorl %r12d, %r12d
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rax, %r12
jae 0x1138b0
movsd %xmm0, (%rsp)
movq (%rbx), %rdi
addq %r15, %rsi
andq $0x0, 0x8(%rsp)
movq %r14, %rdx
callq 0x1139b7
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
incq %r12
addq $0x20, %r15
jmp 0x11386b
leaq 0x13494d(%rip), %rdi    # 0x248204
movb $0x1, %al
callq 0x110080
leaq 0x10(%rsp), %rdi
callq 0x178b72
leaq 0x30(%rsp), %rdi
callq 0x110608
leaq 0x50(%rsp), %rdi
callq 0x110040
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x1138ed
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x178b72
leaq 0x30(%rsp), %rdi
callq 0x110608
leaq 0x50(%rsp), %rdi
callq 0x110040
movq %rbx, %rdi
callq 0x110360
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/shared/mips_test_framework.cpp
// Function: mips_test_begin_suite
void mips_test_begin_suite()
{
    if(sg_started){
        fprintf(stderr, "Error:mips_test_begin_suite - Test suite has already been started\n");
        exit(1);
    }
    
    // Build up a list of known instruction names
    for(unsigned i=0; i<sg_instructionsCount; i++){
        sg_knownInstructions.insert(std::string(sg_instructionsArray[i].instruction));
    }
    
    sg_started=true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
cmpb $0x0, 0xac58(%rip)      # 0xe228
jne 0x3633
xorl %r12d, %r12d
leaq 0xa474(%rip), %r13      # 0xda50
leaq 0x10(%rsp), %rbx
leaq 0xf(%rsp), %r14
leaq 0xac0b(%rip), %r15      # 0xe1f8
cmpq $0x360, %r12            # imm = 0x360
je 0x361e
movq (%r12,%r13), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3bee
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3ef6
movq %rbx, %rdi
callq 0x30d0
addq $0x10, %r12
jmp 0x35ed
movb $0x1, 0xac03(%rip)      # 0xe228
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0xa99e(%rip), %rax      # 0xdfd8
movq (%rax), %rcx
leaq 0x59cc(%rip), %rdi      # 0x9010
pushq $0x42
popq %rsi
pushq $0x1
popq %rdx
callq 0x3370
pushq $0x1
popq %rdi
callq 0x3230
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x3330
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/shared/mips_test_framework.cpp
// Function: mips_test_begin_test
int mips_test_begin_test(const char *instruction)
{
    if(!sg_started){
        fprintf(stderr, "Error:mips_test_begin_test - Test suite has not been started with mips_test_begin_suite.\n");
        exit(1);
    }
    
    if(sg_tests.size()>0){
        if(sg_tests.back().status == -1){
            fprintf(stderr, "Error:mips_test_begin_test - Attempt to start new test of '%s', but previous test with id %u has not been completed.\n", instruction, sg_tests.back().testId);
            exit(1);
        }
    }
    
    int testId=sg_tests.size();
    
    test_info_t info;
    info.testId=testId;
    
    info.instruction=instruction; // We want the string in upper case (shouting!)
    std::transform(info.instruction.begin(), info.instruction.end(), info.instruction.begin(), ::toupper);
    
    if(sg_knownInstructions.find(info.instruction)==sg_knownInstructions.end()){
        fprintf(stderr, "Warning:mips_test_begin_test - Unknown instruction '%s', might want to check the spelling.\n", instruction);
    }
    
    info.status=-1;
    sg_tests.push_back(info);
    
    return testId;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpb $0x0, 0xaba7(%rip)      # 0xe228
je 0x377b
movq %rdi, %rbx
movq 0xab57(%rip), %rcx      # 0xe1e8
movq 0xab48(%rip), %rsi      # 0xe1e0
movq %rcx, %rax
subq %rsi, %rax
pushq $0x50
popq %rdi
cqto
idivq %rdi
movq %rax, %r14
cmpq %rsi, %rcx
je 0x36b8
cmpl $-0x1, -0x28(%rcx)
je 0x3799
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x10(%rsp), %r15
movb %cl, (%rax)
movl %r14d, -0x40(%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3360
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r13
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x3712
movsbl (%r12,%rbp), %edi
callq 0x3350
movb %al, (%r12,%rbp)
incq %rbp
jmp 0x36fa
leaq 0xaadf(%rip), %rdi      # 0xe1f8
movq %r15, %rsi
callq 0x40a2
leaq 0xaad8(%rip), %rcx      # 0xe200
cmpq %rcx, %rax
je 0x375e
leaq 0x8(%rsp), %rsi
orl $-0x1, 0x28(%rsi)
leaq 0xaaa3(%rip), %rdi      # 0xe1e0
callq 0x3c2a
leaq 0x8(%rsp), %rdi
callq 0x3c56
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa873(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
leaq 0x59b4(%rip), %rsi      # 0x9123
movq %rbx, %rdx
xorl %eax, %eax
callq 0x32b0
jmp 0x372d
movq 0xa856(%rip), %rax      # 0xdfd8
movq (%rax), %rcx
leaq 0x58c7(%rip), %rdi      # 0x9053
pushq $0x59
popq %rsi
pushq $0x1
popq %rdx
callq 0x3370
jmp 0x37b7
movq 0xa838(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movl -0x50(%rcx), %ecx
leaq 0x5900(%rip), %rsi      # 0x90ad
movq %rbx, %rdx
xorl %eax, %eax
callq 0x32b0
pushq $0x1
popq %rdi
callq 0x3230
jmp 0x37c1
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3c56
movq %rbx, %rdi
callq 0x3330
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/shared/mips_test_framework.cpp
// Function: mips_test_end_test
void mips_test_end_test(int testId, int passed, const char *msg)
{
    if(!sg_started){
        fprintf(stderr, "Error:mips_test_finish_test - Test suite has not been started with mips_test_begin_suite.");
        exit(1);
    }
    
    if(sg_tests.size()==0){
        fprintf(stderr, "Error:mips_test_finish_test - No tests have been started.\n");
        exit(1);
    }
    if(sg_tests.back().testId!=testId){
        fprintf(stderr, "Error:mips_test_finish_test - Attempt to finish test %u, but last test started was %u.\n", testId, sg_tests.back().testId);
        exit(1);
    }
    if(sg_tests.back().status!=-1){
        fprintf(stderr, "Error:mips_test_finish_test - Attempt to finish test %u, but it already finished with status %u.\n", testId, sg_tests.back().status);
        exit(1);  
    }
    
    sg_tests.back().status=passed ? 1 : 0;
    if(msg){
        sg_tests.back().message=msg;
    }
}

// Assembly:
pushq %rax
cmpb $0x0, 0xaa4a(%rip)      # 0xe228
je 0x381f
movl %edi, %eax
movq 0xa9ff(%rip), %rdi      # 0xe1e8
cmpq 0xa9f0(%rip), %rdi      # 0xe1e0
je 0x3834
movl -0x50(%rdi), %ecx
cmpl %eax, %ecx
jne 0x3852
movl -0x28(%rdi), %ecx
cmpl $-0x1, %ecx
jne 0x3865
xorl %eax, %eax
testl %esi, %esi
setne %al
movl %eax, -0x28(%rdi)
testq %rdx, %rdx
je 0x381d
addq $-0x20, %rdi
movq %rdx, %rsi
popq %rax
jmp 0x3360
popq %rax
retq
movq 0xa7b2(%rip), %rax      # 0xdfd8
movq (%rax), %rcx
leaq 0x594f(%rip), %rdi      # 0x917f
pushq $0x59
jmp 0x3847
movq 0xa79d(%rip), %rax      # 0xdfd8
movq (%rax), %rcx
leaq 0x5994(%rip), %rdi      # 0x91d9
pushq $0x3a
popq %rsi
pushq $0x1
popq %rdx
callq 0x3370
jmp 0x387f
movq 0xa77f(%rip), %rdx      # 0xdfd8
movq (%rdx), %rdi
leaq 0x59b1(%rip), %rsi      # 0x9214
jmp 0x3876
movq 0xa76c(%rip), %rdx      # 0xdfd8
movq (%rdx), %rdi
leaq 0x59f6(%rip), %rsi      # 0x926c
movl %eax, %edx
xorl %eax, %eax
callq 0x32b0
pushq $0x1
popq %rdi
callq 0x3230
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/shared/mips_mem_ram.cpp
// Function: mips_mem_create_ram
mips_mem_h mips_mem_create_ram(
                                          uint32_t cbMem	//!< Total number of bytes of ram
){
    if(cbMem>0x20000000){
        return 0; // No more than 512MB of RAM
    }
    
    uint8_t *data=(uint8_t*)malloc(cbMem);
    if(data==0)
        return 0;
    
    struct mips_mem_provider *mem=(struct mips_mem_provider*)malloc(sizeof(struct mips_mem_provider));
    if(mem==0){
        free(data);
        return 0;
    }
    
    mem->length=cbMem;
    mem->data=data;
    
    return mem;
}

// Assembly:
cmpl $0x20000000, %edi       # imm = 0x20000000
jbe 0x4703
xorl %eax, %eax
retq
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %edi
callq 0x3290
testq %rax, %rax
je 0x4735
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x3290
testq %rax, %rax
je 0x472d
movl %ebx, (%rax)
movq %r14, 0x8(%rax)
jmp 0x4737
movq %r14, %rdi
callq 0x3220
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/shared/mips_mem_ram.cpp
// Function: mips_mem_read_write(bool, mips_mem_provider*, unsigned int, unsigned int, unsigned char*)
static mips_error mips_mem_read_write(
                                      bool write,
                                      mips_mem_h mem,
                                      uint32_t address,
                                      uint32_t length,
                                      uint8_t *dataOut
                                      )
{
    if(mem==0){
        return mips_ErrorInvalidHandle;
    }
    
    if( (length!=1) && (length!=2) && (length!=4) ){
        return mips_ExceptionInvalidLength;
    }
    
    if(0 != (address % length) ){
        return mips_ExceptionInvalidAlignment;
    }
    if(((address+length) > mem->length) || (address > (UINT32_MAX - length))){	// A subtle bug here, maybe?
        return mips_ExceptionInvalidAddress;
    }
    
    if(write){
        for(unsigned i=0; i<length; i++){
            mem->data[address+i]=dataOut[i];
        }
    }else{
        for(unsigned i=0; i<length; i++){
            dataOut[i]=mem->data[address+i];
        }
    }
    return mips_Success;
}

// Assembly:
testq %rsi, %rsi
je 0x4778
movl $0x2001, %eax           # imm = 0x2001
cmpl $0x4, %ecx
ja 0x4777
movl %edx, %r9d
pushq $0x16
popq %rdx
btl %ecx, %edx
jae 0x4777
movl %r9d, %eax
xorl %edx, %edx
divl %ecx
movl $0x2003, %eax           # imm = 0x2003
testl %edx, %edx
je 0x477e
retq
movl $0x1002, %eax           # imm = 0x1002
retq
movl %ecx, %edx
movl $0x2002, %eax           # imm = 0x2002
addl %r9d, %edx
jb 0x4777
cmpl (%rsi), %edx
ja 0x4777
movl %ecx, %ecx
movl %r9d, %edx
xorl %eax, %eax
testb %dil, %dil
je 0x47b6
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x4777
movb (%r8,%rdi), %r9b
movq 0x8(%rsi), %r10
leal (%rdx,%rdi), %r11d
movb %r9b, (%r10,%r11)
incq %rdi
jmp 0x479c
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x4777
movq 0x8(%rsi), %r9
leal (%rdx,%rdi), %r10d
movb (%r9,%r10), %r9b
movb %r9b, (%r8,%rdi)
incq %rdi
jmp 0x47b8
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu.cpp
// Function: mips_cpu_create
mips_cpu_h mips_cpu_create(mips_mem_h mem){
	if (mem==0)
		return NULL;

	mips_cpu_h state = new mips_cpu_impl;
	state->hi = 0;
	state->lo = 0;
	state->pc = 0;
	state->pcN = 4;
	state->mem=mem;
	for (unsigned i = 0; i < 32; ++i)
		state->regs[i]=0;

	return state;
}

// Assembly:
testq %rdi, %rdi
je 0x4838
pushq %rbx
movq %rdi, %rbx
movl $0xa8, %edi
callq 0x31d0
movaps 0x5296(%rip), %xmm0     # 0x9ab0
movups %xmm0, (%rax)
movq %rbx, 0xa0(%rax)
pushq $0x4
popq %rcx
cmpq $0x24, %rcx
je 0x4836
andl $0x0, (%rax,%rcx,4)
incq %rcx
jmp 0x4827
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu.cpp
// Function: mips_cpu_reset
mips_error mips_cpu_reset(mips_cpu_h state){
	if (state==0)
		return mips_ErrorInvalidHandle;

	state->pc = 0;
	state->pcN = 4;
	state->hi = 0;
	state->lo = 0;
	for (unsigned i = 0; i < 32; ++i)
		state->regs[i]=0;

	return mips_Success;
}

// Assembly:
testq %rdi, %rdi
je 0x485e
movaps 0x5269(%rip), %xmm0     # 0x9ab0
movups %xmm0, (%rdi)
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x20, %rcx
je 0x4863
andl $0x0, 0x10(%rdi,%rcx,4)
incq %rcx
jmp 0x484e
movl $0x1002, %eax           # imm = 0x1002
retq
// File: /workspace/github_cpp_makefile_star2_O2/martinferianc[P]CPUSimulator-EIE2/src/mips_cpu.cpp
// Function: mips_cpu_set_register
mips_error mips_cpu_set_register(mips_cpu_h state, unsigned index, uint32_t value){
	if(state==0)
		return mips_ErrorInvalidHandle;

	if(index>31)
		return mips_ErrorInvalidArgument;

	if(index!=0)
		state->regs[index]=value;

	return mips_Success;
}

// Assembly:
testq %rdi, %rdi
je 0x48a0
movl $0x1001, %eax           # imm = 0x1001
cmpl $0x1f, %esi
ja 0x489f
xorl %eax, %eax
testl %esi, %esi
je 0x489f
movl %esi, %ecx
movl %edx, 0x10(%rdi,%rcx,4)
retq
movl $0x1002, %eax           # imm = 0x1002
retq