// File: 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
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
movq %rdi, -0x230(%rbp)
movq %rdi, %rax
movq %rax, -0x228(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x220(%rbp)
movl 0xd0(%rdi), %eax
movl %eax, -0x1c(%rbp)
callq 0x38fd0
movq -0x220(%rbp), %rsi
addq $0x58, %rsi
addq $0x58, %rsi
leaq 0x190271(%rip), %rdi    # 0x1e5a98
callq 0x2cb10
movq -0x220(%rbp), %rdi
movq %rax, -0x28(%rbp)
callq 0x38fd0
leaq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x58bf0
movq -0x220(%rbp), %rax
cmpl $0x3a, 0xd0(%rax)
jne 0x558a6
movq -0x220(%rbp), %rdi
callq 0x38fd0
jmp 0x55867
movq -0x220(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x44bf0
jmp 0x5587d
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x577a0
leaq -0x58(%rbp), %rdi
callq 0x24b20
jmp 0x558a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x56148
movq -0x220(%rbp), %rax
cmpl $0x7b, 0xd0(%rax)
je 0x55b99
leaq -0x99(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x119d0
movq -0x238(%rbp), %rdx
leaq 0xfb8b5(%rip), %rsi     # 0x151190
leaq -0x98(%rbp), %rdi
callq 0x24740
jmp 0x558e9
movb $0x1, -0xf2(%rbp)
leaq -0xe8(%rbp), %rax
movq %rax, -0x248(%rbp)
movq %rax, -0xf0(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x119d0
movq -0x248(%rbp), %rdi
movq -0x240(%rbp), %rdx
leaq 0xfba14(%rip), %rsi     # 0x151341
callq 0x24740
jmp 0x55934
movb $0x0, -0xf2(%rbp)
leaq -0xe8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq $0x1, -0xc0(%rbp)
leaq -0xf3(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x26e30
movq -0x250(%rbp), %rcx
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
callq 0x2d6a0
jmp 0x5598a
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x9e250
jmp 0x559a3
movq -0x220(%rbp), %rsi
movq -0x230(%rbp), %rdi
movq %rsi, %rcx
addq $0x58, %rcx
leaq -0x78(%rbp), %rdx
callq 0x3f820
jmp 0x559c3
leaq -0x78(%rbp), %rdi
callq 0x11360
leaq -0xb8(%rbp), %rdi
callq 0x25b00
leaq -0xf3(%rbp), %rdi
callq 0x279c0
leaq -0xe8(%rbp), %rax
movq %rax, -0x260(%rbp)
addq $0x20, %rax
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x268(%rbp)
callq 0x11360
movq -0x260(%rbp), %rcx
movq -0x268(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x258(%rbp)
jne 0x559fd
leaq -0xf1(%rbp), %rdi
callq 0x11600
leaq -0x98(%rbp), %rdi
callq 0x11360
leaq -0x99(%rbp), %rdi
callq 0x11600
movl $0x1, -0xf8(%rbp)
jmp 0x5612f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x55b88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x55b18
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x55ac0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x55ab4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x11360
leaq -0xb8(%rbp), %rdi
callq 0x25b00
leaq -0xf3(%rbp), %rdi
callq 0x279c0
leaq -0xe8(%rbp), %rax
movq %rax, -0x278(%rbp)
addq $0x20, %rax
movq %rax, -0x270(%rbp)
movq -0x270(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x280(%rbp)
callq 0x11360
movq -0x278(%rbp), %rcx
movq -0x280(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x270(%rbp)
jne 0x55ae5
jmp 0x55b18
leaq -0xf1(%rbp), %rdi
callq 0x11600
testb $0x1, -0xf2(%rbp)
jne 0x55b2f
jmp 0x55b7c
movq -0xf0(%rbp), %rax
leaq -0xe8(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x288(%rbp)
je 0x55b7a
movq -0x288(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x290(%rbp)
callq 0x11360
movq -0x290(%rbp), %rax
leaq -0xe8(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x288(%rbp)
jne 0x55b49
jmp 0x55b7c
leaq -0x98(%rbp), %rdi
callq 0x11360
leaq -0x99(%rbp), %rdi
callq 0x11600
jmp 0x56148
movq -0x220(%rbp), %rdi
callq 0x38fd0
jmp 0x55ba7
leaq -0x110(%rbp), %rdi
callq 0x57390
movq -0x18(%rbp), %rax
movq %rax, -0x298(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
xorps %xmm0, %xmm0
movups %xmm0, -0x128(%rbp)
movq $0x0, -0x118(%rbp)
callq 0x2ccf0
movq -0x298(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x2ccc0
jmp 0x55bff
leaq -0x130(%rbp), %rdi
callq 0x2cd10
movq -0x220(%rbp), %rax
cmpl $0x0, 0xd0(%rax)
je 0x55d9e
movq -0x220(%rbp), %rax
cmpl $0x7d, 0xd0(%rax)
jne 0x55c51
jmp 0x55d9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x2cd10
jmp 0x56121
movq -0x220(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x140(%rbp), %rdi
callq 0x39980
jmp 0x55c6a
leaq -0x140(%rbp), %rdi
callq 0x57630
testb $0x1, %al
jne 0x55c7c
jmp 0x55cb8
leaq -0x110(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x57650
jmp 0x55c91
jmp 0x55d62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x56121
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x55d8d
leaq -0x161(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x119d0
movq -0x2a0(%rbp), %rdx
leaq 0xfb54d(%rip), %rsi     # 0x151226
leaq -0x160(%rbp), %rdi
callq 0x24740
jmp 0x55ce7
movq -0x220(%rbp), %rsi
movq -0x230(%rbp), %rdi
movq %rsi, %rcx
addq $0x58, %rcx
leaq -0x160(%rbp), %rdx
callq 0x3f820
jmp 0x55d0a
leaq -0x160(%rbp), %rdi
callq 0x11360
leaq -0x161(%rbp), %rdi
callq 0x11600
movl $0x1, -0xf8(%rbp)
jmp 0x55d6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x55d54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x11360
leaq -0x161(%rbp), %rdi
callq 0x11600
jmp 0x55d8d
movl $0x0, -0xf8(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x24b20
movl -0xf8(%rbp), %eax
testl %eax, %eax
jne 0x56113
jmp 0x55d88
jmp 0x55c0b
leaq -0x140(%rbp), %rdi
callq 0x24b20
jmp 0x56121
movq -0x220(%rbp), %rax
cmpl $0x7d, 0xd0(%rax)
je 0x5609d
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x119d0
movq -0x2a8(%rbp), %rdx
leaq 0xfb3bd(%rip), %rsi     # 0x151190
leaq -0x1a8(%rbp), %rdi
callq 0x24740
jmp 0x55de1
movb $0x1, -0x202(%rbp)
leaq -0x1f8(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x201(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x119d0
movq -0x2b8(%rbp), %rdi
movq -0x2b0(%rbp), %rdx
leaq 0xff4e4(%rip), %rsi     # 0x155309
callq 0x24740
jmp 0x55e2c
movb $0x0, -0x202(%rbp)
leaq -0x1f8(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movq $0x1, -0x1d0(%rbp)
leaq -0x203(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x26e30
movq -0x2c0(%rbp), %rcx
movq -0x1d8(%rbp), %rsi
movq -0x1d0(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x2d6a0
jmp 0x55e82
leaq -0x188(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x1c8(%rbp), %rdx
callq 0x9e250
jmp 0x55e9e
movq -0x220(%rbp), %rsi
movq -0x230(%rbp), %rdi
movq %rsi, %rcx
addq $0x58, %rcx
leaq -0x188(%rbp), %rdx
callq 0x3f820
jmp 0x55ec1
leaq -0x188(%rbp), %rdi
callq 0x11360
leaq -0x1c8(%rbp), %rdi
callq 0x25b00
leaq -0x203(%rbp), %rdi
callq 0x279c0
leaq -0x1f8(%rbp), %rax
movq %rax, -0x2d0(%rbp)
addq $0x20, %rax
movq %rax, -0x2c8(%rbp)
movq -0x2c8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x11360
movq -0x2d0(%rbp), %rcx
movq -0x2d8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x2c8(%rbp)
jne 0x55efe
leaq -0x201(%rbp), %rdi
callq 0x11600
leaq -0x1a8(%rbp), %rdi
callq 0x11360
leaq -0x1a9(%rbp), %rdi
callq 0x11600
movl $0x1, -0xf8(%rbp)
jmp 0x56113
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5608c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5601c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x55fc4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x55fb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x11360
leaq -0x1c8(%rbp), %rdi
callq 0x25b00
leaq -0x203(%rbp), %rdi
callq 0x279c0
leaq -0x1f8(%rbp), %rax
movq %rax, -0x2e8(%rbp)
addq $0x20, %rax
movq %rax, -0x2e0(%rbp)
movq -0x2e0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x11360
movq -0x2e8(%rbp), %rcx
movq -0x2f0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x2e0(%rbp)
jne 0x55fe9
jmp 0x5601c
leaq -0x201(%rbp), %rdi
callq 0x11600
testb $0x1, -0x202(%rbp)
jne 0x56033
jmp 0x56080
movq -0x200(%rbp), %rax
leaq -0x1f8(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x2f8(%rbp)
je 0x5607e
movq -0x2f8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x300(%rbp)
callq 0x11360
movq -0x300(%rbp), %rax
leaq -0x1f8(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x2f8(%rbp)
jne 0x5604d
jmp 0x56080
leaq -0x1a8(%rbp), %rdi
callq 0x11360
leaq -0x1a9(%rbp), %rdi
callq 0x11600
jmp 0x56121
movq -0x220(%rbp), %rdi
callq 0x38fd0
jmp 0x560ab
movq -0x18(%rbp), %rdi
callq 0x58270
movq -0x220(%rbp), %rcx
movq -0x18(%rbp), %rsi
addq $0x58, %rcx
movq %rsp, %rax
movq %rcx, (%rax)
leaq -0x218(%rbp), %rdi
leaq -0x28(%rbp), %rdx
leaq -0x1c(%rbp), %rcx
leaq -0x110(%rbp), %r8
leaq -0x38(%rbp), %r9
callq 0x59ed0
jmp 0x560ea
movq -0x230(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x59f70
leaq -0x218(%rbp), %rdi
callq 0x59fa0
movl $0x1, -0xf8(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x574c0
jmp 0x5612f
leaq -0x110(%rbp), %rdi
callq 0x574c0
jmp 0x56148
leaq -0x38(%rbp), %rdi
callq 0x24b20
movq -0x228(%rbp), %rax
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x24b20
movq -0x40(%rbp), %rdi
callq 0x119c0
nopw (%rax,%rax)