// File: /workspace/github_cpp_makefile_star2_O1/zhengwangsun[P]pas2c/grammar.cpp
// Function: GetFirstGroup(int)
void GetFirstGroup(int num)            //求编号为num的生成式右部第start位置起之后字符串的FIRST集
{
	int i,j,k,m,n,flag=1;
	i=0;
	while(flag==1&&g[num].right[i]!=-1)
	{
		if(g[num].right[i]>=100)       //是终结符 
		{
			flag=0;
			for(j=0;g[num].FIRST[j]!=-1&&j<FIRSTnum&&g[num].FIRST[j]!=g[num].right[i];j++)
				;
			if(g[num].FIRST[j]==-1)    //无重复的将此终结符加入到FIRST集中 
				g[num].FIRST[j]=g[num].right[i];
		}
		else                           //是非终结符 
		{
			int a[20];                 //暂时存放非终结符g[num].right[i]的FIRST集
			for(m=0;m<20;m++)
				a[m]=-1;
			//求 g[num].right[i]的FIRST集
			for(k=0;k<GenerationNum;k++)
			{
				if(g[k].left==g[num].right[i])
				{
					GetFirstGroup(k);
					for(m=0;g[k].FIRST[m]!=-1;m++)
					{
						for(n=0;a[n]!=-1&&n<20&&a[n]!=g[k].FIRST[m];n++)
							;
						if(a[n]==-1)
							a[n]=g[k].FIRST[m];
					}
				}
			}
			for(k=0;a[k]!=-1&&k<20&&a[k]!=106;k++)
				;
			if(a[k]==-1)               //非终结符g[num].right[i]的FIRST集不含ε
			{
				flag=0; 
				//将非终结符g[num].right[i]的FIRST集全部加入ll.
				for(m=0;a[m]!=-1;m++)
				{
					for(n=0;g[num].FIRST[n]!=-1&&g[num].FIRST[n]!=a[m]&&n<FIRSTnum;n++)
						;
					if(g[num].FIRST[n]==-1)
						g[num].FIRST[n]=a[m];
				}
			}
			else                      //非终结符g[num].right[i]的FIRST集含有ε
			{   //将非终结符g[num].right[i]的FIRST集中的非 ε元素加入
				for(m=0;a[m]!=-1;m++)
				{
					if(a[m]!=106)
					{
						for(n=0;g[num].FIRST[n]!=-1&&g[num].FIRST[n]!=a[m]&&n<FIRSTnum;n++)
							;
						if(g[num].FIRST[n]==-1)
							g[num].FIRST[n]=a[m];
					}
				}
				if(g[num].right[i+1]==-1)//非终结符g[num].right[i]是最后一个元素 
				{
					flag=0;              //将 ε加入 
					for(m=0;g[num].FIRST[m]!=-1&&g[num].FIRST[m]!=106&&m<FIRSTnum;m++)
						;
					if(g[num].FIRST[m]==-1) 
						g[num].FIRST[m]=106;
				}
				else
					i++;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movslq %edi, %rax
imulq $0xd0, %rax, %rax
leaq 0xa262a(%rip), %r14     # 0xb48d0
leaq (%r14,%rax), %r15
leaq (%rax,%r14), %r12
addq $0x34, %r12
xorl %r9d, %r9d
movslq %r9d, %rbp
movl 0x8(%r15,%rbp,4), %eax
cmpl $-0x1, %eax
je 0x124d1
cmpl $0x64, %eax
jl 0x122fb
xorl %esi, %esi
movl 0x30(%r15,%rsi,4), %edx
leaq 0x1(%rsi), %rcx
cmpl %eax, %edx
je 0x122e8
cmpq $0x13, %rsi
ja 0x122e8
movq %rcx, %rsi
cmpl $-0x1, %edx
jne 0x122cd
cmpl $-0x1, %edx
jne 0x124a3
movl %eax, 0x2c(%r15,%rcx,4)
jmp 0x124a3
movq %r9, 0x8(%rsp)
pcmpeqd %xmm0, %xmm0
movdqa %xmm0, 0x50(%rsp)
movdqa %xmm0, 0x40(%rsp)
movdqa %xmm0, 0x30(%rsp)
movdqa %xmm0, 0x20(%rsp)
movdqa %xmm0, 0x10(%rsp)
xorl %ebx, %ebx
imulq $0xd0, %rbx, %r13
movl 0x4(%r13,%r14), %eax
cmpl 0x8(%r15,%rbp,4), %eax
jne 0x1237e
addq %r14, %r13
movl %ebx, %edi
callq 0x12287
movl 0x30(%r13), %eax
cmpl $-0x1, %eax
je 0x1237e
xorl %ecx, %ecx
xorl %edi, %edi
movl 0x10(%rsp,%rdi,4), %esi
leaq 0x1(%rdi), %rdx
cmpl %eax, %esi
je 0x12368
cmpq $0x13, %rdi
ja 0x12368
movq %rdx, %rdi
cmpl $-0x1, %esi
jne 0x1234e
cmpl $-0x1, %esi
jne 0x12371
movl %eax, 0xc(%rsp,%rdx,4)
movl 0x34(%r13,%rcx,4), %eax
incq %rcx
cmpl $-0x1, %eax
jne 0x1234c
incq %rbx
cmpq $0x4c, %rbx
jne 0x12324
movl $0x1, %eax
movl 0x10(%rsp), %ecx
movq 0x8(%rsp), %r9
cmpl $-0x1, %ecx
je 0x12421
cmpl $0x6a, %ecx
je 0x123b5
movl 0x10(%rsp,%rax,4), %ecx
incq %rax
cmpq $0x15, %rax
jne 0x12395
cmpl $-0x1, %ecx
je 0x12421
xorl %eax, %eax
movl 0x10(%rsp,%rax,4), %ecx
cmpl $0x6a, %ecx
je 0x123e6
cmpl $-0x1, %ecx
je 0x1240f
movl 0x30(%r15), %edx
cmpl $-0x1, %edx
sete %sil
je 0x123df
cmpl %ecx, %edx
jne 0x123eb
xorl %edx, %edx
testb %sil, %sil
jne 0x123e1
jmp 0x123e6
xorl %edx, %edx
movl %ecx, 0x30(%r15,%rdx,4)
incq %rax
jmp 0x123b7
xorl %edi, %edi
leaq 0x1(%rdi), %rdx
movl (%r12,%rdi,4), %r8d
cmpl $-0x1, %r8d
sete %sil
je 0x123e1
cmpq $0x12, %rdi
ja 0x123d8
movq %rdx, %rdi
cmpl %ecx, %r8d
jne 0x123ed
jmp 0x123d8
cmpl $-0x1, 0xc(%r15,%rbp,4)
je 0x1247f
incl %r9d
movb $0x1, %al
jmp 0x124a5
movl 0x10(%rsp), %eax
cmpl $-0x1, %eax
je 0x124a3
xorl %ecx, %ecx
movl 0x30(%r15), %edx
cmpl $-0x1, %edx
sete %sil
je 0x12446
cmpl %eax, %edx
jne 0x1245b
xorl %edx, %edx
testb %sil, %sil
jne 0x12448
jmp 0x1244d
xorl %edx, %edx
movl %eax, 0x30(%r15,%rdx,4)
movl 0x14(%rsp,%rcx,4), %eax
incq %rcx
cmpl $-0x1, %eax
jne 0x1242c
jmp 0x124a3
xorl %edi, %edi
leaq 0x1(%rdi), %rdx
movl (%r12,%rdi,4), %r8d
cmpl $-0x1, %r8d
sete %sil
je 0x12448
cmpq $0x12, %rdi
ja 0x1243f
movq %rdx, %rdi
cmpl %eax, %r8d
jne 0x1245d
jmp 0x1243f
movl 0x30(%r15), %eax
cmpl $-0x1, %eax
sete %cl
je 0x12498
cmpl $0x6a, %eax
jne 0x124af
xorl %eax, %eax
testb %cl, %cl
jne 0x1249a
jmp 0x124a3
xorl %eax, %eax
movl $0x6a, 0x30(%r15,%rax,4)
xorl %eax, %eax
testb %al, %al
jne 0x122b5
jmp 0x124d1
xorl %edx, %edx
leaq 0x1(%rdx), %rax
movl (%r12,%rdx,4), %esi
cmpl $-0x1, %esi
sete %cl
je 0x1249a
cmpq $0x12, %rdx
ja 0x12492
movq %rax, %rdx
cmpl $0x6a, %esi
jne 0x124b1
jmp 0x12492
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq