LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/PDSampling.cpp
// Function: PDSampler::addPoint(Vec2)
void PDSampler::addPoint(Vec2 pt)
{
	int i, gx, gy, *cell;

	points.push_back(pt);

	if (m_grid) {
		getGridXY(pt, &gx, &gy);
		cell = m_grid[gy*m_gridSize + gx];
		for (i=0; i<kMaxPointsPerCell; i++) {
			if (cell[i]==-1) {
				cell[i] = (int) points.size()-1;
				break;
			}
		}
		if (i==kMaxPointsPerCell) {
			printf("Internal error, overflowed max points per grid cell. Exiting.\n");
			exit(1);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %rsi
movlps %xmm0, (%rsi)
addq $0x13b8, %rdi           # imm = 0x13B8
callq 0x4824
cmpq $0x0, 0x13a8(%rbx)
je 0x3147
movq %rsp, %rsi
leaq 0xc(%rsp), %r14
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x3016
movl 0x13b0(%rbx), %eax
imull (%r15), %eax
addl (%r14), %eax
cltq
imulq $0x24, %rax, %rax
addq 0x13a8(%rbx), %rax
xorl %ecx, %ecx
cmpq $0x9, %rcx
je 0x3151
cmpl $-0x1, (%rax,%rcx,4)
je 0x3130
incq %rcx
jmp 0x311f
movq 0x13c0(%rbx), %rdx
subq 0x13b8(%rbx), %rdx
shrq $0x3, %rdx
decl %edx
movl %edx, (%rax,%rcx,4)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8328(%rip), %rdi      # 0xb480
callq 0x2280
pushq $0x1
popq %rdi
callq 0x21f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/PDSampling.cpp
// Function: PDSampler::findNeighbors(Vec2&, float)
int PDSampler::findNeighbors(Vec2 &pt, float distance)
{
	if (!m_grid) {
		printf("Internal error, sampler cannot search without grid.\n");
		exit(1);
	}

	float distanceSqrd = distance*distance;
	int i, j, k, gx, gy, N = (int) ceil(distance/m_gridCellSize);
	if (N>(m_gridSize>>1)) N = m_gridSize>>1;
	
	m_neighbors.clear();
	getGridXY(pt, &gx, &gy);
	for (j=-N; j<=N; j++) {
		for (i=-N; i<=N; i++) {
			int cx = (gx+i+m_gridSize)%m_gridSize;
			int cy = (gy+j+m_gridSize)%m_gridSize;
			int *cell = m_grid[cy*m_gridSize + cx];

			for (k=0; k<kMaxPointsPerCell; k++) {
				if (cell[k]==-1) {
					break;
				} else {
					if (getDistanceSquared(pt, points[cell[k]])<distanceSqrd)
						m_neighbors.push_back(cell[k]);
				}
			}
		}
	}

	return (int) m_neighbors.size();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpq $0x0, 0x13a8(%rdi)
je 0x32ec
movq %rsi, %r14
movq %rdi, %rbx
movss %xmm0, 0xc(%rsp)
divss 0x13b4(%rdi), %xmm0
callq 0x20c0
cvttss2si %xmm0, %eax
movl 0x13b0(%rbx), %ebp
sarl %ebp
cmpl %eax, %ebp
cmovgel %eax, %ebp
movq 0x1390(%rbx), %rax
cmpq %rax, 0x1398(%rbx)
je 0x31c3
movq %rax, 0x1398(%rbx)
movss 0xc(%rsp), %xmm0
mulss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
leaq 0x1390(%rbx), %r15
leaq 0x34(%rsp), %r12
leaq 0x30(%rsp), %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x3016
movl %ebp, %eax
negl %eax
movl (%r12), %ecx
movq %rcx, 0x20(%rsp)
movl (%r13), %ecx
movl %ecx, 0x18(%rsp)
incl %ebp
cmpl %ebp, %eax
movl %ebp, 0x1c(%rsp)
cmovgl %eax, %ebp
movl %ebp, 0x14(%rsp)
movl %eax, 0x10(%rsp)
movl %eax, %edi
cmpl 0x14(%rsp), %edi
je 0x32cb
movl 0x10(%rsp), %eax
movl %eax, %r13d
movq %rdi, 0x28(%rsp)
cmpl 0x1c(%rsp), %r13d
je 0x32c4
movq 0x20(%rsp), %rax
addl %r13d, %eax
movl 0x13b0(%rbx), %esi
addl %esi, %eax
cltd
idivl %esi
movl %edx, %ecx
leal (%rsi,%rdi), %eax
addl 0x18(%rsp), %eax
cltd
idivl %esi
imull %esi, %edx
addl %ecx, %edx
movslq %edx, %rax
imulq $0x24, %rax, %r12
addq 0x13a8(%rbx), %r12
xorl %ebp, %ebp
cmpq $0x24, %rbp
je 0x32b7
movslq (%r12,%rbp), %rdx
cmpq $-0x1, %rdx
je 0x32b7
shlq $0x3, %rdx
addq 0x13b8(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4842
movss 0xc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x32b1
leaq (%r12,%rbp), %rsi
movq %r15, %rdi
callq 0x4868
addq $0x4, %rbp
jmp 0x3274
incl %r13d
movq 0x28(%rsp), %rdi
jmp 0x3235
incl %edi
jmp 0x321f
movq 0x1398(%rbx), %rax
subq 0x1390(%rbx), %rax
shrq $0x2, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x81cb(%rip), %rdi      # 0xb4be
callq 0x2280
pushq $0x1
popq %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/PDSampling.cpp
// Function: PDSampler::findClosestNeighbor(Vec2&, float)
float PDSampler::findClosestNeighbor(Vec2 &pt, float distance)
{
	if (!m_grid) {
		printf("Internal error, sampler cannot search without grid.\n");
		exit(1);
	}

	float closestSqrd = distance*distance;
	int i, j, k, gx, gy, N = (int) ceil(distance/m_gridCellSize);
	if (N>(m_gridSize>>1)) N = m_gridSize>>1;
	
	getGridXY(pt, &gx, &gy);
	for (j=-N; j<=N; j++) {
		for (i=-N; i<=N; i++) {
			int cx = (gx+i+m_gridSize)%m_gridSize;
			int cy = (gy+j+m_gridSize)%m_gridSize;
			int *cell = m_grid[cy*m_gridSize + cx];

			for (k=0; k<kMaxPointsPerCell; k++) {
				if (cell[k]==-1) {
					break;
				} else {
					float d = getDistanceSquared(pt, points[cell[k]]);

					if (d<closestSqrd)
						closestSqrd = d;
				}
			}
		}
	}

	return sqrt(closestSqrd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpq $0x0, 0x13a8(%rdi)
je 0x345a
movq %rsi, %rbx
movq %rdi, %r14
movaps %xmm0, %xmm1
mulss %xmm0, %xmm1
movss %xmm1, 0x4(%rsp)
divss 0x13b4(%rdi), %xmm0
callq 0x20c0
cvttss2si %xmm0, %eax
movl 0x13b0(%r14), %ebp
sarl %ebp
cmpl %eax, %ebp
cmovgel %eax, %ebp
leaq 0x24(%rsp), %r15
leaq 0x20(%rsp), %r12
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x3016
movl %ebp, %eax
negl %eax
movl (%r15), %ecx
movq %rcx, 0x18(%rsp)
movl (%r12), %ecx
movl %ecx, 0x10(%rsp)
incl %ebp
cmpl %ebp, %eax
movl %ebp, 0x14(%rsp)
cmovgl %eax, %ebp
movl %ebp, 0xc(%rsp)
movl %eax, 0x8(%rsp)
movl %eax, %r13d
cmpl 0xc(%rsp), %r13d
je 0x3423
movl 0x8(%rsp), %eax
movl %eax, %ebp
cmpl 0x14(%rsp), %ebp
je 0x341b
movq 0x18(%rsp), %rax
addl %ebp, %eax
movl 0x13b0(%r14), %esi
addl %esi, %eax
cltd
idivl %esi
movl %edx, %ecx
leal (%rsi,%r13), %eax
addl 0x10(%rsp), %eax
cltd
idivl %esi
imull %esi, %edx
addl %ecx, %edx
movslq %edx, %rax
imulq $0x24, %rax, %r15
addq 0x13a8(%r14), %r15
xorl %r12d, %r12d
cmpq $0x9, %r12
je 0x3417
movslq (%r15,%r12,4), %rdx
cmpq $-0x1, %rdx
je 0x3417
shlq $0x3, %rdx
addq 0x13b8(%r14), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4842
minss 0x4(%rsp), %xmm0
incq %r12
movss %xmm0, 0x4(%rsp)
jmp 0x33e0
incl %ebp
jmp 0x33a4
incl %r13d
jmp 0x3393
xorps %xmm0, %xmm0
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
movaps %xmm1, %xmm0
jb 0x3447
sqrtss %xmm0, %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2310
leaq 0x805d(%rip), %rdi      # 0xb4be
callq 0x2280
pushq $0x1
popq %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/PDSampling.cpp
// Function: PDSampler::maximize()
void PDSampler::maximize()
{
	RangeList rl(0,0);
	int i, N = (int) points.size();

	for (i=0; i<N; i++) {
		Vec2 &candidate = points[i];

		rl.reset(0, (float) M_PI*2);
		findNeighborRanges(i, rl);
		while (rl.numRanges) {
			RangeEntry &re = rl.ranges[m_rng.getInt31()%rl.numRanges];
			float angle = re.min + (re.max-re.min)*m_rng.getFloatL();
			Vec2 pt = getTiled(Vec2(candidate.x + cos(angle)*2*radius,
									candidate.y + sin(angle)*2*radius));

			addPoint(pt);
			rl.subtract(angle - (float) M_PI/3, angle + (float) M_PI/3);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x28(%rsp), %r14
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %r14, %rdi
callq 0x68d4
movq 0x13c0(%rbx), %rax
subq 0x13b8(%rbx), %rax
shrq $0x3, %rax
xorl %r15d, %r15d
testl %eax, %eax
cmovlel %r15d, %eax
movq %rax, 0x38(%rsp)
leaq 0x8(%rbx), %r12
cmpq 0x38(%rsp), %r15
je 0x3911
movq 0x13b8(%rbx), %rbp
xorps %xmm0, %xmm0
movq %r14, %rdi
movss 0x5c94(%rip), %xmm1     # 0x9484
callq 0x6924
movq %rbx, %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x346e
cmpl $0x0, 0x30(%rsp)
je 0x3909
movq 0x28(%rsp), %r13
movq %r12, %rdi
callq 0x266e
movslq 0x30(%rsp), %rcx
cqto
idivq %rcx
movss (%r13,%rdx,8), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x4(%r13,%rdx,8), %xmm0
movss %xmm0, 0xc(%rsp)
movq %r12, %rdi
callq 0x274a
movss 0xc(%rsp), %xmm1
movss 0x10(%rsp), %xmm2
subss %xmm2, %xmm1
mulss %xmm0, %xmm1
addss %xmm2, %xmm1
movss %xmm1, 0xc(%rsp)
movss (%rbp,%r15,8), %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm1, %xmm0
callq 0x2110
movaps %xmm0, 0x40(%rsp)
movss 0x13d0(%rbx), %xmm0
movaps %xmm0, 0x50(%rsp)
movss 0x4(%rbp,%r15,8), %xmm0
movaps 0x10(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movaps %xmm1, 0x10(%rsp)
movss 0xc(%rsp), %xmm0
callq 0x2160
movaps 0x40(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
addps %xmm1, %xmm1
movaps %xmm1, %xmm2
movss 0x13d0(%rbx), %xmm0
movaps 0x50(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
mulps %xmm2, %xmm1
addps 0x10(%rsp), %xmm1
movaps %xmm1, %xmm0
movq %rbx, %rdi
callq 0x2fb6
movq %rbx, %rdi
callq 0x30c0
movss 0xc(%rsp), %xmm1
movaps %xmm1, %xmm0
addss 0x5b94(%rip), %xmm0     # 0x9488
addss 0x5b90(%rip), %xmm1     # 0x948c
movq %r14, %rdi
callq 0x6a44
jmp 0x3803
incq %r15
jmp 0x37d0
leaq 0x28(%rsp), %rdi
callq 0x6938
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3930
jmp 0x3930
jmp 0x3930
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6938
movq %rbx, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/PDSampling.cpp
// Function: DartThrowing::complete()
void DartThrowing::complete()
{
	while (1) {
		int i, N = (int) points.size()*m_maxThrowsMult;
		if (N<m_minMaxThrows) N = m_minMaxThrows;

		for (i=0; i<N; i++) {
			Vec2 pt = randomPoint();

			findNeighbors(pt, 2*radius);

			if (!m_neighbors.size()) {
				addPoint(pt);
				break;
			}
		}

		if (i==N)
			break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq 0x13c0(%rbx), %r15
subq 0x13b8(%rbx), %r15
shrq $0x3, %r15
imull 0x13dc(%rbx), %r15d
movl 0x13d8(%rbx), %eax
cmpl %eax, %r15d
cmovlel %eax, %r15d
xorl %ebp, %ebp
testl %r15d, %r15d
movl $0x0, %r12d
cmovgl %r15d, %r12d
cmpl %ebp, %r12d
je 0x3d9d
movq %rbx, %rdi
callq 0x2f7c
movlps %xmm0, 0x8(%rsp)
movss 0x13d0(%rbx), %xmm0
addss %xmm0, %xmm0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3166
movq 0x1398(%rbx), %rax
cmpq 0x1390(%rbx), %rax
je 0x3da2
incl %ebp
jmp 0x3d60
movl %r12d, %ebp
jmp 0x3db0
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x30c0
cmpl %r15d, %ebp
jne 0x3d2a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/PDSampling.cpp
// Function: BestCandidate::complete()
void BestCandidate::complete()
{
	for (int i=0; i<m_N; i++) {
		Vec2 best(0,0);
		float bestDistance = 0;
		int count = 1 + (int) points.size()*m_multiplier;

		for (int j=0; j<count; j++) {
			Vec2 pt = randomPoint();
			float closest = 2;

			closest = findClosestNeighbor(pt, 4*radius);
			if (j==0 || closest>bestDistance) {
				bestDistance = closest;
				best = pt;
			}
		}

		addPoint(best);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorl %ebp, %ebp
leaq 0x8(%rsp), %r14
cmpl 0x13dc(%rbx), %ebp
jge 0x3ed2
movq 0x13c0(%rbx), %r15
subq 0x13b8(%rbx), %r15
shrq $0x3, %r15
imull 0x13d8(%rbx), %r15d
xorl %r12d, %r12d
xorps %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %rbx, %rdi
cmpl %r15d, %r12d
jg 0x3ec1
callq 0x2f7c
movlps %xmm0, 0x8(%rsp)
movss 0x13d0(%rbx), %xmm0
mulss 0x55ee(%rip), %xmm0     # 0x947c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3300
testl %r12d, %r12d
sete %al
ucomiss 0x4(%rsp), %xmm0
seta %cl
orb %al, %cl
je 0x3ebc
movsd 0x8(%rsp), %xmm1
movaps %xmm1, 0x10(%rsp)
movss %xmm0, 0x4(%rsp)
incl %r12d
jmp 0x3e6c
movaps 0x10(%rsp), %xmm0
callq 0x30c0
incl %ebp
jmp 0x3e32
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/PDSampling.cpp
// Function: PenroseSampler::complete()
void PenroseSampler::complete()
{
	PenroseQuasisampler s((unsigned int) (9.1/(radius*radius)));
	std::vector<Point2D> pts = s.getSamplingPoints();

	for (std::vector<Point2D>::iterator it=pts.begin(); it!=pts.end(); it++ ) {
		Vec2 pt((float) it->x/50.f - 1.0f, (float) it->y/50.f - 1.0f);

		if (pointInDomain(pt)) {
			addPoint(pt);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movss 0x13d0(%rdi), %xmm0
mulss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x4d1a(%rip), %xmm1     # 0x9418
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movaps 0x4db2(%rip), %xmm0     # 0x94c0
leaq 0x20(%rsp), %rsi
movups %xmm0, 0x10(%rsi)
andq $0x0, 0x8(%rsi)
leaq 0xb61d(%rip), %rcx      # 0xfd40
movq %rcx, (%rsi)
movl %eax, 0x20(%rsi)
leaq 0x8(%rsp), %rdi
callq 0x4c52
movq 0x8(%rsp), %r14
cmpq 0x10(%rsp), %r14
je 0x4797
movupd (%r14), %xmm0
cvtpd2ps %xmm0, %xmm0
divps 0x4d81(%rip), %xmm0     # 0x94d0
addps 0x4d4a(%rip), %xmm0     # 0x94a0
ucomiss 0x4d0f(%rip), %xmm0     # 0x946c
jb 0x4791
movaps %xmm0, %xmm1
cmpleps 0x4d76(%rip), %xmm1     # 0x94e0
unpcklps %xmm1, %xmm1            # xmm1 = xmm1[0,0,1,1]
movmskpd %xmm1, %eax
testb $0x2, %al
je 0x4791
testb $0x1, %al
je 0x4791
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
ucomiss 0x4ce5(%rip), %xmm1     # 0x946c
jb 0x4791
movq %rbx, %rdi
callq 0x30c0
addq $0x10, %r14
jmp 0x4738
leaq 0x8(%rsp), %rdi
callq 0x5f88
leaq 0x20(%rsp), %rdi
callq 0x4cba
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x47c5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5f88
leaq 0x20(%rsp), %rdi
callq 0x4cba
movq %rbx, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::insert(int, float)
void WeightedDiscretePDF<T>::insert(T item, float weight)
{
	WDPDF_Node<T> *p=0, *n=m_root;

	while (n) {
		if (n->leftIsRed() && n->rightIsRed())
			split(n);

		p = n;
		if (n->key==item) {
			throw std::domain_error("insert: argument(item) already in tree");
		} else {
			n = (item<n->key)?n->left:n->right;
		}
	}

	n = new WDPDF_Node<T>(item, weight, p);

	if (!p) {
		m_root = n;
	} else {
		if (item<p->key) {
			p->left = n;
		} else {
			p->right = n;
		}

		split(n);
	}

	propogateSumsUp(n);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movss %xmm0, 0x4(%rsp)
movl %esi, %ebp
movq %rdi, %rbx
xorl %r15d, %r15d
movq %rdi, %rax
movq (%rax), %r14
testq %r14, %r14
je 0x4936
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x491b
cmpb $0x1, (%rax)
jne 0x491b
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x491b
cmpb $0x1, (%rax)
jne 0x491b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x65e0
movl 0x20(%r14), %ecx
cmpl %ebp, %ecx
je 0x4999
leaq 0x10(%r14), %rdx
leaq 0x18(%r14), %rax
cmpl %ebp, %ecx
cmovgq %rdx, %rax
movq %r14, %r15
jmp 0x48ec
pushq $0x30
popq %rdi
callq 0x2190
movq %rax, %r14
movb $0x0, (%rax)
movl %ebp, 0x20(%rax)
movss 0x4(%rsp), %xmm0
movss %xmm0, 0x24(%rax)
andl $0x0, 0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq %r15, 0x8(%rax)
testq %r15, %r15
je 0x4981
xorl %eax, %eax
cmpl %ebp, 0x20(%r15)
setle %al
movq %r14, 0x10(%r15,%rax,8)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x65e0
jmp 0x4984
movq %r14, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6658
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x69de(%rip), %rsi      # 0xb389
movq %rax, %rdi
callq 0x20e0
movq 0xb606(%rip), %rsi      # 0xffc0
movq 0xb60f(%rip), %rdx      # 0xffd0
movq %rbx, %rdi
callq 0x22f0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::choose(float)
T WeightedDiscretePDF<T>::choose(float p)
{
	if (p<0.0 || p>=1.0) {
		throw std::domain_error("choose: argument(p) outside valid range");
	} else if (!m_root) {
		throw std::logic_error("choose: choose() called on empty tree");
	} else {
		float w = m_root->sumWeights * p;
		WDPDF_Node<T> *n = m_root;

		while (1) {
			if (n->left) {
				if (w<n->left->sumWeights) {
					n = n->left;
					continue;
				} else {
					w -= n->left->sumWeights;
				}
			}
			if (w<n->weight || !n->right) {
				break; // !n->right condition shouldn't be necessary, just sanity check
			}
			w -= n->weight;
			n = n->right;
		}

		return n->key;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x4a3c
ucomiss 0x4a81(%rip), %xmm0     # 0x9470
jae 0x4a3c
movq (%rdi), %rax
testq %rax, %rax
je 0x4a66
mulss 0x28(%rax), %xmm0
movq %rax, %rcx
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x4a18
movss 0x28(%rax), %xmm1
ucomiss %xmm0, %xmm1
ja 0x49fe
subss %xmm1, %xmm0
movss 0x24(%rcx), %xmm1
ucomiss %xmm0, %xmm1
ja 0x4a31
movq 0x18(%rcx), %rax
testq %rax, %rax
je 0x4a31
subss %xmm1, %xmm0
jmp 0x49fe
movl 0x20(%rcx), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x6962(%rip), %rsi      # 0xb3b0
movq %rax, %rdi
callq 0x20e0
movq 0xb563(%rip), %rsi      # 0xffc0
movq 0xb56c(%rip), %rdx      # 0xffd0
jmp 0x4a8e
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x6960(%rip), %rsi      # 0xb3d8
movq %rax, %rdi
callq 0x2260
movq 0xb561(%rip), %rsi      # 0xffe8
movq 0xb54a(%rip), %rdx      # 0xffd8
movq %rbx, %rdi
callq 0x22f0
jmp 0x4a98
movq %rax, %r14
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::remove(int)
void WeightedDiscretePDF<T>::remove(T item)
{
	WDPDF_Node<T> **np = lookup(item, 0);
	WDPDF_Node<T> *child, *n = *np;

	if (!n) {
		throw std::domain_error("remove: argument(item) not in tree");
	} else {
		if (n->left) {
			WDPDF_Node<T> **leftMaxp = &n->left;

			while ((*leftMaxp)->right)
				leftMaxp = &(*leftMaxp)->right;

			n->key = (*leftMaxp)->key;
			n->weight = (*leftMaxp)->weight;

			np = leftMaxp;
			n = *np;
		}

			// node now has at most one child

		child = n->left?n->left:n->right;
		*np = child;

		if (child) {
			child->parent = n->parent;

			if (n->isBlack()) {
				lengthen(child);
			}
		}

		propogateSumsUp(n->parent);

		n->left = n->right = 0;
		delete n;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edx, %edx
callq 0x67a8
movq (%rax), %rcx
testq %rcx, %rcx
je 0x4b5e
movq 0x10(%rcx), %rdx
testq %rdx, %rdx
je 0x4b06
leaq 0x10(%rcx), %rsi
movq %rsi, %rax
movq %rdx, %r14
leaq 0x18(%rdx), %rsi
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
jne 0x4ad3
movl 0x20(%r14), %edx
movl %edx, 0x20(%rcx)
movss 0x24(%r14), %xmm0
movss %xmm0, 0x24(%rcx)
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0x4b0b
movq %rsi, (%rax)
jmp 0x4b1a
movq %rcx, %r14
jmp 0x4b0e
movq %r14, %rcx
movq 0x18(%rcx), %rsi
movq %rsi, (%rax)
testq %rsi, %rsi
je 0x4b30
movq 0x8(%r14), %rax
movq %rax, 0x8(%rsi)
cmpb $0x0, (%r14)
jne 0x4b30
movq %rbx, %rdi
callq 0x67d6
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x6658
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movq %r14, %rdi
callq 0x6324
pushq $0x30
popq %rsi
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21a0
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x688e(%rip), %rsi      # 0xb3fe
movq %rax, %rdi
callq 0x20e0
movq 0xb441(%rip), %rsi      # 0xffc0
movq 0xb44a(%rip), %rdx      # 0xffd0
movq %rbx, %rdi
callq 0x22f0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::update(int, float)
void WeightedDiscretePDF<T>::update(T item, float weight)
{
	WDPDF_Node<T> *n = *lookup(item, 0);

	if (!n) {
		throw std::domain_error("update: argument(item) not in tree");
	} else {
		float delta = weight - n->weight;
		n->weight = weight;

		for (; n; n=n->parent) {
			n->sumWeights += delta;
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movss %xmm0, 0x4(%rsp)
xorl %edx, %edx
callq 0x67a8
movq (%rax), %rax
testq %rax, %rax
je 0x4bef
movss 0x4(%rsp), %xmm1
movaps %xmm1, %xmm0
subss 0x24(%rax), %xmm0
movss %xmm1, 0x24(%rax)
testq %rax, %rax
je 0x4be7
movss 0x28(%rax), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x28(%rax)
movq 0x8(%rax), %rax
jmp 0x4bce
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %rbx
leaq 0x6820(%rip), %rsi      # 0xb421
movq %rax, %rdi
callq 0x20e0
movq 0xb3b0(%rip), %rsi      # 0xffc0
movq 0xb3b9(%rip), %rdx      # 0xffd0
movq %rbx, %rdi
callq 0x22f0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::getSamplingPoints()
std::vector<Point2D> getSamplingPoints()
  {
    if (root) delete root;
    std::vector<Point2D> pointlist;
    
    buildAdaptiveSubdivision(); 
    collectPoints(pointlist);
    return pointlist;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x4c79
movq %r15, %rdi
callq 0x4e38
pushq $0x78
popq %rsi
movq %r15, %rdi
callq 0x21a0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
pushq $0x6
popq %rsi
movq %r14, %rdi
callq 0x4ee8
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4ffc
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x5f88
movq %r14, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::TileNode::collapse()
void collapse()
    {
      // Recursively prune the tree.
      for (unsigned i=0; i<children.size(); i++) delete children[i];
      terminal = true;
      children.clear();
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
pushq $0x78
popq %r14
movl %r12d, %r12d
movq 0x60(%rbx), %rax
movq 0x68(%rbx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r12, %rdx
jbe 0x4e9b
movq (%rax,%r12,8), %r15
testq %r15, %r15
je 0x4e8b
movq %r15, %rdi
callq 0x4e38
movq %r15, %rdi
movq %r14, %rsi
callq 0x21a0
incl %r12d
jmp 0x4e60
movb $0x1, 0x5c(%rbx)
cmpq %rax, %rcx
je 0x4ea8
movq %rax, 0x68(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::buildAdaptiveSubdivision(unsigned int)
void buildAdaptiveSubdivision( unsigned minSubdivisionLevel = 6 )
  {
    root = new TileNode(width,height);
    
    // Since we are approximating the MAX within each tile by the values at
    // a few key points, we must provide a sufficiently dense initial
    // tiling. This would not be necessary with a more thorough scan of each
    // tile.
    subdivideAll(minSubdivisionLevel);

    TileLeafIterator it(root);
    TileNode *tmp;

    // Recursively subdivide all triangles until each triangle's
    // required level is reached.
    unsigned level;
    do {
      level = it->getLevel();
      
      if ( it->isSamplingType() ) // Sampling tiles are infinitesimal
      {
        if ( level < getReqSubdivisionLevel(getImportanceAt_bounded(it->getP1())) )
        {
          tmp = *it;
          tmp->refine();
        }
      }
      else
      {
        if ( 
          ( level < getReqSubdivisionLevel(getImportanceAt_bounded(it->getP1())) ) ||
          ( level < getReqSubdivisionLevel(getImportanceAt_bounded(it->getP2())) ) ||
          ( level < getReqSubdivisionLevel(getImportanceAt_bounded(it->getP3())) ) ||
          ( level < getReqSubdivisionLevel(getImportanceAt_bounded(it->getCenter())) )
          )
        {
          tmp = *it;
          tmp->refine();
        }
      }
    } while ( it.next() );
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
pushq $0x78
popq %rdi
callq 0x2190
movq %rax, %r14
movsd 0x10(%rbx), %xmm0
movsd 0x18(%rbx), %xmm1
movq %rax, %rdi
callq 0x50d6
movq %r14, 0x8(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x51ae
movq 0x8(%rbx), %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x5a14
movq (%rsp), %rax
movl (%rax), %ebp
movl 0x4(%rax), %r15d
movsd 0x18(%rax), %xmm0
movsd 0x20(%rax), %xmm1
movq %rbx, %rdi
callq 0x5268
movl %eax, %edi
callq 0x5212
cmpl $0x1, %r15d
ja 0x4f5d
cmpl %eax, %ebp
jb 0x4fa3
jmp 0x4fac
cmpl %eax, %ebp
jb 0x4fa3
movq (%rsp), %rax
movsd 0x28(%rax), %xmm0
movsd 0x30(%rax), %xmm1
movq %rbx, %rdi
callq 0x5268
movl %eax, %edi
callq 0x5212
cmpl %eax, %ebp
jb 0x4fa3
movq (%rsp), %rax
movsd 0x38(%rax), %xmm0
movsd 0x40(%rax), %xmm1
movq %rbx, %rdi
callq 0x5268
movl %eax, %edi
callq 0x5212
cmpl %eax, %ebp
jae 0x4fbe
movq (%rsp), %rdi
callq 0x529e
movq %r14, %rdi
callq 0x5766
testb %al, %al
jne 0x4f2e
jmp 0x4fdb
movq (%rsp), %rdi
callq 0x573e
movq %rbx, %rdi
callq 0x5268
movl %eax, %edi
callq 0x5212
jmp 0x4f57
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x78
popq %rsi
movq %r14, %rdi
callq 0x21a0
movq %rbx, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::collectPoints(std::vector<Point2D, std::allocator<Point2D>>&, bool)
void collectPoints( 
    std::vector<Point2D> &pointlist,
    bool filterBounds = true )
  {
    pointlist.clear();

    Point2D pt, pt_displaced;
    unsigned importance;
    TileLeafIterator it(root);
    do {
      pt = it->getP1();  
      if ( it->isSamplingType() ) // Only "pentagonal" tiles generate sampling points.
      {   
        importance = getImportanceAt_bounded( pt );

        // Threshold the function against the F-Code value.           
        if ( importance >= calcFCodeValue( it->getFCode() , 2*it->getLevel() ) )
        {
          // Get the displaced point using the lookup table.
          pt_displaced = it->getDisplacedSamplingPoint(importance);

          if ( !filterBounds ||
            (pt_displaced.x>=0 && pt_displaced.x<width && 
            pt_displaced.y>=0 && pt_displaced.y<height) )
          {
            pointlist.push_back(pt_displaced); // collect point.
          }
        }
      }

    } while ( it.next() );

  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x501f
movq %rax, 0x8(%r14)
movq 0x8(%r15), %rsi
movq %rsp, %r12
movq %r12, %rdi
callq 0x5a14
leaq 0x8(%rsp), %r13
movq (%rsp), %rax
cmpl $0x1, 0x4(%rax)
ja 0x50b7
movsd 0x18(%rax), %xmm0
movsd 0x20(%rax), %xmm1
movq %r15, %rdi
callq 0x5268
movl %eax, %ebp
movq (%rsp), %rax
movl (%rax), %esi
movl 0x48(%rax), %edi
addl %esi, %esi
callq 0x5bec
cmpl %eax, %ebp
jb 0x50b7
movq (%rsp), %rdi
movl %ebp, %esi
callq 0x5c2a
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
testb %bl, %bl
je 0x50ac
ucomisd 0x43a0(%rip), %xmm0     # 0x9428
jb 0x50b7
movsd 0x10(%r15), %xmm2
ucomisd %xmm0, %xmm2
jbe 0x50b7
ucomisd 0x438a(%rip), %xmm1     # 0x9428
jb 0x50b7
movsd 0x18(%r15), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x50b7
movq %r14, %rdi
movq %r13, %rsi
callq 0x5c66
movq %r12, %rdi
callq 0x5766
testb %al, %al
jne 0x5033
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::TileNode::TileNode(double, double)
TileNode( double roi_width,  double roi_height)
    {
      double side = MAX(roi_width,roi_height);
      double scale = 2.0 * side;
      Point2D offset(PHI*PHI/2.0-0.25,0.125);
      *this = TileNode(NULL, TileTypeF,offset*-scale,15,0,0,scale);
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
leaq 0x60(%rdi), %rbx
xorps %xmm2, %xmm2
movups %xmm2, 0x60(%rdi)
andq $0x0, 0x70(%rdi)
movq %rsp, %rsi
andq $0x0, 0x70(%rsi)
movups %xmm2, 0x60(%rsi)
andq $0x0, 0x50(%rsi)
maxsd %xmm1, %xmm0
addsd %xmm0, %xmm0
movapd %xmm0, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
mulpd 0x43da(%rip), %xmm1     # 0x94f0
movupd %xmm1, 0x18(%rsi)
movl $0xf, 0x8(%rsi)
andl $0x0, 0x58(%rsi)
movsd %xmm0, 0x10(%rsi)
movabsq $0x500000000, %rax      # imm = 0x500000000
movq %rax, (%rsi)
movsd 0x42f0(%rip), %xmm2     # 0x9430
mulsd %xmm0, %xmm2
xorpd %xmm3, %xmm3
mulsd %xmm2, %xmm3
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
addpd %xmm1, %xmm2
movupd %xmm2, 0x28(%rsi)
mulsd 0x42d7(%rip), %xmm0     # 0x9438
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd 0x4393(%rip), %xmm0     # 0x9500
addpd %xmm1, %xmm0
movupd %xmm0, 0x38(%rsi)
andl $0x0, 0x48(%rsi)
movb $0x1, 0x5c(%rsi)
callq 0x58ba
movq %rsp, %rdi
callq 0x4e38
addq $0x78, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rsp, %rdi
callq 0x4e38
movq %rbx, %rdi
callq 0x4eb4
movq %r14, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::subdivideAll(int)
void subdivideAll(int times=1)
  {
    if (!root) return;
    TileNode *tmp;
    for (int i=0;i<times;i++)  
    {
      TileLeafIterator it(root);
      do { 
        tmp = *it;
        it.next();
        tmp->refine();
      }
      while (*it);
    }
  }

// Assembly:
cmpq $0x0, 0x8(%rdi)
je 0x5211
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorl %ebp, %ebp
testl %esi, %esi
cmovlel %ebp, %ebx
leaq 0x8(%rsp), %r15
cmpl %ebx, %ebp
je 0x5205
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x5a14
movq 0x8(%rsp), %r12
movq %r15, %rdi
callq 0x5766
movq %r12, %rdi
callq 0x529e
movq 0x8(%rsp), %r12
testq %r12, %r12
jne 0x51e7
incl %ebp
jmp 0x51d2
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::getReqSubdivisionLevel(unsigned int)
static unsigned getReqSubdivisionLevel( unsigned importance )
  {
    if (importance==0) return 0;
    unsigned nbits = (unsigned)(log( (double)importance*SQRT5 + 1.0 ) / LOG_PHI) - 1;
    if (nbits<1) nbits = 1;
    return (unsigned)ceil(0.5*nbits);
  }

// Assembly:
testl %edi, %edi
je 0x5265
pushq %rax
movl %edi, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x421a(%rip), %xmm0     # 0x9440
addsd 0x421a(%rip), %xmm0     # 0x9448
callq 0x2140
divsd 0x4215(%rip), %xmm0     # 0x9450
cvttsd2si %xmm0, %rax
leal -0x1(%rax), %ecx
cmpl $0x1, %ecx
adcl $-0x1, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x3dfa(%rip), %xmm0     # 0x9050
callq 0x2060
cvttsd2si %xmm0, %rax
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::getImportanceAt_bounded(Point2D)
unsigned getImportanceAt_bounded(Point2D pt)
  {
    if (pt.x>=0 && pt.x<width && pt.y>=0 && pt.y<height) 
      return getImportanceAt(pt);
    else 
      return 0;
  }

// Assembly:
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
jae 0x5275
xorl %eax, %eax
retq
movsd 0x10(%rdi), %xmm2
ucomisd %xmm0, %xmm2
jbe 0x5272
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jb 0x5272
movsd 0x18(%rdi), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x5272
movq (%rdi), %rax
movq 0x10(%rax), %rax
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::TileNode::nextNode()
TileNode* nextNode()
    {
      if (!terminal) return children[0];
      
      if (level == 0) return NULL; // single node case.

      if ( parent_slot < parent->children.size()-1 )
        return parent->children[parent_slot+1];

      // last child case
      TileNode* tmp = this;
      do
      {
        tmp = tmp->parent;
      }
      while ( (tmp->level != 0) && (tmp->parent_slot ==  tmp->parent->children.size()-1) );

      if (tmp->level == 0) return NULL; // last node
      return tmp->parent->children[tmp->parent_slot+1];

    }

// Assembly:
cmpb $0x0, 0x5c(%rdi)
je 0x5bb3
cmpl $0x0, (%rdi)
je 0x5bbb
movl 0x58(%rdi), %eax
movq 0x50(%rdi), %rcx
movq 0x60(%rcx), %rdx
movq 0x68(%rcx), %rsi
subq %rdx, %rsi
sarq $0x3, %rsi
decq %rsi
cmpq %rax, %rsi
jbe 0x5bbe
incl %eax
leaq (%rdx,%rax,8), %rax
jmp 0x5bb7
movq 0x60(%rdi), %rax
movq (%rax), %rax
retq
xorl %eax, %eax
retq
xorl %eax, %eax
cmpl $0x0, (%rcx)
je 0x5bba
movl 0x58(%rcx), %edx
movq 0x50(%rcx), %rcx
movq 0x60(%rcx), %rsi
movq 0x68(%rcx), %rdi
subq %rsi, %rdi
sarq $0x3, %rdi
decq %rdi
cmpq %rdx, %rdi
je 0x5bc0
incl %edx
leaq (%rsi,%rdx,8), %rax
jmp 0x5bb7
nop
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::calcFCodeValue(unsigned int, unsigned int)
static unsigned calcFCodeValue(unsigned bitsequence,unsigned nbits)
  {
    unsigned i_s = 0;
    for (unsigned i=0; i<nbits ;i++ )
    {
      if ( bitsequence & ( 1u<<(nbits-i-1) ) ) i_s += fibonacci(i+2);
    }
    return i_s;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
decl %ebx
xorl %r14d, %r14d
pushq $0x2
popq %r15
cmpl $-0x1, %ebx
je 0x5c1c
btl %ebx, %ebp
jae 0x5c15
movl %r15d, %edi
callq 0x5c84
addl %eax, %r14d
decl %ebx
incl %r15d
jmp 0x5c00
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./quasisampler_prototype.h
// Function: Quasisampler::calcDisplacementVector(unsigned int, unsigned int, int)
static Point2D calcDisplacementVector(unsigned importance, unsigned f_code, int dir)
  {
    unsigned i_s = calcStructuralIndex(f_code);
    unsigned i_v = calcImportanceIndex(importance);

    return  
      vvect[dir]        * lut[i_v][i_s][0] + // u component
      vvect[(dir+5)%20] * lut[i_v][i_s][1] ; // v component
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %edi, %ebp
movl %esi, %edi
callq 0x5d72
movl %eax, %r14d
movl %ebp, %edi
callq 0x5d7a
movslq %ebx, %rcx
movq %rcx, %rdi
shlq $0x4, %rdi
leaq 0x38ac(%rip), %rsi      # 0x95c0
movl %eax, %eax
movl %r14d, %r8d
imulq $0x150, %rax, %rax      # imm = 0x150
leaq 0x39d9(%rip), %r9       # 0x9700
addq %rax, %r9
shlq $0x4, %r8
addl $0x5, %ecx
pushq $0x14
popq %r10
movl %ecx, %eax
cltd
idivl %r10d
movslq %edx, %rax
shlq $0x4, %rax
movsd (%r8,%r9), %xmm1
movsd 0x8(%r8,%r9), %xmm0
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd (%rdi,%rsi), %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd (%rax,%rsi), %xmm0
addpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::split(WDPDF_Node<int>*)
void WeightedDiscretePDF<T>::split(WDPDF_Node<T> *n)
{
	if (n->left) n->left->markBlack();
	if (n->right) n->right->markBlack();

	if (n->parent) {
		WDPDF_Node<T> *p = n->parent;

		n->markRed();

		if (p->isRed()) {
			p->parent->markRed();

				// not same direction
			if (!(	(n==p->left && p==p->parent->left) || 
					(n==p->right && p==p->parent->right))) {
			  rotate(n);
			  p = n;
			}

			rotate(p);
			p->markBlack();
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %rax
testq %rax, %rax
je 0x65f7
movb $0x0, (%rax)
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x6603
movb $0x0, (%rax)
movq 0x8(%r14), %r15
testq %r15, %r15
je 0x6652
movb $0x1, (%r14)
cmpb $0x1, (%r15)
jne 0x6652
movq 0x8(%r15), %rax
movb $0x1, (%rax)
cmpq %r14, 0x10(%r15)
jne 0x6629
cmpq 0x10(%rax), %r15
je 0x6643
cmpq %r14, 0x18(%r15)
jne 0x6635
cmpq 0x18(%rax), %r15
je 0x6643
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6672
movq %r14, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6672
movb $0x0, (%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/./WeightedDiscretePDF.cpp
// Function: WeightedDiscretePDF<int>::rotate(WDPDF_Node<int>*)
void WeightedDiscretePDF<T>::rotate(WDPDF_Node<T> *n)
{
	WDPDF_Node<T> *p=n->parent, *pp=p->parent;

	n->parent = pp;
	p->parent = n;

	if (n==p->left) {
		p->left = n->right;
		n->right = p;
		if (p->left) p->left->parent = p;
	} else {
		p->right = n->left;
		n->left = p;
		if (p->right) p->right->parent = p;
	}

	n->setSum();
	p->setSum();
	
	if (!pp) {
		m_root = n;
	} else {
		if (p==pp->left) {
			pp->left = n;
		} else {
			pp->right = n;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r15
movq 0x8(%r15), %r12
movq %r12, 0x8(%rsi)
movq %rsi, 0x8(%r15)
cmpq %rsi, 0x10(%r15)
je 0x66a4
movq 0x10(%rbx), %rax
movq %rax, 0x18(%r15)
movq %r15, 0x10(%rbx)
jmp 0x66b0
movq 0x18(%rbx), %rax
movq %rax, 0x10(%r15)
movq %r15, 0x18(%rbx)
testq %rax, %rax
je 0x66b9
movq %r15, 0x8(%rax)
movq %rbx, %rdi
callq 0x66f0
movq %r15, %rdi
callq 0x66f0
testq %r12, %r12
je 0x66e1
leaq 0x10(%r12), %rax
leaq 0x18(%r12), %r14
cmpq 0x10(%r12), %r15
cmoveq %rax, %r14
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rdi, %rbx
movq %rsi, %r15
cmpb $0x0, (%rsi)
jne 0x6860
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x68cb
movq 0x10(%rsi), %rcx
movq %rcx, %r14
cmpq %r15, %rcx
jne 0x6803
movq 0x18(%rsi), %r14
testq %r14, %r14
je 0x67de
cmpb $0x1, (%r14)
jne 0x6839
movb $0x1, (%rsi)
movb $0x0, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6672
movq 0x8(%r15), %rsi
movq 0x10(%rsi), %rcx
movq %rcx, %r14
cmpq %r15, %rcx
jne 0x6834
movq 0x18(%rsi), %r14
testq %r14, %r14
je 0x67de
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x6847
cmpb $0x0, (%rax)
jne 0x6865
movq 0x18(%r14), %rdx
testq %rdx, %rdx
je 0x6855
cmpb $0x0, (%rdx)
jne 0x6865
cmpb $0x0, (%rsi)
movb $0x1, (%r14)
je 0x67de
jmp 0x68c8
movq %r15, %rsi
jmp 0x68c8
cmpq %r15, %rcx
je 0x6880
cmpq %r15, 0x18(%rsi)
jne 0x68a5
testq %rax, %rax
je 0x687a
cmpb $0x0, (%rax)
jne 0x68a5
movq 0x18(%r14), %rax
jmp 0x688e
movq 0x18(%r14), %rcx
testq %rcx, %rcx
je 0x688e
cmpb $0x1, (%rcx)
je 0x686a
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6672
movb $0x1, (%r14)
movq 0x8(%r14), %r14
movb $0x0, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6672
movq 0x8(%r15), %rax
cmpb $0x1, (%rax)
jne 0x68bd
movb $0x1, (%r14)
movq 0x10(%r14), %rax
movb $0x0, (%rax)
movq 0x18(%r14), %rsi
movb $0x0, (%rsi)
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/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)
pushq $0x40
popq %rdi
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_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movss %xmm1, 0x4(%rsp)
movss %xmm0, (%rsp)
movl %esi, %ebp
movq %rdi, %rbx
movl 0x8(%rdi), %r13d
cmpl 0xc(%rdi), %r13d
jne 0x69e9
movslq %r13d, %r12
shlq $0x3, %r12
testl %r13d, %r13d
pushq $-0x1
popq %rdi
cmovnsq %r12, %rdi
callq 0x2030
movq %rax, %r14
movq (%rbx), %r15
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2150
testq %r15, %r15
je 0x69e4
movq %r15, %rdi
callq 0x2210
movl 0x8(%rbx), %r13d
movq %r14, (%rbx)
jmp 0x69ec
movq (%rbx), %r14
movl %r13d, %eax
movslq %ebp, %r15
subl %ebp, %eax
jle 0x6a15
leaq (%r14,%r15,8), %rsi
leaq (%r14,%r15,8), %rdi
addq $0x8, %rdi
movslq %eax, %rdx
shlq $0x3, %rdx
callq 0x22c0
movq (%rbx), %r14
movl 0x8(%rbx), %r13d
movss (%rsp), %xmm0
movss %xmm0, (%r14,%r15,8)
movss 0x4(%rsp), %xmm0
movss %xmm0, 0x4(%r14,%r15,8)
incl %r13d
movl %r13d, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x5b
popq %rdi
callq 0x2230
xorl %r15d, %r15d
leaq 0x46fa(%rip), %r12      # 0xb32a
leaq 0x4933(%rip), %r13      # 0xb56a
leaq 0x4922(%rip), %r14      # 0xb560
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jge 0x6c72
movq (%rbx), %rcx
cvtss2sd (%rcx,%r15,8), %xmm0
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
jmp 0x6c3e
leaq 0x48f4(%rip), %rdi      # 0xb56d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O2/ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedSector::ScallopedSector(Vec2&, float, float, Vec2&, float, float, Vec2&, float, float)
ScallopedSector::ScallopedSector(Vec2 &_Pt, float _a1, float _a2, Vec2 &P1, float r1, float sign1, Vec2 &P2, float r2, float sign2)
{
	Vec2 v1 = Vec2(P1.x - _Pt.x, P1.y - _Pt.y);
	Vec2 v2 = Vec2(P2.x - _Pt.x, P2.y - _Pt.y);

	P = _Pt;
	a1 = _a1;
	a2 = _a2;

	arcs[0].P = P1;
	arcs[0].r = r1;
	arcs[0].sign = sign1;
	arcs[0].d = sqrt(v1.x*v1.x + v1.y*v1.y);
	arcs[0].rSqrd = arcs[0].r*arcs[0].r;
	arcs[0].dSqrd = arcs[0].d*arcs[0].d;
	arcs[0].theta = atan2(v1.y,v1.x);
	arcs[0].integralAtStart = integralOfDistToCircle(a1 - arcs[0].theta, arcs[0].d, arcs[0].r, arcs[0].sign);

	arcs[1].P = P2;
	arcs[1].r = r2;
	arcs[1].sign = sign2;
	arcs[1].d = sqrt(v2.x*v2.x + v2.y*v2.y);
	arcs[1].rSqrd = arcs[1].r*arcs[1].r;
	arcs[1].dSqrd = arcs[1].d*arcs[1].d;
	arcs[1].theta = atan2(v2.y,v2.x);
	arcs[1].integralAtStart = integralOfDistToCircle(a1 - arcs[1].theta, arcs[1].d, arcs[1].r, arcs[1].sign);

	area = calcAreaToAngle(a2);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movss %xmm5, 0xc(%rsp)
movaps %xmm4, 0x10(%rsp)
movq %rcx, %r14
movaps %xmm1, %xmm4
movaps %xmm0, %xmm5
movq %rdi, %rbx
movss (%rdx), %xmm1
movss 0x4(%rdx), %xmm0
movss (%rsi), %xmm6
movss 0x4(%rsi), %xmm7
subss %xmm6, %xmm1
subss %xmm7, %xmm0
movss (%rcx), %xmm8
movss 0x4(%rcx), %xmm9
subss %xmm6, %xmm8
movss %xmm8, 0x8(%rsp)
subss %xmm7, %xmm9
movss %xmm9, 0x4(%rsp)
movq (%rsi), %rax
movq %rax, (%rdi)
movss %xmm5, 0x8(%rdi)
movss %xmm4, 0xc(%rdi)
movq (%rdx), %rax
movq %rax, 0x14(%rdi)
movss %xmm2, 0x1c(%rdi)
movss %xmm3, 0x20(%rdi)
movaps %xmm0, %xmm3
mulss %xmm0, %xmm3
movaps %xmm1, %xmm4
mulss %xmm1, %xmm4
addss %xmm3, %xmm4
sqrtss %xmm4, %xmm3
movss %xmm3, 0x24(%rdi)
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
mulps %xmm2, %xmm2
movlps %xmm2, 0x30(%rdi)
callq 0x2220
movss %xmm0, 0x28(%rbx)
movss 0x8(%rbx), %xmm4
movss 0x1c(%rbx), %xmm2
subss %xmm0, %xmm4
movss 0x24(%rbx), %xmm1
movss 0x20(%rbx), %xmm3
movaps %xmm4, %xmm0
callq 0x6dee
movss %xmm0, 0x2c(%rbx)
movq (%r14), %rax
movq %rax, 0x38(%rbx)
movaps 0x10(%rsp), %xmm2
movss %xmm2, 0x40(%rbx)
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x44(%rbx)
movss 0x4(%rsp), %xmm0
movaps %xmm0, %xmm4
mulss %xmm0, %xmm4
movss 0x8(%rsp), %xmm1
movaps %xmm1, %xmm3
mulss %xmm1, %xmm3
addss %xmm4, %xmm3
sqrtss %xmm3, %xmm3
movss %xmm3, 0x48(%rbx)
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
mulps %xmm2, %xmm2
movlps %xmm2, 0x54(%rbx)
callq 0x2220
movss %xmm0, 0x4c(%rbx)
movss 0x8(%rbx), %xmm4
movss 0x40(%rbx), %xmm2
subss %xmm0, %xmm4
movss 0x48(%rbx), %xmm1
movss 0x44(%rbx), %xmm3
movaps %xmm4, %xmm0
callq 0x6dee
movss %xmm0, 0x50(%rbx)
movss 0xc(%rbx), %xmm0
movq %rbx, %rdi
callq 0x6ece
movss %xmm0, 0x10(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4777(%rip), %xmm4     # 0xb570
ucomiss %xmm2, %xmm4
ja 0x6eca
subq $0x18, %rsp
movss %xmm3, 0x8(%rsp)
movss %xmm0, 0x10(%rsp)
movss %xmm2, 0x4(%rsp)
movss %xmm1, 0x14(%rsp)
callq 0x2160
mulss 0x14(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movaps %xmm0, %xmm1
divss 0x4(%rsp), %xmm1
movss 0x262c(%rip), %xmm0     # 0x946c
ucomiss %xmm1, %xmm0
ja 0x6e59
ucomiss 0x2624(%rip), %xmm1     # 0x9470
movaps %xmm1, %xmm0
jbe 0x6e59
movss 0x2617(%rip), %xmm0     # 0x9470
callq 0x22a0
movss 0x8(%rsp), %xmm1
mulss %xmm0, %xmm1
addss 0x10(%rsp), %xmm1
movss %xmm1, (%rsp)
callq 0x2110
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 0x2110
movss (%rsp), %xmm5
mulss 0x14(%rsp), %xmm0
mulss 0xc(%rsp), %xmm0
mulss 0x4(%rsp), %xmm5
addss %xmm0, %xmm5
mulss 0x2196(%rip), %xmm5     # 0x905c
addq $0x18, %rsp
movaps %xmm5, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x277c
movaps 0x20(%rsp), %xmm2
mulss 0x10(%rsp), %xmm0
addss %xmm2, %xmm0
pushq $0xa
popq %rbp
subl $0x1, %ebp
jb 0x6fda
movq %rbx, %rdi
movaps %xmm2, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
callq 0x6ece
movaps 0x10(%rsp), %xmm4
movaps 0x20(%rsp), %xmm3
movss 0xc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
movss 0x8(%rsp), %xmm1
ja 0x6fb3
movss %xmm4, 0x8(%rsp)
movaps %xmm3, %xmm1
cmpltss 0xc(%rsp), %xmm0
movaps %xmm0, %xmm2
andps %xmm4, %xmm2
andnps %xmm3, %xmm0
orps %xmm2, %xmm0
addss %xmm4, %xmm1
mulss 0x208a(%rip), %xmm1     # 0x905c
movaps %xmm0, %xmm2
movaps %xmm1, %xmm0
jmp 0x6f78
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
nop