// File: /workspace/github_cpp_makefile_star2_O2/matteorr[P]EarleyParser/EarleyParser.cpp
// Function: EarleyParser::returnParsingTrees(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<Node*>* EarleyParser::returnParsingTrees( string mainNonTerminal )
{

	for( vector<State*>::iterator it = this->earleyParserChart[ this->inputVector.size() ].begin();
			it != this->earleyParserChart[ this->inputVector.size() ].end(); it++ )
	{
		if( (*it)->getNonTerminal() == mainNonTerminal && (*it)->getProductionProgress() == (*it)->getProductionPointer()->getProductionContent().size() )
		{
			State* stateBookmark = (*it);
			Node* rootOfParsingTree;

			if( this->probabilityParser == true )
			{
				rootOfParsingTree =
						new Node(
								NULL,
								stateBookmark->getNonTerminal(),
								stateBookmark->getProductionPointer()->getProductionContent(),
								stateBookmark->getProductionPointer(),
								stateBookmark->getProductionPointer()->getProductionProbability()
							);
			}else{

				rootOfParsingTree =
						new Node(
								NULL,
								stateBookmark->getNonTerminal(),
								stateBookmark->getProductionPointer()->getProductionContent(),
								stateBookmark->getProductionPointer(),
								-1
							);
			}

			vector<State*>* test;
			State* test2;
			test2 = rootOfParsingTree->expandNode( stateBookmark, & this->earleyProductions );
			cout << endl << "finished expanding - " << test2->getNonTerminal() << endl;

			this->returnVector.push_back( rootOfParsingTree );
		}
	}

	return & this->returnVector;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r12
movq 0xa0(%rdi), %rax
movq 0x80(%rdi), %rcx
movq 0x98(%rdi), %rdx
movq %rax, %rsi
subq %rdx, %rsi
sarq $0x5, %rsi
imulq $0x18, %rsi, %rsi
movq (%rcx,%rsi), %r13
leaq 0x10(%rdi), %rsi
movq %rsi, -0x50(%rbp)
movq %rdi, -0x40(%rbp)
leaq 0xb0(%rdi), %rsi
movq %rsi, -0x38(%rbp)
leaq -0x88(%rbp), %r14
movq %r12, -0x48(%rbp)
subq %rdx, %rax
sarq $0x5, %rax
imulq $0x18, %rax, %rax
cmpq 0x8(%rcx,%rax), %r13
je 0x467c
movq (%r13), %rsi
movq %r14, %rdi
callq 0x780c
movq %r14, %rdi
movq %r12, %rsi
callq 0x4e25
testb %al, %al
je 0x456e
movq (%r13), %rdi
callq 0x785a
movl %eax, %ebx
movq (%r13), %rdi
callq 0x7828
leaq -0x68(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x76d8
movslq %ebx, %rbx
movq -0x60(%rbp), %r15
subq -0x68(%rbp), %r15
sarq $0x5, %r15
movq %r14, %rdi
callq 0x4ba2
leaq -0x88(%rbp), %r14
movq %r14, %rdi
callq 0x20f0
cmpq %rbx, %r15
jne 0x465a
movq (%r13), %r12
movq -0x40(%rbp), %rax
movb 0x8(%rax), %bl
pushq $0x70
popq %rdi
callq 0x21d0
movq %rax, -0x30(%rbp)
cmpb $0x1, %bl
jne 0x457b
leaq -0xf8(%rbp), %rdi
movq %r12, %rsi
callq 0x780c
movq %r12, %rdi
callq 0x7828
leaq -0xb8(%rbp), %rdi
movq %rax, %rsi
callq 0x76d8
movq %r12, %rdi
callq 0x7828
movq %rax, %rbx
movq %r12, %rdi
callq 0x7828
movq %rax, %rdi
callq 0x76fe
movq -0x30(%rbp), %rdi
xorl %esi, %esi
leaq -0xf8(%rbp), %r14
movq %r14, %rdx
leaq -0xb8(%rbp), %r15
movq %r15, %rcx
movq %rbx, %r8
callq 0x64f4
movq %r15, %rdi
movq %r14, %rbx
jmp 0x45d6
movq %r14, %rdi
callq 0x20f0
jmp 0x465a
leaq -0xd8(%rbp), %rdi
movq %r12, %rsi
callq 0x780c
movq %r12, %rdi
callq 0x7828
leaq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x76d8
movq %r12, %rdi
callq 0x7828
movq -0x30(%rbp), %rdi
xorl %esi, %esi
leaq -0xd8(%rbp), %rbx
movq %rbx, %rdx
leaq -0xa0(%rbp), %r14
movq %r14, %rcx
movq %rax, %r8
movss 0x3a3a(%rip), %xmm0     # 0x8008
callq 0x64f4
movq %r14, %rdi
movq -0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
callq 0x4ba2
movq %rbx, %rdi
callq 0x20f0
movq -0x68(%rbp), %rdi
movq %r12, %rsi
movq -0x50(%rbp), %rdx
callq 0x6636
movq %rax, %rbx
movq 0x89d3(%rip), %rdi      # 0xcfd8
callq 0x2100
movq %rax, %rdi
leaq 0x3ec5(%rip), %rsi      # 0x84d9
callq 0x21c0
movq %rax, %r15
leaq -0x88(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x780c
movq %r15, %rdi
movq %r14, %rsi
callq 0x2190
movq %rax, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x20f0
movq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x4e48
movq -0x48(%rbp), %r12
addq $0x8, %r13
movq -0x40(%rbp), %rdx
movq 0xa0(%rdx), %rax
movq 0x80(%rdx), %rcx
movq 0x98(%rdx), %rdx
jmp 0x4460
movq -0x38(%rbp), %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4694
movq %rax, %rbx
jmp 0x46d6
movq %rax, %rbx
jmp 0x46ca
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x4ba2
jmp 0x46b2
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
jmp 0x46d1
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x4ba2
leaq -0xf8(%rbp), %rdi
callq 0x20f0
movq -0x30(%rbp), %rdi
callq 0x21a0
jmp 0x46f4
jmp 0x46e5
jmp 0x46e5
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x22c0