// File: /workspace/github_cpp_makefile_star2_O3/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 %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 0x588c
movq %rsi, %r13
leaq -0x38(%rbp), %r12
leaq 0x10(%rbx), %rax
movq %rax, -0x78(%rbp)
leaq 0xb0(%rbx), %rax
movq %rax, -0x70(%rbp)
movq %rsi, -0x50(%rbp)
movq (%r14), %rsi
leaq -0x48(%rbp), %rdi
callq 0x944e
movq -0x40(%rbp), %rdx
cmpq 0x8(%r13), %rdx
jne 0x5603
testq %rdx, %rdx
je 0x5608
movq (%r13), %rsi
movq -0x48(%rbp), %rdi
callq 0x21f0
testl %eax, %eax
je 0x5608
xorl %r15d, %r15d
jmp 0x5658
movq %rbx, %r13
movq %r12, %rbx
movq (%r14), %rdi
callq 0x94b0
movl %eax, %r15d
movq (%r14), %rdi
callq 0x947c
leaq -0x68(%rbp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x92d6
movq -0x60(%rbp), %rax
subq -0x68(%rbp), %rax
movslq %r15d, %rcx
sarq $0x5, %rax
cmpq %rcx, %rax
sete %r15b
movq %r12, %rdi
callq 0x60b2
movq %rbx, %r12
movq %r13, %rbx
movq -0x50(%rbp), %r13
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5666
callq 0x21a0
testb %r15b, %r15b
je 0x5860
movq (%r14), %r13
movb 0x8(%rbx), %r12b
movl $0x70, %edi
callq 0x21e0
movq %rax, %r15
cmpb $0x1, %r12b
jne 0x5705
leaq -0xb8(%rbp), %rdi
movq %r13, %rsi
callq 0x944e
movq %r13, %rdi
callq 0x947c
leaq -0xd0(%rbp), %rdi
movq %rax, %rsi
callq 0x92d6
movq %r13, %rdi
callq 0x947c
movq %rax, %r12
movq %r13, %rdi
callq 0x947c
movq %rax, %rdi
callq 0x92fc
movq %r15, %rdi
xorl %esi, %esi
leaq -0xb8(%rbp), %rdx
leaq -0xd0(%rbp), %rcx
movq %r12, %r8
callq 0x78a8
movq %r15, -0x68(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x60b2
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
jmp 0x5773
leaq -0x98(%rbp), %rdi
movq %r13, %rsi
callq 0x944e
movq %r13, %rdi
callq 0x947c
leaq -0xe8(%rbp), %rdi
movq %rax, %rsi
callq 0x92d6
movq %r13, %rdi
callq 0x947c
leaq -0xe8(%rbp), %r12
movq %r15, %rdi
xorl %esi, %esi
leaq -0x98(%rbp), %rdx
movq %r12, %rcx
movq %rax, %r8
movss 0x48b4(%rip), %xmm0     # 0xa008
callq 0x78a8
movq %r15, -0x68(%rbp)
movq %r12, %rdi
callq 0x60b2
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x577d
callq 0x21a0
movq -0x68(%rbp), %rdi
movq %r13, %rsi
movq -0x78(%rbp), %rdx
callq 0x7a0e
movq %rax, %r15
movq 0x8841(%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 0x4d08(%rip), %rsi      # 0xa4d9
callq 0x2220
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x944e
movq -0x48(%rbp), %rsi
movq -0x40(%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 -0x48(%rbp), %rdi
leaq -0x38(%rbp), %r12
cmpq %r12, %rdi
movq -0x50(%rbp), %r13
je 0x5832
callq 0x21a0
movq 0xb8(%rbx), %rsi
cmpq 0xc0(%rbx), %rsi
je 0x5853
movq -0x68(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0xb8(%rbx)
jmp 0x5860
movq -0x70(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x757c
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 0x55d7
addq $0xb0, %rbx
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x58aa
movq %rax, %rbx
jmp 0x5903
jmp 0x5908
movq %rax, %rbx
jmp 0x58c5
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x60b2
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
jmp 0x58f9
movq %rax, %rbx
jmp 0x58eb
jmp 0x5908
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x60b2
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x5903
callq 0x21a0
movq %r15, %rdi
jmp 0x5918
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x591d
callq 0x21a0
movq %rbx, %rdi
callq 0x22f0
nop