// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movq %rsi, %r13
movq %rdi, %r12
movq 0x6574(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %rax, %rbx
leaq 0x2c13(%rip), %rsi      # 0xa6a8
movl $0x1c, %edx
movq %rax, %rdi
callq 0x2220
leaq -0x58(%rbp), %r14
movq %r14, %rdi
movq %r13, -0x30(%rbp)
movq %r13, %rsi
callq 0x945a
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2220
movq %r12, -0x38(%rbp)
movq %r15, -0x60(%rbp)
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7ade
callq 0x21a0
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x9488
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x92e6
movq 0x8(%rbx), %r12
movq (%rbx), %r15
movq %rbx, %rdi
callq 0x60da
cmpq %r15, %r12
je 0x7bd4
movl $0x1, %ebx
xorl %r13d, %r13d
movq 0x64b8(%rip), %r15      # 0xdfd8
leaq -0x58(%rbp), %r12
movl $0x1, %edx
movq %r15, %rdi
leaq 0x2a6e(%rip), %rsi      # 0xa5a1
callq 0x2220
movq %r14, %rdi
callq 0x9488
movq %r12, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r13, %rdx
jbe 0x8cf0
shlq $0x5, %r13
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq %r15, %rdi
callq 0x2220
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2a1a(%rip), %rsi      # 0xa5a1
callq 0x2220
movq %r12, %rdi
callq 0x60da
movl %ebx, %r13d
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x9488
movq %r12, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x50(%rbp), %r15
subq -0x58(%rbp), %r15
sarq $0x5, %r15
movq %r12, %rdi
callq 0x60da
incl %ebx
cmpq %r13, %r15
movq 0x640a(%rip), %r15      # 0xdfd8
ja 0x7b24
movq -0x38(%rbp), %r12
movq 0x30(%r12), %rax
subq 0x28(%r12), %rax
shrq $0x5, %rax
testl %eax, %eax
je 0x8c62
leaq 0x48(%r12), %rcx
movq %rcx, -0x98(%rbp)
movl %eax, %ebx
leaq -0x58(%rbp), %r13
movq -0x60(%rbp), %r15
movq -0x30(%rbp), %r14
decq %rbx
movq 0x28(%r12), %rsi
movq 0x30(%r12), %rdx
subq %rsi, %rdx
sarq $0x5, %rdx
cmpq %rbx, %rdx
jbe 0x8cba
movq %rbx, -0x70(%rbp)
shlq $0x5, %rbx
addq %rbx, %rsi
movq %r15, %rdi
callq 0x6804
testq %rax, %rax
movq %r14, -0x30(%rbp)
je 0x7fc4
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq $0x9, %rcx
jb 0x808d
movq 0x6373(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %rax, %rbx
movl $0x1e, %edx
movq %rax, %rdi
leaq 0x2a27(%rip), %rsi      # 0xa6c5
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x7f16
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x9446
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0x8cae
movq (%rcx,%r15,8), %r14
movq 0x62cc(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %rax, %r12
movl $0xf, %edx
movq %rax, %rdi
leaq 0x299f(%rip), %rsi      # 0xa6e4
callq 0x2220
movq %r13, %rdi
movq %r14, %rsi
callq 0x945a
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %r12, %rdi
callq 0x2220
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
leaq 0x297d(%rip), %rsi      # 0xa6f4
callq 0x2220
movq %r14, %rdi
callq 0x9488
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x80(%rbp), %rsi
subq -0x88(%rbp), %rsi
sarq $0x5, %rsi
movq %r12, %rdi
callq 0x2140
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %r15, -0x68(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x60da
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x7df6
callq 0x21a0
movq %r14, %rdi
callq 0x9488
movq %r13, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x50(%rbp), %r15
movq -0x58(%rbp), %r12
movq %r13, %rdi
callq 0x60da
cmpq %r12, %r15
je 0x7ec1
movl $0x1, %r15d
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x9488
movq %r13, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r12, %rdx
jbe 0x8c7b
shlq $0x5, %r12
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq 0x616e(%rip), %rdi      # 0xdfd8
callq 0x2220
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2723(%rip), %rsi      # 0xa5a1
callq 0x2220
movq %r13, %rdi
callq 0x60da
movl %r15d, %r12d
movq %r14, %rdi
callq 0x9488
movq %r13, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x50(%rbp), %rbx
subq -0x58(%rbp), %rbx
sarq $0x5, %rbx
movq %r13, %rdi
callq 0x60da
incl %r15d
cmpq %r12, %rbx
ja 0x7e2b
movq 0x6110(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x68(%rbp), %r15
incl %r15d
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x7ce2
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x84f9
movl $0x1, %r15d
xorl %ebx, %ebx
movq -0x38(%rbp), %r12
movq 0x40(%r12), %rax
movq 0x68(%rax), %r12
movq %r14, %rdi
callq 0x9446
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rbx, %rdx
jbe 0x8cba
movq (%rcx,%rbx,8), %rdi
callq 0x9488
movq %rax, -0x68(%rbp)
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rdx
subq (%rax), %rdx
sarq $0x3, %rdx
cmpq -0x68(%rbp), %r12
je 0x8503
decq %rdx
cmpq %rbx, %rdx
movq -0x38(%rbp), %r12
je 0x8ccb
movl %r15d, %ebx
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
incl %r15d
cmpq %rbx, %rcx
ja 0x7f37
jmp 0x8560
movss 0x60(%r12), %xmm0
movss %xmm0, -0x68(%rbp)
movl $0x70, %edi
callq 0x21e0
movq %rax, %r14
movq 0x28(%r12), %rax
movq 0x30(%r12), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
movss -0x68(%rbp), %xmm0
ucomiss 0x26aa(%rip), %xmm0     # 0xa6a4
jae 0x80aa
cmpq -0x70(%rbp), %rdx
jbe 0x8d20
leaq -0xb0(%rbp), %rcx
movq %rcx, -0xc0(%rbp)
movq (%rax,%rbx), %rsi
movq 0x8(%rax,%rbx), %rdx
addq %rsi, %rdx
leaq -0xc0(%rbp), %rbx
movq %rbx, %rdi
callq 0x66d0
xorps %xmm0, %xmm0
movaps %xmm0, -0x140(%rbp)
movq $0x0, -0x130(%rbp)
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
leaq -0x140(%rbp), %rbx
movq %rbx, %rcx
xorl %r8d, %r8d
movss 0x1fa2(%rip), %xmm0     # 0xa008
callq 0x78e4
movq %r14, -0xa0(%rbp)
movq %rbx, %rdi
callq 0x60da
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
jmp 0x8132
movq %r14, %rdi
callq 0x9446
movq (%rax), %rcx
cmpq %rcx, 0x8(%rax)
je 0x8d01
movq (%rcx), %rbx
jmp 0x856b
cmpq -0x70(%rbp), %rdx
jbe 0x8d0e
leaq -0xd0(%rbp), %rcx
movq %rcx, -0xe0(%rbp)
movq (%rax,%rbx), %rsi
movq 0x8(%rax,%rbx), %rdx
addq %rsi, %rdx
leaq -0xe0(%rbp), %rbx
movq %rbx, %rdi
callq 0x66d0
xorps %xmm0, %xmm0
movaps %xmm0, -0x160(%rbp)
movq $0x0, -0x150(%rbp)
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
leaq -0x160(%rbp), %rbx
movq %rbx, %rcx
xorl %r8d, %r8d
movss 0x1ef4(%rip), %xmm0     # 0xa004
callq 0x78e4
movq %r14, -0xa0(%rbp)
movq %rbx, %rdi
callq 0x60da
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x813c
callq 0x21a0
movq -0x98(%rbp), %rdi
movq (%rdi), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x90b2
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq $0x9, %rcx
jb 0x84dc
movq 0x5e62(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %rax, %rbx
movl $0x1e, %edx
movq %rax, %rdi
leaq 0x2516(%rip), %rsi      # 0xa6c5
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x8427
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x9446
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0x8cae
movq (%rcx,%r15,8), %r14
movq 0x5dbb(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %rax, %r12
movl $0xf, %edx
movq %rax, %rdi
leaq 0x248e(%rip), %rsi      # 0xa6e4
callq 0x2220
movq %r13, %rdi
movq %r14, %rsi
callq 0x945a
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %r12, %rdi
callq 0x2220
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
leaq 0x246c(%rip), %rsi      # 0xa6f4
callq 0x2220
movq %r14, %rdi
callq 0x9488
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x80(%rbp), %rsi
subq -0x88(%rbp), %rsi
sarq $0x5, %rsi
movq %r12, %rdi
callq 0x2140
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %r15, -0x68(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x60da
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x8307
callq 0x21a0
movq %r14, %rdi
callq 0x9488
movq %r13, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x50(%rbp), %r15
movq -0x58(%rbp), %r12
movq %r13, %rdi
callq 0x60da
cmpq %r12, %r15
je 0x83d2
movl $0x1, %r15d
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x9488
movq %r13, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r12, %rdx
jbe 0x8c8c
shlq $0x5, %r12
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq 0x5c5d(%rip), %rdi      # 0xdfd8
callq 0x2220
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2212(%rip), %rsi      # 0xa5a1
callq 0x2220
movq %r13, %rdi
callq 0x60da
movl %r15d, %r12d
movq %r14, %rdi
callq 0x9488
movq %r13, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x50(%rbp), %rbx
subq -0x58(%rbp), %rbx
sarq $0x5, %rbx
movq %r13, %rdi
callq 0x60da
incl %r15d
cmpq %r12, %rbx
ja 0x833c
movq 0x5bff(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x68(%rbp), %r15
incl %r15d
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x81f3
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x877a
movl $0x1, %r15d
xorl %ebx, %ebx
movq -0x38(%rbp), %r12
movq 0x40(%r12), %rax
movq 0x68(%rax), %r12
movq %r14, %rdi
callq 0x9446
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rbx, %rdx
jbe 0x8cba
movq (%rcx,%rbx,8), %rdi
callq 0x9488
movq %rax, -0x68(%rbp)
movq %r14, %rdi
callq 0x9446
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq -0x68(%rbp), %r12
je 0x8784
decq %rdx
cmpq %rbx, %rdx
movq -0x38(%rbp), %r12
je 0x8ccb
movl %r15d, %ebx
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
incl %r15d
cmpq %rbx, %rcx
ja 0x8448
movq -0x60(%rbp), %r15
jmp 0x87f1
movq %r14, %rdi
callq 0x9446
movq (%rax), %rcx
cmpq %rcx, 0x8(%rax)
je 0x8d01
movq (%rcx), %r14
jmp 0x87f1
movq -0x60(%rbp), %r15
movq -0x38(%rbp), %r12
jmp 0x8564
cmpq %rbx, %rdx
movq -0x38(%rbp), %r12
jbe 0x8cba
movl $0x31, %edx
movq 0x5abc(%rip), %r14      # 0xdfd8
movq %r14, %rdi
leaq 0x21d6(%rip), %rsi      # 0xa6fc
callq 0x2220
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x60(%rbp), %r15
movq -0x90(%rbp), %rbx
movss 0x60(%r12), %xmm0
movss %xmm0, -0x30(%rbp)
movl $0x70, %edi
callq 0x21e0
movq %rax, %r14
movss -0x30(%rbp), %xmm0
ucomiss 0x2114(%rip), %xmm0     # 0xa6a4
movq %rbx, -0x90(%rbp)
jae 0x8610
leaq -0x100(%rbp), %rdi
movq %rbx, %rsi
callq 0x945a
movq %rbx, %rdi
callq 0x9488
leaq -0x190(%rbp), %rdi
movq %rax, %rsi
callq 0x92e6
movq %rbx, %rdi
callq 0x9488
leaq -0x190(%rbp), %rbx
movq %r14, %rdi
movq %r12, %rsi
leaq -0x100(%rbp), %rdx
movq %rbx, %rcx
movq %rax, %r8
movss 0x1a1f(%rip), %xmm0     # 0xa008
callq 0x78e4
movq %r14, -0x88(%rbp)
movq %rbx, %rdi
callq 0x60da
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
jmp 0x8692
leaq -0x120(%rbp), %rdi
movq %rbx, %rsi
callq 0x945a
movq %rbx, %rdi
callq 0x9488
leaq -0x178(%rbp), %rdi
movq %rax, %rsi
callq 0x92e6
movq %rbx, %rdi
callq 0x9488
movq %rax, %rbx
movq -0x90(%rbp), %rdi
callq 0x9488
movq %rax, %rdi
callq 0x930c
movq %r14, %rdi
movq %r12, %rsi
leaq -0x120(%rbp), %rdx
leaq -0x178(%rbp), %rcx
movq %rbx, %r8
callq 0x78e4
movq %r14, -0x88(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x60da
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x869c
callq 0x21a0
movq -0x98(%rbp), %rdi
movq (%rdi), %rsi
leaq -0x88(%rbp), %rdx
callq 0x90b2
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %r14
movq %r14, %rsi
movq %r15, %rdx
callq 0x7a40
movq %rax, %r15
movq 0x5903(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %rax, %rbx
movl $0x15, %edx
movq %rax, %rdi
leaq 0x1dcb(%rip), %rsi      # 0xa4d9
callq 0x2220
movq %r13, %rdi
movq %r14, %rsi
callq 0x945a
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x2220
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x876a
callq 0x21a0
movq -0x70(%rbp), %rbx
movq %r15, %r14
movq -0x60(%rbp), %r15
jmp 0x8c57
movq -0x60(%rbp), %r15
movq -0x38(%rbp), %r12
jmp 0x87f1
cmpq %rbx, %rdx
movq -0x60(%rbp), %r15
movq -0x38(%rbp), %r12
jbe 0x8cba
movq (%rcx,%rbx,8), %rax
movq %rax, -0x30(%rbp)
movl $0x31, %edx
movq 0x582f(%rip), %r14      # 0xdfd8
movq %r14, %rdi
leaq 0x1f49(%rip), %rsi      # 0xa6fc
callq 0x2220
movq %r14, %rdi
movq -0x30(%rbp), %r14
movq %rbx, %rsi
callq 0x2140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq $0x9, %rcx
jb 0x8bba
movq 0x57c7(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %rax, %rbx
movl $0x1e, %edx
movq %rax, %rdi
leaq 0x1e7b(%rip), %rsi      # 0xa6c5
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
movq %r14, -0x30(%rbp)
je 0x8ac6
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x9446
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0x8cae
movq (%rcx,%r15,8), %r14
movq 0x571c(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %rax, %r12
movl $0xf, %edx
movq %rax, %rdi
leaq 0x1def(%rip), %rsi      # 0xa6e4
callq 0x2220
movq %r13, %rdi
movq %r14, %rsi
callq 0x945a
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %r12, %rdi
callq 0x2220
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
leaq 0x1dcd(%rip), %rsi      # 0xa6f4
callq 0x2220
movq %r14, %rdi
callq 0x9488
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x80(%rbp), %rsi
subq -0x88(%rbp), %rsi
sarq $0x5, %rsi
movq %r12, %rdi
callq 0x2140
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq %r15, -0x68(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x60da
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x89a6
callq 0x21a0
movq %r14, %rdi
callq 0x9488
movq %r13, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x50(%rbp), %r15
movq -0x58(%rbp), %r12
movq %r13, %rdi
callq 0x60da
cmpq %r12, %r15
je 0x8a71
movl $0x1, %r15d
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x9488
movq %r13, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r12, %rdx
jbe 0x8c9d
shlq $0x5, %r12
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq 0x55be(%rip), %rdi      # 0xdfd8
callq 0x2220
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1b73(%rip), %rsi      # 0xa5a1
callq 0x2220
movq %r13, %rdi
callq 0x60da
movl %r15d, %r12d
movq %r14, %rdi
callq 0x9488
movq %r13, %rdi
movq %rax, %rsi
callq 0x92e6
movq -0x50(%rbp), %rbx
subq -0x58(%rbp), %rbx
sarq $0x5, %rbx
movq %r13, %rdi
callq 0x60da
incl %r15d
cmpq %r12, %rbx
ja 0x89db
movq 0x5560(%rip), %rbx      # 0xdfd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x68(%rbp), %r15
incl %r15d
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x8892
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x8c4b
movl $0x1, %r12d
xorl %ebx, %ebx
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq %r14, %rdi
movq 0x68(%rax), %r14
callq 0x9446
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rbx, %rdx
jbe 0x8cba
movq (%rcx,%rbx,8), %rdi
callq 0x9488
cmpq %rax, %r14
je 0x8bd4
movl $0x34, %edx
movq 0x54ac(%rip), %r14      # 0xdfd8
movq %r14, %rdi
leaq 0x1c4a(%rip), %rsi      # 0xa780
callq 0x2220
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2140
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
decq %rcx
cmpq %rbx, %rcx
je 0x8ccb
movl %r12d, %ebx
movq %r14, %rdi
callq 0x9446
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
incl %r12d
cmpq %rbx, %rcx
ja 0x8ae3
jmp 0x8c4b
movq %r14, %rdi
callq 0x9446
movq (%rax), %rcx
cmpq %rcx, 0x8(%rax)
je 0x8d01
movq (%rcx), %r14
jmp 0x8c53
movq -0x30(%rbp), %rdi
callq 0x9446
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rbx, %rdx
jbe 0x8cba
movq (%rcx,%rbx,8), %r15
movl $0x31, %edx
movq 0x53d4(%rip), %r14      # 0xdfd8
movq %r14, %rdi
leaq 0x1aee(%rip), %rsi      # 0xa6fc
callq 0x2220
movq %r14, %rdi
movq %r15, %r14
movq %rbx, %rsi
callq 0x2140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x60(%rbp), %r15
movq -0x38(%rbp), %r12
movq -0x70(%rbp), %rbx
testq %rbx, %rbx
jne 0x7c08
jmp 0x8c66
movq -0x30(%rbp), %r14
movq %r14, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1993(%rip), %rdi      # 0xa615
movq %r12, %rsi
xorl %eax, %eax
callq 0x2280
leaq 0x1982(%rip), %rdi      # 0xa615
movq %r12, %rsi
xorl %eax, %eax
callq 0x2280
leaq 0x1971(%rip), %rdi      # 0xa615
movq %r12, %rsi
xorl %eax, %eax
callq 0x2280
leaq 0x1960(%rip), %rdi      # 0xa615
movq %r15, %rsi
jmp 0x8cc4
leaq 0x1954(%rip), %rdi      # 0xa615
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2280
movq 0x5306(%rip), %rdi      # 0xdfd8
leaq 0x1a55(%rip), %rsi      # 0xa72e
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movl $0x1, %edi
callq 0x2230
leaq 0x191e(%rip), %rdi      # 0xa615
movq %r13, %rsi
xorl %eax, %eax
callq 0x2280
leaq 0x190d(%rip), %rdi      # 0xa615
xorl %esi, %esi
xorl %edx, %edx
jmp 0x8cc4
leaq 0x1900(%rip), %rdi      # 0xa615
movq -0x70(%rbp), %rsi
xorl %eax, %eax
callq 0x2280
leaq 0x18ee(%rip), %rdi      # 0xa615
movq -0x70(%rbp), %rsi
xorl %eax, %eax
callq 0x2280
movq %rax, %rbx
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x8e14
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0x60da
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
jmp 0x8dd7
jmp 0x8d8a
jmp 0x8d8a
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x60da
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
jmp 0x8dd7
jmp 0x8d8a
jmp 0x8d8a
jmp 0x8d8a
movq %rax, %rbx
jmp 0x8de1
movq %rax, %rbx
jmp 0x8da3
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
callq 0x60da
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
jmp 0x8dd7
movq %rax, %rbx
jmp 0x8dc9
jmp 0x8e2a
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
callq 0x60da
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x8de1
callq 0x21a0
movq %r14, %rdi
jmp 0x8e19
jmp 0x8e2a
jmp 0x8df4
jmp 0x8df4
jmp 0x8df4
jmp 0x8df4
jmp 0x8df4
jmp 0x8df4
movq %rax, %rbx
jmp 0x8e0c
jmp 0x8dfd
jmp 0x8dfd
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x60da
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x8e36
callq 0x21a0
jmp 0x8e36
jmp 0x8e2a
jmp 0x8e2a
jmp 0x8e2a
jmp 0x8e2a
jmp 0x8e2a
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x60da
movq %rbx, %rdi
callq 0x22f0