// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1048, %rsp           # imm = 0x1048
movq %rdx, -0x38(%rbp)
movq %rdi, %r15
movl %esi, -0x2c(%rbp)
cmpl $0x1, %esi
jne 0x3313
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
leaq 0x4(%r15), %rax
movq %rax, -0x58(%rbp)
xorl %eax, %eax
movl $0x1, %ebx
movabsq $0x100000000, %r9       # imm = 0x100000000
xorl %r12d, %r12d
imulq $0x38, %rax, %r10
addq -0x38(%rbp), %r10
movl $0x1, %r11d
movq %r10, -0x40(%rbp)
movq %rax, -0x60(%rbp)
cmpl $-0x1, (%r10)
je 0x336f
movq -0x50(%rbp), %rcx
xorl %eax, %eax
addq %r9, %rax
cmpl $-0x1, (%rcx)
leaq 0x4(%rcx), %rcx
jne 0x335d
sarq $0x20, %rax
jmp 0x3371
xorl %eax, %eax
cmpq %rax, %r11
jge 0x34f8
movl -0x2c(%rbp), %eax
cmpl %eax, (%r10,%r11,4)
jne 0x34f0
movq %r11, %rax
movq %r11, -0x48(%rbp)
movl 0x4(%r10,%rax,4), %r13d
cmpl $-0x1, %r13d
movq %rax, -0x68(%rbp)
je 0x343c
incq %rax
movq %rax, -0x70(%rbp)
xorl %r14d, %r14d
movl $0x1000, %edx           # imm = 0x1000
leaq -0x1070(%rbp), %rdi
xorl %esi, %esi
callq 0x20f0
leaq -0x1070(%rbp), %rdi
movl %r13d, %esi
movq -0x38(%rbp), %rdx
callq 0x3148
movq -0x58(%rbp), %r8
xorl %eax, %eax
movl -0x1070(%rbp,%r14,4), %ecx
cmpl $0x6d, %ecx
je 0x3413
testl %ecx, %ecx
je 0x341d
movl (%r15), %edx
testl %edx, %edx
je 0x3407
xorl %esi, %esi
movq %r8, %rdi
cmpl %ecx, %edx
cmovel %ebx, %esi
movl (%rdi), %edx
addq $0x4, %rdi
testl %edx, %edx
jne 0x33f4
testl %esi, %esi
jne 0x3418
movslq %r12d, %rdx
incl %r12d
movl %ecx, (%r15,%rdx,4)
jmp 0x3418
movl $0x1, %eax
incq %r14
jmp 0x33d7
cmpl $0x1, %eax
movabsq $0x100000000, %r9       # imm = 0x100000000
movq -0x40(%rbp), %r10
movq -0x48(%rbp), %r11
movq -0x70(%rbp), %rax
je 0x338e
movq -0x68(%rbp), %rax
leaq (%r10,%rax,4), %rax
addq $0x4, %rax
cmpl $-0x1, (%rax)
jne 0x34f0
movl (%r10), %r13d
cmpl -0x2c(%rbp), %r13d
je 0x34f0
movl $0x1000, %edx           # imm = 0x1000
leaq -0x1070(%rbp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x20f0
movq %r14, %rdi
movl %r13d, %esi
movq -0x38(%rbp), %rdx
callq 0x32e9
movl -0x1070(%rbp), %ecx
testl %ecx, %ecx
je 0x34de
xorl %eax, %eax
movq -0x58(%rbp), %r8
movabsq $0x100000000, %r9       # imm = 0x100000000
movq -0x40(%rbp), %r10
movq -0x48(%rbp), %r11
movl (%r15), %edx
testl %edx, %edx
je 0x34c4
xorl %esi, %esi
movq %r8, %rdi
cmpl %ecx, %edx
cmovel %ebx, %esi
movl (%rdi), %edx
addq $0x4, %rdi
testl %edx, %edx
jne 0x34b1
testl %esi, %esi
jne 0x34ce
movslq %r12d, %rdx
incl %r12d
movl %ecx, (%r15,%rdx,4)
movl -0x106c(%rbp,%rax,4), %ecx
incq %rax
testl %ecx, %ecx
jne 0x34a5
jmp 0x34f0
movabsq $0x100000000, %r9       # imm = 0x100000000
movq -0x40(%rbp), %r10
movq -0x48(%rbp), %r11
incq %r11
jmp 0x3351
movq -0x60(%rbp), %rax
incq %rax
addq $0x38, -0x50(%rbp)
cmpq $0x5e, %rax
jne 0x333b
addq $0x1048, %rsp           # imm = 0x1048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq