// File: acliusBackHome[P]kamaya/dist/ParseDeclaration.cpp
// Function: ParseScope::get_variable_declaration(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
ParseVariable ParseScope::get_variable_declaration(const string &symbol) const {
    auto it = symbol2dec_ptr.find(symbol);
    if (it == symbol2dec_ptr.end()) {
        if (parent_scope == this_scope) {
            // 找不到变量声明
            string info = "ParseScope::get_variable_declaration(const string &symbol) symbol=" + symbol;
            throw ParseException(EX_NOT_DECLARED, info);
        }
        return get_scope(parent_scope).get_variable_declaration(symbol);
    }
    if (it->second.first != D_VARIABLE) {
        // 非变量声明
        string info = "ParseScope::get_variable_declaration(const string &symbol) symbol=" + symbol;
        throw ParseException(EX_DECLARATION_NOT_A_VARIABLE, info);
    }
    const auto &var_ptr_list = it->second.second;
    if (var_ptr_list.empty()) {
        // 声明了变量但是找不到其记录(BUG)
        string info = "ParseScope::get_variable_declaration(const string &symbol) symbol=" + symbol;
        throw ParseException(EX_DECLARATION_NOT_FOUND, info);
    }
    return *((ParseVariable *) var_ptr_list[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0xb8(%rbp)
movq %rdi, %rax
movq %rax, -0xb0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
addq $0x10, %rdi
movq -0x18(%rbp), %rsi
callq 0x6cbe0
movq -0xa8(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x10, %rdi
callq 0x6cc40
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x6cc10
testb $0x1, %al
jne 0x6ba4e
jmp 0x6bb21
movq -0xa8(%rbp), %rcx
movq (%rcx), %rax
cmpq 0x8(%rcx), %rax
jne 0x6bafa
movq -0x18(%rbp), %rdx
leaq 0x2557c(%rip), %rsi     # 0x90fe9
leaq -0x48(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x16320
movl $0x28, %edi
callq 0x41c0
movq -0xc8(%rbp), %rdx
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xc0(%rbp)
movl $0x7, %esi
callq 0x73a90
jmp 0x6baa7
movq -0xc0(%rbp), %rdi
leaq 0x5a29b(%rip), %rsi     # 0xc5d50
leaq -0x55c2c(%rip), %rdx    # 0x15e90
callq 0x45b0
jmp 0x6bcc0
movq -0xc0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0x4280
jmp 0x6baec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4688
jmp 0x6bcb7
movq -0xa8(%rbp), %rax
movq (%rax), %rdi
callq 0x6a860
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x6b9e0
jmp 0x6bca7
leaq -0x20(%rbp), %rdi
callq 0x6cc70
cmpl $0x2, 0x20(%rax)
je 0x6bbcc
movq -0x18(%rbp), %rdx
leaq 0x254aa(%rip), %rsi     # 0x90fe9
leaq -0x78(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x16320
movl $0x28, %edi
callq 0x41c0
movq -0xd8(%rbp), %rdx
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xd0(%rbp)
movl $0x8, %esi
callq 0x73a90
jmp 0x6bb79
movq -0xd0(%rbp), %rdi
leaq 0x5a1c9(%rip), %rsi     # 0xc5d50
leaq -0x55cfe(%rip), %rdx    # 0x15e90
callq 0x45b0
jmp 0x6bcc0
movq -0xd0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0x4280
jmp 0x6bbbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4688
jmp 0x6bcb7
leaq -0x20(%rbp), %rdi
callq 0x6cc70
addq $0x20, %rax
addq $0x8, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
callq 0x167a0
testb $0x1, %al
jne 0x6bbf3
jmp 0x6bc8b
movq -0x18(%rbp), %rdx
leaq 0x253eb(%rip), %rsi     # 0x90fe9
leaq -0xa0(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x16320
movl $0x28, %edi
callq 0x41c0
movq -0xe8(%rbp), %rdx
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xe0(%rbp)
movl $0xa, %esi
callq 0x73a90
jmp 0x6bc3b
movq -0xe0(%rbp), %rdi
leaq 0x5a107(%rip), %rsi     # 0xc5d50
leaq -0x55dc0(%rip), %rdx    # 0x15e90
callq 0x45b0
jmp 0x6bcc0
movq -0xe0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0x4280
jmp 0x6bc7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x4688
jmp 0x6bcb7
movq -0x80(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x165e0
movq -0xb8(%rbp), %rdi
movq (%rax), %rsi
callq 0x68a40
movq -0xb0(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x45e0