// File: /workspace/github_cpp_makefile_star2_O3/SeanLee97[P]LL1-Parser/grammar.cpp
// Function: Grammar::_process_grammar[abi:cxx11](char*)
vector<vector<string> > Grammar::_process_grammar(char* inputFile) {

	vector<string> temp_terminals(maxidx_terminal + 1); // Terminal names
	vector<string> temp_nonterminals(num_nonterminals + 1); // Nonterminal names

	vector< vector<string> > temp_names(2);
	temp_names[0] = temp_terminals;
	temp_names[1] = temp_nonterminals;

	input.open(inputFile); // 文件指针

	string cur_terminal_name;
	string cur_terminal_idx;

	// 终结符获取
	while(getline(input, line)) {
		if(line.compare("") == 0) break;

		stringstream ss(line); 
		getline(ss, cur_terminal_name, ' '); 
		getline(ss, cur_terminal_idx, ' ');

		// cout<<cur_terminal_idx<<"-"<<cur_terminal_name<<endl;
		temp_names[0][atoi(cur_terminal_idx.c_str())] = cur_terminal_name;
	}

	int cur_nonterminal_idx = 0; 
	string cur_nonterminal_name; 
	string last_unique_nonterminal("");

	while(getline(input, line)) {
		stringstream ss(line); 
		getline(ss, cur_nonterminal_name, ' ');

		if(cur_nonterminal_name.compare(last_unique_nonterminal) != 0) {
			temp_names[1][cur_nonterminal_idx + 1] = cur_nonterminal_name; 
			++cur_nonterminal_idx; 
			last_unique_nonterminal = cur_nonterminal_name;
		}
	}
	input.close();
	return temp_names;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movslq (%rsi), %rsi
incq %rsi
leaq -0xf0(%rbp), %rdi
leaq -0x278(%rbp), %rdx
callq 0x5f3c
movslq 0x4(%r14), %rsi
incq %rsi
leaq -0xd8(%rbp), %rdi
leaq -0x278(%rbp), %rdx
callq 0x5f3c
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movl $0x30, %edi
callq 0x21c0
movq %rax, %r13
movq %rax, (%r15)
addq $0x30, %rax
movq %rax, 0x10(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r13)
movups %xmm0, 0x10(%r13)
movups %xmm0, (%r13)
movq %r15, -0x38(%rbp)
movq %rax, 0x8(%r15)
leaq -0xf0(%rbp), %rsi
movq %r13, %rdi
callq 0x5fc8
movq %r13, %rdi
addq $0x18, %rdi
leaq -0xd8(%rbp), %rsi
movq %rdi, -0xa0(%rbp)
callq 0x5fc8
leaq 0x10(%r14), %r12
movq %r12, %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x2120
leaq -0xb0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x88(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
addq $0x218, %r14            # imm = 0x218
leaq -0x278(%rbp), %rbx
leaq -0xc0(%rbp), %r15
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %edx
movq %r12, %rdi
movq %r14, %rsi
callq 0x2300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4538
movq %r14, %rdi
leaq 0x3e12(%rip), %rsi      # 0x82ce
callq 0x2090
testl %eax, %eax
je 0x4538
movq %rbx, %rdi
movq %r14, %rsi
movl $0x18, %edx
callq 0x2290
movq %rbx, %rdi
movq %r15, %rsi
movl $0x20, %edx
callq 0x2300
movq %rbx, %rdi
leaq -0x98(%rbp), %rsi
movl $0x20, %edx
callq 0x2300
movq -0x98(%rbp), %rdi
callq 0x2280
movslq %eax, %rdi
shlq $0x5, %rdi
addq (%r13), %rdi
movq %r15, %rsi
callq 0x2100
movq %rbx, %rdi
movq 0x6a96(%rip), %rsi      # 0xafb8
callq 0x2160
leaq -0x1f8(%rbp), %rdi
callq 0x20a0
jmp 0x447d
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x3d74(%rip), %rdx      # 0x82ce
leaq -0x58(%rbp), %rdi
movq %rdx, %rsi
callq 0x2d4c
movl $0x0, -0x2c(%rbp)
leaq -0x278(%rbp), %rbx
leaq -0x78(%rbp), %r15
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %edx
movq %r12, %rdi
movq %r14, %rsi
callq 0x2300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4669
movq %rbx, %rdi
movq %r14, %rsi
movl $0x18, %edx
callq 0x2290
movq %rbx, %rdi
movq %r15, %rsi
movl $0x20, %edx
callq 0x2300
movq %r15, %rbx
movq -0x70(%rbp), %r15
movq -0x50(%rbp), %r13
cmpq %r15, %r13
movq %r15, %rdx
cmovbq %r13, %rdx
testq %rdx, %rdx
je 0x4609
movq -0x58(%rbp), %rsi
movq -0x78(%rbp), %rdi
callq 0x21e0
cmpq %r13, %r15
jne 0x460e
testl %eax, %eax
jne 0x460e
movq %rbx, %r15
leaq -0x278(%rbp), %rbx
jmp 0x4649
cmpq %r13, %r15
je 0x45fd
movslq -0x2c(%rbp), %rax
shlq $0x5, %rax
movq -0xa0(%rbp), %rcx
movq (%rcx), %rcx
leaq (%rax,%rcx), %rdi
addq $0x20, %rdi
movq %rbx, %r15
movq %rbx, %rsi
callq 0x2100
leaq -0x278(%rbp), %rbx
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
callq 0x2100
incl -0x2c(%rbp)
movq %rbx, %rdi
movq 0x6965(%rip), %rsi      # 0xafb8
callq 0x2160
leaq -0x1f8(%rbp), %rdi
callq 0x20a0
jmp 0x4578
movq %r12, %rdi
callq 0x2060
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x468a
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x46a3
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x46c5
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x46e7
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x21d0
leaq -0xd8(%rbp), %rdi
callq 0x26f2
leaq -0xf0(%rbp), %rdi
callq 0x26f2
movq -0x38(%rbp), %rax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4788
movq %rax, %r14
jmp 0x47a4
movq %rax, %r14
jmp 0x480a
movq %rax, %r14
jmp 0x4816
movq %rax, %r14
jmp 0x4801
jmp 0x473b
jmp 0x4788
movq %rax, %r14
jmp 0x47bd
movq %rax, %r14
movq 0x686e(%rip), %rsi      # 0xafb8
leaq -0x278(%rbp), %rdi
callq 0x2160
leaq -0x1f8(%rbp), %rdi
callq 0x20a0
jmp 0x47bd
movq %rax, %r14
movq 0x684a(%rip), %rsi      # 0xafb8
leaq -0x278(%rbp), %rdi
callq 0x2160
leaq -0x1f8(%rbp), %rdi
callq 0x20a0
jmp 0x478b
movq %rax, %r14
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x47a4
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x47bd
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x47df
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x4801
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x38(%rbp), %rdi
callq 0x6176
leaq -0xd8(%rbp), %rdi
callq 0x26f2
leaq -0xf0(%rbp), %rdi
callq 0x26f2
movq %r14, %rdi
callq 0x22e0