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

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

    auto id_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(id_conv, seg_name)) {
                return Node(this->env->tree, tp, false);
            }

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

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

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

    return Node(this->env->tree);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rcx, %r14
movl %edx, 0xc(%rsp)
movq %rsi, %r15
movq %rdi, (%rsp)
leaq 0x8(%rsi), %rax
movq %rax, 0x48(%rsp)
movq (%rsi), %rsi
movq %rcx, %rdi
callq 0x16b66
movq %rax, %r13
leaq 0x10(%r15), %rbx
leaq 0x50(%rsp), %rbp
movq %rbx, %r12
movq (%r12), %r12
movq %r12, 0x50(%rsp)
cmpq %rbx, %r12
je 0x17917
cmpq %r13, 0x10(%r12)
jne 0x178d0
movq %rbp, %rdi
movq %r14, %rsi
callq 0x1892f
testb %al, %al
je 0x178d0
leaq 0x18(%r12), %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x11fe0
movq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x12900
jmp 0x17ad1
movq (%r15), %rdi
movq %r14, %rsi
callq 0x126b0
leaq 0xa8(%rsp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
leaq 0x60(%rsp), %rbx
leaq 0x50(%rsp), %r13
cmpb $0x0, 0x51(%r15)
jne 0x17ab2
andl $0x0, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movw $0xb, 0x34(%rsp)
movb $0x0, 0x36(%rsp)
movq (%r15), %rdx
movq 0x250(%rdx), %rsi
addq $0x260, %rdx            # imm = 0x260
movq (%rsi), %rax
movq %r13, %rdi
callq *0x10(%rax)
movups 0x50(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x30(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, 0x20(%rsp)
movb 0x34(%rsp), %r12b
cmpb $0x10, %r12b
je 0x17aad
movl %r12d, %eax
andb $-0x2, %al
cmpb $0xe, %al
jne 0x17a77
leaq 0xa8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x17b57
movq (%r15), %rbp
testb %al, %al
jne 0x17ae6
movq (%rbp), %rdi
callq 0x12af0
movq %rax, 0x50(%rsp)
addq $0x8, %rax
movq %rax, 0x58(%rsp)
movq %rbx, 0x68(%rsp)
movq %rbx, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
movq %rax, 0x78(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %rax, 0x80(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movb %r12b, 0xa0(%rsp)
movb $0x1, 0xa1(%rsp)
movq 0x10(%rsp), %rax
movl 0x18(%rsp), %ecx
movq %rax, 0x38(%rsp)
movl %ecx, 0x40(%rsp)
movw $0x10c, 0x44(%rsp)      # imm = 0x10C
movb $0x0, 0x46(%rsp)
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
leaq 0x38(%rsp), %rcx
callq 0x11700
movq %rax, %rbp
movq %r13, %rdi
callq 0x12c70
addq $0x8, %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x12040
jmp 0x1793b
movq (%r15), %rdi
movq 0x10(%rsp), %rax
movl 0x18(%rsp), %ecx
movq %rax, 0x50(%rsp)
movl %ecx, 0x58(%rsp)
movw $0x10c, 0x5c(%rsp)      # imm = 0x10C
movb $0x0, 0x5e(%rsp)
movq %r15, %rsi
leaq 0x20(%rsp), %rdx
movq %r13, %rcx
callq 0x12b00
jmp 0x1793b
movb $0x1, 0x51(%r15)
cmpb $0x0, 0xc(%rsp)
jne 0x17af9
movq (%r15), %rax
movq (%rax), %rsi
pushq $0xe
popq %rdx
pushq $0x1
popq %rcx
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x11530
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbp), %rsi
movzbl %r12b, %edx
movq (%rsp), %rbx
movq %rbx, %rdi
xorl %ecx, %ecx
jmp 0x17acc
pushq $0x28
popq %rdi
callq 0x115e0
movq %rax, %rbx
movq 0x48(%r15), %rdx
testq %rdx, %rdx
jne 0x17b14
movq 0x1442c(%rip), %rdx     # 0x2bf40
movq %rbx, %rdi
movq %r14, %rsi
callq 0x17744
movq 0x144c2(%rip), %rsi     # 0x2bfe8
movq 0x1441b(%rip), %rdx     # 0x2bf48
movq %rbx, %rdi
callq 0x12920
movq %rax, %r14
movq %rbx, %rdi
callq 0x119b0
jmp 0x17b4f
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x12c70
movq %r14, %rdi
callq 0x12990