// File: /workspace/github_cpp_makefile_star2_O3/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, %rcx
leaq 0xa1ad4(%rip), %r12     # 0xb38d0
movl 0x8(%rcx,%r12), %eax
cmpl $-0x1, %eax
je 0x11f7b
leaq (%r12,%rcx), %r14
leaq (%rcx,%r12), %r15
addq $0x8, %r15
xorl %ecx, %ecx
movq %r15, %rbp
cmpl $0x64, %eax
jge 0x11f8a
movq %rcx, 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,%r12), %eax
cmpl (%rbp), %eax
jne 0x11eb2
addq %r12, %r13
movl %ebx, %edi
callq 0x11ddd
movl 0x30(%r13), %eax
cmpl $-0x1, %eax
je 0x11eb2
xorl %ecx, %ecx
movl 0x10(%rsp), %edx
cmpl $-0x1, %edx
je 0x11e9f
xorl %edi, %edi
cmpl %eax, %edx
je 0x11ea5
leaq 0x1(%rdi), %rsi
movl 0x14(%rsp,%rdi,4), %edx
cmpq $0x12, %rdi
ja 0x11e98
movq %rsi, %rdi
cmpl $-0x1, %edx
jne 0x11e7e
cmpl $-0x1, %edx
jne 0x11ea5
jmp 0x11ea1
xorl %esi, %esi
movl %eax, 0x10(%rsp,%rsi,4)
movl 0x34(%r13,%rcx,4), %eax
incq %rcx
cmpl $-0x1, %eax
jne 0x11e73
incq %rbx
cmpq $0x4c, %rbx
jne 0x11e4d
movl $0x1, %ecx
movl 0x10(%rsp), %eax
movl %eax, %edx
cmpl $-0x1, %edx
je 0x11f44
cmpl $0x6a, %edx
je 0x11ee2
movl 0x10(%rsp,%rcx,4), %edx
incq %rcx
cmpq $0x15, %rcx
jne 0x11ec6
cmpl $-0x1, %edx
je 0x11f44
xorl %ecx, %ecx
cmpl $0x6a, %eax
je 0x11f12
cmpl $-0x1, %eax
je 0x11f1b
movl 0x30(%r14), %esi
xorl %edx, %edx
cmpl $-0x1, %esi
je 0x11f0d
cmpq $0x13, %rdx
ja 0x11f12
cmpl %eax, %esi
je 0x11f12
movl 0x2c(%r15,%rdx,4), %esi
incq %rdx
jmp 0x11ef4
movl %eax, 0x30(%r14,%rdx,4)
movl 0x14(%rsp,%rcx,4), %eax
incq %rcx
jmp 0x11ee4
movq 0x8(%rsp), %rcx
movl %ecx, %eax
cmpl $-0x1, 0x4(%r15,%rax,4)
je 0x11fb7
incl %ecx
movl %ecx, %eax
leaq (%r15,%rax,4), %rbp
movl (%rbp), %eax
cmpl $-0x1, %eax
jne 0x11e1b
jmp 0x11f7b
cmpl $-0x1, %eax
je 0x11f7b
xorl %ecx, %ecx
movl 0x30(%r14), %esi
xorl %edx, %edx
cmpl $-0x1, %esi
je 0x11f6a
cmpq $0x13, %rdx
ja 0x11f6f
cmpl %eax, %esi
je 0x11f6f
movl 0x2c(%r15,%rdx,4), %esi
incq %rdx
jmp 0x11f51
movl %eax, 0x30(%r14,%rdx,4)
movl 0x14(%rsp,%rcx,4), %eax
incq %rcx
cmpl $-0x1, %eax
jne 0x11f4b
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x30(%r14), %ecx
cmpl $-0x1, %ecx
je 0x11fe2
xorl %esi, %esi
cmpl %eax, %ecx
je 0x11f7b
leaq 0x1(%rsi), %rdx
movl 0x2c(%r15,%rsi,4), %ecx
cmpq $0x12, %rsi
ja 0x11fb0
movq %rdx, %rsi
cmpl $-0x1, %ecx
jne 0x11f95
cmpl $-0x1, %ecx
jne 0x11f7b
jmp 0x11fe4
movl 0x30(%r14), %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
je 0x11fd7
cmpq $0x13, %rax
ja 0x11f7b
cmpl $0x6a, %ecx
je 0x11f7b
movl 0x2c(%r15,%rax,4), %ecx
incq %rax
jmp 0x11fbd
movl $0x6a, 0x30(%r14,%rax,4)
jmp 0x11f7b
xorl %edx, %edx
movl %eax, 0x30(%r14,%rdx,4)
jmp 0x11f7b