// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movl %edi, -0x4(%rbp)
movl $0x1, -0x1c(%rbp)
movl $0x0, -0x8(%rbp)
xorl %eax, %eax
cmpl $0x1, -0x1c(%rbp)
movb %al, -0x71(%rbp)
jne 0x1aa3b
movslq -0x4(%rbp), %rcx
leaq 0xa5f1e(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x8(%rbp), %rcx
cmpl $-0x1, 0x8(%rax,%rcx,4)
setne %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x1aa47
jmp 0x1afe8
movslq -0x4(%rbp), %rcx
leaq 0xa5eee(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x8(%rbp), %rcx
cmpl $0x64, 0x8(%rax,%rcx,4)
jl 0x1ab61
movl $0x0, -0x1c(%rbp)
movl $0x0, -0xc(%rbp)
movslq -0x4(%rbp), %rax
leaq 0xa5ebc(%rip), %rcx     # 0xc0940
imulq $0xd0, %rax, %rax
addq %rax, %rcx
movslq -0xc(%rbp), %rdx
xorl %eax, %eax
cmpl $-0x1, 0x30(%rcx,%rdx,4)
movb %al, -0x72(%rbp)
je 0x1aae9
xorl %eax, %eax
cmpl $0x14, -0xc(%rbp)
movb %al, -0x72(%rbp)
jge 0x1aae9
movslq -0x4(%rbp), %rcx
leaq 0xa5e8c(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
movl 0x30(%rax,%rcx,4), %eax
movslq -0x4(%rbp), %rdx
leaq 0xa5e6f(%rip), %rcx     # 0xc0940
imulq $0xd0, %rdx, %rdx
addq %rdx, %rcx
movslq -0x8(%rbp), %rdx
cmpl 0x8(%rcx,%rdx,4), %eax
setne %al
movb %al, -0x72(%rbp)
movb -0x72(%rbp), %al
testb $0x1, %al
jne 0x1aaf2
jmp 0x1ab02
jmp 0x1aaf4
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1aa79
movslq -0x4(%rbp), %rcx
leaq 0xa5e33(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
cmpl $-0x1, 0x30(%rax,%rcx,4)
jne 0x1ab5c
movslq -0x4(%rbp), %rcx
leaq 0xa5e13(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x8(%rbp), %rcx
movl 0x8(%rax,%rcx,4), %edx
movslq -0x4(%rbp), %rcx
leaq 0xa5df6(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
movl %edx, 0x30(%rax,%rcx,4)
jmp 0x1afe3
movl $0x0, -0x14(%rbp)
cmpl $0x14, -0x14(%rbp)
jge 0x1ab85
movslq -0x14(%rbp), %rax
movl $0xffffffff, -0x70(%rbp,%rax,4) # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1ab68
movl $0x0, -0x10(%rbp)
cmpl $0x4c, -0x10(%rbp)
jge 0x1acb9
movslq -0x10(%rbp), %rcx
leaq 0xa5d9f(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movslq -0x4(%rbp), %rdx
leaq 0xa5d87(%rip), %rcx     # 0xc0940
imulq $0xd0, %rdx, %rdx
addq %rdx, %rcx
movslq -0x8(%rbp), %rdx
cmpl 0x8(%rcx,%rdx,4), %eax
jne 0x1aca9
movl -0x10(%rbp), %edi
callq 0x1a9f0
movl $0x0, -0x14(%rbp)
movslq -0x10(%rbp), %rcx
leaq 0xa5d55(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
cmpl $-0x1, 0x30(%rax,%rcx,4)
je 0x1aca7
movl $0x0, -0x18(%rbp)
movslq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpl $-0x1, -0x70(%rbp,%rcx,4)
movb %al, -0x73(%rbp)
je 0x1ac51
xorl %eax, %eax
cmpl $0x14, -0x18(%rbp)
movb %al, -0x73(%rbp)
jge 0x1ac51
movslq -0x18(%rbp), %rax
movl -0x70(%rbp,%rax,4), %eax
movslq -0x10(%rbp), %rdx
leaq 0xa5d07(%rip), %rcx     # 0xc0940
imulq $0xd0, %rdx, %rdx
addq %rdx, %rcx
movslq -0x14(%rbp), %rdx
cmpl 0x30(%rcx,%rdx,4), %eax
setne %al
movb %al, -0x73(%rbp)
movb -0x73(%rbp), %al
testb $0x1, %al
jne 0x1ac5a
jmp 0x1ac67
jmp 0x1ac5c
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1ac0b
movslq -0x18(%rbp), %rax
cmpl $-0x1, -0x70(%rbp,%rax,4)
jne 0x1ac97
movslq -0x10(%rbp), %rcx
leaq 0xa5cc3(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movl 0x30(%rax,%rcx,4), %ecx
movslq -0x18(%rbp), %rax
movl %ecx, -0x70(%rbp,%rax,4)
jmp 0x1ac99
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1abe0
jmp 0x1aca9
jmp 0x1acab
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1ab8c
movl $0x0, -0x10(%rbp)
movslq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl $-0x1, -0x70(%rbp,%rcx,4)
movb %al, -0x74(%rbp)
je 0x1acea
xorl %eax, %eax
cmpl $0x14, -0x10(%rbp)
movb %al, -0x74(%rbp)
jge 0x1acea
movslq -0x10(%rbp), %rax
cmpl $0x6a, -0x70(%rbp,%rax,4)
setne %al
movb %al, -0x74(%rbp)
movb -0x74(%rbp), %al
testb $0x1, %al
jne 0x1acf3
jmp 0x1ad00
jmp 0x1acf5
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1acc0
movslq -0x10(%rbp), %rax
cmpl $-0x1, -0x70(%rbp,%rax,4)
jne 0x1adfe
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
cmpl $-0x1, -0x70(%rbp,%rax,4)
je 0x1adf9
movl $0x0, -0x18(%rbp)
movslq -0x4(%rbp), %rax
leaq 0xa5c02(%rip), %rcx     # 0xc0940
imulq $0xd0, %rax, %rax
addq %rax, %rcx
movslq -0x18(%rbp), %rdx
xorl %eax, %eax
cmpl $-0x1, 0x30(%rcx,%rdx,4)
movb %al, -0x75(%rbp)
je 0x1ad8e
movslq -0x4(%rbp), %rcx
leaq 0xa5bdd(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movl 0x30(%rax,%rcx,4), %ecx
movslq -0x14(%rbp), %rdx
xorl %eax, %eax
cmpl -0x70(%rbp,%rdx,4), %ecx
movb %al, -0x75(%rbp)
je 0x1ad8e
cmpl $0x14, -0x18(%rbp)
setl %al
movb %al, -0x75(%rbp)
movb -0x75(%rbp), %al
testb $0x1, %al
jne 0x1ad97
jmp 0x1ada4
jmp 0x1ad99
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1ad33
movslq -0x4(%rbp), %rcx
leaq 0xa5b91(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
cmpl $-0x1, 0x30(%rax,%rcx,4)
jne 0x1ade9
movslq -0x14(%rbp), %rax
movl -0x70(%rbp,%rax,4), %edx
movslq -0x4(%rbp), %rcx
leaq 0xa5b69(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movl %edx, 0x30(%rax,%rcx,4)
jmp 0x1adeb
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1ad1d
jmp 0x1afe1
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
cmpl $-0x1, -0x70(%rbp,%rax,4)
je 0x1aef2
movslq -0x14(%rbp), %rax
cmpl $0x6a, -0x70(%rbp,%rax,4)
je 0x1aee2
movl $0x0, -0x18(%rbp)
movslq -0x4(%rbp), %rax
leaq 0xa5b0b(%rip), %rcx     # 0xc0940
imulq $0xd0, %rax, %rax
addq %rax, %rcx
movslq -0x18(%rbp), %rdx
xorl %eax, %eax
cmpl $-0x1, 0x30(%rcx,%rdx,4)
movb %al, -0x76(%rbp)
je 0x1ae85
movslq -0x4(%rbp), %rcx
leaq 0xa5ae6(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movl 0x30(%rax,%rcx,4), %ecx
movslq -0x14(%rbp), %rdx
xorl %eax, %eax
cmpl -0x70(%rbp,%rdx,4), %ecx
movb %al, -0x76(%rbp)
je 0x1ae85
cmpl $0x14, -0x18(%rbp)
setl %al
movb %al, -0x76(%rbp)
movb -0x76(%rbp), %al
testb $0x1, %al
jne 0x1ae8e
jmp 0x1ae9b
jmp 0x1ae90
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1ae2a
movslq -0x4(%rbp), %rcx
leaq 0xa5a9a(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
cmpl $-0x1, 0x30(%rax,%rcx,4)
jne 0x1aee0
movslq -0x14(%rbp), %rax
movl -0x70(%rbp,%rax,4), %edx
movslq -0x4(%rbp), %rcx
leaq 0xa5a72(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movl %edx, 0x30(%rax,%rcx,4)
jmp 0x1aee2
jmp 0x1aee4
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1ae05
movslq -0x4(%rbp), %rcx
leaq 0xa5a43(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpl $-0x1, 0x8(%rax,%rcx,4)
jne 0x1afd6
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x14(%rbp)
movslq -0x4(%rbp), %rax
leaq 0xa5a0c(%rip), %rcx     # 0xc0940
imulq $0xd0, %rax, %rax
addq %rax, %rcx
movslq -0x14(%rbp), %rdx
xorl %eax, %eax
cmpl $-0x1, 0x30(%rcx,%rdx,4)
movb %al, -0x77(%rbp)
je 0x1af7d
movslq -0x4(%rbp), %rax
leaq 0xa59e7(%rip), %rcx     # 0xc0940
imulq $0xd0, %rax, %rax
addq %rax, %rcx
movslq -0x14(%rbp), %rdx
xorl %eax, %eax
cmpl $0x6a, 0x30(%rcx,%rdx,4)
movb %al, -0x77(%rbp)
je 0x1af7d
cmpl $0x14, -0x14(%rbp)
setl %al
movb %al, -0x77(%rbp)
movb -0x77(%rbp), %al
testb $0x1, %al
jne 0x1af86
jmp 0x1af93
jmp 0x1af88
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1af29
movslq -0x4(%rbp), %rcx
leaq 0xa59a2(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
cmpl $-0x1, 0x30(%rax,%rcx,4)
jne 0x1afd4
movslq -0x4(%rbp), %rcx
leaq 0xa5982(%rip), %rax     # 0xc0940
imulq $0xd0, %rcx, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movl $0x6a, 0x30(%rax,%rcx,4)
jmp 0x1afdf
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x1afe1
jmp 0x1afe3
jmp 0x1aa0c
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)