// File: /workspace/github_cpp_makefile_star2_O3/SNUCSE-CTA[P]GI/src/refine.cpp
// Function: Refinement::prepCoreOne(Coloring*, Graph*, Graph*)
int32_t Refinement::prepCoreOne(Coloring* aColoring, Graph* aG1, Graph* aG2)
{
	#ifdef DEBUG
	cout << __PRETTY_FUNCTION__ << endl;
	#endif

	Graph* g1 = aG1;
	Graph* g2 = aG2;

	int32_t n = g1->numNode;
	int32_t* d1 = g1->d;
	char* one1 = g1->one;
	int32_t** neigh1 = g1->e;
	int32_t* d2 = g2->d;
	char* one2 = g2->one;
	int32_t** neigh2 = g2->e;
	int32_t numNode = aColoring->numNode;
	int32_t* perm = aColoring->perm;
	int32_t* inv = aColoring->inv;
	int32_t* cellSize = aColoring->cellSize;
	int32_t* color = aColoring->color;

	int32_t i, j, k, sc, ind, currCell, cellEnd, visitCellInd;
	int32_t u, du, v, adj, cell, splitInd, splitCountInd, count, size, endIdx, newCell;
	int32_t numDeleted = 0;

	//check if there are coreness-1 vertices.
	bool hasDegreeOne = false;
	for(i = 0; i < n; ++i) {
		if( d1[i] == 1 ){
			hasDegreeOne = true;
			break;
		}
	}
	if( hasDegreeOne == false )
		return 0;

	//now there is at least one degree one vertex

	//push cells having degree one vertices to cellStack
	stackSize = 0;
	for( i = 0; i < numNode; i += cellSize[i] ) {
		u = perm[i];
		du = (u < n) ? d1[u] : d2[u - n];
		if( du == 1 ) {
			cellStack[stackSize] = i;
			++stackSize;
		}
	}

	ind = 0;
	while( ind < stackSize ) {
		if( global_mark > INFINITY ) {
			memset(markCell, 0, sizeof(int32_t) * n);
			memset(markNode, 0, sizeof(int32_t) * n);
			global_mark = 0;
		}
		++global_mark;

		//Step 1. select a cell from cellStack and count the cell
		currCell = cellStack[ind];
		++ind;

		cellEnd = currCell + cellSize[currCell];
		visitCellInd = 0;
		for(i = currCell; i < cellEnd; ++i) {
			u = perm[i];
			if(u < n) { //g1
				adj = *(neigh1[u]); //the only neighbor of u
				if( d1[adj] != 1 ) {
					d1[u] = -1;
					one1[u] = 1;
				}

				if( markNode[adj] == global_mark ) {
					++(neighCount[adj]);
				}
				else { //adj is visited first time
					cell = color[ inv[adj] ];
					markNode[adj] = global_mark;
					neighCount[adj] = 1;
					if( markCell[cell] != global_mark ) { //cell is visited first time
						visitCell[visitCellInd] = cell;
						++visitCellInd;
						markCell[cell] = global_mark;
						visitNode[cell] = adj;
						numVisitNode[cell] = 1;
					}
					else {
						visitNode[cell + numVisitNode[cell]] = adj;
						++(numVisitNode[cell]);
					}
				}
			}
			else { //g2
				adj = *(neigh2[u - n]); //the only neighbor of u
				if( d2[adj] != 1 ) {
					d2[u - n] = -1;
					one2[u - n] = 1;
				}

				if( markNode[adj + n] == global_mark ) {
					++(neighCount[adj + n]);
				}
				else { //adj is visited first time
					cell = color[ inv[adj + n] ];
					markNode[adj + n] = global_mark;
					neighCount[adj + n] = 1;
					if( markCell[cell] != global_mark ) { //cell is visited first time
						visitCell[visitCellInd] = cell;
						++visitCellInd;
						markCell[cell] = global_mark;
						visitNode[cell] = adj + n;
						numVisitNode[cell] = 1;
					}
					else {
						visitNode[cell + numVisitNode[cell]] = adj + n;
						++(numVisitNode[cell]);
					}
				}
			} //if-else ( u < n )
		} //for (i)
		++global_mark;

		//Step 2. find out cells to split & delete edges whose degree not 1
		sort(visitCell, visitCell+visitCellInd);
		splitInd = 0;
		splitCell[0] = numNode;
		for(j = 0; j < visitCellInd; ++j) {
			cell = visitCell[j]; //for each visited cell
			//TODO: I think we have always (numVisitNode[cell] > 0).
			if( numVisitNode[cell] > 0 && numVisitNode[cell] < cellSize[cell] ) {
				splitCell[splitInd] = cell;
				++splitInd;
			}
			else {
				cellEnd = cell + cellSize[cell];
				count = neighCount[ perm[cell] ];
				for(i = cell + 1; i < cellEnd; ++i) {
					if( neighCount[ perm[i] ] != count ) {
						splitCell[splitInd] = cell;
						++splitInd;
						break;
					}
				}
				if( i == cellEnd ) { //cell does not split
					u = perm[cell];
					du = (u < n) ? d1[u] : d2[u - n];
					if( du != 1 ) {
						for(k = cell; k < cellEnd; ++k) {
							v = perm[k]; //each vertex in this cell
							deleteEdge(v, neighCount[v], g1, g2);
							numDeleted += neighCount[v];
						}
						//if degree becomes 1 after deleting edges
						du = (u < n) ? d1[u] : d2[u - n];
						if( du == 1 ) {
							cellStack[stackSize] = cell;
							++stackSize;
						}
					} //if (du != 1)
				} //if (i == cellEnd)
			} //if-else (numVisitNode[cell] < cellSize[cell])
		} //for (j)

		//Step 3. split the cells in splitCell
		if( splitInd > 0 ) {
			for(sc = 0; sc < splitInd; ++sc) { //for each cell to split
				cell = splitCell[sc];
				cellEnd = cell + cellSize[cell];

				//Step 3-1. count #vertices of each new cell
				splitCountInd = 0;
				if( numVisitNode[cell] < cellSize[cell] ) {
					splitCount[splitCountInd] = 0;
					++splitCountInd;
					splitPos[0] = cellSize[cell] - numVisitNode[cell];
				}
				endIdx = cell + numVisitNode[cell];
				for(i = cell; i < endIdx; ++i) {
					count = neighCount[ visitNode[i] ];
					//Note that markCell marks 'count' in below.
					if( markCell[count] != global_mark ) {
						markCell[count] = global_mark;
						splitCount[splitCountInd] = count;
						++splitCountInd;
						splitPos[count] = 1;
					}
					else {
						++(splitPos[count]);
					}
				} //for (i)
				++global_mark;

				sort(splitCount, splitCount + splitCountInd);
				aColoring->numCell += (splitCountInd - 1);

				//Step 3-2. compute start position of each new cell
				i = cell;
				for(k = 0; k < splitCountInd; ++k) {
					size = splitPos[ splitCount[k] ];
					cellSize[i] = size;
					splitPos[ splitCount[k] ] = i;
					i += size;
				}

				//Step 3-3. move vertices to its appropriate new cells
				endIdx = cell + numVisitNode[cell];
				for(i = cell; i < endIdx; ++i) {
					u = visitNode[i];
					deleteEdge(u, neighCount[u], g1, g2);
					numDeleted += neighCount[u];
					j = splitPos[ neighCount[u] ]; //where u goes
					++(splitPos[ neighCount[u] ]);
					k = inv[u]; //where u was

					perm[k] = perm[j];
					perm[j] = u;
					inv[u] = j;
					inv[ perm[k] ] = k;
					neighCount[u] = 0;
				}

				//Step 3-4. recolor the vertices in new cells
				newCell = cellEnd - numVisitNode[cell];
				i = newCell;
				endIdx = newCell + cellSize[newCell] - 1;
				do {
					color[i] = newCell;
					if( i == endIdx ) {
						newCell = i + 1;
						if( newCell < numNode )
							endIdx = newCell + cellSize[newCell] - 1;
					}
				} while( ++i < cellEnd );

				//Step 3-5. push the new cells to the stack
				for(i = cell, k = 0; k < splitCountInd; i += cellSize[i], ++k) {
					if( k > 0 || splitCount[0] > 0 ) {
						u = perm[i];
						du = (u < n) ? d1[u] : d2[u - n];
						if( du == 1 ) {
							cellStack[stackSize] = i;
							++stackSize;
						}
					}
				}
			} //for (sc)
		} //if( splitInd > 0 )
	} //while (ind < stackSize)

	return numDeleted;
}

// Assembly:
movslq 0xc(%rdx), %r11
testq %r11, %r11
jle 0x97dd
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbp
movq 0x20(%rdx), %r15
movq 0x30(%rdx), %r14
movq %rsi, %r10
movq 0x38(%rdx), %r13
movq 0x20(%rcx), %rsi
movq 0x30(%rcx), %rax
movq %rax, 0xb8(%rsp)
movq 0x38(%rcx), %rax
movq %rax, 0xd0(%rsp)
movl (%r10), %edi
movq 0x10(%r10), %r8
movq 0x18(%r10), %r9
movq 0x20(%r10), %rbx
movq %r10, 0x78(%rsp)
movq 0x8(%r10), %rax
movq %rax, 0x68(%rsp)
xorl %eax, %eax
cmpl $0x1, (%r15,%rax,4)
je 0x97e0
incq %rax
cmpq %rax, %r11
jne 0x97c9
jmp 0xa058
xorl %eax, %eax
retq
movl $0x0, 0x28(%rbp)
testl %edi, %edi
jle 0xa058
movq %r9, 0x60(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rbp), %rax
xorl %r9d, %r9d
xorl %r10d, %r10d
movq %rdi, 0x58(%rsp)
movq %r8, (%rsp)
movq %rbx, 0x8(%rsp)
movslq %r10d, %rsi
movslq (%r8,%rsi,4), %rdi
movl %edi, %r8d
subl %r11d, %r8d
cmpl %r11d, %edi
leaq (%r15,%rdi,4), %rdi
movslq %r8d, %r8
movq 0x18(%rsp), %rbx
leaq (%rbx,%r8,4), %r8
cmovlq %rdi, %r8
cmpl $0x1, (%r8)
jne 0x984d
movslq %r9d, %rdi
movl %r10d, (%rax,%rdi,4)
movl 0x28(%rbp), %r9d
incl %r9d
movl %r9d, 0x28(%rbp)
movq 0x58(%rsp), %rdi
movq 0x8(%rsp), %rbx
addl (%rbx,%rsi,4), %r10d
cmpl %edi, %r10d
movq (%rsp), %r8
jl 0x9811
testl %r9d, %r9d
jle 0xa058
movq %rdx, 0x80(%rsp)
movq %rcx, 0x88(%rsp)
leaq (,%r11,4), %rax
movq %rax, 0x90(%rsp)
leaq 0x4(%rbx), %rax
movq %rax, 0xa8(%rsp)
xorl %edx, %edx
xorl %eax, %eax
movq %r11, 0x48(%rsp)
movq %r14, 0x70(%rsp)
movq %r13, 0x98(%rsp)
movq 0x18(%rsp), %r10
movq %r15, 0x30(%rsp)
movl %eax, 0x10(%rsp)
movl 0x80(%rbp), %ebx
cmpl $0x77359401, %ebx       # imm = 0x77359401
jl 0x9906
movq 0x70(%rbp), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
movq 0x90(%rsp), %r12
movq %rdx, %r14
movq %r12, %rdx
callq 0x20e0
movq 0x78(%rbp), %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20e0
movq %r14, %rdx
movq 0x70(%rsp), %r14
movq 0x18(%rsp), %r10
movq 0x48(%rsp), %r11
leal 0x1(%rbx), %eax
movl %eax, 0x80(%rbp)
movq 0x20(%rbp), %rax
movq %rdx, 0xa0(%rsp)
movslq (%rax,%rdx,4), %rax
movq 0x8(%rsp), %rcx
movl (%rcx,%rax,4), %ecx
testl %ecx, %ecx
jle 0xa008
addl %eax, %ecx
movslq %ecx, %rcx
xorl %ebx, %ebx
movq (%rsp), %rdx
movslq (%rdx,%rax,4), %rsi
cmpl %r11d, %esi
jge 0x997e
movq (%r13,%rsi,8), %rdx
movl (%rdx), %edx
movslq %edx, %rdi
cmpl $0x1, (%r15,%rdi,4)
je 0x9961
movl $0xffffffff, (%r15,%rsi,4) # imm = 0xFFFFFFFF
movb $0x1, (%r14,%rsi)
movq 0x78(%rbp), %r8
movl 0x80(%rbp), %r9d
cmpl %r9d, (%r8,%rdi,4)
jne 0x99ce
movq 0x30(%rbp), %rdx
incl (%rdx,%rdi,4)
jmp 0x9ab2
subl %r11d, %esi
movslq %esi, %rsi
movq 0xd0(%rsp), %rdx
movq (%rdx,%rsi,8), %rdx
movslq (%rdx), %rdx
cmpl $0x1, (%r10,%rdx,4)
je 0x99ae
movl $0xffffffff, (%r10,%rsi,4) # imm = 0xFFFFFFFF
movq 0xb8(%rsp), %rdi
movb $0x1, (%rdi,%rsi)
movq 0x78(%rbp), %rdi
addq %r11, %rdx
movl 0x80(%rbp), %r8d
cmpl %r8d, (%rdi,%rdx,4)
jne 0x9a19
movq 0x30(%rbp), %rsi
incl (%rsi,%rdx,4)
jmp 0x9ab2
movq 0x60(%rsp), %rsi
movslq (%rsi,%rdi,4), %rsi
movq 0x68(%rsp), %r12
movl (%r12,%rsi,4), %esi
movslq %esi, %rsi
movl %r9d, (%r8,%rdi,4)
movq 0x30(%rbp), %r8
movl $0x1, (%r8,%rdi,4)
movq 0x70(%rbp), %rdi
movl (%rdi,%rsi,4), %r8d
cmpl 0x80(%rbp), %r8d
jne 0x9a67
movq 0x40(%rbp), %rdi
movq 0x48(%rbp), %r8
movslq (%r8,%rsi,4), %r9
addq %rsi, %r9
movl %edx, (%rdi,%r9,4)
jmp 0x9a61
movq 0x60(%rsp), %rsi
movslq (%rsi,%rdx,4), %rsi
movq 0x68(%rsp), %r9
movl (%r9,%rsi,4), %esi
movslq %esi, %rsi
movl %r8d, (%rdi,%rdx,4)
movq 0x30(%rbp), %rdi
movl $0x1, (%rdi,%rdx,4)
movq 0x70(%rbp), %rdi
movl (%rdi,%rsi,4), %r8d
cmpl 0x80(%rbp), %r8d
jne 0x9a88
movq 0x40(%rbp), %rdi
movq 0x48(%rbp), %r8
movslq (%r8,%rsi,4), %r9
addq %rsi, %r9
movl %edx, (%rdi,%r9,4)
incl (%r8,%rsi,4)
jmp 0x9ab2
movq 0x38(%rbp), %r8
movslq %ebx, %r9
movl %esi, (%r8,%r9,4)
incl %ebx
movl 0x80(%rbp), %r8d
movl %r8d, (%rdi,%rsi,4)
movq 0x40(%rbp), %rdi
movl %edx, (%rdi,%rsi,4)
jmp 0x9aa7
movq 0x38(%rbp), %r8
movslq %ebx, %rbx
movl %esi, (%r8,%rbx,4)
incl %ebx
movl 0x80(%rbp), %r8d
movl %r8d, (%rdi,%rsi,4)
movq 0x40(%rbp), %rdi
movl %edx, (%rdi,%rsi,4)
movq 0x48(%rbp), %rdx
movl $0x1, (%rdx,%rsi,4)
incq %rax
cmpq %rcx, %rax
jl 0x9936
incl 0x80(%rbp)
testl %ebx, %ebx
je 0xa011
movslq %ebx, %rax
movq 0x38(%rbp), %r13
leaq (,%rax,4), %r15
addq %r13, %r15
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x89b7
movq %r13, %rdi
movq %r15, %rsi
callq 0x8a92
movq 0x50(%rbp), %rax
movq 0x58(%rsp), %rcx
movl %ecx, (%rax)
testl %ebx, %ebx
jle 0xa047
movl %ebx, %r8d
xorl %r12d, %r12d
xorl %r9d, %r9d
movq 0x48(%rsp), %r11
movq 0x30(%rsp), %r15
movq 0x18(%rsp), %r10
movq (%rsp), %rdi
movq 0x8(%rsp), %rbx
movl 0x10(%rsp), %eax
movq %r8, 0x38(%rsp)
movq 0x38(%rbp), %rdx
movq 0x48(%rbp), %rcx
movl (%rdx,%r12,4), %r13d
movslq %r13d, %r14
movl (%rcx,%r14,4), %ecx
testl %ecx, %ecx
setg %dl
movl (%rbx,%r14,4), %esi
cmpl %esi, %ecx
setl %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x9b79
movq 0x50(%rbp), %rdx
movslq %r9d, %rcx
movl %r13d, (%rdx,%rcx,4)
incl %r9d
jmp 0x9ca9
movq %r12, 0x50(%rsp)
movq %r9, 0x28(%rsp)
movl %esi, %r12d
movq %r13, 0x20(%rsp)
leal (%r12,%r13), %esi
movq 0x30(%rbp), %rcx
leaq (%rdi,%r14,4), %rdx
movslq (%rdx), %rdi
movl (%rcx,%rdi,4), %edi
movslq %esi, %rbx
movl $0x1, %r8d
movq %r8, %rsi
addq %r14, %r8
cmpq %rbx, %r8
jge 0x9bdc
movslq (%rdx,%rsi,4), %r9
leaq 0x1(%rsi), %r8
cmpl %edi, (%rcx,%r9,4)
je 0x9ba6
movq 0x50(%rbp), %rdi
movq 0x28(%rsp), %r8
movslq %r8d, %r8
movq 0x20(%rsp), %r9
movl %r9d, (%rdi,%r8,4)
incl %r8d
movq %r8, 0x28(%rsp)
cmpl %esi, %r12d
jne 0x9c91
movslq (%rdx), %rdx
leaq (%r15,%rdx,4), %rsi
subl %r11d, %edx
movslq %edx, %rdx
leaq (%r10,%rdx,4), %rdx
cmovlq %rsi, %rdx
cmpl $0x1, (%rdx)
je 0x9c91
testl %r12d, %r12d
jle 0x9c91
movq %rdx, 0x10(%rsp)
movq (%rsp), %r12
movslq (%r12,%r14,4), %r15
movl (%rcx,%r15,4), %edx
movl %eax, %r13d
movl %r15d, %esi
movq 0x80(%rsp), %rcx
movq 0x88(%rsp), %r8
callq 0xac50
movl %r13d, %eax
movq 0x30(%rbp), %rcx
addl (%rcx,%r15,4), %eax
incq %r14
cmpq %rbx, %r14
jl 0x9c15
movq 0x10(%rsp), %rcx
cmpl $0x1, (%rcx)
movq 0x8(%rsp), %rbx
movq 0x38(%rsp), %r8
movq 0x28(%rsp), %r9
movq 0x50(%rsp), %r12
jne 0x9c7c
movq 0x20(%rbp), %rdx
movslq 0x28(%rbp), %rcx
movq 0x20(%rsp), %rsi
movl %esi, (%rdx,%rcx,4)
incl 0x28(%rbp)
movq 0x48(%rsp), %r11
movq 0x30(%rsp), %r15
movq 0x18(%rsp), %r10
movq (%rsp), %rdi
jmp 0x9ca9
movq (%rsp), %rdi
movq 0x8(%rsp), %rbx
movq 0x38(%rsp), %r8
movq 0x28(%rsp), %r9
movq 0x50(%rsp), %r12
incq %r12
cmpq %r8, %r12
jne 0x9b3e
testl %r9d, %r9d
jle 0xa020
movl %r9d, %ecx
movq %rcx, 0xb0(%rsp)
movq 0x48(%rbp), %r12
xorl %edx, %edx
movq 0x50(%rbp), %rcx
movq %rdx, 0xc8(%rsp)
movl (%rcx,%rdx,4), %ecx
movl %ecx, 0x20(%rsp)
movslq %ecx, %r9
movl (%rbx,%r9,4), %ecx
movl (%r12,%r9,4), %r8d
xorl %r14d, %r14d
movq %rcx, 0xc0(%rsp)
cmpl %ecx, %r8d
jge 0x9d1f
movq 0x58(%rbp), %rcx
movl $0x0, (%rcx)
movl (%rbx,%r9,4), %ecx
subl (%r12,%r9,4), %ecx
movq 0x60(%rbp), %rdx
movl %ecx, (%rdx)
movl (%r12,%r9,4), %r8d
movl $0x1, %r14d
movl %eax, 0x10(%rsp)
testl %r8d, %r8d
movq %r9, 0x38(%rsp)
jle 0x9d85
addl 0x20(%rsp), %r8d
movq 0x30(%rbp), %rax
movq 0x40(%rbp), %rcx
movq 0x70(%rbp), %rdx
movq 0x58(%rbp), %rsi
movq 0x60(%rbp), %rdi
movslq %r8d, %r8
movslq (%rcx,%r9,4), %r10
movl (%rax,%r10,4), %r10d
movslq %r10d, %r10
movl 0x80(%rbp), %r11d
cmpl %r11d, (%rdx,%r10,4)
jne 0x9d67
incl (%rdi,%r10,4)
jmp 0x9d7d
movl %r11d, (%rdx,%r10,4)
movslq %r14d, %r14
movl %r10d, (%rsi,%r14,4)
incl %r14d
movl $0x1, (%rdi,%r10,4)
incq %r9
cmpq %r8, %r9
jl 0x9d49
incl 0x80(%rbp)
testl %r14d, %r14d
movq %r14, 0x50(%rsp)
je 0x9e20
movslq %r14d, %rax
movq 0x58(%rbp), %r15
leaq (%r15,%rax,4), %r12
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x89b7
movq %r15, %rdi
movq %r12, %rsi
callq 0x8a92
movq 0x78(%rsp), %rcx
movl 0x4(%rcx), %eax
addl %r14d, %eax
decl %eax
movl %eax, 0x4(%rcx)
testl %r14d, %r14d
setg %al
jle 0x9e32
movl %eax, 0x44(%rsp)
movq 0x58(%rbp), %rax
movq 0x60(%rbp), %rcx
movl %r14d, %edx
xorl %esi, %esi
movl 0x20(%rsp), %edi
movq 0x30(%rsp), %r15
movslq (%rax,%rsi,4), %r8
movslq %edi, %rdi
movl (%rcx,%r8,4), %r8d
movl %r8d, (%rbx,%rdi,4)
movslq (%rax,%rsi,4), %r9
movl %edi, (%rcx,%r9,4)
addl %edi, %r8d
incq %rsi
movl %r8d, %edi
cmpq %rsi, %rdx
jne 0x9df9
jmp 0x9e3f
movq 0x78(%rsp), %rax
decl 0x4(%rax)
movl $0x0, 0x44(%rsp)
jmp 0x9e3f
movl $0x0, 0x44(%rsp)
movq 0x30(%rsp), %r15
movq 0x48(%rbp), %r12
movq 0x38(%rsp), %r14
movl (%r12,%r14,4), %r8d
testl %r8d, %r8d
movl 0x20(%rsp), %eax
jle 0x9eff
addl %eax, %r8d
movslq %r8d, %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rbp), %rax
movq (%rsp), %rbx
movq 0x60(%rsp), %r12
movl 0x10(%rsp), %r13d
movq 0x40(%rbp), %rcx
movslq (%rcx,%r14,4), %r15
movl (%rax,%r15,4), %edx
movl %r15d, %esi
movq 0x80(%rsp), %rcx
movq 0x88(%rsp), %r8
callq 0xac50
movq 0x30(%rbp), %rax
movq 0x60(%rbp), %rcx
movslq (%rax,%r15,4), %rdx
addl %edx, %r13d
movslq (%rcx,%rdx,4), %rsi
leal 0x1(%rsi), %edi
movl %edi, (%rcx,%rdx,4)
movslq (%r12,%r15,4), %rcx
movl (%rbx,%rsi,4), %edx
movl %edx, (%rbx,%rcx,4)
movl %r15d, (%rbx,%rsi,4)
movl %esi, (%r12,%r15,4)
movslq (%rbx,%rcx,4), %rdx
movl %ecx, (%r12,%rdx,4)
movl $0x0, (%rax,%r15,4)
incq %r14
cmpq 0x28(%rsp), %r14
jl 0x9e76
movl %r13d, 0x10(%rsp)
movq 0x48(%rbp), %r12
movq 0x38(%rsp), %rax
movl (%r12,%rax,4), %r8d
movq 0x30(%rsp), %r15
movq 0x8(%rsp), %rbx
movl 0x20(%rsp), %eax
movq 0xc0(%rsp), %r9
addl %eax, %r9d
movslq %r9d, %rcx
subl %r8d, %r9d
movslq %r9d, %rdx
movl (%rbx,%rdx,4), %esi
addl %edx, %esi
decl %esi
leaq (,%rcx,4), %rdi
movslq %r8d, %r8
shlq $0x2, %r8
subq %r8, %rdi
movq 0xa8(%rsp), %rax
leaq (%rax,%rdi), %r8
movq %r9, %rax
addq 0x68(%rsp), %rdi
xorl %r9d, %r9d
movl %eax, %r10d
movq 0x58(%rsp), %rbx
movl %r10d, (%rdi,%r9,4)
leal (%rax,%r9), %r14d
leaq (%rdx,%r9), %r11
incq %r11
cmpl %esi, %r14d
jne 0x9f6f
leaq (%rax,%r9), %r10
incq %r10
cmpq %rbx, %r11
jge 0x9f6f
addl (%r8,%r9,4), %esi
incq %r9
cmpq %rcx, %r11
jl 0x9f4b
cmpb $0x0, 0x44(%rsp)
movq 0x48(%rsp), %r11
movq 0x18(%rsp), %r10
movq (%rsp), %rbx
movl 0x20(%rsp), %eax
je 0x9fe4
movq 0x20(%rbp), %rcx
movq 0x58(%rbp), %rdx
xorl %esi, %esi
movslq %eax, %rdi
testl %esi, %esi
jne 0x9fa6
cmpl $0x0, (%rdx)
jle 0x9fd3
movslq (%rbx,%rdi,4), %r8
movl %r8d, %r9d
subl %r11d, %r9d
cmpl %r11d, %r8d
leaq (%r15,%r8,4), %r8
movslq %r9d, %r9
leaq (%r10,%r9,4), %r9
cmovlq %r8, %r9
cmpl $0x1, (%r9)
jne 0x9fd3
movslq 0x28(%rbp), %r8
movl %eax, (%rcx,%r8,4)
incl 0x28(%rbp)
movq 0x8(%rsp), %r8
addl (%r8,%rdi,4), %eax
incl %esi
cmpl %esi, 0x50(%rsp)
jne 0x9f9a
movq 0xc8(%rsp), %rdx
incq %rdx
cmpq 0xb0(%rsp), %rdx
movq 0x8(%rsp), %rbx
movl 0x10(%rsp), %eax
jne 0x9ccf
jmp 0xa020
addl $0x2, %ebx
movl %ebx, 0x80(%rbp)
movq 0x50(%rbp), %rax
movq 0x58(%rsp), %rcx
movl %ecx, (%rax)
movl 0x10(%rsp), %eax
movq 0xa0(%rsp), %rdx
incq %rdx
movslq 0x28(%rbp), %rcx
cmpq %rcx, %rdx
movq 0x70(%rsp), %r14
movq 0x98(%rsp), %r13
jl 0x98b9
jmp 0xa05a
movq 0x48(%rsp), %r11
movq 0x30(%rsp), %r15
movq 0x18(%rsp), %r10
jmp 0xa01c
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq