LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::lengthen(WDPDF_Node<int>*)
void WeightedDiscretePDF<T>::lengthen(WDPDF_Node<T> *n)
{
	if (n->isRed()) {
		n->markBlack();
	} else if (n->parent) {
		WDPDF_Node<T> *sibling = n->sibling();

		if (sibling && sibling->isRed()) {
			n->parent->markRed();
			sibling->markBlack();

			rotate(sibling); // node sibling is now old sibling child, must be black
			sibling = n->sibling();
		}

		// sibling is black

		if (!sibling) {
			lengthen(n->parent);
		} else if (sibling->leftIsBlack() && sibling->rightIsBlack()) {
			if (n->parent->isBlack()) {
				sibling->markRed();
				lengthen(n->parent);
			} else {
				sibling->markRed();
				n->parent->markBlack();
			}
		} else {
			if (n==n->parent->left && sibling->rightIsBlack()) {
				rotate(sibling->left); // sibling->left must be red
				sibling->markRed();
				sibling->parent->markBlack();
				sibling = sibling->parent;
			} else if (n==n->parent->right && sibling->leftIsBlack()) {
				rotate(sibling->right); // sibling->right must be red
				sibling->markRed();
				sibling->parent->markBlack();
				sibling = sibling->parent;
			}

			// sibling is black, and sibling's far child is red

			rotate(sibling);
			if (n->parent->isRed()) sibling->markRed();
			sibling->left->markBlack();
			sibling->right->markBlack();
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x1, (%rbx)
je 0x71fb
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x7268
movq 0x10(%rax), %r15
cmpq %rbx, %r15
jne 0x718a
movq 0x18(%rax), %r15
testq %r15, %r15
je 0x71ba
cmpb $0x1, (%r15)
jne 0x71bd
movb $0x1, (%rax)
movb $0x0, (%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7066
movq 0x8(%rbx), %rax
movq 0x10(%rax), %r15
cmpq %rbx, %r15
jne 0x71bd
movq 0x18(%rax), %r15
jmp 0x71bd
xorl %r15d, %r15d
testq %r15, %r15
je 0x71f2
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0x71d0
cmpb $0x0, (%rsi)
jne 0x7200
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x71de
cmpb $0x0, (%rax)
jne 0x7200
movq 0x8(%rbx), %rbx
movb (%rbx), %al
movb $0x1, (%r15)
cmpb $0x1, %al
jne 0x7167
jmp 0x71fb
movq 0x8(%rbx), %rbx
jmp 0x7167
movb $0x0, (%rbx)
jmp 0x7268
movq 0x8(%rbx), %rax
cmpq %rbx, 0x10(%rax)
je 0x7220
cmpq %rbx, 0x18(%rax)
jne 0x7242
testq %rsi, %rsi
je 0x721a
cmpb $0x0, (%rsi)
jne 0x7242
movq 0x18(%r15), %rsi
jmp 0x722e
movq 0x18(%r15), %rcx
testq %rcx, %rcx
je 0x722e
cmpb $0x1, (%rcx)
je 0x720a
movq %r14, %rdi
callq 0x7066
movb $0x1, (%r15)
movq 0x8(%r15), %r15
movb $0x0, (%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7066
movq 0x8(%rbx), %rax
cmpb $0x1, (%rax)
jne 0x725a
movb $0x1, (%r15)
movq 0x10(%r15), %rax
xorl %ecx, %ecx
movb %cl, (%rax)
movq 0x18(%r15), %rax
movb %cl, (%rax)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/RangeList.cpp
// Function: RangeList::RangeList(float, float)
RangeList::RangeList(float min, float max)
{
	numRanges = 0;
	rangesSize = 8;
	ranges = new RangeEntry[rangesSize];
	reset(min, max);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movss %xmm1, 0xc(%rsp)
movss %xmm0, 0x8(%rsp)
movq %rdi, %rbx
movabsq $0x800000000, %rax      # imm = 0x800000000
movq %rax, 0x8(%rdi)
movl $0x40, %edi
callq 0x2030
movq %rax, (%rbx)
movl $0x1, 0x8(%rbx)
movss 0x8(%rsp), %xmm0
movss %xmm0, (%rax)
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/RangeList.cpp
// Function: RangeList::insertRange(int, float, float)
void RangeList::insertRange(int pos, float min, float max)
{
	if (numRanges==rangesSize) {
		RangeEntry *tmp = new RangeEntry[rangesSize];
		memcpy(tmp, ranges, numRanges*sizeof(*tmp));
		delete[] ranges;
		ranges = tmp;
	}

	if (pos<numRanges) {
		memmove(&ranges[pos+1], &ranges[pos], sizeof(*ranges)*(numRanges-pos));
	}

	ranges[pos].min = min;
	ranges[pos].max = max;
	numRanges++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movss %xmm1, 0xc(%rsp)
movss %xmm0, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, %rbx
movslq 0x8(%rdi), %r14
movslq 0xc(%rdi), %rax
cmpl %eax, %r14d
jne 0x7387
movq %rax, %rcx
shlq $0x3, %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x2030
movq %rax, %r15
movq (%rbx), %r12
shlq $0x3, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2160
testq %r12, %r12
je 0x7384
movq %r12, %rdi
callq 0x2220
movq %r15, (%rbx)
movl 0x8(%rbx), %eax
movslq %ebp, %r14
subl %ebp, %eax
jle 0x73ac
movq (%rbx), %rcx
leaq (%rcx,%r14,8), %rsi
leaq (%rcx,%r14,8), %rdi
addq $0x8, %rdi
movslq %eax, %rdx
shlq $0x3, %rdx
callq 0x22d0
movq (%rbx), %rax
movss 0x8(%rsp), %xmm0
movss %xmm0, (%rax,%r14,8)
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x4(%rax,%r14,8)
incl 0x8(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/RangeList.cpp
// Function: RangeList::print()
void RangeList::print()
{
	printf("[");
	for (int i=0; i<numRanges; i++) {
		printf("(%f,%f)%s", ranges[i].min, ranges[i].max, (i==numRanges-1)?"":", ");
	}
	printf("]\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x5b, %edi
callq 0x2240
movl 0x8(%rbx), %eax
testl %eax, %eax
jle 0x766d
xorl %r15d, %r15d
leaq 0x4d13(%rip), %r12      # 0xc33a
leaq 0x4f4c(%rip), %r13      # 0xc57a
leaq 0x4f3b(%rip), %r14      # 0xc570
movq (%rbx), %rcx
xorps %xmm0, %xmm0
cvtss2sd (%rcx,%r15,8), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rcx,%r15,8), %xmm1
decl %eax
cmpq %rax, %r15
movq %r13, %rsi
cmoveq %r12, %rsi
movq %r14, %rdi
movb $0x2, %al
callq 0x2040
incq %r15
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jl 0x7635
leaq 0x4f09(%rip), %rdi      # 0xc57d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2290
nop
// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/ScallopedSector.cpp
// Function: integralOfDistToCircle(float, float, float, float)
static float integralOfDistToCircle(float x, float d, float r, float k)
{
	if (r<FLT_EPSILON)
		return 0.0;

	float sin_x = sin(x);
	float d_sin_x = d*sin_x;
	float y = sin_x*d/r;
	if (y<-1) y = -1;
	else if (y>1) y = 1;

	float theta = asin(y);

	return (r*(r*(x + 
				  k*theta) +
			   k*cos(theta)*d_sin_x) +
		    d*cos(x)*d_sin_x)*.5f;
}

// Assembly:
xorps %xmm5, %xmm5
movss 0x4d37(%rip), %xmm4     # 0xc580
ucomiss %xmm2, %xmm4
ja 0x791a
subq $0x18, %rsp
movss %xmm3, 0x8(%rsp)
movss %xmm0, 0x10(%rsp)
movss %xmm2, 0x4(%rsp)
movss %xmm1, 0x14(%rsp)
callq 0x2170
mulss 0x14(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movaps %xmm0, %xmm1
divss 0x4(%rsp), %xmm1
movss 0x2bec(%rip), %xmm0     # 0xa47c
ucomiss %xmm1, %xmm0
ja 0x78a9
ucomiss 0x2be4(%rip), %xmm1     # 0xa480
movaps %xmm1, %xmm0
jbe 0x78a9
movss 0x2bd7(%rip), %xmm0     # 0xa480
callq 0x22b0
movss 0x8(%rsp), %xmm1
mulss %xmm0, %xmm1
addss 0x10(%rsp), %xmm1
movss %xmm1, (%rsp)
callq 0x2120
mulss 0x8(%rsp), %xmm0
mulss 0xc(%rsp), %xmm0
movss (%rsp), %xmm1
mulss 0x4(%rsp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, (%rsp)
movss 0x10(%rsp), %xmm0
callq 0x2120
movss (%rsp), %xmm5
mulss 0x14(%rsp), %xmm0
mulss 0xc(%rsp), %xmm0
mulss 0x4(%rsp), %xmm5
addss %xmm0, %xmm5
mulss 0x2746(%rip), %xmm5     # 0xa05c
addq $0x18, %rsp
movaps %xmm5, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedSector::calcAngleForArea(float, RNG&)
float ScallopedSector::calcAngleForArea(float area, RNG &rng)
{
	float lo = a1, hi = a2, cur = lo + (hi-lo)*rng.getFloat();

	for (int i=0; i<10; i++) {
		if (calcAreaToAngle(cur)<area) {
			lo = cur;
			cur = (cur + hi)*.5f;
		} else {
			hi = cur;
			cur = (lo + cur)*.5f;
		}
	}

	return cur;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x38, %rsp
movss %xmm0, 0xc(%rsp)
movq %rdi, %rbx
movss 0x8(%rdi), %xmm1
movaps %xmm1, 0x20(%rsp)
movss 0xc(%rdi), %xmm0
movss %xmm0, 0x8(%rsp)
subss %xmm1, %xmm0
movss %xmm0, 0x10(%rsp)
movq %rsi, %rdi
callq 0x2878
movaps 0x20(%rsp), %xmm1
movaps %xmm0, %xmm3
mulss 0x10(%rsp), %xmm3
addss %xmm1, %xmm3
movl $0xa, %ebp
movaps %xmm1, 0x20(%rsp)
movaps %xmm3, 0x10(%rsp)
movq %rbx, %rdi
movaps %xmm3, %xmm0
callq 0x791e
movaps 0x20(%rsp), %xmm4
movaps 0x10(%rsp), %xmm3
movss 0xc(%rsp), %xmm2
ucomiss %xmm0, %xmm2
movss 0x8(%rsp), %xmm1
ja 0x7a06
movss %xmm3, 0x8(%rsp)
movaps %xmm4, %xmm1
cmpltss %xmm2, %xmm0
movaps %xmm0, %xmm2
andps %xmm3, %xmm2
andnps %xmm4, %xmm0
orps %xmm2, %xmm0
addss %xmm1, %xmm3
mulss 0x2639(%rip), %xmm3     # 0xa05c
movaps %xmm0, %xmm1
decl %ebp
jne 0x79cd
movaps %xmm3, %xmm0
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedSector::distToCurve(float, int)
float ScallopedSector::distToCurve(float angle, int index)
{
	float alpha = angle - arcs[index].theta;
	float sin_alpha = sin(alpha);
	float t0 = arcs[index].rSqrd - arcs[index].dSqrd*sin_alpha*sin_alpha;
	if (t0<0) {
		return arcs[index].d*cos(alpha);
	} else {
		return arcs[index].d*cos(alpha) + arcs[index].sign*sqrt(t0);
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movslq %esi, %rax
leaq (%rax,%rax,8), %r14
subss 0x28(%rdi,%r14,4), %xmm0
movss %xmm0, 0x10(%rsp)
callq 0x2170
movss 0x24(%rbx,%r14,4), %xmm1
movss %xmm1, 0x14(%rsp)
movss 0x30(%rbx,%r14,4), %xmm2
movss 0x34(%rbx,%r14,4), %xmm1
mulss %xmm0, %xmm1
mulss %xmm0, %xmm1
subss %xmm1, %xmm2
movss %xmm2, 0xc(%rsp)
movss 0x10(%rsp), %xmm0
callq 0x2120
movss 0xc(%rsp), %xmm1
movaps %xmm0, %xmm2
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x7aac
movss 0x14(%rsp), %xmm0
mulss %xmm2, %xmm0
jmp 0x7afc
leaq (%rbx,%r14,4), %rax
addq $0x14, %rax
movss 0xc(%rax), %xmm3
ucomiss %xmm0, %xmm1
jb 0x7ac7
xorps %xmm0, %xmm0
sqrtss %xmm1, %xmm0
jmp 0x7ae7
movaps %xmm1, %xmm0
movss %xmm2, 0x10(%rsp)
movss %xmm3, 0xc(%rsp)
callq 0x2320
movss 0xc(%rsp), %xmm3
movss 0x10(%rsp), %xmm2
movss 0x14(%rsp), %xmm1
mulss %xmm0, %xmm3
mulss %xmm2, %xmm1
addss %xmm3, %xmm1
movaps %xmm1, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedSector::sample(RNG&)
Vec2 ScallopedSector::sample(RNG &rng)
{
	float angle = calcAngleForArea(area*rng.getFloatL(), rng);
	float d1 = distToCurve(angle, 0);
	float d2 = distToCurve(angle, 1);
	float d = sqrt(d1*d1 + (d2*d2 - d1*d1)*rng.getFloat());
	
	return Vec2(P.x + cos(angle)*d, P.y + sin(angle)*d);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movss 0x10(%rdi), %xmm0
movss %xmm0, 0xc(%rsp)
movq %rsi, %rdi
callq 0x2846
mulss 0xc(%rsp), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7980
movss %xmm0, 0xc(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7a34
movss %xmm0, 0x10(%rsp)
movq %rbx, %rdi
movss 0xc(%rsp), %xmm0
movl $0x1, %esi
callq 0x7a34
mulss %xmm0, %xmm0
movss 0x10(%rsp), %xmm1
mulss %xmm1, %xmm1
movss %xmm1, 0x10(%rsp)
subss %xmm1, %xmm0
movss %xmm0, 0x20(%rsp)
movq %r14, %rdi
callq 0x2878
mulss 0x20(%rsp), %xmm0
addss 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x7b9e
sqrtss %xmm0, %xmm0
jmp 0x7ba3
callq 0x2320
movaps %xmm0, 0x10(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, 0x20(%rsp)
movss 0xc(%rsp), %xmm0
callq 0x2120
movaps %xmm0, 0x30(%rsp)
movss 0x4(%rbx), %xmm0
movaps %xmm0, 0x40(%rsp)
movss 0xc(%rsp), %xmm0
callq 0x2170
movaps 0x30(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movaps 0x10(%rsp), %xmm2
shufps $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
mulps %xmm1, %xmm2
movaps 0x20(%rsp), %xmm1
movaps 0x40(%rsp), %xmm0
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
addps %xmm2, %xmm0
addq $0x58, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedSector::distToCircle(float, Vec2&, float, float*, float*)
void ScallopedSector::distToCircle(float angle, Vec2 &C, float r, float *d1_out, float *d2_out)
{
	Vec2 v(C.x - P.x, C.y - P.y);
	float dSqrd = v.x*v.x + v.y*v.y;
	float theta = atan2(v.y, v.x);
	float alpha = angle - theta;
	float sin_alpha = sin(alpha);
	float xSqrd = r*r - dSqrd*sin_alpha*sin_alpha;

	if (xSqrd<0) {
		*d1_out = *d2_out = -10000000;
	} else {
		float a = sqrt(dSqrd)*cos(alpha);
		float x = sqrt(xSqrd);
		*d1_out = a-x;
		*d2_out = a+x;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movss %xmm1, 0xc(%rsp)
movss %xmm0, 0x14(%rsp)
movss (%rsi), %xmm1
subss (%rdi), %xmm1
movss 0x4(%rsi), %xmm0
subss 0x4(%rdi), %xmm0
movaps %xmm0, %xmm2
mulss %xmm0, %xmm2
movaps %xmm1, %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
movss %xmm3, 0x10(%rsp)
callq 0x2230
movss 0x14(%rsp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x14(%rsp)
movaps %xmm1, %xmm0
callq 0x2170
movss 0x10(%rsp), %xmm3
movaps %xmm0, %xmm1
mulss %xmm3, %xmm1
mulss %xmm0, %xmm1
movss 0xc(%rsp), %xmm2
mulss %xmm2, %xmm2
subss %xmm1, %xmm2
xorps %xmm0, %xmm0
movss %xmm2, 0xc(%rsp)
ucomiss %xmm2, %xmm0
jbe 0x7cdf
movl $0xcb189680, %eax       # imm = 0xCB189680
movl %eax, (%rbx)
movl %eax, (%r14)
jmp 0x7d4b
ucomiss %xmm0, %xmm3
jb 0x7ced
xorps %xmm0, %xmm0
sqrtss %xmm3, %xmm0
jmp 0x7cf5
movaps %xmm3, %xmm0
callq 0x2320
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
callq 0x2120
movaps %xmm0, %xmm2
mulss 0x10(%rsp), %xmm2
xorps %xmm0, %xmm0
movss 0xc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
movaps %xmm1, %xmm0
jb 0x7d26
sqrtss %xmm0, %xmm0
jmp 0x7d37
movss %xmm2, 0xc(%rsp)
callq 0x2320
movss 0xc(%rsp), %xmm2
movaps %xmm2, %xmm1
subss %xmm0, %xmm1
movss %xmm1, (%r14)
addss %xmm0, %xmm2
movss %xmm2, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedRegion::sample(RNG&)
Vec2 ScallopedRegion::sample(RNG &rng)
{
	if (!regions->size()) {
		printf("Fatal error, sampled from empty region.");
		exit(1);
		return Vec2(0,0); 
	} else {
		float a = area*rng.getFloatL();
		ScallopedSector &ss = (*regions)[0];

		for (unsigned int i=0; i<regions->size(); i++) {
			ss = (*regions)[i];
			if (a<ss.area)
				break;
			a -= ss.area;
		}

		return ss.sample(rng);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rax
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x894c
movq %rsi, %rbx
movq %rdi, %r14
movss 0xc(%rdi), %xmm0
movss %xmm0, 0x4(%rsp)
movq %rsi, %rdi
callq 0x2846
movss 0x4(%rsp), %xmm1
movq (%r14), %rcx
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
je 0x893a
mulss %xmm0, %xmm1
movl $0x1, %edx
xorl %ecx, %ecx
movabsq $-0x2c8590b21642c859, %r8 # imm = 0xD37A6F4DE9BD37A7
movq %rax, %rdi
imulq $0x5c, %rcx, %rsi
addq %rdi, %rsi
movl $0x17, %ecx
movq %rax, %rdi
rep  movsl (%rsi), %es:(%rdi)
movss 0x10(%rax), %xmm0
ucomiss %xmm1, %xmm0
ja 0x893a
subss %xmm0, %xmm1
movl %edx, %ecx
movq (%r14), %rsi
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
subq %rdi, %rsi
sarq $0x2, %rsi
imulq %r8, %rsi
incl %edx
cmpq %rcx, %rsi
ja 0x88fd
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x7b04
leaq 0x3c5d(%rip), %rdi      # 0xc5b0
xorl %eax, %eax
callq 0x2040
movl $0x1, %edi
callq 0x2200
// File: /workspace/github_cpp_makefile_star2_O1/pokorj54[P]Pathfinder-utilities/src/Helpers/fraction.cpp
// Function: Fraction::Normalize()
Fraction Fraction::Normalize()
{
    int d = gcd(numerator, denominator);
    numerator /= d;
    denominator /= d;
    if(denominator < 0)
    {
        numerator *= -1;
        denominator *= -1;
    }
    return *this;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %ebp
movl 0x4(%rdi), %r14d
movl %ebp, %edi
movl %r14d, %esi
callq 0x237c
movl %eax, %esi
movl %ebp, %eax
cltd
idivl %esi
movl %eax, %ecx
movl %eax, (%rbx)
movl %r14d, %eax
cltd
idivl %esi
movl %eax, 0x4(%rbx)
testl %eax, %eax
jns 0x23ce
negl %ecx
movl %ecx, (%rbx)
negl %eax
movl %eax, 0x4(%rbx)
movq (%rbx), %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/pokorj54[P]Pathfinder-utilities/src/sacredGeometry.cpp
// Function: GetHigherBound(int*, int)
int GetHigherBound(int * values, int size)
{
    int res = 1;
    int ones = 0;
    int twos = 0;
    for(int i = 0; i < size; ++i)
    {
        if(values[i] == 1)
        {
            ++ones;
        }
        else if(values[i] == 2)
        {
            ++twos;
        }
        else
        {
            res *= values[i];
        }
        if(res > PRIMECONSTANTS[(sizeof(PRIMECONSTANTS)/sizeof(*PRIMECONSTANTS))-1][0])
        {
            return res;
        }
    }
    if(ones > twos)
    {
        res *= pow(3, twos+(ones-twos)/3)*2;
    }
    else
    {
        res *= pow(3, ones);
        res *= pow(2, twos-ones);
    }
    return res;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
testl %esi, %esi
setg %cl
jle 0x2a82
movl %esi, %edx
movq %rdx, %rsi
negq %rsi
movl $0x1, %eax
xorl %ebx, %ebx
movl $0x1, %r8d
xorl %ebp, %ebp
movl -0x4(%rdi,%r8,4), %r9d
cmpl $0x2, %r9d
je 0x2a59
cmpl $0x1, %r9d
jne 0x2a5d
incl %ebp
jmp 0x2a61
incl %ebx
jmp 0x2a61
imull %r9d, %eax
cmpl $0x66, %eax
jge 0x2a7c
cmpq %rdx, %r8
setb %cl
leaq (%rsi,%r8), %r9
incq %r9
incq %r8
cmpq $0x1, %r9
jne 0x2a44
cvtsi2sd %eax, %xmm0
jmp 0x2a8e
xorl %ebp, %ebp
movsd 0x2654(%rip), %xmm0     # 0x50e0
xorl %ebx, %ebx
testb $0x1, %cl
jne 0x2b17
movsd %xmm0, (%rsp)
movl %ebp, %eax
subl %ebx, %eax
jle 0x2ad6
cltq
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
addl %ebx, %eax
cvtsi2sd %eax, %xmm1
movsd 0x2622(%rip), %xmm0     # 0x50e8
callq 0x2210
addsd %xmm0, %xmm0
mulsd (%rsp), %xmm0
jmp 0x2b13
cvtsi2sd %ebp, %xmm1
movsd 0x2606(%rip), %xmm0     # 0x50e8
callq 0x2210
mulsd (%rsp), %xmm0
movapd %xmm0, (%rsp)
subl %ebp, %ebx
movsd 0x25e5(%rip), %xmm0     # 0x50e0
movl %ebx, %edi
callq 0x21b0
cvttpd2dq (%rsp), %xmm2
movapd %xmm0, %xmm1
cvtdq2pd %xmm2, %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/pokorj54[P]Pathfinder-utilities/src/sacredGeometry.cpp
// Function: GetDesiredExpression[abi:cxx11](int, int*, int)
string GetDesiredExpression(int spellLevel, int rolledDices[], int size)
{
    if(GetHigherBound(rolledDices, size) < PRIMECONSTANTS[spellLevel-1][0])
    {
         return "";
    }
    ExprAndValue * exprs = new ExprAndValue[size];
    for(int i = 0; i < size; ++i)
    {
        exprs[i] = ExprAndValue(Fraction(rolledDices[i]), i);
    }
    return CombineExpressions(spellLevel, exprs, size, size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %rbx
movq %rdx, %rdi
movl %ecx, %esi
callq 0x2a20
leal -0x1(%r14), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x185c(%rip), %rdx      # 0x50f0
cmpl (%rdx,%rcx,4), %eax
jge 0x38b7
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x19f4(%rip), %rdx      # 0x529b
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x3d56
jmp 0x39e8
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movslq %ebp, %r14
movq %r14, %rbx
shlq $0x6, %rbx
leaq 0x8(%rbx), %rax
testl %ebp, %ebp
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq %rax, %r12
movq %r14, (%rax)
testl %ebp, %ebp
je 0x3909
leaq 0x20(%r12), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0x40, %rax
addq $-0x40, %rbx
jne 0x38f0
leaq 0x8(%r12), %rax
movq %rax, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
testl %ebp, %ebp
jle 0x39ca
leaq 0x40(%rsp), %r13
movl 0xc(%rsp), %ebp
addq $0x30, %r12
xorl %r14d, %r14d
leaq 0x30(%rsp), %rbx
movl (%r15,%r14,4), %esi
leaq 0x28(%rsp), %rdi
movl $0x1, %edx
callq 0x238c
movq 0x28(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x23d6
movw $0x101, 0x60(%rsp)      # imm = 0x101
movl %r14d, 0x64(%rsp)
movl %r14d, 0x68(%rsp)
movl %r14d, 0x6c(%rsp)
movl %r14d, 0x70(%rsp)
movq 0x38(%rsp), %rax
movq %rax, -0x28(%r12)
leaq -0x20(%r12), %rdi
movq %r13, %rsi
callq 0x2190
movl 0x30(%r13), %eax
movl %eax, 0x10(%r12)
movups 0x20(%r13), %xmm0
movups %xmm0, (%r12)
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x39ba
callq 0x2120
incq %r14
addq $0x40, %r12
cmpq %r14, %rbp
jne 0x3934
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %ecx
movl %ecx, %r8d
callq 0x2b1e
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/pokorj54[P]Pathfinder-utilities/src/SGsearch.cpp
// Function: SGCategory::Print() const
void SGCategory::Print() const
{
    int64_t possibleVariations = pow(maxDiceValue, noDices);
    int64_t possibleLimitedVariations = pow(limitedDiceValue, noDices);
    cout << setprecision(5)  << "NoD: " << noDices << ", SL: " << spellLevel<< " = PC: "
        << possibleVariations << ", SC: " << successfulVariations << ", PLC: " << possibleLimitedVariations 
        << ", SLC: " << successfulLimitedVariations << " -> Rate: "
        << (double)successfulVariations/possibleVariations << "(" << (double)successfulLimitedVariations/possibleLimitedVariations 
        << ")" << endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cvtsi2sdl (%rdi), %xmm0
mulsd 0x105f(%rip), %xmm0     # 0x50e8
callq 0x2100
cvttsd2si %xmm0, %r15
cvtsi2sdl (%rbx), %xmm1
movsd 0x1121(%rip), %xmm0     # 0x51c0
callq 0x2210
cvttsd2si %xmm0, %r14
movq 0x2f28(%rip), %r12      # 0x6fd8
movq (%r12), %rax
movq -0x18(%rax), %rax
movq $0x5, 0x8(%r12,%rax)
leaq 0x11b0(%rip), %rsi      # 0x5278
movl $0x5, %edx
movq %r12, %rdi
callq 0x2170
movl (%rbx), %esi
movq %r12, %rdi
callq 0x2200
movq %rax, %r12
leaq 0x1195(%rip), %rsi      # 0x527e
movl $0x6, %edx
movq %rax, %rdi
callq 0x2170
movl 0x4(%rbx), %esi
movq %r12, %rdi
callq 0x2200
movq %rax, %r12
leaq 0x117a(%rip), %rsi      # 0x5285
movl $0x7, %edx
movq %rax, %rdi
callq 0x2170
movq %r12, %rdi
movq %r15, %rsi
callq 0x2130
movq %rax, %r12
leaq 0x1160(%rip), %rsi      # 0x528d
movl $0x6, %edx
movq %rax, %rdi
callq 0x2170
movq 0x10(%rbx), %rsi
movq %r12, %rdi
callq 0x2130
movq %rax, %r12
leaq 0x1144(%rip), %rsi      # 0x5294
movl $0x7, %edx
movq %rax, %rdi
callq 0x2170
movq %r12, %rdi
movq %r14, %rsi
callq 0x2130
movq %rax, %r12
leaq 0x112a(%rip), %rsi      # 0x529c
movl $0x7, %edx
movq %rax, %rdi
callq 0x2170
movq 0x18(%rbx), %rsi
movq %r12, %rdi
callq 0x2130
movq %rax, %r12
leaq 0x110f(%rip), %rsi      # 0x52a4
movl $0xa, %edx
movq %rax, %rdi
callq 0x2170
xorps %xmm0, %xmm0
cvtsi2sdq 0x10(%rbx), %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r15, %xmm1
divsd %xmm1, %xmm0
movq %r12, %rdi
callq 0x21e0
movq %rax, %r15
leaq 0xf99(%rip), %rsi       # 0x5162
movl $0x1, %edx
movq %rax, %rdi
callq 0x2170
xorps %xmm0, %xmm0
cvtsi2sdq 0x18(%rbx), %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r14, %xmm1
divsd %xmm1, %xmm0
movq %r15, %rdi
callq 0x21e0
movq %rax, %rbx
leaq 0xf67(%rip), %rsi       # 0x5164
movl $0x1, %edx
movq %rax, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x20c0
// File: /workspace/github_cpp_makefile_star2_O1/akw0088[P]openssl/aes_enc.cpp
// Function: main
int main(int argc, char *argv[])
{
	if (argc < 3)
	{
		printf("Usage:\taes_enc 256bit_key 128bit_iv plaintext\r\n");
		printf("Example:\taes_enc 01234567890123456789012345678901 0123456789012345 HelloWorld!\r\n");
		return -1;
	}

	/* A 256 bit key */
	unsigned char *key = (unsigned char *)argv[1];

	/* A 128 bit IV */
	unsigned char *iv = (unsigned char *)argv[2];

	/* Message to be encrypted */
	unsigned char *plaintext = (unsigned char *)argv[3];

	/*
	 * Buffer for ciphertext. Ensure the buffer is long enough for the
	 * ciphertext which may be longer than the plaintext, depending on the
	 * algorithm and mode.
	 */
	unsigned char *ciphertext = (unsigned char *)malloc(strlen((char *)plaintext) * 2);
	if (ciphertext == NULL)
	{
		perror("malloc failed");
		return -1;
	}


	int ciphertext_len;

	/* Encrypt the plaintext */
	ciphertext_len = encrypt (plaintext, strlen ((char *)plaintext), key, iv, ciphertext);

	/* Do something useful with the ciphertext here */
	printf("Ciphertext is:\n");
	BIO_dump_fp (stdout, (const char *)ciphertext, ciphertext_len);

	write_file((char *)"file.enc", (char *)ciphertext, ciphertext_len);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jg 0x140d
leaq 0xc77(%rip), %rdi       # 0x206c
callq 0x1180
leaq 0xc9a(%rip), %rdi       # 0x209b
callq 0x1180
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1481
movq 0x8(%rsi), %r14
movq 0x10(%rsi), %r15
movq 0x18(%rsi), %r12
movq %r12, %rdi
callq 0x1080
movq %rax, %r13
leaq (%rax,%rax), %rdi
callq 0x1160
testq %rax, %rax
je 0x1490
movq %rax, %rbx
movq %r12, %rdi
movl %r13d, %esi
movq %r14, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x14a1
movl %eax, %r14d
leaq 0xc0a(%rip), %rdi       # 0x205d
callq 0x1180
movq 0x2b69(%rip), %rax      # 0x3fc8
movq (%rax), %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x10c0
leaq 0xbc4(%rip), %rdi       # 0x2038
movq %rbx, %rsi
movl %r14d, %edx
callq 0x135e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb93(%rip), %rdi       # 0x202a
callq 0x1100
jmp 0x1406
// File: /workspace/github_cpp_makefile_star2_O1/jaldhar[P]Lets-Build-a-Simple-Interpreter/calc1.cc
// Function: Interpreter::expression()
long Interpreter::expression() {

    // set current token to the first token taken from the input
    _current_token = get_next_token();

    // we expect the current token to be an integer
    Token left = _current_token;
    eat(TOKENTYPE::INTEGER);

    // we expect the current token to be a '+' or '-' token
    Token op = _current_token;
    if (op.type == TOKENTYPE::PLUS) {
        eat(TOKENTYPE::PLUS);
        return plus(left.value);
    }

    if (op.type == TOKENTYPE::MINUS) {
        eat(TOKENTYPE::MINUS);
        return minus(left.value);
    }

    return 0L; // An exception should have been thrown before we ever get here.
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x2472
movq %rdx, %r14
movl %eax, 0x10(%rbx)
movq %rdx, 0x18(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x26e6
movl 0x10(%rbx), %eax
cmpl $0x3, %eax
je 0x2440
cmpl $0x2, %eax
jne 0x2466
movq %rbx, %rdi
movl $0x2, %esi
callq 0x26e6
movq 0x18(%rbx), %r15
addq %r14, %r15
movq %rbx, %rdi
movl $0x1, %esi
callq 0x26e6
jmp 0x2469
movq %rbx, %rdi
movl $0x3, %esi
callq 0x26e6
movq 0x18(%rbx), %rax
subq %rax, %r14
movq %rbx, %rdi
movl $0x1, %esi
callq 0x26e6
movq %r14, %r15
jmp 0x2469
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/ctSkennerton[P]fxtract/util/ordhuff_x.c
// Function: main
int
main (int argc, char **argv)
{
    unsigned        freq[MAXTEST], code[MAXTEST], bits[MAXTEST];
    char            zcode[33];
    int             i, ncodes;

    if (argc != 2)
        return fputs ("Usage: ordhuff_x (freqfile | -)\n", stderr);

    FILE           *finp =
        strcmp (argv[1], "-") ? fopen (argv[1], "r") : stdin;

    if (!finp)
        return 1;

    for (ncodes = 0; 
         ncodes < MAXTEST && fscanf (finp, "%ud", &freq[ncodes]) == 1; 
        ++ncodes);

    ordhuff(ncodes, freq, code, bits);

    unsigned        raw = 0, pkd = 0;

    for (i = 0; i < ncodes; ++i) {
        prbits(zcode, (int) code[i], (int) bits[i]);
        printf ("%4d %8d %s\n", i, freq[i], zcode);
        raw += freq[i];
        pkd += freq[i] * strlen (zcode);
    }

    fprintf (stderr, "Exprevbits: %4.2f\n", (float) pkd / raw);
    return 0;
}

// Assembly:
cmpl $0x2, %edi
jne 0x13a3
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2f18, %rsp           # imm = 0x2F18
movq 0x8(%rsi), %rbx
leaq 0x1cd4(%rip), %rsi      # 0x3031
movq %rbx, %rdi
callq 0x1150
testl %eax, %eax
je 0x137d
leaq 0x20fd(%rip), %rsi      # 0x346d
movq %rbx, %rdi
callq 0x10e0
movq %rax, %r14
jmp 0x1387
movq 0x3c54(%rip), %rax      # 0x4fd8
movq (%rax), %r14
movl $0x1, %eax
testq %r14, %r14
jne 0x13b9
addq $0x2f18, %rsp           # imm = 0x2F18
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3c36(%rip), %rax      # 0x4fe0
movq (%rax), %rsi
leaq 0x1c5c(%rip), %rdi      # 0x3010
jmp 0x10d0
leaq 0x30(%rsp), %r15
leaq 0x1c6e(%rip), %r12      # 0x3033
xorl %ebx, %ebx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1190
cmpl $0x1, %eax
jne 0x13f1
incq %rbx
addq $0x4, %r15
cmpq $0x3e8, %rbx            # imm = 0x3E8
jne 0x13c7
movl $0x3e8, %ebx            # imm = 0x3E8
leaq 0x30(%rsp), %rsi
leaq 0x1f70(%rsp), %rdx
leaq 0xfd0(%rsp), %rcx
movl %ebx, %edi
callq 0x14cc
testl %ebx, %ebx
jne 0x141e
movsd 0x1bef(%rip), %xmm0     # 0x3008
jmp 0x14ac
movl %ebx, %r12d
movq %rsp, %r14
xorl %r15d, %r15d
xorl %r13d, %r13d
xorl %ebp, %ebp
movl 0x1f70(%rsp,%r15,4), %eax
movslq 0xfd0(%rsp,%r15,4), %rcx
movb $0x0, (%rsp,%rcx)
testq %rcx, %rcx
jle 0x145f
incq %rcx
movl %eax, %edx
andb $0x1, %dl
orb $0x30, %dl
movb %dl, -0x2(%rsp,%rcx)
sarl %eax
decq %rcx
cmpq $0x1, %rcx
jg 0x1448
movl 0x30(%rsp,%r15,4), %edx
leaq 0x1bcc(%rip), %rdi      # 0x3037
movl %r15d, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x1030
movl 0x30(%rsp,%r15,4), %ebx
addl %ebx, %ebp
movq %r14, %rdi
callq 0x1060
imull %ebx, %eax
addl %eax, %r13d
incq %r15
cmpq %r12, %r15
jne 0x142c
movl %r13d, %eax
cvtsi2ss %rax, %xmm0
movl %ebp, %eax
cvtsi2ss %rax, %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x3b2d(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1b86(%rip), %rsi      # 0x3043
movb $0x1, %al
callq 0x1170
xorl %eax, %eax
jmp 0x1391
nop
// File: /workspace/github_cpp_makefile_star2_O1/maramire[P]SP_PSO/parallel_main.cpp
// Function: showPermutation(std::vector<int, std::allocator<int>>)
void showPermutation(vector<int> permutation)
{
    for (int i=0; i<permutation.size(); i++){
        cout << permutation[i];
        cout << ", ";
    }
    cout <<endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0x2af6
movq %rdi, %rbx
xorl %r12d, %r12d
movq 0x751b(%rip), %r14      # 0x9fd8
leaq 0x45ac(%rip), %r15      # 0x7070
movl (%rax,%r12,4), %esi
movq %r14, %rdi
callq 0x22e0
movl $0x2, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
incq %r12
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
ja 0x2ac4
movq 0x74db(%rip), %rbx      # 0x9fd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2110
// File: /workspace/github_cpp_makefile_star2_O1/maramire[P]SP_PSO/parallel_main.cpp
// Function: HR(std::vector<Item, std::allocator<Item>>&, Strip&, int, Particle&)
void HR(Item_vector &items, Strip &s, int n_items, Particle &particle)
{

    vector<int> permutation = particle.permutation;
    int fitness = 0;
    int i = 0;

    while(!permutation.empty())
    {
        
        int item_id = permutation[i]-1;
        int original_height;
        
        if (items[item_id].height > items[item_id].width)
        {
            original_height = items[item_id].height;
            items[item_id].height = items[item_id].width;
            items[item_id].width = original_height;
            items[item_id].rotated = 1;
        }           

        /* it is already defined, but convenience */
        items[item_id].x_position = s.x_position;
        items[item_id].y_position = s.y_position; 

        fitness += items[item_id].height;         

        /* Resize strip S1 */
        Strip s1 = {};
        s1.y_position = s.y_position + items[item_id].height;
        s1.x_position = s.x_position;
        s1.height = s.height - items[item_id].height;
        s1.width = s.width;

        /* Generate new strip S2 */
        Strip s2 = {};
        s2.x_position = s.x_position + items[item_id].width;
        s2.y_position = s.y_position;
        s2.height = items[item_id].height;
        s2.width = s.width - items[item_id].width;

        s = s1;

        /* Erase */
        permutation.erase(permutation.begin() + i);

        RecursePacking(s2,permutation,items);

    }      
            
    particle.fitness = fitness;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq -0x60(%rbp), %r12
movq %r12, %rdi
movq %rcx, -0x48(%rbp)
movq %rcx, %rsi
callq 0x4124
movq (%r12), %rdi
movq 0x8(%r12), %rdx
xorl %ebx, %ebx
cmpq %rdx, %rdi
je 0x2e5f
movslq (%rdi), %rax
movq (%r15), %rsi
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %r8
addq %rax, %r8
leaq (%rsi,%r8), %rax
movl -0x18(%rsi,%r8), %ecx
movl -0x14(%rsi,%r8), %esi
cmpl %esi, %ecx
jle 0x2ddb
movl %esi, -0x18(%rax)
movl %ecx, -0x14(%rax)
movl $0x1, -0x4(%rax)
movl 0x8(%r14), %ecx
movl %ecx, -0xc(%rax)
movl 0xc(%r14), %esi
movl %esi, -0x8(%rax)
movl -0x18(%rax), %r12d
leal (%r12,%rsi), %r8d
movl (%r14), %r9d
movl 0x4(%r14), %r10d
subl %r12d, %r9d
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movl -0x14(%rax), %r11d
leal (%r11,%rcx), %r13d
movl %r13d, -0x38(%rbp)
movl %esi, -0x34(%rbp)
movl -0x18(%rax), %eax
movl %eax, -0x40(%rbp)
subl %r11d, %r10d
movl %r10d, -0x3c(%rbp)
movl %r9d, (%r14)
movl %ecx, 0x8(%r14)
movl %r8d, 0xc(%r14)
leaq 0x4(%rdi), %rsi
cmpq %rdx, %rsi
je 0x2e3a
subq %rsi, %rdx
callq 0x22a0
addl %r12d, %ebx
addq $-0x4, -0x58(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movq %r15, %rdx
callq 0x2bc1
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rdx
jmp 0x2da2
movq -0x48(%rbp), %rax
movl %ebx, 0x18(%rax)
testq %rdi, %rdi
je 0x2e77
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x21c0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/maramire[P]SP_PSO/parallel_main.cpp
// Function: showRectangles(std::vector<Item, std::allocator<Item>>)
void showRectangles(Item_vector items)
{
    /* Print all rectangles and its information */
    cout << "-> Printing rectangles of instance and its information!"<<endl;
    cout << "-------------------------------------------------------"<<endl;
    cout << "AreaID, X,      Y,     Width,  Height,  Rotated?"<<endl;
    
    for (int i = 0; i < items.size(); i++)
    {
        cout << items[i].id << "	" << items[i].x_position;
        cout << "	" << items[i].y_position << "	";
        cout << items[i].width << "	" << items[i].height << "	"; 
        cout << items[i].rotated <<endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x713a(%rip), %r14      # 0x9fd8
leaq 0x41ce(%rip), %rsi      # 0x7073
movl $0x37, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x41cb(%rip), %rsi      # 0x70ab
movl $0x37, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x41c8(%rip), %rsi      # 0x70e3
movl $0x30, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x3086
xorl %r13d, %r13d
xorl %r14d, %r14d
movl (%rax,%r13), %esi
movq 0x706b(%rip), %rdi      # 0x9fd8
callq 0x22e0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %r15
leaq 0x418d(%rip), %rbx      # 0x7114
movq %rbx, %rsi
callq 0x21e0
movq (%r15), %rax
movl 0x10(%rax,%r13), %esi
movq %r12, %rdi
callq 0x22e0
movl $0x1, %edx
movq 0x702d(%rip), %r12      # 0x9fd8
movq %r12, %rdi
movq %rbx, %rsi
callq 0x21e0
movq (%r15), %rax
movl 0x14(%rax,%r13), %esi
movq %r12, %rdi
callq 0x22e0
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21e0
movq (%r15), %rax
movl 0x8(%rax,%r13), %esi
movq %r12, %rdi
callq 0x22e0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21e0
movq (%r15), %rax
movl 0x4(%rax,%r13), %esi
movq %r12, %rdi
callq 0x22e0
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rbx
callq 0x21e0
movq (%r15), %rax
movl 0x18(%rax,%r13), %esi
movq 0x6fad(%rip), %rdi      # 0x9fd8
callq 0x22e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
incq %r14
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movabsq $0x6db6db6db6db6db7, %rdx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rdx, %rcx
addq $0x1c, %r13
cmpq %r14, %rcx
ja 0x2f62
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/richardposner[P]BioNetFit2/src/code/Config.cpp
// Function: Config::Config(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Config::Config(string configFile) {
	swarm_ = 0;
	verbose=false; //razi added
	configPath_ = convertToAbsPath(configFile);
	//cout << "*** configFile: " << configPath_ << endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x10(%rdi), %rbx
leaq 0x20(%rdi), %r15
movq %r15, 0x10(%rdi)
xorl %eax, %eax
movq %rax, 0x18(%rdi)
movb %al, 0x20(%rdi)
movq %rax, 0x8(%rdi)
movb %al, (%rdi)
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x32180
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xbe434
leaq 0x28(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22bb0
movq (%r14), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x28f1c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x28f33
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x28f5e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x28f5e
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x28f71
movq (%r15), %rsi
incq %rsi
callq 0x229c0
movq %r14, %rdi
callq 0x23240
nop
// File: /workspace/github_cpp_makefile_star2_O1/richardposner[P]BioNetFit2/src/code/Data.cpp
// Function: Data::getColumnAverages()
void Data::getColumnAverages() {
	double sum;
	int counter;
	for(map<string,map<double,double> >::iterator c = dataCurrent->begin(); c != dataCurrent->end(); ++c) {
		//cout << "gca col loop" << endl;

		sum = 0;
		counter = 0;

		for(map<double,double>::iterator v = c->second.begin(); v != c->second.end(); ++v) {
			//cout << "gca tp loop" << endl;
			if (std::isnan(v->second)) {
				continue;
			}

			sum += v->second;
			counter++;
		}
		colAverages.insert(pair<string,double>(c->first,sum/counter));
	}



}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq (%rdi), %rax
movq 0x18(%rax), %r14
addq $0x8, %rax
cmpq %rax, %r14
je 0x4995f
movq %rdi, %rbx
leaq 0x38(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %r15
leaq 0x10(%rsp), %r12
movq 0x58(%r14), %rax
leaq 0x48(%r14), %rbp
movsd 0xad28e(%rip), %xmm0    # 0xf6b30
cmpq %rbp, %rax
je 0x498f8
xorl %r13d, %r13d
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movsd 0x28(%rax), %xmm0
xorl %ecx, %ecx
ucomisd %xmm0, %xmm0
setnp %dl
jp 0x498d1
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movb %dl, %cl
addl %ecx, %r13d
movq %rax, %rdi
callq 0x22670
cmpq %rbp, %rax
jne 0x498b3
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
movsd %xmm0, (%rsp)
movq %r15, 0x10(%rsp)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x32180
movsd (%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x4d33e
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x49944
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %r14, %rdi
callq 0x22670
movq %rax, %r14
movq (%rbx), %rax
addq $0x8, %rax
cmpq %rax, %r14
jne 0x49892
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x49988
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O1/richardposner[P]BioNetFit2/src/code/Data.cpp
// Function: Data::divideByInit()
void Data::divideByInit() {
	for(map<string,map<double,double> >::iterator c = dataCurrent->begin(); c != dataCurrent->end(); ++c) {
		for(map<double,double>::iterator v = c->second.begin(); v != c->second.end(); ++v) {
			if (v->second == 0) {
				swarm_->outputError("You chose to divide_by_init, but the first value in the column '" + c->first + "' is 0. We cannot divide by 0.");
			}
			if (std::isnan(v->second)) {
				dataDividedByInit_[c->first][v->first] = nan("1");
				continue;
			}
			dataDividedByInit_[c->first][v->first] = v->second / c->second.begin()->first;
			//cout << "dividing t=" << v->first << " of " << v->second << "by " << c->first << " init of " << c->second.begin()->first << endl;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, (%rsp)
movq (%rdi), %rax
movq 0x18(%rax), %r14
addq $0x8, %rax
cmpq %rax, %r14
je 0x49b34
movq (%rsp), %rax
addq $0x120, %rax            # imm = 0x120
movq %rax, 0x30(%rsp)
movq 0x58(%r14), %rbp
leaq 0x48(%r14), %rbx
cmpq %rbx, %rbp
je 0x49b15
leaq 0x20(%r14), %r12
movsd 0x28(%rbp), %xmm0
ucomisd 0xad151(%rip), %xmm0    # 0xf6b38
jne 0x49ab1
jp 0x49ab1
movq (%rsp), %rax
movq 0x150(%rax), %r13
leaq 0x38(%rsp), %r15
movq %r15, %rdi
leaq 0xad3ce(%rip), %rsi     # 0xf6ddb
movq %r12, %rdx
callq 0x319d8
movq %r15, %rdi
leaq 0xad3fd(%rip), %rsi     # 0xf6e1c
callq 0x233b0
leaq 0x20(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x49a4c
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x49a54
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0x78b66
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x49a95
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x49ab1
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x229c0
movsd 0x28(%rbp), %xmm0
ucomisd %xmm0, %xmm0
jp 0x49b07
movq 0x58(%r14), %rax
divsd 0x20(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x20(%rbp), %r13
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x4a3f4
movq %rax, %rdi
movq %r13, %rsi
callq 0x4a556
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbp, %rdi
callq 0x22670
movq %rax, %rbp
cmpq %rbx, %rax
jne 0x499da
jmp 0x49b15
leaq 0xaf0ee(%rip), %rdi     # 0xf8bfc
callq 0x22130
jmp 0x49ac5
movq %r14, %rdi
callq 0x22670
movq %rax, %r14
movq (%rsp), %rax
movq (%rax), %rax
addq $0x8, %rax
cmpq %rax, %r14
jne 0x499c5
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x49b67
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x49b67
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x49b83
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %r14, %rdi
callq 0x23240
nop
// File: /workspace/github_cpp_makefile_star2_O1/richardposner[P]BioNetFit2/src/code/Data.cpp
// Function: Data::logTransformData()
void Data::logTransformData() {
	for(map<string,map<double,double> >::iterator c = dataCurrent->begin(); c != dataCurrent->end(); ++c) {
		for(map<double,double>::iterator v = c->second.begin(); v != c->second.end(); ++v) {
			if (v->second == 0) {
				swarm_->outputError("You chose to log transform simulation output, but the first value in the column '" + c->first + "' is 0. We cannot take the log of 0.");
			}
			else if (std::isnan(v->second)) {
				dataLogTransformed_[c->first][v->first] = nan("1");
				continue;
			}
			dataLogTransformed_[c->first][v->first] = log10(v->second)/log10(swarm_->options.logTransformSimData);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq (%rdi), %rcx
movq 0x18(%rcx), %rax
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x49d4a
movq %rdi, %rbx
leaq 0xf0(%rdi), %rcx
movq %rcx, 0x30(%rsp)
movq 0x58(%rax), %rbp
movq %rax, 0x8(%rsp)
leaq 0x48(%rax), %r13
cmpq %r13, %rbp
je 0x49d30
movq 0x8(%rsp), %rax
leaq 0x20(%rax), %r12
movsd 0x28(%rbp), %xmm0
ucomisd 0xacf4f(%rip), %xmm0    # 0xf6b38
jne 0x49c42
jp 0x49c42
movq 0x150(%rbx), %r14
leaq 0x38(%rsp), %r15
movq %r15, %rdi
leaq 0xad238(%rip), %rsi     # 0xf6e3b
movq %r12, %rdx
callq 0x319d8
movq %r15, %rdi
leaq 0xad278(%rip), %rsi     # 0xf6e8d
callq 0x233b0
leaq 0x20(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x49c5e
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x49c66
ucomisd %xmm0, %xmm0
jnp 0x49cc3
leaq 0xaefad(%rip), %rdi     # 0xf8bfc
callq 0x22130
movsd %xmm0, (%rsp)
jmp 0x49cf7
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x78b66
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x49ca7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x49cc3
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x229c0
movsd 0x28(%rbp), %xmm0
callq 0x22480
movsd %xmm0, (%rsp)
movq 0x150(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2sdl 0x1640(%rax), %xmm0
callq 0x22480
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
leaq 0x20(%rbp), %r14
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x4a3f4
movq %rax, %rdi
movq %r14, %rsi
callq 0x4a556
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbp, %rdi
callq 0x22670
movq %rax, %rbp
cmpq %r13, %rax
jne 0x49bdc
movq 0x8(%rsp), %rdi
callq 0x22670
movq (%rbx), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
jne 0x49bbd
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x49d7d
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x49d7d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x49d99
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
nop