// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0xb0, %rsp
movq %rdi, %rbx
addq $0x5098, %rdi           # imm = 0x5098
leaq 0x5236(%rip), %rsi      # 0xf757
callq 0x2310
movq %rbx, %rdi
callq 0x97e2
leaq 0x5050(%rbx), %rdi
leaq 0x4af0(%rip), %rsi      # 0xf02c
callq 0x7926
testb %al, %al
je 0xa707
movq %rbx, %rdi
callq 0x9522
movq %rbx, %rdi
callq 0xae02
movl $0x3, 0x4dd8(%rbx)
movl 0x71b0(%rbx), %r15d
incl %r15d
movl %r15d, 0x71b0(%rbx)
movq %rbx, %rdi
movl %r15d, %esi
callq 0x9a0c
testb %al, %al
jne 0xa5b5
leaq 0x51d0(%rip), %rsi      # 0xf75a
leaq -0xc8(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x20a0
leaq -0xc8(%rbp), %rsi
movq %rbx, %rdi
callq 0x9890
leaq -0xc8(%rbp), %rdi
callq 0x20d0
leaq 0x4c38(%rbx), %r14
movq %r14, %rdi
callq 0xc95c
testb %al, %al
jne 0xa5fa
leaq 0x51ad(%rip), %rsi      # 0xf77c
leaq -0xa8(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x20a0
leaq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x9890
leaq -0xa8(%rbp), %rdi
callq 0x20d0
movl 0x71b0(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x71bc(%rbx)
addl $0x2, %eax
movl %eax, 0x71b0(%rbx)
movl %eax, 0x71c0(%rbx)
leaq 0x5084(%rip), %rsi      # 0xf6a3
leaq -0x88(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x20a0
leaq 0x50c0(%rbx), %r12
leaq -0x88(%rbp), %rsi
movq %r12, %rdi
movl %r15d, %edx
callq 0x85c6
leaq -0x88(%rbp), %rdi
callq 0x20d0
leaq 0x5152(%rip), %rsi      # 0xf7ad
leaq -0x68(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x20a0
movl 0x71bc(%rbx), %edx
movl 0x71c0(%rbx), %ecx
leaq -0x68(%rbp), %rsi
movq %r12, %rdi
callq 0x8630
leaq -0x68(%rbp), %rdi
callq 0x20d0
movslq 0x71ec(%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, 0x71ec(%rbx)
andl $0x0, 0x71c8(%rbx,%rax,4)
incl 0x7224(%rbx)
movq %rbx, %rdi
callq 0x9f4a
decl 0x71ec(%rbx)
movslq 0x7224(%rbx), %rax
movl $0x3, 0x71fc(%rbx,%rax,4)
decl 0x7224(%rbx)
movq %rbx, %rdi
callq 0x9d34
movq %r14, %rdi
callq 0xc97c
leaq 0x50c5(%rip), %rsi      # 0xf7aa
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x20a0
leaq -0x48(%rbp), %rsi
movq %r12, %rdi
callq 0x8572
leaq -0x48(%rbp), %rdi
callq 0x20d0
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
jmp 0xa753
jmp 0xa75a
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
jmp 0xa753
jmp 0xa75a
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
jmp 0xa753
jmp 0xa75a
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
jmp 0xa753
jmp 0xa75a
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x20d0
jmp 0xa75d
movq %rax, %rbx
movq %rbx, %rdi
callq 0x22e0
nop