// File: /workspace/github_cpp_makefile_star2_O1/night-shift[P]Srl/src/lib/Environment.cpp
// Function: Srl::Lib::Environment::store_node(Srl::Node&, Srl::Node const&, Srl::String const&)
Link<Node>* Environment::store_node(Node& parent, const Node& node, const String& name)
{
    if(this->parsing) {

        Value scope_start = Value(node.scope_type);
        this->write(scope_start, name);

        for(auto& v : node.values) {
            this->write(v.field, v.field.name());
        }

        for(auto& n : node.nodes) {
            this->store_node(parent, n.field, n.field.name());
        }

        Value scope_end = Value(Type::Scope_End);
        this->write(scope_end, name);

        return create_node(node.scope_type, name);
    }

    if(node.env != this) {
        auto* link = this->create_link(parent.nodes, Node(this->tree, node.scope_type), name);

        for(auto& n : node.nodes) {
            link->field.insert_node(n.field, n.field.name());
        }
        for(auto& v : node.values) {
            link->field.insert_value(v.field, v.field.name());
        }

        return link;

    } else {
        return this->create_link(parent.nodes, node, name);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
cmpb $0x1, 0x258(%rdi)
jne 0xe7f8
movb 0x50(%rbx), %al
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movl $0x0, 0x10(%rsi)
movb %al, 0x14(%rsi)
movw $0x0, 0x15(%rsi)
movq %r15, %rdi
movq %r14, 0x8(%rsp)
movq %r14, %rdx
callq 0xbbe0
leaq 0x30(%rbx), %r13
movq 0x30(%rbx), %rbp
cmpq %r13, %rbp
je 0xe77d
movq 0x197e4(%rip), %r14     # 0x27f40
movq 0x18(%rbp), %rdx
testq %rdx, %rdx
jne 0xe768
movq %r14, %rdx
leaq 0x18(%rbp), %rsi
movq %r15, %rdi
callq 0xbbe0
movq (%rbp), %rbp
cmpq %r13, %rbp
jne 0xe75c
leaq 0x10(%rbx), %r13
movq 0x10(%rbx), %rbp
cmpq %r13, %rbp
je 0xe7b5
movq 0x197af(%rip), %r14     # 0x27f40
movq 0x60(%rbp), %rcx
testq %rcx, %rcx
jne 0xe79d
movq %r14, %rcx
leaq 0x18(%rbp), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xb470
movq (%rbp), %rbp
cmpq %r13, %rbp
jne 0xe791
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rsi
movaps %xmm0, (%rsi)
movl $0x0, 0x10(%rsi)
movw $0x10, 0x14(%rsi)
movb $0x0, 0x16(%rsi)
movq %r15, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0xbbe0
movzbl 0x50(%rbx), %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0xb1c0
movq %rax, %r14
jmp 0xe90b
addq $0x8, %r12
cmpq %r15, (%rbx)
je 0xe920
movq (%r15), %rdi
movb 0x50(%rbx), %bpl
callq 0xbf80
leaq 0x20(%rsp), %rcx
movq %rax, -0x10(%rcx)
addq $0x8, %rax
movq %rax, -0x8(%rcx)
movq %rcx, 0x8(%rcx)
movq %rcx, (%rcx)
movq $0x0, 0x10(%rcx)
movq %rax, 0x18(%rcx)
leaq 0x40(%rsp), %r13
movq %r13, 0x8(%r13)
movq %r13, (%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r13)
movb %bpl, 0x20(%r13)
movb $0x1, 0x21(%r13)
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0xbb30
movq %rax, %r14
movq 0x40(%rsp), %r15
cmpq %r13, %r15
je 0xe88a
movq %r15, %rsi
movq (%r15), %r15
movq 0x38(%rsp), %rdi
movl $0x30, %edx
callq 0xb3c0
jmp 0xe86e
leaq 0x18(%rsp), %rdi
callq 0xbab0
leaq 0x10(%rbx), %r12
movq 0x10(%rbx), %r13
cmpq %r12, %r13
je 0xe8cd
leaq 0x8(%r14), %r15
movq 0x19694(%rip), %rbp     # 0x27f40
movq 0x60(%r13), %rdx
testq %rdx, %rdx
jne 0xe8b8
movq %rbp, %rdx
leaq 0x18(%r13), %rsi
movq %r15, %rdi
callq 0xbc80
movq (%r13), %r13
cmpq %r12, %r13
jne 0xe8ac
movq 0x30(%rbx), %r12
addq $0x30, %rbx
cmpq %rbx, %r12
je 0xe90b
movq %r14, %r15
addq $0x8, %r15
movq 0x19658(%rip), %r13     # 0x27f40
movq 0x18(%r12), %rdx
testq %rdx, %rdx
jne 0xe8f5
movq %r13, %rdx
leaq 0x18(%r12), %rsi
movq %r15, %rdi
callq 0xb930
movq (%r12), %r12
cmpq %rbx, %r12
jne 0xe8e8
movq %r14, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r14, %rcx
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbb30
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xc020
movq %rbx, %rdi
callq 0xbe90
movq %rax, %rdi
callq 0xf080
nop