// File: /workspace/github_cpp_makefile_star2_O3/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, 0x1c(%rsp)
movq %rsi, %r15
movq %rdi, 0x8(%rsp)
movq (%rsi), %rsi
movq %rcx, 0x10(%rsp)
movq %rcx, %rdi
callq 0x10a18
leaq 0x30(%r15), %r14
movq %r15, (%rsp)
movq 0x30(%r15), %r12
cmpq %r14, %r12
je 0x1231c
movq %rax, %rbp
movq (%rsp), %rax
leaq 0x28(%rax), %r13
cmpq %rbp, 0x10(%r12)
jne 0x12313
movq 0x18(%r12), %rdi
movq 0x10(%rsp), %rsi
callq 0x13667
testb %al, %al
jne 0x12513
movq (%r12), %r12
cmpq %r14, %r12
jne 0x122f5
movq (%rsp), %r14
movq (%r14), %rdi
movq 0x10(%rsp), %rsi
callq 0xbd10
movq %rax, 0x98(%rsp)
movq %rdx, 0xa0(%rsp)
cmpb $0x0, 0x51(%r14)
jne 0x1255a
movl %edx, %ecx
movq %rcx, 0x20(%rsp)
btq $0x30, %rdx
leaq 0x98(%rsp), %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x90(%rsp)
leaq 0x68(%rsp), %r12
leaq 0x38(%rsp), %r15
movq 0x8(%rsp), %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rbp)
movl $0x0, 0x10(%rbp)
movw $0xb, 0x14(%rbp)
movb $0x0, 0x16(%rbp)
movq %r14, %rbx
movq (%r14), %rdx
movq 0x250(%rdx), %rsi
addq $0x260, %rdx            # imm = 0x260
movq (%rsi), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq 0x38(%rsp), %r13
movq 0x40(%rsp), %r14
leaq 0x48(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rbp)
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movb 0x14(%rbp), %r15b
cmpb $0x10, %r15b
je 0x12553
movl %r15d, %eax
andb $-0x2, %al
cmpb $0xe, %al
jne 0x12493
movq (%rsp), %rax
movq (%rax), %rbx
movq (%rbx), %rdi
callq 0xbf80
movq %rax, 0x38(%rsp)
addq $0x8, %rax
movq %rax, 0x40(%rsp)
leaq 0x48(%rsp), %rcx
movq %rcx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq $0x0, 0x58(%rsp)
movq %rax, 0x60(%rsp)
movq %r12, 0x70(%rsp)
movq %r12, 0x68(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rcx)
movb %r15b, 0x88(%rsp)
movb $0x1, 0x89(%rsp)
movq %r13, 0x28(%rsp)
movl %r14d, 0x30(%rsp)
movw $0x10c, 0x34(%rsp)      # imm = 0x10C
movb $0x0, 0x36(%rsp)
movq %rbx, %rdi
movq (%rsp), %rsi
leaq 0x38(%rsp), %r15
movq %r15, %rdx
leaq 0x28(%rsp), %rcx
callq 0xb470
movq %rax, %r13
movq 0x68(%rsp), %r14
cmpq %r12, %r14
je 0x124ea
movq %r14, %rsi
movq (%r14), %r14
movq 0x60(%rsp), %rdi
movl $0x30, %edx
callq 0xb3c0
jmp 0x12477
cmpq 0x20(%rsp), %r14
jne 0x124b7
movq 0x90(%rsp), %rdi
movq %r13, %rsi
movq 0x20(%rsp), %rdx
callq 0xb960
testl %eax, %eax
je 0x1257d
movq (%rbx), %rdi
movq %r13, 0x38(%rsp)
movl %r14d, 0x40(%rsp)
movq %rbx, %r14
movw $0x10c, 0x44(%rsp)      # imm = 0x10C
movb $0x0, 0x46(%rsp)
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
leaq 0x38(%rsp), %r15
movq %r15, %rcx
callq 0xbf90
jmp 0x12506
leaq 0x40(%rsp), %rdi
callq 0xbab0
addq $0x8, %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0xb9f0
movq (%rsp), %r14
cmpb $0x1, 0x51(%r14)
jne 0x12377
jmp 0x1255a
cmpq %r14, %r12
je 0x1231c
movq 0x28(%r12), %rax
movq 0x8(%rsp), %rbx
movq %rax, 0x10(%rbx)
movups 0x18(%r12), %xmm0
movups %xmm0, (%rbx)
movq (%rsp), %rax
decq 0x40(%rax)
movq %r12, %rdi
callq 0xbd90
movq %r13, %rdi
movq %r12, %rsi
callq 0xb700
movq %rbx, %rax
jmp 0x12582
movq %rbx, %r14
movb $0x1, 0x51(%rbx)
cmpb $0x0, 0x1c(%rsp)
jne 0x12594
xorps %xmm0, %xmm0
movq 0x8(%rsp), %rax
movups %xmm0, (%rax)
movl $0x0, 0x10(%rax)
movw $0xb, 0x14(%rax)
movb $0x0, 0x16(%rax)
movq 0x8(%rsp), %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(%r14), %rdx
testq %rdx, %rdx
jne 0x125b1
movq 0x1498f(%rip), %rdx     # 0x26f40
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x11af4
movq 0x14a23(%rip), %rsi     # 0x26fe8
movq 0x1497c(%rip), %rdx     # 0x26f48
movq %rbx, %rdi
callq 0xbe60
movq %rax, %r14
movq %rbx, %rdi
callq 0xb610
jmp 0x125ee
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0xc020
movq %r14, %rdi
callq 0xbe90
movq %rax, %rdi
callq 0xf059