// File: /workspace/github_cpp_makefile_star2_O1/Nallantli[P]Rossa/main/rossa/node_parser/node_parser.cpp
// Function: node_parser_t::parseLoadNode(std::vector<node_scope_t, std::allocator<node_scope_t>>*)
ptr_node_t node_parser_t::parseLoadNode(std::vector<node_scope_t> *scopes)
{
	nextToken();
	if (currentToken.type != TOK_STR_LIT)
		return logErrorN(_EXPECTED_FILE_, currentToken);
	std::string filename = currentToken.valueString + ".ra";
	nextToken();

	auto path = dir::findFile(currentFile.parent_path(), filename, &currentToken);

	if (std::find(dir::loaded.begin(), dir::loaded.end(), path) != dir::loaded.end())
	{
		if (currentToken.type != ';')
			return logErrorN(util::format(_EXPECTED_ERROR_, {";"}), currentToken);
		nextToken();
		return nullptr;
	}

	dir::loaded.push_back(path);

	std::string content = "";
	std::string line;
	std::ifstream myfile(path.string());
	if (myfile.is_open())
	{
		while (getline(myfile, line))
			content += line + "\n";
		myfile.close();
	}

	auto tokens = lexString(content, path.filename().string());
	node_parser_t np(tokens, path);
	auto n = np.parse(scopes, consts);

	if (currentToken.type != ';')
		return logErrorN(util::format(_EXPECTED_ERROR_, {";"}), currentToken);
	nextToken();

	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movq %rdx, 0x100(%rsp)
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2565a
leaq 0x58(%r15), %r13
cmpl $-0x12, 0xd0(%r15)
jne 0x36d24
leaq 0xd0(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0xb0(%r15), %rsi
movq 0xb8(%r15), %rdx
addq %rsi, %rdx
leaq 0xc0(%rsp), %rbx
movq %rbx, %rdi
callq 0x1e014
leaq 0x4e214(%rip), %rsi     # 0x84a74
movq %rbx, %rdi
callq 0x10770
movq %r15, %rdi
callq 0x2565a
leaq 0x28(%r15), %rsi
leaq 0x230(%rsp), %rdi
callq 0x10760
leaq 0x50(%rsp), %rdi
leaq 0x230(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
movq %r13, %rcx
callq 0x567f8
leaq 0x230(%rsp), %rdi
callq 0x1d736
leaq 0x8168e(%rip), %rbx     # 0xb7f40
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
leaq 0x50(%rsp), %rdx
callq 0x3c245
cmpq 0x8(%rbx), %rax
je 0x368eb
cmpl $0x3b, 0xd0(%r15)
jne 0x36d5e
movq %r15, %rdi
callq 0x2565a
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
jmp 0x36ce8
movq %r13, 0xf0(%rsp)
movq %r15, 0x8(%rsp)
leaq 0x81641(%rip), %rdi     # 0xb7f40
leaq 0x50(%rsp), %rbx
movq %rbx, %rsi
callq 0x37660
movq %r14, 0xf8(%rsp)
leaq 0x40(%rsp), %r13
movq %r13, -0x10(%r13)
xorl %eax, %eax
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq 0xb0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq 0x50(%rsp), %rsi
leaq 0x118(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
leaq 0x108(%rsp), %rdi
callq 0x1e7ca
leaq 0x230(%rsp), %rbp
leaq 0x108(%rsp), %rsi
movq %rbp, %rdi
movl $0x8, %edx
callq 0x10670
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x36999
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x103d0
leaq 0x2a8(%rsp), %rdi
callq 0x100b0
testb %al, %al
je 0x36a8a
leaq 0xa0(%rsp), %r12
leaq 0x108(%rsp), %r15
leaq 0x4f118(%rip), %r13     # 0x85add
leaq 0x30(%rsp), %rbx
movq 0x230(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x103a0
movsbl %al, %edx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x10720
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x36a6b
movq %r14, 0x108(%rsp)
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x1e014
movq %r15, %rdi
movq %r13, %rsi
callq 0x10770
movq 0x108(%rsp), %rsi
movq 0x110(%rsp), %rdx
movq %rbx, %rdi
callq 0x10120
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x369ca
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x369ca
leaq 0x230(%rsp), %rdi
leaq 0xd0(%rsp), %r12
leaq 0x40(%rsp), %r13
callq 0x100a0
leaq 0x50(%rsp), %rbx
movq 0x58(%rsp), %rcx
testq %rcx, %rcx
movq 0xf8(%rsp), %r14
je 0x36b10
movq 0x70(%rsp), %rax
movl %eax, %edx
notb %dl
testb $0x3, %dl
je 0x36b01
movl %eax, %edx
andl $0x3, %edx
jne 0x36b10
movq 0x50(%rsp), %rdx
cmpb $0x2f, -0x1(%rdx,%rcx)
je 0x36b10
leaq 0x70(%rsp), %rbx
testb $0x3, %al
je 0x36aca
xorl %eax, %eax
jmp 0x36ad2
movq %rbx, %rdi
callq 0x10270
movq 0x70(%rsp), %rdx
leaq -0x30(%rax), %rcx
testb $0x3, %dl
cmovneq %rax, %rcx
leaq 0x20(%rcx), %rax
testb $0x3, %dl
cmoveq %rax, %rbx
movl (%rbx), %eax
notl %eax
testb $0x3, %al
jne 0x36b10
testb $0x3, %dl
leaq 0x50(%rsp), %rbx
cmoveq %rcx, %rbx
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x1e698
jmp 0x36b1a
leaq 0x78(%rsp), %rdi
callq 0x251b8
movq 0x78(%rsp), %rsi
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x1e7ca
leaq 0x108(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x2, %edx
callq 0x3768c
leaq 0x1e0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x108(%rsp), %rdx
callq 0x2391f
leaq 0x108(%rsp), %rdi
callq 0x1d736
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x36b92
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
leaq 0x78(%rsp), %rdi
callq 0x1d736
leaq 0x108(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x255c8
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
leaq 0x108(%rsp), %rdi
movq %rax, 0x8(%rdi)
callq 0x2565a
leaq 0xe0(%rsp), %rdi
leaq 0x108(%rsp), %rsi
movq 0x100(%rsp), %rdx
callq 0x25ed6
movq 0x8(%rsp), %rdi
cmpl $0x3b, 0xd0(%rdi)
jne 0x36df8
callq 0x2565a
movq 0xe0(%rsp), %rax
movq %rax, (%r14)
xorl %eax, %eax
movq %rax, 0x8(%r14)
movq 0xe8(%rsp), %rcx
movq %rax, 0xe8(%rsp)
movq %rcx, 0x8(%r14)
leaq 0x1c8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36c4a
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x103d0
leaq 0x198(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36c6b
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x103d0
leaq 0x160(%rsp), %rdi
callq 0x1d736
leaq 0x130(%rsp), %rdi
callq 0x1d736
leaq 0x118(%rsp), %rdi
callq 0x20ba4
leaq 0x1e0(%rsp), %rdi
callq 0x20ba4
leaq 0x230(%rsp), %rdi
callq 0x100d0
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x36cd1
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0x36ce8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
leaq 0x50(%rsp), %rdi
callq 0x1d736
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0x36d0f
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x103d0
movq %r14, %rax
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x240(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4dd1e(%rip), %rsi     # 0x84a55
leaq 0x4dd35(%rip), %rdx     # 0x84a73
leaq 0x230(%rsp), %rdi
callq 0x1e7ca
leaq 0x230(%rsp), %rdx
movq %r15, %rsi
movq %r13, %rcx
callq 0x29894
movq %r15, %rbx
leaq 0x118(%rsp), %r14
movq %r14, -0x10(%r14)
movabsq $0x6465746365707845, %rax # imm = 0x6465746365707845
movq %rax, (%r14)
movabsq $0x607d307b60206465, %rax # imm = 0x607D307B60206465
movq %rax, 0x6(%r14)
movq $0xe, -0x8(%r14)
movb $0x0, 0xe(%r14)
leaq 0x88(%rsp), %r15
movq %r15, -0x10(%r15)
movw $0x3b, (%r15)
movq $0x1, -0x8(%r15)
leaq 0x30(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0xa0(%rsp), %rcx
movl $0x1, %edx
callq 0x20c5e
leaq 0x230(%rsp), %rdi
leaq 0x108(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x48694
leaq 0x230(%rsp), %rdx
movq %rbx, %rsi
movq %r13, %rcx
callq 0x29894
movq %r15, 0x10(%rsp)
movabsq $0x6465746365707845, %rax # imm = 0x6465746365707845
movq %rax, 0x20(%rsp)
movabsq $0x607d307b60206465, %rax # imm = 0x607D307B60206465
movq %rax, 0x26(%rsp)
movq $0xe, 0x18(%rsp)
movb $0x0, 0x2e(%rsp)
leaq 0x208(%rsp), %r14
movq %r14, -0x10(%r14)
movw $0x3b, (%r14)
movq $0x1, -0x8(%r14)
leaq 0x218(%rsp), %rdi
leaq 0x1f8(%rsp), %rsi
leaq 0x7(%rsp), %rcx
movl $0x1, %edx
callq 0x20c5e
leaq 0x78(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x218(%rsp), %rdx
callq 0x48694
leaq 0x78(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq 0xf0(%rsp), %rcx
callq 0x29894
movq %rax, %rbx
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36eb9
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x36eb9
movq %rax, %rbx
leaq 0x218(%rsp), %rdi
callq 0x1dca2
jmp 0x36f0a
jmp 0x370bd
movq %rax, %rbx
leaq 0x240(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36ef6
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x36ef6
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1dca2
jmp 0x36f43
jmp 0x370bd
movq %rax, %rbx
movq 0x1f8(%rsp), %rdi
cmpq %r14, %rdi
je 0x36f27
movq 0x208(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x36f7e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x36f7e
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x36f5d
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x3710e
movq 0x118(%rsp), %rsi
jmp 0x37106
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x3703e
callq 0x1e6ee
jmp 0x3703e
movq %rax, %rbx
jmp 0x3704b
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x1d736
jmp 0x36fb6
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x36fd2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x36fd2
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x1d736
jmp 0x370c0
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x370cd
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x370cd
movq %rax, %rbx
jmp 0x370cd
movq %rax, %rbx
movq 0x230(%rsp), %rdi
cmpq %r14, %rdi
je 0x3713d
movq 0x240(%rsp), %rsi
jmp 0x37135
movq %rax, %rbx
jmp 0x3713d
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x20b44
leaq 0x1e0(%rsp), %rdi
callq 0x20ba4
jmp 0x370c0
jmp 0x3705c
movq %rax, %rbx
jmp 0x3710e
movq %rax, %rbx
leaq 0x230(%rsp), %rdi
jmp 0x37113
jmp 0x37076
movq %rax, %rbx
jmp 0x37118
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
jne 0x3712d
jmp 0x3713d
jmp 0x37099
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x370c0
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x370c0
jmp 0x370bd
movq %rax, %rbx
leaq 0x230(%rsp), %rdi
callq 0x100d0
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x370f2
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3710e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
leaq 0x50(%rsp), %rdi
callq 0x1d736
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x3713d
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x103d0
movq %rbx, %rdi
callq 0x106f0
nop