// File: /workspace/github_cpp_makefile_star2_O2/sighingnow[P]compile-pascal/pl0_tac_gen.cpp
// Function: pl0_tac_const_stmt(pl0_ast_const_stmt const*)
void pl0_tac_const_stmt(pl0_ast_const_stmt const *stmts) {
    cout << __func__;
    if (!stmts) { return; }
    for (auto && def: stmts->stmt) {
        string id = def->id->id;
        // validate.
        if (!scope.empty() && id == scope.back()) {
            pl0_ast_error(def->id->loc, string("duplicate identifier ") + "\"" + id + "\"");
        }
        else if (valtb.find(id, false) || vartb.find(id, false)) {
            pl0_ast_error(def->id->loc, string("redefinition of ") + "\"" + id + "\"");
        }
        else {
            valtb.push(constant(id, def->val->val, (def->val->dt == pl0_ast_constv::INT ? "integer" : "char"))); // update symbol table.
        }
    }
    cout << __func__;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
movq 0x4d0a7(%rip), %rdi     # 0x8afd8
leaq 0x1d607(%rip), %rsi     # 0x5b53f
callq 0x5250
testq %rbx, %rbx
je 0x3e195
movq 0x8(%rbx), %rbp
movq 0x10(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0xd8(%rsp), %rbx
cmpq 0x8(%rsp), %rbp
je 0x3e182
movq (%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x8, %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x5340
movq 0x4e682(%rip), %rsi     # 0x8c608
cmpq %rsi, 0x4e673(%rip)     # 0x8c600
je 0x3e01e
addq $-0x20, %rsi
movq %r14, %rdi
callq 0xfb78
testb %al, %al
je 0x3e01e
movq (%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %r14
leaq 0x30(%rsp), %r12
movq %r12, %rdi
leaq 0x1c9b7(%rip), %rsi     # 0x5a974
leaq 0x7(%rsp), %rdx
callq 0xfa26
movq %rbx, %r13
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x1d04c(%rip), %rdx     # 0x5b023
callq 0xfd14
leaq 0x70(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
leaq 0x10(%rsp), %rdx
callq 0xfda4
leaq 0x118(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
leaq 0x1d01d(%rip), %rdx     # 0x5b023
callq 0xfd14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3da88
movq %r15, %rdi
jmp 0x3e0c4
leaq 0x4e623(%rip), %rdi     # 0x8c648
movq %r14, %rsi
xorl %edx, %edx
callq 0x46d8a
testb %al, %al
jne 0x3e04e
leaq 0x4e5de(%rip), %rdi     # 0x8c618
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x46e8a
testb %al, %al
je 0x3e0f8
movq (%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %r14
leaq 0x30(%rsp), %r12
movq %r12, %rdi
leaq 0x1c922(%rip), %rsi     # 0x5a98a
leaq 0x7(%rsp), %rdx
callq 0xfa26
movq %rbx, %r13
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x1cfa1(%rip), %rdx     # 0x5b023
callq 0xfd14
leaq 0x70(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
leaq 0x10(%rsp), %rdx
callq 0xfda4
leaq 0xf8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
leaq 0x1cf72(%rip), %rdx     # 0x5b023
callq 0xfd14
movq %r14, %rdi
movq %r12, %rsi
callq 0x3da88
movq %r12, %rdi
callq 0x5120
leaq 0x70(%rsp), %rdi
callq 0x5120
movq %rbx, %rdi
callq 0x5120
leaq 0x30(%rsp), %rdi
callq 0x5120
leaq 0x10(%rsp), %rdi
callq 0x5120
addq $0x8, %rbp
jmp 0x3df5b
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5340
movq (%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0xc(%rax)
movl 0x8(%rax), %r14d
leaq 0x1b749(%rip), %rsi     # 0x59867
leaq 0x1afea(%rip), %rax     # 0x5910f
cmoveq %rax, %rsi
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
callq 0xfa26
leaq 0x70(%rsp), %r12
movq %r12, %rdi
leaq 0x50(%rsp), %rsi
movl %r14d, %edx
movq %r15, %rcx
callq 0x3bdf8
leaq 0x4e4ed(%rip), %rdi     # 0x8c648
movq %r12, %rsi
callq 0x483c4
movq %r12, %rdi
callq 0x46f8a
leaq 0xb8(%rsp), %rdi
callq 0x5120
leaq 0x50(%rsp), %rdi
jmp 0x3e0e0
movq 0x4ce4f(%rip), %rdi     # 0x8afd8
leaq 0x1d3af(%rip), %rsi     # 0x5b53f
callq 0x5250
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x46f8a
jmp 0x3e1b9
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x5120
jmp 0x3e1cb
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0x3e226
jmp 0x3e22d
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
jmp 0x3e205
jmp 0x3e1ee
jmp 0x3e1f5
jmp 0x3e1e9
jmp 0x3e22d
movq %rax, %rbx
jmp 0x3e221
movq %rax, %rbx
jmp 0x3e20a
jmp 0x3e22d
movq %rax, %rbx
jmp 0x3e214
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x5120
leaq 0x70(%rsp), %rdi
callq 0x5120
leaq 0xd8(%rsp), %rdi
callq 0x5120
leaq 0x30(%rsp), %rdi
callq 0x5120
jmp 0x3e230
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5120
movq %rbx, %rdi
callq 0x53f0