LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/Forest.cpp
// Function: Forest::Forest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Forest::
Forest(string sent)
{
	stringstream ss(sent);
	while(!ss.eof())
	{
		string wrd;
		ss>>wrd;
		if(wrd!="") _sentence.push_back(wrd);
		if(ss.eof())break;
	}
	for(int i=0;(size_t)i<_sentence.size();i++)
	{
		vector<Node> vn;
		for(int j=0;(size_t)j<_sentence.size();j++)
		{
			Node nd(i,j);
			vn.push_back(nd);
		}
		push_back(vn);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rdi, %rbx
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
leaq 0x140(%rsp), %rdi
pushq $0x18
popq %rdx
callq 0x3460
leaq 0x38(%rsp), %rbp
leaq 0x140(%rsp), %r15
leaq 0x28(%rsp), %r12
leaq 0x14396(%rip), %r13     # 0x32eb6
movq 0x140(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x160(%rsp,%rax)
jne 0x1eb8f
movq %rbp, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x3380
movq %r12, %rdi
movq %r13, %rsi
callq 0x106a8
testb %al, %al
je 0x1eb6d
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x129cc
movq 0x140(%rsp), %rax
movq -0x18(%rax), %rax
movb 0x160(%rsp,%rax), %r14b
movq %r12, %rdi
callq 0x3578
testb $0x2, %r14b
je 0x1eb20
xorl %r15d, %r15d
leaq 0x28(%rsp), %r12
leaq 0x10(%rsp), %r13
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rax
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %r15, %rdx
jbe 0x1ec14
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
xorl %ebp, %ebp
subq %rcx, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0x1ebfc
movq %r12, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x17826
movq %r13, %rdi
movq %r12, %rsi
callq 0x21256
movq %r12, %rdi
callq 0x178a4
incq %rbp
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rax
jmp 0x1ebc3
movq %rbx, %rdi
movq %r13, %rsi
callq 0x21286
movq %r13, %rdi
callq 0x212b2
incq %r15
jmp 0x1eb9c
leaq 0x140(%rsp), %rdi
callq 0x3260
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x1ec72
jmp 0x1ec58
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0x3578
jmp 0x1ec65
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0x178a4
jmp 0x1ec5b
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x212b2
leaq 0x140(%rsp), %rdi
callq 0x3260
movq 0x8(%rsp), %rdi
callq 0x5166
movq %rbx, %rdi
callq 0x212d4
movq %r15, %rdi
callq 0x34f0
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/UniqueHeap.h
// Function: UniqueHeap<ScoreInfo>::pop()
_type pop(){
        _type ret;
		if(empty())
		{
			return nullData;
		}
		else
		{
			ret = top();
			dataSet.erase(ret);
			pop_heap(data.begin(), data.end());
			data.pop_back();
			return ret;
		}
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r15
leaq 0x18(%rsp), %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x10(%rbx)
orq $-0x1, -0x8(%rbx)
movq %rdi, %r14
movq 0x8(%rsi), %rax
cmpq (%rsi), %rax
je 0x25711
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x25dec
leaq 0x8(%rsp), %r12
leaq 0x30(%rsp), %rsi
movq %r12, %rdi
callq 0x1abf6
leaq 0x40(%rsp), %rdi
callq 0x8180
leaq 0x18(%r15), %rdi
movq %r12, %rsi
callq 0x25e48
movq (%r15), %rdi
movq 0x8(%r15), %rsi
callq 0x25e0c
movq %r15, %rdi
callq 0x25e30
movups 0x8(%rsp), %xmm0
movups %xmm0, (%r14)
movups 0x18(%rsp), %xmm0
movups %xmm0, 0x10(%r14)
movq 0x28(%rsp), %rax
movq %rax, 0x20(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
jmp 0x25720
addq $0x48, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1a2f8
movq %rbx, %rdi
callq 0x8180
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x25739
movq %rax, %r14
movq %rbx, %rdi
callq 0x8180
movq %r14, %rdi
callq 0x34f0
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/UniqueHeap.h
// Function: UniqueHeap<ScoreInfo>::push(ScoreInfo)
void push(_type entry){
		if(dataSet.count(entry)==0)
		{
			data.push_back(entry);
			push_heap(data.begin(), data.end());
			dataSet.insert(entry);
		}
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0x1a154
testq %rax, %rax
je 0x2576e
popq %rbx
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1a16e
movq (%r15), %rdi
movq 0x8(%r15), %rsi
callq 0x260df
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x1a818
nop
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/ScoreInfo.h
// Function: IntArray::shoulders(std::vector<IntArray, std::allocator<IntArray>>&) const
vector<IntArray>& shoulders(vector<IntArray>& m_ia)const
	{
		m_ia.clear();
		for(size_t i=0;i<size();i++)
		{
			m_ia.push_back((*this));
			m_ia[i][i]++;
		}
		return m_ia;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x25a3a
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x2, %rax
cmpq %rax, %r12
jae 0x258c7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x25a42
movq (%rbx), %rax
movq (%rax,%r15), %rax
incl (%rax,%r12,4)
incq %r12
addq $0x18, %r15
jmp 0x25898
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/UniqueHeap.h
// Function: UniqueHeap<ScoreInfo>::top()
_type top(){
		if(empty())
			return nullData;
		else
			return *(data.begin());
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rcx
leaq 0x48(%rsi), %rax
cmpq %rcx, 0x8(%rsi)
cmovneq %rcx, %rax
movq %rax, %rsi
callq 0x1a2f8
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/Main.cpp
// Function: string2oft(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
ObjectFunctionType string2oft(string str)
{
	if(str=="variational")
		return VARIATIONAL;
	else if(str=="max_rule_sum")
		return MAX_RULE_SUM;
	else if(str=="max_rule_product")
		return MAX_RULE_PRODUCT;
	else if(str=="max_prob")
		return MAX_PROB;
	else if(str=="viterbi")
		return NONE;
	return MAX_RULE_PRODUCT;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xc038(%rip), %rsi      # 0x32c2b
callq 0x57b9
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
jne 0x26c44
leaq 0xc030(%rip), %rsi      # 0x32c37
movq %rbx, %rdi
callq 0x57b9
testb %al, %al
je 0x26c17
pushq $0x1
jmp 0x26c43
leaq 0xbb2f(%rip), %rsi      # 0x3274d
movq %rbx, %rdi
callq 0x57b9
testb %al, %al
je 0x26c2e
pushq $0x2
jmp 0x26c43
leaq 0xc00f(%rip), %rsi      # 0x32c44
movq %rbx, %rdi
callq 0x57b9
testb %al, %al
je 0x26c46
pushq $0x4
popq %rax
popq %rbx
retq
leaq 0xc000(%rip), %rsi      # 0x32c4d
movq %rbx, %rdi
callq 0x57b9
movzbl %al, %eax
orl $0x2, %eax
jmp 0x26c44
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/RuleSet.cpp
// Function: ListRuleSet::ListRuleSet(std::istream&)
ListRuleSet::ListRuleSet(istream &is)
{
	string curline;
	InterNodes interNodes;
	while(!is.eof())
	{
		getline(is,curline);
		if(is.eof())break;
		if(curline.find("-->")==string::npos)continue;
		Rule rule;
		string2rule(curline,rule);
		//rule.print(jout);
		//add(rule);
		binarize(rule, interNodes, rule.left, PERMUTE , *this);
	}
	normalize();
	//cerr<<"finished loading!"<<endl;
	//print(cout);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
andl $0x0, 0x38(%rdi)
andq $0x0, 0x40(%rdi)
leaq 0x38(%rdi), %rax
movq %rax, 0x48(%rdi)
movq %rax, 0x50(%rdi)
andq $0x0, 0x58(%rdi)
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x70(%rsp), %rcx
andl $0x0, (%rcx)
andq $0x0, 0x8(%rcx)
movq %rsi, %r14
movb $0x0, (%rax)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
andq $0x0, 0x20(%rcx)
leaq 0x48(%rsp), %r15
xorl %r12d, %r12d
movq %rsp, %r13
leaq 0x98(%rsp), %rbp
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r14,%rax)
jne 0x2f6b1
movq %r14, %rdi
movq %r15, %rsi
callq 0x3070
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r14,%rax)
jne 0x2f6b1
movq %r15, %rdi
leaq 0x387d(%rip), %rsi      # 0x32eb7
xorl %edx, %edx
callq 0x3550
cmpq $-0x1, %rax
je 0x2f5ff
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
andq $0x0, 0x8(%rsp)
movb %r12b, 0x10(%rsp)
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
movb %r12b, 0x30(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x2f2a6
movq %rbp, %rdi
movq %r13, %rsi
callq 0x33c0
movq %r13, %rdi
leaq 0x68(%rsp), %rsi
movq %rbp, %rdx
pushq $0x2
popq %rcx
movq %rbx, %r8
callq 0x12203
movq %rbp, %rdi
callq 0x3578
movq %r13, %rdi
callq 0x12aa2
jmp 0x2f5ff
movq %rbx, %rdi
callq 0x2f734
leaq 0x68(%rsp), %rdi
callq 0x2342e
leaq 0x48(%rsp), %rdi
callq 0x3578
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2f6f3
movq %rax, %r14
leaq 0x98(%rsp), %rdi
callq 0x3578
jmp 0x2f6fb
movq %rax, %r14
jmp 0x2f703
movq %rax, %r14
movq %rsp, %rdi
callq 0x12aa2
leaq 0x30(%rbx), %r15
leaq 0x68(%rsp), %rdi
callq 0x2342e
leaq 0x48(%rsp), %rdi
callq 0x3578
movq %r15, %rdi
callq 0x149b6
movq %rbx, %rdi
callq 0x29434
movq %r14, %rdi
callq 0x34f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/Tree.cpp
// Function: getUPennTerm(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
string getUPennTerm(string& str)
{
	string result;
	size_t pos=0;
	
	result=str;
	pos=str.find("_");
	if(pos!=string::npos)
		result=str.substr(0,pos);
	
	pos=str.find("^g");
	if(pos!=string::npos)
	{
		result=str.substr(0,pos);
	}
	pos=result.find("u*");
	if(pos!=string::npos)
	{
		result=result.substr(pos+2);
	}
	return result;
	
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
callq 0x3170
leaq 0x1166(%rip), %rsi      # 0x321ab
movq %r14, %rdi
xorl %edx, %edx
callq 0x3550
cmpq $-0x1, %rax
je 0x3107b
movq %rsp, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3300
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3360
movq %r15, %rdi
callq 0x3578
leaq 0x1e51(%rip), %rsi      # 0x32ed3
movq %r14, %rdi
xorl %edx, %edx
callq 0x3550
cmpq $-0x1, %rax
je 0x310b8
movq %rsp, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3300
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3360
movq %r14, %rdi
callq 0x3578
leaq 0x12c9(%rip), %rsi      # 0x32388
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3550
cmpq $-0x1, %rax
je 0x310fa
addq $0x2, %rax
movq %rsp, %rdi
pushq $-0x1
popq %rcx
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3300
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3360
movq %r14, %rdi
callq 0x3578
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x3110d
jmp 0x3110d
jmp 0x3110d
movq %rax, %r14
movq %rbx, %rdi
callq 0x3578
movq %r14, %rdi
callq 0x34f0
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/utils.cpp
// Function: intToString[abi:cxx11](int)
string
intToString(int i)
{
  stringstream ss;
  ss<<i;
  string ans;
  ss>>ans;
  return ans;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3220
leaq 0x18(%rsp), %rdi
movl %ebp, %esi
callq 0x34d0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3380
leaq 0x8(%rsp), %rdi
callq 0x3260
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3578
jmp 0x31c10
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x3260
movq %r14, %rdi
callq 0x34f0
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/utils.cpp
// Function: doubleToString[abi:cxx11](double)
string doubleToString(double i)
{
  stringstream ss;
  ss.precision(20);
  if(i==0)
	  return "0.0";
  ss<<i;
  string ans;
  ss>>ans;
  return ans;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x3220
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x18(%rsp,%rax)
xorpd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jne 0x31c7a
jp 0x31c7a
leaq 0x126b(%rip), %rsi      # 0x32ed6
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x9f86
jmp 0x31ca5
movapd %xmm1, %xmm0
leaq 0x20(%rsp), %rdi
callq 0x3490
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x3380
leaq 0x10(%rsp), %rdi
callq 0x3260
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3578
jmp 0x31ccf
jmp 0x31ccc
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x3260
movq %r14, %rdi
callq 0x34f0
// File: /workspace/github_cpp_makefile_star2_O2/neubig[P]egret/Egret/src/utils.cpp
// Function: replaceSubStr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string& replaceSubStr(string& in, string oldSub, string newSub)
{
	size_t pos=0;
	while(true)
	{
		pos=in.find(oldSub,pos);
		if(pos!=string::npos)
		{
			in.replace(pos,oldSub.length(),newSub);
			pos+=newSub.length();
		}
		else break;
	}
	return in;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
xorl %r12d, %r12d
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3560
cmpq $-0x1, %rax
je 0x31d24
movq %rax, %r12
movq 0x8(%r15), %rdx
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x30f0
addq 0x8(%rbx), %r12
jmp 0x31cf5
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/iohandler.cpp
// Function: IOHandler::getBiggestId()
int IOHandler::getBiggestId(){

  int idBuffer;
  int bigger = 0;
  unsigned long backupPosition = ftell(this->file);
  fseek(this->file, 0, SEEK_SET);
  while (fscanf(this->file, "\"%d\";", &idBuffer) == 1) {
    // READ TITLE
    readNIgnoreColumn(this->file, ';');
    // READ YEAR
    fscanf(this->file, "\"%*d\";");

    // READ AUTHOR
    readNIgnoreColumn(this->file,  ';');

    // READ CITATION
    fscanf(this->file, "\"%*d\";");

    // READ DATE
    readNIgnoreColumn(this->file, ';');

    // READ SNIPPET
    readNIgnoreColumn(this->file, ';');

    if(idBuffer > bigger){
      bigger = idBuffer;
    }
  }

  fseek(this->file, backupPosition, SEEK_SET);

  return bigger;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x1030
movq %rax, %r14
movq (%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10c0
leaq 0x2ccc(%rip), %r15      # 0x4004
leaq 0x4(%rsp), %r12
leaq 0x2cc6(%rip), %r13      # 0x400a
xorl %ebp, %ebp
movq (%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1150
movq (%rbx), %rdi
cmpl $0x1, %eax
jne 0x13a0
callq 0x13bb
movq (%rbx), %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1150
movq (%rbx), %rdi
callq 0x13bb
movq (%rbx), %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1150
movq (%rbx), %rdi
callq 0x13bb
movq (%rbx), %rdi
callq 0x13bb
movl 0x4(%rsp), %eax
cmpl %ebp, %eax
cmovgl %eax, %ebp
jmp 0x1346
movq %r14, %rsi
xorl %edx, %edx
callq 0x10c0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/iohandler.cpp
// Function: readNIgnoreColumn(_IO_FILE*, char)
static inline void readNIgnoreColumn(FILE* file, char previous)
{
  char current = fgetc(file);
  char type;
  type = pairClass(previous, current);
  if (type != R_SON) {
    current = fgetc(file);
    do {
      previous = current;
      current = fgetc(file);
    } while ((type = after_pairClass(previous, current)) < R_EOC);
  } else {
    fscanf(file, "ULL\n");
    fscanf(file, "ULL\r\n");
    fscanf(file, "ULL;");
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x1110
cmpb $0x4e, %al
jne 0x1402
leaq 0x2c3f(%rip), %rsi      # 0x4011
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1150
leaq 0x2c33(%rip), %rsi      # 0x4016
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1150
leaq 0x2c28(%rip), %rsi      # 0x401c
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x1150
movq %rbx, %rdi
callq 0x1110
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1110
movl %eax, %r14d
movsbl %bpl, %edi
movsbl %r14b, %esi
callq 0x1694
movl %r14d, %ebp
cmpb $0x2, %al
jb 0x140c
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/iohandler.cpp
// Function: IOHandler::parseNext()
void IOHandler::parseNext()
{
  if (fscanf(this->file, "\"%d\";", &this->idBuffer) == 1) {
    // READ TITLE
    readColumn(this->file, this->readBuffer, ';');

    std::memcpy(this->titleBuffer, this->readBuffer, FIELD_TITLE_MAX_SIZE);
    this->titleBuffer[FIELD_TITLE_MAX_SIZE - 1] = '\0';
    // READ YEAR
    fscanf(this->file, "\"%d\";", &this->yearBuffer);

    // READ AUTHOR
    readColumn(this->file, this->readBuffer, ';');
    std::memcpy(this->authorsBuffer, this->readBuffer, FIELD_AUTHORS_MAX_SIZE);
    this->authorsBuffer[FIELD_AUTHORS_MAX_SIZE - 1] = '\0';
    // READ CITATION
    fscanf(this->file, "\"%d\";", &this->citationsBuffer);

    // READ DATE
    readColumn(this->file, this->readBuffer, ';');
    std::memcpy(this->dateBuffer, this->readBuffer, FIELD_DATE_MAX_SIZE);
    this->dateBuffer[FIELD_DATE_MAX_SIZE - 1] = '\0';
    // READ SNIPPET
    readColumn(this->file, readBuffer, ';');
    std::memcpy(this->snippetBuffer, this->readBuffer, FIELD_SNIPPET_MAX_SIZE);
    this->snippetBuffer[FIELD_SNIPPET_MAX_SIZE - 1] = '\0';
    this->state = IOHANDLER_READY;
  } else {
    this->state = IOHANDLER_END;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0xc(%rbx), %rdx
leaq 0x2bbc(%rip), %rsi      # 0x4004
xorl %eax, %eax
callq 0x1150
movb $0x2, %bpl
cmpl $0x1, %eax
jne 0x152e
movq (%rbx), %rdi
leaq 0x958(%rbx), %r14
movq %r14, %rsi
callq 0x153d
leaq 0x10(%rbx), %rdi
movl $0x12c, %edx            # imm = 0x12C
movq %r14, %rsi
callq 0x1070
xorl %ebp, %ebp
movb %bpl, 0x13b(%rbx)
movq (%rbx), %rdi
leaq 0x13c(%rbx), %rdx
leaq 0x2b6c(%rip), %r15      # 0x4004
movq %r15, %rsi
xorl %eax, %eax
callq 0x1150
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x153d
leaq 0x140(%rbx), %rdi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rsi
callq 0x1070
movb %bpl, 0x53f(%rbx)
movq (%rbx), %rdi
leaq 0x540(%rbx), %rdx
movq %r15, %rsi
xorl %eax, %eax
callq 0x1150
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x153d
movl 0x968(%rbx), %eax
movl %eax, 0x554(%rbx)
movups 0x958(%rbx), %xmm0
movups %xmm0, 0x544(%rbx)
movb %bpl, 0x557(%rbx)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x153d
leaq 0x558(%rbx), %rdi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rsi
callq 0x1070
movb %bpl, 0x957(%rbx)
movb %bpl, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/iohandler.cpp
// Function: readColumn(_IO_FILE*, char*, char)
static inline void readColumn(FILE* file, char* buffer, char previous)
{
  char current = fgetc(file);
  int pointer = 0;
  char type;
  type = pairClass(previous, current);
  if (type != R_SON) {
    current = fgetc(file);
    do {
      previous = current;
      current = fgetc(file);
      if (type < R_SOR) {
        buffer[pointer++] = previous;
      }
    } while ((type = after_pairClass(previous, current)) < R_EOC);
  } else {
    fscanf(file, "ULL\n");
    fscanf(file, "ULL\r\n");
    fscanf(file, "ULL;");
    pointer = 1;
  }
  buffer[pointer - 1] = '\0';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1110
cmpb $0x4e, %al
jne 0x158f
leaq 0x2ab3(%rip), %rsi      # 0x4011
movq %r14, %rdi
xorl %eax, %eax
callq 0x1150
leaq 0x2aa7(%rip), %rsi      # 0x4016
movq %r14, %rdi
xorl %eax, %eax
callq 0x1150
leaq 0x2a9c(%rip), %rsi      # 0x401c
movq %r14, %rdi
xorl %eax, %eax
callq 0x1150
pushq $0x1
popq %rax
jmp 0x15d9
cmpb $0x3b, %al
sete %r15b
movq %r14, %rdi
callq 0x1110
movl %eax, %ebp
addb %r15b, %r15b
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x1110
movl %eax, %r12d
testb %r15b, %r15b
jne 0x15bf
movslq %r13d, %rax
incl %r13d
movb %bpl, (%rbx,%rax)
movsbl %bpl, %edi
movsbl %r12b, %esi
callq 0x1694
movl %eax, %r15d
movl %r12d, %ebp
cmpb $0x2, %al
jb 0x15a5
movslq %r13d, %rax
movb $0x0, -0x1(%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/iohandler.cpp
// Function: IOHandler::operator>>(Article_t&)
void IOHandler::operator>>(Article_t& article)
{
  article.id = idBuffer;
  article.year = yearBuffer;
  article.citations = citationsBuffer;
  std::memcpy(article.title, this->titleBuffer, FIELD_TITLE_MAX_SIZE);
  std::memcpy(article.authors, this->authorsBuffer, FIELD_AUTHORS_MAX_SIZE);
  std::memcpy(article.date, this->dateBuffer, FIELD_DATE_MAX_SIZE);
  std::memcpy(article.snippet, this->snippetBuffer, FIELD_SNIPPET_MAX_SIZE);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc(%rdi), %eax
movl %eax, (%rsi)
movl 0x13c(%rdi), %eax
movl %eax, 0x130(%rsi)
movl 0x540(%rdi), %eax
movl %eax, 0x534(%rsi)
leaq 0x4(%rsi), %rdi
leaq 0x10(%r14), %rsi
movl $0x12c, %edx            # imm = 0x12C
callq 0x1070
leaq 0x134(%rbx), %rdi
leaq 0x140(%r14), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x1070
movups 0x544(%r14), %xmm0
movups %xmm0, 0x538(%rbx)
movl 0x554(%r14), %eax
movl %eax, 0x548(%rbx)
addq $0x54c, %rbx            # imm = 0x54C
addq $0x558, %r14            # imm = 0x558
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1070
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/iohandler.cpp
// Function: after_pairClass(char, char)
static inline char after_pairClass(char previous, char current)
{
  switch (previous) {
    case '\"': {

      if (current == ';' || current == '\n' || current == EOF) {
        return R_EOC;
      }

    } break;

    case ';': {

      if (current == '\"') {
        return R_SOR;
      }

    } break;

    case '\r': {
      if (current == '\n' || current == EOF) {
        return R_EOC;
      }
    }
  }
  return R_NOTHING;
}

// Assembly:
cmpl $0xd, %edi
je 0x16cc
cmpl $0x3b, %edi
je 0x16c1
cmpl $0x22, %edi
jne 0x16c9
movsbl %sil, %ecx
incl %ecx
cmpl $0x3c, %ecx
ja 0x16c9
movb $0x2, %al
movabsq $0x1000000000000801, %rdx # imm = 0x1000000000000801
btq %rcx, %rdx
jae 0x16c9
retq
movb $0x1, %al
cmpb $0x22, %sil
je 0x16c0
xorl %eax, %eax
retq
cmpb $-0x1, %sil
sete %cl
cmpb $0xa, %sil
sete %al
orb %cl, %al
addb %al, %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/secondarybtree.cpp
// Function: SecondaryBTreeNode::insert(SecondaryBTreeDataMap&)
int SecondaryBTreeNode::insert(SecondaryBTreeDataMap& key)
{ // [TROCAR]

    int i;

    for (i = count; i >= 1; i--) {
        if (key > keys[i - 1]) {
            keys[i] = key;
            break;
        } else {
            keys[i] = keys[i - 1];
        }
    }
    if (i == 0) {
        keys[0] = key;
    }

    count++;

    return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzwl (%rdi), %ebp
leaq 0x4(%rdi), %r12
imulq $0x130, %rbp, %rax      # imm = 0x130
leaq (%rax,%rdi), %r13
addq $-0x12c, %r13           # imm = 0xFED4
movq %rbp, %r15
testq %r15, %r15
jle 0x1839
movq %r14, %rdi
movq %r13, %rsi
callq 0x17aa
testb %al, %al
jne 0x185b
leaq 0x130(%r13), %rdi
movl $0x12c, %edx            # imm = 0x12C
movq %r13, %rsi
callq 0x1070
movl 0x12c(%r13), %eax
movl %eax, 0x25c(%r13)
addq $-0x130, %r13           # imm = 0xFED0
decq %r15
jmp 0x17f7
movl $0x12c, %edx            # imm = 0x12C
movq %r12, %rdi
movq %r14, %rsi
callq 0x1070
movl 0x12c(%r14), %eax
movl %eax, 0x130(%rbx)
xorl %r15d, %r15d
jmp 0x1885
movl %r15d, %eax
imulq $0x130, %rax, %r13      # imm = 0x130
leaq (%r12,%r13), %rdi
movl $0x12c, %edx            # imm = 0x12C
movq %r14, %rsi
callq 0x1070
movl 0x12c(%r14), %eax
movl %eax, 0x12c(%r12,%r13)
incl %ebp
movw %bp, (%rbx)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/secondarybtree.cpp
// Function: SecondaryBTree::buildIndex(_IO_FILE*)
void SecondaryBTree::buildIndex(FILE* indexFile)
{
    rewind(indexFile);
    fwrite(&rootOffset, sizeof(AbstractBlock_t), 1, indexFile);

    fseek(indexFile, sizeof(AbstractBlock_t), SEEK_SET);
    fwrite(root, sizeof(AbstractBlock_t), 1, indexFile);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1040
leaq 0x140(%r14), %rdi
pushq $0x1
popq %r15
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
movq %rbx, %rcx
callq 0x1160
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10c0
movq 0x138(%r14), %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x1160
nop
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/secondarybtree.cpp
// Function: SecondaryBTree::readRoot(_IO_FILE*)
void SecondaryBTree::readRoot(FILE* indexFile)
{
    rewind(indexFile);
    fread(&rootOffset, sizeof(int), 1, indexFile);

    SecondaryBTreeNodeReinterpret* reinterpretation = (SecondaryBTreeNodeReinterpret*)this->root;

    fseek(indexFile, sizeof(AbstractBlock_t) * rootOffset, SEEK_SET);
    fread(&reinterpretation->block, sizeof(AbstractBlock_t), 1, indexFile);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1040
leaq 0x140(%r14), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %r15
movq %r15, %rdx
movq %rbx, %rcx
callq 0x10f0
movq 0x138(%r14), %r12
movslq 0x140(%r14), %rsi
shlq $0xc, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10c0
movl $0x1000, %esi           # imm = 0x1000
movq %r12, %rdi
movq %r15, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x10f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/secondarybtree.cpp
// Function: SecondaryBTree::insert(SecondaryBTreeDataMap&, _IO_FILE*)
void SecondaryBTree::insert(SecondaryBTreeDataMap& key, FILE* indexFile)
{ // [TROCAR]
    auto result = insertRecursive(key, root, rootOffset, indexFile);

    if (result.hasBeenSplit) { // se tiver um promovido vindo de um split abaixo
        SecondaryBTreeNodeReinterpret* newRoot = new SecondaryBTreeNodeReinterpret();
        newRoot->node.insert(result.promotedKey); // insere a key promovida do nível abaixo
        newRoot->node.blockPointers[0] = rootOffset; //apontador esquerdo -> antiga raíz

        // considerando que o block splittado já foi salvo no arquivo na função insertRecursive
        newRoot->node.blockPointers[1] = result.newBlockOffset;
        newRoot->node.countPointers = 2;

        // salvar o newRoot no arquivo da SecondaryBTree
        rootOffset = writeNewNode(&newRoot->node, indexFile);

        // atualizar o header
        fseek(indexFile, 0, SEEK_SET);

        fwrite(&rootOffset, sizeof(AbstractBlock_t), 1, indexFile);

        delete (root);
        root = newRoot;

        fseek(indexFile, 0, SEEK_END);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x140, %rsp            # imm = 0x140
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %r14
movq 0x138(%rdi), %rcx
movl 0x140(%rdi), %r8d
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %r9
callq 0x1988
cmpb $0x1, (%r15)
jne 0x2244
leaq 0x140(%r14), %r12
movl $0x1000, %edi           # imm = 0x1000
callq 0x10a0
movq %rax, %r15
andl $0x0, (%rax)
leaq 0xc(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x17ca
movl 0x140(%r14), %eax
movl %eax, 0xe44(%r15)
movl 0x130(%r13), %eax
movl %eax, 0xe48(%r15)
movw $0x2, 0x2(%r15)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x24e7
movl %eax, 0x140(%r14)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10c0
pushq $0x1
popq %rdx
movl $0x1000, %esi           # imm = 0x1000
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1160
movq 0x138(%r14), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x10b0
movq %r15, 0x138(%r14)
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x10c0
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/arrayoperations.hpp
// Function: std::pair<bool, int> binarySearch<SecondaryBTreeDataMap, SecondaryBTreeDataMap>(SecondaryBTreeDataMap*, int, SecondaryBTreeDataMap)
static inline std::pair<bool, int> binarySearch(T* array, int length, K value)
{
    int position = lowerBound(array, length, value);

    if (array[position] == value) {
        return { true, position };
    }

    return { false, position };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movl %esi, %ebp
movq %rdi, %rbx
movq %rsp, %r15
leaq 0x160(%rsp), %r14
movl $0x130, %r12d           # imm = 0x130
movl $0x130, %edx            # imm = 0x130
movq %r15, %rdi
movq %r14, %rsi
callq 0x1070
movl %ebp, %eax
imulq $0x130, %rax, %rsi      # imm = 0x130
addq %rbx, %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x2593
subq %rbx, %rax
cqto
idivq %r12
movslq %eax, %rcx
movq %rax, %r15
shlq $0x20, %r15
imulq $0x130, %rcx, %rdi      # imm = 0x130
addq %rbx, %rdi
movq %r14, %rsi
callq 0x1790
movzbl %al, %eax
orq %r15, %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/primarybtree.cpp
// Function: PrimaryBTreeNode::insert(int)
unsigned short PrimaryBTreeNode::insert(int key)
{ // [TROCAR]

    unsigned short i;

    for (i = count; i >= 1; i--) {
        if (key > keys[i - 1]) {
            keys[i] = key;
            break;
        } else {
            keys[i] = keys[i - 1];
        }
    }
    if (i == 0) {
        keys[0] = key;
    }

    count++;

    return i;
}

// Assembly:
movzwl (%rdi), %ecx
leaq 0x4(%rdi), %rdx
movl %ecx, %eax
movl %ecx, %r8d
subw $0x1, %r8w
jb 0x2657
movzwl %ax, %r10d
leal -0x1(%r10), %r9d
movl (%rdx,%r9,4), %r9d
leaq (%rdx,%r10,4), %r10
cmpl %esi, %r9d
jl 0x2654
movl %r9d, (%r10)
movl %r8d, %eax
jmp 0x2630
movq %r10, %rdx
movl %esi, (%rdx)
incl %ecx
movw %cx, (%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/primarybtree.cpp
// Function: PrimaryBTree::buildIndex(_IO_FILE*)
void PrimaryBTree::buildIndex(FILE* indexFile)
{
    rewind(indexFile);
    fwrite(&rootOffset, sizeof(AbstractBlock_t), 1, indexFile);

    fseek(indexFile, sizeof(AbstractBlock_t), SEEK_SET);
    fwrite(root, sizeof(AbstractBlock_t), 1, indexFile);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1040
leaq 0x18(%r14), %rdi
pushq $0x1
popq %r15
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
movq %rbx, %rcx
callq 0x1160
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10c0
movq 0x10(%r14), %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x1160
nop
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/primarybtree.cpp
// Function: PrimaryBTree::readRoot(_IO_FILE*)
void PrimaryBTree::readRoot(FILE* indexFile)
{
    rewind(indexFile);
    fread(&rootOffset, sizeof(unsigned short), 1, indexFile);

    PrimaryBTreeNodeReinterpret* reinterpretation = (PrimaryBTreeNodeReinterpret*)this->root;

    fseek(indexFile, sizeof(AbstractBlock_t) * rootOffset, SEEK_SET);
    fread(&reinterpretation->block, sizeof(AbstractBlock_t), 1, indexFile);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1040
leaq 0x18(%r14), %rdi
pushq $0x2
popq %rsi
pushq $0x1
popq %r15
movq %r15, %rdx
movq %rbx, %rcx
callq 0x10f0
movq 0x10(%r14), %r12
movzwl 0x18(%r14), %esi
shll $0xc, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10c0
movl $0x1000, %esi           # imm = 0x1000
movq %r12, %rdi
movq %r15, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/primarybtree.cpp
// Function: PrimaryBTree::insert(int, _IO_FILE*)
void PrimaryBTree::insert(int key, FILE* indexFile)
{ // [TROCAR]
    auto result = insertRecursive(key, root, rootOffset, indexFile);

    if (result.hasBeenSplit) { // se tiver um promovido vindo de um split abaixo
        PrimaryBTreeNodeReinterpret* newRoot = new PrimaryBTreeNodeReinterpret();
        newRoot->node.insert(result.promotedKey); // insere a key promovida do nível abaixo
        newRoot->node.blockPointers[0] = rootOffset; //apontador esquerdo -> antiga raíz

        // considerando que o block splittado já foi salvo no arquivo na função insertRecursive
        newRoot->node.blockPointers[1] = result.newBlockOffset;
        newRoot->node.countPointers = 2;

        // salvar o newRoot no arquivo da PrimaryBTree
        rootOffset = writeNewNode(&newRoot->node, indexFile);

        // atualizar o header
        fseek(indexFile, 0, SEEK_SET);

        fwrite(&rootOffset, sizeof(AbstractBlock_t), 1, indexFile);

        delete (root);
        root = newRoot;

        fseek(indexFile, 0, SEEK_END);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rdx
movzwl 0x18(%rdi), %ecx
movq %rbx, %r8
callq 0x273e
movq %rax, %r13
testb $0x1, %r13b
je 0x2ccd
movl %edx, %ebp
leaq 0x18(%r14), %r12
movl $0x1000, %edi           # imm = 0x1000
callq 0x10a0
movq %rax, %r15
andl $0x0, (%rax)
shrq $0x20, %r13
movq %rax, %rdi
movl %r13d, %esi
callq 0x2624
movzwl 0x18(%r14), %eax
movw %ax, 0xaa4(%r15)
movw %bp, 0xaa6(%r15)
movw $0x2, 0x2(%r15)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2e62
movw %ax, 0x18(%r14)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10c0
pushq $0x1
popq %rdx
movl $0x1000, %esi           # imm = 0x1000
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1160
movq 0x10(%r14), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x10b0
movq %r15, 0x10(%r14)
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10c0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/article.cpp
// Function: Article_t::Article_t(int, char*, int, char*, int, char*, char*)
Article_t::Article_t(int id, char title[FIELD_TITLE_MAX_SIZE], int year, char authors[FIELD_AUTHORS_MAX_SIZE], int citations, char date[FIELD_DATE_MAX_SIZE], char snippet[FIELD_SNIPPET_MAX_SIZE])
: id(id)
, year(year)
, citations(citations)
{
  std::memcpy(this->title, title, FIELD_TITLE_MAX_SIZE);
  std::memcpy(this->authors, authors, FIELD_AUTHORS_MAX_SIZE);
  std::memcpy(this->date, date, FIELD_DATE_MAX_SIZE);
  std::memcpy(this->snippet, snippet, FIELD_SNIPPET_MAX_SIZE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rdx, %rax
movq %rdi, %r14
movq 0x38(%rsp), %rbx
movq 0x30(%rsp), %r12
movl %esi, (%rdi)
movl %ecx, 0x130(%rdi)
movl %r9d, 0x534(%rdi)
addq $0x4, %rdi
movl $0x12c, %edx            # imm = 0x12C
movq %rax, %rsi
callq 0x1070
leaq 0x134(%r14), %rdi
movl $0x400, %edx            # imm = 0x400
movq %r15, %rsi
callq 0x1070
movups (%r12), %xmm0
movups %xmm0, 0x538(%r14)
movl 0x10(%r12), %eax
movl %eax, 0x548(%r14)
addq $0x54c, %r14            # imm = 0x54C
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1070
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/article.cpp
// Function: Article_t::toString[abi:cxx11]()
std::string Article_t::toString() {
  std::stringstream ss;
  ss << "> Id: " << id << "\n\n";
  ss << "> Title: \"" << title << "\"" << "\n\n";
  ss << "> Year: " << year << "\n\n";
  ss << "> Authors: \"" << authors << "\"" << "\n\n";
  ss << "> Citations: \"" << citations << "\"" << "\n\n";
  ss << "> Date: " << date << "\n\n";
  ss << "> Snippet: \"" << snippet << "\"";

  return ss.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1050
leaq 0x18(%rsp), %r15
leaq 0x1074(%rip), %rsi      # 0x403c
movq %r15, %rdi
callq 0x1090
movl (%r14), %esi
movq %rax, %rdi
callq 0x1130
leaq 0x1061(%rip), %rsi      # 0x4043
movq %rax, %rdi
callq 0x1090
leaq 0x1055(%rip), %rsi      # 0x4046
movq %r15, %rdi
callq 0x1090
leaq 0x4(%r14), %rsi
movq %rax, %rdi
callq 0x1090
leaq 0x1043(%rip), %rsi      # 0x404f
movq %rax, %rdi
callq 0x1090
leaq 0x1028(%rip), %rsi      # 0x4043
movq %rax, %rdi
callq 0x1090
leaq 0x1027(%rip), %rsi      # 0x4051
movq %r15, %rdi
callq 0x1090
movl 0x130(%r14), %esi
movq %rax, %rdi
callq 0x1130
leaq 0xffb(%rip), %rsi       # 0x4043
movq %rax, %rdi
callq 0x1090
leaq 0x1003(%rip), %rsi      # 0x405a
movq %r15, %rdi
callq 0x1090
leaq 0x134(%r14), %rsi
movq %rax, %rdi
callq 0x1090
leaq 0xfda(%rip), %rsi       # 0x404f
movq %rax, %rdi
callq 0x1090
leaq 0xfbf(%rip), %rsi       # 0x4043
movq %rax, %rdi
callq 0x1090
leaq 0xfd4(%rip), %rsi       # 0x4067
movq %r15, %rdi
callq 0x1090
movl 0x534(%r14), %esi
movq %rax, %rdi
callq 0x1130
leaq 0xf9e(%rip), %rsi       # 0x404f
movq %rax, %rdi
callq 0x1090
leaq 0xf83(%rip), %rsi       # 0x4043
movq %rax, %rdi
callq 0x1090
leaq 0xfa7(%rip), %rsi       # 0x4076
movq %r15, %rdi
callq 0x1090
leaq 0x538(%r14), %rsi
movq %rax, %rdi
callq 0x1090
leaq 0xf56(%rip), %rsi       # 0x4043
movq %rax, %rdi
callq 0x1090
leaq 0xf83(%rip), %rsi       # 0x407f
movq %r15, %rdi
callq 0x1090
addq $0x54c, %r14            # imm = 0x54C
movq %rax, %rdi
movq %r14, %rsi
callq 0x1090
leaq 0xf32(%rip), %rsi       # 0x404f
movq %rax, %rdi
callq 0x1090
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x1120
leaq 0x8(%rsp), %rdi
callq 0x1060
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1060
movq %rbx, %rdi
callq 0x1140
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/block.cpp
// Function: Block_t::tryPutArticle(Article_t&)
bool Block_t::tryPutArticle(Article_t& article)
{
  Header_Interpretation_t* headerOnBytes = (Header_Interpretation_t*)(&this->content[0]);
  Tail_Interpretation_t* tailOnBytes = (Tail_Interpretation_t*)(&this->content[TAIL_LOCATION]);

  unsigned char position = headerOnBytes->struct_header.count;
  unsigned int realPosition = DATA_LOCATION + (position * sizeof(Article_t));

  if (realPosition < BLOCK_SIZE - sizeof(Article_t)) {
    Article_Interpretation_t* articleOnBytes = (Article_Interpretation_t*)(&this->content[realPosition]);

    std::memcpy(&articleOnBytes->struct_article, &article, sizeof(Article_Interpretation_t));

    ++headerOnBytes->struct_header.count;
    tailOnBytes->struct_tail.verificationMask = headerOnBytes->struct_header.verificationMask = VERIFICATION_MASK;

    return true;
  }

  return false;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movb 0x8(%rdi), %bpl
testb %bpl, %bpl
jne 0x31a1
movq %rdi, %rbx
addq $0x9, %rdi
movl $0x94c, %edx            # imm = 0x94C
callq 0x1070
movb $0x1, 0x8(%rbx)
movabsq $0x1591c7f96733dc5d, %rax # imm = 0x1591C7F96733DC5D
movq %rax, (%rbx)
movq %rax, 0xff7(%rbx)
testb %bpl, %bpl
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/hashfilefactory.cpp
// Function: HashFileFactory::createBinaryFilePerfectHash(_IO_FILE*, _IO_FILE*)
void HashFileFactory::createBinaryFilePerfectHash(FILE *toRead, FILE *toWrite) {
  IOHandler handler(toRead);

  FILE* primaryIndexFileWrite = fopen("files/primaryindex.block", "wb+");
  FILE* secondaryIndexFileWrite = fopen("files/secondaryindex.block", "wb+");


  PrimaryBTree pBtree;
  SecondaryBTree sBtree;

  pBtree.buildIndex(primaryIndexFileWrite);
  sBtree.buildIndex(secondaryIndexFileWrite);

  this->hashSize = handler.getBiggestId();

  Article_t currentArticle;
  SecondaryBTreeDataMap key;

  while (handler.hasNext()) {
    handler >> currentArticle;
    Block_t currentBlock;
    currentBlock.tryPutArticle(currentArticle);
    currentBlock.validate();

    std::memcpy(key.key, currentArticle.title, SECONDARY_KEY_LENGTH);
    key.dataPointer = currentArticle.id;

    pBtree.insert(currentArticle.id, primaryIndexFileWrite);
    sBtree.insert(key, secondaryIndexFileWrite);

    fseek(toWrite, currentArticle.id * sizeof(Block_t), SEEK_SET);
    fwrite(&currentBlock, sizeof(Block_t), 1, toWrite);

    handler.parseNext();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3558, %rsp           # imm = 0x3558
movq %rdx, %rbx
movq %rdi, 0x8(%rsp)
leaq 0x1c00(%rsp), %r14
movq %r14, %rdi
callq 0x1688
leaq 0xe60(%rip), %rdi       # 0x408c
leaq 0xe01(%rip), %r12       # 0x4034
movq %r12, %rsi
callq 0x10d0
movq %rax, %r13
leaq 0xe60(%rip), %rdi       # 0x40a5
movq %r12, %rsi
callq 0x10d0
movq %rax, %rbp
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x2660
leaq 0x168(%rsp), %r15
movq %r15, %rdi
callq 0x189c
movq %r12, %rdi
movq %r13, 0x10(%rsp)
movq %r13, %rsi
callq 0x268a
movq %r15, %rdi
movq %rbp, %r12
movq %rbp, %rsi
callq 0x18c4
movq %r14, %rdi
callq 0x130c
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x2b4(%rsp), %r13
movq %r13, %rdi
callq 0x2f14
leaq 0xc00(%rsp), %rbp
leaq 0x38(%rsp), %r15
movq %r14, %rdi
callq 0x1680
testb %al, %al
je 0x3368
movq %r14, %rdi
movq %r13, %rsi
callq 0x15ee
movq %rbp, %rdi
callq 0x31f8
movq %rbp, %rdi
movq %r13, %rsi
callq 0x316c
movq %rbp, %rdi
callq 0x31c0
movl $0x12c, %edx            # imm = 0x12C
movq %r15, %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x1070
movl 0x2b4(%rsp), %esi
movl %esi, 0x164(%rsp)
leaq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
callq 0x2c02
leaq 0x168(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2150
movslq 0x2b4(%rsp), %rsi
shlq $0xc, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10c0
movl $0x1000, %esi           # imm = 0x1000
movq %rbp, %rdi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1160
movq %r14, %rdi
callq 0x1430
jmp 0x32b7
addq $0x3558, %rsp           # imm = 0x3558
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ruankotovich[P]B-Tree/src/hashfinder.cpp
// Function: getArticleFromHash(int, Article_t*, _IO_FILE*)
bool getArticleFromHash(int id, Article_t *article, FILE *toRead) {
  Block_t block;

  fseek(toRead, sizeof(Block_t) * id, SEEK_SET);
  fread(&block, sizeof(Block_t), 1, toRead);

  if (!block.isValid()) {
    return false;
  }

  memcpy(article, block.getArticle(0), sizeof(Article_t));

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x31f8
movslq %ebp, %rsi
shlq $0xc, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x10c0
pushq $0x1
popq %rdx
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %r14, %rcx
callq 0x10f0
movq %r15, %rdi
callq 0x31da
movl %eax, %ebp
testb %al, %al
je 0x33ec
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x31ae
movl $0x94c, %edx            # imm = 0x94C
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1070
movl %ebp, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/xdsopl[P]FEC/./reed_solomon.hh
// Function: ReedSolomon<4, 0, GF::Types<4, 19, unsigned char>>::ReedSolomon()
ReedSolomon()
	{
		// $generator = \prod_{i=0}^{NR}(x-pe^{FCR+i})$
		ValueType tmp[NR+1];
		IndexType root(FCR), pe(1);
		for (int i = 0; i < NR; ++i) {
			tmp[i] = ValueType(1);
			for (int j = i; j > 0; --j)
				tmp[j] = fma(root, tmp[j], tmp[j-1]);
			tmp[0] *= root;
			root *= pe;
		}
		tmp[NR] = ValueType(1);
#ifndef NDEBUG
		std::cout << "generator = ";
		for (int i = NR; i > 0; --i) {
			if (!tmp[i])
				continue;
			if (tmp[i] != ValueType(1))
				std::cout << (int)tmp[i] << "*";
			std::cout << "x";
			if (i != 1)
				std::cout << "^" << i;
			std::cout << " + ";
		}
		std::cout << (int)tmp[0] << std::endl;
#endif
		for (int i = 0; i <= NR; ++i)
			generator[i] = index(tmp[i]);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
leaq 0xa(%rsp), %r14
movb $0x0, (%r14)
xorl %r12d, %r12d
leaq 0xb(%rsp), %r15
pushq $0x1
popq %rbp
cmpq $0x4, %r12
je 0x35be
movb $0x1, 0xb(%rsp,%r12)
movq %r12, %r13
movzbl 0xa(%rsp), %eax
testq %r13, %r13
jle 0x35a5
leaq -0x1(%r13), %rbx
movzbl 0xa(%rsp,%r13), %edx
movzbl 0xb(%rsp,%r13), %esi
movl %eax, %edi
callq 0x67d8
movb %al, 0xb(%rsp,%r13)
movq %rbx, %r13
jmp 0x357a
movq %r15, %rdi
movl %eax, %esi
callq 0x790e
movq %r14, %rdi
movl %ebp, %esi
callq 0x688a
incq %r12
jmp 0x356b
movb $0x1, 0xf(%rsp)
movq 0xd0a0e(%rip), %r14     # 0xd3fd8
leaq 0x9d2f(%rip), %rsi      # 0xd300
movq %r14, %rdi
callq 0x2160
pushq $0x4
popq %r15
pushq $0x1
popq %rbx
leaq 0x98b2(%rip), %r12      # 0xce99
leaq 0x98af(%rip), %r13      # 0xce9d
movq %r15, %rbp
subq $0x1, %r15
jb 0x3660
movb 0xb(%rsp,%rbp), %al
testb %al, %al
je 0x35ee
movzbl %al, %edi
movl %ebx, %esi
callq 0x6b32
testb %al, %al
je 0x3629
movzbl 0xb(%rsp,%rbp), %esi
movq %r14, %rdi
callq 0x21e0
movq %rax, %rdi
leaq 0x9873(%rip), %rsi      # 0xce97
callq 0x2160
movq %r14, %rdi
movq %r12, %rsi
callq 0x2160
cmpq $0x1, %rbp
je 0x3653
movq %r14, %rdi
leaq 0x9857(%rip), %rsi      # 0xce9b
callq 0x2160
movq %rax, %rdi
movl %ebp, %esi
callq 0x21e0
movq %r14, %rdi
movq %r13, %rsi
callq 0x2160
jmp 0x35ee
movzbl 0xb(%rsp), %esi
movq 0xd096c(%rip), %rdi     # 0xd3fd8
callq 0x21e0
movq %rax, %rdi
callq 0x20a0
xorl %r14d, %r14d
movq 0x10(%rsp), %rbx
cmpq $0x5, %r14
je 0x369b
movzbl 0xb(%rsp,%r14), %edi
callq 0x6a15
movb %al, (%rbx,%r14)
incq %r14
jmp 0x3681
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/xdsopl[P]FEC/./galois_field.hh
// Function: GF::Value<4, 19, unsigned char> GF::fma<4, 19, unsigned char>(GF::Index<4, 19, unsigned char>, GF::Value<4, 19, unsigned char>, GF::Value<4, 19, unsigned char>)
Value<M, POLY, TYPE> fma(Index<M, POLY, TYPE> a, Value<M, POLY, TYPE> b, Value<M, POLY, TYPE> c)
{
	assert(a.i < a.modulus());
	assert(b.v <= b.N);
	assert(c.v <= c.N);
	return !b.v ? c : (value(a * index(b)) + c);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
cmpb $0xf, %bpl
jae 0x682c
cmpb $0x10, %sil
jae 0x684b
movl %edx, %ebx
cmpb $0x10, %bl
jae 0x686a
testb %sil, %sil
je 0x6823
movzbl %sil, %edi
callq 0x6a15
movzbl %bpl, %edi
movzbl %al, %esi
callq 0x6997
movzbl %al, %edi
callq 0x694b
movzbl %al, %edi
movzbl %bl, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x68e0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x5e5d(%rip), %rdi      # 0xc690
leaq 0x5c7c(%rip), %rsi      # 0xc4b6
leaq 0x5e61(%rip), %rcx      # 0xc6a2
movl $0xe9, %edx
callq 0x20d0
leaq 0x5dcf(%rip), %rdi      # 0xc621
leaq 0x5c5d(%rip), %rsi      # 0xc4b6
leaq 0x5e42(%rip), %rcx      # 0xc6a2
movl $0xea, %edx
callq 0x20d0
leaq 0x5eb9(%rip), %rdi      # 0xc72a
leaq 0x5c3e(%rip), %rsi      # 0xc4b6
leaq 0x5e23(%rip), %rcx      # 0xc6a2
movl $0xeb, %edx
callq 0x20d0
nop