// File: Caproner[P]Naive_Compiler/Grammar/Grammar.cpp
// Function: Grammar::init()
void Grammar::init()
{
	this->ACTION.clear();
	this->GOTO.clear();
	this->Grammars.clear();
	
	this->Number_to_Symbol.clear();
	this->Number_to_Symbol[1]='v';
	this->Number_to_Symbol[2]='p';
	this->Number_to_Symbol[3]='x';
	this->Number_to_Symbol[4]='c';
	this->Number_to_Symbol[5]='+';
	this->Number_to_Symbol[6]='-';
	this->Number_to_Symbol[7]='*';
	this->Number_to_Symbol[8]='/';
	this->Number_to_Symbol[9]='=';
	this->Number_to_Symbol[10]='(';
	this->Number_to_Symbol[11]=')'; 
	this->Number_to_Symbol[14]='#';
	
	FILE *fp=fopen("Analysis_Table.txt","r");
	char Grammar_String[105];
	int Cnt;
	fscanf(fp,"%d",&Cnt);
	while(Cnt--)
	{
		fscanf(fp,"%s",Grammar_String);
		std::string s=Grammar_String;
		this->Grammars.push_back(s);
	}
	char Tag[3],Symbol[3];
	int Status,Target;
	while(~fscanf(fp,"%s",Tag))
	{
		fscanf(fp,"%s",Symbol);
		fscanf(fp,"%d",&Status);
		fscanf(fp,"%d",&Target);
		if(Tag[0]=='G')this->GOTO[std::make_pair(Symbol[0],Status)]=Target;
		else this->ACTION[std::make_pair(Symbol[0],Status)]=Target;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x118(%rbp)
addq $0x48, %rdi
callq 0x9ff0
movq -0x118(%rbp), %rdi
addq $0x78, %rdi
callq 0x9ff0
movq -0x118(%rbp), %rdi
addq $0x30, %rdi
callq 0xa010
movq -0x118(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
callq 0xa030
movq -0x118(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
movl $0x1, -0xc(%rbp)
leaq -0xc(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x76, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0x2, -0x10(%rbp)
leaq -0x10(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x70, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0x3, -0x14(%rbp)
leaq -0x14(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x78, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0x4, -0x18(%rbp)
leaq -0x18(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x63, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0x5, -0x1c(%rbp)
leaq -0x1c(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x2b, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0x6, -0x20(%rbp)
leaq -0x20(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x2d, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0x7, -0x24(%rbp)
leaq -0x24(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x2a, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0x8, -0x28(%rbp)
leaq -0x28(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x2f, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0x9, -0x2c(%rbp)
leaq -0x2c(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x3d, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0xa, -0x30(%rbp)
leaq -0x30(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x28, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0xb, -0x34(%rbp)
leaq -0x34(%rbp), %rsi
callq 0xa050
movq -0x118(%rbp), %rdi
movb $0x29, (%rax)
addq $0x148, %rdi            # imm = 0x148
movl $0xe, -0x38(%rbp)
leaq -0x38(%rbp), %rsi
callq 0xa050
movb $0x23, (%rax)
leaq 0x8b3c(%rip), %rdi      # 0x12155
leaq 0x8b12(%rip), %rsi      # 0x12132
callq 0x2290
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq 0x8b34(%rip), %rsi      # 0x12168
leaq -0xb4(%rbp), %rdx
movb $0x0, %al
callq 0x2380
movl -0xb4(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0xb4(%rbp)
cmpl $0x0, %eax
je 0x9727
movq -0x40(%rbp), %rdi
leaq 0x8b04(%rip), %rsi      # 0x1216b
xorl %eax, %eax
leaq -0xb0(%rbp), %rdx
movq %rdx, -0x128(%rbp)
callq 0x2380
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x2360
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0xd8(%rbp), %rdi
callq 0xa130
jmp 0x96ab
leaq -0xd9(%rbp), %rdi
callq 0x2260
movq -0x118(%rbp), %rdi
addq $0x30, %rdi
leaq -0xd8(%rbp), %rsi
callq 0xa1e0
jmp 0x96d0
leaq -0xd8(%rbp), %rdi
callq 0x2140
jmp 0x9642
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
leaq -0xd9(%rbp), %rdi
callq 0x2260
jmp 0x985b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x2140
jmp 0x985b
jmp 0x9729
movq -0x40(%rbp), %rdi
leaq -0xef(%rbp), %rdx
leaq 0x8a30(%rip), %rsi      # 0x1216b
movb $0x0, %al
callq 0x2380
xorl $-0x1, %eax
cmpl $0x0, %eax
je 0x9852
movq -0x40(%rbp), %rdi
leaq -0xf2(%rbp), %rdx
leaq 0x8a0b(%rip), %rsi      # 0x1216b
movb $0x0, %al
callq 0x2380
movq -0x40(%rbp), %rdi
leaq 0x89f6(%rip), %rsi      # 0x12168
leaq -0xf8(%rbp), %rdx
movb $0x0, %al
callq 0x2380
movq -0x40(%rbp), %rdi
leaq 0x89dd(%rip), %rsi      # 0x12168
leaq -0xfc(%rbp), %rdx
movb $0x0, %al
callq 0x2380
movsbl -0xef(%rbp), %eax
cmpl $0x47, %eax
jne 0x97fa
movq -0x118(%rbp), %rax
movl -0xfc(%rbp), %ecx
movl %ecx, -0x12c(%rbp)
addq $0x78, %rax
movq %rax, -0x138(%rbp)
leaq -0xf2(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x9cc0
movq -0x138(%rbp), %rdi
movq %rax, -0x104(%rbp)
leaq -0x104(%rbp), %rsi
callq 0x9d20
movl -0x12c(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x984d
movq -0x118(%rbp), %rax
movl -0xfc(%rbp), %ecx
movl %ecx, -0x13c(%rbp)
addq $0x48, %rax
movq %rax, -0x148(%rbp)
leaq -0xf2(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x9cc0
movq -0x148(%rbp), %rdi
movq %rax, -0x10c(%rbp)
leaq -0x10c(%rbp), %rsi
callq 0x9d20
movl -0x13c(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x9729
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0xe8(%rbp), %rdi
callq 0x2350
nopw (%rax,%rax)