// File: /workspace/github_cpp_makefile_star2_O2/night-shift[P]Srl/src/lib/Node.cpp
// Function: Srl::Node::consume_value(bool, Srl::String const&)
Value Node::consume_value(bool throw_ex, const String& id)
{
    auto stored_itr = find_link_iterator(id, this->values, *this->env);

    if(stored_itr != this->values.end()) {
        auto stored_field = move(stored_itr->field);
        this->values.erase(stored_itr);
        return stored_field;
    }

    auto name_conv = this->env->conv_string(id);

    while(!this->parsed) {

        MemBlock seg_name; Value val;
        tie(seg_name, val) = this->env->parser->read(this->env->in);

        auto tp = val.type();

        if(tp == Type::Scope_End) {
            this->parsed = true;
            break;
        }

        if(!TpTools::is_scope(tp)) {
            if(compare(name_conv, seg_name)) {
                return val;
            }

            this->env->store_value(*this, val, seg_name);

        } else {
            auto* link = this->env->store_node(*this, Node(this->env->tree, tp), seg_name);
            link->field.read_source();
        }
    }

    if(throw_ex) {
        throw field_name_not_found_ex(id, this->name());
    }

    return Value(Type::Null);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %edx, 0xc(%rsp)
movq %rsi, %r15
movq %rdi, %r14
leaq 0x28(%rsi), %rax
movq %rax, 0x38(%rsp)
movq (%rsi), %rsi
movq %rcx, (%rsp)
movq %rcx, %rdi
callq 0x16b66
movq %rax, %rbp
leaq 0x30(%r15), %rbx
leaq 0x40(%rsp), %r12
movq %rbx, %r13
movq (%r13), %r13
movq %r13, 0x40(%rsp)
cmpq %rbx, %r13
je 0x17c09
cmpq %rbp, 0x10(%r13)
jne 0x17bc2
movq %r12, %rdi
movq (%rsp), %rsi
callq 0x18913
testb %al, %al
je 0x17bc2
movq 0x28(%r13), %rax
movq %rax, 0x10(%r14)
movups 0x18(%r13), %xmm0
movups %xmm0, (%r14)
movq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0x12a50
jmp 0x17db3
movq (%r15), %rdi
movq (%rsp), %rsi
callq 0x126b0
leaq 0x98(%rsp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
leaq 0x50(%rsp), %r12
leaq 0x40(%rsp), %r13
cmpb $0x0, 0x51(%r15)
jne 0x17d94
andl $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movw $0xb, 0x14(%r14)
movb $0x0, 0x16(%r14)
movq (%r15), %rdx
movq 0x250(%rdx), %rsi
addq $0x260, %rdx            # imm = 0x260
movq (%rsi), %rax
movq %r13, %rdi
callq *0x10(%rax)
movups 0x40(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x10(%r12), %rax
movq %rax, 0x10(%r14)
movups (%r12), %xmm0
movups %xmm0, (%r14)
movb 0x14(%r14), %bl
cmpb $0x10, %bl
je 0x17d8f
movl %ebx, %eax
andb $-0x2, %al
cmpb $0xe, %al
jne 0x17d45
movq (%r15), %rbp
movq (%rbp), %rdi
callq 0x12af0
movq %rax, 0x40(%rsp)
addq $0x8, %rax
movq %rax, 0x48(%rsp)
movq %r12, 0x58(%rsp)
movq %r12, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movq %rax, 0x68(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x78(%rsp)
movq %rax, 0x70(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r12)
movb %bl, 0x90(%rsp)
movb $0x1, 0x91(%rsp)
movq 0x10(%rsp), %rax
movl 0x18(%rsp), %ecx
movq %rax, 0x28(%rsp)
movl %ecx, 0x30(%rsp)
movw $0x10c, 0x34(%rsp)      # imm = 0x10C
movb $0x0, 0x36(%rsp)
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
leaq 0x28(%rsp), %rcx
callq 0x11700
movq %rax, %rbp
movq %r13, %rdi
callq 0x12c70
addq $0x8, %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x12040
jmp 0x17c2e
leaq 0x98(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x17b57
testb %al, %al
jne 0x17db3
movq (%r15), %rdi
movq 0x10(%rsp), %rax
movl 0x18(%rsp), %ecx
movq %rax, 0x40(%rsp)
movl %ecx, 0x48(%rsp)
movw $0x10c, 0x4c(%rsp)      # imm = 0x10C
movb $0x0, 0x4e(%rsp)
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x12b00
jmp 0x17c2e
movb $0x1, 0x51(%r15)
cmpb $0x0, 0xc(%rsp)
jne 0x17dc8
andl $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movw $0xb, 0x14(%r14)
movb $0x0, 0x16(%r14)
movq %r14, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x115e0
movq %rax, %r14
movq 0x48(%r15), %rdx
testq %rdx, %rdx
jne 0x17de3
movq 0x1415d(%rip), %rdx     # 0x2bf40
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x17744
movq 0x141f2(%rip), %rsi     # 0x2bfe8
movq 0x1414b(%rip), %rdx     # 0x2bf48
movq %r14, %rdi
callq 0x12920
movq %rax, %rbx
movq %r14, %rdi
callq 0x119b0
jmp 0x17e1f
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x12c70
movq %rbx, %rdi
callq 0x12990
nop