// File: /workspace/github_cpp_makefile_star2_O1/Nallantli[P]Rossa/main/rossa/node_parser/node_parser.cpp
// Function: node_parser_t::parseUnitNode(std::vector<node_scope_t, std::allocator<node_scope_t>>*)
ptr_node_t node_parser_t::parseUnitNode(std::vector<node_scope_t> *scopes)
{
	if (currentToken.type == NULL_TOK)
		return logErrorN(_UNEXPECTED_TERMINATION_, currentToken);

	ptr_node_t ret = nullptr;
	switch (currentToken.type)
	{
	case ';':
	case 0:
		return nullptr;
	case TOK_NUM:
	case TOK_IDF:
	case TOK_TRUE:
	case TOK_FALSE:
	case TOK_NIL:
	case TOK_STR_LIT:
	case '@':
	case '[':
	case '{':
	case TOK_NIL_NAME:
	case TOK_NUMBER:
	case TOK_STRING:
	case TOK_BOOLEAN:
	case TOK_ARRAY:
	case TOK_DICTIONARY:
	case TOK_OBJECT:
	case TOK_FUNCTION:
	case TOK_TYPE_NAME:
	case TOK_POINTER:
	case TOK_NO_PARAM_LAMBDA:
	case TOK_LAMBDA:
		ret = parseBaseNode(scopes);
		return parseTrailingNode(scopes, ret, true);
	case TOK_EXTERN_CALL:
		return parseExternCallNode(scopes);
	case TOK_CALL_OP:
		return parseCallOpNode(scopes);
	case TOK_ALLOC:
	case TOK_LENGTH:
	case TOK_CHARN:
	case TOK_CHARS:
	case TOK_PARSE:
		return parseCallBuiltNode(scopes);
	case TOK_NEW:
		return parseNewNode(scopes);
	case TOK_OPR:
		return parseUnOpNode(scopes);
	case TOK_EACH:
		return parseEachNode(scopes);
	case '(':
		nextToken();
		if ((ret = parseEquNode(scopes)))
		{
			if (currentToken.type != ')')
				return logErrorN(util::format(_EXPECTED_ERROR_, {")"}), currentToken);
			ret = std::make_shared<ParenNode>(*scopes, ret, currentToken);
			nextToken();
			return parseTrailingNode(scopes, ret, true);
		}
		return logErrorN(_FAILURE_PARSE_CODE_, currentToken);
	default:
		return logErrorN(_FAILURE_PARSE_CODE_, currentToken);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %rbx
leaq 0x58(%rsi), %r12
movl 0xd0(%rsi), %eax
testl %eax, %eax
je 0x2c8a5
movq %rdx, %r15
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
cmpl $0x27, %eax
jg 0x2c727
addl $0x3c, %eax
cmpl $0x3a, %eax
ja 0x2c986
leaq 0x5804f(%rip), %rcx     # 0x846f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rsp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2ea36
movaps (%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%rsp)
movq 0x38(%rsp), %rdi
movaps %xmm0, 0x30(%rsp)
testq %rdi, %rdi
je 0x2c6db
callq 0x1e6ee
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2c6ea
callq 0x1e6ee
movq %rsp, %r8
movb $0x1, (%r8)
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x28276
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2c713
callq 0x1e6ee
movq %r14, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpl $0x3f, %eax
jle 0x2c75c
cmpl $0x40, %eax
je 0x2c6ae
cmpl $0x5b, %eax
je 0x2c6ae
cmpl $0x7b, %eax
je 0x2c6ae
jmp 0x2c986
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2918e
jmp 0x2c704
cmpl $0x28, %eax
je 0x2c780
cmpl $0x3b, %eax
jne 0x2c986
movups %xmm0, (%r14)
jmp 0x2c704
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2995c
jmp 0x2c704
movq %rbx, %rdi
callq 0x2565a
movq %rsp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x296b0
movaps (%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%rsp)
movq 0x38(%rsp), %rdi
movaps %xmm0, 0x30(%rsp)
testq %rdi, %rdi
je 0x2c7b5
callq 0x1e6ee
movq 0x30(%rsp), %r13
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2c7c9
callq 0x1e6ee
testq %r13, %r13
je 0x2c8d2
cmpl $0x29, 0xd0(%rbx)
jne 0x2c8ff
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %rsp, %rsi
leaq 0x48(%rsp), %rdx
leaq 0x30(%rsp), %r8
movq %r15, %rcx
movq %r12, %r9
callq 0x3b4a8
movaps (%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%rsp)
movq 0x38(%rsp), %rdi
movaps %xmm0, 0x30(%rsp)
testq %rdi, %rdi
je 0x2c823
callq 0x1e6ee
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2c832
callq 0x1e6ee
movq %rbx, %rdi
callq 0x2565a
movq %rsp, %r8
movb $0x1, (%r8)
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x28276
jmp 0x2c704
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2a106
jmp 0x2c704
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x30540
jmp 0x2c704
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x31c54
jmp 0x2c704
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2c48e
jmp 0x2c704
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x580a1(%rip), %rsi     # 0x84956
leaq 0x580bc(%rip), %rdx     # 0x84978
movq %rsp, %rdi
callq 0x1e7ca
movq %rsp, %rdx
movq %rbx, %rsi
movq %r12, %rcx
callq 0x29894
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x58017(%rip), %rsi     # 0x848f9
leaq 0x58025(%rip), %rdx     # 0x8490e
movq %rsp, %rdi
callq 0x1e7ca
movq %rsp, %rdx
movq %rbx, %rsi
movq %r12, %rcx
callq 0x29894
leaq 0x58(%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 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
movw $0x29, (%r15)
movq $0x1, -0x8(%r15)
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x2f(%rsp), %rcx
movl $0x1, %edx
callq 0x20c5e
movq %rsp, %rdi
leaq 0x48(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x48694
movq %rsp, %rdx
movq %rbx, %rsi
movq %r12, %rcx
callq 0x29894
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x57f63(%rip), %rsi     # 0x848f9
leaq 0x57f71(%rip), %rdx     # 0x8490e
movq %rsp, %rdi
callq 0x1e7ca
movq %rsp, %rdx
movq %rbx, %rsi
movq %r12, %rcx
callq 0x29894
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c9d6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x2c9d6
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x1dca2
jmp 0x2c9ec
jmp 0x2ca14
jmp 0x2ca5b
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x2ca03
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x2ca5e
movq 0x58(%rsp), %rsi
jmp 0x2ca25
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2ca5e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x2ca5e
jmp 0x2ca5b
jmp 0x2ca5b
jmp 0x2ca5b
jmp 0x2ca5b
jmp 0x2ca5b
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2ca6d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x2ca6d
movq %rax, %rbx
jmp 0x2ca6d
jmp 0x2ca5b
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2ca6d
callq 0x1e6ee
movq %rbx, %rdi
callq 0x106f0
nop