// File: /workspace/github_cpp_makefile_star2_O1/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 0x3a3c
leaq 0x130(%rsp), %rdi
callq 0x2caa
leaq 0x130(%rsp), %rdi
callq 0x4714
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 0x65ac
cmpl $0x1, 0x4(%rsp)
jne 0x27ac
movq 0x7837(%rip), %rdi      # 0x9fd0
leaq 0x48a0(%rip), %rsi      # 0x7040
movl $0x2f, %edx
callq 0x21c0
jmp 0x27c1
movq 0x8(%r14), %rdi
leaq 0x496b(%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 0x2835
movq 0x77e6(%rip), %rcx      # 0x9fe0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %edx
movq 0x77c8(%rip), %rdi      # 0x9fe0
leaq 0x8(%rsp), %rsi
callq 0x22a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x2894
jmp 0x2ad0
leaq 0x7954(%rip), %rdi      # 0xa190
movl $0x186a0, %esi          # imm = 0x186A0
movq 0x28(%rsp), %rdx
callq 0x2210
testq %rax, %rax
je 0x2ad0
movq %rbp, %r12
movq %r13, %rbp
movq %r15, %r13
movq 0x10(%rsp), %r15
leaq 0x7927(%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 0x34e2
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3a46
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x28d0
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbp, %rdi
callq 0x3a60
testb %al, %al
je 0x29ef
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3b38
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x32e6
leaq 0x130(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x4a3a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2921
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x130(%rsp), %rdi
callq 0x4b20
testb %al, %al
je 0x2a52
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
leaq 0x130(%rsp), %rsi
callq 0x4b9a
leaq 0x98(%rsp), %rdi
movq %rbx, %rsi
callq 0x65b2
movl %eax, %ecx
movq 0x7669(%rip), %rax      # 0x9fd0
testb %cl, %cl
jne 0x29b5
movl $0x1a, %edx
movq 0x7659(%rip), %rdi      # 0x9fd0
leaq 0x4728(%rip), %rsi      # 0x70a6
callq 0x21c0
movq 0x7646(%rip), %rcx      # 0x9fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq 0x7628(%rip), %rdi      # 0x9fd0
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x3, %edx
movq %rax, %rdi
leaq 0x46a8(%rip), %rsi      # 0x706c
callq 0x21c0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2ab0
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x2ab0
movl $0x1a, %edx
movq 0x75d5(%rip), %rdi      # 0x9fd0
leaq 0x466e(%rip), %rsi      # 0x7070
callq 0x21c0
movq 0x75c2(%rip), %rcx      # 0x9fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq 0x75a4(%rip), %rdi      # 0x9fd0
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x3, %edx
movq %rax, %rdi
leaq 0x4624(%rip), %rsi      # 0x706c
callq 0x21c0
jmp 0x27ec
movl $0x1a, %edx
movq 0x7572(%rip), %rdi      # 0x9fd0
leaq 0x4626(%rip), %rsi      # 0x708b
callq 0x21c0
movq 0x755f(%rip), %rcx      # 0x9fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq 0x7541(%rip), %rdi      # 0x9fd0
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x3, %edx
movq %rax, %rdi
leaq 0x45c1(%rip), %rsi      # 0x706c
callq 0x21c0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x27ec
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x27ec
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2aec
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x98(%rsp), %rdi
callq 0x337a
leaq 0x278(%rsp), %rdi
callq 0x33ca
leaq 0x228(%rsp), %rdi
callq 0x341a
leaq 0x1d8(%rsp), %rdi
callq 0x3246
leaq 0x1a8(%rsp), %rdi
callq 0x3296
leaq 0x178(%rsp), %rdi
callq 0x3296
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
callq 0x2eb0
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2b63
movq 0x158(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x130(%rsp), %rdi
callq 0x2f0c
leaq 0x100(%rsp), %rbx
movq %rbx, %rdi
callq 0x346a
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2b99
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x2bbe
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 0x2bd4
movq %rax, %rbx
jmp 0x2c7a
movq %rax, %rbx
jmp 0x2c87
jmp 0x2be6
movq %rax, %rbx
jmp 0x2c94
jmp 0x2c3f
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2c42
movq 0x40(%rsp), %rsi
jmp 0x2c1e
jmp 0x2c5b
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2c42
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x2c42
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x2c5e
movq 0x70(%rsp), %rsi
incq %rsi
jmp 0x2c54
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x2c5e
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x2c5e
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq 0x8(%rsp), %rdi
cmpq %rax, %rdi
je 0x2c7a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x98(%rsp), %rdi
callq 0x337a
leaq 0x130(%rsp), %rdi
callq 0x2e06
leaq 0xc8(%rsp), %rdi
callq 0x2e68
movq %rbx, %rdi
callq 0x2270
nop