// File: /workspace/github_cpp_makefile_star2_O3/Caproner[P]Naive_Compiler/main.cpp
// Function: main
int main(int argc,char *argv[])
{
	Lexical L;
	L.init();
	
	Grammar G;
	G.init();
	
	Semantic S;
	S.init();
	
	FILE *Input;
	if(argc!=1)Input=fopen(argv[1],"r");
	else cout<<"[Naive by Caproner]\nWelcome to use Naive_C!\n > ";
	
	string s;
	while(true)
	{
		if(argc==1)
		{
			if(!getline(cin,s))break;
		}
		else
		{
			if(fgets(Read,100000,Input)==NULL)break;
			s=Read;
		}
		L.Input(s);
		if(!L.Analysis())
		{
			cout<<"Error：词法分析出错"<<endl<<" > ";
			continue;
		}
		
		Word_List WL=L.Output();
		#ifdef TEST
		for(int i=0;i<WL.List.size();i++)
		{
			cout<<"["<<WL.List[i].Number<<","<<WL.List[i].Value<<"]"<<endl;
		}
		cout<<"词法分析结束"<<endl;
		#endif
		
		G.Input(WL);
		if(!G.Analysis())
		{
			cout<<"Error：语法分析出错"<<endl<<" > ";
			continue;
		}
		
		Forest F=G.Output();
		#ifdef TEST
		for(int i=0;i<F.forest.size();i++)
		{
			cout<<"输出第"<<i+1<<"棵语法树"<<endl;
			print(F.forest[i]);
		}
		cout<<"语法分析结束"<<endl;
		#endif
		
		if(!S.Analysis(F))
		{
			cout<<"Error：语义分析出错"<<endl<<" > ";
			continue; 
		}
		
		#ifdef TEST
		for(int i=0;i<F.forest.size();i++)
		{
			cout<<"输出第"<<i+1<<"棵语法树"<<endl;
			print(F.forest[i]);
		}
		cout<<"语义分析结束"<<endl;
		#endif
		cout<<" > ";
	}
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rsi, %r14
movl %edi, 0x4(%rsp)
leaq 0xd8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x108(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0xc8(%rsp), %rdi
callq 0x3aa2
leaq 0x130(%rsp), %rdi
callq 0x2cca
leaq 0x130(%rsp), %rdi
callq 0x46be
leaq 0xa0(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x98(%rsp), %rdi
callq 0x643a
cmpl $0x1, 0x4(%rsp)
jne 0x27cc
movq 0x7817(%rip), %rdi      # 0x9fd0
leaq 0x4880(%rip), %rsi      # 0x7040
movl $0x2f, %edx
callq 0x21c0
jmp 0x27e1
movq 0x8(%r14), %rdi
leaq 0x494b(%rip), %rsi      # 0x7122
callq 0x21d0
movq %rax, 0x28(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x70(%rsp), %r15
leaq 0x60(%rsp), %r13
leaq 0xc8(%rsp), %rbp
leaq 0x48(%rsp), %r12
cmpl $0x1, 0x4(%rsp)
jne 0x2855
movq 0x77c6(%rip), %rcx      # 0x9fe0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %edx
movq 0x77a8(%rip), %rdi      # 0x9fe0
leaq 0x8(%rsp), %rsi
callq 0x22a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x28b4
jmp 0x2af0
leaq 0x7934(%rip), %rdi      # 0xa190
movl $0x186a0, %esi          # imm = 0x186A0
movq 0x28(%rsp), %rdx
callq 0x2210
testq %rax, %rax
je 0x2af0
movq %rbp, %r12
movq %r13, %rbp
movq %r15, %r13
movq 0x10(%rsp), %r15
leaq 0x7907(%rip), %r14      # 0xa190
movq %r14, %rdi
callq 0x20b0
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r13, %r15
movq %rbp, %r13
movq %r12, %rbp
leaq 0x48(%rsp), %r12
movq %r14, %rcx
movq %rax, %r8
callq 0x2200
movq %r15, 0x60(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x351a
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3aac
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x28f0
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbp, %rdi
callq 0x3ac6
testb %al, %al
je 0x2a0f
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3b8a
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x3316
leaq 0x130(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x49e4
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2941
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x130(%rsp), %rdi
callq 0x4ad0
testb %al, %al
je 0x2a72
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
leaq 0x130(%rsp), %rsi
callq 0x4b2c
leaq 0x98(%rsp), %rdi
movq %rbx, %rsi
callq 0x6440
movl %eax, %ecx
movq 0x7649(%rip), %rax      # 0x9fd0
testb %cl, %cl
jne 0x29d5
movl $0x1a, %edx
movq 0x7639(%rip), %rdi      # 0x9fd0
leaq 0x4708(%rip), %rsi      # 0x70a6
callq 0x21c0
movq 0x7626(%rip), %rcx      # 0x9fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq 0x7608(%rip), %rdi      # 0x9fd0
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x3, %edx
movq %rax, %rdi
leaq 0x4688(%rip), %rsi      # 0x706c
callq 0x21c0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2ad0
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x2ad0
movl $0x1a, %edx
movq 0x75b5(%rip), %rdi      # 0x9fd0
leaq 0x464e(%rip), %rsi      # 0x7070
callq 0x21c0
movq 0x75a2(%rip), %rcx      # 0x9fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq 0x7584(%rip), %rdi      # 0x9fd0
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x3, %edx
movq %rax, %rdi
leaq 0x4604(%rip), %rsi      # 0x706c
callq 0x21c0
jmp 0x280c
movl $0x1a, %edx
movq 0x7552(%rip), %rdi      # 0x9fd0
leaq 0x4606(%rip), %rsi      # 0x708b
callq 0x21c0
movq 0x753f(%rip), %rcx      # 0x9fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq 0x7521(%rip), %rdi      # 0x9fd0
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x3, %edx
movq %rax, %rdi
leaq 0x45a1(%rip), %rsi      # 0x706c
callq 0x21c0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x280c
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x280c
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2b0c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x98(%rsp), %rdi
callq 0x33aa
leaq 0x278(%rsp), %rdi
callq 0x33fa
leaq 0x228(%rsp), %rdi
callq 0x344a
leaq 0x1d8(%rsp), %rdi
callq 0x326e
leaq 0x1a8(%rsp), %rdi
callq 0x32c6
leaq 0x178(%rsp), %rdi
callq 0x32c6
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
callq 0x2ed0
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2b83
movq 0x158(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x130(%rsp), %rdi
callq 0x2f2e
leaq 0x100(%rsp), %rbx
movq %rbx, %rdi
callq 0x34a2
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2bb9
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x2bde
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21a0
xorl %eax, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2bf4
movq %rax, %rbx
jmp 0x2c9a
movq %rax, %rbx
jmp 0x2ca7
jmp 0x2c06
movq %rax, %rbx
jmp 0x2cb4
jmp 0x2c5f
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2c62
movq 0x40(%rsp), %rsi
jmp 0x2c3e
jmp 0x2c7b
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2c62
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x2c62
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x2c7e
movq 0x70(%rsp), %rsi
incq %rsi
jmp 0x2c74
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x2c7e
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x2c7e
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq 0x8(%rsp), %rdi
cmpq %rax, %rdi
je 0x2c9a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x98(%rsp), %rdi
callq 0x33aa
leaq 0x130(%rsp), %rdi
callq 0x2e26
leaq 0xc8(%rsp), %rdi
callq 0x2e88
movq %rbx, %rdi
callq 0x2270
nop