// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x64a0
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x14, -0xc(%rbp)
jge 0x75ac
movq 0x1bde1(%rip), %rax     # 0x23218
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x759c
movq -0x20(%rbp), %rdi
leaq 0x6266(%rip), %rsi      # 0xd6cb
callq 0x20f0
cmpl $0x0, %eax
je 0x759c
movq 0x1bd9e(%rip), %rax     # 0x23218
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rdi
addq $0x37, %rdi
leaq 0x576e(%rip), %rsi      # 0xcc07
callq 0x20f0
cmpl $0x0, %eax
jne 0x74ac
movl -0x14(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x14(%rbp)
movq 0x1bd65(%rip), %rax     # 0x23218
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rdi
addq $0x37, %rdi
leaq 0x573f(%rip), %rsi      # 0xcc11
callq 0x20f0
cmpl $0x0, %eax
jne 0x74e5
movl -0x14(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x14(%rbp)
movq 0x1bd2c(%rip), %rax     # 0x23218
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rdi
addq $0x37, %rdi
leaq 0x532b(%rip), %rsi      # 0xc836
callq 0x20f0
cmpl $0x0, %eax
jne 0x7542
movq 0x1bcfc(%rip), %rax     # 0x23218
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rdi
callq 0x2080
movq %rax, %rcx
movslq -0x14(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x14(%rbp)
movq 0x1bccf(%rip), %rax     # 0x23218
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rdi
addq $0x37, %rdi
leaq 0x4e77(%rip), %rsi      # 0xc3df
callq 0x20f0
cmpl $0x0, %eax
jne 0x757b
movl -0x14(%rbp), %eax
addl $0x0, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movq 0x1bc93(%rip), %rax     # 0x23218
movslq -0x10(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0xc(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq 0x50(%rax), %rax
movl %ecx, 0x48(%rax)
jmp 0x759e
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7426
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)