// File: /workspace/github_cpp_makefile_star2_O1/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 0x60b9(%rip), %rcx      # 0x13767
movl $0x2, %r8d
xorl %esi, %esi
callq 0x22b0
movq %rbx, %rdi
callq 0xc41a
leaq 0x5050(%rbx), %r14
leaq 0x5956(%rip), %rsi      # 0x13027
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
jne 0xd92e
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 0xe1ec
movl $0x3, 0x4dd8(%rbx)
movl 0x71b0(%rbx), %r15d
incl %r15d
movl %r15d, 0x71b0(%rbx)
movq %rbx, %rdi
movl %r15d, %esi
callq 0xc704
testb %al, %al
jne 0xd783
leaq -0xc0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x6019(%rip), %rsi      # 0x1376a
leaq 0x6033(%rip), %rdx      # 0x1378b
leaq -0xd0(%rbp), %r14
movq %r14, %rdi
callq 0x42dc
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc53c
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0xd783
callq 0x21b0
leaq 0x4c38(%rbx), %r13
movq %r13, %rdi
callq 0x10618
testb %al, %al
jne 0xd7da
leaq -0xa0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x5fe4(%rip), %rsi      # 0x1378c
leaq 0x600a(%rip), %rdx      # 0x137b9
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
callq 0x42dc
movq %rbx, %rdi
movq %r12, %rsi
callq 0xc53c
movq -0xb0(%rbp), %rdi
cmpq %r14, %rdi
je 0xd7da
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 0x5ea1(%rip), %rsi      # 0x136b3
leaq 0x5ea1(%rip), %rdx      # 0x136ba
leaq -0x90(%rbp), %r13
movq %r13, %rdi
callq 0x42dc
movq %r12, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0xab04
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0xd847
callq 0x21b0
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x5f67(%rip), %rsi      # 0x137bd
leaq 0x5f64(%rip), %rdx      # 0x137c1
leaq -0x70(%rbp), %r15
movq %r15, %rdi
callq 0x42dc
movl 0x71bc(%rbx), %edx
movl 0x71c0(%rbx), %ecx
movq %r12, %rdi
movq %r15, %rsi
callq 0xabb8
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0xd88e
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 0xcf32
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 0xd8eb
movq %rbx, %rdi
callq 0x10688
movq %rbx, %rdi
callq 0x10638
leaq -0x40(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x5eb8(%rip), %rsi      # 0x137ba
leaq 0x5eb8(%rip), %rdx      # 0x137c1
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
callq 0x42dc
movq %r12, %rdi
movq %rbx, %rsi
callq 0xaa88
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0xd92e
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 0xd97e
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
jne 0xd983
jmp 0xd988
movq %rax, %rbx
movq -0x50(%rbp), %rdi
jmp 0xd97e
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
jne 0xd983
jmp 0xd988
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0xd988
callq 0x21b0
movq %rbx, %rdi
callq 0x2310