LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/trumabrat[P]GrandProjet/Struct_File.c
// Function: enfile
void enfile(S_file * f, int donnee){
 Cellule_file *nouv=(Cellule_file *) malloc(sizeof(Cellule_file));
  nouv->val=donnee;
  nouv->suiv=NULL;
  if (f->tete==NULL)
    f->tete=nouv;
  else
    f->dernier->suiv=nouv;
  f->dernier=nouv;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x10f0
movl %ebp, (%rax)
andq $0x0, 0x8(%rax)
cmpq $0x0, (%rbx)
movq %rbx, %rcx
je 0x2ee9
movq 0x8(%rbx), %rcx
addq $0x8, %rcx
movq %rax, (%rcx)
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/trumabrat[P]GrandProjet/Struct_File.c
// Function: defile
int defile(S_file *f){
  int v=f->tete->val;
  Cellule_file *temp=f->tete;
  if (f->tete==f->dernier)
    f->dernier=NULL;
  f->tete=f->tete->suiv;
  free(temp);
  return v;

}

// Assembly:
pushq %rbx
movq %rdi, %rax
movq (%rdi), %rdi
movl (%rdi), %ebx
cmpq 0x8(%rax), %rdi
jne 0x2f0b
andq $0x0, 0x8(%rax)
movq 0x8(%rdi), %rcx
movq %rcx, (%rax)
callq 0x1030
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/trumabrat[P]GrandProjet/Struct_Liste.c
// Function: ajoute_en_tete
void ajoute_en_tete(ListeEntier* L, int u){
  Cell_entier *nouvsom=(Cell_entier*) malloc(sizeof(Cell_entier));
  nouvsom->u=u;
  nouvsom->suiv=*L;
  *L=nouvsom;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
pushq $0x10
popq %rdi
callq 0x10f0
movl %ebx, (%rax)
movq (%r14), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/trumabrat[P]GrandProjet/Struct_Liste.c
// Function: desalloue
void desalloue(ListeEntier *L){
  Cell_entier *cour,*prec;
  cour=*L;
  while(cour!=NULL){
    prec=cour;
    cour=cour->suiv;
    free(prec);
  }
  *L=NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x2f89
movq 0x8(%rdi), %r14
callq 0x1030
movq %r14, %rdi
jmp 0x2f76
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/trumabrat[P]GrandProjet/Struct_Liste.c
// Function: afficher_liste_entier
void afficher_liste_entier(ListeEntier* L){
  if(!L) printf("L est null!\n");
  ListeEntier tmp = *L;
  printf("[");
  while(tmp){
    printf("%d, ", tmp->u);
    tmp = tmp->suiv;
  }
  printf("]\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x2fad
leaq 0x4e4(%rip), %rdi       # 0x348c
callq 0x1070
movq (%rbx), %r14
pushq $0x5b
popq %rdi
callq 0x1040
leaq 0x4c8(%rip), %rbx       # 0x3487
testq %r14, %r14
je 0x2fd7
movl (%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10a0
movq 0x8(%r14), %r14
jmp 0x2fbf
leaq 0x4ba(%rip), %rdi       # 0x3498
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./lexer.c
// Function: createnode
node* createnode(){         //creating a lexer node
    node* mynode = (node*)malloc(sizeof(node));
    mynode->tk = (tokenInfo*)malloc(sizeof(tokenInfo));
    return mynode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
pushq $0x8
popq %rdi
callq 0x2150
movq %rax, %rbx
pushq $0x40
popq %rdi
callq 0x2150
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./lexer.c
// Function: flush
void flush(char* str){     //flush buffer
   int i;
    for(i = 0; i < 30; i++)
        str[i] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
cmpq $0x1e, %rax
je 0x2349
movb $0x0, (%rdi,%rax)
incq %rax
jmp 0x233a
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./lexer.c
// Function: buffer_flush
void buffer_flush(char* str){     //flush buffer
   int i;
    for(i = 0; i < 4000; i++)
        str[i] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
cmpq $0xfa0, %rax            # imm = 0xFA0
je 0x2362
movb $0x0, (%rdi,%rax)
incq %rax
jmp 0x2351
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./lexer.c
// Function: Keyword_checker
char* Keyword_checker(char val[]){ //check for keywords
    char *s;
    s = (char *) malloc(sizeof(char)*30);
    int i;
    for(i=0;i<30;i++){
        if(strcmp(val,keyword_dict[i])==0){
            strcpy(s,token_key[i]);
            return s;
        }
    }
    char cp[6] = "SORRY";
    strcpy(s,cp);
    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
pushq $0x1e
popq %rdi
callq 0x2150
movq %rax, %rbx
xorl %r15d, %r15d
leaq 0x9d89(%rip), %r12      # 0xc110
cmpq $0xf0, %r15
je 0x23c0
movq (%r15,%r12), %rsi
movq %r14, %rdi
callq 0x2120
addq $0x8, %r15
testl %eax, %eax
jne 0x2387
leaq 0x9e55(%rip), %rax      # 0xc200
movq -0x8(%r15,%rax), %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2060
movw $0x59, 0x4(%rbx)
movl $0x52524f53, (%rbx)     # imm = 0x52524F53
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./lexer.c
// Function: remove_comments
int remove_comments(char *B,int forward){   //remove comments from a char array

    while(!((B[forward] == '*') && (B[forward+1] == '*'))){
        forward++;
        if(B[forward] == '\n'){
            lineno++;
        }
    }
    return forward;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x9efa(%rip), %ecx      # 0xc2f0
movslq %esi, %rax
movb (%rdi,%rax), %dl
cmpb $0x2a, %dl
jne 0x2408
cmpb $0x2a, 0x1(%rdi,%rax)
je 0x241e
movb 0x1(%rdi,%rax), %dl
incq %rax
cmpb $0xa, %dl
jne 0x23fc
incl %ecx
movl %ecx, 0x9ed4(%rip)      # 0xc2f0
jmp 0x23fc
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./lexer.c
// Function: reloadBuff
FILE* reloadBuff(){    //reload the buffer
    fseek( fp1, 0, SEEK_CUR);
    fp1 = getstream(fp1);
    B[3998] = '~';
    return fp1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x164ad(%rip), %rdi     # 0x188d8
pushq $0x1
popq %rdx
xorl %esi, %esi
callq 0x2170
movq 0x1649c(%rip), %rdi     # 0x188d8
callq 0x2451
movq %rax, 0x16490(%rip)     # 0x188d8
movb $0x7e, 0x1742f(%rip)    # 0x1987e
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./lexer.c
// Function: getstream
FILE* getstream(FILE *fp){  //the input stream method, reads bufflen data into buffer B and returns file with advanced pointer 
	int i;
    int bufflen = 4000;
    buffer_flush(B);
	if(fp == NULL){
		printf("Invalid File name..\n");
		exit(0);
	}
	//flushing the buffer
    for(i = 0; i < bufflen; i++)
        B[i] = '\0';

	if(fread(B,(size_t)bufflen,1,fp)){
        return fp;
	}
	//printf("(%s)\n",B);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x1647e(%rip), %r14     # 0x188e0
movq %r14, %rdi
callq 0x234b
testq %rbx, %rbx
je 0x24a6
xorl %eax, %eax
cmpq $0xfa0, %rax            # imm = 0xFA0
je 0x2483
movb $0x0, (%rax,%r14)
incq %rax
jmp 0x2471
leaq 0x16456(%rip), %rdi     # 0x188e0
pushq $0x1
popq %rdx
movl $0xfa0, %esi            # imm = 0xFA0
movq %rbx, %rcx
callq 0x2080
testq %rax, %rax
cmovneq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x7360(%rip), %rdi      # 0x980d
callq 0x2070
xorl %edi, %edi
callq 0x21d0
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./lexer.c
// Function: removeComments
void removeComments(char *testcaseFile){ //used to remove comments from testcasefile and print clean code in cleanfile

    FILE *f1 = fopen(testcaseFile, "r+");
    if(f1==NULL){
        printf("ERROR OPENING FILE\n");
        return;
    }
    //FILE *f2 = fopen(cleanFile, "w+");
    
    char c;

    while(!feof(f1)){

        c = fgetc(f1);
        if(c=='$')
            break;

        if(c=='*'){
            if(c = fgetc(f1)== '*'){

                while(!((c = fgetc(f1) == '*') && (c = fgetc(f1)== '*')))
                    continue;
                c = fgetc(f1);
                
            }}
 
        fputc(c, stdout);

        }

fclose(f1);
//fclose(f2);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x5ed8(%rip), %rsi      # 0x839f
callq 0x2180
testq %rax, %rax
je 0x2549
movq %rax, %rbx
movq 0x9b05(%rip), %r14      # 0xbfe0
movq %rbx, %rdi
callq 0x2140
testl %eax, %eax
jne 0x253d
movq %rbx, %rdi
callq 0x2100
cmpb $0x2a, %al
je 0x24fd
movzbl %al, %ecx
cmpl $0x24, %ecx
jne 0x2530
jmp 0x253d
movq %rbx, %rdi
callq 0x2100
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x2a, %ecx
jne 0x2530
movq %rbx, %rdi
callq 0x2100
cmpl $0x2a, %eax
jne 0x250e
movq %rbx, %rdi
callq 0x2100
cmpl $0x2a, %eax
jne 0x250e
movq %rbx, %rdi
callq 0x2100
movsbl %al, %edi
movq (%r14), %rsi
callq 0x2110
jmp 0x24db
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2090
leaq 0x72d1(%rip), %rdi      # 0x9821
popq %rbx
popq %r14
popq %rbp
jmp 0x2070
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: presentIn
int presentIn(int *a, int b){

    int i = 0, flag = 0;
    for(i = 0; a[i]!=0; i++){
        if(a[i]==b)
            flag = 1;
    }
    return flag;            //if b is in array a

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
movl $0x1, %ecx
movl (%rdi), %edx
testl %edx, %edx
je 0x2f99
cmpl %esi, %edx
cmovel %ecx, %eax
addq $0x4, %rdi
jmp 0x2f88
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: find_location
int find_location(char *token){
    int j;
    for(j=0;j<TERMS;j++){
        if(strcmp(terms[j],token)==0){
            return j;
        }
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
leaq 0x8ad0(%rip), %r12      # 0xba80
xorl %r15d, %r15d
pushq $-0x1
popq %rbx
cmpq $0x6e, %r15
je 0x2fd8
movq (%r12), %rdi
movq %r14, %rsi
callq 0x2120
testl %eax, %eax
je 0x2fd5
incq %r15
addq $0x8, %r12
jmp 0x2fb6
movl %r15d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: epsInFirst
int epsInFirst(int alpha, int first[][11]){         //if epsilon is part of first set
    int i = 0;
    for(i=0; i < 11; i++){
        if(first[alpha][i] == EPLS)
            return 1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq %edi, %rax
imulq $0x2c, %rax, %rcx
addq %rsi, %rcx
xorl %eax, %eax
movl $0x1, %edx
xorl %esi, %esi
cmpq $0xb, %rsi
je 0x300c
cmpl $0x6d, (%rcx,%rsi,4)
leaq 0x1(%rsi), %rsi
jne 0x2ffa
movl %edx, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: findfirst
void findfirst(int result[150], int n, int G[][14]){  //find first set of a given non-terminal
int i, k, j = 0, l;

if(n > 51)
    result[0] = n;

else{

for(i = 0; i < 94; i++)
    if(G[i][0] == n){

        
        if (G[i][1] > 51)
            {if(!presentIn(result, G[i][1])){
                    result[j++] = G[i][1];
                }}

        else{
        for(k = 1; k < size_of(G[i]); k++){
            int flag = 0;
            int subresult[150] = {0};

            findfirst(subresult, G[i][k], G);

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



        }
            }


    }}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rdi, %r15
cmpl $0x33, %esi
jle 0x303f
movl %esi, (%r15)
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, -0x34(%rbp)
xorl %r14d, %r14d
xorl %r12d, %r12d
movq %rdx, -0x30(%rbp)
cmpq $0x5e, %r14
je 0x302d
imulq $0x38, %r14, %r13
movl -0x34(%rbp), %eax
cmpl %eax, (%rdx,%r13)
jne 0x3139
addq %rdx, %r13
movl 0x4(%r13), %ebx
cmpl $0x33, %ebx
jle 0x3092
movq %rdx, %r13
movq %r15, %rdi
movl %ebx, %esi
callq 0x2f7d
testl %eax, %eax
jne 0x308a
movslq %r12d, %rax
incl %r12d
movl %ebx, (%r15,%rax,4)
movq %r13, %rdx
jmp 0x3139
pushq $0x1
popq %rbx
movq %r14, -0x50(%rbp)
movq %r13, -0x48(%rbp)
movq %r13, %rdi
callq 0x2f67
cltq
cmpq %rax, %rbx
jge 0x3135
xorl %r14d, %r14d
movl $0x258, %edx            # imm = 0x258
movq %rbx, -0x40(%rbp)
leaq -0x2b0(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20f0
movq -0x40(%rbp), %rax
movl (%r13,%rax,4), %esi
movq %rbx, %rdi
movq -0x30(%rbp), %rdx
callq 0x300e
movq %rbx, %r13
movl (%r13), %ebx
cmpl $0x6d, %ebx
je 0x310c
testl %ebx, %ebx
je 0x3116
movq %r15, %rdi
movl %ebx, %esi
callq 0x2f7d
testl %eax, %eax
jne 0x3110
movslq %r12d, %rax
incl %r12d
movl %ebx, (%r15,%rax,4)
jmp 0x3110
pushq $0x1
popq %r14
addq $0x4, %r13
jmp 0x30e5
movq -0x40(%rbp), %rbx
incq %rbx
cmpl $0x1, %r14d
movq -0x30(%rbp), %rdx
movq -0x50(%rbp), %r14
movq -0x48(%rbp), %r13
je 0x309d
jmp 0x3139
movq -0x30(%rbp), %rdx
incq %r14
jmp 0x304c
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: Initialise_table
void Initialise_table(int table[][TERMINALS]){ //initialise the parse table with -1's
    int i;
    int j;
    for(i=0;i<NON_TERMINALS;i++){
        for(j=0;j<TERMINALS;j++){
            table[i][j] = -1;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
cmpq $0x33, %rax
je 0x32f5
xorl %ecx, %ecx
cmpq $0x3a, %rcx
je 0x32e9
orl $-0x1, (%rdi,%rcx,4)
incq %rcx
jmp 0x32da
incq %rax
addq $0xe8, %rdi
jmp 0x32d2
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: search
parsetree search(parsetree root, int a){       //search a node with value a in parsetree with root as its root 
    parsetree temp;

    if(root == NULL)
        return NULL;
    else if((root->value == a) && !root->isVisited){
        return root;
    }
    else if((temp=search(root->child, a))!=NULL)
        return temp;
    else if ((temp = search(root->right, a))!=NULL)
        return temp;
    else
        return NULL;
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
testq %rbx, %rbx
je 0x332c
cmpl %r14d, 0x8(%rbx)
jne 0x3315
cmpl $0x0, 0x3c(%rbx)
je 0x3333
movq 0x18(%rbx), %rdi
movl %r14d, %esi
callq 0x32f7
testq %rax, %rax
jne 0x3330
movq 0x28(%rbx), %rbx
jmp 0x3304
xorl %ebx, %ebx
jmp 0x3333
movq %rax, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: insert
void insert(parsetree x, int rule, int G[][14], node* Lex){ //to insert a node in the parsetree

    int *r = G[rule-1];
    int i = 1;
    parsetree temp, temp2, right, left;

    x->isVisited = 1;
    x->rule = rule;

    while(r[i]!=-1){
        int j;
        temp = (parsetree) malloc(sizeof (struct Parse_Tree));
        temp->Lex = createnode();
        temp->Lex->tk->line = Lex->tk->line;
        temp->generated = 0;
        //temp->Lex = (node *) malloc sizeof(node);
        //temp->Lex->tk = (tokenInfo *) malloc sizeof (tokenInfo);
        temp->value =  r[i];
        
        if(r[i] > NON_TERMINALS)
        {
            temp->isleaf = 1;
            //temp->Lex = getNextToken();
        }
        else
            {
                //temp->Lex = NULL;
                temp->isleaf = 0;
            }
        temp->left = NULL;
        temp->right = NULL;
        temp->child = NULL;
        temp->parent = x;
        //temp->Lex = Lex;
        temp->isVisited = 0;

        if(x->child==NULL)
            x->child = temp;
        else                            //if x has children already
        {
            temp2 = x->child;
            while(temp2->right!=NULL)
            {
                right = temp2->right;
                temp2 = right;

            }

            temp2->right = temp;
            temp->left = temp2;
             
        }


        i++;
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdi, %r14
movslq %esi, %rax
imulq $0x38, %rax, %r13
addq %rdx, %r13
movl $0x1, 0x3c(%rdi)
movl %eax, 0xc(%rdi)
pushq $0x1
popq %r15
cmpl $-0x1, -0x38(%r13,%r15,4)
je 0x33ff
pushq $0x40
popq %rdi
callq 0x2150
movq %rax, %r12
callq 0x22fc
movq %rax, (%r12)
movq (%rbx), %rcx
movl 0x3c(%rcx), %ecx
movq (%rax), %rax
movl %ecx, 0x3c(%rax)
andl $0x0, 0x10(%r12)
movl -0x38(%r13,%r15,4), %eax
movl %eax, 0x8(%r12)
xorl %ecx, %ecx
cmpl $0x34, %eax
setge %cl
movl %ecx, 0x38(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r12)
andq $0x0, 0x28(%r12)
movq %r14, 0x30(%r12)
andl $0x0, 0x3c(%r12)
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x33f3
movq %rax, %rcx
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0x33dc
movq %r12, 0x28(%rcx)
movq %rcx, 0x20(%r12)
jmp 0x33f7
movq %r12, 0x18(%r14)
incq %r15
jmp 0x3370
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: initialise_stack
void initialise_stack(){    //initialise stack with -1's
    int j;
    for(j=0;j<STACK_SIZE;j++){
        stack[j] = -1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
leaq 0x16262(%rip), %rcx     # 0x19890
cmpq $0xc8, %rax
je 0x3640
orl $-0x1, (%rax,%rcx)
addq $0x4, %rax
jmp 0x362e
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: pop
int pop(){                  //pop functionality for stack
    int temp = stack[top];
    stack[top] = -1;
    top--;
    return temp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0xb613(%rip), %rcx      # 0xec60
leaq 0x1623c(%rip), %rdx     # 0x19890
movl (%rdx,%rcx,4), %eax
orl $-0x1, (%rdx,%rcx,4)
decl %ecx
movl %ecx, 0xb5fd(%rip)      # 0xec60
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: printstack
void printstack(){          //print all elements of the stack
    int i;
    for(i=0;i<STACK_SIZE;i++){
        if(stack[i] == -1){
            break;
        }
        printf("%s ",terms[stack[i]]);
    }
    printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x16219(%rip), %r14     # 0x19890
leaq 0x8402(%rip), %r15      # 0xba80
leaq 0x4ec6(%rip), %rbx      # 0x854b
xorl %r12d, %r12d
cmpq $0xc8, %r12
je 0x36af
movslq (%r12,%r14), %rax
cmpq $-0x1, %rax
je 0x36af
movq (%r15,%rax,8), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20b0
addq $0x4, %r12
jmp 0x3688
pushq $0xa
popq %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: Print_parsing_table
void Print_parsing_table(int table[][TERMINALS]){ //to print the parsing table
    int i;
    int j;
    for(i=0;i<NON_TERMINALS;i++){
        for(j=0;j<TERMINALS;j++){
            if(table[i][j] == -1){
                printf("_ ");
            }else{
                printf("%d ",table[i][j]);
            }
        }
        printf("\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4e78(%rip), %r15      # 0x854f
leaq 0x4e74(%rip), %r12      # 0x8552
xorl %r13d, %r13d
cmpq $0x33, %r13
je 0x3728
xorl %r14d, %r14d
cmpq $0x3a, %r14
je 0x3714
movl (%rbx,%r14,4), %esi
cmpl $-0x1, %esi
je 0x3705
movq %r12, %rdi
xorl %eax, %eax
callq 0x20b0
jmp 0x370f
movq %r15, %rdi
xorl %eax, %eax
callq 0x20b0
incq %r14
jmp 0x36ea
pushq $0xa
popq %rdi
callq 0x2040
incq %r13
addq $0xe8, %rbx
jmp 0x36e1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: pullup
parsetree pullup(parsetree head){
    if(head->left==NULL){
        head->child->right = head->right;
        if(head->right!=NULL)
            head->right->left = head->child;
        head->parent->child = head->child;
        head->child->parent = head->parent;
        parsetree temp = head->child;
        free(head);
        return temp;

    }
    else
    {
        head->left->right = head->child;
        head->child->left = head->left;
        head->child->right = head->right;
        if(head->right!=NULL)
            head->right->left = head->child;
        head->child->parent = head->parent;
        parsetree temp = head->child;
        free(head);
        return temp;
    }
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x37e6
movq 0x18(%rdi), %rbx
movq %rbx, 0x28(%rax)
movq %rax, 0x20(%rbx)
movq 0x28(%rdi), %rax
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x37e0
movq %rbx, 0x20(%rax)
movq 0x30(%rdi), %rax
jmp 0x3807
movq 0x18(%rdi), %rcx
movq 0x28(%rdi), %rax
movq %rax, 0x28(%rcx)
testq %rax, %rax
je 0x37fb
movq %rcx, 0x20(%rax)
movq 0x30(%rdi), %rax
movq %rcx, 0x18(%rax)
movq 0x18(%rdi), %rbx
movq %rax, 0x30(%rbx)
callq 0x2030
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: countNodes
void countNodes(parsetree head, int *count){

    if(head==NULL)
        return;
    countNodes(head->child, count);

    count[0]++;
    // printf("%d\n", count[0]);


    countNodes(head->right, count); 



}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %r14, %r14
je 0x394c
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x3926
incl (%rbx)
movq 0x28(%r14), %r14
jmp 0x3933
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: ComputeFirstAndFollowSets
void ComputeFirstAndFollowSets(int G[][14], int first[][11], int follow [][15]){ //Compute the first and follow Sets, given Grammar
    int i, j;
    for(i = 1; i < 52; i++){
        //printf("%d - ", i);
        int result[1024] = {0};
        findfirst(result, i, G);
        for(j = 0; result[j]!=0; j++){
             first[i][j] = result[j];

        }

        first[i][j] = -1;

    }

    for(i = 1; i < 52; i++){
        //printf("%d - ", i);
        int result[1024] = {0};
        findfollow(result, i, G);
        for(j = 0; result[j]!=0; j++){
             
             if(result[j]==-1)
                follow[i][j] = 0;
             else{
                follow[i][j] = result[j];
             }
    }

        follow[i][j] = -1;

    }



}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
addq $0x2c, %r15
pushq $0x1
popq %r12
leaq -0x1030(%rbp), %r13
cmpq $0x34, %r12
je 0x3bc2
movl $0x1000, %edx           # imm = 0x1000
movq %r13, %rdi
xorl %esi, %esi
callq 0x20f0
movq %r13, %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x300e
xorl %eax, %eax
movl -0x1030(%rbp,%rax), %ecx
testl %ecx, %ecx
je 0x3bb4
movl %ecx, (%r15,%rax)
addq $0x4, %rax
jmp 0x3b9f
orl $-0x1, (%r15,%rax)
incq %r12
addq $0x2c, %r15
jmp 0x3b7a
addq $0x3c, %rbx
pushq $0x1
popq %r15
leaq -0x1030(%rbp), %r12
cmpq $0x34, %r15
je 0x3c20
movl $0x1000, %edx           # imm = 0x1000
movq %r12, %rdi
xorl %esi, %esi
callq 0x20f0
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x3141
xorl %eax, %eax
movl -0x1030(%rbp,%rax), %ecx
xorl %edx, %edx
cmpl $-0x1, %ecx
je 0x3c0a
testl %ecx, %ecx
je 0x3c13
movl %ecx, %edx
movl %edx, (%rbx,%rax)
addq $0x4, %rax
jmp 0x3bf6
orl $-0x1, (%rbx,%rax)
incq %r15
addq $0x3c, %rbx
jmp 0x3bd1
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: addLexeme
void addLexeme(parsetree head, node* Lex){

    if(head==NULL){
        return;
    }
    else{
    addLexeme(head->child, Lex);

    /*if(head->value > NON_TERMINALS && head->value!=109){
        if(strcmp(Lex->tk->token,"COMMENTMARK")==0){
            Lex = getNextToken();
        }
        if(strcmp(Lex->tk->value,"declare")==0 && head->value!=59){
            Lex = getNextToken();
        }
        head->Lex = Lex;
        printf("%s\n", terms[head->value]);
        Lex = getNextToken();
    }*/
    if(head->isleaf == 1 && head->value!=109 ){
        
        // head->Lex->tk->line = lineno[pop1];
        strcpy(head->Lex->tk->value,arra[popl++]);
         
        //printf("%s     -     %s\n",terms[head->value],head->Lex->tk->value);
    }
    addLexeme(head->right, Lex);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xae9c(%rip), %r15      # 0xec70
testq %r14, %r14
je 0x3e1f
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x3dbd
cmpl $0x1, 0x38(%r14)
jne 0x3e19
cmpl $0x6d, 0x8(%r14)
je 0x3e19
movq (%r14), %rax
movq (%rax), %rdi
addq $0x1e, %rdi
movslq 0x15b54(%rip), %rax     # 0x19958
leal 0x1(%rax), %ecx
movl %ecx, 0x15b4b(%rip)     # 0x19958
imulq $0x28, %rax, %rsi
addq %r15, %rsi
callq 0x2060
movq 0x28(%r14), %r14
jmp 0x3dd4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./parser.c
// Function: populateLexemes
void populateLexemes(parsetree head, char *filename){



    /*FILE* fp = fopen("testcase5.txt","r");
    rewind(fp);
    fseek( fp, 0, SEEK_SET);
    fp = getstream(fp);*/
 
           node* Lex = getNextToken();                  //Call method in lexer
                    int i = 1;
                    int j = 0;
                    while(strcmp(Lex->tk->value,"$")!=0){

                         //if(strcmp(Lex->tk->value, "**")!=0)
                         // lineno[j] = Lex->tk->value;
                         strcpy(arra[j++],Lex->tk->value);

                         //printf("%s \n", arra[j-1]);
                //printf("%d. token = %s, value = %s, line = %d\n", i++,Lex->tk->token, Lex->tk->value, Lex->tk->line);   //print tokens to console
                        free(Lex);
                        node* Lex = getNextToken();
                    }               //Call method in lexer
    addLexeme(head, Lex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xae32(%rip), %r14      # 0xec70
callq 0x2559
movq %rax, %r15
movq (%r15), %rsi
cmpb $0x24, 0x1e(%rsi)
jne 0x3e55
cmpb $0x0, 0x1f(%rsi)
je 0x3e74
addq $0x1e, %rsi
movq %r14, %rdi
callq 0x2060
movq %r15, %rdi
callq 0x2030
callq 0x2559
addq $0x28, %r14
jmp 0x3e46
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3dbd
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./symboltable.h
// Function: hash
int hash(char *key)
{
    int value = 0;
    int i;
    for (i = 0; i < strlen(key); i++)
         value += (int)key[i];
    return (value % SIZE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x20a0
xorl %edx, %edx
xorl %ecx, %ecx
cmpq %rdx, %rax
je 0x4365
movsbl (%rbx,%rdx), %esi
addl %esi, %ecx
incq %rdx
jmp 0x4355
pushq $0x14
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
movl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./functionsymboltable.h
// Function: hash_insert_func
int hash_insert_func(char *key,char* input_parameters,char* output_parameters)
{
    int h = hash(key);
    struct funcNode* it = create_func_node(key,input_parameters,output_parameters);
    if (it == NULL){
        return 0;
    }
    while(functable->table[h]->next != NULL){
        h++;
    }
    functable->table[h]->next = it;
    strcpy(arr[funcnum++], key);
    return h;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
callq 0x4343
movl %eax, %r14d
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x42ee
testq %rax, %rax
je 0x43fa
movslq %r14d, %rcx
leal -0x1(%rcx), %r14d
shlq $0x3, %rcx
addq 0x183e9(%rip), %rcx     # 0x1c7a0
movq (%rcx), %rdx
incl %r14d
addq $0x8, %rcx
cmpq $0x0, 0xe8(%rdx)
jne 0x43b7
movq %rax, 0xe8(%rdx)
movslq 0x183bf(%rip), %rax     # 0x1c798
leal 0x1(%rax), %ecx
movl %ecx, 0x183b6(%rip)     # 0x1c798
imulq $0x64, %rax, %rax
leaq 0x183c3(%rip), %rdi     # 0x1c7b0
addq %rax, %rdi
movq %rbx, %rsi
callq 0x2060
jmp 0x43fd
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./functionsymboltable.h
// Function: get_func_hash_value
int get_func_hash_value(char* functionname){
    int h = hash(functionname);
    while(functable->table[h]->next != NULL){
        if(strcmp(functable->table[h]->next->name,functionname) == 0){
            return h;
        }
        h++;
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x4343
movl %eax, %r14d
movslq %eax, %r12
shlq $0x3, %r12
addq 0x18373(%rip), %r12     # 0x1c7a0
pushq $-0x1
popq %r15
movq (%r12), %rax
movq 0xe8(%rax), %rdi
testq %rdi, %rdi
je 0x4459
movq %rbx, %rsi
callq 0x2120
testl %eax, %eax
je 0x4456
incl %r14d
addq $0x8, %r12
jmp 0x4431
movl %r14d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./functionsymboltable.h
// Function: get_Func_input_type
void get_Func_input_type(char* functionname){
    int i;
    fnode* it;
    char inputtype[1000] = {'\0'};
    int j=1;
    for(i=0;i<SIZE;i++){
        if(functable->table[i]->next != NULL && ((int)(functable->table[i]->next->name) < 100000000)){
            if(strcmp(functable->table[i]->next->name,functionname) == 0){
                strcpy(inputtype, functable->table[i]->next->input);
                printf("I am    %s    module and input parameters are..\n",functable->table[i]->next->name);
                    char *token;
                    token = strtok(functable->table[i]->next->input, ";");
                    while( token != NULL ) {
                       printf( "%d. %s\n", j++,token );
                       token = strtok(NULL, ";");
                    }
                // return functable->table[i]->next->input;
            }
        }
        // return "";
    }
    // return inputtype;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, -0x30(%rbp)
pushq $0x1
popq %r13
leaq 0x3f31(%rip), %r15      # 0x83b9
leaq 0x4235(%rip), %r12      # 0x86c4
xorl %ebx, %ebx
cmpq $0x14, %rbx
je 0x452d
movq 0x182fe(%rip), %rax     # 0x1c7a0
movq (%rax,%rbx,8), %rax
movq 0xe8(%rax), %r14
testq %r14, %r14
sete %al
cmpl $0x5f5e100, %r14d       # imm = 0x5F5E100
setge %cl
orb %al, %cl
jne 0x44d1
movq %r14, %rdi
movq -0x30(%rbp), %rsi
callq 0x2120
testl %eax, %eax
je 0x44d6
incq %rbx
jmp 0x4491
leaq 0x41b6(%rip), %rdi      # 0x8693
movq %r14, %rsi
xorl %eax, %eax
callq 0x20b0
movq 0x182b2(%rip), %rax     # 0x1c7a0
movq (%rax,%rbx,8), %rax
movq 0xe8(%rax), %rdi
addq $0x1e, %rdi
movq %r15, %rsi
callq 0x2190
testq %rax, %rax
je 0x44d1
leal 0x1(%r13), %r14d
movq %r12, %rdi
movl %r13d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x20b0
xorl %edi, %edi
movq %r15, %rsi
callq 0x2190
movl %r14d, %r13d
jmp 0x4505
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./functionsymboltable.h
// Function: get_Func_output_type
void get_Func_output_type(char* functionname){
    int i;
    fnode* it;
    int j=1;
    char outputtype[1000] = {'\0'};
    for(i=0;i<SIZE;i++){
        if(functable->table[i]->next != NULL && ((int)(functable->table[i]->next->name) < 100000000)){
            if(strcmp(functable->table[i]->next->name,functionname) == 0){
                strcpy(outputtype, functable->table[i]->next->output);
                printf("I am    %s    module and output parameters are..\n",functable->table[i]->next->name);
                    char *token;
                    token = strtok(functable->table[i]->next->output, ";");
                    while( token != NULL ) {
                       printf( "%d. %s\n", j++,token );
                       token = strtok(NULL, ";");
                    }
                    // return functable->table[i]->next->output;
            }
        }
    }

    // return "";
    // return outputtype;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, -0x30(%rbp)
pushq $0x1
popq %r13
leaq 0x3e60(%rip), %r15      # 0x83b9
leaq 0x4164(%rip), %r12      # 0x86c4
xorl %ebx, %ebx
cmpq $0x14, %rbx
je 0x4602
movq 0x1822d(%rip), %rax     # 0x1c7a0
movq (%rax,%rbx,8), %rax
movq 0xe8(%rax), %r14
testq %r14, %r14
sete %al
cmpl $0x5f5e100, %r14d       # imm = 0x5F5E100
setge %cl
orb %al, %cl
jne 0x45a2
movq %r14, %rdi
movq -0x30(%rbp), %rsi
callq 0x2120
testl %eax, %eax
je 0x45a7
incq %rbx
jmp 0x4562
leaq 0x411e(%rip), %rdi      # 0x86cc
movq %r14, %rsi
xorl %eax, %eax
callq 0x20b0
movq 0x181e1(%rip), %rax     # 0x1c7a0
movq (%rax,%rbx,8), %rax
movq 0xe8(%rax), %rdi
movl $0x82, %eax
addq %rax, %rdi
movq %r15, %rsi
callq 0x2190
testq %rax, %rax
je 0x45a2
leal 0x1(%r13), %r14d
movq %r12, %rdi
movl %r13d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x20b0
xorl %edi, %edi
movq %r15, %rsi
callq 0x2190
movl %r14d, %r13d
jmp 0x45da
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./functionsymboltable.h
// Function: get_Function_input_type
char* get_Function_input_type(char* functionname){
    int i;
    fnode* it;
    char inputtype[1000] = {'\0'};
    int j=1;
    for(i=0;i<SIZE;i++){
        if(functable->table[i]->next != NULL && ((int)(functable->table[i]->next->name) < 100000000)){
            if(strcmp(functable->table[i]->next->name,functionname) == 0){
                strcpy(inputtype, functable->table[i]->next->input);
                
                // return functable->table[i]->next->input;
            }
        }
        // return "";
    }
    return inputtype;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rdi, %rbx
leaq -0x410(%rbp), %r14
xorl %r12d, %r12d
movl $0x3e8, %edx            # imm = 0x3E8
movq %r14, %rdi
xorl %esi, %esi
callq 0x20f0
movq 0x18158(%rip), %r13     # 0x1c7a0
cmpq $0x14, %r12
je 0x4691
movq (%r13,%r12,8), %rax
movq 0xe8(%rax), %r15
testq %r15, %r15
sete %al
cmpl $0x5f5e100, %r15d       # imm = 0x5F5E100
setge %cl
orb %al, %cl
jne 0x468c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2120
testl %eax, %eax
jne 0x468c
addq $0x1e, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2060
incq %r12
jmp 0x4648
leaq -0x410(%rbp), %rax
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./functionsymboltable.h
// Function: get_Function_output_type
char* get_Function_output_type(char* functionname){
    int i;
    fnode* it;
    int j=1;
    char outputtype[1000] = {'\0'};
    for(i=0;i<SIZE;i++){
        if(functable->table[i]->next != NULL && ((int)(functable->table[i]->next->name) < 100000000)){
            if(strcmp(functable->table[i]->next->name,functionname) == 0){
                strcpy(outputtype, functable->table[i]->next->output);
                
                    // return functable->table[i]->next->output;
            }
        }
    }

    // return "";
    return outputtype;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rdi, %rbx
leaq -0x410(%rbp), %r14
xorl %r12d, %r12d
movl $0x3e8, %edx            # imm = 0x3E8
movq %r14, %rdi
xorl %esi, %esi
callq 0x20f0
movq 0x180bf(%rip), %r13     # 0x1c7a0
cmpq $0x14, %r12
je 0x472d
movq (%r13,%r12,8), %rax
movq 0xe8(%rax), %r15
testq %r15, %r15
sete %al
cmpl $0x5f5e100, %r15d       # imm = 0x5F5E100
setge %cl
orb %al, %cl
jne 0x4728
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2120
testl %eax, %eax
jne 0x4728
addq $0x82, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2060
incq %r12
jmp 0x46e1
leaq -0x410(%rbp), %rax
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./functionsymboltable.h
// Function: check_func_present
int check_func_present(char* functionname){
    int i;
    fnode* it;
    int j=1;
    for(i=0;i<SIZE;i++){
        if(functable->table[i]->next != NULL && ((int)(functable->table[i]->next->name) < 100000000)){
            if(strcmp(functable->table[i]->next->name,functionname) == 0){
               return 1;
            }
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18042(%rip), %r15     # 0x1c7a0
xorl %ebx, %ebx
pushq $0x1
popq %r12
xorl %r13d, %r13d
cmpq $0x14, %r13
je 0x479f
movq (%r15,%r13,8), %rax
movq 0xe8(%rax), %rdi
testq %rdi, %rdi
sete %al
cmpl $0x5f5e100, %edi        # imm = 0x5F5E100
setge %cl
orb %al, %cl
jne 0x4797
movq %r14, %rsi
callq 0x2120
testl %eax, %eax
je 0x479c
incq %r13
jmp 0x4767
movl %r12d, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./functionsymboltable.h
// Function: directfunctionpointer
fnode* directfunctionpointer(char* functionname){
    int i;
    fnode* it;
    int j=1;
    for(i=0;i<SIZE;i++){
        if(functable->table[i]->next != NULL && ((int)(functable->table[i]->next->name) < 100000000)){
            if(strcmp(functable->table[i]->next->name,functionname) == 0){
               return functable->table[i]->next;
            }
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x17fdb(%rip), %r15     # 0x1c7a0
xorl %r12d, %r12d
cmpq $0x14, %r12
je 0x4801
movq (%r15,%r12,8), %rax
movq 0xe8(%rax), %r14
testq %r14, %r14
sete %al
cmpl $0x5f5e100, %r14d       # imm = 0x5F5E100
setge %cl
orb %al, %cl
jne 0x47fc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2120
testl %eax, %eax
je 0x4804
incq %r12
jmp 0x47c8
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./tokensymboltable.h
// Function: display
void display(char* functionname){
    int i;
    int j = get_func_hash_value(functionname);
      
    for(i=0;i<SIZE;i++){
        pNode* it  = ht->functable[j]->table[i]->next;

        if(it !=NULL && strcmp(it->name,"")!= 0){

            if(strncmp(ht->functable[j]->table[i]->next->type,"ARRAY",5)==0)
                printf("%-3d %-20s %-22s %-20s %-5d %-6d\n",(sequencenumber++),ht->functable[j]->table[i]->next->name,"ARRAY",ht->functable[j]->table[i]->next->scope,ht->functable[j]->table[i]->next->width,offseter);
           
            else
                printf("%-3d %-20s %-22s %-20s %-5d %-6d\n",(sequencenumber++),ht->functable[j]->table[i]->next->name,ht->functable[j]->table[i]->next->type,ht->functable[j]->table[i]->next->scope,ht->functable[j]->table[i]->next->width,offseter);
            offseter += ht->functable[j]->table[i]->next->width;
            //printf("%d.\t%s\t\t%s\t\t%s\t\t%s\t\t%d\n",(sequencenumber++),ht->functable[j]->table[i]->next->name,ht->functable[j]->table[i]->next->type,ht->functable[j]->table[i]->next->ifnumvalue,ht->functable[j]->table[i]->next->scope,ht->functable[j]->table[i]->next->offset); 
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x4409
movslq %eax, %r14
leaq 0x38d3(%rip), %rbx      # 0x8307
xorl %r15d, %r15d
cmpq $0x14, %r15
je 0x4ad3
movq 0x1a480(%rip), %rax     # 0x1eec8
movq (%rax,%r14,8), %rax
movq (%rax,%r15,8), %rax
movq 0x50(%rax), %r12
testq %r12, %r12
je 0x4acb
cmpb $0x0, (%r12)
je 0x4acb
leaq 0x37(%r12), %r13
movq %r13, %rdi
movq %rbx, %rsi
pushq $0x5
popq %rdx
callq 0x2050
movl 0x13e37(%rip), %esi     # 0x188b0
leal 0x1(%rsi), %ecx
leaq 0x28(%r12), %r8
testl %eax, %eax
movl %ecx, 0x13e27(%rip)     # 0x188b0
movl 0x4c(%r12), %r9d
movl 0x1a42c(%rip), %eax     # 0x1eec0
cmoveq %rbx, %r13
movl %eax, (%rsp)
leaq 0x3c63(%rip), %rdi      # 0x8705
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x20b0
movq 0x1a412(%rip), %rax     # 0x1eec8
movq (%rax,%r14,8), %rax
movq (%rax,%r15,8), %rax
movq 0x50(%rax), %rax
movl 0x4c(%rax), %eax
addl %eax, 0x1a3f5(%rip)     # 0x1eec0
incq %r15
jmp 0x4a37
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./tokensymboltable.h
// Function: displaySymbolTable
void displaySymbolTable(){
    int i;
    printf("\t\t\t\t Symbol Table\n");
    printf("%-3s %-20s %-22s %-20s %5s %6s\n","No.","Identifier name","Type", "Module Scope","Width","Offset");
      
    for(i=0; i<funcnum; i++)
        display(arr[i]);

    //assert(0);


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x4d61(%rip), %rdi      # 0x9855
callq 0x2070
leaq 0x3c6e(%rip), %rax      # 0x876e
movq %rax, (%rsp)
leaq 0x3c1c(%rip), %rdi      # 0x8727
leaq 0x3c35(%rip), %rsi      # 0x8747
leaq 0x3c32(%rip), %rdx      # 0x874b
leaq 0x4b75(%rip), %rcx      # 0x9695
leaq 0x3c34(%rip), %r8       # 0x875b
leaq 0x3c3a(%rip), %r9       # 0x8768
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x20b0
leaq 0x17c71(%rip), %rbx     # 0x1c7b0
movslq 0x17c52(%rip), %rax     # 0x1c798
cmpq %rax, %r14
jge 0x4b5c
movq %rbx, %rdi
callq 0x4a17
incq %r14
addq $0x64, %rbx
jmp 0x4b3f
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./tokensymboltable.h
// Function: checksymbolpresent
int checksymbolpresent(char* key,char* functionname){
    int j = get_func_hash_value(functionname);
    int h = hash(key);
    if(ht->functable[j]->table[h]==NULL){
        return 0;
    }
    while(ht->functable[j]->table[h]->next != NULL){
        if(strcmp(key,ht->functable[j]->table[h]->next->name) == 0){
            return 1;
        }
        h++;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4409
movl %eax, %r14d
movq %rbx, %rdi
callq 0x4343
movq 0x1a33b(%rip), %rcx     # 0x1eec8
movslq %r14d, %rdx
movq (%rcx,%rdx,8), %rcx
cltq
xorl %r14d, %r14d
cmpq $0x0, (%rcx,%rax,8)
je 0x4bc8
leaq (%rcx,%rax,8), %r12
pushq $0x1
popq %r15
movq (%r12), %rax
movq 0x50(%rax), %rsi
testq %rsi, %rsi
je 0x4bc8
movq %rbx, %rdi
callq 0x2120
addq $0x8, %r12
testl %eax, %eax
jne 0x4ba8
movl %r15d, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./tokensymboltable.h
// Function: getoffset
int getoffset(char* key,char* functionname){
    int j = get_func_hash_value(functionname);
    int h = hash(key);
    while(ht->functable[j]->table[h]->next != NULL){
        if(strcmp(key,ht->functable[j]->table[h]->next->name) == 0){
            return ht->functable[j]->table[h]->next->offset;
        }
        h++;
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4409
movl %eax, %r14d
movq %rbx, %rdi
callq 0x4343
movq 0x1a2cc(%rip), %rcx     # 0x1eec8
movslq %r14d, %rdx
movslq %eax, %r12
shlq $0x3, %r12
addq (%rcx,%rdx,8), %r12
pushq $-0x1
popq %r14
movq (%r12), %rax
movq 0x50(%rax), %r15
testq %r15, %r15
je 0x4c32
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2120
addq $0x8, %r12
testl %eax, %eax
jne 0x4c0e
movl 0x48(%r15), %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./tokensymboltable.h
// Function: gettype
char* gettype(char* key,char* functionname){
    int j = get_func_hash_value(functionname);
    int h = hash(key);
    while(ht->functable[j]->table[h]->next != NULL){
        if(strcmp(key,ht->functable[j]->table[h]->next->name) == 0){
            return ht->functable[j]->table[h]->next->type;
        }
        h++;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4409
movl %eax, %r14d
movq %rbx, %rdi
callq 0x4343
movq 0x1a262(%rip), %rcx     # 0x1eec8
movslq %r14d, %rdx
movslq %eax, %r12
shlq $0x3, %r12
addq (%rcx,%rdx,8), %r12
xorl %r14d, %r14d
movq (%r12), %rax
movq 0x50(%rax), %r15
testq %r15, %r15
je 0x4c9e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2120
addq $0x8, %r12
testl %eax, %eax
jne 0x4c77
addq $0x37, %r15
movq %r15, %r14
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Gaurang18[P]Compiler-Project-BITS-Pilani/./tokensymboltable.h
// Function: automateoffset
void automateoffset(char* functionname){
    int i;
    int j = get_func_hash_value(functionname);
    int offset = 0;
    for(i=0;i<SIZE;i++){
        pNode* it  = ht->functable[j]->table[i]->next;
        if(it !=NULL && strcmp(it->name,"")!= 0){
            if(strcmp(ht->functable[j]->table[i]->next->type,"INTEGER") ==0){
            	offset += 4;
            }
            if(strcmp(ht->functable[j]->table[i]->next->type,"REAL") ==0){
            	offset += 8;
            }
            if(strcmp(ht->functable[j]->table[i]->next->type,"STRING") ==0){
            	offset += strlen(ht->functable[j]->table[i]->next->name);
            }
            if(strcmp(ht->functable[j]->table[i]->next->type,"ARRAY") ==0){
            	offset += 0;
            }
         	ht->functable[j]->table[i]->next->offset = offset;   
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x4409
movq 0x1a204(%rip), %rcx     # 0x1eec8
cltq
movq (%rcx,%rax,8), %rcx
xorl %r14d, %r14d
xorl %r15d, %r15d
movq %rcx, -0x30(%rbp)
cmpq $0x14, %r14
je 0x4d51
movq (%rcx,%r14,8), %rax
movq 0x50(%rax), %r12
testq %r12, %r12
je 0x4d4c
cmpb $0x0, (%r12)
je 0x4d4c
leaq 0x37(%r12), %r13
movq %r13, %rdi
leaq 0x3dbf(%rip), %rsi      # 0x8abc
callq 0x2120
leal 0x4(%r15), %ebx
testl %eax, %eax
cmovnel %r15d, %ebx
movq %r13, %rdi
leaq 0x3db0(%rip), %rsi      # 0x8ac6
callq 0x2120
leal 0x8(%rbx), %r15d
testl %eax, %eax
cmovnel %ebx, %r15d
movq %r13, %rdi
leaq 0x39cf(%rip), %rsi      # 0x86fe
callq 0x2120
testl %eax, %eax
jne 0x4d43
movq %r12, %rdi
callq 0x20a0
addl %eax, %r15d
movl %r15d, 0x48(%r12)
movq -0x30(%rbp), %rcx
incq %r14
jmp 0x4cd4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq