// File: /workspace/github_cpp_makefile_star2_O3/navrajsaini[P]PL_Compiler_design_project/parser.cpp
// Function: Parse::ProcDef()
void Parse::ProcDef()//procedure definition
{where="PD";check();
   if(LHS=="proc")
   {
      match();
      ProcName();
      eKind = PROCEDURE;
      int procLabel = newLabel();
      // add to current block 
      if(!checkDef(procLabel))
	 scopeError("Ambiguous definition of Procedure");
      //add to block stack
      if(!bTable.newBlock())
	 scopeError("Exceded Block limit while declaring procedure");
      //

      varLabel = newLabel();
      startLabel = newLabel();  
      gen.emit2("DEFADDR", procLabel);
      gen.emit3("PROC", varLabel, startLabel);
      //***
      valLenPtr++;
      valLength[valLenPtr] = 0;
      currentLevel++;
      Block();
      valLenPtr--;
      levelOfCurrentBlock[currentLevel] = 3;
      currentLevel--;
      //remove block from stack
      printPop();
      bTable.endBlock();
      gen.emit1("ENDPROC");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
addq $0x5098, %rdi           # imm = 0x5098
movq 0x50a0(%rbx), %rdx
leaq 0x60d7(%rip), %rcx      # 0x13767
movl $0x2, %r8d
xorl %esi, %esi
callq 0x22b0
movq %rbx, %rdi
callq 0xc3e8
leaq 0x5050(%rbx), %r14
leaq 0x5974(%rip), %rsi      # 0x13027
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
jne 0xd910
leaq 0x5070(%rbx), %rdi
movq %r14, %rsi
callq 0x2100
movslq 0x2028(%rbx), %rsi
shlq $0x5, %rsi
addq %rbx, %rsi
movq %r14, %rdi
callq 0x2100
incl 0x2028(%rbx)
movq %rbx, %rdi
callq 0xe20c
movl $0x3, 0x4dd8(%rbx)
movl 0x71b0(%rbx), %r15d
incl %r15d
movl %r15d, 0x71b0(%rbx)
movq %rbx, %rdi
movl %r15d, %esi
callq 0xc6d2
testb %al, %al
jne 0xd765
leaq -0xc0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x6037(%rip), %rsi      # 0x1376a
leaq 0x6051(%rip), %rdx      # 0x1378b
leaq -0xd0(%rbp), %r14
movq %r14, %rdi
callq 0x42ea
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc50a
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0xd765
callq 0x21b0
leaq 0x4c38(%rbx), %r13
movq %r13, %rdi
callq 0x106a4
testb %al, %al
jne 0xd7bc
leaq -0xa0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x6002(%rip), %rsi      # 0x1378c
leaq 0x6028(%rip), %rdx      # 0x137b9
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
callq 0x42ea
movq %rbx, %rdi
movq %r12, %rsi
callq 0xc50a
movq -0xb0(%rbp), %rdi
cmpq %r14, %rdi
je 0xd7bc
callq 0x21b0
movq %r13, -0x30(%rbp)
movl 0x71b0(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x71bc(%rbx)
addl $0x2, %eax
movl %eax, 0x71b0(%rbx)
movl %eax, 0x71c0(%rbx)
leaq 0x50c0(%rbx), %r12
leaq -0x80(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ebf(%rip), %rsi      # 0x136b3
leaq 0x5ebf(%rip), %rdx      # 0x136ba
leaq -0x90(%rbp), %r13
movq %r13, %rdi
callq 0x42ea
movq %r12, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0xaae4
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0xd829
callq 0x21b0
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x5f85(%rip), %rsi      # 0x137bd
leaq 0x5f82(%rip), %rdx      # 0x137c1
leaq -0x70(%rbp), %r15
movq %r15, %rdi
callq 0x42ea
movl 0x71bc(%rbx), %edx
movl 0x71c0(%rbx), %ecx
movq %r12, %rdi
movq %r15, %rsi
callq 0xab98
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0xd870
callq 0x21b0
movslq 0x71ec(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x71ec(%rbx)
movl $0x0, 0x71c8(%rbx,%rax,4)
incl 0x7224(%rbx)
movq %rbx, %rdi
callq 0xced4
decl 0x71ec(%rbx)
movslq 0x7224(%rbx), %rax
movl $0x3, 0x71fc(%rbx,%rax,4)
decl 0x7224(%rbx)
cmpb $0x1, 0x202d(%rbx)
movq -0x30(%rbp), %rbx
jne 0xd8cd
movq %rbx, %rdi
callq 0x106fa
movq %rbx, %rdi
callq 0x106c4
leaq -0x40(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ed6(%rip), %rsi      # 0x137ba
leaq 0x5ed6(%rip), %rdx      # 0x137c1
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
callq 0x42ea
movq %r12, %rdi
movq %rbx, %rsi
callq 0xaa68
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0xd910
callq 0x21b0
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
jmp 0xd960
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
jne 0xd965
jmp 0xd96a
movq %rax, %rbx
movq -0x50(%rbp), %rdi
jmp 0xd960
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
jne 0xd965
jmp 0xd96a
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0xd96a
callq 0x21b0
movq %rbx, %rdi
callq 0x2310