LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/Dxyz.cpp
// Function: setPopTable(std::basic_ifstream<char, std::char_traits<char>>&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>&)
int setPopTable(std::ifstream &popfile, std::map<std::string, int> &popmap) {
	std::string sample;
	int pop;
	while (popfile >> sample) {
		popfile >> pop;
		switch (pop) {
			case 0:
				break;
			case 1:
				break;
			case 2:
				break;
			default:
				std::cerr << "Invalid population label " << pop << "\n";
				return -1;
		}
		popmap.insert(std::pair<std::string, int>(sample, pop));
	}
	if (popmap.size() == 0) {
		std::cerr << "Population map is empty\n";
	}
	return popmap.size();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x8(%rsp), %r15
leaq 0x4(%rsp), %r12
leaq 0x28(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x6400
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x79d5
movq %r14, %rdi
movq %r12, %rsi
callq 0x6200
cmpl $0x3, 0x4(%rsp)
jae 0x79f7
movq %r13, %rdi
movq %r15, %rsi
callq 0x6450
movl 0x4(%rsp), %eax
movl %eax, 0x48(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xd09a
movq %r13, %rdi
callq 0x61a0
jmp 0x7982
movq 0x28(%rbx), %r14
testq %r14, %r14
jne 0x7a29
movq 0xf603(%rip), %rdi      # 0x16fe8
leaq 0x6ac4(%rip), %rsi      # 0xe4b0
callq 0x6320
movq 0x28(%rbx), %r14
jmp 0x7a29
movq 0xf5ea(%rip), %rdi      # 0x16fe8
leaq 0x6a91(%rip), %rsi      # 0xe496
callq 0x6320
movl 0x4(%rsp), %esi
movq %rax, %rdi
callq 0x65c0
leaq 0x666e(%rip), %rsi      # 0xe08b
movq %rax, %rdi
callq 0x6320
pushq $-0x1
popq %r14
leaq 0x8(%rsp), %rdi
callq 0x61a0
movl %r14d, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x7a57
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x61a0
jmp 0x7a5a
jmp 0x7a57
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x61a0
movq %rbx, %rdi
callq 0x65d0
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/Dxyz.cpp
// Function: parseGenotype(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<int, std::allocator<int>>&)
std::vector<int>::iterator& parseGenotype (const std::string &gt, std::vector<int> &alleles) {
	// sets the alleles in the allele vector and advances the iterator to the last set position
	static std::vector<int>::iterator it = alleles.begin();

	if (gt[1] == '/' || gt[1] == '|') {
		for (unsigned int i=0; i<3; i+=2) {
			switch (gt[i]) {
				case '0':
					*it = 0;
					break;
				case '1':
					*it = 1;
					break;
				case '.':
					*it = -9;
					break;
				default:
					std::cerr << "Unrecognized allele " << gt[i] << "\n";
					it = alleles.end();
					return it;
			}
			++it;
		}
	} else {
		std::cerr << "Invalid genotype subfield format\n";
		it=alleles.end();
		return it;
	}

	if (it == alleles.end()) {
		it = alleles.begin();
	}

	return it;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb 0xf8f5(%rip), %al       # 0x17388
testb %al, %al
je 0x7b5a
movq (%r14), %rax
movzbl 0x1(%rax), %ecx
cmpl $0x7c, %ecx
je 0x7aac
cmpl $0x2f, %ecx
jne 0x7afd
movq 0xf8cd(%rip), %rcx      # 0x17380
xorl %r15d, %r15d
pushq $-0x9
popq %rdx
pushq $0x1
popq %rsi
cmpq $0x2, %r15
ja 0x7af5
movzbl (%rax,%r15), %edi
cmpl $0x2e, %edi
je 0x7ade
xorl %r8d, %r8d
cmpl $0x30, %edi
je 0x7ae1
cmpl $0x31, %edi
jne 0x7b0d
movl %esi, %r8d
jmp 0x7ae1
movl %edx, %r8d
movl %r8d, (%rcx)
addq $0x4, %rcx
movq %rcx, 0xf891(%rip)      # 0x17380
addq $0x2, %r15
jmp 0x7abc
cmpq 0x8(%rbx), %rcx
jne 0x7b4d
jmp 0x7b43
movq 0xf4e4(%rip), %rdi      # 0x16fe8
leaq 0x69d3(%rip), %rsi      # 0xe4de
jmp 0x7b3a
movq 0xf4d4(%rip), %rdi      # 0x16fe8
leaq 0x69ae(%rip), %rsi      # 0xe4c9
callq 0x6320
movq (%r14), %rcx
movsbl (%rcx,%r15), %esi
movq %rax, %rdi
callq 0x63a0
leaq 0x6554(%rip), %rsi      # 0xe08b
movq %rax, %rdi
callq 0x6320
addq $0x8, %rbx
movq (%rbx), %rax
movq %rax, 0xf833(%rip)      # 0x17380
leaq 0xf82c(%rip), %rax      # 0x17380
popq %rbx
popq %r14
popq %r15
retq
leaq 0xf827(%rip), %rdi      # 0x17388
callq 0x6610
testl %eax, %eax
je 0x7a9b
movq (%rbx), %rax
movq %rax, 0xf808(%rip)      # 0x17380
leaq 0xf809(%rip), %rdi      # 0x17388
callq 0x6220
jmp 0x7a9b
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/Dxyz.cpp
// Function: calcDxyzWindow(Matrix<double> const&, unsigned int, double*, int*, double, double*)
double calcDxyzWindow(const Matrix<double> &dxy, unsigned int lastidx, double* nseqavg, int *nsites, const double minmaf, double* dxy_comp) {
	/*
	 * calculates Dxyz statistic as average_Dxy(source_pop,sink_pop)/average_Dxy(source_pop,outgroup_pop)
	 * average_Dxy = 1/N*[sum_i=1_to_i=N(Dxy)], N = number of sites
	 *
	 * Encode windows with no data or with no source-outgroup differences as -9
	 */

	dxy_comp[0] = 0; // Source-Sink average dxy
	dxy_comp[1] = 0; // Source-Outgroup average dxy
	*nseqavg = 0;
	*nsites = 0;

	unsigned int i;
	for (i=0; i<=lastidx; ++i) {
		if (dxy(i,0) != -9 && dxy(i,1) != -9 && dxy(i,4) >= minmaf) {
			dxy_comp[0] += dxy(i,0);
			dxy_comp[1] += dxy(i,1);
			*nseqavg += dxy(i,3);
			++*nsites;
		}
	}

	dxy_comp[0] /= *nsites;
	dxy_comp[1] /= *nsites;
	*nseqavg /= *nsites;

	if (*nsites < 1) return -9;

	return (dxy_comp[1] > 0 ? dxy_comp[0]/dxy_comp[1] : -9);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movsd %xmm0, 0x10(%rsp)
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%r8)
andq $0x0, (%rdx)
movq %rcx, 0x8(%rsp)
andl $0x0, (%rcx)
xorl %r13d, %r13d
movsd 0x6202(%rip), %xmm0     # 0xe018
movsd %xmm0, (%rsp)
pushq $0x1
popq %r15
cmpl %ebp, %r13d
ja 0x7ec5
movq %r12, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x84de
ucomisd 0x61db(%rip), %xmm0     # 0xe018
jne 0x7e41
jnp 0x7ebd
movq %r12, %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x84de
ucomisd 0x61c1(%rip), %xmm0     # 0xe018
jne 0x7e5b
jnp 0x7ebd
movq %r12, %rdi
movl %r13d, %esi
pushq $0x4
popq %rdx
callq 0x84de
ucomisd 0x10(%rsp), %xmm0
jb 0x7ebd
movq %r12, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x84de
addsd (%rbx), %xmm0
movsd %xmm0, (%rbx)
movq %r12, %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x84de
addsd 0x8(%rbx), %xmm0
movsd %xmm0, 0x8(%rbx)
movq %r12, %rdi
movl %r13d, %esi
pushq $0x3
popq %rdx
callq 0x84de
addsd (%r14), %xmm0
movsd %xmm0, (%r14)
movq 0x8(%rsp), %rax
incl (%rax)
incl %r13d
jmp 0x7e1f
movq 0x8(%rsp), %rax
movl (%rax), %eax
cvtsi2sd %eax, %xmm0
movupd (%rbx), %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
divpd %xmm2, %xmm1
movupd %xmm1, (%rbx)
movsd (%r14), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%r14)
testl %eax, %eax
jle 0x7f12
movsd 0x8(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x7f12
movsd (%rbx), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/Dxyz.cpp
// Function: printWindow(std::ostream&, double const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int const&, unsigned int const&, double const&, double const&, double*)
void printWindow (std::ostream &outstream, const double &dxyz, const std::string &seqid, const unsigned int &startpos, const unsigned int &endpos,
		const double &nseq, const double &nsites, double* dxy_comp) {
	outstream << seqid << "\t" << startpos << "\t" << endpos << "\t" << dxy_comp[0] << "\t" << dxy_comp[1] << "\t";
	if (dxyz != -9) {
		outstream << dxyz << "\t";
	} else {
		outstream << "NA\t";
	}
	outstream << nseq << "\t" << nsites << "\n";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x8(%rsp)
movq %r8, %r13
movq %rcx, %rbp
movq %rsi, %r15
movq %rdi, %r14
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rbx
movq %rdx, %rsi
callq 0x62e0
leaq 0x6531(%rip), %r12      # 0xe494
movq %rax, %rdi
movq %r12, %rsi
callq 0x6320
movl (%rbp), %esi
movq %rax, %rdi
callq 0x6250
movq %rax, %rdi
movq %r12, %rsi
callq 0x6320
movl (%r13), %esi
movq %rax, %rdi
callq 0x6250
movq %rax, %rdi
movq %r12, %rsi
callq 0x6320
movsd (%rbx), %xmm0
movq %rax, %rdi
callq 0x6540
movq %rax, %rdi
movq %r12, %rsi
callq 0x6320
movsd 0x8(%rbx), %xmm0
movq %rax, %rdi
callq 0x6540
movq %rax, %rdi
movq %r12, %rsi
callq 0x6320
movsd (%r15), %xmm0
ucomisd 0x6041(%rip), %xmm0     # 0xe018
jne 0x7fdb
jnp 0x7fef
movq %r14, %rdi
callq 0x6540
leaq 0x64aa(%rip), %rsi      # 0xe494
movq %rax, %rdi
jmp 0x7ff9
leaq 0x649c(%rip), %rsi      # 0xe492
movq %r14, %rdi
callq 0x6320
movq 0x8(%rsp), %rax
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x6540
leaq 0x647e(%rip), %rsi      # 0xe494
movq %rax, %rdi
callq 0x6320
movq 0x10(%rsp), %rcx
movsd (%rcx), %xmm0
movq %rax, %rdi
callq 0x6540
leaq 0x6055(%rip), %rsi      # 0xe08b
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6320
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/Dxyz.cpp
// Function: slideWindow(Matrix<double>&, unsigned int, unsigned int, unsigned int)
unsigned int slideWindow (Matrix<double> &win, const unsigned int winsize, const unsigned int step, unsigned int nsites) {
	/*
	 * Advances window along chromosome
	 * returns the number of sites shifted to the beginning of the window
	 */

	unsigned int nshift = 0;
	if (nsites == winsize) {
		// advance existing window
		nshift = winsize - step;
		for (unsigned int i=0; i<nshift; ++i) {
			int k=step+i;
			for (unsigned int j=0; j<win.ncol(); ++j) {
				win(i,j) = win(k,j);
			}
		}
	}

	return nshift;
}

// Assembly:
xorl %eax, %eax
cmpl %esi, %ecx
jne 0x80c3
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r14d
movq %rdi, %r15
subl %edx, %ebx
xorl %r12d, %r12d
cmpl %ebx, %r12d
je 0x80b3
leal (%r12,%r14), %ebp
xorl %r13d, %r13d
cmpl 0x4(%r15), %r13d
jae 0x80ae
movq %r15, %rdi
movl %ebp, %esi
movl %r13d, %edx
callq 0x8402
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r15, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x8402
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
incl %r13d
jmp 0x8076
incl %r12d
jmp 0x806a
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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, 0xf294(%rip)      # 0x17360
movq (%rdi), %rdx
movq 0x8(%rdi), %rcx
pushq $0x3
popq %rax
movsd 0x5f4a(%rip), %xmm0     # 0xe028
leal -0x3(%rax), %r8d
cmpq %r8, %rcx
jbe 0x817e
leal -0x1(%rax), %esi
cmpq %rsi, %rcx
jbe 0x810b
cmpb $0x41, (%rdx,%r8)
jne 0x810b
leal -0x2(%rax), %r8d
cmpb $0x46, (%rdx,%r8)
jne 0x810b
cmpb $0x3d, (%rdx,%rsi)
je 0x810f
incl %eax
jmp 0x80de
xorl %esi, %esi
leaq 0xf248(%rip), %rdx      # 0x17360
movl %eax, %eax
cmpq %rax, %rcx
jbe 0x813e
movq (%rdi), %rcx
movzbl (%rcx,%rax), %ecx
cmpl $0x2c, %ecx
je 0x813e
cmpl $0x3b, %ecx
je 0x813e
movb %cl, (%rsi,%rdx)
incq %rsi
incl %eax
movq 0x8(%rdi), %rcx
jmp 0x8118
movl %esi, %eax
movb $0x0, (%rax,%rdx)
cmpb $0x0, 0xf215(%rip)      # 0x17360
je 0x817e
leaq 0xf20c(%rip), %rdi      # 0x17360
callq 0x63e0
movapd %xmm0, %xmm1
movsd 0x5ebb(%rip), %xmm2     # 0xe020
cmpltsd 0x5e9a(%rip), %xmm0     # 0xe008
subsd %xmm1, %xmm2
andpd %xmm0, %xmm1
andnpd %xmm2, %xmm0
orpd %xmm1, %xmm0
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
andl $0x0, (%rdx)
movq (%rsi), %rcx
movq 0x8(%rsi), %rsi
movq (%rdi), %rdi
xorl %r8d, %r8d
xorl %eax, %eax
cmpq %rsi, %rcx
je 0x81be
movslq (%rcx), %r9
movl (%rdi,%r9,4), %r9d
cmpl $-0x9, %r9d
je 0x81b8
xorl %r10d, %r10d
cmpl $0x1, %r9d
sete %r10b
addl %r10d, %eax
incl %r8d
movl %r8d, (%rdx)
addq $0x4, %rcx
jmp 0x8192
movq %rcx, 0xf1cb(%rip)      # 0x17390
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
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 0x837f
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 %r13d, %r14d
cmpq %rbx, %r14
jae 0x8375
movq %r12, %rdi
callq 0x6030
movq 0x8(%r15), %rcx
movq %rax, (%rcx,%r14,8)
leal 0x1(%r14), %r13d
jmp 0x8357
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0xec62(%rip), %rdi      # 0x16fe8
leaq 0x6eb3(%rip), %rsi      # 0xf240
callq 0x6320
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6250
leaq 0x6ebe(%rip), %rsi      # 0xf262
movq %rax, %rdi
callq 0x6320
movq %rax, %rdi
movq %r14, %rsi
callq 0x6250
leaq 0x6eae(%rip), %rsi      # 0xf26c
movq %rax, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x6320
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
xorl %r14d, %r14d
movl (%rbx), %eax
movq 0x8(%rbx), %rdi
cmpq %rax, %r14
jae 0x8486
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x8481
callq 0x6410
incq %r14
jmp 0x8468
testq %rdi, %rdi
je 0x8490
callq 0x6410
andq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/minirop[P]JDecomqiler/src/main.cpp
// Function: main
int main(int argc, char** argv)
{
   if (argc != 2)
   {
      std::cerr << "usage: " << argv[0] << " <file.class>\n";
      return 1;
   }

	ClassFile cf(argv[1]);
	cf.generate();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
cmpl $0x2, %edi
jne 0x2656
movq 0x8(%rbx), %rsi
leaq -0x30(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x2100
leaq -0xe0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x28bc
leaq -0x30(%rbp), %rdi
callq 0x2140
leaq -0xe0(%rbp), %rdi
callq 0x3630
leaq -0xe0(%rbp), %rdi
callq 0x35dc
xorl %eax, %eax
jmp 0x2686
movq 0x16993(%rip), %rdi     # 0x18ff0
leaq 0xf9a0(%rip), %rsi      # 0x12004
callq 0x2230
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2230
leaq 0xf991(%rip), %rsi      # 0x1200c
movq %rax, %rdi
callq 0x2230
pushq $0x1
popq %rax
addq $0xd8, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x35dc
jmp 0x26b2
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2140
jmp 0x26b2
movq %rax, %rbx
movq %rbx, %rdi
callq 0x23b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0xa8(%rsi), %rdi
leaq -0x12(%rbp), %rsi
callq 0x280c
movzwl -0x12(%rbp), %r14d
leaq 0x16282(%rip), %rax     # 0x19230
movq (%rax), %rax
imulq $0x18, %r14, %rcx
cmpb $0x7, (%rax,%rcx)
jne 0x2fe4
addq %rcx, %rax
movzwl 0x8(%rax), %esi
leaq -0x38(%rbp), %rdi
callq 0x119f9
leaq -0x38(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22b0
movq %r14, %rdi
callq 0x2140
jmp 0x301a
movq 0x16005(%rip), %rdi     # 0x18ff0
leaq 0xf18b(%rip), %rsi      # 0x1217d
callq 0x2230
movzwl %r14w, %esi
movq %rax, %rdi
callq 0x2380
leaq 0xf181(%rip), %rsi      # 0x1218b
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2150
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x302a
jmp 0x302a
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x23b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x250, %rsp            # imm = 0x250
movq %rsi, %r14
movq %rdi, %rbx
addq $0xa8, %r14
leaq -0x26(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x280c
movzwl (%r15), %esi
leaq -0x68(%rbp), %rdi
callq 0x119f9
leaq -0x24(%rbp), %rsi
movq %r14, %rdi
callq 0x284c
movl -0x24(%rbp), %r15d
cmpq $0x201, %r15            # imm = 0x201
jae 0x3578
leaq -0x270(%rbp), %r12
movl $0x200, %edx            # imm = 0x200
movq %r12, %rdi
xorl %esi, %esi
callq 0x2180
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x26cc
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq (%r15,%rbp), %rdx
addq $-0x270, %rdx           # imm = 0xFD90
leaq -0x48(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x42ae
leaq -0x68(%rbp), %rsi
leaq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x39bc
leaq -0x48(%rbp), %rdi
callq 0x2140
leaq -0x68(%rbp), %rdi
callq 0x2140
movq %rbx, %rax
addq $0x250, %rsp            # imm = 0x250
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x15a71(%rip), %rdi     # 0x18ff0
leaq 0xeb6c(%rip), %rsi      # 0x120f2
callq 0x2230
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x2210
leaq 0xeb5f(%rip), %rsi      # 0x120fd
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2150
pushq $0x1
popq %rdi
callq 0x2290
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2140
jmp 0x35cb
jmp 0x35c8
jmp 0x35c8
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2140
movq %rbx, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O2/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 0xeb55(%rip), %rsi      # 0x1219b
leaq -0x208(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x2260
leaq -0x198(%rbp), %rdi
callq 0x2090
testb %al, %al
je 0x3674
leaq -0x208(%rbp), %rsi
movq %rbx, %rdi
callq 0x47e0
leaq -0x208(%rbp), %rdi
callq 0x2310
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x208(%rbp), %rdi
callq 0x2310
movq %rbx, %rdi
callq 0x23b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1186a
leaq 0x989(%rip), %rsi       # 0x121eb
movq %rbx, %rdi
callq 0x2230
cmpb $0x1, 0x59(%r14)
jne 0x11880
leaq 0xdc9(%rip), %rsi       # 0x12641
movq %rbx, %rdi
callq 0x2230
cmpb $0x1, 0x5a(%r14)
jne 0x11896
leaq 0xdbe(%rip), %rsi       # 0x1264c
movq %rbx, %rdi
callq 0x2230
cmpb $0x1, 0x5d(%r14)
jne 0x118ac
leaq 0xdb1(%rip), %rsi       # 0x12655
movq %rbx, %rdi
callq 0x2230
cmpb $0x1, 0x5c(%r14)
jne 0x118c2
leaq 0x943(%rip), %rsi       # 0x121fd
movq %rbx, %rdi
callq 0x2230
cmpb $0x1, 0x5e(%r14)
jne 0x118d8
leaq 0x13a9(%rip), %rsi      # 0x12c79
movq %rbx, %rdi
callq 0x2230
cmpb $0x1, 0x5b(%r14)
jne 0x118ee
leaq 0x139e(%rip), %rsi      # 0x12c84
movq %rbx, %rdi
callq 0x2230
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x2210
leaq 0xe5f(%rip), %rsi       # 0x12760
movq %rbx, %rdi
callq 0x2230
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2210
leaq 0xf03(%rip), %rsi       # 0x1281e
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xdff(%rip), %rsi       # 0x12737
callq 0x4d6e
movl %eax, %ecx
movb $0x69, %al
testb %cl, %cl
jne 0x1198f
leaq 0xdef(%rip), %rsi       # 0x1273b
movq %rbx, %rdi
callq 0x4d6e
movl %eax, %ecx
movb $0x6c, %al
testb %cl, %cl
jne 0x1198f
leaq 0xddd(%rip), %rsi       # 0x12740
movq %rbx, %rdi
callq 0x4d6e
movl %eax, %ecx
movb $0x66, %al
testb %cl, %cl
jne 0x1198f
leaq 0xdcc(%rip), %rsi       # 0x12746
movq %rbx, %rdi
callq 0x4d6e
xorl %ecx, %ecx
testb %al, %al
setne %cl
leal (%rcx,%rcx,2), %eax
addl $0x61, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x30, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x1307(%rip), %rsi      # 0x12d18
leaq -0x38(%rbp), %rdx
callq 0x2100
movl %r14d, %ecx
movq 0x780c(%rip), %rax      # 0x19230
imulq $0x18, %rcx, %rcx
cmpb $0x1, (%rax,%rcx)
jne 0x11a59
addq %rcx, %rax
movq 0x10(%rax), %rsi
leaq -0x38(%rbp), %rdi
leaq -0x11(%rbp), %rdx
callq 0x2100
leaq -0x38(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22b0
movq %r14, %rdi
callq 0x2140
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
addq %rdi, %rsi
leaq -0x38(%rbp), %rdx
movb $0x2f, (%rdx)
leaq -0x11(%rbp), %rcx
movb $0x2e, (%rcx)
callq 0x11f54
leaq 0x128b(%rip), %rsi      # 0x12d38
movq %r14, %rdi
xorl %edx, %edx
callq 0x2400
cmpq $-0x1, %rax
je 0x11ae8
leaq -0x28(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
pushq $0xa
popq %rdx
leaq -0x38(%rbp), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x20f0
leaq -0x38(%rbp), %rdi
callq 0x2140
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22e0
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x2140
movq %rbx, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xc06(%rip), %r15       # 0x12734
leaq 0x120e(%rip), %r12      # 0x12d43
pushq $0x2
popq %r13
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2400
cmpq $-0x1, %rax
je 0x11b5f
movq %r14, %rdi
movq %rax, %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x2190
jmp 0x11b39
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22e0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/minirop[P]JDecomqiler/src/Helpers.cpp
// Function: parseSignature(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::vector<std::string> parseSignature(std::string signature)
{
	std::vector<std::string> params;
	
	int i = 0;
	if(signature[i] == '(')
	{
		i++;
		
		int next_is_array = 0;
		std::string type;
		while(signature[i] != ')')
		{
			if(signature[i] == '[')
			{
				next_is_array++;
			}
			else
			{
				type = parseType(signature, i);
			}
			
			if(type.length() > 0)
			{
				std::string tmp = type;
				while(next_is_array > 0)
				{
					tmp += "[]";
					next_is_array--;
				}
				params.push_back(tmp);
				tmp.clear();
			}
			
			i++;
		}
		i++; // skip the ')'
	}
	
	params.push_back(parseType(signature, i));
	
	return params;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
andl $0x0, -0x2c(%rbp)
movq %rdi, -0x38(%rbp)
movups %xmm0, (%rdi)
movq (%rsi), %rcx
cmpb $0x28, (%rcx)
jne 0x11cb9
movq %rsi, -0x40(%rbp)
leaq -0x2c(%rbp), %rdx
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movl $0x1, (%rdx)
movb $0x0, (%rax)
xorl %r13d, %r13d
pushq $0x1
popq %rax
leaq -0xa0(%rbp), %r12
leaq 0xb53(%rip), %r15       # 0x12734
leaq -0xc0(%rbp), %r14
movslq %eax, %rdx
movzbl (%rcx,%rdx), %ecx
cmpl $0x5b, %ecx
je 0x11c36
cmpl $0x29, %ecx
je 0x11ca7
movq %r14, %rdi
movq -0x40(%rbp), %rsi
callq 0x22f0
movq %r12, %rdi
movq %r14, %rsi
leaq -0x2c(%rbp), %rdx
callq 0x11d64
leaq -0x60(%rbp), %rdi
movq %r12, %rsi
callq 0x22b0
movq %r12, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x2140
jmp 0x11c39
incl %r13d
cmpq $0x0, -0x58(%rbp)
je 0x11c93
movq %r12, %rdi
leaq -0x60(%rbp), %rsi
callq 0x22f0
movl %r13d, %ebx
sarl $0x1f, %ebx
andl %r13d, %ebx
testl %r13d, %r13d
jle 0x11c6a
movq %r12, %rdi
movq %r15, %rsi
callq 0x23d0
decl %r13d
jmp 0x11c55
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0xfb56
andq $0x0, -0x98(%rbp)
movq -0xa0(%rbp), %rax
movb $0x0, (%rax)
movq %r12, %rdi
callq 0x2140
movl %ebx, %r13d
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
jmp 0x11be8
incl %eax
movl %eax, -0x2c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x2140
movq -0x40(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x22f0
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0x11d64
leaq -0x60(%rbp), %rsi
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x3be2
leaq -0x60(%rbp), %rdi
callq 0x2140
leaq -0x80(%rbp), %rdi
callq 0x2140
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x2140
jmp 0x11d1b
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
jmp 0x11d4e
movq %rax, %rbx
jmp 0x11d53
jmp 0x11d36
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
jmp 0x11d45
jmp 0x11d3b
movq %rax, %rbx
jmp 0x11d4a
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x2140
leaq -0x60(%rbp), %rdi
callq 0x2140
movq -0x38(%rbp), %rdi
callq 0x3834
movq %rbx, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x739a
testb %al, %al
je 0x2ca7
movq %r14, %rdi
callq 0x73a4
testb %al, %al
je 0x2c59
movl 0x13c(%rbx), %edi
cmpl $0x1, 0x138(%rbx)
jne 0x2c88
callq 0xc19d
movq %rbx, %rdi
movl %eax, %esi
callq 0x9f37
cmpl $0x1, %eax
jne 0x2cc4
pushq $0x1
jmp 0x2c9e
movq %r14, %rdi
callq 0x7372
movq %rbx, %rdi
movl %eax, %esi
callq 0x9f37
testl %eax, %eax
jne 0x2c9f
leaq 0x243f9(%rip), %rdi     # 0x2706f
leaq 0x24395(%rip), %rsi     # 0x27012
leaq 0x2439c(%rip), %rcx     # 0x27020
pushq $0x1f
jmp 0x2cbe
callq 0xc1e0
movq %rbx, %rdi
movl %eax, %esi
callq 0x9f37
cmpl $-0x1, %eax
jne 0x2cdd
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x24356(%rip), %rdi     # 0x27004
leaq 0x2435d(%rip), %rsi     # 0x27012
leaq 0x24364(%rip), %rcx     # 0x27020
pushq $0x10
popq %rdx
callq 0x20c0
leaq 0x24385(%rip), %rdi     # 0x27050
leaq 0x24340(%rip), %rsi     # 0x27012
leaq 0x24347(%rip), %rcx     # 0x27020
pushq $0x16
jmp 0x2cbe
leaq 0x2437b(%rip), %rdi     # 0x2705f
leaq 0x24327(%rip), %rsi     # 0x27012
leaq 0x2432e(%rip), %rcx     # 0x27020
pushq $0x19
jmp 0x2cbe
// File: /workspace/github_cpp_makefile_star2_O2/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 0xf8131(%rip), %r15     # 0xfb598
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 0xd4d8
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_O2/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 0xf80ac(%rip), %r14     # 0xfb598
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 0xd4d8
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
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3582
cmpl $0x40, %esi
jae 0x359b
cmpl $0x2, %edx
jae 0x35b4
xorl %eax, %eax
cmpl $0x1, %edx
setne %al
movl %esi, %ecx
leaq 0xfa13f(%rip), %rdx     # 0xfd6b0
movq 0x168(%rdi,%rax,8), %rax
testq %rax, (%rdx,%rcx,8)
setne %al
popq %rcx
retq
leaq 0x2fe36(%rip), %rdi     # 0x333bf
leaq 0x23c38(%rip), %rsi     # 0x271c8
leaq 0x23c40(%rip), %rcx     # 0x271d7
pushq $0xf
jmp 0x35cb
leaq 0x23c6c(%rip), %rdi     # 0x2720e
leaq 0x23c1f(%rip), %rsi     # 0x271c8
leaq 0x23c27(%rip), %rcx     # 0x271d7
pushq $0x10
jmp 0x35cb
leaq 0x23c68(%rip), %rdi     # 0x27223
leaq 0x23c06(%rip), %rsi     # 0x271c8
leaq 0x23c0e(%rip), %rcx     # 0x271d7
pushq $0x11
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x360d
cmpl $0x40, %esi
jae 0x3626
cmpl $0x2, %edx
jae 0x363f
xorl %eax, %eax
cmpl $0x1, %edx
setne %al
movl %esi, %ecx
leaq 0xfa2be(%rip), %rdx     # 0xfd8b0
movl 0x14c(%rdi,%rax,4), %eax
leaq 0xf9eb0(%rip), %rsi     # 0xfd4b0
movq (%rsi,%rax,8), %rax
testq %rax, (%rdx,%rcx,8)
setne %al
popq %rcx
retq
leaq 0x2fdab(%rip), %rdi     # 0x333bf
leaq 0x23bad(%rip), %rsi     # 0x271c8
leaq 0x23c20(%rip), %rcx     # 0x27242
pushq $0x17
jmp 0x3656
leaq 0x23be1(%rip), %rdi     # 0x2720e
leaq 0x23b94(%rip), %rsi     # 0x271c8
leaq 0x23c07(%rip), %rcx     # 0x27242
pushq $0x18
jmp 0x3656
leaq 0x23bdd(%rip), %rdi     # 0x27223
leaq 0x23b7b(%rip), %rsi     # 0x271c8
leaq 0x23bee(%rip), %rcx     # 0x27242
pushq $0x19
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3742
cmpl $0x40, %esi
jae 0x375b
cmpl $0x2, %edx
jae 0x3774
leaq 0xf9d57(%rip), %r8      # 0xfd430
movq (%r8), %r9
notq %r9
movl %esi, %eax
leaq 0xf9dc8(%rip), %rcx     # 0xfd4b0
movq (%rcx,%rax,8), %rcx
cmpl $0x1, %edx
jne 0x3716
movq 0x158(%rdi), %rdx
andq %rdx, %r9
shrq $0x9, %r9
movb $0x1, %al
testq %rcx, %r9
jne 0x3740
movq 0x38(%r8), %rsi
notq %rsi
andq %rsi, %rdx
shrq $0x7, %rdx
jmp 0x3739
movq 0x160(%rdi), %rdx
andq %rdx, %r9
shlq $0x7, %r9
movb $0x1, %al
testq %rcx, %r9
jne 0x3740
movq 0x38(%r8), %rsi
notq %rsi
andq %rsi, %rdx
shlq $0x9, %rdx
testq %rcx, %rdx
jne 0x3740
xorl %eax, %eax
popq %rcx
retq
leaq 0x2fc76(%rip), %rdi     # 0x333bf
leaq 0x23a78(%rip), %rsi     # 0x271c8
leaq 0x23b20(%rip), %rcx     # 0x27277
pushq $0x2f
jmp 0x378b
leaq 0x23aac(%rip), %rdi     # 0x2720e
leaq 0x23a5f(%rip), %rsi     # 0x271c8
leaq 0x23b07(%rip), %rcx     # 0x27277
pushq $0x30
jmp 0x378b
leaq 0x23aa8(%rip), %rdi     # 0x27223
leaq 0x23a46(%rip), %rsi     # 0x271c8
leaq 0x23aee(%rip), %rcx     # 0x27277
pushq $0x31
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
callq 0x36b6
testb %al, %al
jne 0x37e5
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x3550
testb %al, %al
jne 0x37e5
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x35d1
testb %al, %al
jne 0x37e5
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x365c
testb %al, %al
jne 0x37e5
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x367a
testb %al, %al
je 0x37ec
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x3698
// File: /workspace/github_cpp_makefile_star2_O2/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 0xf9e9a(%rip), %rax     # 0xfd6b0
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
leaq 0xf9c8a(%rip), %r9      # 0xfd4b0
movq (%r9,%rcx,8), %rdi
leaq 0xf9bff(%rip), %r8      # 0xfd430
movq (%r8), %rax
movq 0x38(%r8), %r13
notq %rax
andq %rdi, %rax
notq %r13
andq %rdi, %r13
xorl %edi, %edi
leaq 0xfa063(%rip), %r8      # 0xfd8b0
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 0x389c
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 0x38be
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 0x62e4
movq %rax, %r15
movq (%r14,%r12), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x63e8
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 0x63b6
orq %r12, %rax
orq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/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 0x395f
xorl %eax, %eax
leaq 0xf9b67(%rip), %rdx     # 0xfd4b0
xorl %ecx, %ecx
cmpq $0x40, %rcx
je 0x395e
testq %rdi, (%rdx,%rcx,8)
jne 0x395c
incq %rcx
jmp 0x394b
movl %ecx, %eax
retq
pushq %rax
leaq 0x23959(%rip), %rdi     # 0x272c0
leaq 0x2395a(%rip), %rsi     # 0x272c8
leaq 0x23965(%rip), %rcx     # 0x272da
pushq $0x1c
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x39dc
movq %rdi, %rax
andq $0xffff, %rax           # imm = 0xFFFF
je 0x3998
leaq 0x41b0c(%rip), %rcx     # 0x454a0
movl (%rcx,%rax,4), %eax
retq
movl %edi, %eax
shrl $0x10, %eax
je 0x39ad
leaq 0x41afa(%rip), %rcx     # 0x454a0
movl (%rcx,%rax,4), %eax
addl $0x10, %eax
retq
movq %rdi, %rax
shrq $0x20, %rax
andq $0xffff, %rax           # imm = 0xFFFF
je 0x39ca
leaq 0x41add(%rip), %rcx     # 0x454a0
movl (%rcx,%rax,4), %eax
addl $0x20, %eax
retq
shrq $0x30, %rdi
leaq 0x41acb(%rip), %rax     # 0x454a0
movl (%rax,%rdi,4), %eax
addl $0x30, %eax
retq
pushq %rax
leaq 0x238dc(%rip), %rdi     # 0x272c0
leaq 0x238dd(%rip), %rsi     # 0x272c8
leaq 0x23904(%rip), %rcx     # 0x272f6
pushq $0x28
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3a26
pushq $0x3f
popq %rax
pushq $-0x1
popq %rcx
leaq 0xf9aa4(%rip), %rdx     # 0xfd4b0
testl %eax, %eax
js 0x3a1e
movl %eax, %esi
testq %rdi, (%rdx,%rsi,8)
jne 0x3a1c
decl %eax
jmp 0x3a0c
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovgl %ecx, %eax
retq
pushq %rax
leaq 0x23892(%rip), %rdi     # 0x272c0
leaq 0x23893(%rip), %rsi     # 0x272c8
leaq 0x238d1(%rip), %rcx     # 0x2730d
pushq $0x3d
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3a9d
movq %rdi, %rax
shrq $0x30, %rax
jne 0x3a6f
movq %rdi, %rax
shrq $0x20, %rax
jne 0x3a7d
cmpq $0x10000, %rdi          # imm = 0x10000
jae 0x3a8b
leaq 0x81a35(%rip), %rax     # 0x854a0
movl (%rax,%rdi,4), %eax
retq
leaq 0x81a2a(%rip), %rcx     # 0x854a0
movl (%rcx,%rax,4), %eax
addl $0x30, %eax
retq
leaq 0x81a1c(%rip), %rcx     # 0x854a0
movl (%rcx,%rax,4), %eax
addl $0x20, %eax
retq
shrq $0x10, %rdi
leaq 0x81a0a(%rip), %rax     # 0x854a0
movl (%rax,%rdi,4), %eax
addl $0x10, %eax
retq
pushq %rax
leaq 0x2381b(%rip), %rdi     # 0x272c0
leaq 0x2381c(%rip), %rsi     # 0x272c8
leaq 0x23876(%rip), %rcx     # 0x27329
pushq $0x49
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 0xf99ec(%rip), %rdx     # 0xfd4b0
xorl %r8d, %r8d
cmpq $0x40, %rcx
je 0x3ae3
movq (%rdx,%rcx,8), %rax
testq %rdi, %rax
je 0x3ade
cmpl %esi, %r8d
je 0x3ae5
incl %r8d
incq %rcx
jmp 0x3ac7
xorl %eax, %eax
retq