// File: /workspace/github_cpp_makefile_star2_O1/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 $0xc8, %rsp
movq %rsi, -0x58(%rbp)
movq %rdi, %rbx
movq 0x80(%rdi), %rax
movq 0xa0(%rdi), %rcx
subq 0x98(%rdi), %rcx
sarq $0x5, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %r14
cmpq 0x8(%rax,%rcx,8), %r14
je 0x58ab
leaq -0x40(%rbp), %r13
leaq 0x10(%rbx), %rax
movq %rax, -0x68(%rbp)
leaq 0xb0(%rbx), %rax
movq %rax, -0x60(%rbp)
movq (%r14), %rsi
leaq -0x50(%rbp), %rdi
callq 0x945a
movq -0x48(%rbp), %rdx
movq -0x58(%rbp), %rax
cmpq 0x8(%rax), %rdx
jne 0x561d
testq %rdx, %rdx
je 0x5622
movq -0x58(%rbp), %rax
movq (%rax), %rsi
movq -0x50(%rbp), %rdi
callq 0x21f0
testl %eax, %eax
sete %r12b
jmp 0x5625
xorl %r12d, %r12d
jmp 0x5625
movb $0x1, %r12b
testb %r12b, %r12b
je 0x566a
movq (%r14), %rdi
callq 0x94bc
movl %eax, %r15d
movq (%r14), %rdi
callq 0x9488
leaq -0xd8(%rbp), %rdi
movq %rax, %rsi
callq 0x92e6
movq -0xd0(%rbp), %rax
subq -0xd8(%rbp), %rax
movslq %r15d, %rcx
sarq $0x5, %rax
cmpq %rcx, %rax
sete %r15b
jmp 0x566d
xorl %r15d, %r15d
testb %r12b, %r12b
je 0x567e
leaq -0xd8(%rbp), %rdi
callq 0x60da
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x568c
callq 0x21a0
testb %r15b, %r15b
je 0x587f
movq (%r14), %r13
movb 0x8(%rbx), %r12b
movl $0x70, %edi
callq 0x21e0
movq %rax, %r15
cmpb $0x1, %r12b
jne 0x572b
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x945a
movq %r13, %rdi
callq 0x9488
leaq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x92e6
movq %r13, %rdi
callq 0x9488
movq %rax, %r12
movq %r13, %rdi
callq 0x9488
movq %rax, %rdi
callq 0x930c
movq %r15, %rdi
xorl %esi, %esi
leaq -0xa8(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
movq %r12, %r8
callq 0x78e4
movq %r15, -0x30(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x60da
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
jmp 0x5796
leaq -0x88(%rbp), %rdi
movq %r13, %rsi
callq 0x945a
movq %r13, %rdi
callq 0x9488
leaq -0xf0(%rbp), %rdi
movq %rax, %rsi
callq 0x92e6
movq %r13, %rdi
callq 0x9488
leaq -0xf0(%rbp), %r12
movq %r15, %rdi
xorl %esi, %esi
leaq -0x88(%rbp), %rdx
movq %r12, %rcx
movq %rax, %r8
movss 0x488e(%rip), %xmm0     # 0xa008
callq 0x78e4
movq %r15, -0x30(%rbp)
movq %r12, %rdi
callq 0x60da
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x57a0
callq 0x21a0
movq -0x30(%rbp), %rdi
movq %r13, %rsi
movq -0x68(%rbp), %rdx
callq 0x7a40
movq %rax, %r15
movq 0x881e(%rip), %r12      # 0xdfd8
movq (%r12), %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 %rax, %r12
movl $0x15, %edx
movq %rax, %rdi
leaq 0x4ce5(%rip), %rsi      # 0xa4d9
callq 0x2220
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x945a
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x2220
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %r13
cmpq %r13, %rdi
je 0x5851
callq 0x21a0
movq 0xb8(%rbx), %rsi
cmpq 0xc0(%rbx), %rsi
je 0x5872
movq -0x30(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0xb8(%rbx)
jmp 0x587f
movq -0x60(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x7588
addq $0x8, %r14
movq 0x80(%rbx), %rax
movq 0xa0(%rbx), %rcx
subq 0x98(%rbx), %rcx
sarq $0x5, %rcx
leaq (%rcx,%rcx,2), %rcx
cmpq 0x8(%rax,%rcx,8), %r14
jne 0x55e6
addq $0xb0, %rbx
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x58c9
movq %rax, %rbx
jmp 0x592b
movq %rax, %rbx
jmp 0x58e2
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x60da
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
jmp 0x5921
jmp 0x58f6
movq %rax, %rbx
jmp 0x5913
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
jne 0x5940
jmp 0x5945
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x60da
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x592b
callq 0x21a0
movq %r15, %rdi
jmp 0x5940
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5945
callq 0x21a0
movq %rbx, %rdi
callq 0x22f0
nop