// File: /workspace/github_cpp_makefile_star2_O2/matteorr[P]EarleyParser/Node.cpp
// Function: Node::expandNode(State*, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::list<Production, std::allocator<Production>>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::list<Production, std::allocator<Production>>>>>*)
State* Node::expandNode( State* currentStateToExpand, unordered_map< string, list<Production> >* earleyProductions )
{
	State* nextStateToExpand;

	cout << endl << "currently in expansion of - " << currentStateToExpand->getNonTerminal();
	for( unsigned int i = 0; i < currentStateToExpand->getProductionPointer()->getProductionContent().size(); i++ )
	{
		cout << " " << currentStateToExpand->getProductionPointer()->getProductionContent().at(i) << " ";
	}

	for( unsigned int i = this->production.size(); i > 0; i-- )
	{

/*		cout << endl << "check-------------------------------------------------" << endl;
		cout << endl << "[DEBUG]: production of this node - size: " << this->production.size() << endl;
		for( unsigned int k = 0; k < this->production.size(); k++ )
		{
			cout << this->production.at(k) << " ";
		}
		cout << endl << "[DEBUG]: production of current state to expand - size: " << currentStateToExpand->getProductionPointer()->getProductionContent().size() << endl;
		for( unsigned int k = 0; k < currentStateToExpand->getProductionPointer()->getProductionContent().size(); k++ )
		{
			cout << currentStateToExpand->getProductionPointer()->getProductionContent().at(k) << " ";
		}
		cout << endl << "-------------------------------------------------finish" << endl << endl;

		if( this->productionPointer != currentStateToExpand->getProductionPointer() )
		{
			exit(1);
		}
*/
		unordered_map< string, list<Production> >::iterator got = earleyProductions->find( this->production.at( i - 1 ) );
		if( got != earleyProductions->end() )
		{
			/*
			 * the element contained in the production
			 * at current position of loop is NON TERMINAL
			 * and needs to be expanded
			 */
			if( currentStateToExpand->getBacktraceStateVector()->size() > 1 ){

				cout << endl << "BACKTRACE VECTOR BIGGER THAN 1" << endl;

				for( unsigned j = 0; j < currentStateToExpand->getBacktraceStateVector()->size(); j++ )
				{
					State* state = currentStateToExpand->getBacktraceStateVector()->at(j);
					cout << endl << "[DEBUG]: at 0 -" << state->getNonTerminal() << " size: " << state->getProductionPointer()->getProductionContent().size() << endl;
					for( unsigned int k = 0; k < state->getProductionPointer()->getProductionContent().size(); k++ )
					{
						cout << state->getProductionPointer()->getProductionContent().at(k) << " ";
					}
					cout << endl;
				}

				for( unsigned j = 0; j < currentStateToExpand->getBacktraceStateVector()->size(); j++ )
				{
					if( this->father->getProductionPointer() == currentStateToExpand->getBacktraceStateVector()->at(j)->getProductionPointer() )
					{
						currentStateToExpand = currentStateToExpand->getBacktraceStateVector()->at(j);
						cout << "[DEBUG]: matching production pointer at position " << j << endl;
						break;
					}

					if( j == currentStateToExpand->getBacktraceStateVector()->size() - 1 )
					{
						cout << "[ERROR]: no matching production pointer correspondent to production in this node!" << endl;
						exit(1);
					}
				}

			}else{
				nextStateToExpand = currentStateToExpand->getBacktraceStateVector()->at(0);
			}

			// TODO CHECK THAT this->production.at( i - 1 ) == nextStateToExpand->getNonTerminal()

			Node* child;
			if( this->productionProbability >= 0 )
			{
				child =	new Node(
								this,
								nextStateToExpand->getNonTerminal(),
								nextStateToExpand->getProductionPointer()->getProductionContent(),
								nextStateToExpand->getProductionPointer(),
								nextStateToExpand->getProductionPointer()->getProductionProbability()
							);
			}else{

				child = new Node(
								this,
								nextStateToExpand->getNonTerminal(),
								nextStateToExpand->getProductionPointer()->getProductionContent(),
								nextStateToExpand->getProductionPointer(),
								-1
							);
			}

			/*
			 * insert at beginning of vector
			 */
			this->children.insert( this->children.begin(), child );

			currentStateToExpand = child->expandNode( nextStateToExpand, earleyProductions );

			cout << endl << "finished expanding - " << nextStateToExpand->getNonTerminal() << endl;

		}else{
			/*
			 * the element is TERMINAL
			 * and needs not to be exapanded
			 */

			Node* child;
			if( this->productionProbability >= 0 )
			{
				/*
				 * leaf nodes have probabilities only
				 * if terminal symbols probabilities are
				 * specified in input
				 */

				/*
				 * NULL is inserted because terminal
				 * symbols do not have a production
				 */
				child =	new Node(
								this,
								this->production.at( i - 1 ),
								vector<string>(),
								//nextStateToExpand->getProductionPointer()->getProductionProbability()
								//nextStateToExpand->getProductionPointer(),
								NULL,
								1
							);
			}else{

				child = new Node(
								this,
								this->production.at( i - 1 ),
								vector<string>(),
								//nextStateToExpand->getProductionPointer(),
								NULL,
								-1
							);
			}

			/*
			 * insert at beginning of vector
			 */
			this->children.insert( this->children.begin(), child );

			if( currentStateToExpand->getBacktraceStateVector()->size() > 1 ){

				cout << endl << "BACKTRACE VECTOR BIGGER THAN 1" << endl;

				for( unsigned j = 0; j < currentStateToExpand->getBacktraceStateVector()->size(); j++ )
				{
					State* state = currentStateToExpand->getBacktraceStateVector()->at(j);
					cout << endl << "[DEBUG]: at 0 -" << state->getNonTerminal() << " size: " << state->getProductionPointer()->getProductionContent().size() << endl;
					for( unsigned int k = 0; k < state->getProductionPointer()->getProductionContent().size(); k++ )
					{
						cout << state->getProductionPointer()->getProductionContent().at(k) << " ";
					}
					cout << endl;
				}

				for( unsigned j = 0; j < currentStateToExpand->getBacktraceStateVector()->size(); j++ )
				{
					if( this->father->getProductionPointer() == currentStateToExpand->getBacktraceStateVector()->at(j)->getProductionPointer() )
					{
						currentStateToExpand = currentStateToExpand->getBacktraceStateVector()->at(j);
						cout << "[DEBUG]: matching production pointer at position " << j << endl;
						break;
					}

					if( j == currentStateToExpand->getBacktraceStateVector()->size() - 1 )
					{
						cout << "[ERROR]: no matching production pointer correspondent to production in this node!" << endl;
						exit(1);
					}
				}

			}else{
				currentStateToExpand = currentStateToExpand->getBacktraceStateVector()->at(0);
			}

			if( currentStateToExpand->getBacktraceStateVector()->size() > 1 ){

				cout << endl << "BACKTRACE VECTOR BIGGER THAN 1" << endl;

				for( unsigned j = 0; j < currentStateToExpand->getBacktraceStateVector()->size(); j++ )
				{
					State* state = currentStateToExpand->getBacktraceStateVector()->at(j);
					cout << endl << "[DEBUG]: at 0 -" << state->getNonTerminal() << " size: " << state->getProductionPointer()->getProductionContent().size() << endl;
					for( unsigned int k = 0; k < state->getProductionPointer()->getProductionContent().size(); k++ )
					{
						cout << state->getProductionPointer()->getProductionContent().at(k) << " ";
					}
					cout << endl;
				}

				//for( unsigned j = currentStateToExpand->getBacktraceStateVector()->size() - 1; j >= 0; j-- )
				for( unsigned j = 0; j < currentStateToExpand->getBacktraceStateVector()->size(); j++ )
				{
					if( this->father->getProductionPointer() == currentStateToExpand->getBacktraceStateVector()->at(j)->getProductionPointer() )
					{
						currentStateToExpand = currentStateToExpand->getBacktraceStateVector()->at(j);
						cout << "[DEBUG]: matching production pointer at position " << j << endl;
						break;
					}else{
						cout << "[DEBUG]: no matching production pointer at position " << j << endl;
					}

					if( j == currentStateToExpand->getBacktraceStateVector()->size() - 1/*0*/ )
					{
						cout << "[ERROR]: no matching production pointer correspondent to production in this node!" << endl;
						exit(1);
					}
				}

			}else{
				currentStateToExpand = currentStateToExpand->getBacktraceStateVector()->at(0);
			}
		}
	}

	return currentStateToExpand;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdx, -0xa0(%rbp)
movq %rsi, %r15
movq %rdi, -0x30(%rbp)
movq 0x6979(%rip), %rdi      # 0xcfd8
callq 0x2100
leaq 0x2011(%rip), %rsi      # 0x867c
movq %rax, %rdi
callq 0x21c0
movq %rax, %rbx
leaq -0x80(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x780c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2190
leaq -0x80(%rbp), %rbx
movq %rbx, %rdi
callq 0x20f0
xorl %r14d, %r14d
movl %r14d, %r14d
movq %r15, %rdi
callq 0x7828
movq %rbx, %rdi
movq %rax, %rsi
callq 0x76d8
movq -0x78(%rbp), %r13
subq -0x80(%rbp), %r13
sarq $0x5, %r13
movq %rbx, %rdi
callq 0x4ba2
cmpq %r14, %r13
jbe 0x6732
movq 0x6903(%rip), %rdi      # 0xcfd8
leaq 0x1ec5(%rip), %rsi      # 0x85a1
callq 0x21c0
movq %rax, %r13
movq %r15, %r12
movq %r15, %rdi
callq 0x7828
movq %rbx, %rdi
movq %rax, %rsi
callq 0x76d8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4c0a
movq %r13, %rdi
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x1e87(%rip), %rsi      # 0x85a1
callq 0x21c0
movq %rbx, %rdi
callq 0x4ba2
incl %r14d
movq %r12, %r15
jmp 0x669f
movq -0x30(%rbp), %rcx
movq 0x30(%rcx), %rax
subq 0x28(%rcx), %rax
leaq 0x28(%rcx), %rdx
movq %rdx, -0x88(%rbp)
shrq $0x5, %rax
addq $0x48, %rcx
movq %rcx, -0x98(%rbp)
movl %eax, %esi
leaq -0x80(%rbp), %r12
movq %r15, %r13
subq $0x1, %rsi
jb 0x7155
movq -0x88(%rbp), %rdi
movq %rsi, -0x60(%rbp)
callq 0x4c0a
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x533e
testq %rax, %rax
movq %r13, -0x38(%rbp)
jne 0x6d7f
movq -0x30(%rbp), %rax
movss 0x60(%rax), %xmm0
movss %xmm0, -0x8c(%rbp)
pushq $0x70
popq %rdi
callq 0x21d0
movq %rax, %r14
movss -0x8c(%rbp), %xmm0
ucomiss 0x1eb6(%rip), %xmm0     # 0x8678
jae 0x681e
movq -0x88(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x4c0a
leaq -0x170(%rbp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x2250
xorps %xmm0, %xmm0
movaps %xmm0, -0xc0(%rbp)
andq $0x0, -0xb0(%rbp)
movq %r14, %rdi
movq -0x30(%rbp), %rsi
movq %r15, %rdx
leaq -0xc0(%rbp), %rbx
movq %rbx, %rcx
xorl %r8d, %r8d
movss 0x17f1(%rip), %xmm0     # 0x8008
callq 0x64f4
jmp 0x6876
movq -0x88(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x4c0a
leaq -0x190(%rbp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x2250
xorps %xmm0, %xmm0
movaps %xmm0, -0xe0(%rbp)
andq $0x0, -0xd0(%rbp)
movq %r14, %rdi
movq -0x30(%rbp), %rsi
movq %r15, %rdx
leaq -0xe0(%rbp), %rbx
movq %rbx, %rcx
xorl %r8d, %r8d
movss 0x1793(%rip), %xmm0     # 0x8004
callq 0x64f4
movq %r14, -0xa8(%rbp)
movq %rbx, %rdi
callq 0x4ba2
movq %r15, %rdi
callq 0x20f0
movq -0x98(%rbp), %rdi
movq (%rdi), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x7414
movq %r13, %rdi
callq 0x77f8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq $0x9, %rcx
jb 0x6a31
movq 0x6715(%rip), %rdi      # 0xcfd8
callq 0x2100
movq %rax, %rdi
leaq 0x1dc7(%rip), %rsi      # 0x8699
callq 0x21c0
movq %rax, %rdi
callq 0x2100
xorl %r15d, %r15d
movl %r15d, %r15d
movq %r13, %rdi
callq 0x77f8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
jbe 0x6a4b
movq %r13, %rdi
callq 0x77f8
movq %rax, %rdi
movq %r15, %rsi
callq 0x4e04
movq (%rax), %r14
movq 0x66ba(%rip), %rdi      # 0xcfd8
callq 0x2100
movq %rax, %rdi
leaq 0x1d8b(%rip), %rsi      # 0x86b8
callq 0x21c0
movq %rax, %r13
movq %r12, %rdi
movq %r14, %rsi
callq 0x780c
movq %r13, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x1d73(%rip), %rsi      # 0x86c8
callq 0x21c0
movq %rax, %r13
movq %r14, %rdi
callq 0x7828
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x76d8
movq -0x50(%rbp), %rsi
subq -0x58(%rbp), %rsi
sarq $0x5, %rsi
movq %r13, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
callq 0x4ba2
movq %r12, %rdi
callq 0x20f0
xorl %r13d, %r13d
movl %r13d, %r13d
movq %r14, %rdi
callq 0x7828
movq %r12, %rdi
movq %rax, %rsi
callq 0x76d8
movq -0x78(%rbp), %rbx
subq -0x80(%rbp), %rbx
sarq $0x5, %rbx
movq %r12, %rdi
callq 0x4ba2
cmpq %r13, %rbx
jbe 0x6a19
movq %r14, %rdi
callq 0x7828
movq %r12, %rdi
movq %rax, %rsi
callq 0x76d8
movq %r12, %rdi
movq %r13, %rsi
callq 0x4c0a
movq 0x65e3(%rip), %rdi      # 0xcfd8
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x1b9a(%rip), %rsi      # 0x85a1
callq 0x21c0
movq %r12, %rdi
callq 0x4ba2
incl %r13d
jmp 0x69a1
movq 0x65b8(%rip), %rdi      # 0xcfd8
callq 0x2100
incl %r15d
movq -0x38(%rbp), %r13
jmp 0x68e2
movq %r13, %rdi
callq 0x77f8
movq %rax, %rdi
xorl %esi, %esi
callq 0x4e04
movq (%rax), %r13
jmp 0x6af3
xorl %eax, %eax
movl %eax, %r14d
movq %r13, %rdi
callq 0x77f8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0x6af3
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x68(%rax), %rbx
movq %r13, %rdi
callq 0x77f8
movq %rax, %rdi
movq %r14, %rsi
callq 0x4e04
movq (%rax), %rdi
callq 0x7828
movq %rax, %r15
movq %r13, %rdi
callq 0x77f8
cmpq %r15, %rbx
je 0x6abf
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
decq %rcx
leal 0x1(%r14), %eax
cmpq %r14, %rcx
jne 0x6a4d
jmp 0x716a
movq %rax, %rdi
movq %r14, %rsi
callq 0x4e04
movq (%rax), %r13
movq 0x6504(%rip), %rdi      # 0xcfd8
leaq 0x1bf5(%rip), %rsi      # 0x86d0
callq 0x21c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2150
movq %rax, %rdi
callq 0x2100
movq %r13, %rdi
callq 0x77f8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq $0x9, %rcx
jb 0x6c85
movq 0x64c5(%rip), %rdi      # 0xcfd8
callq 0x2100
movq %rax, %rdi
leaq 0x1b77(%rip), %rsi      # 0x8699
callq 0x21c0
movq %rax, %rdi
callq 0x2100
xorl %r15d, %r15d
movq %r13, -0x38(%rbp)
movl %r15d, %r15d
movq %r13, %rdi
callq 0x77f8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
jbe 0x6c9f
movq %r13, %rdi
callq 0x77f8
movq %rax, %rdi
movq %r15, %rsi
callq 0x4e04
movq (%rax), %r14
movq 0x6466(%rip), %rdi      # 0xcfd8
callq 0x2100
movq %rax, %rdi
leaq 0x1b37(%rip), %rsi      # 0x86b8
callq 0x21c0
movq %rax, %r13
movq %r12, %rdi
movq %r14, %rsi
callq 0x780c
movq %r13, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x1b1f(%rip), %rsi      # 0x86c8
callq 0x21c0
movq %rax, %r13
movq %r14, %rdi
callq 0x7828
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x76d8
movq -0x50(%rbp), %rsi
subq -0x58(%rbp), %rsi
sarq $0x5, %rsi
movq %r13, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
callq 0x4ba2
movq %r12, %rdi
callq 0x20f0
xorl %r13d, %r13d
movl %r13d, %r13d
movq %r14, %rdi
callq 0x7828
movq %r12, %rdi
movq %rax, %rsi
callq 0x76d8
movq -0x78(%rbp), %rbx
subq -0x80(%rbp), %rbx
sarq $0x5, %rbx
movq %r12, %rdi
callq 0x4ba2
cmpq %r13, %rbx
jbe 0x6c6d
movq %r14, %rdi
callq 0x7828
movq %r12, %rdi
movq %rax, %rsi
callq 0x76d8
movq %r12, %rdi
movq %r13, %rsi
callq 0x4c0a
movq 0x638f(%rip), %rdi      # 0xcfd8
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x1946(%rip), %rsi      # 0x85a1
callq 0x21c0
movq %r12, %rdi
callq 0x4ba2
incl %r13d
jmp 0x6bf5
movq 0x6364(%rip), %rdi      # 0xcfd8
callq 0x2100
incl %r15d
movq -0x38(%rbp), %r13
jmp 0x6b36
movq %r13, %rdi
callq 0x77f8
movq %rax, %rdi
xorl %esi, %esi
callq 0x4e04
movq (%rax), %r13
jmp 0x6d76
xorl %eax, %eax
movl %eax, %r14d
movq %r13, %rdi
callq 0x77f8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0x6d76
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x68(%rax), %rbx
movq %r13, %rdi
callq 0x77f8
movq %rax, %rdi
movq %r14, %rsi
callq 0x4e04
movq (%rax), %rdi
callq 0x7828
cmpq %rax, %rbx
je 0x6d3a
movq 0x62e5(%rip), %rdi      # 0xcfd8
leaq 0x1a5a(%rip), %rsi      # 0x8754
callq 0x21c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2150
movq %rax, %rdi
callq 0x2100
movq %r13, %rdi
callq 0x77f8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
decq %rcx
leal 0x1(%r14), %eax
cmpq %r14, %rcx
jne 0x6ca1
jmp 0x716a
movq %r13, %rdi
callq 0x77f8
movq %rax, %rdi
movq %r14, %rsi
callq 0x4e04
movq (%rax), %r13
movq 0x6281(%rip), %rdi      # 0xcfd8
leaq 0x1972(%rip), %rsi      # 0x86d0
callq 0x21c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2150
movq %rax, %rdi
callq 0x2100
movq -0x60(%rbp), %rsi
jmp 0x6761
movq %r13, %rdi
callq 0x77f8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq $0x9, %rcx
jb 0x6f0a
movq 0x6239(%rip), %rdi      # 0xcfd8
callq 0x2100
movq %rax, %rdi
leaq 0x18eb(%rip), %rsi      # 0x8699
callq 0x21c0
movq %rax, %rdi
callq 0x2100
xorl %ebx, %ebx
movl %ebx, %ebx
movq %r13, %rdi
callq 0x77f8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %rbx, %rcx
jbe 0x6f28
movq %r13, %rdi
callq 0x77f8
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4e04
movq (%rax), %r15
movq 0x61e0(%rip), %rdi      # 0xcfd8
callq 0x2100
movq %rax, %rdi
leaq 0x18b1(%rip), %rsi      # 0x86b8
callq 0x21c0
movq %rax, %r14
movq %r12, %rdi
movq %r15, %rsi
callq 0x780c
movq %r14, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x1899(%rip), %rsi      # 0x86c8
callq 0x21c0
movq %rax, %r14
movq %r15, %rdi
callq 0x7828
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x76d8
movq -0x50(%rbp), %rsi
subq -0x58(%rbp), %rsi
sarq $0x5, %rsi
movq %r14, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
callq 0x4ba2
movq %r12, %rdi
callq 0x20f0
xorl %r14d, %r14d
movl %r14d, %r14d
movq %r15, %rdi
callq 0x7828
movq %r12, %rdi
movq %rax, %rsi
callq 0x76d8
movq -0x78(%rbp), %r13
subq -0x80(%rbp), %r13
sarq $0x5, %r13
movq %r12, %rdi
callq 0x4ba2
cmpq %r14, %r13
jbe 0x6ef3
movq %r15, %rdi
callq 0x7828
movq %r12, %rdi
movq %rax, %rsi
callq 0x76d8
movq %r12, %rdi
movq %r14, %rsi
callq 0x4c0a
movq 0x6109(%rip), %rdi      # 0xcfd8
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x16c0(%rip), %rsi      # 0x85a1
callq 0x21c0
movq %r12, %rdi
callq 0x4ba2
incl %r14d
jmp 0x6e7b
movq 0x60de(%rip), %rdi      # 0xcfd8
callq 0x2100
incl %ebx
movq -0x38(%rbp), %r13
jmp 0x6dbd
movq %r13, %rdi
callq 0x77f8
movq %rax, %rdi
xorl %esi, %esi
callq 0x4e04
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x6fd4
xorl %eax, %eax
movl %eax, %r14d
movq %r13, %rdi
callq 0x77f8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0x6fd4
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq %r13, %rbx
movq 0x68(%rax), %r13
movq %rbx, %rdi
callq 0x77f8
movq %rax, %rdi
movq %r14, %rsi
callq 0x4e04
movq (%rax), %rdi
callq 0x7828
movq %rax, %r15
movq %rbx, %rdi
callq 0x77f8
cmpq %r15, %r13
je 0x6fa3
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
decq %rcx
leal 0x1(%r14), %eax
cmpq %r14, %rcx
movq -0x38(%rbp), %r13
jne 0x6f2a
jmp 0x716a
movq %rax, %rdi
movq %r14, %rsi
callq 0x4e04
movq 0x6023(%rip), %rdi      # 0xcfd8
leaq 0x1714(%rip), %rsi      # 0x86d0
callq 0x21c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2150
movq %rax, %rdi
callq 0x2100
movq -0x30(%rbp), %rax
movss 0x60(%rax), %xmm0
movss %xmm0, -0x38(%rbp)
pushq $0x70
popq %rdi
callq 0x21d0
movq %rax, %r14
movss -0x38(%rbp), %xmm0
ucomiss 0x167f(%rip), %xmm0     # 0x8678
jae 0x705e
leaq -0x130(%rbp), %rdi
movq -0x40(%rbp), %rbx
movq %rbx, %rsi
callq 0x780c
movq %rbx, %rdi
callq 0x7828
leaq -0xf8(%rbp), %rdi
movq %rax, %rsi
callq 0x76d8
movq -0x40(%rbp), %rdi
callq 0x7828
movq %r14, %rdi
movq -0x30(%rbp), %rsi
leaq -0x130(%rbp), %r15
movq %r15, %rdx
leaq -0xf8(%rbp), %rbx
movq %rbx, %rcx
movq %rax, %r8
movss 0xfb4(%rip), %xmm0      # 0x8008
callq 0x64f4
movq %rbx, %rdi
jmp 0x70ce
leaq -0x150(%rbp), %rdi
movq -0x40(%rbp), %rbx
movq %rbx, %rsi
callq 0x780c
movq %rbx, %rdi
callq 0x7828
leaq -0x110(%rbp), %rdi
movq %rax, %rsi
callq 0x76d8
movq -0x40(%rbp), %rdi
callq 0x7828
movq %rax, %r15
movq -0x40(%rbp), %rdi
callq 0x7828
movq %rax, %rdi
callq 0x76fe
movq %r14, %rdi
movq -0x30(%rbp), %rsi
leaq -0x150(%rbp), %rbx
movq %rbx, %rdx
leaq -0x110(%rbp), %r13
movq %r13, %rcx
movq %r15, %r8
callq 0x64f4
movq %r13, %rdi
movq %rbx, %r15
movq %r14, -0x58(%rbp)
callq 0x4ba2
movq %r15, %rdi
callq 0x20f0
movq -0x98(%rbp), %rdi
movq (%rdi), %rsi
leaq -0x58(%rbp), %rdx
callq 0x7414
movq -0x58(%rbp), %rdi
movq -0x40(%rbp), %rbx
movq %rbx, %rsi
movq -0xa0(%rbp), %rdx
callq 0x6636
movq %rax, %r13
movq 0x5ec5(%rip), %rdi      # 0xcfd8
callq 0x2100
movq %rax, %rdi
leaq 0x13b7(%rip), %rsi      # 0x84d9
callq 0x21c0
movq %rax, %r14
movq %r12, %rdi
movq %rbx, %rsi
callq 0x780c
movq %r14, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
callq 0x2100
movq %r12, %rdi
callq 0x20f0
jmp 0x6d76
movq %r13, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5e67(%rip), %rdi      # 0xcfd8
leaq 0x158a(%rip), %rsi      # 0x8702
callq 0x21c0
movq %rax, %rdi
callq 0x2100
pushq $0x1
popq %rdi
callq 0x2200
jmp 0x720c
jmp 0x720c
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x4ba2
jmp 0x71a5
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
jmp 0x71fd
movq %rax, %rbx
jmp 0x71c6
jmp 0x7231
jmp 0x7231
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x4ba2
leaq -0x150(%rbp), %rdi
jmp 0x71fd
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x4ba2
leaq -0x170(%rbp), %rdi
jmp 0x71fd
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x4ba2
leaq -0x190(%rbp), %rdi
callq 0x20f0
jmp 0x720f
jmp 0x7231
jmp 0x7231
jmp 0x7223
jmp 0x720c
movq %rax, %rbx
movq %r14, %rdi
callq 0x21a0
jmp 0x724f
jmp 0x7243
jmp 0x7223
jmp 0x7231
jmp 0x7231
jmp 0x7231
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x4ba2
jmp 0x7234
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x20f0
jmp 0x724f
jmp 0x7243
jmp 0x7243
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x4ba2
movq %rbx, %rdi
callq 0x22c0
nop