// File: RuiDGPires[P]CrimLang/src/generator.cpp
// Function: gc_Tracker::parse_node(crl::Node*, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&)
void _gc_Tracker::parse_node(crl::Node * node, std::stringstream &stream){
	switch (node->type){
		case crl::Node::Type::CAS:
			this->declaration_cas(node);
			break;
		case crl::Node::Type::VAR_DECLARATION:
			this->declaration_var(node);
			break;
		case crl::Node::Type::FUNC_DECLARATION:
			this->declaration_func(node);
			break;
		case crl::Node::Type::INIT:
			this->init(node);
			break;
		case crl::Node::Type::PROGRAM:
			this->program(node);
			break;
		case crl::Node::Type::CALL:
			this->func_call(node, stream);
			break;
		case crl::Node::Type::EXPRESSION:
			this->expression(node, stream);
			break;
		case crl::Node::Type::TERM:
			this->term(node, stream);
			break;
		case crl::Node::Type::FACTOR:
			this->factor(node, stream);
			break;
		case crl::Node::Type::RETURN:
			this->return_(node);
			break;
		case crl::Node::Type::BREAK:
			this->break_(node);
			break;
		case crl::Node::Type::ASSIGN:
			this->assign(node);
			break;
		case crl::Node::Type::IF:
			this->if_(node);
			break;
		case crl::Node::Type::WHILE:
			this->while_(node);
			break;
		case crl::Node::Type::BLOCK:
			this->block(node);
			break;
		case crl::Node::Type::INC:
		case crl::Node::Type::DEC:
			this->unary(node);
			break;
		default:
			std::cout << node->type << std::endl;
			ASSERT(false, "Not implemented");
			break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0x16, %eax
ja 0xfbb8
movq -0x58(%rbp), %rax
leaq 0x1b765(%rip), %rcx     # 0x2b1e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xddb0
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xd510
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xeb50
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xfc90
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x129a0
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xa650
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xd440
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xb7d0
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x9360
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xf8e0
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xf9a0
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x10600
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12270
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12660
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xf840
jmp 0xfc81
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x12230
jmp 0xfc81
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
movq 0x2a412(%rip), %rdi     # 0x39fd8
callq 0x4570
movq %rax, %rdi
movq 0x2a3eb(%rip), %rsi     # 0x39fc0
callq 0x4330
movb $0x1, -0x4d(%rbp)
movl $0x50, %edi
callq 0x4190
movq %rax, -0x70(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x4590
movq -0x68(%rbp), %rdx
leaq 0x1b66d(%rip), %rsi     # 0x2b271
leaq -0x38(%rbp), %rdi
callq 0x52e0
jmp 0xfc0f
movq -0x70(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x38(%rbp), %rcx
movl %edx, %esi
callq 0x9140
jmp 0xfc25
movq -0x70(%rbp), %rdi
movb $0x0, -0x4d(%rbp)
leaq 0x2a14c(%rip), %rsi     # 0x39d80
leaq -0x692b(%rip), %rdx     # 0x9310
callq 0x4550
jmp 0xfc90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xfc65
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x41e0
leaq -0x39(%rbp), %rdi
callq 0x4360
testb $0x1, -0x4d(%rbp)
jne 0xfc76
jmp 0xfc7f
movq -0x70(%rbp), %rdi
callq 0x4230
jmp 0xfc87
addq $0x70, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x4580