LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tplinderoth[P]introDist/Dxyz.cpp
// Function: getMaf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
double getMaf (const std::string &info) {
	// returns MAF based on the AF INFO subfield
	static char f [30];
	f[0] = '\0';
	int j=0;
	for (unsigned int i=0; i<info.size(); ++i) {
		if (i+2 < info.size() && info[i]=='A' && info[i+1]=='F' && info[i+2]=='=') {
			i += 3;
			while (i < info.size() && info[i] != ';' && info[i] != ',') {
				f[j] = info[i];
				++j;
				++i;
			}
			f[j] = '\0';
			break;
		}
	}

	if (!f[0]) {
		return -1.0;
	}

	double freq = atof(f);
	return (freq < 0.5 ? freq : 1.0-freq);
}

// Assembly:
pushq %rax
movb $0x0, 0xebe0(%rip)      # 0x17350
movq 0x8(%rdi), %rdx
movsd 0x68ac(%rip), %xmm0     # 0xf028
testq %rdx, %rdx
je 0x87b4
movq (%rdi), %rcx
movl $0x4, %eax
xorl %esi, %esi
leal -0x2(%rax), %r8d
cmpq %r8, %rdx
jbe 0x87aa
cmpb $0x41, (%rcx,%rsi)
jne 0x87aa
leal -0x3(%rax), %esi
cmpb $0x46, (%rcx,%rsi)
jne 0x87aa
cmpb $0x3d, (%rcx,%r8)
je 0x87b6
leal -0x3(%rax), %esi
incl %eax
cmpq %rsi, %rdx
ja 0x878b
popq %rax
retq
leal -0x1(%rax), %esi
leaq 0xeb90(%rip), %rcx      # 0x17350
cmpq %rsi, %rdx
jbe 0x87ee
xorl %edx, %edx
movq (%rdi), %r8
movzbl (%r8,%rsi), %esi
cmpl $0x2c, %esi
je 0x87ea
cmpl $0x3b, %esi
je 0x87ea
movb %sil, (%rdx,%rcx)
incq %rdx
movl %eax, %esi
incl %eax
cmpq %rsi, 0x8(%rdi)
ja 0x87c7
movl %edx, %eax
jmp 0x87f0
xorl %eax, %eax
movb $0x0, (%rax,%rcx)
cmpb $0x0, 0xeb55(%rip)      # 0x17350
je 0x87b4
leaq 0xeb4c(%rip), %rdi      # 0x17350
callq 0x63d0
movapd %xmm0, %xmm1
movsd 0x680b(%rip), %xmm2     # 0xf020
cmpltsd 0x67ea(%rip), %xmm0     # 0xf008
subsd %xmm1, %xmm2
andpd %xmm0, %xmm1
andnpd %xmm2, %xmm0
orpd %xmm1, %xmm0
jmp 0x87b4
// File: /workspace/github_cpp_makefile_star2_O3/tplinderoth[P]introDist/Dxyz.cpp
// Function: altCount(std::vector<int, std::allocator<int>> const&, std::vector<int, std::allocator<int>> const&, unsigned int&)
unsigned int altCount (const std::vector<int> &alleles, const std::vector<int> &idx, unsigned int &nseq) {
	static std::vector<int>::const_iterator idxiter;
	nseq = 0;
	unsigned int altcount = 0;
	for (idxiter = idx.begin(); idxiter != idx.end(); ++idxiter) {
		if (alleles[*idxiter] == -9) continue;
		if (alleles[*idxiter] == 1) ++altcount;
		++nseq;
	}

	return altcount;
}

// Assembly:
movl $0x0, (%rdx)
movq (%rsi), %rcx
movq 0x8(%rsi), %rsi
cmpq %rsi, %rcx
je 0x8876
movq (%rdi), %rdi
xorl %eax, %eax
xorl %r8d, %r8d
movslq (%rcx), %r9
movl (%rdi,%r9,4), %r9d
cmpl $-0x9, %r9d
je 0x886b
xorl %r10d, %r10d
cmpl $0x1, %r9d
sete %r10b
addl %r10d, %eax
incl %r8d
movl %r8d, (%rdx)
addq $0x4, %rcx
cmpq %rsi, %rcx
jne 0x884a
jmp 0x8878
xorl %eax, %eax
movq %rcx, 0xeb01(%rip)      # 0x17380
retq
// File: /workspace/github_cpp_makefile_star2_O3/tplinderoth[P]introDist/./Dxyz.h
// Function: Matrix<double>::Matrix(unsigned long, unsigned long)
Matrix (size_t n1, size_t n2)
		:   _nrow(0),
			_ncol(0),
			data(NULL)
	{
		if (n1 > 0 && n2 > 0) {
			_nrow = n1;
			_ncol = n2;
			data = new T* [n1];
			for (unsigned int i = 0; i < n1; ++i) {
				data[i] = new T [n2];
			}
		} else {
			std::cerr << "Unable to initialize matrix with " << n1 << "rows and " << n2 << " columns\n";
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sete %cl
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
orb %al, %cl
jne 0x8a59
movq %rdi, %r15
movl %ebx, (%rdi)
movl %r14d, 0x4(%rdi)
movq %rbx, %rax
shrq $0x3d, %rax
leaq (,%rbx,8), %rcx
xorl %r13d, %r13d
negq %rax
movl $0x0, %edi
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x6030
movq %rax, 0x8(%r15)
movq %r14, %rax
shrq $0x3d, %rax
shlq $0x3, %r14
negq %rax
movl $0x0, %r12d
sbbq %r12, %r12
orq %r14, %r12
movl $0x1, %ebp
movq %r12, %rdi
callq 0x6030
movq 0x8(%r15), %rcx
movq %rax, (%rcx,%r13,8)
movl %ebp, %r13d
incl %ebp
cmpq %rbx, %r13
jb 0x8a30
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xe588(%rip), %r15      # 0x16fe8
leaq 0x77d9(%rip), %rsi      # 0x10240
movl $0x21, %edx
movq %r15, %rdi
callq 0x6390
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6210
movq %rax, %rbx
leaq 0x77d9(%rip), %rsi      # 0x10262
movl $0x9, %edx
movq %rax, %rdi
callq 0x6390
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6210
leaq 0x77c4(%rip), %rsi      # 0x1026c
movl $0x9, %edx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6390
nop
// File: /workspace/github_cpp_makefile_star2_O3/tplinderoth[P]introDist/./Dxyz.h
// Function: Matrix<double>::~Matrix()
~Matrix () {
		for (unsigned int i = 0; i < _nrow; ++i) {
			delete [] data[i];
		}
		delete [] data;
		data = NULL;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %eax
testl %eax, %eax
je 0x8b7e
xorl %r14d, %r14d
movq 0x8(%rbx), %rcx
movq (%rcx,%r14,8), %rdi
testq %rdi, %rdi
je 0x8b74
callq 0x6400
movl (%rbx), %eax
incq %r14
movl %eax, %ecx
cmpq %rcx, %r14
jb 0x8b60
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x8b8c
callq 0x6400
movq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/minirop[P]JDecomqiler/src/ClassFile.cpp
// Function: ClassFile::parseInterface[abi:cxx11]()
std::string ClassFile::parseInterface()
{
	std::uint16_t name_index;
	std::string interfaceName;
	
	stream >> name_index;
	CPinfo *data = &constant_pool[name_index];
	if(data->tag == CONSTANT_Class)
	{
		interfaceName = getName(data->ClassInfo.name_index);
	}
	else
	{
		cerr << "ERROR: index " << name_index << " in not a class" << endl;
	}
	
	return interfaceName;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq -0x38(%rbp), %rax
movw $0x0, (%rax)
movq 0xa8(%rsi), %rdi
movl $0x2, %edx
movq %rax, %rsi
callq 0x22d0
movzwl -0x38(%rbp), %eax
rolw $0x8, %ax
movzwl %ax, %r14d
leaq 0x1fb91(%rip), %rax     # 0x23218
movq (%rax), %rax
leaq (%r14,%r14,2), %rcx
cmpb $0x7, (%rax,%rcx,8)
jne 0x36c7
leaq (%rax,%rcx,8), %rax
movzwl 0x8(%rax), %esi
leaq -0x38(%rbp), %rdi
callq 0x1a8c6
leaq -0x38(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22c0
movq (%r14), %rdi
leaq -0x28(%rbp), %rax
cmpq %rax, %rdi
je 0x372c
callq 0x2200
jmp 0x372c
movq 0x1f922(%rip), %rdi     # 0x22ff0
leaq 0x18a94(%rip), %rsi     # 0x1c169
movl $0xd, %edx
callq 0x2280
movq 0x1f90a(%rip), %rdi     # 0x22ff0
movq %r14, %rsi
callq 0x2170
movq %rax, %r14
leaq 0x18a7f(%rip), %rsi     # 0x1c177
movl $0xf, %edx
movq %rax, %rdi
callq 0x2280
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2180
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x373e
jmp 0x373e
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x374e
callq 0x2200
movq %r14, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O3/minirop[P]JDecomqiler/src/ClassFile.cpp
// Function: ClassFile::parseAttribute[abi:cxx11]()
std::tuple<std::string, std::string> ClassFile::parseAttribute()
{
	std::uint16_t attribute_name_index;
	stream >> attribute_name_index;
	
	std::string name = getName(attribute_name_index);
	
	std::uint32_t length;
	stream >> length;
	if(length > 512)
	{
		cerr << "attribute " << name << " has more than 512 bytes of data" << endl;
		exit(1);
	}
	
	char tmp[512] = {0};
	stream.readRawData(tmp, length);
	std::string data(tmp, length);
	
	return std::make_tuple(name, data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x240, %rsp            # imm = 0x240
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x260(%rbp), %r15
movw $0x0, (%r15)
movq 0xa8(%rsi), %rdi
movl $0x2, %edx
movq %r15, %rsi
callq 0x22d0
movzwl (%r15), %eax
rolw $0x8, %ax
movzwl %ax, %esi
leaq -0x40(%rbp), %rdi
callq 0x1a8c6
movl $0x0, (%r15)
movq 0xa8(%r14), %rdi
leaq -0x260(%rbp), %rsi
movl $0x4, %edx
callq 0x22d0
movl -0x260(%rbp), %r15d
bswapl %r15d
cmpl $0x201, %r15d           # imm = 0x201
jae 0x3fd2
leaq -0x260(%rbp), %r12
movl $0x200, %edx            # imm = 0x200
movq %r12, %rdi
xorl %esi, %esi
callq 0x2160
movl %r15d, %r15d
movq 0xa8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x22d0
leaq -0x50(%rbp), %r14
movq %r14, -0x10(%r14)
leaq (%r15,%rbp), %rdx
addq $-0x260, %rdx           # imm = 0xFDA0
leaq -0x60(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x50a4
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
movq %rbx, %rdi
callq 0x44ee
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x3fad
callq 0x2200
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fbf
callq 0x2200
movq %rbx, %rax
addq $0x240, %rsp            # imm = 0x240
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x1f017(%rip), %rdi     # 0x22ff0
leaq 0x180fe(%rip), %rsi     # 0x1c0de
movl $0xa, %edx
callq 0x2280
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq 0x1eff7(%rip), %rdi     # 0x22ff0
callq 0x2280
movq %rax, %rbx
leaq 0x180e1(%rip), %rsi     # 0x1c0e9
movl $0x20, %edx
movq %rax, %rdi
callq 0x2280
movq %rbx, %rdi
callq 0x2130
movl $0x1, %edi
callq 0x22a0
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x4041
callq 0x2200
jmp 0x4041
jmp 0x403e
jmp 0x403e
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4053
callq 0x2200
movq %rbx, %rdi
callq 0x23b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/minirop[P]JDecomqiler/src/ClassFile.cpp
// Function: ClassFile::generate()
void ClassFile::generate()
{
	std::ofstream file("output.java");
	if(!file.is_open())
		return;
	
	output.generate(file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
leaq 0x1807b(%rip), %rsi     # 0x1c187
leaq -0x208(%rbp), %rdi
movl $0x10, %edx
callq 0x2260
leaq -0x198(%rbp), %rdi
callq 0x2090
testb %al, %al
je 0x413c
leaq -0x208(%rbp), %rsi
movq %rbx, %rdi
callq 0x55e8
movq 0x1ee85(%rip), %rax     # 0x22fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x200(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x208(%rbp,%rcx)
callq 0x21d0
leaq -0x110(%rbp), %rdi
callq 0x20e0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x208(%rbp), %rdi
callq 0x2300
movq %rbx, %rdi
callq 0x23b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/minirop[P]JDecomqiler/src/FieldOutput.cpp
// Function: FieldOutput::generate(std::basic_ofstream<char, std::char_traits<char>>&)
void FieldOutput::generate(std::ofstream & file)
{
	if(isPublic)
		W("public ");
	if(isProtected)
		W("protected ");
	if(isPrivate)
		W("private ");
	if(isStatic)
		W("static ");
	if(isFinal)
		W("final ");
	if(isTransient)
		W("transient ");
	if(isVolatile)
		W("volatile ");
	
	W(type);
	W(" ");
	W(name);
	W(";\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x1, 0x58(%rdi)
jne 0x1a6e7
leaq 0x1afd(%rip), %rsi      # 0x1c1d7
movl $0x7, %edx
movq %rbx, %rdi
callq 0x2280
cmpb $0x1, 0x59(%r14)
jne 0x1a702
leaq 0x1f4c(%rip), %rsi      # 0x1c641
movl $0xa, %edx
movq %rbx, %rdi
callq 0x2280
cmpb $0x1, 0x5a(%r14)
jne 0x1a71d
leaq 0x1f3c(%rip), %rsi      # 0x1c64c
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2280
cmpb $0x1, 0x5d(%r14)
jne 0x1a738
leaq 0x1f2a(%rip), %rsi      # 0x1c655
movl $0x7, %edx
movq %rbx, %rdi
callq 0x2280
cmpb $0x1, 0x5c(%r14)
jne 0x1a753
leaq 0x1aa3(%rip), %rsi      # 0x1c1e9
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2280
cmpb $0x1, 0x5e(%r14)
jne 0x1a76e
leaq 0x2518(%rip), %rsi      # 0x1cc79
movl $0xa, %edx
movq %rbx, %rdi
callq 0x2280
cmpb $0x1, 0x5b(%r14)
jne 0x1a789
leaq 0x2508(%rip), %rsi      # 0x1cc84
movl $0x9, %edx
movq %rbx, %rdi
callq 0x2280
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq %rbx, %rdi
callq 0x2280
leaq 0x1fc0(%rip), %rsi      # 0x1c760
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2280
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2280
leaq 0x205b(%rip), %rsi      # 0x1c81e
movl $0x2, %edx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2280
// File: /workspace/github_cpp_makefile_star2_O3/minirop[P]JDecomqiler/src/Helpers.cpp
// Function: letterFromType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
char letterFromType(std::string type)
{
	if(type == "int")
		return 'i';
	else if(type == "long")
		return 'l';
	else if(type == "float")
		return 'f';
	else if(type == "double")
		return 'd';
	else
		return 'a';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1f53(%rip), %rsi      # 0x1c737
callq 0x20c0
testl %eax, %eax
je 0x1a831
leaq 0x1f47(%rip), %rsi      # 0x1c73b
movq %rbx, %rdi
callq 0x20c0
testl %eax, %eax
je 0x1a835
leaq 0x1f39(%rip), %rsi      # 0x1c740
movq %rbx, %rdi
callq 0x20c0
testl %eax, %eax
je 0x1a839
leaq 0x1f2c(%rip), %rsi      # 0x1c746
movq %rbx, %rdi
callq 0x20c0
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leal (%rcx,%rcx,2), %eax
addl $0x61, %eax
jmp 0x1a83b
movb $0x69, %al
jmp 0x1a83b
movb $0x6c, %al
jmp 0x1a83b
movb $0x66, %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/minirop[P]JDecomqiler/src/Helpers.cpp
// Function: typeFromInt[abi:cxx11](int)
std::string typeFromInt(int typeInt)
{
	std::string ret = "*ERROR*";
	switch(typeInt)
	{
		case T_BOOLEAN:
			ret = "boolean";
			break;
		case T_CHAR:
			ret = "char";
			break;
		case T_FLOAT:
			ret = "float";
			break;
		case T_DOUBLE:
			ret = "double";
			break;
		case T_BYTE:
			ret = "byte";
			break;
		case T_SHORT:
			ret = "short";
			break;
		case T_INT:
			ret = "int";
			break;
		case T_LONG:
			ret = "long";
			break;
		default:
			;
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
leaq 0x24f8(%rip), %rsi      # 0x1cd58
leaq 0x24f8(%rip), %rdx      # 0x1cd5f
callq 0x50a4
addl $-0x4, %r14d
cmpl $0x8, %r14d
jae 0x1a8a0
movl %r14d, %eax
leaq 0x2478(%rip), %rdx      # 0x1ccf8
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
leaq 0x248a(%rip), %rdx      # 0x1cd18
movq (%rdx,%rax,8), %r8
movq 0x8(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2320
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x1a8be
callq 0x2200
movq %r14, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O3/minirop[P]JDecomqiler/src/Helpers.cpp
// Function: getName[abi:cxx11](unsigned short)
std::string getName(std::uint16_t index)
{
	std::string ret_string("*ERROR*");
	
	CPinfo *data = &constant_pool[index];
	if(data->tag == CONSTANT_Utf8)
	{
		ret_string = std::string(data->UTF8Info.bytes);
	}
	
	return ret_string;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
leaq 0x2471(%rip), %rsi      # 0x1cd58
leaq 0x2471(%rip), %rdx      # 0x1cd5f
callq 0x50a4
movl %r14d, %ecx
movq 0x891b(%rip), %rax      # 0x23218
leaq (%rcx,%rcx,2), %rcx
cmpb $0x1, (%rax,%rcx,8)
jne 0x1a93c
leaq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rsi
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x2100
leaq -0x40(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22c0
movq (%r14), %rdi
leaq -0x30(%rbp), %rax
cmpq %rax, %rdi
je 0x1a93c
callq 0x2200
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x1a95a
callq 0x2200
movq %r14, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O3/minirop[P]JDecomqiler/src/Helpers.cpp
// Function: checkClassName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string checkClassName(std::string classname)
{
	std::replace(classname.begin(), classname.end(), '/', '.');
	size_t start_pos = classname.find("java.lang.");
	if(start_pos != std::string::npos)
	{
		classname.replace(start_pos, 10, std::string());
	}
	return classname;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x1a995
movq (%r14), %rcx
xorl %edx, %edx
cmpb $0x2f, (%rcx,%rdx)
jne 0x1a98d
movb $0x2e, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x1a983
leaq 0x23dc(%rip), %rsi      # 0x1cd78
movl $0xa, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x23a0
cmpq $-0x1, %rax
je 0x1a9e9
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movl $0xa, %edx
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x2270
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x1a9e9
callq 0x2200
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movq (%r14), %rdx
leaq 0x10(%r14), %rax
cmpq %rax, %rdx
je 0x1aa08
movq %rdx, (%rbx)
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x1aa0e
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x1aa45
callq 0x2200
movq %rbx, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O3/minirop[P]JDecomqiler/src/Helpers.cpp
// Function: removeArray(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string removeArray(std::string className)
{
	size_t start_pos;
	while((start_pos = className.find("[]")) != std::string::npos)
	{
		className.replace(start_pos, 2, "_arr");
	}
	
	return className;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1ccf(%rip), %rsi      # 0x1c734
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x23a0
cmpq $-0x1, %rax
je 0x1aab9
leaq 0x2302(%rip), %r15      # 0x1cd83
leaq 0x1cac(%rip), %r12      # 0x1c734
movl $0x2, %edx
movl $0x4, %r8d
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rcx
callq 0x2270
movl $0x2, %ecx
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x23a0
cmpq $-0x1, %rax
jne 0x1aa88
leaq 0x10(%r14), %rcx
movq %rcx, (%r14)
movq (%rbx), %rdx
leaq 0x10(%rbx), %rax
cmpq %rax, %rdx
je 0x1aad8
movq %rdx, (%r14)
movq (%rax), %rcx
movq %rcx, 0x10(%r14)
jmp 0x1aade
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%r14)
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/apply.cpp
// Function: remove_captured_piece(position*, unsigned long long)
piece_t remove_captured_piece(position* p,move m) {
    assert(is_capture(m));
    piece_t captured;
    if (is_epcapture(m)) {
        // remove pawn
        if (p->player==WHITE) { // black WAS on move
            captured = remove_piece(p,north(p->ep_sq));
            assert(captured==PAWN);
        } else {
            captured = remove_piece(p,south(p->ep_sq));
            assert(captured==-PAWN);
        }
    } else {
        captured = remove_piece(p,get_to_sq(m));
    }

    assert(captured != NO_PIECE);
    return captured;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x7883
testb %al, %al
je 0x2d93
movq %r14, %rdi
callq 0x788d
testb %al, %al
je 0x2d3b
movl 0x13c(%rbx), %edi
cmpl $0x1, 0x138(%rbx)
jne 0x2d70
callq 0xcc05
movq %rbx, %rdi
movl %eax, %esi
callq 0xa78d
movl %eax, %ecx
movl $0x1, %eax
cmpl $0x1, %ecx
je 0x2d8b
leaq 0x2632d(%rip), %rdi     # 0x29050
leaq 0x262e8(%rip), %rsi     # 0x29012
leaq 0x262ef(%rip), %rcx     # 0x29020
movl $0x16, %edx
callq 0x20d0
movq %r14, %rdi
callq 0x785b
movq %rbx, %rdi
movl %eax, %esi
callq 0xa78d
testl %eax, %eax
jne 0x2d8b
leaq 0x26317(%rip), %rdi     # 0x2906f
leaq 0x262b3(%rip), %rsi     # 0x29012
leaq 0x262ba(%rip), %rcx     # 0x29020
movl $0x1f, %edx
callq 0x20d0
callq 0xcc3e
movq %rbx, %rdi
movl %eax, %esi
callq 0xa78d
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $-0x1, %ecx
jne 0x2db2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2626a(%rip), %rdi     # 0x29004
leaq 0x26271(%rip), %rsi     # 0x29012
leaq 0x26278(%rip), %rcx     # 0x29020
movl $0x10, %edx
callq 0x20d0
leaq 0x262a6(%rip), %rdi     # 0x2905f
leaq 0x26252(%rip), %rsi     # 0x29012
leaq 0x26259(%rip), %rcx     # 0x29020
movl $0x19, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/apply.cpp
// Function: apply_null_move(position*)
square_t apply_null_move(position *p) {
    square_t ep_sq = p->ep_sq;

    // clear current values
    p->hash_key ^= zkeys.ptm[p->player];
    p->hash_key ^= zkeys.ep[p->ep_sq];

    // change player and reset EP square
    p->player = opposite_player(p->player);
    p->ep_sq = NO_SQUARE;

    // set current values
    p->hash_key ^= zkeys.ep[p->ep_sq];
    p->hash_key ^= zkeys.ptm[p->player];

    return ep_sq;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x138(%rdi), %edi
movl 0x13c(%rbx), %r14d
leaq 0xf4fb4(%rip), %r15     # 0xf8598
movq 0x1b8(%rbx), %rax
xorq 0x1c00(%r15,%rdi,8), %rax
movq %rax, 0x1b8(%rbx)
xorq 0x1c90(%r15,%r14,8), %rax
movq %rax, 0x1b8(%rbx)
callq 0xdf74
movl %eax, 0x138(%rbx)
movl $0x40, 0x13c(%rbx)
movq 0x1b8(%rbx), %rcx
xorq 0x1e90(%r15), %rcx
movq %rcx, 0x1b8(%rbx)
movl %eax, %eax
xorq 0x1c00(%r15,%rax,8), %rcx
movq %rcx, 0x1b8(%rbx)
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/apply.cpp
// Function: undo_null_move(position*, square_t)
void undo_null_move(position *p,square_t ep_sq) {
    // clear current values
    p->hash_key ^= zkeys.ptm[p->player];
    p->hash_key ^= zkeys.ep[p->ep_sq];

    // change player and reset EP square
    p->player = opposite_player(p->player);
    p->ep_sq = ep_sq;

    // set current values
    p->hash_key ^= zkeys.ep[p->ep_sq];
    p->hash_key ^= zkeys.ptm[p->player];
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl 0x138(%rdi), %edi
movl 0x13c(%rbx), %eax
leaq 0xf4f2f(%rip), %r14     # 0xf8598
movq 0x1b8(%rbx), %rcx
xorq 0x1c00(%r14,%rdi,8), %rcx
movq %rcx, 0x1b8(%rbx)
xorq 0x1c90(%r14,%rax,8), %rcx
movq %rcx, 0x1b8(%rbx)
callq 0xdf74
movl %eax, 0x138(%rbx)
movl %ebp, 0x13c(%rbx)
movl %ebp, %ecx
movq 0x1b8(%rbx), %rdx
xorq 0x1c90(%r14,%rcx,8), %rdx
movq %rdx, 0x1b8(%rbx)
movl %eax, %eax
xorq 0x1c00(%r14,%rax,8), %rdx
movq %rdx, 0x1b8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/attack.cpp
// Function: attacked_by_knight(position*, square_t, color_t)
bool attacked_by_knight(position *p,square_t sq,color_t player) {
    assert(p);
    assert(sq >= A8 && sq <= H1);
    assert(player==WHITE || player==BLACK);

    return bb_knight_moves[sq] & (player==WHITE ? p->white_knights : p->black_knights);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x3702
cmpl $0x40, %esi
jae 0x3721
cmpl $0x2, %edx
jae 0x3740
xorl %eax, %eax
cmpl $0x1, %edx
setne %al
movl %esi, %ecx
leaq 0xf6fbf(%rip), %rdx     # 0xfa6b0
movq 0x168(%rdi,%rax,8), %rax
testq %rax, (%rdx,%rcx,8)
setne %al
popq %rcx
retq
leaq 0x31bf3(%rip), %rdi     # 0x352fc
leaq 0x25ab8(%rip), %rsi     # 0x291c8
leaq 0x25ac0(%rip), %rcx     # 0x291d7
movl $0xf, %edx
callq 0x20d0
leaq 0x25ae6(%rip), %rdi     # 0x2920e
leaq 0x25a99(%rip), %rsi     # 0x291c8
leaq 0x25aa1(%rip), %rcx     # 0x291d7
movl $0x10, %edx
callq 0x20d0
leaq 0x25adc(%rip), %rdi     # 0x29223
leaq 0x25a7a(%rip), %rsi     # 0x291c8
leaq 0x25a82(%rip), %rcx     # 0x291d7
movl $0x11, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/attack.cpp
// Function: attacked_by_king(position*, square_t, color_t)
bool attacked_by_king(position *p,square_t sq,color_t player) {
    assert(p);
    assert(sq >= A8 && sq <= H1);
    assert(player==WHITE || player==BLACK);

    return bb_king_moves[sq] & bb_squares[player==WHITE ? p->white_king : p->black_king];
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x379b
cmpl $0x40, %esi
jae 0x37ba
cmpl $0x2, %edx
jae 0x37d9
xorl %eax, %eax
cmpl $0x1, %edx
setne %al
movl %esi, %ecx
leaq 0xf7130(%rip), %rdx     # 0xfa8b0
movl 0x14c(%rdi,%rax,4), %eax
leaq 0xf6d22(%rip), %rsi     # 0xfa4b0
movq (%rsi,%rax,8), %rax
testq %rax, (%rdx,%rcx,8)
setne %al
popq %rcx
retq
leaq 0x31b5a(%rip), %rdi     # 0x352fc
leaq 0x25a1f(%rip), %rsi     # 0x291c8
leaq 0x25a92(%rip), %rcx     # 0x29242
movl $0x17, %edx
callq 0x20d0
leaq 0x25a4d(%rip), %rdi     # 0x2920e
leaq 0x25a00(%rip), %rsi     # 0x291c8
leaq 0x25a73(%rip), %rcx     # 0x29242
movl $0x18, %edx
callq 0x20d0
leaq 0x25a43(%rip), %rdi     # 0x29223
leaq 0x259e1(%rip), %rsi     # 0x291c8
leaq 0x25a54(%rip), %rcx     # 0x29242
movl $0x19, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/attack.cpp
// Function: attacked_by_pawn(position*, square_t, color_t)
bool attacked_by_pawn(position *p,square_t sq,color_t player) {
    assert(p);
    assert(sq >= A8 && sq <= H1);
    assert(player==WHITE || player==BLACK);

    if (player==WHITE) {
        if (((p->white_pawns & ~bb_files[FILE_A]) >> 9) & bb_squares[sq]) return true;
        if (((p->white_pawns & ~bb_files[FILE_H]) >> 7) & bb_squares[sq]) return true;
    } else {
        if (((p->black_pawns & ~bb_files[FILE_A]) << 7) & bb_squares[sq]) return true;
        if (((p->black_pawns & ~bb_files[FILE_H]) << 9) & bb_squares[sq]) return true;
    }

    return false;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x38de
cmpl $0x40, %esi
jae 0x38fd
cmpl $0x2, %edx
jae 0x391c
leaq 0xf6bbb(%rip), %r8      # 0xfa430
movq (%r8), %r9
notq %r9
movl %esi, %eax
leaq 0xf6c2c(%rip), %rcx     # 0xfa4b0
movq (%rcx,%rax,8), %rcx
cmpl $0x1, %edx
jne 0x38b2
movq 0x158(%rdi), %rdx
andq %rdx, %r9
shrq $0x9, %r9
movb $0x1, %al
testq %rcx, %r9
jne 0x38dc
movq 0x38(%r8), %rsi
notq %rsi
andq %rsi, %rdx
shrq $0x7, %rdx
jmp 0x38d5
movq 0x160(%rdi), %rdx
andq %rdx, %r9
shlq $0x7, %r9
movb $0x1, %al
testq %rcx, %r9
jne 0x38dc
movq 0x38(%r8), %rsi
notq %rsi
andq %rsi, %rdx
shlq $0x9, %rdx
testq %rcx, %rdx
jne 0x38dc
xorl %eax, %eax
popq %rcx
retq
leaq 0x31a17(%rip), %rdi     # 0x352fc
leaq 0x258dc(%rip), %rsi     # 0x291c8
leaq 0x25984(%rip), %rcx     # 0x29277
movl $0x2f, %edx
callq 0x20d0
leaq 0x2590a(%rip), %rdi     # 0x2920e
leaq 0x258bd(%rip), %rsi     # 0x291c8
leaq 0x25965(%rip), %rcx     # 0x29277
movl $0x30, %edx
callq 0x20d0
leaq 0x25900(%rip), %rdi     # 0x29223
leaq 0x2589e(%rip), %rsi     # 0x291c8
leaq 0x25946(%rip), %rcx     # 0x29277
movl $0x31, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/attack.cpp
// Function: attacked(position*, square_t, color_t)
bool attacked(position *p,square_t sq,color_t player) {

    if (attacked_by_pawn(p,sq,player)) return true;
    if (attacked_by_knight(p,sq,player)) return true;
    if (attacked_by_king(p,sq,player)) return true;
    if (attacked_by_rook(p,sq,player)) return true;
    if (attacked_by_bishop(p,sq,player)) return true;
    if (attacked_by_queen(p,sq,player)) return true;

    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movl %esi, %ebx
movq %rdi, %r14
callq 0x3852
movb $0x1, %bpl
testb %al, %al
jne 0x39de
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0x36d0
testb %al, %al
jne 0x39de
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0x375f
testb %al, %al
jne 0x39de
xorl %eax, %eax
cmpl $0x1, %r15d
setne %al
movq 0x188(%r14,%rax,8), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x6828
testq %rax, %rax
jne 0x39de
xorl %eax, %eax
cmpl $0x1, %r15d
setne %al
movq 0x178(%r14,%rax,8), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x6708
testq %rax, %rax
jne 0x39de
xorl %eax, %eax
cmpl $0x1, %r15d
setne %al
movq 0x198(%r14,%rax,8), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x67f6
testq %rax, %rax
setne %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/attack.cpp
// Function: get_attackers(position*, square_t, color_t)
uint64 get_attackers(position *p,square_t sq,color_t player) {
    uint64 attackers = 0;

    attackers = bb_knight_moves[sq] & (player==WHITE ? p->white_knights : p->black_knights);
    attackers |= bb_king_moves[sq] & (player==WHITE ? bb_squares[p->white_king] : bb_squares[p->black_king]);

    if (player==WHITE) {
        attackers |= ((bb_squares[sq] & ~bb_files[FILE_A]) << 7) & p->white_pawns;
        attackers |= ((bb_squares[sq] & ~bb_files[FILE_H]) << 9) & p->white_pawns;
    } else {
        attackers |= ((bb_squares[sq] & ~bb_files[FILE_A]) >> 9) & p->black_pawns;
        attackers |= ((bb_squares[sq] & ~bb_files[FILE_H]) >> 7) & p->black_pawns;
    }

    attackers |= get_bishop_moves(p,sq,player==WHITE ? p->white_bishops : p->black_bishops);
    attackers |= get_rook_moves(p,sq,player==WHITE ? p->white_rooks : p->black_rooks);
    attackers |= get_queen_moves(p,sq,player==WHITE ? p->white_queens : p->black_queens);

    return attackers;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl %esi, %ecx
leaq 0xf6cab(%rip), %rax     # 0xfa6b0
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
leaq 0xf6a9b(%rip), %r9      # 0xfa4b0
movq (%r9,%rcx,8), %rdi
leaq 0xf6a10(%rip), %r8      # 0xfa430
movq (%r8), %rax
movq 0x38(%r8), %r13
notq %rax
andq %rdi, %rax
notq %r13
andq %rdi, %r13
xorl %edi, %edi
leaq 0xf6e74(%rip), %r8      # 0xfa8b0
movq (%r8,%rcx,8), %rcx
movq %rcx, 0x18(%rsp)
cmpl $0x1, %edx
setne %dil
movq 0x168(%r14,%rdi,8), %rcx
movq %rcx, 0x10(%rsp)
movl 0x14c(%r14,%rdi,4), %ecx
movq (%r9,%rcx,8), %rbp
jne 0x3a8b
shlq $0x7, %rax
shlq $0x9, %r13
orq %rax, %r13
andq 0x158(%r14), %r13
movl $0x178, %eax            # imm = 0x178
movl $0x188, %r12d           # imm = 0x188
movl $0x198, %ecx            # imm = 0x198
jmp 0x3aad
shrq $0x9, %rax
shrq $0x7, %r13
orq %rax, %r13
andq 0x160(%r14), %r13
movl $0x180, %eax            # imm = 0x180
movl $0x190, %r12d           # imm = 0x190
movl $0x1a0, %ecx            # imm = 0x1A0
movq %rcx, 0x8(%rsp)
movq (%r14,%rax), %rdx
movq %r14, %rdi
movl %esi, %ebx
callq 0x6708
movq %rax, %r15
movq (%r14,%r12), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x6828
movq %rax, %r12
movq 0x8(%rsp), %rax
movq (%r14,%rax), %rdx
movq 0x10(%rsp), %rax
andq 0x20(%rsp), %rax
andq 0x18(%rsp), %rbp
orq %rax, %rbp
orq %r15, %rbp
orq %rbp, %r12
movq %r14, %rdi
movl %ebx, %esi
callq 0x67f6
orq %r12, %rax
orq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/bitboards.cpp
// Function: get_lsb_slow(unsigned long long)
uint32 get_lsb_slow(uint64 val) {
    assert(val > 0);

    for (int i=0;i<64;i++) {
        if (val & bb_squares[i]) {
            return i;
        }
    }

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x3b47
xorl %eax, %eax
leaq 0xf697b(%rip), %rcx     # 0xfa4b0
testq %rdi, (%rcx,%rax,8)
jne 0x3b46
incq %rax
cmpq $0x40, %rax
jne 0x3b35
xorl %eax, %eax
retq
pushq %rax
leaq 0x257a1(%rip), %rdi     # 0x292f0
leaq 0x257a2(%rip), %rsi     # 0x292f8
leaq 0x257ad(%rip), %rcx     # 0x2930a
movl $0x1c, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/bitboards.cpp
// Function: get_lsb(unsigned long long)
uint32 get_lsb(uint64 val) {
    assert(val > 0);

    if (val & 65535) {
        return lsb[(uint32)(val & 65535)];
    }

    val >>= 16;
    if (val & 65535) {
        return lsb[(uint32)(val & 65535)] + 16;
    }

    val >>= 16;
    if (val & 65535) {
        return lsb[(uint32)(val & 65535)] + 32;
    }

    val >>= 16;
    return lsb[(uint32)val] + 48;
}

// Assembly:
testq %rdi, %rdi
je 0x3bc6
movq %rdi, %rax
andq $0xffff, %rax           # imm = 0xFFFF
je 0x3b82
leaq 0x3e922(%rip), %rcx     # 0x424a0
movl (%rcx,%rax,4), %eax
retq
movl %edi, %eax
shrl $0x10, %eax
je 0x3b97
leaq 0x3e910(%rip), %rcx     # 0x424a0
movl (%rcx,%rax,4), %eax
addl $0x10, %eax
retq
movq %rdi, %rax
shrq $0x20, %rax
andq $0xffff, %rax           # imm = 0xFFFF
je 0x3bb4
leaq 0x3e8f3(%rip), %rcx     # 0x424a0
movl (%rcx,%rax,4), %eax
addl $0x20, %eax
retq
shrq $0x30, %rdi
leaq 0x3e8e1(%rip), %rax     # 0x424a0
movl (%rax,%rdi,4), %eax
addl $0x30, %eax
retq
pushq %rax
leaq 0x25722(%rip), %rdi     # 0x292f0
leaq 0x25723(%rip), %rsi     # 0x292f8
leaq 0x2574a(%rip), %rcx     # 0x29326
movl $0x28, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/bitboards.cpp
// Function: get_msb_slow(unsigned long long)
uint32 get_msb_slow(uint64 val) {
    assert(val > 0);

    for (int i=63;i>=0;i--) {
        if (val & bb_squares[i]) {
            return i;
        }
    }

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x3c11
movl $0x3f, %ecx
leaq 0xf68b9(%rip), %rax     # 0xfa4b0
movl %ecx, %edx
testq %rdi, (%rax,%rdx,8)
jne 0x3c09
addl $-0x1, %ecx
jb 0x3bf7
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %eax, %eax
testl %ecx, %ecx
cmovgl %ecx, %eax
retq
pushq %rax
leaq 0x256d7(%rip), %rdi     # 0x292f0
leaq 0x256d8(%rip), %rsi     # 0x292f8
leaq 0x25716(%rip), %rcx     # 0x2933d
movl $0x3d, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/bitboards.cpp
// Function: get_msb(unsigned long long)
uint32 get_msb(uint64 val) {
    assert(val > 0);

    if ((val >> 48) & 65535) {
        return msb[(uint32)((val>>48)&65535)] + 48;
    }

    if ((val >> 32) & 65535) {
        return msb[(uint32)((val>>32)&65535)] + 32;
    }

    if ((val >> 16) & 65535) {
        return msb[(uint32)((val>>16)&65535)] + 16;
    }

    return msb[(uint32)val];
}

// Assembly:
testq %rdi, %rdi
je 0x3c8a
movq %rdi, %rax
shrq $0x30, %rax
jne 0x3c5c
movq %rdi, %rax
shrq $0x20, %rax
jne 0x3c6a
cmpq $0x10000, %rdi          # imm = 0x10000
jae 0x3c78
leaq 0x7e848(%rip), %rax     # 0x824a0
movl (%rax,%rdi,4), %eax
retq
leaq 0x7e83d(%rip), %rcx     # 0x824a0
movl (%rcx,%rax,4), %eax
addl $0x30, %eax
retq
leaq 0x7e82f(%rip), %rcx     # 0x824a0
movl (%rcx,%rax,4), %eax
addl $0x20, %eax
retq
shrq $0x10, %rdi
leaq 0x7e81d(%rip), %rax     # 0x824a0
movl (%rax,%rdi,4), %eax
addl $0x10, %eax
retq
pushq %rax
leaq 0x2565e(%rip), %rdi     # 0x292f0
leaq 0x2565f(%rip), %rsi     # 0x292f8
leaq 0x256b9(%rip), %rcx     # 0x29359
movl $0x49, %edx
callq 0x20d0
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/bitboards.cpp
// Function: isolate_lsb_bit(unsigned long long, unsigned int)
uint64 isolate_lsb_bit(uint64 mask,uint32 bit_pos) {

    uint32 n=0;
    for (int i=0;i<64;i++) {
        if (bb_squares[i] & mask) {
            if (n==bit_pos) {
                return bb_squares[i];
            }
            n++;
        }
    }

    return 0;
}

// Assembly:
xorl %ecx, %ecx
leaq 0xf67fd(%rip), %rdx     # 0xfa4b0
xorl %r8d, %r8d
movq (%rdx,%rcx,8), %rax
testq %rdi, %rax
je 0x3cc7
cmpl %esi, %r8d
je 0x3cd2
incl %r8d
incq %rcx
cmpq $0x40, %rcx
jne 0x3cb6
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/bitboards.cpp
// Function: init_knight_moves()
void init_knight_moves() {

    for (int i=0;i<64;i++) {
        square_t sq = (square_t)i;
        bb_knight_moves[sq] = 0;
        rank_t r = get_rank(sq);
        file_t f = get_file(sq);
        if (f > FILE_A) {
            if (r > RANK_7) {
                bb_knight_moves[sq] |= bb_squares[north(northwest(sq))];
            }
            if (r < RANK_2) {
                bb_knight_moves[sq] |= bb_squares[south(southwest(sq))];
            }
        }
        if (f > FILE_B) {
            if (r > RANK_8) {
                bb_knight_moves[sq] |= bb_squares[northwest(west(sq))];
            }
            if (r < RANK_1) {
                bb_knight_moves[sq] |= bb_squares[southwest(west(sq))];
            }
        }
        if (f < FILE_G) {
            if (r > RANK_8) {
                bb_knight_moves[sq] |= bb_squares[northeast(east(sq))];
            }
            if (r < RANK_1) {
                bb_knight_moves[sq] |= bb_squares[southeast(east(sq))];
            }
        }
        if (f < FILE_H) {
            if (r > RANK_7) {
                bb_knight_moves[sq] |= bb_squares[north(northeast(sq))];
            }
            if (r < RANK_2) {
                bb_knight_moves[sq] |= bb_squares[south(southeast(sq))];
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
leaq 0xf69cc(%rip), %r15     # 0xfa6b0
leaq 0xf67c5(%rip), %r12     # 0xfa4b0
movq $0x0, (%r15,%rbx,8)
movl %ebx, %edi
callq 0xca69
movl %eax, %ebp
movl %ebx, %edi
callq 0xca3e
testl %eax, %eax
jle 0x3d91
movl %eax, %r14d
cmpl $0x2, %ebp
jl 0x3d30
movl %ebx, %edi
callq 0xcdba
movl %eax, %edi
callq 0xcc05
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
cmpl $0x5, %ebp
ja 0x3d48
movl %ebx, %edi
callq 0xcd7a
movl %eax, %edi
callq 0xcc3e
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
cmpl $0x1, %r14d
je 0x3d91
testl %ebp, %ebp
jle 0x3d6f
movl %ebx, %edi
callq 0xccba
movl %eax, %edi
callq 0xcdba
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
cmpl $0x6, %ebp
ja 0x3d87
movl %ebx, %edi
callq 0xccba
movl %eax, %edi
callq 0xcd7a
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
cmpl $0x5, %r14d
ja 0x3e13
testl %ebp, %ebp
jle 0x3db2
movl %ebx, %edi
callq 0xcc7d
movl %eax, %edi
callq 0xccf0
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
cmpl $0x6, %ebp
ja 0x3dcf
movl %ebx, %edi
callq 0xcc7d
movl %eax, %edi
callq 0xcd33
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
cmpl $0x2, %ebp
jl 0x3dec
movl %ebx, %edi
callq 0xccf0
movl %eax, %edi
callq 0xcc05
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
cmpl $0x5, %ebp
ja 0x3e04
movl %ebx, %edi
callq 0xcd33
movl %eax, %edi
callq 0xcc3e
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
incq %rbx
cmpq $0x40, %rbx
jne 0x3ceb
jmp 0x3e1b
cmpl $0x6, %r14d
je 0x3dca
jmp 0x3e04
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/bitboards.cpp
// Function: init_king_moves()
void init_king_moves() {
    for (int i=0;i<64;i++) {
        square_t sq = (square_t)i;
        bb_king_moves[sq] = 0;
        rank_t r = get_rank(sq);
        file_t f = get_file(sq);
        if (r > RANK_8) {
            if (f > FILE_A) {
                bb_king_moves[sq] |= bb_squares[northwest(sq)];
            }
            bb_king_moves[sq] |= bb_squares[north(sq)];
            if (f < FILE_H) {
                bb_king_moves[sq] |= bb_squares[northeast(sq)];
            }
        }
        if (f < FILE_H) {
            bb_king_moves[sq] |= bb_squares[east(sq)];
        }
        if (r < RANK_1) {
            if (f < FILE_H) {
                bb_king_moves[sq] |= bb_squares[southeast(sq)];
            }
            bb_king_moves[sq] |= bb_squares[south(sq)];
            if (f > FILE_A) {
                bb_king_moves[sq] |= bb_squares[southwest(sq)];
            }
        }
        if (f > FILE_A) {
            bb_king_moves[sq] |= bb_squares[west(sq)];
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
leaq 0xf6a7b(%rip), %r15     # 0xfa8b0
leaq 0xf6674(%rip), %r12     # 0xfa4b0
movq $0x0, (%r15,%rbx,8)
movl %ebx, %edi
callq 0xca69
movl %eax, %r14d
movl %ebx, %edi
callq 0xca3e
movl %eax, %ebp
testl %r14d, %r14d
jle 0x3e9a
testl %ebp, %ebp
jle 0x3e71
movl %ebx, %edi
callq 0xcdba
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
movl %ebx, %edi
callq 0xcc05
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
cmpl $0x6, %ebp
jg 0x3ec9
movl %ebx, %edi
callq 0xccf0
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
jmp 0x3e9f
cmpl $0x6, %ebp
jg 0x3ecf
movl %ebx, %edi
callq 0xcc7d
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
cmpl $0x7, %r14d
jge 0x3ef7
movl %ebx, %edi
callq 0xcd33
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
jmp 0x3ecf
cmpl $0x7, %r14d
jae 0x3efb
movl %ebx, %edi
callq 0xcc3e
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
testl %ebp, %ebp
jle 0x3f0c
movl %ebx, %edi
callq 0xcd7a
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
jmp 0x3efb
testl %ebp, %ebp
jle 0x3f0c
movl %ebx, %edi
callq 0xccba
movl %eax, %eax
movq (%r12,%rax,8), %rax
orq %rax, (%r15,%rbx,8)
incq %rbx
cmpq $0x40, %rbx
jne 0x3e3c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/bitboards.cpp
// Function: init_pawn_attacks()
void init_pawn_attacks() {
    for (int i=0;i<64;i++) {
        square_t sq = (square_t)i;
        file_t file_i = get_file(sq);
        rank_t rank_i = get_rank(sq);

        bb_pawn_attacks[i][BLACK] = bb_pawn_attacks[i][WHITE] = 0;
        if (rank_i != RANK_1 && rank_i != RANK_8) {
            if (file_i > FILE_A) {
                bb_pawn_attacks[i][WHITE] |= bb_squares[northwest(sq)];
                bb_pawn_attacks[i][BLACK] |= bb_squares[southwest(sq)];
            }
            if (file_i < FILE_H) {
                bb_pawn_attacks[i][WHITE] |= bb_squares[northeast(sq)];
                bb_pawn_attacks[i][BLACK] |= bb_squares[southeast(sq)];
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0xf6a17(%rip), %r14     # 0xfaab0
xorl %ebx, %ebx
leaq 0xf640e(%rip), %r15     # 0xfa4b0
movl %ebx, %edi
callq 0xca3e
movl %eax, %ebp
movl %ebx, %edi
callq 0xca69
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
testl %eax, %eax
je 0x410d
cmpl $0x7, %eax
je 0x410d
testl %ebp, %ebp
jle 0x40ec
movl %ebx, %edi
callq 0xcdba
movl %eax, %eax
movq (%r15,%rax,8), %rax
orq %rax, 0x8(%r14)
movl %ebx, %edi
callq 0xcd7a
movl %eax, %eax
movq (%r15,%rax,8), %rax
orq %rax, (%r14)
cmpl $0x6, %ebp
ja 0x410d
movl %ebx, %edi
callq 0xccf0
movl %eax, %eax
movq (%r15,%rax,8), %rax
orq %rax, 0x8(%r14)
movl %ebx, %edi
callq 0xcd33
movl %eax, %eax
movq (%r15,%rax,8), %rax
orq %rax, (%r14)
incq %rbx
addq $0x10, %r14
cmpq $0x40, %rbx
jne 0x40a2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/bitboards.cpp
// Function: init_bitboards()
void init_bitboards() {

    for (int i=0;i<64;i++) {
        bb_squares[i] = ((uint64)1) << i;
    }

    for (int i=0;i<8;i++) {
        bb_ranks[i] = 0;
        bb_files[i] = 0;
    }

    for (int i=0;i<64;i++) {
        bb_ranks[get_rank((square_t)i)] |= bb_squares[i];
        bb_files[get_file((square_t)i)] |= bb_squares[i];
    }

    lsb[0] = 0; msb[0] = 0;
    for (uint32 i=1;i<65536;i++) {
        lsb[i] = get_lsb_slow(i);
        msb[i] = get_msb_slow(i);
    }

    init_knight_moves();
    init_king_moves();
    init_pawn_attacks();
    init_rays();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movdqa 0x2518a(%rip), %xmm0    # 0x292c0
xorl %eax, %eax
movdqa 0x25190(%rip), %xmm1    # 0x292d0
leaq 0xf6369(%rip), %r14     # 0xfa4b0
movdqa 0x25191(%rip), %xmm2    # 0x292e0
movdqa %xmm1, %xmm3
psllq %xmm0, %xmm3
pshufd $0xee, %xmm0, %xmm4     # xmm4 = xmm0[2,3,2,3]
movdqa %xmm1, %xmm5
psllq %xmm4, %xmm5
movsd %xmm3, %xmm5            # xmm5 = xmm3[0],xmm5[1]
movapd %xmm5, (%r14,%rax,8)
addq $0x2, %rax
paddq %xmm2, %xmm0
cmpq $0x40, %rax
jne 0x414f
pxor %xmm0, %xmm0
leaq 0xf62e9(%rip), %r15     # 0xfa470
movdqa %xmm0, 0x30(%r15)
movdqa %xmm0, 0x20(%r15)
movdqa %xmm0, 0x10(%r15)
movdqa %xmm0, (%r15)
leaq 0xf628b(%rip), %r12     # 0xfa430
movdqa %xmm0, (%r12)
movdqa %xmm0, 0x10(%r12)
movdqa %xmm0, 0x20(%r12)
movdqa %xmm0, 0x30(%r12)
xorl %ebx, %ebx
movq (%r14,%rbx,8), %r13
movl %ebx, %edi
callq 0xca69
movl %eax, %eax
orq %r13, (%r15,%rax,8)
movq (%r14,%rbx,8), %r13
movl %ebx, %edi
callq 0xca3e
movl %eax, %eax
orq %r13, (%r12,%rax,8)
incq %rbx
cmpq $0x40, %rbx
jne 0x41c2
xorl %eax, %eax
movl %eax, 0x3e2ab(%rip)     # 0x424a0
movl %eax, 0x7e2a5(%rip)     # 0x824a0
movl $0x1, %ebx
leaq 0x3e299(%rip), %r14     # 0x424a0
leaq 0x7e292(%rip), %r15     # 0x824a0
movq %rbx, %rdi
callq 0x3b27
movl %eax, (%r14,%rbx,4)
movq %rbx, %rdi
callq 0x3be6
movl %eax, (%r15,%rbx,4)
incq %rbx
cmpq $0x10000, %rbx          # imm = 0x10000
jne 0x420e
callq 0x3cd3
callq 0x3e24
callq 0x408b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3f22
nop
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/book.cpp
// Function: load_zkeys()
void load_zkeys() {
    printd("loading zkeys from book...\n");

    char* sql = "select key from zobrist_keys order by id";
    char *err_msg = 0;
    int num_keys = 0;

    int rc = sqlite3_exec(book_db,sql,load_zkeys_callback,(void*)&num_keys,&err_msg);
    if( rc != SQLITE_OK ){
        error("SQL error: %s\n",err_msg);
        sqlite3_free(err_msg);
    }
    printd("loaded %d keys\n",num_keys);
}

// Assembly:
subq $0x18, %rsp
leaq 0x2514d(%rip), %rdi     # 0x293a8
xorl %eax, %eax
callq 0x65d9
leaq 0x10(%rsp), %r8
movq $0x0, (%r8)
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0xc0698(%rip), %rax     # 0xc4918
movq (%rax), %rdi
leaq 0x2513a(%rip), %rsi     # 0x293c4
leaq 0x3d(%rip), %rdx        # 0x42ce
callq 0x2250
testl %eax, %eax
je 0x42b7
movq 0x10(%rsp), %rsi
leaq 0x25147(%rip), %rdi     # 0x293ed
xorl %eax, %eax
callq 0x2330
movq 0x10(%rsp), %rdi
callq 0x2200
movl 0xc(%rsp), %esi
leaq 0x2513a(%rip), %rdi     # 0x293fc
xorl %eax, %eax
callq 0x65d9
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/book.cpp
// Function: open_book_db(char*)
int32 open_book_db(char *path) {

    int rc = sqlite3_open(path, &book_db);
    if (rc){
        error("Can't open database: %s\n", sqlite3_errmsg(book_db));
        sqlite3_close(book_db);
        book_db = 0;
        return 0;
    }

    char* sql = "select count(*) from book_moves";
    char *err_msg = 0;
    int num_moves = 0;

    rc = sqlite3_exec(book_db,sql,num_moves_callback,(void*)&num_moves,&err_msg);
    if( rc != SQLITE_OK ){
        error("SQL error: %s\n",err_msg);
        sqlite3_free(err_msg);
    }

    load_zkeys();

    return num_moves;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
leaq 0xc0441(%rip), %rbx     # 0xc4918
movq %rbx, %rsi
callq 0x22e0
testl %eax, %eax
je 0x450f
movq (%rbx), %rdi
callq 0x2160
leaq 0x24f1a(%rip), %rdi     # 0x2940c
xorl %ebp, %ebp
movq %rax, %rsi
xorl %eax, %eax
callq 0x2330
movq (%rbx), %rdi
callq 0x20a0
movq $0x0, (%rbx)
jmp 0x4566
leaq 0x10(%rsp), %r8
movq $0x0, (%r8)
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
movq (%rbx), %rdi
leaq 0x24ef5(%rip), %rsi     # 0x29425
leaq 0x38(%rip), %rdx        # 0x456f
callq 0x2250
testl %eax, %eax
je 0x455d
movq 0x10(%rsp), %rsi
leaq 0x24ea1(%rip), %rdi     # 0x293ed
xorl %eax, %eax
callq 0x2330
movq 0x10(%rsp), %rdi
callq 0x2200
callq 0x4250
movl 0xc(%rsp), %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/src/book.cpp
// Function: num_moves_callback(void*, int, char**, char**)
static int num_moves_callback(void *data, int argc, char **argv, char **azColName){

    int* num_moves = (int*)data;

    if (argc==1 && argv[0]) {
        *num_moves = atoi(argv[0]);
    }

    printd("num moves: %d\n",*num_moves);

    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0x4587
movq (%rdx), %rdi
testq %rdi, %rdi
je 0x4587
callq 0x22b0
movl %eax, (%rbx)
movl (%rbx), %esi
leaq 0x24fea(%rip), %rdi     # 0x2957a
xorl %eax, %eax
callq 0x65d9
xorl %eax, %eax
popq %rbx
retq