// File: /workspace/github_cpp_makefile_star2_O3/matteorr[P]EarleyParser/EarleyParser.cpp
// Function: EarleyParser::createInputStringVector(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void EarleyParser::createInputStringVector( string filePath )
{
	string line;
	ifstream inputFile;
	string inputStringToParse;

	inputFile.open( filePath.c_str(), fstream::in );

	if( inputFile.is_open() )
	{
		/*
		 * reads a line (production) from the context free input grammar
		 */
		getline( inputFile, line );

		/*
		 * extracts words of the input string
		 * separated by " "
		 */
		this->splitToVector( line, & this->inputVector, " ", false );

		for( unsigned int i = 0; i < this->inputVector.size(); i++ ){
			cout << "[DEBUG]: " << "line token: [" << this->inputVector.at(i) << "]" << endl;

			EarleyParser::dictionaryHashTable::iterator got = this->earleyDictionary.find( this->inputVector.at(i) );
			if( got != this->earleyDictionary.end() )
			{
				/*
				 * element found in hash table (key tokenVector->at(i) contained)
				 */
				if( i == 0 )
					inputStringToParse += got->second;
				else
					inputStringToParse = inputStringToParse + " " + got->second;

			}else{
				/*
				 * element not found in hash table (key tokenVector->at(i) not contained)
				 * error in input string, word not contained in dictionary
				 */
				cout << "[DEBUG]: BAD INPUT STRING!word " << this->inputVector.at(i) << " not contained in dictionary" << endl << endl;
				exit(1);
			}
		}

		cout << "[DEBUG]: input string of parser [" << inputStringToParse << "]" << endl << endl;

		inputFile.close();

		/*
		 * extracts words of the input string to parse
		 * separated by " "
		 */
		this->splitToVector( inputStringToParse, & this->inputVector, " ", false );

		for( unsigned int i = 0; i < this->inputVector.size(); i++ ){
			cout << "[DEBUG]: " << "input vector element: [" << this->inputVector.at(i) << "]" << endl;
		}


	}else{
		cout << "Error: not able to open input file [" << filePath << "]" << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x2c0(%rbp), %rdi
callq 0x2210
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%r14), %rsi
leaq -0x2c0(%rbp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x2130
leaq -0x248(%rbp), %rdi
callq 0x2070
testb %al, %al
je 0x3e7d
movq -0x2c0(%rbp), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %edx
leaq -0x2c0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x2310
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x6b2d(%rip), %rsi      # 0xa5a1
leaq 0x6b27(%rip), %rdx      # 0xa5a2
leaq -0x48(%rbp), %rdi
callq 0x675a
leaq 0x98(%rbx), %rdx
leaq -0x88(%rbp), %rsi
leaq -0x48(%rbp), %rcx
movq %rdx, -0x90(%rbp)
xorl %r8d, %r8d
callq 0x328e
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3ab7
callq 0x21a0
movq 0xa0(%rbx), %rax
cmpq 0x98(%rbx), %rax
je 0x3cb3
leaq 0x48(%rbx), %rax
movq %rax, -0x98(%rbp)
movl $0x1, %r15d
xorl %r12d, %r12d
movl $0x9, %edx
movq 0xa4ed(%rip), %rdi      # 0xdfd8
leaq 0x652e(%rip), %rsi      # 0xa020
callq 0x2220
movl $0xd, %edx
movq 0xa4d5(%rip), %rdi      # 0xdfd8
leaq 0x6525(%rip), %rsi      # 0xa02f
callq 0x2220
movq 0x98(%rbx), %rax
movq 0xa0(%rbx), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r12, %rdx
jbe 0x3fb4
movq %r12, %r14
shlq $0x5, %r14
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
movq 0xa494(%rip), %rdi      # 0xdfd8
callq 0x2220
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x64e2(%rip), %rsi      # 0xa03d
callq 0x2220
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0x98(%rbx), %rsi
movq 0xa0(%rbx), %rdx
subq %rsi, %rdx
sarq $0x5, %rdx
cmpq %r12, %rdx
jbe 0x3fa3
addq %r14, %rsi
movq -0x98(%rbp), %rdi
callq 0x6de0
movq %rax, %r13
testq %rax, %rax
je 0x3f2b
cmpl $0x1, %r15d
jne 0x3bdd
movq 0x28(%r13), %rsi
movq 0x30(%r13), %rdx
leaq -0x68(%rbp), %rdi
callq 0x20b0
jmp 0x3c92
leaq -0xa8(%rbp), %r12
movq %r12, -0xb8(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %r14
movq %r14, %rdi
callq 0x66bc
movq %r14, %rdi
leaq 0x6992(%rip), %rsi      # 0xa5a1
callq 0x2320
movq 0x28(%r13), %rsi
movq 0x30(%r13), %rdx
movq %r14, %rdi
callq 0x20b0
leaq -0x38(%rbp), %r14
movq %r14, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3c48
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x3c4f
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2240
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x3c81
callq 0x21a0
movq -0xb8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3c92
callq 0x21a0
movq 0xa0(%rbx), %rax
subq 0x98(%rbx), %rax
movl %r15d, %r12d
sarq $0x5, %rax
incl %r15d
cmpq %r12, %rax
ja 0x3adf
movq 0xa31e(%rip), %rdi      # 0xdfd8
leaq 0x653e(%rip), %rsi      # 0xa1ff
movl $0x21, %edx
callq 0x2220
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq 0xa2fe(%rip), %rdi      # 0xdfd8
callq 0x2220
movq %rax, %r14
leaq 0x6354(%rip), %rsi      # 0xa03d
movl $0x1, %edx
movq %rax, %rdi
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
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
leaq -0x2c0(%rbp), %rdi
callq 0x2060
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
movq %rax, (%rdi)
leaq 0x683c(%rip), %rsi      # 0xa5a1
leaq 0x6836(%rip), %rdx      # 0xa5a2
callq 0x675a
leaq -0x68(%rbp), %rsi
leaq -0x48(%rbp), %rcx
movq -0x90(%rbp), %rdx
xorl %r8d, %r8d
callq 0x328e
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3d9a
callq 0x21a0
movq 0xa0(%rbx), %rax
cmpq 0x98(%rbx), %rax
je 0x3ee6
movl $0x1, %r12d
xorl %r15d, %r15d
movq 0xa21a(%rip), %r14      # 0xdfd8
leaq 0x6278(%rip), %r13      # 0xa03d
movl $0x9, %edx
movq %r14, %rdi
leaq 0x624c(%rip), %rsi      # 0xa020
callq 0x2220
movl $0x17, %edx
movq %r14, %rdi
leaq 0x6439(%rip), %rsi      # 0xa221
callq 0x2220
movq 0x98(%rbx), %rax
movq 0xa0(%rbx), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r15, %rdx
jbe 0x3fc5
shlq $0x5, %r15
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
movq %r14, %rdi
callq 0x2220
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2220
movq (%r15), %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 0xa0(%rbx), %rax
subq 0x98(%rbx), %rax
movl %r12d, %r15d
sarq $0x5, %rax
incl %r12d
cmpq %r15, %rax
ja 0x3dc5
jmp 0x3ee6
movq 0xa154(%rip), %rdi      # 0xdfd8
leaq 0x62aa(%rip), %rsi      # 0xa135
movl $0x24, %edx
callq 0x2220
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0xa135(%rip), %rdi      # 0xdfd8
callq 0x2220
movq %rax, %rbx
leaq 0x618b(%rip), %rsi      # 0xa03d
movl $0x1, %edx
movq %rax, %rdi
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 -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3ef8
callq 0x21a0
leaq -0x2c0(%rbp), %rdi
callq 0x2080
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x3f19
callq 0x21a0
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa0a6(%rip), %rdi      # 0xdfd8
leaq 0x6289(%rip), %rsi      # 0xa1c2
movl $0x1f, %edx
callq 0x2220
movq 0x98(%rbx), %rax
movq 0xa0(%rbx), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r12, %rdx
jbe 0x3fa3
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
movq 0xa06b(%rip), %rdi      # 0xdfd8
callq 0x2220
movq %rax, %rbx
leaq 0x6266(%rip), %rsi      # 0xa1e2
movl $0x1c, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
movl $0x1, %edi
callq 0x2230
leaq 0x666b(%rip), %rdi      # 0xa615
movq %r12, %rsi
xorl %eax, %eax
callq 0x2280
leaq 0x665a(%rip), %rdi      # 0xa615
movq %r12, %rsi
xorl %eax, %eax
callq 0x2280
leaq 0x6649(%rip), %rdi      # 0xa615
movq %r15, %rsi
xorl %eax, %eax
callq 0x2280
jmp 0x3fda
jmp 0x401d
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
jne 0x400a
jmp 0x4020
jmp 0x401d
movq %rax, %rbx
leaq -0x78(%rbp), %r14
jmp 0x4042
jmp 0x401d
jmp 0x3ffb
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r12, %rdi
je 0x4020
callq 0x21a0
jmp 0x4020
jmp 0x401d
jmp 0x401d
jmp 0x401d
jmp 0x401d
jmp 0x401d
jmp 0x401d
movq %rax, %rbx
leaq -0x78(%rbp), %r14
leaq -0x58(%rbp), %rax
movq -0x68(%rbp), %rdi
cmpq %rax, %rdi
je 0x4036
callq 0x21a0
leaq -0x2c0(%rbp), %rdi
callq 0x2080
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x4053
callq 0x21a0
movq %rbx, %rdi
callq 0x22f0
nop