// File: navrajsaini[P]PL_Compiler_design_project/parser.cpp
// Function: Parse::VarDefB()
void Parse::VarDefB()//variable definition for multiple itirations
{where="VDB";check();
   if(LHS=="id")
   {
      valLength[valLenPtr]++;
      VarList();
   }else if(LHS=="array")
   {
      eKind = ARR;
      match();
      
      VarList();
      if(LHS=="[")
      { 
	 match();
	 bool sVal = 1;
	 if(LHS=="num")
	 {
	    checkVal=ln[tokeNum][2];	    
	 }else if(LHS=="id")
	 {	   
	    index2 = ln[tokeNum][1];
	    ent = bTable.find_all_level(index2);
	    bool lVal = bTable.search(index2);
	    sVal=lVal;
	    //cout<<bTable.inScope;
	    en=1;
	 }	 
	 Const();
	 if(!sVal)
	 {
	    scopeError("Error, Variable not declared in scope");    
	 }
	 bTable.inScope = 0;
	 if(en=1)
	 {
	    for(int i = 0; i < listDepth; i++)
	    {
	       size[i] = ent.value;
	    }
	 }else
	 {
	    for(int i = 0; i<listDepth;i++)
	    {
	       size[i] = checkVal;
	    }
	 }
	 size[0] = checkVal;
	 int tmp = checkVal;
	 valLength[valLenPtr] = valLength[valLenPtr] + checkVal;//
	 if(!checkDefList())
	    scopeError("Ambiguous definition of array");
	 levelOfCurrentBlock[currentLevel] = levelOfCurrentBlock[currentLevel] + (tmp - 1);
	 if(LHS=="]")
	 {
	    match();
	 }else
	    errorReport();
      }
   }else
   {
      errorReport();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
addq $0x5098, %rdi           # imm = 0x5098
leaq 0x8a00(%rip), %rsi      # 0x1f868
callq 0x2280
movq -0xa0(%rbp), %rdi
callq 0x15310
movq -0xa0(%rbp), %rdi
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x84ea(%rip), %rsi      # 0x1f378
callq 0x10ea0
testb $0x1, %al
jne 0x16e99
jmp 0x16ec2
movq -0xa0(%rbp), %rdi
movslq 0x71ec(%rdi), %rax
movl 0x71c4(%rdi,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, 0x71c4(%rdi,%rax,4)
callq 0x172e0
jmp 0x172ce
movq -0xa0(%rbp), %rdi
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x89d3(%rip), %rsi      # 0x1f8aa
callq 0x10ea0
testb $0x1, %al
jne 0x16ee5
jmp 0x172c0
movq -0xa0(%rbp), %rdi
movl $0x2, 0x4dd8(%rdi)
callq 0x14f20
movq -0xa0(%rbp), %rdi
callq 0x172e0
movq -0xa0(%rbp), %rdi
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x88a0(%rip), %rsi      # 0x1f7bc
callq 0x10ea0
testb $0x1, %al
jne 0x16f2a
jmp 0x172be
movq -0xa0(%rbp), %rdi
callq 0x14f20
movq -0xa0(%rbp), %rdi
movb $0x1, -0x9(%rbp)
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x8375(%rip), %rsi      # 0x1f2c4
callq 0x10ea0
testb $0x1, %al
jne 0x16f5a
jmp 0x16f87
movq -0xa0(%rbp), %rax
movq %rax, %rcx
addq $0x2030, %rcx           # imm = 0x2030
movslq 0x2028(%rax), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x4de4(%rax)
jmp 0x17052
movq -0xa0(%rbp), %rdi
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x83dc(%rip), %rsi      # 0x1f378
callq 0x10ea0
testb $0x1, %al
jne 0x16faa
jmp 0x17050
movq -0xa0(%rbp), %rax
movq %rax, %rcx
addq $0x2030, %rcx           # imm = 0x2030
movslq 0x2028(%rax), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x4de0(%rax)
movq %rax, %rsi
addq $0x4c38, %rsi           # imm = 0x4C38
movl 0x4de0(%rax), %edx
leaq -0x28(%rbp), %rdi
callq 0x1a870
movq -0xa0(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, 0x4e10(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x4e18(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x4e20(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x4e28(%rax)
movq %rax, %rdi
addq $0x4c38, %rdi           # imm = 0x4C38
movl 0x4de0(%rax), %esi
callq 0x19fe0
movb %al, %cl
movq -0xa0(%rbp), %rax
andb $0x1, %cl
movb %cl, -0x29(%rbp)
movb -0x29(%rbp), %cl
andb $0x1, %cl
movb %cl, -0x9(%rbp)
movb $0x1, 0x4dd1(%rax)
jmp 0x17052
movq -0xa0(%rbp), %rdi
callq 0x16ba0
testb $0x1, -0x9(%rbp)
jne 0x170e8
leaq -0x51(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x2350
movq -0xa8(%rbp), %rdx
leaq 0x87e6(%rip), %rsi      # 0x1f86c
leaq -0x50(%rbp), %rdi
callq 0x2290
jmp 0x17091
movq -0xa0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x15400
jmp 0x170a3
leaq -0x50(%rbp), %rdi
callq 0x2130
leaq -0x51(%rbp), %rdi
callq 0x21e0
jmp 0x170e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x170da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2130
leaq -0x51(%rbp), %rdi
callq 0x21e0
jmp 0x172d7
movq -0xa0(%rbp), %rax
movb $0x0, 0x4c38(%rax)
movb $0x1, 0x4dd1(%rax)
movb $0x1, %al
testb $0x1, %al
jne 0x17105
jmp 0x17143
movl $0x0, -0x68(%rbp)
movq -0xa0(%rbp), %rcx
movl -0x68(%rbp), %eax
cmpl 0x4d88(%rcx), %eax
jge 0x17141
movq -0xa0(%rbp), %rax
movl 0x4e20(%rax), %edx
movslq -0x68(%rbp), %rcx
movl %edx, 0x4de8(%rax,%rcx,4)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x1710c
jmp 0x17181
movl $0x0, -0x6c(%rbp)
movq -0xa0(%rbp), %rcx
movl -0x6c(%rbp), %eax
cmpl 0x4d88(%rcx), %eax
jge 0x1717f
movq -0xa0(%rbp), %rax
movl 0x4de4(%rax), %edx
movslq -0x6c(%rbp), %rcx
movl %edx, 0x4de8(%rax,%rcx,4)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1714a
jmp 0x17181
movq -0xa0(%rbp), %rdi
movl 0x4de4(%rdi), %eax
movl %eax, 0x4de8(%rdi)
movl 0x4de4(%rdi), %eax
movl %eax, -0x70(%rbp)
movslq 0x71ec(%rdi), %rax
movl 0x71c4(%rdi,%rax,4), %ecx
addl 0x4de4(%rdi), %ecx
movslq 0x71ec(%rdi), %rax
movl %ecx, 0x71c4(%rdi,%rax,4)
callq 0x15680
testb $0x1, %al
jne 0x1725e
leaq -0x91(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x2350
movq -0xb0(%rbp), %rdx
leaq 0x86a5(%rip), %rsi      # 0x1f892
leaq -0x90(%rbp), %rdi
callq 0x2290
jmp 0x171fb
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x15400
jmp 0x17210
leaq -0x90(%rbp), %rdi
callq 0x2130
leaq -0x91(%rbp), %rdi
callq 0x21e0
jmp 0x1725e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x17250
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x2130
leaq -0x91(%rbp), %rdi
callq 0x21e0
jmp 0x172d7
movq -0xa0(%rbp), %rdi
movslq 0x7224(%rdi), %rax
movl 0x71fc(%rdi,%rax,4), %ecx
movl -0x70(%rbp), %eax
subl $0x1, %eax
addl %eax, %ecx
movslq 0x7224(%rdi), %rax
movl %ecx, 0x71fc(%rdi,%rax,4)
addq $0x5050, %rdi           # imm = 0x5050
leaq 0x80d9(%rip), %rsi      # 0x1f370
callq 0x10ea0
testb $0x1, %al
jne 0x172a2
jmp 0x172b0
movq -0xa0(%rbp), %rdi
callq 0x14f20
jmp 0x172bc
movq -0xa0(%rbp), %rdi
callq 0x15110
jmp 0x172be
jmp 0x172cc
movq -0xa0(%rbp), %rdi
callq 0x15110
jmp 0x172ce
addq $0xb0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x2340