// File: /workspace/github_cpp_makefile_star2_O2/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), %r15
movl 0xd0(%rsi), %eax
testl %eax, %eax
je 0x279f2
movq %rdx, %r12
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
leal 0x3c(%rax), %ecx
cmpl $0x3a, %ecx
ja 0x278bd
leaq 0x4eeec(%rip), %rax     # 0x76738
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x28e58
leaq 0x30(%rsp), %r15
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x30b82
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x1d786
movb $0x1, -0x8(%r13)
leaq 0x10(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x24b08
leaq 0x38(%rsp), %rdi
callq 0x1d786
movq %r14, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpl $0x28, %eax
je 0x2794d
cmpl $0x7b, %eax
je 0x27855
cmpl $0x40, %eax
je 0x27855
cmpl $0x5b, %eax
je 0x27855
cmpl $0x3b, %eax
jne 0x27a18
movups %xmm0, (%r14)
jmp 0x2789f
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x254a8
jmp 0x2789f
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x259d6
jmp 0x2789f
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2b292
jmp 0x2789f
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x25ec4
jmp 0x2789f
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2a256
jmp 0x2789f
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x276a2
jmp 0x2789f
movq %rbx, %rdi
callq 0x22e24
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x25798
leaq 0x30(%rsp), %r13
leaq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0x30b82
movq (%r13), %r13
leaq 0x18(%rsp), %rdi
callq 0x1d786
testq %r13, %r13
je 0x27a3e
cmpl $0x29, 0xd0(%rbx)
jne 0x27a64
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq %r12, %rsi
movq %r15, %rcx
callq 0x2f065
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x34214
leaq 0x18(%rsp), %rdi
callq 0x1d786
movq %rbx, %rdi
callq 0x22e24
leaq 0x10(%rsp), %r8
movb $0x1, (%r8)
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x24b08
jmp 0x2789f
leaq 0x4ef9e(%rip), %rsi     # 0x76997
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x1c814
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x25932
leaq 0x4ef1b(%rip), %rsi     # 0x7693a
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x1c814
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x25932
leaq 0x4eef5(%rip), %rsi     # 0x7693a
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x1c814
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x25932
leaq 0x4ee39(%rip), %rsi     # 0x768a4
leaq 0x48(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x1c814
leaq 0x508b0(%rip), %rsi     # 0x78331
leaq 0x80(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x1c814
leaq 0x68(%rsp), %rdi
leaq 0x80(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xd(%rsp), %rcx
callq 0x1f298
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x3f724
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x25932
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x27ae3
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x1cea0
jmp 0x27af2
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x101d0
jmp 0x27b04
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x27b19
jmp 0x27b40
jmp 0x27b11
jmp 0x27b40
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x27b43
jmp 0x27b40
jmp 0x27b40
jmp 0x27b40
jmp 0x27b40
jmp 0x27b40
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x27b4d
movq %rax, %rbx
jmp 0x27b4d
jmp 0x27b40
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x1d786
movq %rbx, %rdi
callq 0x106f0
nop