// File: /workspace/github_cpp_makefile_star2_O2/acliusBackHome[P]kamaya/dist/ParseNode.cpp
// Function: ParseNode::collect_init_declarator() const
void ParseNode::collect_init_declarator() const {
    auto &the_map = tree.node_init_dec;
    InitDeclarator res(get_symbol(), ParseExpression(), get_ptr_lv(), vector<size_t>(), get_param_list_node());
    // 获取元祖引用以便修改其值
    // 初始化表达式可能会有变动
    ParseExpression &init_expression = get<1>(res);
    // 数组大小声明可能会有变动
    vector<size_t> &arr_size = get<3>(res);
    switch (type) {
        case N_DECLARATOR: {
            arr_size = get_array_size();
            break;
        }
        case N_INIT_DECLARATOR: {
            // 因为有两个表达式, 一个是初始化表达式, 一个是数组大小声明表达式
            // 所以get_expression在该节点有歧义, 必须分开
            for (const auto &each : tree.node_children[node_id]) {
                const ParseNode &child = tree.nodes[each];
                switch (child.type) {
                    case N_DECLARATOR: {
                        arr_size = child.get_array_size();
                        break;
                    }
                    case N_INITIALIZER : {
                        // TODO:其实可以只记录指针
                        init_expression = ParseExpression(child.get_expression());
                        break;
                    }
                    default:
                        break;
                }
            }
            break;
        }
        default: {
            string info = "ParseNode::collect_init_declarator(): node_type=";
            info += get_node_type_name(type);
            info += "node_id=" + to_string(node_id);
            throw ParseException(EX_NODE_NOT_ALLOW_OP, info);
        }
    }
    // 到此res就是抽取出的InitDeclarator
    // 这里强制转换成非常量指针来改变keys表示该节点拥有这个键值
    ((ParseNode *) this)->keys |= K_INIT_DEC;
    the_map[node_id] = res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
movl $0x4c8, %r14d           # imm = 0x4C8
addq 0x10(%rdi), %r14
callq 0x18e76
movq %rax, %r15
leaq -0x88(%rbp), %rdi
callq 0x24c58
movq %rbx, %rdi
callq 0x18ec6
movq %rax, -0xa8(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
andq $0x0, -0x40(%rbp)
movq %rbx, %rdi
callq 0x18ed8
leaq -0xb0(%rbp), %r9
movq %rax, (%r9)
leaq -0x128(%rbp), %rdi
leaq -0x88(%rbp), %rdx
leaq -0xa8(%rbp), %rcx
leaq -0x50(%rbp), %r8
movq %r15, %rsi
callq 0x1e180
movq %r14, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xd238
leaq -0x88(%rbp), %rdi
callq 0x25150
movl 0x18(%rbx), %eax
cmpl $0x6, %eax
je 0x1a070
cmpl $0xb, %eax
jne 0x1a0c4
leaq -0x100(%rbp), %r12
movq 0x10(%rbx), %rax
imulq $0x18, (%rbx), %rcx
movq 0x60(%rax), %rax
movq (%rax,%rcx), %r14
movq 0x8(%rax,%rcx), %r15
leaq -0x88(%rbp), %r13
cmpq %r15, %r14
je 0x1a087
movq 0x10(%rbx), %rax
movq (%r14), %rcx
movq (%rax), %rax
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdi
movl 0x18(%rax,%rcx), %eax
cmpl $0xd, %eax
je 0x1a047
cmpl $0x6, %eax
jne 0x1a06a
callq 0x18efc
leaq -0x120(%rbp), %rdi
movq %rax, %rsi
callq 0x1e062
jmp 0x1a06a
callq 0x18eec
movq %r13, %rdi
movq %rax, %rsi
callq 0x24d02
movq %r12, %rdi
movq %r13, %rsi
callq 0x25250
movq %r13, %rdi
callq 0x25150
addq $0x8, %r14
jmp 0x1a00c
movq %rbx, %rdi
callq 0x18efc
leaq -0x120(%rbp), %rdi
movq %rax, %rsi
callq 0x1e062
orb $0x20, 0xa(%rbx)
movq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x1e12e
leaq -0x128(%rbp), %rsi
movq %rax, %rdi
callq 0x21066
leaq -0x128(%rbp), %rdi
callq 0x10f30
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20ba5(%rip), %rsi     # 0x3ac70
leaq -0x88(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x4130
movl 0x18(%rbx), %esi
leaq -0x50(%rbp), %r14
movq %r14, %rdi
callq 0x17f38
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq 0x4580
leaq -0x50(%rbp), %rdi
callq 0x4598
movq (%rbx), %rsi
leaq -0xa8(%rbp), %rdi
callq 0xc865
leaq 0x205d9(%rip), %rsi     # 0x3a6f1
leaq -0x50(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0xc837
leaq -0x88(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4580
leaq -0x50(%rbp), %rdi
callq 0x4598
leaq -0xa8(%rbp), %rdi
callq 0x4598
pushq $0x28
popq %rdi
callq 0x4180
movq %rax, %r14
pushq $0x4
popq %rsi
leaq -0x88(%rbp), %rdx
movq %rax, %rdi
callq 0x2b53c
leaq 0x38bff(%rip), %rsi     # 0x52d70
leaq -0xd8d0(%rip), %rdx     # 0xc8a8
movq %r14, %rdi
callq 0x44e0
jmp 0x1a1a9
movq %rax, %rbx
movq %r14, %rdi
callq 0x4220
jmp 0x1a1ba
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x4598
jmp 0x1a1a0
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
jmp 0x1a1b5
movq %rax, %rbx
jmp 0x1a1ba
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x4598
leaq -0x88(%rbp), %rdi
callq 0x4598
jmp 0x1a201
jmp 0x1a1fe
movq %rax, %rbx
jmp 0x1a1db
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0xd238
leaq -0x88(%rbp), %rdi
callq 0x25150
jmp 0x1a20d
jmp 0x1a1fe
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x25150
jmp 0x1a201
jmp 0x1a1fe
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x10f30
movq %rbx, %rdi
callq 0x4500
nop