// File: /workspace/github_cpp_makefile_star2_O1/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 $0xd8, %rsp
movq %rcx, %rbp
movl %edx, 0x14(%rsp)
movq %rsi, %r14
movq %rdi, (%rsp)
movq (%rsi), %rsi
movq %rcx, %rdi
callq 0x10a06
leaq 0x10(%r14), %rbx
movq 0x10(%r14), %r15
movq %r15, 0x28(%rsp)
cmpq %rbx, %r15
je 0x11fb2
movq %rax, %r12
leaq 0x28(%rsp), %r13
cmpq %r12, 0x10(%r15)
jne 0x11fa5
movq %r13, %rdi
movq %rbp, %rsi
callq 0x13877
testb %al, %al
jne 0x11fb7
movq (%r15), %r15
movq %r15, 0x28(%rsp)
cmpq %rbx, %r15
jne 0x11f90
movq %rbx, 0x28(%rsp)
movq 0x28(%rsp), %r12
cmpq %rbx, %r12
je 0x12013
addq $0x8, %r14
movq 0x18(%r12), %rax
movq (%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 %r14, %rdi
movq %r12, %rsi
callq 0xb100
movq %rbx, %rax
jmp 0x1230c
movq (%r14), %rdi
movq %rbp, %rsi
callq 0xbd10
leaq 0xc8(%rsp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
leaq 0x38(%rsp), %r13
testb $0x1, 0xe(%rcx)
movl %edx, %edx
movq %rdx, 0xb8(%rsp)
cmovneq %rcx, %rax
movq %rax, 0xb0(%rsp)
leaq 0x58(%rsp), %r15
movq (%rsp), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x30(%rax), %rcx
movq %rcx, 0x20(%rsp)
addq $0x40, %rax
movq %rax, 0xa8(%rsp)
movq %rbp, 0x8(%rsp)
cmpb $0x0, 0x51(%r14)
jne 0x122b4
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movl $0x0, 0x90(%rsp)
movw $0xb, 0x94(%rsp)
movb $0x0, 0x96(%rsp)
movq (%r14), %rdx
movq 0x250(%rdx), %rsi
addq $0x260, %rdx            # imm = 0x260
movq (%rsi), %rax
leaq 0x28(%rsp), %rdi
callq *0x10(%rax)
movq 0x28(%rsp), %r12
movq 0x30(%rsp), %rbp
movq 0x10(%r13), %rax
movq %rax, 0x90(%rsp)
movups (%r13), %xmm0
movaps %xmm0, 0x80(%rsp)
movb 0x94(%rsp), %bl
cmpb $0x10, %bl
jne 0x12105
movb $0x1, 0x51(%r14)
movl $0x3, %ebx
jmp 0x12244
movl %ebx, %eax
andb $-0x2, %al
cmpb $0xe, %al
jne 0x12215
cmpq 0xb8(%rsp), %rbp
jne 0x12136
movq 0xb0(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0xb960
testl %eax, %eax
je 0x12253
movq (%r14), %rax
movq %rax, 0xc0(%rsp)
movq (%rax), %rdi
callq 0xbf80
movq %rax, 0x28(%rsp)
addq $0x8, %rax
movq %rax, 0x30(%rsp)
movq %r13, 0x40(%rsp)
movq %r13, 0x38(%rsp)
movq $0x0, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq %r15, 0x60(%rsp)
movq %r15, 0x58(%rsp)
movq %r14, %rsi
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r13)
movb %bl, 0x78(%rsp)
movb $0x1, 0x79(%rsp)
movq %r12, 0x98(%rsp)
movl %ebp, 0xa0(%rsp)
movw $0x10c, 0xa4(%rsp)      # imm = 0x10C
movb $0x0, 0xa6(%rsp)
movq 0xc0(%rsp), %rdi
leaq 0x28(%rsp), %rdx
leaq 0x98(%rsp), %rcx
callq 0xb470
movq %rax, %r12
movq 0x58(%rsp), %rbx
cmpq %r15, %rbx
movq 0x8(%rsp), %rbp
leaq 0x38(%rsp), %r13
je 0x121f9
movq %rbx, %rsi
movq (%rbx), %rbx
movq 0x50(%rsp), %rdi
movl $0x30, %edx
callq 0xb3c0
cmpq %r15, %rbx
jne 0x121df
leaq 0x30(%rsp), %rdi
callq 0xbab0
addq $0x8, %r12
xorl %ebx, %ebx
movq %r12, %rdi
xorl %esi, %esi
callq 0xb9f0
jmp 0x12249
movq (%r14), %rdi
movq %r12, 0x28(%rsp)
movl %ebp, 0x30(%rsp)
movw $0x10c, 0x34(%rsp)      # imm = 0x10C
movb $0x0, 0x36(%rsp)
movq %r14, %rsi
leaq 0x80(%rsp), %rdx
leaq 0x28(%rsp), %rcx
callq 0xbf90
xorl %ebx, %ebx
movq 0x8(%rsp), %rbp
testl %ebx, %ebx
je 0x12078
jmp 0x122af
movq (%r14), %rax
movq (%rax), %rdi
callq 0xbf80
movq (%rsp), %rcx
movq %rax, (%rcx)
addq $0x8, %rax
movq %rax, 0x8(%rcx)
movq 0x18(%rsp), %rdx
movq %rdx, 0x18(%rcx)
movq %rdx, 0x10(%rcx)
movq $0x0, 0x20(%rcx)
movq %rax, 0x28(%rcx)
movq 0x20(%rsp), %rax
movq %rax, 0x38(%rcx)
movq %rax, 0x30(%rcx)
movq 0xa8(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movb %bl, 0x50(%rcx)
movb $0x0, 0x51(%rcx)
movl $0x1, %ebx
jmp 0x12244
cmpl $0x3, %ebx
jne 0x12308
cmpb $0x0, 0x14(%rsp)
jne 0x1231e
movq (%r14), %rax
movq (%rax), %rdi
callq 0xbf80
movq (%rsp), %rcx
movq %rax, (%rcx)
addq $0x8, %rax
movq %rax, 0x8(%rcx)
movq 0x18(%rsp), %rdx
movq %rdx, 0x18(%rcx)
movq %rdx, 0x10(%rcx)
movq $0x0, 0x20(%rcx)
movq %rax, 0x28(%rcx)
movq 0x20(%rsp), %rax
movq %rax, 0x38(%rcx)
movq %rax, 0x30(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rcx)
movw $0x10e, 0x50(%rcx)      # imm = 0x10E
movq (%rsp), %rax
addq $0xd8, %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 0x1233b
movq 0x15c05(%rip), %rdx     # 0x27f40
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x11b92
movq 0x15c9b(%rip), %rsi     # 0x27fe8
movq 0x15bf4(%rip), %rdx     # 0x27f48
movq %rbx, %rdi
callq 0xbe60
movq %rax, %r14
movq %rbx, %rdi
callq 0xb610
jmp 0x12376
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0xc020
movq %r14, %rdi
callq 0xbe90
movq %rax, %rdi
callq 0xf080