// File: /workspace/github_cpp_makefile_star2_O1/sighingnow[P]compile-pascal/pl0_tac_gen.cpp
// Function: pl0_tac_procedure_stmt(pl0_ast_procedure_stmt const*)
void pl0_tac_procedure_stmt(pl0_ast_procedure_stmt const *stmts) {
    cout << __func__;
    for (auto && p: stmts->procs) {
        // validate.
        string pid = p.first->id->id;
        if (valtb.find(pid, false) || vartb.find(pid, false) || proctb.find(pid, false) || functb.find(pid, false)
                || (!scope.empty() && pid == scope.back())) {
            pl0_ast_error(p.first->id->loc, string("overloaded identifier ") + "\"" + pid + "\"" + " isn't a function");
        }
        else {
            scope.emplace_back(pid); // update global scope.
            vector<string> proctype = pl0_tac_procedure_header(p.first);
            irb.emit("procedure", new Value(scope_name(), "string"));
            proctb.push(proc(scope_name(), proctype)); // update symbol table.
            proctb.tag(); functb.tag();
            pl0_tac_prog(p.second);
            irb.emit("endproc", new Value(scope_name(), "string"));
            // end of current scope.
            scope.pop_back(); // restore scope.
            valtb.detag(); vartb.detag();
            proctb.detag(), functb.detag();
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, %rbx
movq 0x52830(%rip), %rdi     # 0xbffd8
leaq 0x2bd60(%rip), %rsi     # 0x9950f
xorl %edx, %edx
callq 0x52e0
movq 0x8(%rbx), %r12
movq 0x10(%rbx), %rax
movq %rax, 0x160(%rsp)
cmpq %rax, %r12
je 0x6de8f
leaq 0x150(%rsp), %rbx
leaq 0x28(%rsp), %r14
leaq 0x2b810(%rip), %rbp     # 0x98ff3
movq (%r12), %rax
movq 0x8(%rax), %rax
leaq 0x38(%rsp), %rcx
movq %rcx, 0x28(%rsp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x36590
leaq 0x53e11(%rip), %rdi     # 0xc1620
movq %r14, %rsi
xorl %edx, %edx
callq 0x7baf4
testb %al, %al
jne 0x6d860
leaq 0x53dcc(%rip), %rdi     # 0xc15f0
movq %r14, %rsi
xorl %edx, %edx
callq 0x7bc48
testb %al, %al
jne 0x6d860
leaq 0x53e17(%rip), %rdi     # 0xc1650
movq %r14, %rsi
xorl %edx, %edx
callq 0x7be98
testb %al, %al
jne 0x6d860
leaq 0x53e32(%rip), %rdi     # 0xc1680
movq %r14, %rsi
xorl %edx, %edx
callq 0x7bfe8
testb %al, %al
je 0x6dad4
movq %rbp, %r13
movq (%r12), %rax
movq 0x8(%rax), %rax
movq (%rax), %r15
movq %rbx, 0x140(%rsp)
leaq 0x140(%rsp), %rbp
movq %rbp, %rdi
leaq 0x2b0f7(%rip), %rsi     # 0x9897f
leaq 0x2b106(%rip), %rdx     # 0x98995
callq 0x2670a
movq %rbp, %rdi
movq %r13, %rbp
movq %r13, %rsi
callq 0x5420
leaq 0x58(%rsp), %rsi
movq %rsi, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6d8ca
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x6d8d0
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x50d0
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6d924
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x6d92a
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x5420
leaq 0x98(%rsp), %rsi
movq %rsi, 0x88(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6d983
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0x6d989
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x90(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x88(%rsp), %rdi
leaq 0x2afe3(%rip), %rsi     # 0x98996
callq 0x5420
leaq 0x78(%rsp), %rsi
movq %rsi, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6d9e0
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x6d9e6
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r15, %rdi
leaq 0x68(%rsp), %rsi
callq 0x6be78
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x6da27
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x6da4c
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6da68
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x6da84
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x140(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6daa1
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6dabd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5260
addq $0x10, %r12
cmpq 0x160(%rsp), %r12
jne 0x6d7e3
jmp 0x6de8f
movq 0x53b05(%rip), %rax     # 0xc15e0
cmpq %rax, 0x53af6(%rip)     # 0xc15d8
je 0x6db0e
movq 0x30(%rsp), %rdx
cmpq -0x18(%rax), %rdx
jne 0x6db0e
testq %rdx, %rdx
je 0x6d860
movq -0x20(%rax), %rsi
movq 0x28(%rsp), %rdi
callq 0x5280
testl %eax, %eax
je 0x6d860
leaq 0x53ac3(%rip), %rdi     # 0xc15d8
movq %r14, %rsi
callq 0x7c138
movq (%r12), %rbx
movq 0x524b0(%rip), %rdi     # 0xbffd8
leaq 0x2b9e0(%rip), %rsi     # 0x9950f
xorl %edx, %edx
callq 0x52e0
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x6f323
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0xe0(%rsp), %rdi
leaq 0x29d6a(%rip), %rsi     # 0x978cd
leaq 0x29d6c(%rip), %rdx     # 0x978d6
callq 0x2670a
movl $0x48, %edi
callq 0x5250
leaq 0x120(%rsp), %rbx
movq %rax, %r15
leaq 0x188(%rsp), %rdi
callq 0x6f188
leaq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
movq %rbx, %rdi
leaq 0x2b6cd(%rip), %rsi     # 0x99278
leaq 0x2b6cc(%rip), %rdx     # 0x9927e
callq 0x2670a
movq %rbx, %rdx
movb $0x1, %bl
movq %r15, %rdi
leaq 0x188(%rsp), %rsi
callq 0x7be1c
xorl %ebx, %ebx
leaq 0x539d3(%rip), %rdi     # 0xc15a8
leaq 0xe0(%rsp), %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x7b53e
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x6dc0f
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x188(%rsp), %rdi
leaq 0x198(%rsp), %rax
cmpq %rax, %rdi
leaq 0x88(%rsp), %rbx
je 0x6dc3c
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x6dc61
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x5260
leaq 0x1a8(%rsp), %r15
movq %r15, %rdi
callq 0x6f188
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x8(%rsp), %rdx
callq 0x6981a
leaq 0x539c8(%rip), %rdi     # 0xc1650
movq %rbx, %rsi
callq 0x7e07a
leaq 0xa8(%rsp), %rdi
callq 0x7b062
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x6dcc2
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x1a8(%rsp), %rdi
leaq 0x1b8(%rsp), %rax
cmpq %rax, %rdi
je 0x6dce7
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x5260
leaq 0x53962(%rip), %rdi     # 0xc1650
callq 0x7b73e
leaq 0x53986(%rip), %rdi     # 0xc1680
callq 0x7b780
movq 0x8(%r12), %rdi
callq 0x6c38d
leaq 0xd0(%rsp), %rax
movq %rax, 0xc0(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0x2ac13(%rip), %rsi     # 0x9893b
leaq 0x2ac13(%rip), %rdx     # 0x98942
callq 0x2670a
movl $0x48, %edi
callq 0x5250
movq %rax, %r15
leaq 0x168(%rsp), %rdi
callq 0x6f188
leaq 0x110(%rsp), %rax
movq %rax, 0x100(%rsp)
leaq 0x100(%rsp), %r13
movq %r13, %rdi
leaq 0x2b508(%rip), %rsi     # 0x99278
leaq 0x2b507(%rip), %rdx     # 0x9927e
callq 0x2670a
movb $0x1, %bl
movq %r15, %rdi
leaq 0x168(%rsp), %rsi
movq %r13, %rdx
callq 0x7be1c
xorl %ebx, %ebx
leaq 0x5380e(%rip), %rdi     # 0xc15a8
leaq 0xc0(%rsp), %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x7b53e
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x6ddd4
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
leaq 0x150(%rsp), %rbx
je 0x6de01
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x6de26
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x537b3(%rip), %rax     # 0xc15e0
leaq -0x20(%rax), %rcx
movq %rcx, 0x537a8(%rip)     # 0xc15e0
movq -0x20(%rax), %rdi
addq $-0x10, %rax
cmpq %rax, %rdi
je 0x6de50
movq (%rax), %rsi
incq %rsi
callq 0x5260
leaq 0x537c9(%rip), %rdi     # 0xc1620
callq 0x7b964
leaq 0x5378d(%rip), %rdi     # 0xc15f0
callq 0x7b9c8
leaq 0x537e1(%rip), %rdi     # 0xc1650
callq 0x7ba2c
leaq 0x53805(%rip), %rdi     # 0xc1680
callq 0x7ba90
leaq 0x8(%rsp), %rdi
callq 0x7b062
jmp 0x6daa1
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movb $0x1, %bl
jmp 0x6df4b
movq %rax, %r14
movb $0x1, %bl
jmp 0x6df70
movq %rax, %r14
jmp 0x6df81
jmp 0x6e02e
movq %rax, %r14
leaq 0x88(%rsp), %rdi
callq 0x7c17e
jmp 0x6ded7
movq %rax, %r14
movq 0x1a8(%rsp), %rdi
leaq 0x1b8(%rsp), %rax
cmpq %rax, %rdi
je 0x6e031
movq 0x1b8(%rsp), %rsi
jmp 0x6e01f
jmp 0x6e02e
movq %rax, %r14
movb $0x1, %bl
jmp 0x6dfcc
movq %rax, %r14
movb $0x1, %bl
jmp 0x6dff1
movq %rax, %r14
jmp 0x6e002
jmp 0x6e02e
movq %rax, %r14
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x6df4b
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x6df70
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x5260
testb %bl, %bl
je 0x6df81
movl $0x48, %esi
movq %r15, %rdi
callq 0x5260
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x6e031
movq 0xd0(%rsp), %rsi
jmp 0x6e01f
movq %rax, %r14
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x6dfcc
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x188(%rsp), %rdi
leaq 0x198(%rsp), %rax
cmpq %rax, %rdi
je 0x6dff1
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x5260
testb %bl, %bl
je 0x6e002
movl $0x48, %esi
movq %r15, %rdi
callq 0x5260
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x6e031
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x6e031
jmp 0x6e0fc
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x7b062
jmp 0x6e0ff
movq %rax, %r14
jmp 0x6e0d3
movq %rax, %r14
jmp 0x6e0b7
movq %rax, %r14
jmp 0x6e09b
movq %rax, %r14
jmp 0x6e076
movq %rax, %r14
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x6e076
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x6e09b
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6e0b7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x6e0d3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x6e0ff
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x6e0ff
jmp 0x6e0fc
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6e11b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5260
movq %r14, %rdi
callq 0x53d0