// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movl 0xd0(%rsi), %eax
movl %eax, 0x3c(%rsp)
movq %rsi, %rdi
callq 0x2565a
leaq 0xb0(%rbx), %r15
leaq 0x815ea(%rip), %r13     # 0xb78f8
movq (%r13), %rdi
movq 0x8(%r13), %rsi
movq %r15, %rdx
callq 0x20e41
movq 0x8(%r13), %rsi
cmpq %rsi, %rax
je 0x3633f
movq (%r13), %r13
movq %r13, %rdi
movq %r15, %rdx
callq 0x20e41
subq %r13, %rax
sarq $0x5, %rax
jmp 0x36359
movq %r13, %rdi
movq %r15, %rsi
callq 0x20e04
movq 0x8(%r13), %rax
subq (%r13), %rax
sarq $0x5, %rax
decq %rax
movq %rax, 0x78(%rsp)
movq %rbx, %rdi
callq 0x2565a
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
cmpl $0x3a, 0xd0(%rbx)
jne 0x363bf
movq %rbx, %rdi
callq 0x2565a
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2c656
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x68(%rsp), %rdi
movaps %xmm0, 0x60(%rsp)
testq %rdi, %rdi
je 0x363b0
callq 0x1e6ee
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x363bf
callq 0x1e6ee
leaq 0x58(%rbx), %r15
cmpl $0x7b, 0xd0(%rbx)
jne 0x365f2
movq %rbx, %rdi
callq 0x2565a
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
xorl %eax, %eax
movq %rax, 0x90(%rsp)
movq 0x78(%rsp), %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movups %xmm0, 0x8(%rsi)
movq %rax, 0x18(%rsi)
movq %r12, %rdi
callq 0x21808
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x36421
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x103d0
leaq 0x40(%rsp), %rbp
leaq 0x80(%rsp), %r13
movl 0xd0(%rbx), %eax
cmpl $0x7d, %eax
je 0x36477
testl %eax, %eax
je 0x3652d
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x25fda
cmpq $0x0, 0x40(%rsp)
je 0x365c1
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3725c
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x3642e
callq 0x1e6ee
jmp 0x3642e
movq %rbx, %rdi
callq 0x2565a
movq 0x8(%r12), %rax
leaq -0x20(%rax), %rcx
movq %rcx, 0x8(%r12)
movq -0x18(%rax), %rdi
testq %rdi, %rdi
je 0x364a2
movq -0x8(%rax), %rsi
subq %rdi, %rsi
callq 0x103d0
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x68(%rsp), %rax
leaq 0x18(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x80(%rsp), %r8
leaq 0x44(%rsp), %r9
movq %r12, %rcx
pushq %r15
pushq %rax
pushq %r13
callq 0x3c0b4
addq $0x20, %rsp
movq 0x10(%rsp), %rax
movq %rax, (%r14)
xorl %eax, %eax
movq %rax, 0x8(%r14)
movq 0x18(%rsp), %rcx
movq %rax, 0x18(%rsp)
movq %rcx, 0x8(%r14)
leaq 0x80(%rsp), %rdi
callq 0x37214
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x36518
callq 0x1e6ee
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x50(%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 0xb0(%rsp), %r12
movq %r12, -0x10(%r12)
movw $0x7d, (%r12)
movq $0x1, -0x8(%r12)
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x20c5e
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x48694
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x29894
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4e328(%rip), %rsi     # 0x848f9
leaq 0x4e336(%rip), %rdx     # 0x8490e
leaq 0x10(%rsp), %rdi
callq 0x1e7ca
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x29894
leaq 0x50(%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 0xb0(%rsp), %r12
movq %r12, -0x10(%r12)
movw $0x7b, (%r12)
movq $0x1, -0x8(%r12)
leaq 0x80(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0xc0(%rsp), %rcx
movl $0x1, %edx
callq 0x20c5e
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x48694
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r15, %rcx
callq 0x29894
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x366ac
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x366ac
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x1dca2
jmp 0x366be
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r12, %rdi
je 0x366db
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x367da
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x367da
jmp 0x36725
jmp 0x367ca
jmp 0x367ca
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x367cd
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
jmp 0x367af
movq %rax, %rbx
jmp 0x367da
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36750
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x36750
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x1dca2
jmp 0x36780
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x367b9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x367b9
jmp 0x367b6
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r12, %rdi
je 0x3679d
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x367cd
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x367cd
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x367cd
callq 0x1e6ee
jmp 0x367cd
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x37214
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x367e9
callq 0x1e6ee
movq %rbx, %rdi
callq 0x106f0
nop