// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::generateTopology(unsigned int)
vector<vector<unsigned int> > Swarm::generateTopology(unsigned int populationSize) {
	Timer tmr;

	vector<vector<unsigned int> > allParticles (populationSize + 1);

	if (options.fitType == "pso" || options.fitType == "de") {

		if (options.verbosity >= 3) {
			cout << "Generating initial particles with a " << options.topology << " topology" << endl;
		}

		if (options.topology == "fullyconnected") {
			for (unsigned int p = 1; p <= populationSize; ++p) {
				vector<unsigned int> connections;
				for (unsigned int c = 1; c <= populationSize; ++c) {
					if (c != p) {
						connections.push_back(c);
					}
				}
				allParticles[p] = connections;
			}
		}
		else if (options.topology == "ring") {

			// Connect the first particle manually
			unsigned int firstConnection[] = {2, populationSize};
			allParticles[1] = vector<unsigned int> (firstConnection, firstConnection + sizeof(firstConnection) / sizeof(firstConnection[0]));

			vector<unsigned int> connections;
			for (unsigned int p = 2; p <= populationSize - 1; ++p) {

				connections.clear();
				// Connect to particle before, and particle after
				connections.push_back(p-1);
				connections.push_back(p+1);
				allParticles[p] = connections;

			}

			// Connect the last particle manually
			unsigned int lastConnection[] = {populationSize - 1, 1};
			allParticles[populationSize] = vector<unsigned int> (lastConnection, lastConnection + sizeof(lastConnection) / sizeof(lastConnection[0]));
		}
		else if (options.topology == "star") {
			vector<unsigned int> connections;

			// First connect the central particle to all others
			for (unsigned int c = 2; c <= populationSize; ++c) {
				connections.push_back(c);
			}
			allParticles[1] = connections;

			// Then connect all particles to the central particles
			for (unsigned int p = 2; p <= populationSize; ++p) {
				connections.clear();
				connections.push_back(1);
				allParticles[p] = connections;
			}
		}
		else if (options.topology == "mesh") {

			unsigned int desiredArea = populationSize;
			unsigned int divisor = ceil(sqrt(desiredArea));
			if (divisor != 0) {
			  while(desiredArea % divisor != 0) {
				  ++divisor;
			  }
			}
			unsigned int length = divisor;
			unsigned int width = desiredArea / divisor;

			// Construct a matrix of dimension length x width
			// and fill it with particles
			int p = 0;
			vector<vector<unsigned int> > matrix(length, vector<unsigned int>(width));
			for (unsigned int x = 0; x < length; ++x) {
				for (unsigned int y = 0; y < width; ++y) {
					matrix[x][y] = ++p;
				}
			}

			// Make our connections
			vector<unsigned int> connections;
			for (unsigned int x = 0; x < length; ++x) {
				for (unsigned int y = 0; y < width; ++y) {
					connections.clear();
					p = matrix[x][y];

					// If we're on the left bound
					if (x == 0) {
						// Add the particle to the right of us
						connections.push_back(matrix[x+1][y]);
					}
					// If we're on the right bound
					else if (x == length - 1) {
						// Add the particle to the left of us
						connections.push_back(matrix[x-1][y]);
					}
					// If we're in a center
					else {
						// Add the particles on either side of us
						connections.push_back(matrix[x-1][y]);
						connections.push_back(matrix[x+1][y]);
					}

					if (y == 0) {
						connections.push_back(matrix[x][y+1]);
					}
					else if (y == width - 1) {
						connections.push_back(matrix[x][y-1]);
					}
					else {
						connections.push_back(matrix[x][y-1]);
						connections.push_back(matrix[x][y+1]);
					}
					allParticles[p] = connections;
				}
			}
		}
		else if (options.topology == "toroidal") {
			unsigned int desiredArea = populationSize;
			unsigned int divisor = ceil(sqrt(desiredArea));
			if (divisor != 0) {
			  while(desiredArea % divisor != 0) {
				  ++divisor;
			  }
			}
			unsigned int length = divisor;
			unsigned int width = desiredArea / divisor;

			// Construct a matrix of dimensions length x width
			// and fill it with particles
			unsigned int p = 0;
			vector<vector<unsigned int> > matrix(length, vector<unsigned int>(width));
			for (unsigned int x = 0; x < length; ++x) {
				for (unsigned int y = 0; y < width; ++y) {
					matrix[x][y] = ++p;
				}
			}

			// Make our connections
			vector<unsigned int> connections;
			for (unsigned int x = 0; x < length; ++x) {
				for (unsigned int y = 0; y < width; ++y) {
					connections.clear();
					p = matrix[x][y];

					if (x == 0) {
						connections.push_back(matrix[x+1][y]);
						connections.push_back(matrix[length-1][y]);
					}
					else if (x == (length - 1)) {
						connections.push_back(matrix[x-1][y]);
						connections.push_back(matrix[0][y]);
					}
					else {
						connections.push_back(matrix[x-1][y]);
						connections.push_back(matrix[x+1][y]);
					}

					if (y == 0) {
						connections.push_back(matrix[x][y+1]);
						connections.push_back(matrix[x][width-1]);
					}
					else if (y == (width - 1)) {
						connections.push_back(matrix[x][y-1]);
						connections.push_back(matrix[x][0]);
					}
					else {
						connections.push_back(matrix[x][y-1]);
						connections.push_back(matrix[x][y+1]);
					}
					allParticles[p] = connections;
				}
			}
		}
		else if (options.topology == "tree") {
			unsigned int usedParticles = 1;
			unsigned int numLevels = 1;
			unsigned int previousLevel = 1;
			unsigned int currentLevel;

			// Determine number of levels in tree
			while (usedParticles < populationSize) {
				currentLevel = previousLevel*2;
				usedParticles += currentLevel;
				previousLevel = currentLevel;
				++numLevels;
			}

			vector<vector<unsigned int> > tree(numLevels, vector<unsigned int>());
			usedParticles = 1;
			currentLevel = 1;
			unsigned int currentParticle = 2;
			bool doneFilling = false;

			// Construct tree and fill it with particles
			tree[0].push_back(1);

			// For each level in tree
			for (unsigned int level = 1; level <= numLevels; ++level) {
				// Current level's particle count is double that of previous level
				currentLevel = currentLevel * 2;

				// For each slot in current level
				for (unsigned int i = 0; i < currentLevel; ++i) {
					// Fill slot with particle
					tree[level].push_back(currentParticle);
					++currentParticle;

					// Make sure we're not filling past our swarm size
					if (currentParticle == populationSize + 1) {
						doneFilling = true;
						break;
					}
				}
				if (doneFilling) {
					break;
				}
			}

			// For each level in tree
			for (unsigned int level = 1; level < numLevels; ++level) {
				int prevGroupCounter = 0;
				int particleCounter = 0;

				// For each particle in level
				for (unsigned int p = 0; p < tree[level].size(); ++p) {

					// Connect current particle (p) with proper particle in last level
					allParticles[tree[level][p]].push_back(tree[level-1][prevGroupCounter]);

					// Connect particle in last level to current particle (p)
					allParticles[tree[level-1][prevGroupCounter]].push_back(tree[level][p]);

					// If our particle counter reaches two, we're in a new pair in (or new particle
					// in previous level)
					if (++particleCounter == 2) {
						particleCounter = 0;
						++prevGroupCounter;
					}
				}
			}
		}
		else {
			outputError("Error: BioNetFit did not recognize your specified topology of: " + options.topology);
		}
	}

	/*
	int p = 0;
	for (auto o = allParticles.begin(); o != allParticles.end(); ++o) {
		cout << p << " is connected to:" << endl;
		for (auto i = (*o).begin(); i != (*o).end(); ++i) {
			cout << *i << endl;
		}
		++p;
	}
	 */

	double t = tmr.elapsed();
	if (options.verbosity >= 3) {
		cout << "Particle creation took " << t << " seconds" << endl;
	}

	return allParticles;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
callq 0x220b0
movq %rax, 0xb0(%rsp)
leal 0x1(%r15), %esi
leaq 0x20(%rsp), %rdx
movq %rbx, 0x40(%rsp)
movq %rbx, %rdi
callq 0xa7b38
movq %r14, 0xa0(%rsp)
leaq 0x14e0(%r14), %r13
leaq 0x777c9(%rip), %rsi     # 0xfef72
movq %r13, %rdi
callq 0x22250
testl %eax, %eax
je 0x877cc
leaq 0xa673f(%rip), %rsi     # 0x12defb
movq %r13, %rdi
callq 0x22250
testl %eax, %eax
jne 0x88548
movq 0xa0(%rsp), %rbx
cmpl $0x3, 0x1614(%rbx)
jb 0x8784e
movq 0xee7c4(%rip), %rdi     # 0x175fa8
leaq 0x7763d(%rip), %rsi     # 0xfee28
movl $0x24, %edx
callq 0x22ab0
movq 0x16b8(%rbx), %rsi
movq 0x16c0(%rbx), %rdx
movq 0xee79e(%rip), %rdi     # 0x175fa8
callq 0x22ab0
movq %rax, %r13
leaq 0x7901d(%rip), %rsi     # 0x100836
movl $0x9, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r13, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
leaq 0x16b8(%rbx), %r13
leaq 0x76bb2(%rip), %rsi     # 0xfe40e
movq %r13, %rdi
callq 0x22250
testl %eax, %eax
je 0x87979
leaq 0xa79d4(%rip), %rsi     # 0x12f247
movq %r13, %rdi
callq 0x22250
testl %eax, %eax
movq %r15, 0x70(%rsp)
je 0x87a24
leaq 0x775be(%rip), %rsi     # 0xfee4d
movq %r13, %rdi
callq 0x22250
testl %eax, %eax
je 0x87bf9
leaq 0x775ac(%rip), %rsi     # 0xfee52
movq %r13, %rdi
callq 0x22250
testl %eax, %eax
je 0x87d02
leaq 0x7759a(%rip), %rsi     # 0xfee57
movq %r13, %rdi
callq 0x22250
testl %eax, %eax
je 0x87d38
leaq 0x7758c(%rip), %rsi     # 0xfee60
movq %r13, %rdi
callq 0x22250
testl %eax, %eax
jne 0x885f2
movl $0x1, %eax
cmpl $0x2, %r15d
jb 0x87905
movl $0x1, %edx
movl $0x1, %ecx
leal (%rcx,%rdx,2), %ecx
addl %edx, %edx
incl %eax
cmpl %r15d, %ecx
jb 0x878f9
movl %eax, %esi
xorpd %xmm0, %xmm0
movq %rsp, %rdx
movapd %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x20(%rsp), %rdi
leaq 0x68(%rsp), %rcx
movq %rsi, 0x48(%rsp)
callq 0xa7d68
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x87944
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
movl $0x2, (%rsp)
movq 0x20(%rsp), %rdi
movl $0x1, 0x68(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x87d6e
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x87d78
testl %r15d, %r15d
je 0x88548
movl $0x1, %ebx
leaq 0x20(%rsp), %r13
movq %rsp, %rbp
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x1, (%rsp)
movl $0x1, %eax
cmpl %ebx, %eax
je 0x879d6
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x879cb
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x879d6
movq %r13, %rdi
movq %rbp, %rdx
callq 0x6b0da
movl (%rsp), %eax
incl %eax
movl %eax, (%rsp)
cmpl %r15d, %eax
jbe 0x879ae
movl %ebx, %eax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
movq 0x40(%rsp), %rax
addq (%rax), %rdi
movq %r13, %rsi
callq 0xa7bb6
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x87a14
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
incl %ebx
cmpl %r15d, %ebx
jbe 0x8798f
jmp 0x88548
leaq 0x70(%rsp), %rdx
movl $0x2, -0x8(%rdx)
movl %r15d, -0x4(%rdx)
leaq 0x20(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movq %rsp, %rcx
callq 0xa7c9a
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdi
movq 0x28(%rax), %rsi
movapd 0x20(%rsp), %xmm0
movupd %xmm0, 0x18(%rax)
movq 0x30(%rsp), %rcx
movq %rcx, 0x28(%rax)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0x87aa1
subq %rdi, %rsi
callq 0x229c0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x87aa1
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
leaq 0x20(%rsp), %r13
xorpd %xmm0, %xmm0
movapd %xmm0, (%r13)
movq $0x0, 0x10(%r13)
leal -0x1(%r15), %ebx
movl $0x1, %r15d
movq %rsp, %rbp
leal 0x1(%r15), %r14d
cmpl %ebx, %r14d
ja 0x87b63
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rsi
cmpq %rax, %rsi
je 0x87ae9
movq %rax, 0x28(%rsp)
movq %rax, %rsi
movl %r15d, (%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, %rsi
je 0x87b05
movl %r15d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x87b1a
movq %r13, %rdi
movq %rbp, %rdx
callq 0xaeef8
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rax
addl $0x2, %r15d
movl %r15d, (%rsp)
cmpq %rax, %rsi
je 0x87b35
movl %r15d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x87b40
movq %r13, %rdi
movq %rbp, %rdx
callq 0xaeef8
movl %r14d, %eax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
movq 0x40(%rsp), %rax
addq (%rax), %rdi
movq %r13, %rsi
callq 0xa7bb6
movl %r14d, %r15d
jmp 0x87ac5
leaq 0xa0(%rsp), %rdx
movl %ebx, -0x8(%rdx)
movl $0x1, -0x4(%rdx)
movq %rsp, %rdi
leaq 0x98(%rsp), %rsi
leaq 0x5f(%rsp), %rcx
callq 0xa7c9a
movl 0x70(%rsp), %eax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rdi
movq 0x10(%rcx,%rax,8), %rsi
movapd (%rsp), %xmm0
movupd %xmm0, (%rcx,%rax,8)
movq 0x10(%rsp), %rdx
movq %rdx, 0x10(%rcx,%rax,8)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
testq %rdi, %rdi
je 0x87ce2
subq %rdi, %rsi
callq 0x229c0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x87ce2
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
jmp 0x87ce2
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x2, (%rsp)
cmpl $0x2, %r15d
jb 0x87c57
movl $0x2, %eax
leaq 0x20(%rsp), %r13
movq %rsp, %rbp
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x87c3f
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x87c4a
movq %r13, %rdi
movq %rbp, %rdx
callq 0x6b0da
movl (%rsp), %eax
incl %eax
movl %eax, (%rsp)
cmpl %r15d, %eax
jbe 0x87c26
movq 0x40(%rsp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
leaq 0x20(%rsp), %rsi
callq 0xa7bb6
cmpl $0x2, %r15d
jb 0x87ce2
movl $0x2, %ebx
leaq 0x20(%rsp), %r13
movq %rsp, %rbp
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rsi
cmpq %rax, %rsi
je 0x87c97
movq %rax, 0x28(%rsp)
movq %rax, %rsi
movl $0x1, (%rsp)
cmpq 0x30(%rsp), %rsi
je 0x87cb6
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x87cc1
movq %r13, %rdi
movq %rbp, %rdx
callq 0xaeef8
movl %ebx, %eax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
movq 0x40(%rsp), %rax
addq (%rax), %rdi
movq %r13, %rsi
callq 0xa7bb6
incl %ebx
cmpl %r15d, %ebx
jbe 0x87c80
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x88548
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
jmp 0x88548
movl %r15d, %eax
cvtsi2sd %rax, %xmm0
sqrtsd %xmm0, %xmm0
callq 0x22170
cvttsd2si %xmm0, %r14
testl %r14d, %r14d
je 0x87f01
movl %r15d, %eax
xorl %edx, %edx
divl %r14d
incl %r14d
testl %edx, %edx
jne 0x87d21
decl %r14d
jmp 0x87f04
movl %r15d, %eax
cvtsi2sd %rax, %xmm0
sqrtsd %xmm0, %xmm0
callq 0x22170
cvttsd2si %xmm0, %r14
testl %r14d, %r14d
je 0x881a6
movl %r15d, %eax
xorl %edx, %edx
divl %r14d
incl %r14d
testl %edx, %edx
jne 0x87d57
decl %r14d
jmp 0x881a9
leaq 0x68(%rsp), %rdx
callq 0xaeef8
cmpq $0x0, 0x48(%rsp)
je 0x8853e
movl $0x1, %ebx
movq %rsp, %rbp
movl $0x1, %r14d
addl %r14d, %r14d
je 0x87dde
movl %ebx, %eax
leaq (%rax,%rax,2), %r15
movl %r14d, %r12d
movq 0x20(%rsp), %rax
leaq (%rax,%r15,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x87dc2
movl (%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x87dcd
movq %rbp, %rdx
callq 0x6b0da
movl (%rsp), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rsp)
cmpl 0x70(%rsp), %eax
je 0x87de6
decl %r12d
jne 0x87da0
incl %ebx
cmpl 0x48(%rsp), %ebx
jbe 0x87d92
cmpl $0x1, 0x48(%rsp)
je 0x8853e
movl $0x1, %edx
movq 0x20(%rsp), %rax
leaq (%rdx,%rdx,2), %r14
movq (%rax,%r14,8), %rcx
cmpq %rcx, 0x8(%rax,%r14,8)
movq %rdx, 0x60(%rsp)
je 0x87ee9
decq %rdx
xorl %r12d, %r12d
movl $0x1, %ebp
leaq (%rdx,%rdx,2), %rdx
movq %rdx, 0x50(%rsp)
xorl %r13d, %r13d
xorl %ebx, %ebx
movl (%rcx,%r12,4), %edx
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
leaq (%rdx,%rdx,2), %rsi
movslq %ebx, %r15
leaq (,%r15,4), %rdx
movq 0x50(%rsp), %rdi
addq (%rax,%rdi,8), %rdx
leaq (%rcx,%rsi,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x87e6c
movl (%rdx), %edx
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x87e8b
callq 0x6b0da
movq 0x20(%rsp), %rax
movq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movl (%rcx,%r15,4), %edx
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movl %edx, %edx
leaq (%rdx,%rdx,2), %rdx
shlq $0x2, %r12
addq (%rax,%r14,8), %r12
leaq (%rcx,%rdx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x87eb7
movl (%r12), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x87ec4
movq %r12, %rdx
callq 0x6b0da
movq 0x20(%rsp), %rax
addl %r13d, %ebx
xorl $0x1, %r13d
movl %ebp, %r12d
movq (%rax,%r14,8), %rcx
movq 0x8(%rax,%r14,8), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
incl %ebp
cmpq %r12, %rdx
ja 0x87e2c
movq 0x60(%rsp), %rdx
incq %rdx
cmpq 0x48(%rsp), %rdx
jne 0x87dfb
jmp 0x8853e
xorl %r14d, %r14d
movl %r15d, %eax
xorl %edx, %edx
divl %r14d
movl %eax, %r13d
movq %rsp, %rdi
leaq 0x68(%rsp), %rdx
movq %r13, %rsi
callq 0xa7cdc
movl %r14d, %esi
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
leaq 0x98(%rsp), %rcx
callq 0xa7d68
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x87f4d
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
movq 0x20(%rsp), %rax
cmpl $0x1, %r14d
movl %r14d, %r10d
adcl $0x0, %r10d
xorl %ecx, %ecx
xorl %edx, %edx
cmpl %r15d, %r14d
ja 0x87f89
leaq (%rcx,%rcx,2), %rsi
movq (%rax,%rsi,8), %rsi
movl %edx, %edi
xorl %r8d, %r8d
leal (%rdi,%r8), %r9d
incl %r9d
movl %r9d, (%rsi,%r8,4)
incq %r8
cmpq %r13, %r8
jb 0x87f73
addl %r8d, %edx
incq %rcx
cmpq %r10, %rcx
jne 0x87f61
xorpd %xmm0, %xmm0
movq %rsp, %rax
movapd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
leal -0x1(%r14), %eax
movq %rax, 0x60(%rsp)
leal -0x1(%r13), %eax
movq %rax, 0x78(%rsp)
leaq (,%rax,4), %rax
movq %rax, 0x48(%rsp)
xorl %ebx, %ebx
movq %r14, 0x90(%rsp)
movq %r10, 0x88(%rsp)
cmpl %r15d, %r14d
jbe 0x87fe5
incq %rbx
movq %rbx, %rax
jmp 0x88198
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl %ebx, %eax
movq %rax, 0x50(%rsp)
leaq 0x1(%rbx), %rax
movq %rax, 0x80(%rsp)
leaq (%rbx,%rbx,2), %r14
xorl %r15d, %r15d
xorl %ebp, %ebp
movq (%rsp), %rax
movq 0x8(%rsp), %rsi
cmpq %rax, %rsi
je 0x8801c
movq %rax, 0x8(%rsp)
movq %rax, %rsi
movq 0x20(%rsp), %rcx
movq (%rcx,%r14,8), %rax
movslq (%rax,%r15), %r12
movq 0x10(%rsp), %rax
testq %rbx, %rbx
je 0x8804d
movq 0x50(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %rdx
cmpq 0x60(%rsp), %rbx
jne 0x88056
leaq (%rdx,%rbp,4), %rdx
jmp 0x8809c
movq 0x18(%rcx), %rdx
addq %r15, %rdx
jmp 0x8809c
addq %r15, %rdx
cmpq %rax, %rsi
je 0x8806d
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x8807f
movq %rsp, %rdi
callq 0x6b0da
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x80(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdi
leaq (,%rbp,4), %rdx
addq (%rcx,%rdi,8), %rdx
cmpq %rax, %rsi
je 0x880b0
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x880b8
movq %rsp, %rdi
callq 0x6b0da
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
testq %r15, %r15
je 0x880e6
movq 0x20(%rsp), %rcx
movq (%rcx,%r14,8), %rcx
cmpq %r15, 0x48(%rsp)
jne 0x880f5
movq 0x78(%rsp), %rdx
leaq (%rcx,%rdx,4), %rdx
addq $-0x4, %rdx
jmp 0x88134
movq 0x20(%rsp), %rcx
movq (%rcx,%r14,8), %rdx
addq $0x4, %rdx
jmp 0x88134
leaq (%rcx,%r15), %rdx
addq $-0x4, %rdx
cmpq %rax, %rsi
je 0x88111
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x88123
movq %rsp, %rdi
callq 0x6b0da
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%r14,8), %rcx
leaq (%rcx,%r15), %rdx
addq $0x4, %rdx
cmpq %rax, %rsi
je 0x88148
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x88150
movq %rsp, %rdi
callq 0x6b0da
leaq (%r12,%r12,2), %rdi
shlq $0x3, %rdi
movq 0x40(%rsp), %rax
addq (%rax), %rdi
movq %rsp, %rsi
callq 0xa7bb6
incq %rbp
addq $0x4, %r15
cmpq %r13, %rbp
jb 0x88006
movq 0x80(%rsp), %rax
movq %rax, %rbx
movq 0x70(%rsp), %r15
movq 0x90(%rsp), %r14
movq 0x88(%rsp), %r10
cmpq %r10, %rax
jne 0x87fd5
jmp 0x88528
xorl %r14d, %r14d
movl %r15d, %eax
xorl %edx, %edx
divl %r14d
movl %eax, %ebx
movq %rsp, %rdi
leaq 0x68(%rsp), %rdx
movq %rbx, %rsi
callq 0xa7cdc
movl %r14d, %esi
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
leaq 0x98(%rsp), %rcx
callq 0xa7d68
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x881f1
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
movq 0x20(%rsp), %rax
cmpl $0x1, %r14d
movl %r14d, %r10d
adcl $0x0, %r10d
xorl %ecx, %ecx
xorl %edx, %edx
cmpl %r15d, %r14d
ja 0x8822d
leaq (%rcx,%rcx,2), %rsi
movq (%rax,%rsi,8), %rsi
movl %edx, %edi
xorl %r8d, %r8d
leal (%rdi,%r8), %r9d
incl %r9d
movl %r9d, (%rsi,%r8,4)
incq %r8
cmpq %rbx, %r8
jb 0x88217
addl %r8d, %edx
incq %rcx
cmpq %r10, %rcx
jne 0x88205
xorpd %xmm0, %xmm0
movq %rsp, %rax
movapd %xmm0, (%rax)
movq %rax, %r12
movq $0x0, 0x10(%rax)
leal -0x1(%r14), %eax
movq %rax, 0x50(%rsp)
movq %rbx, 0x48(%rsp)
leal -0x1(%rbx), %eax
movq %rax, 0x90(%rsp)
leaq (,%rax,4), %rax
movq %rax, 0x60(%rsp)
xorl %ebx, %ebx
movq %r14, 0x88(%rsp)
movq %r10, 0xa8(%rsp)
cmpl %r15d, %r14d
jbe 0x88293
incq %rbx
movq %rbx, %rax
jmp 0x8851f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl %ebx, %eax
movq %rax, 0x80(%rsp)
leaq 0x1(%rbx), %rax
movq %rax, 0x78(%rsp)
leaq (%rbx,%rbx,2), %r14
xorl %r15d, %r15d
xorl %ebp, %ebp
movq (%rsp), %rax
movq 0x8(%rsp), %rsi
cmpq %rax, %rsi
je 0x882ca
movq %rax, 0x8(%rsp)
movq %rax, %rsi
movq 0x20(%rsp), %rcx
movq (%rcx,%r14,8), %rax
movl (%rax,%r15), %r13d
movq 0x10(%rsp), %rax
testq %rbx, %rbx
je 0x8830f
movq 0x80(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %rdx
addq %r15, %rdx
cmpq 0x50(%rsp), %rbx
jne 0x8832a
cmpq %rax, %rsi
je 0x88367
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x88379
movq 0x18(%rcx), %rdx
addq %r15, %rdx
cmpq %rax, %rsi
je 0x8833e
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x88350
cmpq %rax, %rsi
je 0x8838b
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x8839d
movq %r12, %rdi
callq 0x6b0da
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x50(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %rdx
addq %r15, %rdx
jmp 0x883b7
movq %r12, %rdi
callq 0x6b0da
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
leaq (,%rbp,4), %rdx
addq (%rcx), %rdx
jmp 0x883b7
movq %r12, %rdi
callq 0x6b0da
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x78(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdi
leaq (,%rbp,4), %rdx
addq (%rcx,%rdi,8), %rdx
cmpq %rax, %rsi
je 0x883cb
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x883d3
movq %r12, %rdi
callq 0x6b0da
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
testq %r15, %r15
je 0x88416
movq 0x20(%rsp), %rcx
movq (%rcx,%r14,8), %rcx
cmpq %r15, 0x60(%rsp)
jne 0x88437
movq 0x90(%rsp), %rdx
leaq (%rcx,%rdx,4), %rdx
addq $-0x4, %rdx
cmpq %rax, %rsi
je 0x88475
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x88487
movq 0x20(%rsp), %rcx
movq (%rcx,%r14,8), %rdx
addq $0x4, %rdx
cmpq %rax, %rsi
je 0x88453
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x88465
leaq (%rcx,%r15), %rdx
addq $-0x4, %rdx
cmpq %rax, %rsi
je 0x88492
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x884a4
movq %r12, %rdi
callq 0x6b0da
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%r14,8), %rdx
addq 0x60(%rsp), %rdx
jmp 0x884b5
movq %r12, %rdi
callq 0x6b0da
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%r14,8), %rdx
jmp 0x884b5
movq %r12, %rdi
callq 0x6b0da
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%r14,8), %rcx
leaq (%rcx,%r15), %rdx
addq $0x4, %rdx
cmpq %rax, %rsi
je 0x884c9
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x884d1
movq %r12, %rdi
callq 0x6b0da
leaq (,%r13,2), %rdi
addq %r13, %rdi
shlq $0x3, %rdi
movq 0x40(%rsp), %rax
addq (%rax), %rdi
movq %r12, %rsi
callq 0xa7bb6
incq %rbp
addq $0x4, %r15
cmpq 0x48(%rsp), %rbp
jb 0x882b4
movq 0x78(%rsp), %rax
movq %rax, %rbx
movq 0x70(%rsp), %r15
movq 0x88(%rsp), %r14
movq 0xa8(%rsp), %r10
cmpq %r10, %rax
jne 0x88283
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x8853e
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
leaq 0x20(%rsp), %rdi
callq 0xa7156
callq 0x220b0
movq %rax, %r12
movq 0xa0(%rsp), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x885db
movq 0xeda40(%rip), %rdi     # 0x175fa8
leaq 0x76936(%rip), %rsi     # 0xfeea5
movl $0x17, %edx
callq 0x22ab0
subq 0xb0(%rsp), %r12
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
divsd 0x75a8f(%rip), %xmm0    # 0xfe020
movq 0xeda10(%rip), %rdi     # 0x175fa8
callq 0x23060
movq %rax, %r14
leaq 0x76916(%rip), %rsi     # 0xfeebd
movl $0x8, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq 0x40(%rsp), %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7686c(%rip), %rsi     # 0xfee65
leaq 0xb8(%rsp), %rdi
movq %r13, %rdx
callq 0x31944
leaq 0xb8(%rsp), %rsi
movq %rbx, %rdi
callq 0x784c2
jmp 0x88678
movq %rax, %r14
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x886be
movq 0xc8(%rsp), %rsi
incq %rsi
jmp 0x88692
jmp 0x88648
jmp 0x8866f
jmp 0x88648
jmp 0x8866f
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x886be
movq 0x10(%rsp), %rsi
jmp 0x8868f
jmp 0x8867d
jmp 0x8867d
jmp 0x8866f
jmp 0x88678
jmp 0x8867d
jmp 0x8867d
jmp 0x8867d
jmp 0x8867d
jmp 0x8867d
jmp 0x8866f
movq %rax, %r14
jmp 0x886be
jmp 0x8867d
jmp 0x8867d
movq %rax, %r14
jmp 0x886b4
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x886be
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
jmp 0x886be
jmp 0x8869b
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x886b4
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
leaq 0x20(%rsp), %rdi
callq 0xa7156
movq 0x40(%rsp), %rdi
callq 0xa7156
movq %r14, %rdi
callq 0x23240