// File: /workspace/github_cpp_makefile_star2_O2/acliusBackHome[P]kamaya/dist/ParseNode.cpp
// Function: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>& ParseNode::get_field<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(NodeKey) const
MapType &ParseNode::get_field(NodeKey key) const {
    const auto key_map_iter = tree.node_key2map.find(key);
    map<size_t, MapType> &the_map = *((map<size_t, MapType> *) (key_map_iter->second));
    typedef typename map<size_t, MapType>::iterator MapIter;
    if (keys & key) {
        // 当前节点标记中有该key记录
        // 找该key对应的map
        if (key_map_iter == tree.node_key2map.end()) {
            // 但是没有找到key对应的记录
            // 说明没有定义key对应的map, 有bug
            string info = "NodeKey:";
            info += get_key_name(key) + " not defined.";
            throw ParseException(EX_NODE_KEY_NOT_DEFINED, info);
        }
        const MapIter &iter = the_map.find(node_id);
        if (iter == the_map.end()) {
            // 该节点标记有该记录, 但是对应的map中找不到该节点id的记录, 数据一致性被破坏 有bug
            string info = "ParseNode::get_field(NodeKey key): key=";
            info += get_key_name(key) + ", node_id=";
            info += to_string(node_id);
            throw ParseException(EX_NODE_KEY_DEFINED_NOT_FOUND, info);
        }
        return iter->second;
    } else {
        // 当前节点没有该记录
        // 有些节点是需要收集子树的信息来生成自身节点的信息, 所以需要先做一些动作进行收集信息
        switch (type) {
            case N_PARAM_LIST: {
                if (key == K_PARAM_LIST) {
                    collect_parameters_list();
                    return the_map.find(node_id)->second;
                }
                break;
            }
            case N_DECLARATOR:
            case N_INIT_DECLARATOR: {
                if (key == K_INIT_DEC) {
                    collect_init_declarator();
                    return the_map.find(node_id)->second;
                }
                break;
            }
            default:
                break;
        }
        // 试图向下搜索节点
        for (const auto &child_id: tree.node_children[node_id]) {
            const auto &child = tree.nodes[child_id];
            auto iter = tree.search_able.find(HasNodeKey(key, type, child.type));
            if (iter != tree.search_able.end()) {
                // 找到了记录, 说明该子节点存在唯一的key记录, 返回之
                return child.get_field<MapType>(key);
            }
        }
        // 到这仍未返回, 表示该节点没有该key唯一信息,
        // 说明存在异常, 因为只有当节点一定有该key唯一信息时才会调用此函数
        string info = "ParseNode::get_field(NodeKey key): key=";
        info += get_key_name(key) + ", node_id=";
        info += to_string(node_id);
        throw ParseException(EX_NODE_NO_SUCH_KEY, info);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq -0x2c(%rbp), %r15
movl %esi, (%r15)
movl $0x558, %edi            # imm = 0x558
addq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x1e254
movq 0x28(%rax), %r14
movl (%r15), %ecx
testl %ecx, 0x8(%rbx)
je 0x1b7f7
movl $0x560, %ecx            # imm = 0x560
addq 0x10(%rbx), %rcx
cmpq %rcx, %rax
je 0x1b964
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1e288
addq $0x8, %r14
cmpq %r14, %rax
je 0x1b9f4
addq $0x28, %rax
jmp 0x1b8a3
movl 0x18(%rbx), %eax
cmpl $0x6, %eax
je 0x1b81b
cmpl $0xb, %eax
je 0x1b81b
cmpl $0x8, %eax
jne 0x1b838
cmpl $0x100000, %ecx         # imm = 0x100000
jne 0x1b838
movq %rbx, %rdi
callq 0x19d7a
jmp 0x1b82b
cmpl $0x200000, %ecx         # imm = 0x200000
jne 0x1b838
movq %rbx, %rdi
callq 0x19f38
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1e288
jmp 0x1b7ee
movq 0x10(%rbx), %rdi
imulq $0x18, (%rbx), %rax
movq 0x60(%rdi), %rcx
movq (%rcx,%rax), %r12
movq 0x8(%rcx,%rax), %r13
cmpq %r13, %r12
je 0x1b8b2
movq (%r12), %r14
movq (%rdi), %r15
shlq $0x5, %r14
addq $0x588, %rdi            # imm = 0x588
movl 0x18(%r15,%r14), %eax
movl %eax, -0x70(%rbp)
movl 0x18(%rbx), %eax
movl %eax, -0x6c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x68(%rbp)
leaq -0x70(%rbp), %rsi
callq 0x20816
movq 0x10(%rbx), %rdi
leaq 0x590(%rdi), %rcx
addq $0x8, %r12
cmpq %rcx, %rax
je 0x1b84d
addq %r14, %r15
movl -0x2c(%rbp), %esi
movq %r15, %rdi
callq 0x1b78c
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f4b8(%rip), %rsi     # 0x3ad71
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x4130
movl -0x2c(%rbp), %esi
leaq -0x90(%rbp), %r14
movq %r14, %rdi
callq 0x17bd8
leaq 0x1f411(%rip), %rdx     # 0x3acf0
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0xc8d6
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4580
leaq -0x50(%rbp), %rdi
callq 0x4598
leaq -0x90(%rbp), %rdi
callq 0x4598
movq (%rbx), %rsi
leaq -0x50(%rbp), %rdi
callq 0xc865
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4580
leaq -0x50(%rbp), %rdi
callq 0x4598
pushq $0x28
popq %rdi
callq 0x4180
movq %rax, %r14
pushq $0x2
popq %rsi
leaq -0x70(%rbp), %rdx
movq %rax, %rdi
callq 0x2b53c
leaq 0x37420(%rip), %rsi     # 0x52d70
leaq -0xf0af(%rip), %rdx     # 0xc8a8
movq %r14, %rdi
callq 0x44e0
jmp 0x1baa1
leaq 0x1f3ef(%rip), %rsi     # 0x3ad5a
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x4130
movl -0x2c(%rbp), %esi
leaq -0x90(%rbp), %rbx
movq %rbx, %rdi
callq 0x17bd8
leaq 0x1f3d2(%rip), %rdx     # 0x3ad63
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0xc8d6
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4580
leaq -0x50(%rbp), %rdi
callq 0x4598
leaq -0x90(%rbp), %rdi
callq 0x4598
pushq $0x28
popq %rdi
callq 0x4180
movq %rax, %r14
pushq $0x1
popq %rsi
leaq -0x70(%rbp), %rdx
movq %rax, %rdi
callq 0x2b53c
leaq 0x37390(%rip), %rsi     # 0x52d70
leaq -0xf13f(%rip), %rdx     # 0xc8a8
movq %r14, %rdi
callq 0x44e0
jmp 0x1baa1
leaq 0x1f376(%rip), %rsi     # 0x3ad71
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x4130
movl -0x2c(%rbp), %esi
leaq -0x90(%rbp), %r14
movq %r14, %rdi
callq 0x17bd8
leaq 0x1f2cf(%rip), %rdx     # 0x3acf0
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0xc8d6
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4580
leaq -0x50(%rbp), %rdi
callq 0x4598
leaq -0x90(%rbp), %rdi
callq 0x4598
movq (%rbx), %rsi
leaq -0x50(%rbp), %rdi
callq 0xc865
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4580
leaq -0x50(%rbp), %rdi
callq 0x4598
pushq $0x28
popq %rdi
callq 0x4180
movq %rax, %r14
pushq $0x3
popq %rsi
leaq -0x70(%rbp), %rdx
movq %rax, %rdi
callq 0x2b53c
leaq 0x372de(%rip), %rsi     # 0x52d70
leaq -0xf1f1(%rip), %rdx     # 0xc8a8
movq %r14, %rdi
callq 0x44e0
jmp 0x1bad1
jmp 0x1bab3
jmp 0x1bac4
jmp 0x1bad1
jmp 0x1bad1
jmp 0x1bab3
jmp 0x1bad6
jmp 0x1bad6
jmp 0x1bad1
movq %rax, %rbx
movq %r14, %rdi
callq 0x4220
jmp 0x1baf3
jmp 0x1bae4
jmp 0x1bae4
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
jmp 0x1baee
jmp 0x1bafe
jmp 0x1bafe
movq %rax, %rbx
jmp 0x1baf3
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x4598
jmp 0x1bae7
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x4598
leaq -0x70(%rbp), %rdi
callq 0x4598
jmp 0x1bb01
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4500
nop