// File: sighingnow[P]compile-pascal/pl0_tac_gen.cpp
// Function: pl0_tac_param[abi:cxx11](pl0_ast_param_list const*)
vector<string> pl0_tac_param(pl0_ast_param_list const *param) {
    cout << __func__;
    // set up new flag, new scope.
    valtb.tag(); vartb.tag();
    
    if (!param) { return vector<string>(); } // no parameter.
    vector<string> type;
    for (auto && group: param->params) {
        for (auto && id: group->ids) {
            // validte.
            if (vartb.find(id->id, false) || id->id == scope.back()) {
                pl0_ast_error(id->loc, string("duplicate parameter ") + id->id);
            }
            vartb.push(variable(id->id, group->type->type, group->type->type)); // add parameters to symbol table.
            if (group->is_ref) {
                type.emplace_back(string("ref_") + group->type->type);
                irb.emit("paramref", new Value(id->id, group->type->type), new Value(group->type->type, "string"));
            }
            else {
                type.emplace_back(group->type->type);
                irb.emit("param", new Value(id->id, group->type->type), new Value(group->type->type, "string"));
            }
        }
    }
    return type;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3b0, %rsp            # imm = 0x3B0
movq %rdi, -0x348(%rbp)
movq %rdi, %rax
movq %rax, -0x340(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0xad67d(%rip), %rdi     # 0x15efd8
leaq 0x402cd(%rip), %rsi     # 0xf1c2f
callq 0x5330
leaq 0xaedda(%rip), %rdi     # 0x160748
callq 0xbe050
leaq 0xaed9e(%rip), %rdi     # 0x160718
callq 0xbe090
cmpq $0x0, -0x10(%rbp)
jne 0xb19aa
movq -0x348(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x51c0
movq -0x348(%rbp), %rdi
callq 0xbda00
jmp 0xb2393
movq -0x348(%rbp), %rdi
movb $0x0, -0x11(%rbp)
callq 0xbda00
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x35660
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x35690
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xbf030
testb $0x1, %al
jne 0xb19f6
jmp 0xb236d
leaq -0x28(%rbp), %rdi
callq 0xbf070
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x5aed0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x5c6f0
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xbea30
testb $0x1, %al
jne 0xb1a42
jmp 0xb235d
leaq -0x48(%rbp), %rdi
callq 0x5ced0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %rsi
addq $0x8, %rsi
leaq 0xaecb7(%rip), %rdi     # 0x160718
xorl %edx, %edx
callq 0xbe7c0
movb %al, -0x349(%rbp)
jmp 0xb1a70
movb -0x349(%rbp), %al
testb $0x1, %al
jne 0xb1ab2
jmp 0xb1a7c
movq -0x58(%rbp), %rax
movq (%rax), %rax
addq $0x8, %rax
movq %rax, -0x358(%rbp)
leaq 0xaec6b(%rip), %rdi     # 0x160700
callq 0xbe5f0
movq -0x358(%rbp), %rdi
movq %rax, %rsi
callq 0x19db0
testb $0x1, %al
jne 0xb1ab2
jmp 0xb1ba9
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x70(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x55d0
movq -0x360(%rbp), %rdx
leaq 0x3f607(%rip), %rsi     # 0xf10e8
leaq -0xb0(%rbp), %rdi
callq 0x19840
jmp 0xb1aef
movq -0x58(%rbp), %rax
movq (%rax), %rdx
addq $0x8, %rdx
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x1a4d0
jmp 0xb1b0f
movq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xae910
jmp 0xb1b21
leaq -0x90(%rbp), %rdi
callq 0x5200
leaq -0xb0(%rbp), %rdi
callq 0x5200
leaq -0xb1(%rbp), %rdi
callq 0x53c0
jmp 0xb1ba9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb2385
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb1b98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb1b8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x5200
leaq -0xb0(%rbp), %rdi
callq 0x5200
leaq -0xb1(%rbp), %rdi
callq 0x53c0
jmp 0xb2385
movq -0x58(%rbp), %rax
movq (%rax), %rsi
addq $0x8, %rsi
leaq -0x140(%rbp), %rdi
callq 0x5150
jmp 0xb1bc2
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
leaq -0x160(%rbp), %rdi
callq 0x5150
jmp 0xb1bdf
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
leaq -0x180(%rbp), %rdi
callq 0x5150
jmp 0xb1bfc
leaq -0x120(%rbp), %rdi
leaq -0x140(%rbp), %rsi
leaq -0x160(%rbp), %rdx
leaq -0x180(%rbp), %rcx
callq 0xa0430
jmp 0xb1c1f
leaq 0xaeaf2(%rip), %rdi     # 0x160718
leaq -0x120(%rbp), %rsi
callq 0xbea70
jmp 0xb1c34
leaq -0x120(%rbp), %rdi
callq 0xbeaa0
leaq -0x180(%rbp), %rdi
callq 0x5200
leaq -0x160(%rbp), %rdi
callq 0x5200
leaq -0x140(%rbp), %rdi
callq 0x5200
movq -0x38(%rbp), %rax
movq (%rax), %rax
testb $0x1, 0x28(%rax)
je 0xb2078
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x368(%rbp)
callq 0x55d0
movq -0x368(%rbp), %rdx
leaq 0x3f467(%rip), %rsi     # 0xf10fd
leaq -0x1c0(%rbp), %rdi
callq 0x19840
jmp 0xb1ca4
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rdx
addq $0x8, %rdx
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x1a4d0
jmp 0xb1cc8
movq -0x348(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0xbf090
jmp 0xb1cdd
leaq -0x1a0(%rbp), %rdi
callq 0x5200
leaq -0x1c0(%rbp), %rdi
callq 0x5200
leaq -0x1c1(%rbp), %rdi
callq 0x53c0
leaq -0x1e9(%rbp), %rdi
movq %rdi, -0x370(%rbp)
callq 0x55d0
movq -0x370(%rbp), %rdx
leaq 0x3f3e0(%rip), %rsi     # 0xf1102
leaq -0x1e8(%rbp), %rdi
callq 0x19840
jmp 0xb1d30
movl $0x48, %edi
callq 0x5340
movq %rax, -0x378(%rbp)
jmp 0xb1d43
movb $0x1, -0x231(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %rsi
addq $0x8, %rsi
leaq -0x210(%rbp), %rdi
callq 0x5150
jmp 0xb1d63
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
leaq -0x230(%rbp), %rdi
callq 0x5150
jmp 0xb1d80
movq -0x378(%rbp), %rdi
leaq -0x210(%rbp), %rsi
leaq -0x230(%rbp), %rdx
callq 0xbeae0
jmp 0xb1d9c
movb $0x0, -0x231(%rbp)
movl $0x48, %edi
callq 0x5340
movq %rax, -0x380(%rbp)
jmp 0xb1db6
movb $0x1, -0x27a(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
leaq -0x258(%rbp), %rdi
callq 0x5150
jmp 0xb1dda
leaq -0x279(%rbp), %rdi
movq %rdi, -0x388(%rbp)
callq 0x55d0
movq -0x388(%rbp), %rdx
leaq 0x3fba5(%rip), %rsi     # 0xf19a0
leaq -0x278(%rbp), %rdi
callq 0x19840
jmp 0xb1e09
movq -0x380(%rbp), %rdi
leaq -0x258(%rbp), %rsi
leaq -0x278(%rbp), %rdx
callq 0xbeae0
jmp 0xb1e25
movq -0x380(%rbp), %rcx
movq -0x378(%rbp), %rdx
movb $0x0, -0x27a(%rbp)
leaq 0xae88f(%rip), %rdi     # 0x1606d0
xorl %eax, %eax
movl %eax, %r8d
leaq -0x1e8(%rbp), %rsi
callq 0xbdf00
jmp 0xb1e54
leaq -0x278(%rbp), %rdi
callq 0x5200
leaq -0x279(%rbp), %rdi
callq 0x53c0
leaq -0x258(%rbp), %rdi
callq 0x5200
leaq -0x230(%rbp), %rdi
callq 0x5200
leaq -0x210(%rbp), %rdi
callq 0x5200
leaq -0x1e8(%rbp), %rdi
callq 0x5200
leaq -0x1e9(%rbp), %rdi
callq 0x53c0
jmp 0xb234d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb1f07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb1efb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb1eef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xbeaa0
leaq -0x180(%rbp), %rdi
callq 0x5200
leaq -0x160(%rbp), %rdi
callq 0x5200
leaq -0x140(%rbp), %rdi
callq 0x5200
jmp 0xb2385
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb1f58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb1f4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x5200
leaq -0x1c0(%rbp), %rdi
callq 0x5200
leaq -0x1c1(%rbp), %rdi
callq 0x53c0
jmp 0xb2385
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb2067
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb205b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb203d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb2031
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb2025
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb2007
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb1fef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x5200
leaq -0x279(%rbp), %rdi
callq 0x53c0
leaq -0x258(%rbp), %rdi
callq 0x5200
testb $0x1, -0x27a(%rbp)
jne 0xb2012
jmp 0xb2023
movq -0x380(%rbp), %rdi
movl $0x48, %esi
callq 0x5350
jmp 0xb2025
leaq -0x230(%rbp), %rdi
callq 0x5200
leaq -0x210(%rbp), %rdi
callq 0x5200
testb $0x1, -0x231(%rbp)
jne 0xb2048
jmp 0xb2059
movq -0x378(%rbp), %rdi
movl $0x48, %esi
callq 0x5350
jmp 0xb205b
leaq -0x1e8(%rbp), %rdi
callq 0x5200
leaq -0x1e9(%rbp), %rdi
callq 0x53c0
jmp 0xb2385
movq -0x348(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
callq 0xbeeb0
jmp 0xb2095
leaq -0x2a1(%rbp), %rdi
movq %rdi, -0x390(%rbp)
callq 0x55d0
movq -0x390(%rbp), %rdx
leaq 0x3f055(%rip), %rsi     # 0xf110b
leaq -0x2a0(%rbp), %rdi
callq 0x19840
jmp 0xb20c4
movl $0x48, %edi
callq 0x5340
movq %rax, -0x398(%rbp)
jmp 0xb20d7
movb $0x1, -0x2e9(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %rsi
addq $0x8, %rsi
leaq -0x2c8(%rbp), %rdi
callq 0x5150
jmp 0xb20f7
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
leaq -0x2e8(%rbp), %rdi
callq 0x5150
jmp 0xb2114
movq -0x398(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
leaq -0x2e8(%rbp), %rdx
callq 0xbeae0
jmp 0xb2130
movb $0x0, -0x2e9(%rbp)
movl $0x48, %edi
callq 0x5340
movq %rax, -0x3a0(%rbp)
jmp 0xb214a
movb $0x1, -0x332(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
leaq -0x310(%rbp), %rdi
callq 0x5150
jmp 0xb216e
leaq -0x331(%rbp), %rdi
movq %rdi, -0x3a8(%rbp)
callq 0x55d0
movq -0x3a8(%rbp), %rdx
leaq 0x3f811(%rip), %rsi     # 0xf19a0
leaq -0x330(%rbp), %rdi
callq 0x19840
jmp 0xb219d
movq -0x3a0(%rbp), %rdi
leaq -0x310(%rbp), %rsi
leaq -0x330(%rbp), %rdx
callq 0xbeae0
jmp 0xb21b9
movq -0x3a0(%rbp), %rcx
movq -0x398(%rbp), %rdx
movb $0x0, -0x332(%rbp)
leaq 0xae4fb(%rip), %rdi     # 0x1606d0
xorl %eax, %eax
movl %eax, %r8d
leaq -0x2a0(%rbp), %rsi
callq 0xbdf00
jmp 0xb21e8
leaq -0x330(%rbp), %rdi
callq 0x5200
leaq -0x331(%rbp), %rdi
callq 0x53c0
leaq -0x310(%rbp), %rdi
callq 0x5200
leaq -0x2e8(%rbp), %rdi
callq 0x5200
leaq -0x2c8(%rbp), %rdi
callq 0x5200
leaq -0x2a0(%rbp), %rdi
callq 0x5200
leaq -0x2a1(%rbp), %rdi
callq 0x53c0
jmp 0xb234d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb233f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb2333
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb2315
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb2309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb22fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb22df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xb22c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x330(%rbp), %rdi
callq 0x5200
leaq -0x331(%rbp), %rdi
callq 0x53c0
leaq -0x310(%rbp), %rdi
callq 0x5200
testb $0x1, -0x332(%rbp)
jne 0xb22ea
jmp 0xb22fb
movq -0x3a0(%rbp), %rdi
movl $0x48, %esi
callq 0x5350
jmp 0xb22fd
leaq -0x2e8(%rbp), %rdi
callq 0x5200
leaq -0x2c8(%rbp), %rdi
callq 0x5200
testb $0x1, -0x2e9(%rbp)
jne 0xb2320
jmp 0xb2331
movq -0x398(%rbp), %rdi
movl $0x48, %esi
callq 0x5350
jmp 0xb2333
leaq -0x2a0(%rbp), %rdi
callq 0x5200
leaq -0x2a1(%rbp), %rdi
callq 0x53c0
jmp 0xb2385
jmp 0xb234f
leaq -0x48(%rbp), %rdi
callq 0xbeb50
jmp 0xb1a2c
jmp 0xb235f
leaq -0x28(%rbp), %rdi
callq 0xbf110
jmp 0xb19e0
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0xb2383
movq -0x348(%rbp), %rdi
callq 0xbda20
jmp 0xb2393
movq -0x348(%rbp), %rdi
callq 0xbda20
jmp 0xb23a3
movq -0x340(%rbp), %rax
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x55b0
nopl (%rax)