// File: /workspace/github_c_makefile_star2_O0/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: findfollow
void findfollow(int result[1024], int n, int G[][14]){ //find follow set of a given non-terminal
    int i, j, k, l = 0, m;
    if(n==1){
            result[0] = -1;
            
    }
        
    for(i = 0; i< 94 ; i++){
        for(j = 1; j < size_of(G[i]); j++){

            if(G[i][j]==n){
                for(k = j+1; G[i][k]!=-1; k++){
                        int flag = 0;
                        int subresult[1024] = {0};
                        findfirst(subresult, G[i][k], G);

                        for(m=0; subresult[m]!=0; m++){
                            if(subresult[m] == 109)
                                flag = 1;
                            else
                            if(!presentIn(result, subresult[m])){
                                result[l++] = subresult[m];
                                }

                        }

                        if(flag!=1)
                            break;              
                }

                if(G[i][k]==-1 && G[i][0] != n){

                    int subresult[1024] = {0};
                    findfollow(subresult, G[i][0], G);
                    for(m=0; subresult[m]!=0; m++)
                        if(!presentIn(result, subresult[m])){
                            result[l++] = subresult[m];
                }
                }}}}}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2040, %rsp           # imm = 0x2040
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x28(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x465d
movq -0x8(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x0, -0x1c(%rbp)
cmpl $0x5e, -0x1c(%rbp)
jge 0x489d
movl $0x1, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x2034(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x1c(%rbp), %rax
imulq $0x38, %rax, %rax
addq %rax, %rdi
callq 0x42f0
movl %eax, %ecx
movl -0x2034(%rbp), %eax
cmpl %ecx, %eax
jge 0x488d
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0xc(%rbp), %eax
jne 0x487d
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movslq -0x24(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
je 0x47b3
movl $0x0, -0x30(%rbp)
leaq -0x1030(%rbp), %rdi
xorl %esi, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x20c0
leaq -0x1030(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %esi
movq -0x18(%rbp), %rdx
callq 0x4450
movl $0x0, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
cmpl $0x0, -0x1030(%rbp,%rax,4)
je 0x479b
movslq -0x2c(%rbp), %rax
cmpl $0x6d, -0x1030(%rbp,%rax,4)
jne 0x4753
movl $0x1, -0x30(%rbp)
jmp 0x478e
movq -0x8(%rbp), %rdi
movslq -0x2c(%rbp), %rax
movl -0x1030(%rbp,%rax,4), %esi
callq 0x4330
cmpl $0x0, %eax
jne 0x478c
movslq -0x2c(%rbp), %rax
movl -0x1030(%rbp,%rax,4), %edx
movq -0x8(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x28(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x478e
jmp 0x4790
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x472e
cmpl $0x1, -0x30(%rbp)
je 0x47a3
jmp 0x47b3
jmp 0x47a5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x46ca
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movslq -0x24(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
jne 0x487b
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
je 0x487b
leaq -0x2030(%rbp), %rdi
xorl %esi, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x20c0
leaq -0x2030(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %esi
movq -0x18(%rbp), %rdx
callq 0x4630
movl $0x0, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
cmpl $0x0, -0x2030(%rbp,%rax,4)
je 0x4879
movq -0x8(%rbp), %rdi
movslq -0x2c(%rbp), %rax
movl -0x2030(%rbp,%rax,4), %esi
callq 0x4330
cmpl $0x0, %eax
jne 0x486c
movslq -0x2c(%rbp), %rax
movl -0x2030(%rbp,%rax,4), %edx
movq -0x8(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x28(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x486e
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4825
jmp 0x487b
jmp 0x487d
jmp 0x487f
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4675
jmp 0x488f
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4664
addq $0x2040, %rsp           # imm = 0x2040
popq %rbp
retq
nopw %cs:(%rax,%rax)