// File: 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
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x230(%rbp)
movq 0x10(%rax), %rdi
addq $0x558, %rdi            # imm = 0x558
leaq -0x14(%rbp), %rsi
callq 0x49790
movq %rax, -0x20(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x497c0
movq %rax, %rcx
movq -0x230(%rbp), %rax
movq 0x8(%rcx), %rcx
movq %rcx, -0x28(%rbp)
movq 0x8(%rax), %rax
movl -0x14(%rbp), %ecx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x433c1
movq -0x230(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x558, %rdi            # imm = 0x558
callq 0x368a0
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x36870
testb $0x1, %al
jne 0x43035
jmp 0x4318b
leaq -0x51(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x45f0
movq -0x238(%rbp), %rdx
leaq 0x4ccdf(%rip), %rsi     # 0x8fd32
leaq -0x50(%rbp), %rdi
callq 0x4450
jmp 0x4305e
leaq -0x51(%rbp), %rdi
callq 0x4380
movl -0x14(%rbp), %esi
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x3b620
movq -0x240(%rbp), %rsi
leaq 0x4ccb0(%rip), %rdx     # 0x8fd3b
leaq -0x88(%rbp), %rdi
callq 0x15ed0
jmp 0x43099
leaq -0x50(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x43f0
jmp 0x430ab
leaq -0x88(%rbp), %rdi
callq 0x4688
leaq -0xa8(%rbp), %rdi
callq 0x4688
movl $0x28, %edi
callq 0x41c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x248(%rbp)
movl $0x1, %esi
leaq -0x50(%rbp), %rdx
callq 0x73a90
jmp 0x430ea
movq -0x248(%rbp), %rdi
leaq 0x82c58(%rip), %rsi     # 0xc5d50
leaq -0x2d26f(%rip), %rdx    # 0x15e90
callq 0x45b0
jmp 0x437a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x4380
jmp 0x4379a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x43149
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x4688
leaq -0xa8(%rbp), %rdi
callq 0x4688
jmp 0x4317d
movq -0x248(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x4280
jmp 0x4317d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4688
jmp 0x4379a
movq -0x230(%rbp), %rsi
movq -0x28(%rbp), %rdi
callq 0x497f0
movq %rax, -0xb8(%rbp)
leaq -0xb8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x28(%rbp), %rdi
callq 0x49850
movq -0x250(%rbp), %rdi
movq %rax, -0xc0(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x29e80
testb $0x1, %al
jne 0x431ea
jmp 0x433a8
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x45f0
movq -0x258(%rbp), %rdx
leaq 0x4cb3e(%rip), %rsi     # 0x8fd49
leaq -0xe0(%rbp), %rdi
callq 0x4450
jmp 0x43219
leaq -0xe1(%rbp), %rdi
callq 0x4380
movl -0x14(%rbp), %esi
leaq -0x128(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x3b620
movq -0x260(%rbp), %rsi
leaq 0x4ca7f(%rip), %rdx     # 0x8fcc8
leaq -0x108(%rbp), %rdi
callq 0x15ed0
jmp 0x43257
leaq -0xe0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x43f0
jmp 0x4326c
leaq -0x108(%rbp), %rdi
callq 0x4688
leaq -0x128(%rbp), %rdi
callq 0x4688
movq -0x230(%rbp), %rax
movq (%rax), %rsi
leaq -0x148(%rbp), %rdi
callq 0x15db0
jmp 0x4329c
leaq -0xe0(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x43f0
jmp 0x432b1
leaq -0x148(%rbp), %rdi
callq 0x4688
movl $0x28, %edi
callq 0x41c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x268(%rbp)
movl $0x3, %esi
leaq -0xe0(%rbp), %rdx
callq 0x73a90
jmp 0x432e7
movq -0x268(%rbp), %rdi
leaq 0x82a5b(%rip), %rsi     # 0xc5d50
leaq -0x2d46c(%rip), %rdx    # 0x15e90
callq 0x45b0
jmp 0x437a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xe1(%rbp), %rdi
callq 0x4380
jmp 0x4379a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x43349
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x4688
leaq -0x128(%rbp), %rdi
callq 0x4688
jmp 0x43397
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x43397
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x4688
jmp 0x43397
movq -0x268(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x4280
leaq -0xe0(%rbp), %rdi
callq 0x4688
jmp 0x4379a
movq -0xb0(%rbp), %rdi
callq 0x53060
addq $0x8, %rax
movq %rax, -0x8(%rbp)
jmp 0x4378d
movq -0x230(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x26c(%rbp)
subl $0x6, %eax
je 0x4343c
jmp 0x433d8
movl -0x26c(%rbp), %eax
subl $0x8, %eax
je 0x433f5
jmp 0x433e5
movl -0x26c(%rbp), %eax
subl $0xb, %eax
je 0x4343c
jmp 0x43483
cmpl $0x100000, -0x14(%rbp)  # imm = 0x100000
jne 0x4343a
movq -0x230(%rbp), %rdi
callq 0x3f850
movq -0x230(%rbp), %rsi
movq -0x28(%rbp), %rdi
callq 0x497f0
movq %rax, -0x150(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x53060
addq $0x8, %rax
movq %rax, -0x8(%rbp)
jmp 0x4378d
jmp 0x43485
cmpl $0x200000, -0x14(%rbp)  # imm = 0x200000
jne 0x43481
movq -0x230(%rbp), %rdi
callq 0x3fb70
movq -0x230(%rbp), %rsi
movq -0x28(%rbp), %rdi
callq 0x497f0
movq %rax, -0x158(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x53060
addq $0x8, %rax
movq %rax, -0x8(%rbp)
jmp 0x4378d
jmp 0x43485
jmp 0x43485
movq -0x230(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x60, %rdi
movq (%rax), %rsi
callq 0x340a0
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rdi
callq 0x34240
movq %rax, -0x168(%rbp)
movq -0x160(%rbp), %rdi
callq 0x34270
movq %rax, -0x170(%rbp)
leaq -0x168(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x342a0
testb $0x1, %al
jne 0x434e5
jmp 0x435d2
leaq -0x168(%rbp), %rdi
callq 0x342e0
movq %rax, %rcx
movq -0x230(%rbp), %rax
movq %rcx, -0x178(%rbp)
movq 0x10(%rax), %rdi
movq -0x178(%rbp), %rax
movq (%rax), %rsi
callq 0x34080
movq -0x230(%rbp), %rdx
movq %rax, -0x180(%rbp)
movq 0x10(%rdx), %rax
addq $0x588, %rax            # imm = 0x588
movq %rax, -0x278(%rbp)
addq $0x18, %rdx
movq -0x180(%rbp), %rcx
addq $0x18, %rcx
leaq -0x194(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x530c0
movq -0x278(%rbp), %rdi
leaq -0x194(%rbp), %rsi
callq 0x53080
movq %rax, %rcx
movq -0x230(%rbp), %rax
movq %rcx, -0x188(%rbp)
movq 0x10(%rax), %rdi
addq $0x588, %rdi            # imm = 0x588
callq 0x53130
movq %rax, -0x1a0(%rbp)
leaq -0x188(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x53100
testb $0x1, %al
jne 0x435a7
jmp 0x435bf
movq -0x180(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x42fa0
movq %rax, -0x8(%rbp)
jmp 0x4378d
jmp 0x435c1
leaq -0x168(%rbp), %rdi
callq 0x34300
jmp 0x434c9
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x45f0
movq -0x280(%rbp), %rdx
leaq 0x4c756(%rip), %rsi     # 0x8fd49
leaq -0x1c0(%rbp), %rdi
callq 0x4450
jmp 0x43601
leaq -0x1c1(%rbp), %rdi
callq 0x4380
movl -0x14(%rbp), %esi
leaq -0x208(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x3b620
movq -0x288(%rbp), %rsi
leaq 0x4c697(%rip), %rdx     # 0x8fcc8
leaq -0x1e8(%rbp), %rdi
callq 0x15ed0
jmp 0x4363f
leaq -0x1c0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x43f0
jmp 0x43654
leaq -0x1e8(%rbp), %rdi
callq 0x4688
leaq -0x208(%rbp), %rdi
callq 0x4688
movq -0x230(%rbp), %rax
movq (%rax), %rsi
leaq -0x228(%rbp), %rdi
callq 0x15db0
jmp 0x43684
leaq -0x1c0(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x43f0
jmp 0x43699
leaq -0x228(%rbp), %rdi
callq 0x4688
movl $0x28, %edi
callq 0x41c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x290(%rbp)
movl $0x2, %esi
leaq -0x1c0(%rbp), %rdx
callq 0x73a90
jmp 0x436cf
movq -0x290(%rbp), %rdi
leaq 0x82673(%rip), %rsi     # 0xc5d50
leaq -0x2d854(%rip), %rdx    # 0x15e90
callq 0x45b0
jmp 0x437a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1c1(%rbp), %rdi
callq 0x4380
jmp 0x4379a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x43731
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x4688
leaq -0x208(%rbp), %rdi
callq 0x4688
jmp 0x4377f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x4377f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x4688
jmp 0x4377f
movq -0x290(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x4280
leaq -0x1c0(%rbp), %rdi
callq 0x4688
jmp 0x4379a
movq -0x8(%rbp), %rax
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x45e0
nopw %cs:(%rax,%rax)
nopl (%rax)