// File: /workspace/github_cpp_makefile_star2_O3/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 0x2c578
movq %rdx, %r12
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
cmpl $0x27, %eax
jg 0x2c40e
addl $0x3c, %eax
cmpl $0x3a, %eax
ja 0x2c668
leaq 0x57357(%rip), %rcx     # 0x836f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2e64e
movq 0x38(%rsp), %rdi
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
testq %rdi, %rdi
je 0x2c3cf
callq 0x1e5bc
leaq 0x10(%rsp), %r8
movb $0x1, (%r8)
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x28002
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2c3fa
callq 0x1e5bc
movq %r14, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpl $0x3f, %eax
jle 0x2c437
cmpl $0x40, %eax
je 0x2c3a6
cmpl $0x5b, %eax
je 0x2c3a6
cmpl $0x7b, %eax
je 0x2c3a6
jmp 0x2c668
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x28f58
jmp 0x2c3eb
cmpl $0x28, %eax
je 0x2c45b
cmpl $0x3b, %eax
jne 0x2c668
movups %xmm0, (%r14)
jmp 0x2c3eb
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x29720
jmp 0x2c3eb
movq %rbx, %rdi
callq 0x2549e
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2946a
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %rax
movq %r13, 0x30(%rsp)
movq 0x38(%rsp), %rdi
movq %rax, 0x38(%rsp)
testq %rdi, %rdi
je 0x2c496
callq 0x1e5bc
testq %r13, %r13
je 0x2c5a9
cmpl $0x29, 0xd0(%rbx)
jne 0x2c5da
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x30(%rsp), %r8
movq %r12, %rcx
movq %r15, %r9
callq 0x3aee2
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x38(%rsp), %rdi
movaps %xmm0, 0x30(%rsp)
testq %rdi, %rdi
je 0x2c503
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2c503
callq 0x1e5bc
movq %rbx, %rdi
callq 0x2549e
leaq 0x10(%rsp), %r8
movb $0x1, (%r8)
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x28002
jmp 0x2c3eb
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x29eb8
jmp 0x2c3eb
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x3002a
jmp 0x2c3eb
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x317f0
jmp 0x2c3eb
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2c19a
jmp 0x2c3eb
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x573ee(%rip), %rsi     # 0x83976
leaq 0x57409(%rip), %rdx     # 0x83998
leaq 0x10(%rsp), %rdi
callq 0x1e698
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x29658
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x57360(%rip), %rsi     # 0x83919
leaq 0x5736e(%rip), %rdx     # 0x8392e
leaq 0x10(%rsp), %rdi
callq 0x1e698
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x29658
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), %r12
movq %r12, -0x10(%r12)
movw $0x29, (%r12)
movq $0x1, -0x8(%r12)
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x20b38
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x47db4
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x29658
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x572a1(%rip), %rsi     # 0x83919
leaq 0x572af(%rip), %rdx     # 0x8392e
leaq 0x10(%rsp), %rdi
callq 0x1e698
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x29658
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c6bc
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x2c6bc
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x1db60
jmp 0x2c6d2
jmp 0x2c6fa
jmp 0x2c743
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x2c6e9
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c746
movq 0x58(%rsp), %rsi
jmp 0x2c70c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c746
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x2c746
jmp 0x2c743
jmp 0x2c743
jmp 0x2c743
jmp 0x2c743
jmp 0x2c743
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c755
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x2c755
movq %rax, %rbx
jmp 0x2c755
jmp 0x2c743
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2c755
callq 0x1e5bc
movq %rbx, %rdi
callq 0x106f0
nop