// File: /workspace/github_cpp_makefile_star2_O3/matteorr[P]EarleyParser/EarleyParser.cpp
// Function: EarleyParser::printStateBackTrace(State*)
void EarleyParser::printStateBackTrace( State* stateToPrint )
{
	//cout << "[DEBUG]: in print back trace function" << endl;

	cout << "[DEBUG]: - " << stateToPrint->getNonTerminal() << " -> ";
	for( unsigned int i = 0; i < stateToPrint->getProductionPointer()->getProductionContent().size(); i++ )
	{
		cout << stateToPrint->getProductionPointer()->getProductionContent().at(i) << " ";
	}

	vector<State*>* backTraceVectorState = stateToPrint->getBacktraceStateVector();
	cout << endl << "size of backtrace vector state: " << backTraceVectorState->size() << endl;

	//for( unsigned int i = 0; i < backTraceVectorState->at(0)->getProductionPointer()->getProductionContent().size(); i++ )
	//{
	//	cout << " " << backTraceVectorState->at(0)->getProductionPointer()->getProductionContent().at(i);
	//}

	for( unsigned int i = 0; i < backTraceVectorState->size(); i++ )
	{
		if( backTraceVectorState->at(i) == NULL ){
			cout << "[DEBUG]: pointer to next state is null" << endl;
			continue;
		}

		if( backTraceVectorState->at(i)->getPrinted() == false )
		{
			//cout << "[DEBUG]: Production expanded [ " << *(*it)->getNonTerminal() << " -> ";
			//for( unsigned int i = 0; i < *(*it)->getProductionPointer()->getProductionContent().size(); i++ ){
			//	cout << (*it)->getProductionPointer()->getProductionContent().at(i) << " ";
			//}
			//cout << "]" << endl;
		//	cout << "[DEBUG]: - check if problem is iterator ->>>>>>>>>>>>" << backTraceVectorState->at(i)->getInputStringProgress() << endl << endl;
			//cout << "[DEBUG]: - " << stateToPrint->getNonTerminal() << " -> " <<endl;
			this->printStateBackTrace( backTraceVectorState->at(i) );
		}
		//backTraceVectorState->at(i)->setPrintedTrue();
	}

	//	cout << "[DEBUG]: - check if problem is pointer ->>>>>>>>>>>>" << stateToPrint->getInputStringProgress() << endl;

	cout << endl << endl;

	stateToPrint->setPrintedTrue();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, -0x50(%rbp)
movq 0x825d(%rip), %r15      # 0xdfd8
leaq 0x47cc(%rip), %rsi      # 0xa54e
movl $0xb, %edx
movq %r15, %rdi
callq 0x2220
leaq -0x48(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x944e
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x2220
leaq 0x47a6(%rip), %rsi      # 0xa55a
movl $0x4, %edx
movq %rax, %rdi
callq 0x2220
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5dd3
callq 0x21a0
movq %rbx, %rdi
callq 0x947c
movq %r14, %rdi
movq %rax, %rsi
callq 0x92d6
movq 0x8(%r14), %r15
movq (%r14), %r12
movq %r14, %rdi
callq 0x60b2
cmpq %r12, %r15
je 0x5ea1
movl $0x1, %r13d
xorl %r14d, %r14d
leaq -0x48(%rbp), %r12
movq %rbx, %rdi
callq 0x947c
movq %r12, %rdi
movq %rax, %rsi
callq 0x92d6
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r14, %rdx
jbe 0x6055
shlq $0x5, %r14
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
movq 0x818e(%rip), %rdi      # 0xdfd8
callq 0x2220
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4743(%rip), %rsi      # 0xa5a1
callq 0x2220
movq %r12, %rdi
callq 0x60b2
movl %r13d, %r14d
movq %rbx, %rdi
callq 0x947c
movq %r12, %rdi
movq %rax, %rsi
callq 0x92d6
movq -0x40(%rbp), %r15
subq -0x48(%rbp), %r15
sarq $0x5, %r15
movq %r12, %rdi
callq 0x60b2
incl %r13d
cmpq %r14, %r15
ja 0x5e0b
movq %rbx, %rdi
callq 0x943a
movq %rax, %r12
movq 0x8125(%rip), %r14      # 0xdfd8
movq (%r14), %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 %rax, %r14
leaq 0x46bf(%rip), %rsi      # 0xa5a3
movl $0x20, %edx
movq %rax, %rdi
callq 0x2220
movq 0x8(%r12), %rsi
subq (%r12), %rsi
sarq $0x3, %rsi
movq %r14, %rdi
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 (%r12), %rax
cmpq %rax, 0x8(%r12)
je 0x5fe6
movl $0x1, %r15d
xorl %r14d, %r14d
leaq 0x4675(%rip), %r13      # 0xa5c4
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x5f89
callq 0x95a0
testb %al, %al
jne 0x5fc7
movq (%r12), %rax
movq 0x8(%r12), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x6066
movq (%rax,%r14,8), %rsi
movq -0x50(%rbp), %rdi
callq 0x5d5c
jmp 0x5fc7
movl $0x26, %edx
movq 0x8043(%rip), %r14      # 0xdfd8
movq %r14, %rdi
movq %r13, %rsi
callq 0x2220
movq (%r14), %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
movl %r15d, %r14d
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
incl %r15d
cmpq %r14, %rcx
ja 0x5f4f
movq 0x7feb(%rip), %r14      # 0xdfd8
movq (%r14), %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 %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 %rbx, %rdi
callq 0x95aa
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x45b9(%rip), %rdi      # 0xa615
movq %r14, %rsi
xorl %eax, %eax
callq 0x2280
leaq 0x45a8(%rip), %rdi      # 0xa615
movq %r14, %rsi
xorl %eax, %eax
callq 0x2280
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x609c
callq 0x21a0
jmp 0x609c
jmp 0x6090
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x60b2
movq %rbx, %rdi
callq 0x22f0