// File: /workspace/github_cpp_makefile_star2_O1/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, 0x14(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %rsi
movq %rcx, 0x8(%rsp)
movq %rcx, %rdi
callq 0x10a06
leaq 0x30(%r15), %r14
movq 0x30(%r15), %rbp
movq %rbp, 0x18(%rsp)
cmpq %r14, %rbp
je 0x123f0
movq %rax, %r12
leaq 0x18(%rsp), %r13
cmpq %r12, 0x10(%rbp)
jne 0x123e2
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0x137a7
testb %al, %al
jne 0x123f5
movq (%rbp), %rbp
movq %rbp, 0x18(%rsp)
cmpq %r14, %rbp
jne 0x123cb
movq %r14, 0x18(%rsp)
movq 0x18(%rsp), %r12
cmpq %r14, %r12
je 0x12431
movq 0x28(%r12), %rax
movq %rax, 0x10(%rbx)
movups 0x18(%r12), %xmm0
movups %xmm0, (%rbx)
decq 0x40(%r15)
addq $0x28, %r15
movq %r12, %rdi
callq 0xbd90
movq %r15, %rdi
movq %r12, %rsi
callq 0xb700
jmp 0x12635
movq (%r15), %rdi
movq 0x8(%rsp), %rsi
callq 0xbd10
leaq 0x98(%rsp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
testb $0x1, 0xe(%rcx)
movl %edx, %edx
movq %rdx, 0x88(%rsp)
cmovneq %rcx, %rax
movq %rax, 0x80(%rsp)
leaq 0x48(%rsp), %r14
cmpb $0x0, 0x51(%r15)
jne 0x12617
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x0, 0x10(%rbx)
movw $0xb, 0x14(%rbx)
movb $0x0, 0x16(%rbx)
movq (%r15), %rdx
movq 0x250(%rdx), %rsi
addq $0x260, %rdx            # imm = 0x260
movq (%rsi), %rax
leaq 0x18(%rsp), %rdi
callq *0x10(%rax)
movq 0x18(%rsp), %r12
movq 0x20(%rsp), %rbp
leaq 0x28(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rbx)
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movb 0x14(%rbx), %r13b
cmpb $0x10, %r13b
jne 0x124e0
movb $0x1, 0x51(%r15)
movl $0x3, %ebp
jmp 0x12601
movl %r13d, %eax
andb $-0x2, %al
cmpb $0xe, %al
jne 0x1259a
movq (%r15), %rax
movq %rax, 0x90(%rsp)
movq (%rax), %rdi
callq 0xbf80
movq %rax, 0x18(%rsp)
addq $0x8, %rax
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq $0x0, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq %r14, 0x50(%rsp)
movq %r14, 0x48(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rcx)
movb %r13b, 0x68(%rsp)
movb $0x1, 0x69(%rsp)
movq %r12, 0x70(%rsp)
movl %ebp, 0x78(%rsp)
movw $0x10c, 0x7c(%rsp)      # imm = 0x10C
movb $0x0, 0x7e(%rsp)
movq 0x90(%rsp), %rdi
movq %r15, %rsi
leaq 0x18(%rsp), %rdx
leaq 0x70(%rsp), %rcx
callq 0xb470
movq %rax, %r12
movq 0x48(%rsp), %r13
cmpq %r14, %r13
je 0x125e7
movq %r13, %rsi
movq (%r13), %r13
movq 0x40(%rsp), %rdi
movl $0x30, %edx
callq 0xb3c0
jmp 0x1257d
cmpq 0x88(%rsp), %rbp
jne 0x125bb
movq 0x80(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0xb960
testl %eax, %eax
je 0x1260b
movq (%r15), %rdi
movq %r12, 0x18(%rsp)
movl %ebp, 0x20(%rsp)
movw $0x10c, 0x24(%rsp)      # imm = 0x10C
movb $0x0, 0x26(%rsp)
movq %r15, %rsi
movq %rbx, %rdx
leaq 0x18(%rsp), %rcx
callq 0xbf90
xorl %ebp, %ebp
jmp 0x12601
leaq 0x20(%rsp), %rdi
callq 0xbab0
addq $0x8, %r12
xorl %ebp, %ebp
movq %r12, %rdi
xorl %esi, %esi
callq 0xb9f0
testl %ebp, %ebp
je 0x1246c
jmp 0x12612
movl $0x1, %ebp
jmp 0x12601
cmpl $0x3, %ebp
jne 0x12635
cmpb $0x0, 0x14(%rsp)
jne 0x1264a
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x0, 0x10(%rbx)
movw $0xb, 0x14(%rbx)
movb $0x0, 0x16(%rbx)
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0xb3b0
movq %rax, %rbx
movq 0x48(%r15), %rdx
testq %rdx, %rdx
jne 0x12667
movq 0x158d9(%rip), %rdx     # 0x27f40
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0x11b92
movq 0x1596d(%rip), %rsi     # 0x27fe8
movq 0x158c6(%rip), %rdx     # 0x27f48
movq %rbx, %rdi
callq 0xbe60
movq %rax, %r14
movq %rbx, %rdi
callq 0xb610
jmp 0x126a4
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0xc020
movq %r14, %rdi
callq 0xbe90
movq %rax, %rdi
callq 0xf080