LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/Residue.cpp
// Function: Residue::SetBBAtoms()
int Residue::SetBBAtoms() {

	bool flN = false, flCA = false, flC = false, flO = false, flCB = false;

	for (int i = 0; i < nAtoms; i++) {
		if (strcmp(atom[i].name, "N") == 0) {
			N = &(atom[i]);
			flN = true;
		} else if (strcmp(atom[i].name, "CA") == 0) {
			CA = &(atom[i]);
			flCA = true;
		} else if (strcmp(atom[i].name, "CB") == 0) {
			CB = &(atom[i]);
			flCB = true;
		} else if (strcmp(atom[i].name, "C") == 0) {
			C = &(atom[i]);
			flC = true;
		} else if (strcmp(atom[i].name, "O") == 0
				|| strcmp(atom[i].name, "OXT") == 0) {
			O = &(atom[i]);
			flO = true;
		} else if (strcmp(atom[i].name, "H1") == 0) {
			ntFlag = true;
		} else if (strcmp(atom[i].name, "H2") == 0) {
			ntFlag = true;
		} else if (strcmp(atom[i].name, "H3") == 0) {
			ntFlag = true;
		} else if (strcmp(atom[i].name, "OXT") == 0) {
			ctFlag = true;
		}
	}

	int n = flN + flCA + flC + flO + flCB;

	return n;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movslq 0x18(%rdi), %r13
testq %r13, %r13
jle 0x13f1d
movq %rdi, %rbx
movq 0x10(%rdi), %r14
addq $0x4, %r14
movl $0x0, 0x14(%rsp)
movl $0x0, 0x8(%rsp)
xorl %ebp, %ebp
movl $0x0, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
leaq -0x4(%r14), %r12
movzbl (%r14), %r15d
cmpl $0x43, %r15d
je 0x13e33
cmpl $0x4f, %r15d
je 0x13e0f
cmpl $0x4e, %r15d
jne 0x13e5e
cmpb $0x0, 0x1(%r14)
jne 0x13e5e
movq %r12, 0x160(%rbx)
movb $0x1, %al
movl %eax, 0x14(%rsp)
jmp 0x13eb4
cmpb $0x0, 0x1(%r14)
je 0x13eaa
movq %r14, %rdi
leaq 0x8d40(%rip), %rsi      # 0x1cb64
callq 0x22e0
testl %eax, %eax
jne 0x13eb4
jmp 0x13eaa
cmpb $0x41, 0x1(%r14)
jne 0x13e45
cmpb $0x0, 0x2(%r14)
je 0x13ed2
cmpb $0x42, 0x1(%r14)
jne 0x13e57
cmpb $0x0, 0x2(%r14)
je 0x13ee1
cmpb $0x0, 0x1(%r14)
je 0x13ec3
movq %r14, %rdi
leaq 0x8cfc(%rip), %rsi      # 0x1cb64
callq 0x22e0
testl %eax, %eax
je 0x13eaa
cmpb $0x48, %r15b
jne 0x13eb4
cmpb $0x31, 0x1(%r14)
jne 0x13e85
cmpb $0x0, 0x2(%r14)
je 0x13ea1
cmpb $0x32, 0x1(%r14)
jne 0x13e93
cmpb $0x0, 0x2(%r14)
je 0x13ea1
cmpb $0x33, 0x1(%r14)
jne 0x13eb4
cmpb $0x0, 0x2(%r14)
jne 0x13eb4
movb $0x1, 0x158(%rbx)
jmp 0x13eb4
movq %r12, 0x178(%rbx)
movb $0x1, %bpl
addq $0x60, %r14
decq %r13
jne 0x13ddc
jmp 0x13ef0
movq %r12, 0x170(%rbx)
movb $0x1, %al
movl %eax, 0x10(%rsp)
jmp 0x13eb4
movq %r12, 0x168(%rbx)
movb $0x1, %al
movl %eax, 0xc(%rsp)
jmp 0x13eb4
movq %r12, 0x180(%rbx)
movb $0x1, %al
movl %eax, 0x8(%rsp)
jmp 0x13eb4
movl 0x14(%rsp), %eax
andb $0x1, %al
movl 0xc(%rsp), %ecx
andb $0x1, %cl
movl 0x10(%rsp), %edx
andb $0x1, %dl
addb %cl, %dl
andb $0x1, %bpl
movl 0x8(%rsp), %ecx
andb $0x1, %cl
addb %bpl, %cl
addb %dl, %cl
addb %al, %cl
movzbl %cl, %eax
jmp 0x13f1f
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/Residue.cpp
// Function: Residue::SetCentroid()
void Residue::SetCentroid() {

	centroid[0] = centroid[1] = centroid[2] = 0.0;

	if (type == 7 /* GLY */) {
		centroid[0] = CA->x;
		centroid[1] = CA->y;
		centroid[2] = CA->z;
	} else /* other residues */{
		for (int j = 0; j < nAtoms; j++) {
			centroid[0] += atom[j].x;
			centroid[1] += atom[j].y;
			centroid[2] += atom[j].z;
		}
		centroid[0] /= nAtoms;
		centroid[1] /= nAtoms;
		centroid[2] /= nAtoms;
	}

}

// Assembly:
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rdi)
movq $0x0, 0x30(%rdi)
cmpb $0x7, (%rdi)
jne 0x14208
movq 0x168(%rdi), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x20(%rdi)
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x28(%rdi)
movsd 0x20(%rax), %xmm1
jmp 0x14281
leaq 0x20(%rdi), %rax
movslq 0x18(%rdi), %rcx
testq %rcx, %rcx
jle 0x14266
movq 0x10(%rdi), %rdx
movq %rcx, %rsi
shlq $0x5, %rsi
leaq (%rsi,%rsi,2), %rsi
xorpd %xmm0, %xmm0
xorl %r8d, %r8d
xorpd %xmm2, %xmm2
xorpd %xmm1, %xmm1
addsd 0x10(%rdx,%r8), %xmm0
movsd %xmm0, 0x20(%rdi)
addsd 0x18(%rdx,%r8), %xmm2
movsd %xmm2, 0x28(%rdi)
addsd 0x20(%rdx,%r8), %xmm1
movsd %xmm1, 0x30(%rdi)
addq $0x60, %r8
cmpq %r8, %rsi
jne 0x14233
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
jmp 0x1426a
xorpd %xmm1, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
divsd %xmm2, %xmm1
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm0
movupd %xmm0, (%rax)
movsd %xmm1, 0x30(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/Residue.cpp
// Function: Residue::operator=(Residue const&)
Residue & Residue::operator =(const Residue & source) {

	assert(this != &source); /* an attempt to assign Residue to itself */

	type = source.type;
	strcpy(name, source.name);
	seqNum = source.seqNum;
	insCode = source.insCode;
	nAtoms = source.nAtoms;
	chainId = source.chainId;

	delete[] atom;

	atom = new Atom[nAtoms];
	for (int i = 0; i < nAtoms; i++) {
		atom[i] = source.atom[i];
		atom[i].residue = this;
	}

	SetBBAtoms();

	memcpy(centroid, source.centroid, 3 * sizeof(double));

	return *this;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq %rsi, %rdi
je 0x14a5e
movq %rsi, %r14
movq %rdi, %rbx
movb (%rsi), %al
movb %al, (%rdi)
incq %rdi
incq %rsi
callq 0x21e0
movl 0x8(%r14), %eax
movl %eax, 0x8(%rbx)
movb 0xc(%r14), %al
movb %al, 0xc(%rbx)
movl 0x18(%r14), %eax
movl %eax, 0x18(%rbx)
movb 0x1c(%r14), %cl
movb %cl, 0x1c(%rbx)
movq 0x10(%rbx), %r12
testq %r12, %r12
je 0x14986
leaq -0x8(%r12), %r15
movq -0x8(%r12), %r13
testq %r13, %r13
je 0x1496c
addq $-0x60, %r12
movq %r13, %rax
shlq $0x5, %rax
leaq (%rax,%rax,2), %rbp
leaq (%r12,%rbp), %rdi
callq 0xe546
addq $-0x60, %rbp
jne 0x1495d
shlq $0x5, %r13
leaq 0x8(,%r13,2), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x23c0
movl 0x18(%rbx), %eax
movslq %eax, %rbp
movl $0x60, %ecx
movq %rbp, %rax
mulq %rcx
seto %cl
orq $0x8, %rax
movq $-0x1, %r15
testb %cl, %cl
cmoveq %rax, %r15
movq %r15, %rdi
callq 0x2030
movq %rbp, (%rax)
leaq 0x8(%rax), %r12
testl %ebp, %ebp
je 0x14a2f
movq %rax, 0x8(%rsp)
movq %r15, 0x10(%rsp)
shlq $0x5, %rbp
leaq (,%rbp,2), %r15
addq %rbp, %r15
negq %r15
xorl %r13d, %r13d
movq %r12, %rbp
movq %rbp, %rdi
callq 0xe404
addq $-0x60, %r13
addq $0x60, %rbp
cmpq %r13, %r15
jne 0x149dd
cmpl $0x0, 0x18(%rbx)
movq %r12, 0x10(%rbx)
jle 0x14a33
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x10(%r14), %rsi
addq %r15, %rsi
addq %r15, %r12
movq %r12, %rdi
callq 0xe548
movq 0x10(%rbx), %r12
movq %rbx, 0x40(%r12,%r15)
incq %r13
movslq 0x18(%rbx), %rax
addq $0x60, %r15
cmpq %rax, %r13
jl 0x14a02
jmp 0x14a33
movq %r12, 0x10(%rbx)
movq %rbx, %rdi
callq 0x13d94
movups 0x20(%r14), %xmm0
movups %xmm0, 0x20(%rbx)
movq 0x30(%r14), %rax
movq %rax, 0x30(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x840f(%rip), %rdi      # 0x1ce74
leaq 0xc553(%rip), %rsi      # 0x20fbf
leaq 0xc607(%rip), %rcx      # 0x2107a
movl $0x9f, %edx
callq 0x2160
movq %rax, %rbx
testq %r13, %r13
je 0x14aa0
negq %r13
movq 0x8(%rsp), %r14
addq $-0x58, %r14
leaq (%r14,%r13), %rdi
callq 0xe546
addq $-0x60, %r13
jne 0x14a91
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x23c0
movq %rbx, %rdi
callq 0x2380
nop
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/Complex.cpp
// Function: Complex::Complex(Complex const&)
Complex::Complex(const Complex & C) :
		contacts(C.contacts), intRec(NULL), intLig(NULL), intRecN(C.intRecN), intLigN(
				C.intLigN), Receptor(C.Receptor), Ligand(C.Ligand) {

	AllocateComplex();

	/* copy interface residues */
	memcpy(intRec, C.intRec, Receptor.nRes * sizeof(bool));
	memcpy(intLig, C.intLig, Ligand.nRes * sizeof(bool));

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x161ce
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movq 0x28(%r14), %rax
movq %rax, 0x28(%rbx)
leaq 0x30(%rbx), %r15
leaq 0x30(%r14), %rsi
movq %r15, %rdi
callq 0xf306
movl $0xa0, %esi
leaq (%rbx,%rsi), %rdi
addq %r14, %rsi
callq 0xf306
movslq 0x78(%rbx), %r15
movq %r15, %rdi
callq 0x22c0
movq %rax, %r12
movq %rax, 0x18(%rbx)
movslq 0xe8(%rbx), %r13
movq %r13, %rdi
callq 0x22c0
movq %rax, %rbp
movq %rax, 0x20(%rbx)
movq 0x18(%r14), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x21b0
movq 0x20(%r14), %rsi
movq %rbp, %rdi
movq %r13, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0
movq %rax, %r14
movq %r15, %rdi
callq 0xf4e0
jmp 0x152ef
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x15303
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x2380
nop
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/Complex.cpp
// Function: Complex::operator=(Complex const&)
Complex & Complex::operator =(const Complex & C) {

	assert(this != &C); /* error: an attempt to assign Complex to itself */

	FreeComplex();

	/* copy proteins */
	Receptor = C.Receptor;
	Ligand = C.Ligand;

	AllocateComplex();

	/* copy interface residues and contacts */
	contacts = C.contacts;
	memcpy(intRec, C.intRec, Receptor.nRes * sizeof(bool));
	memcpy(intLig, C.intLig, Ligand.nRes * sizeof(bool));
	intRecN = C.intRecN;
	intLigN = C.intLigN;

	return *this;

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq %rsi, %rdi
je 0x15535
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x2260
movq 0x20(%rbx), %rdi
callq 0x2260
leaq 0x30(%r14), %rsi
leaq 0x30(%rbx), %rdi
callq 0xf5ca
movl $0xa0, %edi
leaq (%r14,%rdi), %rsi
addq %rbx, %rdi
callq 0xf5ca
movslq 0x78(%rbx), %rdi
callq 0x22c0
movq %rax, 0x18(%rbx)
movslq 0xe8(%rbx), %rdi
callq 0x22c0
movq %rax, 0x20(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x16244
movq 0x18(%rbx), %rdi
movq 0x18(%r14), %rsi
movslq 0x78(%rbx), %rdx
callq 0x21b0
movq 0x20(%rbx), %rdi
movq 0x20(%r14), %rsi
movslq 0xe8(%rbx), %rdx
callq 0x21b0
movq 0x28(%r14), %rax
movq %rax, 0x28(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xed94(%rip), %rdi      # 0x242d0
leaq 0xed98(%rip), %rsi      # 0x242db
leaq 0xeda1(%rip), %rcx      # 0x242eb
movl $0x3b, %edx
callq 0x2160
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/Complex.cpp
// Function: Complex::ArrangeContatcs()
void Complex::ArrangeContatcs() {

	std::sort(contacts.begin(), contacts.end());
	std::vector<std::pair<int, int> >::iterator it;
	it = std::unique(contacts.begin(), contacts.end());
	contacts.resize(it - contacts.begin());

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r15
movq 0x8(%rdi), %r14
cmpq %r14, %r15
je 0x15782
movq %r14, %rax
subq %r15, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x164fd
movq %r15, %rdi
movq %r14, %rsi
callq 0x165b0
movq (%rbx), %r15
movq 0x8(%rbx), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x16973
subq (%rbx), %rax
sarq $0x3, %rax
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x1634e
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/Complex.cpp
// Function: Complex::SetInterface2(double)
void Complex::SetInterface2(double d) {

	/* search for interface residues */
	kdres *res;
	double pos[3];
	for (int i = 0; i < Ligand.nRes; i++) {

		Atom *A = Ligand.residue[i].CA;

		if (A == NULL) {
			continue;
		}

		/* check whether the current atom is within the bounding box
		 * of the Receptor */
		kdtree *kdCA = Receptor.kdCA;
		if (A->x < kdCA->rect->min[0] - d || A->y < kdCA->rect->min[1] - d
				|| A->z < kdCA->rect->min[2] - d
				|| A->x > kdCA->rect->max[0] + d
				|| A->y > kdCA->rect->max[1] + d
				|| A->z > kdCA->rect->max[2] + d) {

			continue;

		}

		/* find neighbors of A in the Receptor */
		res = kd_nearest_range3f(kdCA, A->x, A->y, A->z, d);
		while (!kd_res_end(res)) {
			//int idx = (Residue*) kd_res_item(res, pos) - Receptor.residues;
			Atom *A = (Atom*) kd_res_item(res, pos);
			int idx = A->residue - Receptor.residue;
			intRec[idx] = true;
			intLig[i] = true;
			contacts.push_back(std::make_pair(idx, i));
			kd_res_next(res);
		}
		kd_res_free(res);

	}

	ArrangeContatcs();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl 0xe8(%rdi), %eax
testl %eax, %eax
jle 0x15942
cvtsd2ss %xmm0, %xmm3
xorl %r13d, %r13d
leaq 0x20(%rsp), %r15
movabsq $0x7d6343eb1a1f58d1, %rbp # imm = 0x7D6343EB1A1F58D1
movq 0xe0(%rbx), %rcx
imulq $0x188, %r13, %rdx      # imm = 0x188
movq 0x168(%rcx,%rdx), %rdx
testq %rdx, %rdx
je 0x15933
movq 0x88(%rbx), %rdi
movsd 0x10(%rdx), %xmm4
movq 0x10(%rdi), %rcx
movq 0x8(%rcx), %rsi
movsd (%rsi), %xmm1
subsd %xmm0, %xmm1
ucomisd %xmm4, %xmm1
ja 0x15933
movsd 0x18(%rdx), %xmm1
movsd 0x8(%rsi), %xmm2
subsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
ja 0x15933
movsd 0x20(%rdx), %xmm2
movsd 0x10(%rsi), %xmm5
subsd %xmm0, %xmm5
ucomisd %xmm2, %xmm5
ja 0x15933
movq 0x10(%rcx), %rcx
movsd (%rcx), %xmm5
addsd %xmm0, %xmm5
ucomisd %xmm5, %xmm4
ja 0x15933
movsd 0x8(%rcx), %xmm5
addsd %xmm0, %xmm5
ucomisd %xmm5, %xmm1
ja 0x15933
movsd 0x10(%rcx), %xmm5
addsd %xmm0, %xmm5
ucomisd %xmm5, %xmm2
ja 0x15933
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
cvtsd2ss %xmm4, %xmm0
cvtsd2ss %xmm1, %xmm1
cvtsd2ss %xmm2, %xmm2
movss %xmm3, 0xc(%rsp)
callq 0x17fd5
movq %rax, %r12
movq %rax, %rdi
callq 0x18006
testl %eax, %eax
jne 0x15919
movq %r13, %r14
shlq $0x20, %r14
movq %r12, %rdi
movq %r15, %rsi
callq 0x18026
movq 0x40(%rax), %rax
subq 0x70(%rbx), %rax
sarq $0x3, %rax
imulq %rbp, %rax
movq 0x18(%rbx), %rcx
cltq
movb $0x1, %dl
movb %dl, (%rcx,%rax)
movq 0x20(%rbx), %rcx
movb %dl, (%rcx,%r13)
movl %eax, %eax
orq %r14, %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
leaq 0x18(%rsp), %rsi
callq 0x1639c
movq %r12, %rdi
callq 0x18011
movq %r12, %rdi
callq 0x18006
testl %eax, %eax
je 0x158c0
movq %r12, %rdi
callq 0x17a3c
movl 0xe8(%rbx), %eax
movsd 0x10(%rsp), %xmm0
movss 0xc(%rsp), %xmm3
incq %r13
movslq %eax, %rcx
cmpq %rcx, %r13
jl 0x157d9
movq %rbx, %rdi
callq 0x1573a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/Complex.cpp
// Function: Complex::SetInterface4(double)
void Complex::SetInterface4(double d) {

	/* search for interface residues */
	double pos[3];
	kdtree *kd = Receptor.kdCent;
	double *min = kd->rect->min;
	double *max = kd->rect->max;
	for (int i = 0; i < Ligand.nRes; i++) {

		double *xyz = Ligand.residue[i].centroid;

		/* check whether the current atom is within the bounding box
		 * of the Receptor */
		if (xyz[0] < min[0] - d || xyz[1] < min[1] - d || xyz[2] < min[2] - d
				|| xyz[0] > max[0] + d || xyz[1] > max[1] + d
				|| xyz[2] > max[2] + d) {

			continue;

		}

		/* find neighbors of A in the Receptor */
		kdres *res = kd_nearest_range(kd, xyz, d);
		while (!kd_res_end(res)) {
			//int idxRec = (Residue*) kd_res_item(res, pos) - Receptor.residues;
			Atom *A = (Atom*) kd_res_item(res, pos);
			int idxRec = A->residue - Receptor.residue;
			intRec[idxRec] = true;
			intLig[i] = true;
			contacts.push_back(std::make_pair(idxRec, i));
			kd_res_next(res);
		}
		kd_res_free(res);

	}

	ArrangeContatcs();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl 0xe8(%rdi), %eax
testl %eax, %eax
jle 0x15da7
movq 0x90(%rbx), %rdi
movq 0x10(%rdi), %rcx
movq 0x8(%rcx), %rbp
movq 0x10(%rcx), %r8
xorl %r15d, %r15d
leaq 0x20(%rsp), %r14
movq 0xe0(%rbx), %rcx
imulq $0x188, %r15, %rdx      # imm = 0x188
movsd 0x20(%rcx,%rdx), %xmm4
movsd (%rbp), %xmm1
subsd %xmm0, %xmm1
ucomisd %xmm4, %xmm1
ja 0x15d98
leaq (%rcx,%rdx), %rsi
addq $0x20, %rsi
movsd 0x8(%rsi), %xmm1
movsd 0x8(%rbp), %xmm2
subsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
ja 0x15d98
movsd 0x10(%rsi), %xmm2
movsd 0x10(%rbp), %xmm3
subsd %xmm0, %xmm3
ucomisd %xmm2, %xmm3
ja 0x15d98
movsd (%r8), %xmm3
addsd %xmm0, %xmm3
ucomisd %xmm3, %xmm4
ja 0x15d98
movsd 0x8(%r8), %xmm3
addsd %xmm0, %xmm3
ucomisd %xmm3, %xmm1
ja 0x15d98
movsd 0x10(%r8), %xmm1
addsd %xmm0, %xmm1
ucomisd %xmm1, %xmm2
ja 0x15d98
movq %r8, (%rsp)
movq %rdi, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
callq 0x17d1a
movq %rax, %r13
movq %rax, %rdi
callq 0x18006
testl %eax, %eax
jne 0x15d7b
movq %r15, %r12
shlq $0x20, %r12
movq %r13, %rdi
movq %r14, %rsi
callq 0x18026
movq 0x40(%rax), %rax
subq 0x70(%rbx), %rax
sarq $0x3, %rax
movabsq $0x7d6343eb1a1f58d1, %rcx # imm = 0x7D6343EB1A1F58D1
imulq %rcx, %rax
movq 0x18(%rbx), %rcx
cltq
movb $0x1, %dl
movb %dl, (%rcx,%rax)
movq 0x20(%rbx), %rcx
movb %dl, (%rcx,%r15)
movl %eax, %eax
orq %r12, %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
leaq 0x18(%rsp), %rsi
callq 0x1639c
movq %r13, %rdi
callq 0x18011
movq %r13, %rdi
callq 0x18006
testl %eax, %eax
je 0x15d18
movq %r13, %rdi
callq 0x17a3c
movl 0xe8(%rbx), %eax
movsd 0x10(%rsp), %xmm0
movq 0x8(%rsp), %rdi
movq (%rsp), %r8
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x15c54
movq %rbx, %rdi
callq 0x1573a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/Complex.cpp
// Function: Complex::CountIntRes()
void Complex::CountIntRes() {

	intRecN = 0;
	for (int i = 0; i < Receptor.nRes; i++) {
		if (intRec[i]) {
			intRecN++;
		}
	}

	intLigN = 0;
	for (int i = 0; i < Ligand.nRes; i++) {
		if (intLig[i]) {
			intLigN++;
		}
	}

}

// Assembly:
movl $0x0, 0x28(%rdi)
movslq 0x78(%rdi), %rax
testq %rax, %rax
jle 0x160c3
movq 0x18(%rdi), %rcx
xorl %edx, %edx
xorl %esi, %esi
cmpb $0x1, (%rcx,%rdx)
jne 0x160bb
incl %esi
movl %esi, 0x28(%rdi)
incq %rdx
cmpq %rdx, %rax
jne 0x160b0
movl $0x0, 0x2c(%rdi)
movslq 0xe8(%rdi), %rax
testq %rax, %rax
jle 0x160f1
movq 0x20(%rdi), %rcx
xorl %edx, %edx
xorl %esi, %esi
cmpb $0x1, (%rcx,%rdx)
jne 0x160e9
incl %esi
movl %esi, 0x2c(%rdi)
incq %rdx
cmpq %rdx, %rax
jne 0x160de
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/Complex.cpp
// Function: Complex::SetInterface(double, int)
void Complex::SetInterface(double dist, int mode) {

	contacts.clear();
	memset(intRec, 0, Receptor.nRes * sizeof(bool));
	memset(intLig, 0, Ligand.nRes * sizeof(bool));

	if (mode == 1) {
		SetInterface1(dist);
	} else if (mode == 2) {
		SetInterface2(dist);
	} else if (mode == 3) {
		SetInterface3(dist);
	} else if (mode == 4) {
		SetInterface4(dist);
	} else if (mode == 5) {
		SetInterface5(dist);
	} else {
		assert(0); /* error: wrong mode for interface extraction */
	}

	CountIntRes();

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movsd %xmm0, (%rsp)
movq %rdi, %rbx
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0x1610e
movq %rax, 0x8(%rbx)
movq 0x18(%rbx), %rdi
movslq 0x78(%rbx), %rdx
xorl %esi, %esi
callq 0x2150
movq 0x20(%rbx), %rdi
movslq 0xe8(%rbx), %rdx
xorl %esi, %esi
callq 0x2150
decl %r14d
cmpl $0x4, %r14d
ja 0x161a0
leaq 0xaf71(%rip), %rax      # 0x210b0
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rbx, %rdi
movsd (%rsp), %xmm0
callq 0x15554
jmp 0x16191
movq %rbx, %rdi
movsd (%rsp), %xmm0
callq 0x15dbe
jmp 0x16191
movq %rbx, %rdi
movsd (%rsp), %xmm0
callq 0x1595a
jmp 0x16191
movq %rbx, %rdi
movsd (%rsp), %xmm0
callq 0x15c1a
jmp 0x16191
movq %rbx, %rdi
movsd (%rsp), %xmm0
callq 0x157a4
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x16098
leaq 0xae16(%rip), %rdi      # 0x20fbd
leaq 0xe12d(%rip), %rsi      # 0x242db
leaq 0xe163(%rip), %rcx      # 0x24318
movl $0x1a0, %edx            # imm = 0x1A0
callq 0x2160
nop
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_clear
void kd_clear(struct kdtree *tree)
{
	clear_rec(tree->root, tree->destr);
	tree->root = 0;

	if (tree->rect) {
		hyperrect_free(tree->rect);
		tree->rect = 0;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq 0x18(%rbx), %rsi
callq 0x1758e
movq $0x0, 0x8(%rbx)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x1758c
callq 0x175d6
movq $0x0, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: clear_rec(kdnode*, void (*)(void*))
static void clear_rec(struct kdnode *node, void (*destr)(void*))
{
	if(!node) return;

	clear_rec(node->left, destr);
	clear_rec(node->right, destr);
	
	if(destr) {
		destr(node->data);
	}
	free(node->pos);
	free(node);
}

// Assembly:
testq %rdi, %rdi
je 0x175d5
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x1758e
movq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x1758e
testq %r14, %r14
je 0x175be
movq 0x10(%rbx), %rdi
callq *%r14
movq (%rbx), %rdi
callq 0x2260
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2260
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_insert
int kd_insert(struct kdtree *tree, const double *pos, void *data)
{
	if (insert_rec(&tree->root, pos, data, 0, tree->dim)) {
		return -1;
	}

	if (tree->rect == 0) {
		tree->rect = hyperrect_create(tree->dim, pos, pos);
	} else {
		hyperrect_extend(tree->rect, pos);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movslq (%rdi), %rbp
movq 0x8(%rdi), %rdx
testq %rdx, %rdx
je 0x17658
movq %rdx, %r15
movslq 0x8(%rdx), %rax
movq (%rdx), %rcx
movsd (%rcx,%rax,8), %xmm0
xorl %ecx, %ecx
ucomisd (%rbx,%rax,8), %xmm0
setbe %cl
movq 0x18(%rdx,%rcx,8), %rdx
testq %rdx, %rdx
jne 0x1761f
leaq 0x18(,%rcx,8), %rcx
addq %rcx, %r15
incl %eax
cltd
idivl %ebp
movl %edx, 0x4(%rsp)
jmp 0x17664
leaq 0x8(%r14), %r15
movl $0x0, 0x4(%rsp)
movl $0x28, %edi
callq 0x22c0
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x17739
movq %rax, %r12
movq %rbp, 0x8(%rsp)
leaq (,%rbp,8), %rbp
movq %rbp, %rdi
callq 0x22c0
movq %rax, (%r12)
testq %rax, %rax
je 0x17718
movq %rax, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x21b0
movq 0x10(%rsp), %rax
movq %rax, 0x10(%r12)
movl 0x4(%rsp), %eax
movl %eax, 0x8(%r12)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%r12)
movq %r12, (%r15)
movq 0x10(%r14), %rdx
testq %rdx, %rdx
je 0x17722
movslq (%rdx), %rax
testq %rax, %rax
jle 0x17736
movq 0x8(%rdx), %rcx
movq 0x10(%rdx), %rdx
xorl %esi, %esi
movsd (%rbx,%rsi,8), %xmm0
movsd (%rcx,%rsi,8), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x17702
movsd %xmm0, (%rcx,%rsi,8)
movsd (%rbx,%rsi,8), %xmm0
ucomisd (%rdx,%rsi,8), %xmm0
jbe 0x1770e
movsd %xmm0, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x176e8
jmp 0x17736
movq %r12, %rdi
callq 0x2260
jmp 0x17739
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x1774b
movq %rax, 0x10(%r14)
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: hyperrect_create(int, double const*, double const*)
static struct kdhyperrect* hyperrect_create(int dim, const double *min, const double *max)
{
	size_t size = dim * sizeof(double);
	struct kdhyperrect* rect = 0;

	if (!(rect = (kdhyperrect*)malloc(sizeof(struct kdhyperrect)))) {	// (kdhyperrect*) added
		return 0;
	}

	rect->dim = dim;
	if (!(rect->min = (double*)malloc(size))) {	// (double*) added
		free(rect);
		return 0;
	}
	if (!(rect->max = (double*)malloc(size))) {	// (double*) added
		free(rect->min);
		free(rect);
		return 0;
	}
	memcpy(rect->min, min, size);
	memcpy(rect->max, max, size);

	return rect;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movl $0x18, %edi
callq 0x22c0
testq %rax, %rax
je 0x177d3
movq %rax, %rbx
movslq %ebp, %rax
leaq (,%rax,8), %r12
movl %eax, (%rbx)
movq %r12, %rdi
callq 0x22c0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x177cb
movq %rax, %r13
movq %r12, %rdi
callq 0x22c0
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x177c3
movq %rax, %rbp
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21b0
movq %rbp, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x21b0
jmp 0x177d5
movq %r13, %rdi
callq 0x2260
movq %rbx, %rdi
callq 0x2260
xorl %ebx, %ebx
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_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_insertf
int kd_insertf(struct kdtree *tree, const float *pos, void *data)
{
	static double sbuf[16];
	double *bptr, *buf = 0;
	int res, dim = tree->dim;

	if(dim > 16) {
#ifndef NO_ALLOCA
		if(dim <= 256)
			bptr = buf = (double*)alloca(dim * sizeof *bptr);	// (double*) added
		else
#endif
			if(!(bptr = buf = (double*)malloc(dim * sizeof *bptr))) {	// (double*) added
				return -1;
			}
	} else {
		bptr = buf = sbuf;
	}

	while(dim-- > 0) {
		*bptr++ = *pos++;
	}

	res = kd_insert(tree, buf, data);
#ifndef NO_ALLOCA
	if(tree->dim > 256)
#else
	if(tree->dim > 16)
#endif
		free(buf);
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl (%rdi), %r13d
cmpl $0x11, %r13d
jl 0x17827
cmpl $0x100, %r13d           # imm = 0x100
ja 0x17835
movq %rsp, %r12
leaq 0xf(,%r13,8), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
jmp 0x1784a
leaq 0x15b92(%rip), %r12     # 0x2d3c0
testl %r13d, %r13d
jg 0x1784a
jmp 0x1786b
leaq (,%r13,8), %rdi
callq 0x22c0
movq %rax, %r12
testq %rax, %rax
je 0x1789e
incl %r13d
xorl %eax, %eax
xorps %xmm0, %xmm0
cvtss2sd (%r15,%rax), %xmm0
movsd %xmm0, (%r12,%rax,2)
decl %r13d
addq $0x4, %rax
cmpl $0x1, %r13d
ja 0x1784f
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x175fa
movl %eax, %r14d
cmpl $0x101, (%rbx)          # imm = 0x101
jl 0x1788c
movq %r12, %rdi
callq 0x2260
movl %r14d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x1788c
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_insert3
int kd_insert3(struct kdtree *tree, double x, double y, double z, void *data)
{
	double buf[3];
	buf[0] = x;
	buf[1] = y;
	buf[2] = z;
	return kd_insert(tree, buf, data);
}

// Assembly:
subq $0x18, %rsp
movq %rsi, %rdx
movq %rsp, %rsi
movsd %xmm0, (%rsi)
movsd %xmm1, 0x8(%rsi)
movsd %xmm2, 0x10(%rsi)
callq 0x175fa
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_insert3f
int kd_insert3f(struct kdtree *tree, float x, float y, float z, void *data)
{
	double buf[3];
	buf[0] = x;
	buf[1] = y;
	buf[2] = z;
	return kd_insert(tree, buf, data);
}

// Assembly:
subq $0x18, %rsp
movq %rsi, %rdx
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cvtps2pd %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movsd %xmm0, 0x10(%rsi)
callq 0x175fa
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_nearest
struct kdres *kd_nearest(struct kdtree *kd, const double *pos)
{
	struct kdhyperrect *rect;
	struct kdnode *result;
	struct kdres *rset;
	double dist_sq;
	int i;

	if (!kd) return 0;
	if (!kd->rect) return 0;

	/* Allocate result set */
	if(!(rset = (kdres*)malloc(sizeof *rset))) {	// (kdres*) added
		return 0;
	}
	if(!(rset->rlist = (res_node*)alloc_resnode())) {	// (res_node*) added
		free(rset);
		return 0;
	}
	rset->rlist->next = 0;
	rset->tree = kd;

	/* Duplicate the bounding hyperrectangle, we will work on the copy */
	if (!(rect = hyperrect_duplicate(kd->rect))) {
		kd_res_free(rset);
		return 0;
	}

	/* Our first guesstimate is the root node */
	result = kd->root;
	dist_sq = 0;
	for (i = 0; i < kd->dim; i++)
		dist_sq += SQ(result->pos[i] - pos[i]);

	/* Search for the nearest neighbour recursively */
	kd_nearest_i(kd->root, pos, &result, &dist_sq, rect);

	/* Free the copy of the hyperrect */
	hyperrect_free(rect);

	/* Store the result */
	if (result) {
		if (rlist_insert(rset->rlist, result, -1.0) == -1) {
			kd_res_free(rset);
			return 0;
		}
		rset->size = 1;
		kd_res_rewind(rset);
		return rset;
	} else {
		kd_res_free(rset);
		return 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x17a29
movq %rdi, %r13
movq 0x10(%rdi), %r12
testq %r12, %r12
je 0x17a29
movq %rsi, %r15
movl $0x20, %edi
callq 0x22c0
testq %rax, %rax
je 0x17a29
movq %rax, %rbx
movl $0x18, %edi
callq 0x22c0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x17a21
movq %rax, %r14
movq $0x0, 0x10(%rax)
movq %r13, (%rbx)
movl (%r12), %edi
movq 0x8(%r12), %rsi
movq 0x10(%r12), %rdx
callq 0x1774b
testq %rax, %rax
je 0x17a17
movq %rax, %r12
movq 0x8(%r13), %rdi
movq %rdi, 0x8(%rsp)
movq $0x0, (%rsp)
movslq (%r13), %rax
testq %rax, %rax
jle 0x179b7
movq (%rdi), %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm1
subsd (%r15,%rdx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
incq %rdx
cmpq %rdx, %rax
jne 0x17997
leaq 0x8(%rsp), %r13
movq %rsp, %rcx
movq %r15, %rsi
movq %r13, %rdx
movq %r12, %r8
callq 0x17a7c
movq %r12, %rdi
callq 0x175d6
movq (%r13), %r15
testq %r15, %r15
je 0x17a17
movl $0x18, %edi
callq 0x22c0
testq %rax, %rax
je 0x17a17
movq %r15, (%rax)
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movq %rcx, 0x8(%rax)
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rax)
movq %rax, 0x10(%r14)
movl $0x1, 0x18(%rbx)
movq %rax, 0x10(%rbx)
jmp 0x17a2b
movq %rbx, %rdi
callq 0x17a3c
jmp 0x17a29
movq %rbx, %rdi
callq 0x2260
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_nearestf
struct kdres *kd_nearestf(struct kdtree *tree, const float *pos)
{
	static double sbuf[16];
	double *bptr, *buf = 0;
	int dim = tree->dim;
	struct kdres *res;

	if(dim > 16) {
#ifndef NO_ALLOCA
		if(dim <= 256)
			bptr = buf = (double*)alloca(dim * sizeof *bptr);	// (double*) added
		else
#endif
			if(!(bptr = buf = (double*)malloc(dim * sizeof *bptr))) {	// (double*) added
				return 0;
			}
	} else {
		bptr = buf = sbuf;
	}

	while(dim-- > 0) {
		*bptr++ = *pos++;
	}

	res = kd_nearest(tree, buf);
#ifndef NO_ALLOCA
	if(tree->dim > 256)
#else
	if(tree->dim > 16)
#endif
		free(buf);
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %r12d
cmpl $0x11, %r12d
jl 0x17c5e
cmpl $0x100, %r12d           # imm = 0x100
ja 0x17c6c
movq %rsp, %r15
leaq 0xf(,%r12,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
jmp 0x17c81
leaq 0x157db(%rip), %r15     # 0x2d440
testl %r12d, %r12d
jg 0x17c81
jmp 0x17ca2
leaq (,%r12,8), %rdi
callq 0x22c0
movq %rax, %r15
testq %rax, %rax
je 0x17cd0
incl %r12d
xorl %eax, %eax
xorps %xmm0, %xmm0
cvtss2sd (%r14,%rax), %xmm0
movsd %xmm0, (%r15,%rax,2)
decl %r12d
addq $0x4, %rax
cmpl $0x1, %r12d
ja 0x17c86
movq %rbx, %rdi
movq %r15, %rsi
callq 0x178f1
movq %rax, %r14
cmpl $0x101, (%rbx)          # imm = 0x101
jl 0x17cc0
movq %r15, %rdi
callq 0x2260
movq %r14, %rax
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0x17cc0
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_nearest3
struct kdres *kd_nearest3(struct kdtree *tree, double x, double y, double z)
{
	double pos[3];
	pos[0] = x;
	pos[1] = y;
	pos[2] = z;
	return kd_nearest(tree, pos);
}

// Assembly:
subq $0x18, %rsp
movq %rsp, %rsi
movsd %xmm0, (%rsi)
movsd %xmm1, 0x8(%rsi)
movsd %xmm2, 0x10(%rsi)
callq 0x178f1
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_nearest3f
struct kdres *kd_nearest3f(struct kdtree *tree, float x, float y, float z)
{
	double pos[3];
	pos[0] = x;
	pos[1] = y;
	pos[2] = z;
	return kd_nearest(tree, pos);
}

// Assembly:
subq $0x18, %rsp
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cvtps2pd %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movsd %xmm0, 0x10(%rsi)
callq 0x178f1
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_nearest_range
struct kdres *kd_nearest_range(struct kdtree *kd, const double *pos, double range)
{
	int ret;
	struct kdres *rset;

	if(!(rset = (kdres*)malloc(sizeof *rset))) {	// (kdres*) added
		return 0;
	}
	if(!(rset->rlist = (res_node*)alloc_resnode())) {	// (res_node*) added
		free(rset);
		return 0;
	}
	rset->rlist->next = 0;
	rset->tree = kd;

	if((ret = find_nearest(kd->root, pos, range, rset->rlist, 0, kd->dim)) == -1) {
		kd_res_free(rset);
		return 0;
	}
	rset->size = ret;
	kd_res_rewind(rset);
	return rset;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movq %rsi, %r14
movq %rdi, %r12
movl $0x20, %edi
callq 0x22c0
testq %rax, %rax
je 0x17d9d
movq %rax, %rbx
movl $0x18, %edi
callq 0x22c0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x17d8b
movq %rax, %r15
movq $0x0, 0x10(%rax)
movq %r12, (%rbx)
movq 0x8(%r12), %rdi
movl (%r12), %ecx
movq %r14, %rsi
movsd (%rsp), %xmm0
movq %rax, %rdx
callq 0x17dae
cmpl $-0x1, %eax
je 0x17d95
movl %eax, 0x18(%rbx)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rbx)
jmp 0x17d9f
movq %rbx, %rdi
callq 0x2260
jmp 0x17d9d
movq %rbx, %rdi
callq 0x17a3c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: find_nearest(kdnode*, double const*, double, res_node*, int, int)
static int find_nearest(struct kdnode *node, const double *pos, double range, struct res_node *list, int ordered, int dim)
{
	double dist_sq, dx;
	int i, ret, added_res = 0;

	if(!node) return 0;

	dist_sq = 0;
	for(i=0; i<dim; i++) {
		dist_sq += SQ(node->pos[i] - pos[i]);
	}
	if(dist_sq <= SQ(range)) {
		if(rlist_insert(list, node, ordered ? dist_sq : -1.0) == -1) {
			return -1;
		}
		added_res = 1;
	}

	dx = pos[node->dir] - node->pos[node->dir];

	ret = find_nearest(dx <= 0.0 ? node->left : node->right, pos, range, list, ordered, dim);
	if(ret >= 0 && fabs(dx) < range) {
		added_res += ret;
		ret = find_nearest(dx <= 0.0 ? node->right : node->left, pos, range, list, ordered, dim);
	}
	if(ret == -1) {
		return -1;
	}
	added_res += ret;

	return added_res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
testq %rdi, %rdi
je 0x17df7
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
testl %ecx, %ecx
jle 0x17dfe
movq (%r12), %rax
movl %ebx, %ecx
xorpd %xmm2, %xmm2
xorl %edx, %edx
movsd (%rax,%rdx,8), %xmm1
subsd (%r15,%rdx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm2
incq %rdx
cmpq %rdx, %rcx
jne 0x17dda
jmp 0x17e02
xorl %ebp, %ebp
jmp 0x17ee1
xorpd %xmm2, %xmm2
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
xorl %ebp, %ebp
ucomisd %xmm2, %xmm1
movsd %xmm0, 0x8(%rsp)
jb 0x17e53
movl $0x18, %edi
callq 0x22c0
testq %rax, %rax
je 0x17edc
movq %r12, (%rax)
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movq %rcx, 0x8(%rax)
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rax)
movq %rax, 0x10(%r14)
movl $0x1, %ebp
movsd 0x8(%rsp), %xmm0
movslq 0x8(%r12), %rax
movsd (%r15,%rax,8), %xmm2
movq (%r12), %rcx
subsd (%rcx,%rax,8), %xmm2
xorpd %xmm1, %xmm1
xorl %eax, %eax
movapd %xmm2, 0x10(%rsp)
ucomisd %xmm2, %xmm1
setb %al
movq 0x18(%r12,%rax,8), %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x17dae
testl %eax, %eax
js 0x17ed3
movapd 0xeb18(%rip), %xmm0     # 0x269b0
movapd 0x10(%rsp), %xmm2
andpd %xmm2, %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x17ed3
movapd %xmm1, %xmm0
xorpd %xmm1, %xmm1
xorl %ecx, %ecx
ucomisd %xmm2, %xmm1
setae %cl
addl %eax, %ebp
movq 0x18(%r12,%rcx,8), %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x17dae
cmpl $-0x1, %eax
je 0x17edc
addl %eax, %ebp
jmp 0x17ee1
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_nearest_rangef
struct kdres *kd_nearest_rangef(struct kdtree *kd, const float *pos, float range)
{
	static double sbuf[16];
	double *bptr, *buf = 0;
	int dim = kd->dim;
	struct kdres *res;

	if(dim > 16) {
#ifndef NO_ALLOCA
		if(dim <= 256)
			bptr = buf = (double*)alloca(dim * sizeof *bptr);	// (double*) added
		else
#endif
			if(!(bptr = buf = (double*)malloc(dim * sizeof *bptr))) {	// (double*) added
				return 0;
			}
	} else {
		bptr = buf = sbuf;
	}

	while(dim-- > 0) {
		*bptr++ = *pos++;
	}

	res = kd_nearest_range(kd, buf, range);
#ifndef NO_ALLOCA
	if(kd->dim > 256)
#else
	if(kd->dim > 16)
#endif
		free(buf);
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %r12d
cmpl $0x11, %r12d
jl 0x17f2e
cmpl $0x100, %r12d           # imm = 0x100
ja 0x17f3c
movq %rsp, %r15
leaq 0xf(,%r12,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
jmp 0x17f5b
leaq 0x1558b(%rip), %r15     # 0x2d4c0
testl %r12d, %r12d
jg 0x17f5b
jmp 0x17f7c
leaq (,%r12,8), %rdi
movss %xmm0, -0x24(%rbp)
callq 0x22c0
movss -0x24(%rbp), %xmm0
movq %rax, %r15
testq %rax, %rax
je 0x17fae
incl %r12d
xorl %eax, %eax
xorps %xmm1, %xmm1
cvtss2sd (%r14,%rax), %xmm1
movsd %xmm1, (%r15,%rax,2)
decl %r12d
addq $0x4, %rax
cmpl $0x1, %r12d
ja 0x17f60
cvtss2sd %xmm0, %xmm0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x17d1a
movq %rax, %r14
cmpl $0x101, (%rbx)          # imm = 0x101
jl 0x17f9e
movq %r15, %rdi
callq 0x2260
movq %r14, %rax
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0x17f9e
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_nearest_range3
struct kdres *kd_nearest_range3(struct kdtree *tree, double x, double y, double z, double range)
{
	double buf[3];
	buf[0] = x;
	buf[1] = y;
	buf[2] = z;
	return kd_nearest_range(tree, buf, range);
}

// Assembly:
subq $0x18, %rsp
movq %rsp, %rsi
movsd %xmm0, (%rsi)
movsd %xmm1, 0x8(%rsi)
movsd %xmm2, 0x10(%rsi)
movaps %xmm3, %xmm0
callq 0x17d1a
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_nearest_range3f
struct kdres *kd_nearest_range3f(struct kdtree *tree, float x, float y, float z, float range)
{
	double buf[3];
	buf[0] = x;
	buf[1] = y;
	buf[2] = z;
	return kd_nearest_range(tree, buf, range);
}

// Assembly:
subq $0x18, %rsp
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cvtps2pd %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movsd %xmm0, 0x10(%rsi)
xorps %xmm0, %xmm0
cvtss2sd %xmm3, %xmm0
callq 0x17d1a
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_res_item
void *kd_res_item(struct kdres *rset, double *pos)
{
	if(rset->riter) {
		if(pos) {
			memcpy(pos, rset->riter->item->pos, rset->tree->dim * sizeof *pos);
		}
		return rset->riter->item->data;
	}
	return 0;
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x18060
pushq %rbx
testq %rsi, %rsi
je 0x18057
movq %rdi, %rbx
movq (%rax), %rax
movq (%rax), %rax
movq (%rdi), %rcx
movslq (%rcx), %rdx
shlq $0x3, %rdx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x21b0
movq 0x10(%rbx), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_res_itemf
void *kd_res_itemf(struct kdres *rset, float *pos)
{
	if(rset->riter) {
		if(pos) {
			int i;
			for(i=0; i<rset->tree->dim; i++) {
				pos[i] = rset->riter->item->pos[i];
			}
		}
		return rset->riter->item->data;
	}
	return 0;
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x1809b
testq %rsi, %rsi
je 0x1809e
movq (%rdi), %rcx
movslq (%rcx), %rcx
movq (%rax), %rax
testq %rcx, %rcx
jle 0x180a1
movq (%rax), %rdx
xorl %edi, %edi
xorps %xmm0, %xmm0
cvtsd2ss (%rdx,%rdi,8), %xmm0
movss %xmm0, (%rsi,%rdi,4)
incq %rdi
cmpq %rdi, %rcx
jne 0x18084
jmp 0x180a1
xorl %eax, %eax
retq
movq (%rax), %rax
movq 0x10(%rax), %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_res_item3
void *kd_res_item3(struct kdres *rset, double *x, double *y, double *z)
{
	if(rset->riter) {
		if(*x) *x = rset->riter->item->pos[0];
		if(*y) *y = rset->riter->item->pos[1];
		if(*z) *z = rset->riter->item->pos[2];
	}
	return 0;
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x18107
movsd (%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x180bf
jnp 0x180cd
movq (%rax), %rdi
movq (%rdi), %rdi
movsd (%rdi), %xmm1
movsd %xmm1, (%rsi)
movsd (%rdx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x180d9
jnp 0x180e8
movq (%rax), %rsi
movq (%rsi), %rsi
movsd 0x8(%rsi), %xmm0
movsd %xmm0, (%rdx)
movsd (%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x180f8
jnp 0x18107
movq (%rax), %rax
movq (%rax), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, (%rcx)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/kdtree.cpp
// Function: kd_res_item3f
void *kd_res_item3f(struct kdres *rset, float *x, float *y, float *z)
{
	if(rset->riter) {
		if(*x) *x = rset->riter->item->pos[0];
		if(*y) *y = rset->riter->item->pos[1];
		if(*z) *z = rset->riter->item->pos[2];
	}
	return 0;
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x1816f
movss (%rsi), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x18121
jnp 0x18132
movq (%rax), %rdi
movq (%rdi), %rdi
xorps %xmm1, %xmm1
cvtsd2ss (%rdi), %xmm1
movss %xmm1, (%rsi)
movss (%rdx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x1813d
jnp 0x1814f
movq (%rax), %rsi
movq (%rsi), %rsi
xorps %xmm0, %xmm0
cvtsd2ss 0x8(%rsi), %xmm0
movss %xmm0, (%rdx)
movss (%rcx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x1815d
jnp 0x1816f
movq (%rax), %rax
movq (%rax), %rax
xorps %xmm0, %xmm0
cvtsd2ss 0x10(%rax), %xmm0
movss %xmm0, (%rcx)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/rfotino[P]consolite-emulator/src/vidmem.cpp
// Function: EmuVideoMemory::set(unsigned char const&, unsigned char const&, unsigned char const&)
void EmuVideoMemory::set(const uint8_t& x,
                         const uint8_t& y,
                         const uint8_t& color) {
  // Decode the color. The most significant three bits represent
  // red, the middle three bits represent green, and the lowest
  // two bits represent blue. We want the color as a double from
  // 0.0 to 1.0 for cairo.
  double red = (color & 0xe0) / 255.0;
  double green = ((color & 0x1c) << 3) / 255.0;
  double blue = ((color & 0x3) << 6) / 255.0;
  // Paint the pixel specified by (x, y) to the buffer
  cairo_set_source_rgb(_cairo, red, green, blue);
  cairo_rectangle(_cairo, x, y, 1, 1);
  cairo_fill(_cairo);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movzbl (%rcx), %eax
movl %eax, %ecx
andl $-0x20, %ecx
cvtsi2sd %ecx, %xmm0
movsd 0x252c(%rip), %xmm3     # 0x60e8
movl %eax, %ecx
andl $0x1c, %ecx
shll $0x3, %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
shll $0x6, %eax
movzbl %al, %eax
cvtsi2sd %eax, %xmm2
divsd %xmm3, %xmm2
movq 0x8(%rdi), %rdi
callq 0x3160
movzbl (%r15), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq 0x8(%rbx), %rdi
movzbl (%r14), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x24e7(%rip), %xmm2     # 0x60f0
movaps %xmm2, %xmm3
callq 0x3100
movq 0x8(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3490
// File: /workspace/github_cpp_makefile_star2_O3/rfotino[P]consolite-emulator/src/window.cpp
// Function: EmuWindow::~EmuWindow()
EmuWindow::~EmuWindow() {
  // Destroy the cairo object
  cairo_destroy(_cairo);
  // Destroy the cairo Xlib surface
  cairo_surface_destroy(_surface);
  // Close the connection to the X server
  XCloseDisplay(_display);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x3320
movq (%rbx), %rdi
callq 0x32b0
movq 0x10(%rbx), %rdi
callq 0x34b0
leaq 0x68(%rbx), %rdi
callq 0x45a6
addq $0x38, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x45f6
movq %rax, %rdi
callq 0x3c1f
// File: /workspace/github_cpp_makefile_star2_O3/rfotino[P]consolite-emulator/src/window.cpp
// Function: EmuWindow::_draw()
void EmuWindow::_draw() {
  // Scale and paint the video memory's buffer to the window
  double scaleX = (double)_width / _vidMem->getWidth();
  double scaleY = (double)_height / _vidMem->getHeight();
  cairo_identity_matrix(_cairo);
  cairo_scale(_cairo, scaleX, scaleY);
  cairo_set_source_surface(_cairo, _vidMem->getBuffer(), 0, 0);
  cairo_pattern_set_filter(cairo_get_source(_cairo), CAIRO_FILTER_NEAREST);
  cairo_paint(_cairo);
  cairo_surface_flush(_surface);
  XFlush(_display);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cvtsi2sdl 0x2c(%rdi), %xmm0
mulsd 0x1f1d(%rip), %xmm0     # 0x60f8
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x30(%rdi), %xmm0
divsd 0x1f0f(%rip), %xmm0     # 0x6100
movsd %xmm0, (%rsp)
movq 0x8(%rdi), %rdi
callq 0x3130
movq 0x8(%rbx), %rdi
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0x3050
movq 0x8(%rbx), %rdi
movq 0x20(%rbx), %rax
movq (%rax), %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x3470
movq 0x8(%rbx), %rdi
callq 0x3360
movq %rax, %rdi
movl $0x3, %esi
callq 0x34a0
movq 0x8(%rbx), %rdi
callq 0x33c0
movq (%rbx), %rdi
callq 0x33f0
movq 0x10(%rbx), %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x3380
// File: /workspace/github_cpp_makefile_star2_O3/rfotino[P]consolite-emulator/src/window.cpp
// Function: EmuWindow::_updateKeyState(XKeyEvent const&)
void EmuWindow::_updateKeyState(const XKeyEvent& event) {
  // Filter out auto repeat key events
  if (event.type == KeyRelease && XPending(_display)) {
    XEvent nev;
    XPeekEvent(_display, &nev);
    if (nev.type == KeyPress &&
        nev.xkey.time == event.time &&
        nev.xkey.keycode == event.keycode) {
      // Key wasn't really released, get rid of the
      // pending KeyPress event and return
      XNextEvent(_display, &nev);
      return;
    }
  }
  int keysyms_per_keycode_return;
  KeySym *keysym = XGetKeyboardMapping(_display,
                                       event.keycode,
                                       1,
                                       &keysyms_per_keycode_return);
  uint16_t status = KeyPress == event.type ? 1 : 0;
  _keyState[keysym[0]] = status;
  XFree(keysym);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x3, (%rsi)
jne 0x433f
movq 0x10(%rbx), %rdi
callq 0x31f0
testl %eax, %eax
je 0x433f
movq 0x10(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x30c0
cmpl $0x2, (%r15)
jne 0x433f
movq 0x40(%rsp), %rax
cmpq 0x38(%r14), %rax
jne 0x433f
movl 0x5c(%rsp), %eax
cmpl 0x54(%r14), %eax
jne 0x433f
movq 0x10(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3340
jmp 0x437e
movq 0x10(%rbx), %rdi
movzbl 0x54(%r14), %esi
leaq 0x8(%rsp), %rcx
movl $0x1, %edx
callq 0x3450
movq %rax, %r15
xorl %ebp, %ebp
cmpl $0x2, (%r14)
sete %bpl
addq $0x68, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4540
movw %bp, (%rax)
movq %r15, %rdi
callq 0x32c0
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq