// File: /workspace/github_cpp_makefile_star2_O3/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 $0xc8, %rsp
movl %edx, 0x1c(%rsp)
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movq (%rsi), %rsi
movq %rcx, 0x10(%rsp)
movq %rcx, %rdi
callq 0x10a18
leaq 0x10(%r14), %rbx
movq %r14, (%rsp)
movq 0x10(%r14), %r12
cmpq %rbx, %r12
je 0x11f1c
movq %rax, %rbp
movq (%rsp), %rax
leaq 0x8(%rax), %r13
cmpq %rbp, 0x10(%r12)
jne 0x11f13
movq 0x60(%r12), %rdi
movq 0x10(%rsp), %rsi
callq 0x13731
testb %al, %al
jne 0x1211e
movq (%r12), %r12
cmpq %rbx, %r12
jne 0x11ef5
movq (%rsp), %rbx
movq (%rbx), %rdi
movq 0x10(%rsp), %rsi
callq 0xbd10
movq %rax, 0xb8(%rsp)
movq %rdx, 0xc0(%rsp)
cmpb $0x0, 0x51(%rbx)
jne 0x1217b
movl %edx, %r12d
btq $0x30, %rdx
leaq 0xb8(%rsp), %rcx
cmovaeq %rax, %rcx
movq %rcx, 0xa8(%rsp)
leaq 0x80(%rsp), %rbp
leaq 0x50(%rsp), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movl $0x0, 0x30(%rsp)
movw $0xb, 0x34(%rsp)
movb $0x0, 0x36(%rsp)
movq (%rsp), %rax
movq (%rax), %rdx
movq 0x250(%rdx), %rsi
addq $0x260, %rdx            # imm = 0x260
movq (%rsi), %rax
movq %r14, %r15
movq %r14, %rdi
callq *0x10(%rax)
movq 0x50(%rsp), %r13
movq 0x58(%rsp), %r14
leaq 0x60(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x30(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x20(%rsp)
movb 0x34(%rsp), %bl
cmpb $0x10, %bl
je 0x12173
movl %ebx, %eax
andb $-0x2, %al
cmpb $0xe, %al
jne 0x120c7
cmpq %r12, %r14
jne 0x12006
movq 0xa8(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0xb960
testl %eax, %eax
je 0x121eb
movq (%rsp), %rax
movq (%rax), %rax
movq %rax, 0xb0(%rsp)
movq (%rax), %rdi
callq 0xbf80
movq %rax, 0x50(%rsp)
addq $0x8, %rax
movq %rax, 0x58(%rsp)
leaq 0x60(%rsp), %rcx
movq %rcx, 0x68(%rsp)
movq %rcx, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movq %rax, 0x78(%rsp)
movq %rbp, 0x88(%rsp)
movq %rbp, 0x80(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rcx)
movb %bl, 0xa0(%rsp)
movb $0x1, 0xa1(%rsp)
movq %r13, 0x40(%rsp)
movl %r14d, 0x48(%rsp)
movw $0x10c, 0x4c(%rsp)      # imm = 0x10C
movb $0x0, 0x4e(%rsp)
movq 0xb0(%rsp), %rdi
movq (%rsp), %rsi
movq %r15, %r14
movq %r15, %rdx
leaq 0x40(%rsp), %rcx
callq 0xb470
movq %rax, %r13
movq 0x80(%rsp), %rbx
cmpq %rbp, %rbx
je 0x120f6
movq %rbx, %rsi
movq (%rbx), %rbx
movq 0x78(%rsp), %rdi
movl $0x30, %edx
callq 0xb3c0
jmp 0x120ab
movq (%rsp), %rsi
movq (%rsi), %rdi
movq %r13, 0x50(%rsp)
movl %r14d, 0x58(%rsp)
movw $0x10c, 0x5c(%rsp)      # imm = 0x10C
movb $0x0, 0x5e(%rsp)
leaq 0x20(%rsp), %rdx
movq %r15, %r14
movq %r15, %rcx
callq 0xbf90
jmp 0x1210e
leaq 0x58(%rsp), %rdi
callq 0xbab0
addq $0x8, %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0xb9f0
movq (%rsp), %rax
cmpb $0x1, 0x51(%rax)
jne 0x11f70
jmp 0x1217b
cmpq %rbx, %r12
je 0x11f1c
movq 0x18(%r12), %rax
movq 0x8(%rsp), %rbx
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x20(%r12), %rsi
callq 0xb6f0
leaq 0x28(%rbx), %rdi
leaq 0x40(%r12), %rsi
callq 0xb9d0
movzwl 0x68(%r12), %eax
movw %ax, 0x50(%rbx)
movq 0x60(%r12), %rax
movq %rax, 0x48(%rbx)
movq %r13, %rdi
movq %r12, %rsi
callq 0xb100
movq %rbx, %rax
jmp 0x121d9
movq (%rsp), %rax
movb $0x1, 0x51(%rax)
cmpb $0x0, 0x1c(%rsp)
jne 0x1223e
movq (%rsp), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0xbf80
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
addq $0x8, %rax
movq %rax, 0x8(%rdx)
leaq 0x10(%rdx), %rcx
movq %rcx, 0x18(%rdx)
movq %rcx, 0x10(%rdx)
movq $0x0, 0x20(%rdx)
movq %rax, 0x28(%rdx)
leaq 0x30(%rdx), %rax
movq %rax, 0x38(%rdx)
movq %rax, 0x30(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdx)
movw $0x10e, 0x50(%rdx)      # imm = 0x10E
movq %rdx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0xbf80
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
addq $0x8, %rax
movq %rax, 0x8(%rdx)
leaq 0x10(%rdx), %rcx
movq %rcx, 0x18(%rdx)
movq %rcx, 0x10(%rdx)
movq $0x0, 0x20(%rdx)
movq %rax, 0x28(%rdx)
leaq 0x30(%rdx), %rax
movq %rax, 0x38(%rdx)
movq %rax, 0x30(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdx)
movb %bl, 0x50(%rdx)
movb $0x0, 0x51(%rdx)
jmp 0x121d6
movl $0x28, %edi
callq 0xb3b0
movq %rax, %rbx
movq (%rsp), %rax
movq 0x48(%rax), %rdx
testq %rdx, %rdx
jne 0x1225f
movq 0x14ce1(%rip), %rdx     # 0x26f40
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x11af4
movq 0x14d75(%rip), %rsi     # 0x26fe8
movq 0x14cce(%rip), %rdx     # 0x26f48
movq %rbx, %rdi
callq 0xbe60
movq %rax, %r14
movq %rbx, %rdi
callq 0xb610
jmp 0x1229c
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0xc020
movq %r14, %rdi
callq 0xbe90
movq %rax, %rdi
callq 0xf059