// File: /workspace/github_cpp_makefile_star2_O3/night-shift[P]Srl/src/lib/Node.cpp
// Function: Srl::Node::consume_item(Srl::String const&, bool)
Union Node::consume_item(const String& id, bool throw_err)
{
    auto* storednode = find_link<Name>(id, this->nodes);

    if(storednode) {
        return Union(storednode->field);
    }

    auto* storedvalue = find_link<Name>(id, this->values);

    if(storedvalue) {
        return Union(storedvalue->field);
    }

    auto hash = hash_string(id, *this->env);

    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)) {
            auto* link = this->env->store_node(*this, Node(this->env->tree, tp), seg_name);
            link->field.read_source();
            if(link->hash == hash && link->field.name() == id) {
                return Union(link->field);
            }

        } else {
            auto* link = this->env->store_value(*this, val, seg_name);
            if(link->hash == hash && link->field.name() == id) {
                return Union(link->field);
            }
        }
    }

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

    return Union();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %edx, 0x14(%rsp)
movq %rsi, %r14
movq %rdi, %r13
movups (%rsi), %xmm0
leaq 0x18(%rsp), %r15
movups %xmm0, (%r15)
leaq 0x10(%rdi), %rbx
movq %rbx, %rbp
movq (%rbp), %rbp
cmpq %rbx, %rbp
je 0x11695
movq 0x60(%rbp), %rdi
movq %r15, %rsi
callq 0x13731
testb %al, %al
je 0x11670
addq $0x18, %rbp
xorl %r15d, %r15d
jmp 0x11a69
movups (%r14), %xmm0
leaq 0x18(%rsp), %r12
movups %xmm0, (%r12)
leaq 0x30(%r13), %rbx
movq %rbx, %r15
movq (%r15), %r15
cmpq %rbx, %r15
je 0x116cb
movq 0x18(%r15), %rdi
movq %r12, %rsi
callq 0x13667
testb %al, %al
je 0x116aa
addq $0x18, %r15
jmp 0x11a67
movq (%r13), %rsi
movq %r14, %rdi
callq 0x10a18
movq %rax, 0x78(%rsp)
cmpb $0x0, 0x51(%r13)
jne 0x11a5d
xorl %r15d, %r15d
movq %r13, 0x70(%rsp)
movq %r14, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movl $0x0, 0x90(%rsp)
movw $0xb, 0x94(%rsp)
movb $0x0, 0x96(%rsp)
movq (%r13), %rdx
movq 0x250(%rdx), %rsi
addq $0x260, %rdx            # imm = 0x260
movq (%rsi), %rax
leaq 0x18(%rsp), %rdi
callq *0x10(%rax)
movq 0x18(%rsp), %rbp
movq 0x20(%rsp), %rbx
leaq 0x28(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x90(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x80(%rsp)
movb 0x94(%rsp), %r14b
cmpb $0x10, %r14b
je 0x11a53
movl %r14d, %eax
andb $-0x2, %al
movq (%r13), %r12
cmpb $0xe, %al
jne 0x1183c
movq (%r12), %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)
leaq 0x48(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %rax, 0x48(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rcx)
movb %r14b, 0x68(%rsp)
movb $0x1, 0x69(%rsp)
movq %rbp, 0x98(%rsp)
movl %ebx, 0xa0(%rsp)
movw $0x10c, 0xa4(%rsp)      # imm = 0x10C
movb $0x0, 0xa6(%rsp)
movq %r12, %rdi
movq %r13, %rsi
leaq 0x18(%rsp), %rdx
leaq 0x98(%rsp), %rcx
callq 0xb470
movq %rax, %r12
movq 0x48(%rsp), %r14
leaq 0x48(%rsp), %rbx
cmpq %rbx, %r14
je 0x118e3
movq %r14, %rsi
movq (%r14), %r14
movq 0x40(%rsp), %rdi
movl $0x30, %edx
callq 0xb3c0
jmp 0x1181c
movq %rbp, 0x18(%rsp)
movl %ebx, 0x20(%rsp)
movw $0x10c, 0x24(%rsp)      # imm = 0x10C
movb $0x0, 0x26(%rsp)
movq %r12, %rdi
movq %r13, %rsi
leaq 0x80(%rsp), %rdx
leaq 0x18(%rsp), %rcx
callq 0xbf90
movq %rax, %r12
movq 0x78(%rsp), %rax
cmpq %rax, (%r12)
movq 0x8(%rsp), %r14
jne 0x11a46
movq 0x8(%r12), %rbp
testq %rbp, %rbp
jne 0x11891
movq 0x156af(%rip), %rbp     # 0x26f40
movl 0x8(%rbp), %edx
movl 0x8(%r14), %eax
movl %edx, %ecx
orl %eax, %ecx
je 0x11a81
movb 0xd(%rbp), %cl
cmpb %cl, 0xd(%r14)
jne 0x1197b
cmpl %eax, %edx
jne 0x11a46
cmpb $0x0, 0xe(%r14)
movq %r14, %rsi
jne 0x118c4
movq (%r14), %rsi
cmpb $0x0, 0xe(%rbp)
jne 0x118ce
movq (%rbp), %rbp
movq %rbp, %rdi
callq 0xb960
testl %eax, %eax
jne 0x11a46
jmp 0x11a81
leaq 0x20(%rsp), %rdi
callq 0xbab0
movq %r12, %rbp
addq $0x8, %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0xb9f0
movq 0x78(%rsp), %rax
cmpq %rax, (%r12)
movq 0x8(%rsp), %r14
jne 0x11a46
movq 0x50(%r12), %r12
testq %r12, %r12
jne 0x11923
movq 0x1561d(%rip), %r12     # 0x26f40
movl 0x8(%r12), %edx
movl 0x8(%r14), %eax
movl %edx, %ecx
orl %eax, %ecx
je 0x11a69
movb 0xd(%r12), %cl
cmpb %cl, 0xd(%r14)
jne 0x119e1
cmpl %eax, %edx
jne 0x11a46
cmpb $0x0, 0xe(%r14)
movq %r14, %rsi
jne 0x1195a
movq (%r14), %rsi
cmpb $0x0, 0xe(%r12)
jne 0x11966
movq (%r12), %r12
movq %r12, %rdi
callq 0xb960
testl %eax, %eax
jne 0x11a46
jmp 0x11a69
movzbl %cl, %esi
xorl %ebx, %ebx
leaq 0x18(%rsp), %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xbea0
movq 0x18(%rsp), %r13
movq 0x20(%rsp), %rdx
subq %r13, %rdx
movl 0x8(%rbp), %eax
cmpq %rax, %rdx
jne 0x119be
cmpb $0x0, 0xe(%rbp)
jne 0x119ae
movq (%rbp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0xb960
testl %eax, %eax
sete %bl
testq %r13, %r13
je 0x119d3
movq 0x28(%rsp), %rsi
subq %r13, %rsi
movq %r13, %rdi
callq 0xb940
testb %bl, %bl
movq 0x70(%rsp), %r13
je 0x11a46
jmp 0x11a81
movzbl %cl, %esi
xorl %ebx, %ebx
leaq 0x18(%rsp), %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xbea0
movq 0x18(%rsp), %r13
movq 0x20(%rsp), %rdx
subq %r13, %rdx
movl 0x8(%r12), %eax
cmpq %rax, %rdx
jne 0x11a28
cmpb $0x0, 0xe(%r12)
jne 0x11a18
movq (%r12), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0xb960
testl %eax, %eax
sete %bl
testq %r13, %r13
je 0x11a3d
movq 0x28(%rsp), %rsi
subq %r13, %rsi
movq %r13, %rdi
callq 0xb940
testb %bl, %bl
movq 0x70(%rsp), %r13
jne 0x11a69
cmpb $0x1, 0x51(%r13)
jne 0x116f4
jmp 0x11a5d
movb $0x1, 0x51(%r13)
movq 0x8(%rsp), %r14
cmpb $0x0, 0x14(%rsp)
jne 0x11a8c
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %rbp, %rax
movq %r15, %rdx
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %r12
xorl %ebp, %ebp
movq %r12, %r15
jmp 0x11a69
movl $0x28, %edi
callq 0xb3b0
movq %rax, %r15
movq 0x48(%r13), %rdx
testq %rdx, %rdx
jne 0x11aa9
movq 0x15497(%rip), %rdx     # 0x26f40
movq %r15, %rdi
movq %r14, %rsi
callq 0x11af4
movq 0x1552d(%rip), %rsi     # 0x26fe8
movq 0x15486(%rip), %rdx     # 0x26f48
movq %r15, %rdi
callq 0xbe60
movq %rax, %rbx
movq %r15, %rdi
callq 0xb610
jmp 0x11ae4
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xc020
movq %rbx, %rdi
callq 0xbe90
movq %rax, %rdi
callq 0xf059