// File: night-shift[P]Srl/src/lib/Tree.cpp
// Function: Srl::Tree::prologue_in(Srl::Parser&, Srl::Lib::In::Source&)
void Tree::prologue_in(Parser& parser, Lib::In::Source& source)
{
    if(this->env) {
        this->clear();

    } else {
        this->create_env();
    }

    this->env->set_input(parser, source);

    MemBlock name; Value val;
    tie(name, val) = parser.read(this->env->in);

    if(!TpTools::is_scope(val.type())) {
        throw Exception("Unable to parse source. Data malformed.");
    }

    auto* link = this->env->create_node(val.type(), name);
    this->root_node = &link->field;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x34720
testb $0x1, %al
jne 0x6649d
jmp 0x664ab
movq -0xf8(%rbp), %rdi
callq 0x36310
jmp 0x664bc
movq -0xf8(%rbp), %rdi
movl $0xe, %esi
callq 0x35960
movq -0xf8(%rbp), %rdi
callq 0x36450
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x28(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x34150
leaq -0x40(%rbp), %rdi
callq 0x374c0
leaq -0x58(%rbp), %rdi
movl $0xb, %esi
callq 0x33ff0
movq -0xf8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
callq 0x36450
movq -0x100(%rbp), %rsi
movq %rax, %rdx
addq $0x260, %rdx            # imm = 0x260
movq (%rsi), %rax
leaq -0x80(%rbp), %rdi
callq *0x10(%rax)
leaq -0x90(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x37cb0
leaq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x35650
leaq -0x58(%rbp), %rdi
callq 0x35b80
movzbl %al, %edi
callq 0x35db0
testb $0x1, %al
jne 0x6666e
movb $0x1, -0xc5(%rbp)
movl $0x28, %edi
callq 0x34160
movq %rax, -0x110(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x38240
movq -0x108(%rbp), %rdx
leaq 0x3e6c(%rip), %rsi      # 0x6a437
leaq -0xb0(%rbp), %rdi
callq 0x37f40
jmp 0x665d9
movq -0x110(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x33910
jmp 0x665ee
movq -0x110(%rbp), %rdi
movb $0x0, -0xc5(%rbp)
movq 0x1c9e5(%rip), %rsi     # 0x82fe8
movq 0x1c92e(%rip), %rdx     # 0x82f38
callq 0x37fc0
jmp 0x66716
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x66646
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x38ce0
leaq -0xb1(%rbp), %rdi
callq 0x35f90
testb $0x1, -0xc5(%rbp)
jne 0x6665d
jmp 0x66669
movq -0x110(%rbp), %rdi
callq 0x34ce0
jmp 0x6670a
movq -0xf8(%rbp), %rdi
callq 0x36450
movq %rax, -0x120(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x35b80
movb %al, -0x111(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
movl $0x1, %ecx
callq 0x38280
movq -0x120(%rbp), %rdi
movb -0x111(%rbp), %al
leaq -0xe0(%rbp), %rdx
movzbl %al, %esi
callq 0x337b0
movq %rax, %rcx
movq -0xf8(%rbp), %rax
movq %rcx, -0xd0(%rbp)
movq -0xd0(%rbp), %rcx
addq $0x8, %rcx
movq %rcx, 0x8(%rax)
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0xc0(%rbp), %rdi
callq 0x38210
nopw %cs:(%rax,%rax)