LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: menhits[P]phplus/src/utils/stringArray.cpp
// Function: str::join(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)
string join(vector<string>& in, string joiner, bool addAtEnd)
{
	string out;
	
	for (int i=0; i<(int)in.size(); i++)
	{
		out+=in[i];
		
		if (addAtEnd || i!=(int)in.size()-1)
			out+=joiner;
	}
	
	return out;
}

// Assembly:
subq $0x58, %rsp
movq %rdx, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
movb %cl, %al
movq %rdi, %rcx
movq %rcx, 0x20(%rsp)
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
andb $0x1, %al
movb %al, 0x3f(%rsp)
movb $0x0, 0x3e(%rsp)
callq 0xb4e0
movl $0x0, 0x38(%rsp)
movl 0x38(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x48(%rsp), %rdi
callq 0x1bbb0
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0xc7fc4
movq 0x48(%rsp), %rdi
movslq 0x38(%rsp), %rsi
callq 0x1bbd0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0xb470
jmp 0xc7f5e
testb $0x1, 0x3f(%rsp)
jne 0xc7f85
movl 0x38(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x48(%rsp), %rdi
callq 0x1bbb0
movq %rax, %rcx
movl 0x8(%rsp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
je 0xc7fb2
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0xb470
jmp 0xc7f96
jmp 0xc7fb2
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
callq 0xb6e8
jmp 0xc7fe4
jmp 0xc7fb4
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0xc7f1f
movb $0x1, 0x3e(%rsp)
testb $0x1, 0x3e(%rsp)
jne 0xc7fda
movq 0x18(%rsp), %rdi
callq 0xb6e8
movq 0x20(%rsp), %rax
addq $0x58, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0xb680
nop
// File: menhits[P]phplus/src/utils/../../h/utils/stringUtils.h
// Function: str::getWidth(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
inline int getWidth(const string& in)
{
	int glyphPos=0;
	int bytePos=0;
	
	while (bytePos<(int)in.size())
	{
		nextGlyph(bytePos, in);
		glyphPos++;
	}
	
	return glyphPos;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rdi
callq 0xb2a0
movq %rax, %rcx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0xc8042
movq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0xc8050
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xc8009
movl 0xc(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: menhits[P]phplus/src/utils/stringDrawing.cpp
// Function: str::putStringInTreeNodeBox(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string putStringInTreeNodeBox(const string& in)
{
	vector<string> ary;
	splitByLine(ary, in);
	putArrayInTreeNodeBox(ary);
	return join(ary);
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x10(%rsp)
movq %rdi, %rax
movq %rax, 0x18(%rsp)
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
leaq 0x60(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x1a570
movq 0x20(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0xcf090
jmp 0xca141
leaq 0x60(%rsp), %rdi
callq 0xc98f0
jmp 0xca14d
leaq 0x2f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xb690
movq 0x8(%rsp), %rdx
leaq 0x7d90(%rip), %rsi      # 0xd1ef8
leaq 0x30(%rsp), %rdi
callq 0xb4c0
jmp 0xca174
movq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movl $0x1, %ecx
callq 0xc7ee0
jmp 0xca18f
leaq 0x30(%rsp), %rdi
callq 0xb6e8
leaq 0x2f(%rsp), %rdi
callq 0xb3f0
leaq 0x60(%rsp), %rdi
callq 0x1a600
movq 0x18(%rsp), %rax
addq $0x88, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
jmp 0xca1fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
jmp 0xca1f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x30(%rsp), %rdi
callq 0xb6e8
leaq 0x2f(%rsp), %rdi
callq 0xb3f0
leaq 0x60(%rsp), %rdi
callq 0x1a600
movq 0x58(%rsp), %rdi
callq 0xb680
// File: menhits[P]phplus/src/utils/../../h/utils/stringUtils.h
// Function: str::seek(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int)
inline int seek(const string& in, int distGlyph, int startPosByte)
{
	int i=startPosByte;
	
	while (distGlyph>0)
	{
		nextGlyph(i, in);
		
		distGlyph--;
	}
	
	return i;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl %edx, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0xc(%rsp)
jle 0xcf31c
movq 0x10(%rsp), %rsi
leaq 0x4(%rsp), %rdi
callq 0xc8050
movl 0xc(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xcf2f9
movl 0x4(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: menhits[P]phplus/src/utils/stringNumConversion.cpp
// Function: str::charToCppStringLiteralEscaped[abi:cxx11](unsigned char)
string charToCppStringLiteralEscaped(unsigned char c)
{
	string out="\\";
	
	for (int i=0; i<3; i++)
	{
		out+=c%8+'0';
		c/=8;
	}
	
	return out;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x8(%rsp)
movb %sil, %al
movq %rdi, %rcx
movq %rcx, (%rsp)
movq %rdi, 0x30(%rsp)
movb %al, 0x2f(%rsp)
movb $0x0, 0x2e(%rsp)
leaq 0x2d(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xb690
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x26e9(%rip), %rsi      # 0xd21ea
callq 0xb4c0
jmp 0xcfb08
leaq 0x2d(%rsp), %rdi
callq 0xb3f0
movl $0x0, 0x18(%rsp)
cmpl $0x3, 0x18(%rsp)
jge 0xcfb8a
movq 0x8(%rsp), %rdi
movzbl 0x2f(%rsp), %esi
andl $0x7, %esi
orl $0x30, %esi
callq 0xb260
jmp 0xcfb38
movzbl 0x2f(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movb %al, 0x2f(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xcfb1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x2d(%rsp), %rdi
callq 0xb3f0
jmp 0xcfba9
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0xb6e8
jmp 0xcfba9
movb $0x1, 0x2e(%rsp)
testb $0x1, 0x2e(%rsp)
jne 0xcfba0
movq 0x8(%rsp), %rdi
callq 0xb6e8
movq (%rsp), %rax
addq $0x38, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0xb680
nopw %cs:(%rax,%rax)
// File: menhits[P]phplus/src/utils/stringNumConversion.cpp
// Function: str::intToBase62[abi:cxx11](unsigned int, int)
string intToBase62(unsigned int num, int maxDigits)
{
	int i=0;
	string out;
	
	while (num!=0 && (maxDigits<0 || i<maxDigits))
	{
		unsigned int digit=num%62;
		
		if (digit<10)
		{
			out+=(char)(digit+'0');
		}
		else if (digit<10+26)
		{
			out+=(char)(digit-10+'a');
		}
		else if (digit<10+26+26)
		{
			out+=(char)(digit-10-26+'A');
		}
		else
		{
			out+="_"; // this shouldn't happen
		}
		
		num/=62;
		i++;
	}
	
	return out;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
movb $0x0, 0x33(%rsp)
callq 0xb4e0
xorl %eax, %eax
cmpl $0x0, 0x3c(%rsp)
movb %al, 0x7(%rsp)
je 0xcfc21
movb $0x1, %al
cmpl $0x0, 0x38(%rsp)
movb %al, 0x6(%rsp)
jl 0xcfc19
movl 0x34(%rsp), %eax
cmpl 0x38(%rsp), %eax
setl %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0xcfc2e
jmp 0xcfcf3
movl 0x3c(%rsp), %eax
movl $0x3e, %ecx
xorl %edx, %edx
divl %ecx
movl %edx, 0x2c(%rsp)
cmpl $0xa, 0x2c(%rsp)
jae 0xcfc7b
movq 0x8(%rsp), %rdi
movl 0x2c(%rsp), %eax
addl $0x30, %eax
movsbl %al, %esi
callq 0xb260
jmp 0xcfc5c
jmp 0xcfcd2
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0xb6e8
jmp 0xcfd13
cmpl $0x24, 0x2c(%rsp)
jae 0xcfc9a
movq 0x8(%rsp), %rdi
movl 0x2c(%rsp), %eax
addl $0x57, %eax
movsbl %al, %esi
callq 0xb260
jmp 0xcfc98
jmp 0xcfcd0
cmpl $0x3e, 0x2c(%rsp)
jae 0xcfcb9
movq 0x8(%rsp), %rdi
movl 0x2c(%rsp), %eax
addl $0x1d, %eax
movsbl %al, %esi
callq 0xb260
jmp 0xcfcb7
jmp 0xcfcce
movq 0x8(%rsp), %rdi
leaq 0x6d51(%rip), %rsi      # 0xd6a16
callq 0xb360
jmp 0xcfccc
jmp 0xcfcce
jmp 0xcfcd0
jmp 0xcfcd2
movl 0x3c(%rsp), %eax
movl $0x3e, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, 0x3c(%rsp)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xcfbf0
movb $0x1, 0x33(%rsp)
testb $0x1, 0x33(%rsp)
jne 0xcfd09
movq 0x8(%rsp), %rdi
callq 0xb6e8
movq 0x10(%rsp), %rax
addq $0x48, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0xb680
nopl (%rax)
// File: menhits[P]phplus/src/utils/stringUtils.cpp
// Function: str::splitBy(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>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
void splitBy(vector<string>& out, const string& in, const string& splitter, bool keepSplitter)
{
	int i=0;
	int start=0;
	
	while (i<=(int)in.size()-(int)splitter.size())
	{
		if (subMatches(in, i, splitter))
		{
			if (keepSplitter)
				nextGlyph(i, in);
			
			out.push_back(in.substr(start, i-start));
			
			if (!keepSplitter)
				nextGlyph(i, in);
			
			start=i;
		}
		else
		{
			nextGlyph(i, in);
		}
	}
	
	if ((int)in.size()!=start)
		out.push_back(in.substr(start, in.size()-start));
}

// Assembly:
subq $0xb8, %rsp
movb %cl, %al
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xa0(%rsp)
andb $0x1, %al
movb %al, 0x9f(%rsp)
movl $0x0, 0x98(%rsp)
movl $0x0, 0x94(%rsp)
movl 0x98(%rsp), %eax
movl %eax, 0x3c(%rsp)
movq 0xa8(%rsp), %rdi
callq 0xb2a0
movl %eax, 0x38(%rsp)
movq 0xa0(%rsp), %rdi
callq 0xb2a0
movl 0x38(%rsp), %ecx
movq %rax, %rdx
movl 0x3c(%rsp), %eax
subl %edx, %ecx
cmpl %ecx, %eax
jg 0xcfeef
movq 0xa8(%rsp), %rdi
movl 0x98(%rsp), %esi
movq 0xa0(%rsp), %rdx
callq 0x9e650
testb $0x1, %al
jne 0xcfe13
jmp 0xcfed5
testb $0x1, 0x9f(%rsp)
je 0xcfe32
movq 0xa8(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0xc8050
movq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xa8(%rsp), %rsi
movslq 0x94(%rsp), %rdx
movl %edx, %ecx
movl 0x98(%rsp), %eax
subl %ecx, %eax
movslq %eax, %rcx
leaq 0x70(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xb3a0
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1a5a0
jmp 0xcfe7d
leaq 0x70(%rsp), %rdi
callq 0xb6e8
testb $0x1, 0x9f(%rsp)
jne 0xcfec5
movq 0xa8(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0xc8050
jmp 0xcfec5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x70(%rsp), %rdi
callq 0xb6e8
jmp 0xcff9b
movl 0x98(%rsp), %eax
movl %eax, 0x94(%rsp)
jmp 0xcfeea
movq 0xa8(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0xc8050
jmp 0xcfdb0
movq 0xa8(%rsp), %rdi
callq 0xb2a0
cmpl 0x94(%rsp), %eax
je 0xcff93
movq 0xb0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa8(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movslq 0x94(%rsp), %rax
movq %rax, 0x10(%rsp)
callq 0xb2a0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rcx
movslq 0x94(%rsp), %rax
subq %rax, %rcx
leaq 0x40(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xb3a0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1a5a0
jmp 0xcff6d
leaq 0x40(%rsp), %rdi
callq 0xb6e8
jmp 0xcff93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xb6e8
jmp 0xcff9b
addq $0xb8, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0xb680
nopw %cs:(%rax,%rax)
// File: menhits[P]phplus/src/utils/stringUtils.cpp
// Function: str::getGlyphPosOf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int getGlyphPosOf(const string& in, string pattern)
{
	int glyph=0;
	int byte=0;
	
	while (byte<(int)in.size())
	{
		if (subMatches(in, byte, pattern))
			return glyph;
		
		nextGlyph(byte, in);
		glyph++;
	}
	
	return -1;
}

// Assembly:
subq $0x38, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rdi
callq 0xb2a0
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0xd0d3f
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x9e650
testb $0x1, %al
jne 0xd0d19
jmp 0xd0d23
movl 0x1c(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0xd0d47
movq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0xc8050
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xd0ce3
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
// File: iZhangHui[P]CppPrimer/CH08_TheIOLibrary/examples/sstream.cc
// Function: getData(std::istream&)
vector<PersonInfo>
getData(istream &is)
{
	// will hold a line and word from input, respectively
	string line, word;

	// will hold all the records from the input
	vector<PersonInfo> people;

	// read the input a line at a time until end-of-file (or other error)
	while (getline(is, line)) {       
		PersonInfo info;            // object to hold this record's data
	    istringstream record(line); // bind record to the line we just read
		record >> info.name;        // read the name
	    while (record >> word)      // read the phone numbers 
			info.phones.push_back(word);  // and store them
		people.push_back(info); // append this record to people
	}
	
	return people;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x228(%rbp)
movq %rdi, %rax
movq %rax, -0x230(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2180
leaq -0x50(%rbp), %rdi
callq 0x2180
movq -0x228(%rbp), %rdi
movb $0x0, -0x51(%rbp)
callq 0x29b0
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2030
movq %rax, -0x238(%rbp)
jmp 0x23cc
movq -0x238(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2150
movb %al, -0x239(%rbp)
jmp 0x23ea
movb -0x239(%rbp), %al
testb $0x1, %al
jne 0x23f9
jmp 0x2500
leaq -0xa0(%rbp), %rdi
callq 0x29d0
leaq -0x220(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x21d0
jmp 0x241c
leaq -0x220(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x2160
jmp 0x2431
jmp 0x2433
leaq -0x220(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2160
movq %rax, -0x248(%rbp)
jmp 0x244c
movq -0x248(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2150
movb %al, -0x249(%rbp)
jmp 0x246a
movb -0x249(%rbp), %al
testb $0x1, %al
jne 0x2476
jmp 0x24c0
leaq -0x80(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2a00
jmp 0x2485
jmp 0x2433
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2538
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x24f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x2090
jmp 0x24f2
movq -0x228(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x2a70
jmp 0x24d5
leaq -0x220(%rbp), %rdi
callq 0x2090
leaq -0xa0(%rbp), %rdi
callq 0x2ae0
jmp 0x23b6
leaq -0xa0(%rbp), %rdi
callq 0x2ae0
jmp 0x2538
movb $0x1, -0x51(%rbp)
testb $0x1, -0x51(%rbp)
jne 0x2516
movq -0x228(%rbp), %rdi
callq 0x2b10
leaq -0x50(%rbp), %rdi
callq 0x20c0
leaq -0x30(%rbp), %rdi
callq 0x20c0
movq -0x230(%rbp), %rax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq -0x228(%rbp), %rdi
callq 0x2b10
leaq -0x50(%rbp), %rdi
callq 0x20c0
leaq -0x30(%rbp), %rdi
callq 0x20c0
movq -0x60(%rbp), %rdi
callq 0x21e0
nop
// File: aronszanto[P]strassen/main.cpp
// Function: initMatrix(Matrix*, int)
void initMatrix(Matrix* M, int dimension){
    M->dimension = dimension;
    M->matrix.resize(dimension);
    for (int i = 0; i < dimension; i++){
        M->matrix[i].resize(dimension);
    }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
movslq 0xc(%rsp), %rsi
callq 0xd7b0
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0x24aa
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
movslq 0x8(%rsp), %rsi
callq 0xd850
movq %rax, %rdi
movslq 0xc(%rsp), %rsi
callq 0xd870
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x2473
addq $0x18, %rsp
retq
nop
// File: aronszanto[P]strassen/main.cpp
// Function: printMatrix(Matrix&)
void printMatrix(Matrix& A){
    for (int i = 0; i < A.dimension; i ++){
        for (int j = 0; j < A.dimension; j++){
            cout << A.matrix[i][j] << " ";
        }
        cout << endl;
    }
    cout << endl;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x2554
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x2531
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
movslq 0xc(%rsp), %rsi
callq 0xd850
movq %rax, %rdi
movslq 0x8(%rsp), %rsi
callq 0xd910
movl (%rax), %esi
movq 0x1cac0(%rip), %rdi     # 0x1efd0
callq 0x2280
movq %rax, %rdi
leaq 0x168b9(%rip), %rsi     # 0x18dd8
callq 0x2180
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x24da
movq 0x1ca98(%rip), %rdi     # 0x1efd0
movq 0x1ca79(%rip), %rsi     # 0x1efb8
callq 0x21a0
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x24c1
movq 0x1ca75(%rip), %rdi     # 0x1efd0
movq 0x1ca56(%rip), %rsi     # 0x1efb8
callq 0x21a0
addq $0x18, %rsp
retq
nopl (%rax)
// File: aronszanto[P]strassen/main.cpp
// Function: isEqual(Matrix*, Matrix*)
bool isEqual(Matrix* A, Matrix* B){
    if (A->dimension != B->dimension) {
        return false;
    }
    else
    {
        for (int i = 0; i < A->dimension; ++i) {
            for (int j = 0; j < A->dimension; ++j) {
                if (A->matrix[i][j] != B->matrix[i][j]){
                    return false;
                }
            }
        }
        return true;
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl (%rax), %eax
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
je 0x2598
movb $0x0, 0x27(%rsp)
jmp 0x2644
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x263f
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x262d
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
movslq 0xc(%rsp), %rsi
callq 0xd850
movq %rax, %rdi
movslq 0x8(%rsp), %rsi
callq 0xd910
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
movslq 0xc(%rsp), %rsi
callq 0xd850
movq %rax, %rdi
movslq 0x8(%rsp), %rsi
callq 0xd910
movq %rax, %rcx
movl 0x4(%rsp), %eax
cmpl (%rcx), %eax
je 0x261e
movb $0x0, 0x27(%rsp)
jmp 0x2644
jmp 0x2620
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x25b9
jmp 0x262f
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x25a0
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nop
// File: aronszanto[P]strassen/main.cpp
// Function: findOptDim(int, int)
int findOptDim(int n, int convThreshold){
    int counter = 0;
    while (n > convThreshold){
        if (n%2 == 0)
            n /= 2;
        else
            n = (n+1)/2;
        counter ++;
    }
    return n*pow(2,counter);
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl %esi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x10(%rsp), %eax
jle 0x26b1
movl 0x14(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x2691
movl 0x14(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x14(%rsp)
jmp 0x26a4
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x14(%rsp)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x2664
cvtsi2sdl 0x14(%rsp), %xmm0
movsd %xmm0, (%rsp)
movl 0xc(%rsp), %esi
movl $0x2, %edi
callq 0xd930
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
addq $0x18, %rsp
retq
nop
// File: aronszanto[P]strassen/main.cpp
// Function: initPadding(Matrix*, int)
void initPadding(Matrix* M, int newdim){
    M->dimension = newdim;

    M->matrix.resize(newdim);
    for (int i = 0; i < newdim; i++){
        M->matrix[i].resize(newdim);
    }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
movslq 0xc(%rsp), %rsi
callq 0xd7b0
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0x274a
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
movslq 0x8(%rsp), %rsi
callq 0xd850
movq %rax, %rdi
movslq 0xc(%rsp), %rsi
callq 0xd870
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x2713
addq $0x18, %rsp
retq
nop
// File: aronszanto[P]strassen/main.cpp
// Function: removePadding(Matrix*, int)
void removePadding(Matrix* M, int newdim){
    M->dimension = newdim;

    M->matrix.resize(newdim);
    for (int i = 0; i < newdim; i++){
        M->matrix[i].resize(newdim);
    }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
movslq 0xc(%rsp), %rsi
callq 0xd7b0
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0x27ba
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
movslq 0x8(%rsp), %rsi
callq 0xd850
movq %rax, %rdi
movslq 0xc(%rsp), %rsi
callq 0xd870
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x2783
addq $0x18, %rsp
retq
nop
// File: aronszanto[P]strassen/main.cpp
// Function: convMult(Matrix*, Matrix*, Matrix*, int, int, int, int, int, int, int)
void convMult(Matrix* A, Matrix* B, Matrix* C, int topA, int leftA, int topB, int leftB, int topC, int leftC, int dimension) {
    for (int i = 0; i < dimension; ++i)
		for (int k = 0; k < dimension; ++k)
			for (int j = 0; j < dimension; ++j)
                if (k == 0) 
                    C->matrix[topC + i][leftC + j] = A->matrix[topA + i][leftA + k] * B->matrix[topB + k][leftB + j]; 
				else
                    C->matrix[topC + i][leftC + j] += A->matrix[topA + i][leftA + k] * B->matrix[topB + k][leftB + j];
}

// Assembly:
subq $0x48, %rsp
movl 0x68(%rsp), %eax
movl 0x60(%rsp), %eax
movl 0x58(%rsp), %eax
movl 0x50(%rsp), %eax
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movl %ecx, 0x2c(%rsp)
movl %r8d, 0x28(%rsp)
movl %r9d, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x68(%rsp), %eax
jge 0x2c17
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x68(%rsp), %eax
jge 0x2c05
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x68(%rsp), %eax
jge 0x2bf3
cmpl $0x0, 0x1c(%rsp)
jne 0x2b41
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
movl 0x2c(%rsp), %eax
addl 0x20(%rsp), %eax
movslq %eax, %rsi
callq 0xd850
movq %rax, %rdi
movl 0x28(%rsp), %eax
addl 0x1c(%rsp), %eax
movslq %eax, %rsi
callq 0xd910
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movq 0x38(%rsp), %rdi
addq $0x8, %rdi
movl 0x24(%rsp), %eax
addl 0x1c(%rsp), %eax
movslq %eax, %rsi
callq 0xd850
movq %rax, %rdi
movl 0x50(%rsp), %eax
addl 0x18(%rsp), %eax
movslq %eax, %rsi
callq 0xd910
movq %rax, %rcx
movl 0x10(%rsp), %eax
imull (%rcx), %eax
movl %eax, 0x14(%rsp)
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
movl 0x58(%rsp), %eax
addl 0x20(%rsp), %eax
movslq %eax, %rsi
callq 0xd850
movq %rax, %rdi
movl 0x60(%rsp), %eax
addl 0x18(%rsp), %eax
movslq %eax, %rsi
callq 0xd910
movl 0x14(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x2be1
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
movl 0x2c(%rsp), %eax
addl 0x20(%rsp), %eax
movslq %eax, %rsi
callq 0xd850
movq %rax, %rdi
movl 0x28(%rsp), %eax
addl 0x1c(%rsp), %eax
movslq %eax, %rsi
callq 0xd910
movl (%rax), %eax
movl %eax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
addq $0x8, %rdi
movl 0x24(%rsp), %eax
addl 0x1c(%rsp), %eax
movslq %eax, %rsi
callq 0xd850
movq %rax, %rdi
movl 0x50(%rsp), %eax
addl 0x18(%rsp), %eax
movslq %eax, %rsi
callq 0xd910
movq %rax, %rcx
movl 0x8(%rsp), %eax
imull (%rcx), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
movl 0x58(%rsp), %eax
addl 0x20(%rsp), %eax
movslq %eax, %rsi
callq 0xd850
movq %rax, %rdi
movl 0x60(%rsp), %eax
addl 0x18(%rsp), %eax
movslq %eax, %rsi
callq 0xd910
movl 0xc(%rsp), %ecx
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x2be3
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x2a85
jmp 0x2bf5
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2a6f
jmp 0x2c07
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x2a59
addq $0x48, %rsp
retq
nopl (%rax)
// File: aronszanto[P]strassen/main.cpp
// Function: multiply(Matrix*, Matrix*, Matrix*, int, int, int, int, int, int, int)
void multiply(Matrix* A, Matrix* B, Matrix* C, int topA, int leftA, int topB, int leftB, int topC, int leftC, int dimension){
    if (dimension > convThreshold) {
        if (dimension > threadThresh)
            strassenMultThread(A, B, C, topA, leftA, topB, leftB, topC, leftC, dimension);
        else
            strassenMult(A, B, C, topA, leftA, topB, leftB, topC, leftC, dimension);
        
    }
    else
        convMult(A, B, C, topA, leftA, topB, leftB, topC, leftC, dimension);
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movl 0x78(%rsp), %eax
movl 0x70(%rsp), %eax
movl 0x68(%rsp), %eax
movl 0x60(%rsp), %eax
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movl %ecx, 0x34(%rsp)
movl %r8d, 0x30(%rsp)
movl %r9d, 0x2c(%rsp)
movl 0x78(%rsp), %eax
cmpl 0x1b40c(%rip), %eax     # 0x1f198
jle 0x3e2c
movl 0x78(%rsp), %eax
cmpl 0x1b3f8(%rip), %eax     # 0x1f194
jle 0x3de5
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
movl 0x34(%rsp), %ecx
movl 0x30(%rsp), %r8d
movl 0x2c(%rsp), %r9d
movl 0x60(%rsp), %ebx
movl 0x68(%rsp), %r11d
movl 0x70(%rsp), %r10d
movl 0x78(%rsp), %eax
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x3e80
jmp 0x3e2a
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
movl 0x34(%rsp), %ecx
movl 0x30(%rsp), %r8d
movl 0x2c(%rsp), %r9d
movl 0x60(%rsp), %ebx
movl 0x68(%rsp), %r11d
movl 0x70(%rsp), %r10d
movl 0x78(%rsp), %eax
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x2c20
jmp 0x3e71
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
movl 0x34(%rsp), %ecx
movl 0x30(%rsp), %r8d
movl 0x2c(%rsp), %r9d
movl 0x60(%rsp), %ebx
movl 0x68(%rsp), %r11d
movl 0x70(%rsp), %r10d
movl 0x78(%rsp), %eax
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x2a20
addq $0x50, %rsp
popq %rbx
retq
nopw (%rax,%rax)
// File: aronszanto[P]strassen/main.cpp
// Function: multiply(Matrix*, Matrix*)
Matrix* multiply(Matrix* A, Matrix* B){
    if (A->dimension != B->dimension)
        return NULL;
    int dimension = A->dimension;
    Matrix* C = new Matrix();
    initMatrix(C, A->dimension);
    
    int padding = findOptDim(dimension, convThreshold);
    initPadding(A, padding);
    initPadding(B, padding);
    initPadding(C, padding);
    multiply(A,B,C,0,0,0,0,0,0,padding);
    
    removePadding(A, dimension);
    removePadding(B, dimension);
    removePadding(C, dimension);
    return C;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x48(%rsp), %rax
movl (%rax), %eax
movq 0x40(%rsp), %rcx
cmpl (%rcx), %eax
je 0x524c
movq $0x0, 0x50(%rsp)
jmp 0x5347
movq 0x48(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x3c(%rsp)
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, 0x20(%rsp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x20e0
movq 0x20(%rsp), %rdi
callq 0xd950
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq 0x48(%rsp), %rax
movl (%rax), %esi
callq 0x2440
movl 0x3c(%rsp), %edi
movl 0x19ef4(%rip), %esi     # 0x1f198
callq 0x2650
movl %eax, 0x2c(%rsp)
movq 0x48(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x26e0
movq 0x40(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x26e0
movq 0x30(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x26e0
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl 0x2c(%rsp), %eax
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x3d50
movq 0x48(%rsp), %rdi
movl 0x3c(%rsp), %esi
callq 0x2750
movq 0x40(%rsp), %rdi
movl 0x3c(%rsp), %esi
callq 0x2750
movq 0x30(%rsp), %rdi
movl 0x3c(%rsp), %esi
callq 0x2750
movq 0x30(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: aronszanto[P]strassen/main.cpp
// Function: populateRandomMatrix(Matrix*, int, int)
void populateRandomMatrix(Matrix* M, int low, int high){
    random_device r;
    mt19937 mtgen(r());
    uniform_int_distribution<> dist(low,high);
    for (int i = 0; i < M->dimension; i++)
        for (int j = 0; j < M->dimension; j++)
            M->matrix[i][j] = dist(mtgen);
}

// Assembly:
subq $0x2758, %rsp           # imm = 0x2758
movq %rdi, 0x2750(%rsp)
movl %esi, 0x274c(%rsp)
movl %edx, 0x2748(%rsp)
leaq 0x13c0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xe950
movq 0x10(%rsp), %rdi
callq 0xe9f0
movl %eax, 0x18(%rsp)
jmp 0x539f
movl 0x18(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x38(%rsp), %rdi
callq 0xea00
jmp 0x53b3
movl 0x274c(%rsp), %esi
movl 0x2748(%rsp), %edx
leaq 0x24(%rsp), %rdi
callq 0xea30
jmp 0x53cd
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
movq 0x2750(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x547b
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x2750(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x5469
leaq 0x24(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0xea60
movl %eax, 0xc(%rsp)
jmp 0x5416
movq 0x2750(%rsp), %rdi
addq $0x8, %rdi
movslq 0x20(%rsp), %rsi
callq 0xd850
movq %rax, %rdi
movslq 0x1c(%rsp), %rsi
callq 0xd910
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x53f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x13c0(%rsp), %rdi
callq 0xea90
jmp 0x5490
jmp 0x546b
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x53d5
leaq 0x13c0(%rsp), %rdi
callq 0xea90
addq $0x2758, %rsp           # imm = 0x2758
retq
movq 0x30(%rsp), %rdi
callq 0x22a0
nopw (%rax,%rax)
// File: aronszanto[P]strassen/main.cpp
// Function: timeRandMult(int)
double timeRandMult(int dimension){
            Matrix* m1 = new Matrix();
            Matrix* m2 = new Matrix();
            initMatrix(m1, dimension);
            initMatrix(m2, dimension);
            populateRandomMatrix(m1, 0, 1);
            populateRandomMatrix(m2, 0, 1);
            clock_t start;
            start = clock();
            Matrix* m3 = multiply(m1, m2);
            delete(m1);
            delete(m2);
            delete(m3);
            return (std::clock() - start) / (double)(CLOCKS_PER_SEC);
    
}

// Assembly:
subq $0x58, %rsp
movl %edi, 0x54(%rsp)
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, 0x18(%rsp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x20e0
movq 0x18(%rsp), %rdi
callq 0xd950
movq 0x18(%rsp), %rax
movq %rax, 0x48(%rsp)
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, 0x20(%rsp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x20e0
movq 0x20(%rsp), %rdi
callq 0xd950
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x2440
movq 0x40(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x2440
movq 0x48(%rsp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x5360
movq 0x40(%rsp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x5360
callq 0x2120
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x5220
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x578c
movq 0x28(%rsp), %rdi
callq 0xd970
movq 0x28(%rsp), %rdi
callq 0x2170
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x57b0
movq 0x10(%rsp), %rdi
callq 0xd970
movq 0x10(%rsp), %rdi
callq 0x2170
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x57d4
movq 0x8(%rsp), %rdi
callq 0xd970
movq 0x8(%rsp), %rdi
callq 0x2170
callq 0x2120
subq 0x38(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x12825(%rip), %xmm1    # 0x18010
divsd %xmm1, %xmm0
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: aronszanto[P]strassen/main.cpp
// Function: findOptimalThreadThresh()
void findOptimalThreadThresh() {
    convThreshold = 32;
    threadThresh = 64;
    while (threadThresh != 4096){
        //cout << threadThresh << endl;;
        
        
        double total = 0;
        //cout << "multiplying matrices, n = " << i << endl;
        for (int j = 0; j < 1; j ++){
            total += timeRandMult(2048);
        }
        cout << threadThresh << "\t" << total / 1 << endl;
        //cout << "finished multiplying.\n" << endl;
        threadThresh *= 2;
    }
}

// Assembly:
subq $0x18, %rsp
movl $0x20, 0x1998a(%rip)    # 0x1f198
movl $0x40, 0x1997c(%rip)    # 0x1f194
cmpl $0x1000, 0x19972(%rip)  # imm = 0x1000
je 0x58c0
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x1, 0xc(%rsp)
jge 0x5863
movl $0x800, %edi            # imm = 0x800
callq 0x56a0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x5839
movl 0x1992b(%rip), %esi     # 0x1f194
movq 0x19760(%rip), %rdi     # 0x1efd0
callq 0x2280
movq %rax, %rdi
leaq 0x133f1(%rip), %rsi     # 0x18c70
callq 0x2180
movq %rax, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x12783(%rip), %xmm1    # 0x18018
divsd %xmm1, %xmm0
callq 0x22d0
movq %rax, %rdi
movq 0x19710(%rip), %rsi     # 0x1efb8
callq 0x21a0
movl 0x198e1(%rip), %eax     # 0x1f194
shll %eax
movl %eax, 0x198d9(%rip)     # 0x1f194
jmp 0x5818
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: aronszanto[P]strassen/main.cpp
// Function: testRandMatrix()
void testRandMatrix(){
    Matrix* m = new Matrix();
    initMatrix(m,10);
    populateRandomMatrix(m, 0,1);
    printMatrix(*m);
    free(m);
}

// Assembly:
subq $0x18, %rsp
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, 0x8(%rsp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x20e0
movq 0x8(%rsp), %rdi
callq 0xd950
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0xa, %esi
callq 0x2440
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x5360
movq 0x10(%rsp), %rdi
callq 0x24b0
movq 0x10(%rsp), %rdi
callq 0x21c0
addq $0x18, %rsp
retq
nop
// File: aronszanto[P]strassen/main.cpp
// Function: testInitMatrix()
void testInitMatrix(){
    Matrix* m = new Matrix();
    initMatrix(m,3);
    printMatrix(*m);
    free(m);
}

// Assembly:
subq $0x18, %rsp
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, 0x8(%rsp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x20e0
movq 0x8(%rsp), %rdi
callq 0xd950
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0x3, %esi
callq 0x2440
movq 0x10(%rsp), %rdi
callq 0x24b0
movq 0x10(%rsp), %rdi
callq 0x21c0
addq $0x18, %rsp
retq
nop
// File: aronszanto[P]strassen/main.cpp
// Function: testfindOptDim()
void testfindOptDim(){
    assert(findOptDim(258,17) == 272);
    assert(findOptDim(513,15) == 576);
    assert(findOptDim(1025,15) == 1152);

           cout << "all findOptDim tests pass" << endl;
}

// Assembly:
pushq %rax
movl $0x102, %edi            # imm = 0x102
movl $0x11, %esi
callq 0x2650
cmpl $0x110, %eax            # imm = 0x110
jne 0xc499
jmp 0xc4b8
leaq 0xc86f(%rip), %rdi      # 0x18d0f
leaq 0xc7d9(%rip), %rsi      # 0x18c80
movl $0x278, %edx            # imm = 0x278
leaq 0xc876(%rip), %rcx      # 0x18d29
callq 0x2110
movl $0x201, %edi            # imm = 0x201
movl $0xf, %esi
callq 0x2650
cmpl $0x240, %eax            # imm = 0x240
jne 0xc4d0
jmp 0xc4ef
leaq 0xc868(%rip), %rdi      # 0x18d3f
leaq 0xc7a2(%rip), %rsi      # 0x18c80
movl $0x279, %edx            # imm = 0x279
leaq 0xc83f(%rip), %rcx      # 0x18d29
callq 0x2110
movl $0x401, %edi            # imm = 0x401
movl $0xf, %esi
callq 0x2650
cmpl $0x480, %eax            # imm = 0x480
jne 0xc507
jmp 0xc526
leaq 0xc84b(%rip), %rdi      # 0x18d59
leaq 0xc76b(%rip), %rsi      # 0x18c80
movl $0x27a, %edx            # imm = 0x27A
leaq 0xc808(%rip), %rcx      # 0x18d29
callq 0x2110
movq 0x12aa3(%rip), %rdi     # 0x1efd0
leaq 0xc841(%rip), %rsi      # 0x18d75
callq 0x2180
movq %rax, %rdi
movq 0x12a75(%rip), %rsi     # 0x1efb8
callq 0x21a0
popq %rax
retq
nopw (%rax,%rax)
// File: aronszanto[P]strassen/main.cpp
// Function: testPowers2()
void testPowers2(){
    for (int i = 2; i <= 4096; i *= 2){
        Matrix* m1 = new Matrix();
        initMatrix(m1, i);
        Matrix* m2 = new Matrix();
        initMatrix(m2, i);
        //cout << "populating m1" << endl;
        populateRandomMatrix(m1, -10, 10);
        //cout << "populating m2" << endl;
        populateRandomMatrix(m2, -10, 10);
        
        //cout << "multiplying matrices, n = " << i << endl;
        clock_t start;
        start = clock();
        Matrix* m3 = multiply(m1, m2);
        

        cout << "multiplied " << i << "x" << i << " in " << ((double) (clock() - start) / (double)(CLOCKS_PER_SEC)) << "s" << endl;
        delete(m1);
        delete(m2);
        delete(m3);

    }

}

// Assembly:
subq $0x58, %rsp
movl $0x2, 0x54(%rsp)
cmpl $0x1000, 0x54(%rsp)     # imm = 0x1000
jg 0xcf7b
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, 0x10(%rsp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x20e0
movq 0x10(%rsp), %rdi
callq 0xd950
movq 0x10(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x2440
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, 0x18(%rsp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x20e0
movq 0x18(%rsp), %rdi
callq 0xd950
movq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x2440
movq 0x48(%rsp), %rdi
movl $0xfffffff6, %esi       # imm = 0xFFFFFFF6
movl $0xa, %edx
callq 0x5360
movq 0x40(%rsp), %rdi
movl $0xfffffff6, %esi       # imm = 0xFFFFFFF6
movl $0xa, %edx
callq 0x5360
callq 0x2120
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x5220
movq %rax, 0x30(%rsp)
movq 0x12159(%rip), %rdi     # 0x1efd0
leaq 0xbf50(%rip), %rsi      # 0x18dce
callq 0x2180
movq %rax, %rdi
movl 0x54(%rsp), %esi
callq 0x2280
movq %rax, %rdi
leaq 0xbf41(%rip), %rsi      # 0x18dda
callq 0x2180
movq %rax, %rdi
movl 0x54(%rsp), %esi
callq 0x2280
movq %rax, %rdi
leaq 0xbf28(%rip), %rsi      # 0x18ddc
callq 0x2180
movq %rax, 0x20(%rsp)
callq 0x2120
movq 0x20(%rsp), %rdi
subq 0x38(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd 0xb136(%rip), %xmm1     # 0x18010
divsd %xmm1, %xmm0
callq 0x22d0
movq %rax, %rdi
leaq 0xbedf(%rip), %rsi      # 0x18dcc
callq 0x2180
movq %rax, %rdi
movq 0x120bc(%rip), %rsi     # 0x1efb8
callq 0x21a0
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0xcf25
movq 0x28(%rsp), %rdi
callq 0xd970
movq 0x28(%rsp), %rdi
callq 0x2170
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0xcf49
movq 0x8(%rsp), %rdi
callq 0xd970
movq 0x8(%rsp), %rdi
callq 0x2170
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0xcf6a
movq (%rsp), %rdi
callq 0xd970
movq (%rsp), %rdi
callq 0x2170
jmp 0xcf6c
movl 0x54(%rsp), %eax
shll %eax
movl %eax, 0x54(%rsp)
jmp 0xcd9c
addq $0x58, %rsp
retq
// File: aronszanto[P]strassen/main.cpp
// Function: FileToMatrix(char*, int, int)
Matrix* FileToMatrix(char* inputfile, int dimension, int order){
    Matrix* M = new Matrix();
    initMatrix(M, dimension);

    ifstream inFile(inputfile);
    string line;
    for (int i = 0; i < pow(dimension,2)*order; ++i)
    {
        getline(inFile, line);
    }

    for (int i = 0; i < dimension; ++i)
    {
        for (int j = 0; j < dimension; ++j)
        {
            getline(inFile, line);
            M->matrix[i][j] = stoi(line);
        }
    }
    inFile.close();
    return M;
}

// Assembly:
subq $0x288, %rsp            # imm = 0x288
movq %rdi, 0x280(%rsp)
movl %esi, 0x27c(%rsp)
movl %edx, 0x278(%rsp)
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, 0x20(%rsp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x20e0
movq 0x20(%rsp), %rdi
callq 0xd950
movq 0x20(%rsp), %rax
movq %rax, 0x270(%rsp)
movq 0x270(%rsp), %rdi
movl 0x27c(%rsp), %esi
callq 0x2440
movq 0x280(%rsp), %rsi
leaq 0x68(%rsp), %rdi
movl $0x8, %edx
callq 0x22c0
leaq 0x48(%rsp), %rdi
callq 0x21e0
movl $0x0, 0x44(%rsp)
cvtsi2sdl 0x44(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x27c(%rsp), %edi
movl $0x2, %esi
callq 0xd930
movsd %xmm0, 0x18(%rsp)
jmp 0xd034
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm0
cvtsi2sdl 0x278(%rsp), %xmm2
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xd09a
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x2050
jmp 0xd064
jmp 0xd066
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0xd00f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x2100
leaq 0x68(%rsp), %rdi
callq 0x2070
jmp 0xd172
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
cmpl 0x27c(%rsp), %eax
jge 0xd13a
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
cmpl 0x27c(%rsp), %eax
jge 0xd128
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x2050
jmp 0xd0d9
xorl %eax, %eax
movl %eax, %esi
leaq 0x48(%rsp), %rdi
movl $0xa, %edx
callq 0xec20
movl %eax, 0xc(%rsp)
jmp 0xd0f2
movq 0x270(%rsp), %rdi
addq $0x8, %rdi
movslq 0x30(%rsp), %rsi
callq 0xd850
movq %rax, %rdi
movslq 0x2c(%rsp), %rsi
callq 0xd910
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0xd0bb
jmp 0xd12a
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0xd0a2
leaq 0x68(%rsp), %rdi
callq 0x2060
jmp 0xd146
movq 0x270(%rsp), %rax
movq %rax, (%rsp)
leaq 0x48(%rsp), %rdi
callq 0x2100
leaq 0x68(%rsp), %rdi
callq 0x2070
movq (%rsp), %rax
addq $0x288, %rsp            # imm = 0x288
retq
movq 0x38(%rsp), %rdi
callq 0x22a0
nopl (%rax)
// File: justinpajak[P]Sum_SGX/aggsum.cpp
// Function: readAndDecrypt(std::vector<float, std::allocator<float>>&)
void readAndDecrypt(vector<float>& nums) {
	int enc_data = open("enc.txt", O_RDONLY);
	if (!enc_data) {
		fprintf(stderr, "Unable to open file: %s\n", strerror(errno));
		return;
	}
	unsigned char ciphertext[128];
	unsigned char *key = (unsigned char *)"01234567890123456789012345678901";
    unsigned char *iv = (unsigned char *)"0123456789012345";
	while(read(enc_data, (char*)ciphertext, 128)) {
		unsigned char plaintext[128];
		int plaintext_len = decrypt(ciphertext, 32, key, iv, plaintext);
		plaintext[plaintext_len] = '\0';
		nums.push_back(atof((const char*)plaintext));
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
leaq 0x1a3d(%rip), %rdi      # 0x4023
xorl %esi, %esi
movb $0x0, %al
callq 0x2100
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x2632
movq 0x49d9(%rip), %rax      # 0x6fd8
movq (%rax), %rax
movq %rax, -0x130(%rbp)
callq 0x2030
movl (%rax), %edi
callq 0x2070
movq -0x130(%rbp), %rdi
movq %rax, %rdx
leaq 0x1a05(%rip), %rsi      # 0x402b
movb $0x0, %al
callq 0x21a0
jmp 0x26de
leaq 0x1a0b(%rip), %rax      # 0x4044
movq %rax, -0x98(%rbp)
leaq 0x1a1e(%rip), %rax      # 0x4065
movq %rax, -0xa0(%rbp)
movl -0xc(%rbp), %edi
leaq -0x90(%rbp), %rsi
movl $0x80, %edx
callq 0x21b0
cmpq $0x0, %rax
je 0x26de
leaq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rdx
movq -0xa0(%rbp), %rcx
leaq -0x120(%rbp), %r8
movl $0x20, %esi
callq 0x2760
movl %eax, -0x124(%rbp)
movslq -0x124(%rbp), %rax
movb $0x0, -0x120(%rbp,%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x2190
movq -0x138(%rbp), %rdi
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x128(%rbp)
leaq -0x128(%rbp), %rsi
callq 0x2ad0
jmp 0x264e
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopw (%rax,%rax)
// File: justinpajak[P]Sum_SGX/aggsum.cpp
// Function: agg_sum(std::vector<float, std::allocator<float>>)
double agg_sum(vector<float> nums) {
	double sum;
	for (int i = 0; i < nums.size(); i++) {
		sum += nums[i];
	}
	return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x20(%rbp)
movq %rdi, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x14(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x2b00
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x274e
movq -0x20(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x2b20
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
addsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2707
movsd -0x10(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: ivan-tkatchev[P]yalz77/./lz77.h
// Function: lz77::push_vlq_uint(unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
inline void push_vlq_uint(size_t n, std::string& out) {

    while (1) {
        unsigned char c = n & 0x7F;
        size_t q = n >> 7;

        if (q == 0) {
            out += c;
            break;
        }

        out += (c | 0x80);
        n = q;
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
andq $0x7f, %rax
movb %al, 0x17(%rsp)
movq 0x20(%rsp), %rax
shrq $0x7, %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x4524
movb 0x17(%rsp), %al
movq 0x18(%rsp), %rdi
movsbl %al, %esi
callq 0x2100
jmp 0x4547
movzbl 0x17(%rsp), %eax
orl $0x80, %eax
movq 0x18(%rsp), %rdi
movsbl %al, %esi
callq 0x2100
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x44ee
addq $0x28, %rsp
retq
nopl (%rax)
// File: ivan-tkatchev[P]yalz77/./lz77.h
// Function: lz77::fnv32a(unsigned char const*, unsigned long, unsigned int)
inline uint32_t fnv32a(const unsigned char* i, size_t len, uint32_t hash = 0x811c9dc5) {

    while (len > 0) {
        hash ^= (uint32_t)(*i);
        hash *= (uint32_t)0x01000193;
        ++i;
        --len;
    }

    return hash;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movl %edx, -0x14(%rsp)
cmpq $0x0, -0x10(%rsp)
jbe 0x4f70
movq -0x8(%rsp), %rax
movzbl (%rax), %eax
xorl -0x14(%rsp), %eax
movl %eax, -0x14(%rsp)
imull $0x1000193, -0x14(%rsp), %eax # imm = 0x1000193
movl %eax, -0x14(%rsp)
movq -0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rsp)
movq -0x10(%rsp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rsp)
jmp 0x4f2e
movl -0x14(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
nop
// File: ivan-tkatchev[P]yalz77/./lz77.h
// Function: lz77::offsets_dict_t::prev(unsigned long*, unsigned long*, unsigned long*)
static size_t* prev(size_t* b, size_t* e, size_t* i) {

        if (i == b)
            i = e;

        --i;
        return i;
    }

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x18(%rsp), %rax
cmpq -0x8(%rsp), %rax
jne 0x4fc5
movq -0x10(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
addq $-0x8, %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
retq
nopl (%rax)
// File: ivan-tkatchev[P]yalz77/./lz77.h
// Function: lz77::substr_run(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*)
inline size_t substr_run(const unsigned char* ai, const unsigned char* ae,
                         const unsigned char* bi, const unsigned char* be) {

    size_t n = 0;

    while (1) {

        if (*ai != *bi)
            break;

        ++n;
        ++ai;
        ++bi;

        if (ai == ae || bi == be)
            break;
    }

    return n;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq %rcx, -0x20(%rsp)
movq $0x0, -0x28(%rsp)
movq -0x8(%rsp), %rax
movzbl (%rax), %eax
movq -0x18(%rsp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x5013
jmp 0x5059
movq -0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rsp)
movq -0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rsp)
movq -0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rsp)
movq -0x8(%rsp), %rax
cmpq -0x10(%rsp), %rax
je 0x5055
movq -0x18(%rsp), %rax
cmpq -0x20(%rsp), %rax
jne 0x5057
jmp 0x5059
jmp 0x4ffd
movq -0x28(%rsp), %rax
retq
nop
// File: ivan-tkatchev[P]yalz77/./lz77.h
// Function: lz77::gains(unsigned long, unsigned long)
inline size_t gains(size_t run, size_t offset) {
    // Note: this function uses knowledge about the layout of bits in the compressed data format.
    
    size_t gain = run;
    
    offset = offset << (SHORTRUN_BITS + 1);

    size_t loss = vlq_length(offset);
    
    if (run >= SHORTRUN_MAX) {
        loss += vlq_length(run - MIN_RUN + 1);
    }

    if (loss > gain)
        return 0;

    return gain - loss;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
shlq $0x4, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x5150
movq %rax, (%rsp)
cmpq $0x8, 0x18(%rsp)
jb 0x50b6
movq 0x18(%rsp), %rdi
subq $0x5, %rdi
addq $0x1, %rdi
callq 0x5150
addq (%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
cmpq 0x8(%rsp), %rax
jbe 0x50cc
movq $0x0, 0x20(%rsp)
jmp 0x50da
movq 0x8(%rsp), %rax
subq (%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop