// File: /workspace/github_cpp_makefile_star2_O2/Nallantli[P]Rossa/main/rossa/node_parser/node_parser.cpp
// Function: node_parser_t::parseClassNode(std::vector<node_scope_t, std::allocator<node_scope_t>>*)
ptr_node_t node_parser_t::parseClassNode(std::vector<node_scope_t> *scopes)
{
	auto type = currentToken.type;
	nextToken();
	auto key = ROSSA_HASH(currentToken.valueString);
	nextToken();
	ptr_node_t extends = nullptr;
	if (currentToken.type == ':')
	{
		nextToken();
		extends = parseUnitNode(scopes);
	}
	if (currentToken.type != '{')
		return logErrorN(util::format(_EXPECTED_ERROR_, {"{"}), currentToken);
	nextToken();
	std::vector<ptr_node_t> body;
	scopes->push_back({key});
	while (currentToken.type != NULL_TOK)
	{
		if (currentToken.type == '}')
			break;

		if (auto e = parseExprNode(scopes))
			body.push_back(e);
		else
			return logErrorN(_FAILURE_PARSE_CODE_, currentToken);
	}
	if (currentToken.type != '}')
		return logErrorN(util::format(_EXPECTED_ERROR_, {"}"}), currentToken);
	nextToken();

	scopes->pop_back();
	return std::make_shared<ClassNode>(*scopes, key, type, body, extends, currentToken);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movl 0xd0(%rsi), %eax
movl %eax, 0x3c(%rsp)
movq %rsi, %rdi
callq 0x22e24
leaq 0xb0(%rbx), %rsi
leaq 0x88c36(%rip), %rdi     # 0xb6908
callq 0x1efb0
movq %rax, %r13
movq %rax, 0x98(%rsp)
movq %rbx, %rdi
callq 0x22e24
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movl 0xd0(%rbx), %eax
cmpl $0x3a, %eax
jne 0x2dd34
movq %rbx, %rdi
callq 0x22e24
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2780a
leaq 0x60(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x30b82
leaq 0x18(%rsp), %rdi
callq 0x1d786
movl 0xd0(%rbx), %eax
leaq 0x58(%rbx), %r14
cmpl $0x7b, %eax
jne 0x2def8
movq %rbx, %rdi
callq 0x22e24
movq %r14, 0x30(%rsp)
andq $0x0, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
leaq 0x18(%rsp), %r14
movq %r13, -0x8(%r14)
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x1fe52
movq %r14, %rdi
callq 0x1f5c4
leaq 0x80(%rsp), %r13
leaq 0x78(%rsp), %rbp
leaq 0x40(%rsp), %r14
movl 0xd0(%rbx), %eax
cmpl $0x7d, %eax
je 0x2ddd7
testl %eax, %eax
je 0x2de58
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x23390
cmpq $0x0, 0x78(%rsp)
je 0x2decd
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2e880
movq %r13, %rdi
callq 0x1d786
jmp 0x2dd95
movq %rbx, %rdi
callq 0x22e24
movq %r12, %rdi
callq 0x2eb8e
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rdx
leaq 0x3c(%rsp), %rcx
leaq 0x40(%rsp), %r8
leaq 0x60(%rsp), %r9
movq %r12, %rsi
callq 0x2f1d9
leaq 0x18(%rsp), %rdi
movaps -0x8(%rdi), %xmm0
andq $0x0, (%rdi)
movups %xmm0, (%r15)
andq $0x0, -0x8(%rdi)
callq 0x1d786
leaq 0x40(%rsp), %rdi
callq 0x2e838
leaq 0x68(%rsp), %rdi
callq 0x1d786
movq %r15, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x48a45(%rip), %rsi     # 0x768a4
leaq 0x78(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x1c814
leaq 0x4ca4c(%rip), %rsi     # 0x7a8c1
leaq 0xa0(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x1c814
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x1f298
leaq 0x10(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x3f724
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq 0x30(%rsp), %rcx
callq 0x25932
leaq 0x48a66(%rip), %rsi     # 0x7693a
leaq 0x10(%rsp), %rdi
leaq 0xa0(%rsp), %rdx
callq 0x1c814
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq 0x30(%rsp), %rcx
callq 0x25932
leaq 0x489a5(%rip), %rsi     # 0x768a4
leaq 0x78(%rsp), %rdi
leaq 0xc0(%rsp), %rdx
callq 0x1c814
leaq 0x48b3d(%rip), %rsi     # 0x76a55
leaq 0xa0(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x1c814
leaq 0x40(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xd(%rsp), %rcx
callq 0x1f298
leaq 0x10(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x3f724
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r14, %rcx
callq 0x25932
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2df7a
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x1cea0
jmp 0x2df89
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x101d0
jmp 0x2df9b
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x101d0
jmp 0x2e033
jmp 0x2dfbf
jmp 0x2dfbf
jmp 0x2e026
jmp 0x2e026
movq %rax, %rbx
movq %r14, %rdi
callq 0x1f5c4
jmp 0x2e029
movq %rax, %rbx
jmp 0x2e033
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2dfd6
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x1cea0
jmp 0x2dfe8
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x101d0
jmp 0x2dffa
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x101d0
jmp 0x2e029
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2e01c
jmp 0x2e019
jmp 0x2e026
movq %rax, %rbx
movq %r13, %rdi
callq 0x1d786
jmp 0x2e029
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2e838
leaq 0x68(%rsp), %rdi
callq 0x1d786
movq %rbx, %rdi
callq 0x106f0
nop