// File: /workspace/github_cpp_makefile_star2_O3/SNUCSE-CTA[P]GI/src/backtrack.cpp
// Function: Backtrack::backtrack(int)
bool Backtrack::backtrack(int32_t aNumMatching)
{
	#ifdef DEBUG
	cout << __PRETTY_FUNCTION__ << endl;
	#endif

	int32_t depth = aNumMatching; //the number of mapped vertices
	int32_t curr = dag->root; //current mapping node of graph 1 (start from the root)
	int32_t i, j, p, prevCand, child, cand;
	bool backtrack = false;
	bool mappingFailed, needBacktrack;
	int32_t confSize = 0; //for the partial failing set
	int32_t* confArray = global_memory->getLLArray(n);

	int32_t* childSize = dag->childSize;
	int32_t* parentSize = dag->parentSize;
	int32_t* dagArr = dag->dagArr;
	int32_t* adjPos1 = g1->adjPos;
	

	//we implement the recursive backtracking function by iterative method
	while( true ) {
		//two cases:
		//	A. beginning of a new recursive function (backtrack == false)
		//	B. retruning from a recursive function (backtrack == true)
		if( backtrack == false ) {
			// Case A. beginning
			if( depth == n ) { //we found an isomorphism
				global_memory->returnLLArray(confArray, n);
				return true;
			}

            increaseNumRecur();

			curr = getMinExtVertex(); //get a node with the min-weight and delete it from the extendable vertex array.
			computeExtCand(curr);	//compute the extendable candidates by intersection and store it in extCand[curr].
			candPos[curr] = 0;	//index of the extendable candidate array
			matchingOrder[depth] = curr;	//store the matching order so as to get the previously matched node when backtracks.

			//failing set
			vector<int32_t>& curr_f = failingset[ depth - aNumMatching ];
			curr_f.clear();
		}
		else {
			// Case B. returning
			curr = matchingOrder[depth]; //when returning, no need to call getMinExtVertex()
			prevCand = mapping[curr];
			mapping[prevCand] = -1;
			mapping[curr] = -1;

			//update extendable vertices in DAG-ordering
			for(i = 0; i < childSize[curr]; ++i) {
				//delete children whose numMappedParent == parentSize from extendable vertex
				//, and decrease numMappedParent by 1 for each DAG child of u
				child = dagArr[ adjPos1[curr] + parentSize[curr] + i ];
				if( numMappedParent[child] == parentSize[child] ) {
					deleteExtVertex(child);
				}
				--(numMappedParent[child]);
			}

			//failing set
			vector<int32_t>& child_f = failingset[depth - aNumMatching + 1]; //failing set of a child node in the search tree
			int32_t fsetIndex = binarySearch(child_f, curr);
			if( fsetIndex == -1 ) { //if curr is not in child_f
				failingset[depth - aNumMatching] = child_f;

				backtrack = true;
				--depth;
				if( depth == aNumMatching - 1 ) {
					global_memory->returnLLArray(confArray, n);
					return false;
				}
				insertExtVertex(curr, weight[curr]);
				continue;
			}
			else {
				merge( failingset[depth - aNumMatching], child_f ); //union
			}
			
			//if all candidate failed
			if( candPos[curr] == (int32_t)extCand[curr].size() - 1 ) { 
				//failing set
				if( fsetIndex != -1 ) { //if curr is in child_f (it is merged to curr_f)
					vector<int32_t>& curr_f = failingset[depth - aNumMatching];

					//remove curr from curr_f
					curr_f.erase( curr_f.begin() + fsetIndex );

					//insert parent(curr) to curr_f
					global_temp_vector.clear(); //TODO: not using vector
					for(j = 0; j < parentSize[curr]; ++j) {
						p = dagArr[ adjPos1[curr] + j ];
						if( isBinary[p] == 0 )
							global_temp_vector.push_back(p);
					}
					merge(curr_f, global_temp_vector);
				}

				backtrack = true;
				--depth;
				if( depth == aNumMatching - 1 ) {
					global_memory->returnLLArray(confArray, n);
					return false;
				}
				insertExtVertex(curr, weight[curr]);
				continue;
			} //if(candPos[curr] == size() - 1)
			else {
				++(candPos[curr]); //try the next extendable candidate of curr
			}
		} //if-else(backtrack == false)

		if( global_mark > INFINITY ) {
			memset(markCell, 0, sizeof(int32_t) * n2);
			global_mark = 0;
		}
		++global_mark;
		confSize = 0;

		//common part of Cases A and B.
		while( true ) { //while mapping is not okay
			//map curr to the extendable candidate at candPos[curr]
			//if mapping is okay
			//	- then make a new recursive call (with backtrack == false)
			//if mapping is not okay
			//	- then try the next extendable candidate
			//if all extendable candidates are failed to be mapped
			//	- then decrease depth by 1 and backtrack (with backtrack == true)
			//	- if depth becomes -1, termindate

			cand = extCand[curr][ candPos[curr] ];
			mappingFailed = false;
			needBacktrack = false; //when all candidate failed

			if( mapping[cand] != -1 ) {
				//partial failing set
				if( markCell[ mapping[cand] ] != global_mark ) {
					markCell[ mapping[cand] ] = global_mark;
					confArray[confSize] = mapping[cand];
					++confSize;
				}
				if( markCell[curr] != global_mark ) {
					markCell[curr] = global_mark;
					confArray[confSize] = curr;
					++confSize;
				}

				if( candPos[curr] == (int32_t)extCand[curr].size() - 1 ) {
					needBacktrack = true;
				}
				else {
					++(candPos[curr]);
				}
			} // if mapping[cand] != -1
			else {
				mapping[curr] = cand;
				mapping[cand] = curr;

				//for each child of curr
				for(i = 0; i < childSize[curr]; ++i) {
					child = dagArr[ adjPos1[curr] + parentSize[curr] + i ];

					++(numMappedParent[child]);
					if( numMappedParent[child] == parentSize[child] ) {
						weight[child] = computeWeight(child);
						if( weight[child] == 0 ) {	//empty-set class
							mappingFailed = true;
							--(numMappedParent[child]);
							weight[child] = INFINITY;

							vector<int32_t>& curr_f = failingset[depth - aNumMatching];
							global_temp_vector.clear(); //TODO: not using vector
							for(j = 0; j < parentSize[child]; ++j) {
								p = dagArr[ adjPos1[child] + j ];
								if( isBinary[p] == 0 )
									global_temp_vector.push_back(p);
							}
							merge(curr_f, global_temp_vector);
							break; //break the for(i) loop
						} //if weight[child] == 0
						else { //weight[child] > 0
							insertExtVertex(child, weight[child]);
						} //if-else( weight[child] == 0 )
					} //if numMappedParent[child] == parentSize
					else {
						//we can compute weight[child] even if child is not extendable
						if( numMappedParent[child] > 1 && computeWeight(child) == 0 ) {
							mappingFailed = true;
							--(numMappedParent[child]);

							vector<int32_t>& curr_f = failingset[depth - aNumMatching];
							global_temp_vector.clear(); //TODO: not using vector
							for(j = 0; j < parentSize[child]; ++j) {
								p = dagArr[ adjPos1[child] + j ];
								if( isBinary[p] == 0 )
									global_temp_vector.push_back(p);
							}
							merge(curr_f, global_temp_vector);
							break; //break the for(i) loop
						} //if
					} //if-else numMappedParent == parentSize
				} //for (i)

				if( mappingFailed ) {
					//mapping failed because one of the children belongs the empty-set class
					mapping[curr] = -1;
					mapping[cand] = -1;
					for(i = i - 1; i > -1; --i) {
						child = dagArr[ adjPos1[curr] + parentSize[curr] + i ];
						if( numMappedParent[child] == parentSize[child] ) {
							deleteExtVertex(child);
						}
						--(numMappedParent[child]);
					}

					if( candPos[curr] == (int32_t)extCand[curr].size() - 1 ) {
						needBacktrack = true;
					}
					else {
						++(candPos[curr]);
					}
				} //if mappingFailed
				else { //mapping OKAY!
					if( confSize > 0 ) {
						sort(confArray, confArray + confSize);
						merge( failingset[depth - aNumMatching], confArray, confSize );
					}

					backtrack = false;
					++depth;
					break; //break the inner while loop
				} //if-else mappingFailed
			}//if-else mapping[cand] != -1
			
			if( needBacktrack ) {
				vector<int32_t>& curr_f = failingset[depth - aNumMatching];
				if( confSize > 0 ) {
					sort(confArray, confArray + confSize);
					merge(curr_f, confArray, confSize);
				}

				if( curr_f.size() != 0 ) {
					int32_t fsetIndex = binarySearch(curr_f, curr);
					if( fsetIndex != -1 ) {
						//remove curr
						curr_f.erase(curr_f.begin() + fsetIndex);

						//add parent(curr)
						global_temp_vector.clear(); //TODO: not using vector
						for(j = 0; j < parentSize[curr]; ++j) {
							p = dagArr[ adjPos1[curr] + j ];
							if( isBinary[p] == 0 )
								global_temp_vector.push_back(p);
						}
						merge(curr_f, global_temp_vector);
					}
				} //if curr_f.size() != 0

				backtrack = true;
				--depth;
				if( depth == aNumMatching - 1 ) {
					global_memory->returnLLArray(confArray, n);
					return false;
				}
				insertExtVertex(curr, weight[curr]);
				break; //break the inner while loop
			} //if needBacktrack
		} //while(true) of inner loop.
	} //while(true) of outer loop.

	global_memory->returnLLArray(confArray, n);
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %r15d
movq %rdi, %r14
movq 0xb0(%rdi), %rdi
movl 0x2c(%r14), %esi
callq 0x4aba
movq %rax, 0x20(%rsp)
movq 0x10(%r14), %rax
movq 0x40(%r14), %rcx
movq 0x10(%rcx), %rbx
movq 0x18(%rcx), %r12
movq 0x20(%rcx), %rcx
movq %rcx, 0x38(%rsp)
movq 0x40(%rax), %rax
movq %rax, 0x30(%rsp)
leaq 0x98(%r14), %rax
movq %rax, 0x28(%rsp)
movb $0x1, %al
movl %r15d, %r13d
movl %r15d, 0xc(%rsp)
movq %rbx, 0x40(%rsp)
testb $0x1, %al
movl %r13d, 0x14(%rsp)
je 0x6eda
cmpl 0x2c(%r14), %r13d
je 0x7680
incl 0x8(%r14)
movq %r14, %rdi
callq 0x7ac0
movl %eax, %ebx
movq %r14, %rdi
movl %eax, %esi
callq 0x7b48
movq 0x80(%r14), %rax
movl %ebx, 0x10(%rsp)
movslq %ebx, %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x88(%r14), %rdx
movslq %r13d, %rsi
movl %ecx, (%rdx,%rsi,4)
movq 0x58(%r14), %rcx
movl %r13d, %edx
subl %r15d, %edx
movslq %edx, %rdx
leaq (%rdx,%rdx,2), %rsi
movq (%rcx,%rsi,8), %rdx
cmpq %rdx, 0x8(%rcx,%rsi,8)
je 0x7105
leaq (%rcx,%rsi,8), %rcx
movq %rdx, 0x8(%rcx)
jmp 0x7105
movq 0x50(%r14), %rax
movq 0x88(%r14), %rcx
movslq %r13d, %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, 0x10(%rsp)
movslq %ecx, %r13
movslq (%rax,%r13,4), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, (%rax,%rcx,4)
movl %edx, (%rax,%r13,4)
cmpl $0x0, (%rbx,%r13,4)
jle 0x6f5b
movq 0x78(%r14), %rax
xorl %ebp, %ebp
movq 0x30(%rsp), %rcx
movl (%rcx,%r13,4), %ecx
addl (%r12,%r13,4), %ecx
addl %ebp, %ecx
movslq %ecx, %rcx
movq 0x38(%rsp), %rdx
movslq (%rdx,%rcx,4), %rbx
movl (%rax,%rbx,4), %ecx
cmpl (%r12,%rbx,4), %ecx
jne 0x6f49
movq 0x68(%r14), %rdi
movq 0x70(%r14), %rsi
movl %ebx, %edx
callq 0x91d2
movq 0x78(%r14), %rax
movl (%rax,%rbx,4), %ecx
decl %ecx
movl %ecx, (%rax,%rbx,4)
incl %ebp
movq 0x40(%rsp), %rcx
cmpl (%rcx,%r13,4), %ebp
jl 0x6f0f
movq 0x58(%r14), %rax
movl 0x14(%rsp), %r15d
movl %r15d, %ecx
subl 0xc(%rsp), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rbp
leaq (%rax,%rbp,8), %rcx
movq %rcx, 0x18(%rsp)
leaq (%rax,%rbp,8), %rbx
addq $0x18, %rbx
movq %rbx, %rsi
movl 0x10(%rsp), %edx
callq 0x7f82
cmpl $-0x1, %eax
je 0x70b5
movl %eax, %r15d
movq %r14, %rdi
movq 0x18(%rsp), %rsi
movq %rbx, %rdx
callq 0x8010
movq 0x60(%r14), %rcx
movq 0x80(%r14), %rax
leaq (,%r13,2), %rdx
addq %r13, %rdx
movq 0x8(%rcx,%rdx,8), %rsi
subq (%rcx,%rdx,8), %rsi
movl (%rax,%r13,4), %ecx
shrq $0x2, %rsi
decl %esi
cmpl %esi, %ecx
jne 0x70f5
movq 0x58(%r14), %rax
leaq (%rax,%rbp,8), %rbx
movslq %r15d, %rax
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
leaq (%rcx,%rax,4), %rsi
addq $0x4, %rsi
cmpq %rdx, %rsi
je 0x700b
leaq (%rcx,%rax,4), %rdi
subq %rsi, %rdx
callq 0x2290
movq 0x8(%rbx), %rdx
addq $-0x4, %rdx
movq %rdx, 0x8(%rbx)
movq 0x98(%r14), %rax
cmpq %rax, 0xa0(%r14)
je 0x702a
movq %rax, 0xa0(%r14)
cmpl $0x0, (%r12,%r13,4)
jle 0x7091
xorl %r15d, %r15d
movq 0x30(%rsp), %rax
movslq (%rax,%r13,4), %rax
addq %r15, %rax
movq 0x38(%rsp), %rcx
movslq (%rcx,%rax,4), %rax
movl %eax, 0x8(%rsp)
movq 0x90(%r14), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0x7088
movq 0xa0(%r14), %rsi
cmpq 0xa8(%r14), %rsi
je 0x7079
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xa0(%r14)
jmp 0x7088
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x8cfa
incq %r15
cmpl (%r12,%r13,4), %r15d
jl 0x7034
movq %r14, %rdi
movq %rbx, %rsi
movq 0x28(%rsp), %rdx
callq 0x8010
movl 0xc(%rsp), %r15d
movl 0x14(%rsp), %r13d
cmpl %r15d, %r13d
jne 0x70d5
jmp 0x7698
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x8806
movl 0xc(%rsp), %eax
cmpl %eax, %r15d
movl %r15d, %r13d
movl %eax, %r15d
je 0x7698
movq 0x68(%r14), %rdi
movq 0x70(%r14), %rsi
movl 0x10(%rsp), %edx
callq 0x916e
decl %r13d
xorl %eax, %eax
movq 0x40(%rsp), %rbx
jmp 0x6e60
incl %ecx
movl %ecx, (%rax,%r13,4)
movl 0xc(%rsp), %r15d
movl 0x14(%rsp), %r13d
movl 0xc8(%r14), %ebx
cmpl $0x77359401, %ebx       # imm = 0x77359401
jl 0x7133
movq 0xc0(%r14), %rdi
movslq 0x34(%r14), %rdx
shlq $0x2, %rdx
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x20e0
movq 0x80(%r14), %rax
incl %ebx
movl %ebx, 0xc8(%r14)
movslq 0x10(%rsp), %rbp
subl %r15d, %r13d
movslq %r13d, %rcx
movq %rcx, 0x48(%rsp)
movq 0x60(%r14), %rcx
leaq (,%rbp,2), %r15
addq %rbp, %r15
xorl %r11d, %r11d
movq 0x40(%rsp), %rbx
movq %r15, 0x58(%rsp)
movslq (%rax,%rbp,4), %rsi
movq (%rcx,%r15,8), %rdx
movl (%rdx,%rsi,4), %esi
movq 0x50(%r14), %rdi
movslq %esi, %r13
movslq (%rdi,%r13,4), %r9
cmpq $-0x1, %r9
je 0x71f8
movq 0xc0(%r14), %rsi
movl (%rsi,%r9,4), %r8d
movl 0xc8(%r14), %r10d
cmpl %r10d, %r8d
je 0x71b9
movl %r10d, (%rsi,%r9,4)
movl (%rdi,%r13,4), %edi
movslq %r11d, %r11
movq 0x20(%rsp), %r8
movl %edi, (%r8,%r11,4)
incl %r11d
movl 0xc8(%r14), %r8d
cmpl %r8d, (%rsi,%rbp,4)
je 0x71d2
movl %r8d, (%rsi,%rbp,4)
movslq %r11d, %r11
movq 0x20(%rsp), %rsi
movl %ebp, (%rsi,%r11,4)
incl %r11d
leaq (%rcx,%r15,8), %r8
leaq (%rax,%rbp,4), %rdi
movl (%rdi), %esi
movq 0x8(%r8), %r8
subq %rdx, %r8
shrq $0x2, %r8
decl %r8d
cmpl %r8d, %esi
jne 0x748c
jmp 0x750b
movq %r11, 0x18(%rsp)
movl %r13d, (%rdi,%rbp,4)
movq %r13, 0x60(%rsp)
movl %ebp, (%rdi,%r13,4)
cmpl $0x0, (%rbx,%rbp,4)
jle 0x7495
xorl %r13d, %r13d
movq 0x30(%rsp), %rax
movl (%rax,%rbp,4), %eax
addl (%r12,%rbp,4), %eax
addl %r13d, %eax
cltq
movq 0x38(%rsp), %rcx
movslq (%rcx,%rax,4), %r15
movq 0x78(%r14), %rcx
movl (%rcx,%r15,4), %eax
leal 0x1(%rax), %edx
movl %edx, (%rcx,%r15,4)
cmpl (%r12,%r15,4), %edx
jne 0x726b
movq %r14, %rdi
movl %r15d, %esi
callq 0x77b0
movq 0x70(%r14), %rsi
movl %eax, (%rsi,%r15,4)
testl %eax, %eax
je 0x7290
movq 0x68(%r14), %rdi
movl %r15d, %edx
callq 0x916e
jmp 0x7282
testl %eax, %eax
jle 0x7282
movq %r14, %rdi
movl %r15d, %esi
callq 0x77b0
testl %eax, %eax
je 0x733c
incl %r13d
cmpl (%rbx,%rbp,4), %r13d
jl 0x7217
jmp 0x7495
movq 0x78(%r14), %rax
decl (%rax,%r15,4)
movl $0x77359400, (%rsi,%r15,4) # imm = 0x77359400
movq 0x98(%r14), %rax
cmpq %rax, 0xa0(%r14)
je 0x72b7
movq %rax, 0xa0(%r14)
movq 0x48(%rsp), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x58(%r14), %rsi
cmpl $0x0, (%r12,%r15,4)
jle 0x73dc
movq %rsi, 0x50(%rsp)
xorl %ebx, %ebx
movq 0x30(%rsp), %rax
movslq (%rax,%r15,4), %rax
addq %rbx, %rax
movq 0x38(%rsp), %rcx
movslq (%rcx,%rax,4), %rax
movl %eax, 0x8(%rsp)
movq 0x90(%r14), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0x732e
movq 0xa0(%r14), %rsi
cmpq 0xa8(%r14), %rsi
je 0x731f
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xa0(%r14)
jmp 0x732e
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x8cfa
incq %rbx
cmpl (%r12,%r15,4), %ebx
jl 0x72da
jmp 0x73d7
movq 0x78(%r14), %rax
decl (%rax,%r15,4)
movq 0x98(%r14), %rax
cmpq %rax, 0xa0(%r14)
je 0x735b
movq %rax, 0xa0(%r14)
movq 0x48(%rsp), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x58(%r14), %rsi
cmpl $0x0, (%r12,%r15,4)
jle 0x73dc
movq %rsi, 0x50(%rsp)
xorl %ebx, %ebx
movq 0x30(%rsp), %rax
movslq (%rax,%r15,4), %rax
addq %rbx, %rax
movq 0x38(%rsp), %rcx
movslq (%rcx,%rax,4), %rax
movl %eax, 0x8(%rsp)
movq 0x90(%r14), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0x73ce
movq 0xa0(%r14), %rsi
cmpq 0xa8(%r14), %rsi
je 0x73bf
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xa0(%r14)
jmp 0x73ce
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x8cfa
incq %rbx
cmpl (%r12,%r15,4), %ebx
jl 0x737a
movq 0x50(%rsp), %rsi
movq %r14, %rdi
movq 0x28(%rsp), %rdx
callq 0x8010
movq 0x50(%r14), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, (%rax,%rbp,4)
movq 0x60(%rsp), %rdx
movl %ecx, (%rax,%rdx,4)
testl %r13d, %r13d
movq 0x58(%rsp), %r15
je 0x7459
movq 0x78(%r14), %rax
incl %r13d
movq 0x30(%rsp), %rcx
movl (%rcx,%rbp,4), %ecx
addl (%r12,%rbp,4), %ecx
addl %r13d, %ecx
addl $-0x2, %ecx
movslq %ecx, %rcx
movq 0x38(%rsp), %rdx
movslq (%rdx,%rcx,4), %rbx
movl (%rax,%rbx,4), %ecx
cmpl (%r12,%rbx,4), %ecx
jne 0x744b
movq 0x68(%r14), %rdi
movq 0x70(%r14), %rsi
movl %ebx, %edx
callq 0x91d2
movq 0x78(%r14), %rax
movl (%rax,%rbx,4), %ecx
decl %ecx
movl %ecx, (%rax,%rbx,4)
decl %r13d
cmpl $0x1, %r13d
jg 0x740e
movq 0x60(%r14), %rcx
movq 0x80(%r14), %rax
movq 0x8(%rcx,%r15,8), %rdx
subq (%rcx,%r15,8), %rdx
movl (%rax,%rbp,4), %esi
shrq $0x2, %rdx
decl %edx
cmpl %edx, %esi
je 0x7506
leaq (%rax,%rbp,4), %rdi
movq 0x40(%rsp), %rbx
movq 0x18(%rsp), %r11
incl %esi
movl %esi, (%rdi)
jmp 0x7168
movq 0x18(%rsp), %r13
testl %r13d, %r13d
jle 0x74f2
movl %r13d, %eax
movq 0x20(%rsp), %r15
leaq (%r15,%rax,4), %rbx
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x89b7
movq %r15, %rdi
movq %rbx, %rsi
movq 0x40(%rsp), %rbx
callq 0x8a92
movq 0x48(%rsp), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x58(%r14), %rsi
movq %r14, %rdi
movq %r15, %rdx
movl %r13d, %ecx
callq 0x8220
movl 0x14(%rsp), %r13d
incl %r13d
movb $0x1, %al
movl 0xc(%rsp), %r15d
jmp 0x6e60
movq 0x18(%rsp), %r11
movq 0x48(%rsp), %rax
leaq (%rax,%rax,2), %r15
shlq $0x3, %r15
addq 0x58(%r14), %r15
testl %r11d, %r11d
jle 0x756f
movl %r11d, %eax
movq %r11, 0x18(%rsp)
movq 0x20(%rsp), %r13
leaq (,%rax,4), %rbx
addq %r13, %rbx
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x89b7
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8a92
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq 0x18(%rsp), %rcx
callq 0x8220
movq (%r15), %r13
movq 0x8(%r15), %rbx
cmpq %r13, %rbx
je 0x7658
movq %r15, %rsi
movl 0x10(%rsp), %edx
callq 0x7f82
cmpl $-0x1, %eax
je 0x7658
cltq
leaq 0x4(,%rax,4), %rsi
addq %r13, %rsi
cmpq %rbx, %rsi
je 0x75c0
leaq (,%rax,4), %rdi
addq %r13, %rdi
subq %rsi, %rbx
movq %rbx, %rdx
callq 0x2290
movq 0x8(%r15), %rbx
addq $-0x4, %rbx
movq %rbx, 0x8(%r15)
movq 0x98(%r14), %rax
cmpq %rax, 0xa0(%r14)
je 0x75df
movq %rax, 0xa0(%r14)
cmpl $0x0, (%r12,%rbp,4)
movl $0x0, %ebx
jle 0x7648
movq 0x30(%rsp), %rax
movslq (%rax,%rbp,4), %rax
addq %rbx, %rax
movq 0x38(%rsp), %rcx
movslq (%rcx,%rax,4), %rax
movl %eax, 0x8(%rsp)
movq 0x90(%r14), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0x763f
movq 0xa0(%r14), %rsi
cmpq 0xa8(%r14), %rsi
je 0x7630
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xa0(%r14)
jmp 0x763f
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x8cfa
incq %rbx
cmpl (%r12,%rbp,4), %ebx
jl 0x75eb
movq %r14, %rdi
movq %r15, %rsi
movq 0x28(%rsp), %rdx
callq 0x8010
movl 0xc(%rsp), %r15d
movl 0x14(%rsp), %r13d
cmpl %r15d, %r13d
je 0x7698
decl %r13d
movq 0x68(%r14), %rdi
movq 0x70(%r14), %rsi
movl 0x10(%rsp), %edx
callq 0x916e
jmp 0x70e9
movq 0xb0(%r14), %rdi
movq 0x20(%rsp), %rsi
movl %r13d, %edx
callq 0x4c64
movb $0x1, %al
jmp 0x76af
movq 0xb0(%r14), %rdi
movl 0x2c(%r14), %edx
movq 0x20(%rsp), %rsi
callq 0x4c64
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq