// File: /workspace/github_cpp_makefile_star2_O1/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 $0xb8, %rsp
movl %edx, 0x34(%rsp)
movq %rdi, %r14
movq %rsi, (%rsp)
movups (%rsi), %xmm0
leaq 0x38(%rsp), %r15
movups %xmm0, (%r15)
leaq 0x10(%rdi), %rbp
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
movq %rbp, %rbx
movq (%rbx), %rbx
movq %rbx, 0x10(%rsp)
cmpq %rbp, %rbx
je 0x116c2
movq %r13, %rdi
movq %r15, %rsi
callq 0x13877
testb %al, %al
je 0x1169f
addq $0x10, %rbx
movq %rbx, %r12
testq %r12, %r12
je 0x116d2
addq $0x8, %r12
xorl %edx, %edx
jmp 0x11b0a
movq (%rsp), %rax
movups (%rax), %xmm0
leaq 0x38(%rsp), %r12
movups %xmm0, (%r12)
leaq 0x30(%r14), %r15
leaq 0x10(%rsp), %r13
movq %r15, %rbx
movq (%rbx), %rbx
movq %rbx, 0x10(%rsp)
cmpq %r15, %rbx
je 0x11714
movq %r13, %rdi
movq %r12, %rsi
callq 0x137a7
testb %al, %al
je 0x116ef
addq $0x10, %rbx
movq %rbx, %rdx
jmp 0x11716
xorl %edx, %edx
testq %rdx, %rdx
movq (%rsp), %rdi
je 0x11728
addq $0x8, %rdx
jmp 0x11b07
movq (%r14), %rsi
callq 0x10a06
movq %rax, 0x98(%rsp)
movq %r14, 0xb0(%rsp)
cmpb $0x0, 0x51(%r14)
jne 0x11afe
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movl $0x0, 0x20(%rsp)
movw $0xb, 0x24(%rsp)
movb $0x0, 0x26(%rsp)
movq (%r14), %rdx
movq 0x250(%rdx), %rsi
addq $0x260, %rdx            # imm = 0x260
movq (%rsi), %rax
leaq 0x38(%rsp), %rdi
callq *0x10(%rax)
movq 0x38(%rsp), %rbp
movq 0x40(%rsp), %r15
leaq 0x48(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x20(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x10(%rsp)
movb 0x24(%rsp), %bl
cmpb $0x10, %bl
jne 0x117c1
movb $0x1, 0x51(%r14)
movl $0x3, %r15d
testl %r15d, %r15d
je 0x11740
jmp 0x11af8
movl %ebx, %eax
andb $-0x2, %al
movq (%r14), %r13
cmpb $0xe, %al
jne 0x1193d
movq %r12, %r14
movq (%r13), %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)
leaq 0x68(%rsp), %r12
movq %r12, 0x70(%rsp)
movq %r12, 0x68(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rcx)
movb %bl, 0x88(%rsp)
movb $0x1, 0x89(%rsp)
movq %rbp, 0xa0(%rsp)
movl %r15d, 0xa8(%rsp)
movw $0x10c, 0xac(%rsp)      # imm = 0x10C
movb $0x0, 0xae(%rsp)
movq %r13, %rdi
movq 0xb0(%rsp), %rsi
movq %rsi, %rbp
leaq 0x38(%rsp), %rdx
leaq 0xa0(%rsp), %rcx
callq 0xb470
movq %rax, %r13
movq 0x68(%rsp), %rbx
cmpq %r12, %rbx
movq %r12, %r15
movq %r14, %r12
movq %rbp, %r14
je 0x1189e
movq %rbx, %rsi
movq (%rbx), %rbx
movq 0x60(%rsp), %rdi
movl $0x30, %edx
callq 0xb3c0
cmpq %r15, %rbx
jne 0x11884
leaq 0x40(%rsp), %rdi
callq 0xbab0
movq %r13, %rbp
addq $0x8, %rbp
xorl %r15d, %r15d
movq %rbp, %rdi
xorl %esi, %esi
callq 0xb9f0
movq 0x98(%rsp), %rax
cmpq %rax, (%r13)
jne 0x117b7
movq 0x50(%r13), %r13
testq %r13, %r13
jne 0x118de
movq 0x16662(%rip), %r13     # 0x27f40
movl 0x8(%r13), %eax
movq (%rsp), %rcx
movl 0x8(%rcx), %ecx
movl %eax, %edx
orl %ecx, %edx
je 0x11ade
movb 0xd(%r13), %sil
movq (%rsp), %rdx
cmpb %sil, 0xd(%rdx)
jne 0x11a70
movl %ecx, %edx
cmpl %edx, %eax
jne 0x117b7
movq (%rsp), %rsi
cmpb $0x0, 0xe(%rsi)
jne 0x11920
movq (%rsp), %rax
movq (%rax), %rsi
cmpb $0x0, 0xe(%r13)
jne 0x1192b
movq (%r13), %r13
movq %r13, %rdi
callq 0xb960
testl %eax, %eax
sete %al
jmp 0x11ad6
movq %rbp, 0x38(%rsp)
movl %r15d, 0x40(%rsp)
movw $0x10c, 0x44(%rsp)      # imm = 0x10C
movb $0x0, 0x46(%rsp)
movq %r13, %rdi
movq %r14, %rsi
leaq 0x10(%rsp), %rdx
leaq 0x38(%rsp), %rcx
callq 0xbf90
movq %rax, %rbp
xorl %r15d, %r15d
movq 0x98(%rsp), %rax
cmpq %rax, (%rbp)
jne 0x117b7
movq 0x8(%rbp), %r13
testq %r13, %r13
jne 0x11990
movq 0x165b0(%rip), %r13     # 0x27f40
movl 0x8(%r13), %eax
movq (%rsp), %rcx
movl 0x8(%rcx), %ecx
movl %eax, %edx
orl %ecx, %edx
je 0x11a56
movb 0xd(%r13), %sil
movq (%rsp), %rdx
cmpb %sil, 0xd(%rdx)
jne 0x119e8
movl %ecx, %edx
cmpl %edx, %eax
jne 0x117b7
movq (%rsp), %rsi
cmpb $0x0, 0xe(%rsi)
jne 0x119ce
movq (%rsp), %rax
movq (%rax), %rsi
cmpb $0x0, 0xe(%r13)
jne 0x119d9
movq (%r13), %r13
movq %r13, %rdi
callq 0xb960
testl %eax, %eax
sete %al
jmp 0x11a4e
movzbl %sil, %esi
movl $0x0, 0xc(%rsp)
leaq 0x38(%rsp), %rdi
xorl %ecx, %ecx
callq 0xbea0
movq 0x38(%rsp), %rbx
movq 0x40(%rsp), %rdx
subq %rbx, %rdx
movl 0x8(%r13), %eax
cmpq %rax, %rdx
jne 0x11a35
cmpb $0x0, 0xe(%r13)
jne 0x11a21
movq (%r13), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0xb960
testl %eax, %eax
sete %al
movl %eax, 0xc(%rsp)
testq %rbx, %rbx
je 0x11a4a
movq 0x48(%rsp), %rsi
subq %rbx, %rsi
movq %rbx, %rdi
callq 0xb940
movl 0xc(%rsp), %eax
testb %al, %al
je 0x117b7
addq $0x8, %rbp
movl $0x1, %r15d
movq %rbp, 0x90(%rsp)
xorl %r12d, %r12d
jmp 0x117b7
movzbl %sil, %esi
movl $0x0, 0xc(%rsp)
leaq 0x38(%rsp), %rdi
xorl %ecx, %ecx
callq 0xbea0
movq 0x38(%rsp), %rbx
movq 0x40(%rsp), %rdx
subq %rbx, %rdx
movl 0x8(%r13), %eax
cmpq %rax, %rdx
jne 0x11abd
cmpb $0x0, 0xe(%r13)
jne 0x11aa9
movq (%r13), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0xb960
testl %eax, %eax
sete %al
movl %eax, 0xc(%rsp)
testq %rbx, %rbx
je 0x11ad2
movq 0x48(%rsp), %rsi
subq %rbx, %rsi
movq %rbx, %rdi
callq 0xb940
movl 0xc(%rsp), %eax
testb %al, %al
je 0x117b7
movl $0x1, %r15d
movq $0x0, 0x90(%rsp)
movq %rbp, %r12
jmp 0x117b7
cmpl $0x3, %r15d
jne 0x11b1f
cmpb $0x0, 0x34(%rsp)
jne 0x11b29
xorl %edx, %edx
xorl %r12d, %r12d
movq %r12, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x90(%rsp), %rdx
jmp 0x11b0a
movl $0x28, %edi
callq 0xb3b0
movq %rax, %r15
movq 0x48(%r14), %rdx
testq %rdx, %rdx
jne 0x11b46
movq 0x163fa(%rip), %rdx     # 0x27f40
movq %r15, %rdi
movq (%rsp), %rsi
callq 0x11b92
movq 0x1648f(%rip), %rsi     # 0x27fe8
movq 0x163e8(%rip), %rdx     # 0x27f48
movq %r15, %rdi
callq 0xbe60
movq %rax, %rbx
movq %r15, %rdi
callq 0xb610
jmp 0x11b82
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xc020
movq %rbx, %rdi
callq 0xbe90
movq %rax, %rdi
callq 0xf080