// File: /workspace/github_cpp_makefile_star2_O3/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 0x526ff(%rip), %rdi     # 0xb9fd8
leaq 0x2bc2f(%rip), %rsi     # 0x9350f
xorl %edx, %edx
callq 0x52e0
movq 0x8(%rbx), %r12
movq 0x10(%rbx), %rax
movq %rax, 0x1a0(%rsp)
cmpq %rax, %r12
je 0x67fc0
leaq 0x190(%rsp), %rbx
leaq 0x28(%rsp), %r14
leaq 0x2b6df(%rip), %rbp     # 0x92ff3
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 0x351dc
leaq 0x53ce0(%rip), %rdi     # 0xbb620
movq %r14, %rsi
xorl %edx, %edx
callq 0x761f8
testb %al, %al
jne 0x67991
leaq 0x53c9b(%rip), %rdi     # 0xbb5f0
movq %r14, %rsi
xorl %edx, %edx
callq 0x7635e
testb %al, %al
jne 0x67991
leaq 0x53ce6(%rip), %rdi     # 0xbb650
movq %r14, %rsi
xorl %edx, %edx
callq 0x765ba
testb %al, %al
jne 0x67991
leaq 0x53d01(%rip), %rdi     # 0xbb680
movq %r14, %rsi
xorl %edx, %edx
callq 0x76716
testb %al, %al
je 0x67c05
movq %rbp, %r13
movq (%r12), %rax
movq 0x8(%rax), %rax
movq (%rax), %r15
movq %rbx, 0x180(%rsp)
leaq 0x180(%rsp), %rbp
movq %rbp, %rdi
leaq 0x2afc6(%rip), %rsi     # 0x9297f
leaq 0x2afd5(%rip), %rdx     # 0x92995
callq 0x253d0
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 0x679fb
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x67a01
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 0x67a55
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x67a5b
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 0xd8(%rsp), %rsi
movq %rsi, 0xc8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x67ab4
movq %rdx, 0xc8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd8(%rsp)
jmp 0x67aba
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0xd0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc8(%rsp), %rdi
leaq 0x2aeb2(%rip), %rsi     # 0x92996
callq 0x5420
leaq 0x78(%rsp), %rsi
movq %rsi, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x67b11
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x67b17
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 0x65f40
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x67b58
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x67b7d
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x67b99
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x67bb5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x180(%rsp), %rdi
cmpq %rbx, %rdi
je 0x67bd2
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x67bee
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5260
addq $0x10, %r12
cmpq 0x1a0(%rsp), %r12
jne 0x67914
jmp 0x67fc0
movq 0x539d4(%rip), %rax     # 0xbb5e0
cmpq %rax, 0x539c5(%rip)     # 0xbb5d8
je 0x67c3f
movq 0x30(%rsp), %rdx
cmpq -0x18(%rax), %rdx
jne 0x67c3f
testq %rdx, %rdx
je 0x67991
movq -0x20(%rax), %rsi
movq 0x28(%rsp), %rdi
callq 0x5280
testl %eax, %eax
je 0x67991
leaq 0x53992(%rip), %rdi     # 0xbb5d8
movq %r14, %rsi
callq 0x76872
movq (%r12), %rbx
movq 0x5237f(%rip), %rdi     # 0xb9fd8
leaq 0x2b8af(%rip), %rsi     # 0x9350f
xorl %edx, %edx
callq 0x52e0
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x69547
leaq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
leaq 0x120(%rsp), %rdi
leaq 0x29c39(%rip), %rsi     # 0x918cd
leaq 0x29c3b(%rip), %rdx     # 0x918d6
callq 0x253d0
movl $0x48, %edi
callq 0x5250
leaq 0x160(%rsp), %rbx
movq %rax, %r15
leaq 0xa8(%rsp), %rdi
callq 0x693af
leaq 0x170(%rsp), %rax
movq %rax, 0x160(%rsp)
movq %rbx, %rdi
leaq 0x2b59c(%rip), %rsi     # 0x93278
leaq 0x2b59b(%rip), %rdx     # 0x9327e
callq 0x253d0
movq %rbx, %rdx
movb $0x1, %bl
movq %r15, %rdi
leaq 0xa8(%rsp), %rsi
callq 0x7653e
xorl %ebx, %ebx
leaq 0x538a2(%rip), %rdi     # 0xbb5a8
leaq 0x120(%rsp), %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x75c2c
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x67d40
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
leaq 0xc8(%rsp), %rbx
je 0x67d6d
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x67d92
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x5260
leaq 0x1a8(%rsp), %r15
movq %r15, %rdi
callq 0x693af
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x8(%rsp), %rdx
callq 0x6393c
leaq 0x53897(%rip), %rdi     # 0xbb650
movq %rbx, %rsi
callq 0x78798
leaq 0xe8(%rsp), %rdi
callq 0x757a6
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x67df3
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x1a8(%rsp), %rdi
leaq 0x1b8(%rsp), %rax
cmpq %rax, %rdi
je 0x67e18
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x5260
leaq 0x53831(%rip), %rdi     # 0xbb650
callq 0x75e2c
leaq 0x53855(%rip), %rdi     # 0xbb680
callq 0x75e6e
movq 0x8(%r12), %rdi
callq 0x66453
leaq 0x110(%rsp), %rax
movq %rax, 0x100(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x2aae2(%rip), %rsi     # 0x9293b
leaq 0x2aae2(%rip), %rdx     # 0x92942
callq 0x253d0
movl $0x48, %edi
callq 0x5250
movq %rax, %r15
leaq 0x88(%rsp), %rdi
callq 0x693af
leaq 0x150(%rsp), %rax
movq %rax, 0x140(%rsp)
leaq 0x140(%rsp), %r13
movq %r13, %rdi
leaq 0x2b3d7(%rip), %rsi     # 0x93278
leaq 0x2b3d6(%rip), %rdx     # 0x9327e
callq 0x253d0
movb $0x1, %bl
movq %r15, %rdi
leaq 0x88(%rsp), %rsi
movq %r13, %rdx
callq 0x7653e
xorl %ebx, %ebx
leaq 0x536dd(%rip), %rdi     # 0xbb5a8
leaq 0x100(%rsp), %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x75c2c
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x67f05
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
leaq 0x190(%rsp), %rbx
je 0x67f32
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x67f57
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x53682(%rip), %rax     # 0xbb5e0
leaq -0x20(%rax), %rcx
movq %rcx, 0x53677(%rip)     # 0xbb5e0
movq -0x20(%rax), %rdi
addq $-0x10, %rax
cmpq %rax, %rdi
je 0x67f81
movq (%rax), %rsi
incq %rsi
callq 0x5260
leaq 0x53698(%rip), %rdi     # 0xbb620
callq 0x76068
leaq 0x5365c(%rip), %rdi     # 0xbb5f0
callq 0x760cc
leaq 0x536b0(%rip), %rdi     # 0xbb650
callq 0x76130
leaq 0x536d4(%rip), %rdi     # 0xbb680
callq 0x76194
leaq 0x8(%rsp), %rdi
callq 0x757a6
jmp 0x67bd2
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x680ef
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x680ef
movq %rax, %r14
jmp 0x680ef
movq %rax, %r14
jmp 0x680fc
jmp 0x681a9
movq %rax, %r14
leaq 0xc8(%rsp), %rdi
callq 0x768c0
jmp 0x6802d
movq %rax, %r14
movq 0x1a8(%rsp), %rdi
leaq 0x1b8(%rsp), %rax
cmpq %rax, %rdi
je 0x681ac
movq 0x1b8(%rsp), %rsi
jmp 0x6819a
jmp 0x681a9
movq %rax, %r14
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x68170
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x68170
movq %rax, %r14
jmp 0x68170
movq %rax, %r14
jmp 0x6817d
jmp 0x681a9
movq %rax, %r14
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x680c6
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x680eb
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5260
testb %bl, %bl
je 0x680fc
movl $0x48, %esi
movq %r15, %rdi
callq 0x5260
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x681ac
movq 0x110(%rsp), %rsi
jmp 0x6819a
movq %rax, %r14
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x68147
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x6816c
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5260
testb %bl, %bl
je 0x6817d
movl $0x48, %esi
movq %r15, %rdi
callq 0x5260
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x681ac
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x681ac
jmp 0x68277
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x757a6
jmp 0x6827a
movq %rax, %r14
jmp 0x6824e
movq %rax, %r14
jmp 0x68232
movq %rax, %r14
jmp 0x68216
movq %rax, %r14
jmp 0x681f1
movq %rax, %r14
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x681f1
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x68216
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x68232
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x6824e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x6827a
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x6827a
jmp 0x68277
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x68296
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5260
movq %r14, %rdi
callq 0x53d0