// File: /workspace/github_cpp_makefile_star2_O2/RuiDGPires[P]CrimLang/src/generator.cpp
// Function: gc_Tracker::unary_reg(crl::Node*)
u32 _gc_Tracker::unary_reg(crl::Node *node){
	crl::Token t = get_token(node->get_child(0));
	std::string op;
	switch (node->type){
		case crl::Node::Type::INC:
			op = "INC";
		break;
		case crl::Node::Type::DEC:
			op = "DEC";
		break;
		default:
		break;
	}
	u32 reg = reg_tracker.alloc();
	std::string name = reg_tracker.reg_name(reg);
	
	if (symb_tracker.has_local(t.str)){
		std::pair<u32, bool> p = symb_tracker.get_local(t.str);

		if (p.second){
			u32 reg2 = reg_tracker.alloc();
			std::string name2 = reg_tracker.reg_name(reg2);
			stream_funcs <<
				"LOAD " << name << " m[RF][-" << p.first  << "]\n" <<
				"LOAD " << name2 << " m[" << name  << "]\n" <<
				"PSH " << name2 << "\n" <<
				op << " " << name2 << "\n" <<
				"STORE m[" << name << "] " << name2 << "\n" <<
				"POP " << name << "\n";

			reg_tracker.free(reg2);
		} else
			stream_funcs <<
				"LOAD " << name << " m[RF][-" << p.first  << "]\n" <<
				"PSH " << name << "\n" <<
				op << " " << name << "\n" <<
				"STORE m[RF][-" << p.first << "] " << name << "\n" <<
				"POP " << name << "\n";
	}else{
		u32 reg2 = reg_tracker.alloc();
		std::string name2 = reg_tracker.reg_name(reg2);

		stream_funcs << "MVI " << name << " " << t.str << "\n" <<
			"LOAD " << name2 << " m[" << name << "]\n" <<
			"PSH " << name2 << "\n" <<
			op << " " << name2 << "\n" <<
			"STORE m[" << name << "] " << name2 << "\n" <<
			"POP " << name << "\n";

		reg_tracker.free(reg2);
	}

	return reg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r12
movq (%rsi), %rax
movq %rsi, %rdi
xorl %esi, %esi
callq *0x18(%rax)
leaq 0x58(%rax), %rsi
leaq -0xf8(%rbp), %rdi
callq 0xb24a
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0x8(%rbx), %eax
cmpl $0x14, %eax
je 0x5ef7
cmpl $0x13, %eax
jne 0x5f0a
leaq 0xf6f4(%rip), %rsi      # 0x155e9
jmp 0x5efe
leaq 0xf6ef(%rip), %rsi      # 0x155ed
leaq -0x88(%rbp), %rdi
callq 0x3450
leaq 0x500(%r12), %r14
movq %r14, %rdi
callq 0xaa6c
movl %eax, %ebx
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0xab34
leaq -0xc8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x32f0
leaq 0x530(%r12), %r15
leaq -0xc8(%rbp), %rsi
movq %r15, %rdi
callq 0xabb4
movl %eax, %r13d
leaq -0xc8(%rbp), %rdi
callq 0x3110
testb %r13b, %r13b
je 0x60cc
leaq -0xa8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x32f0
leaq -0xa8(%rbp), %rsi
movq %r15, %rdi
callq 0xabee
movq %rax, %r13
leaq -0xa8(%rbp), %rdi
callq 0x3110
btq $0x20, %r13
jb 0x625b
addq $0x328, %r12            # imm = 0x328
leaq 0xf28a(%rip), %rsi      # 0x15240
movq %r12, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf60f(%rip), %rsi      # 0x155e0
movq %rax, %rdi
callq 0x3230
movl %r13d, %r14d
movq %rax, %rdi
movq %r14, %rsi
callq 0x3180
leaq 0xf258(%rip), %rsi      # 0x15246
movq %rax, %rdi
callq 0x3230
leaq 0xf2f7(%rip), %rsi      # 0x152f4
movq %rax, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf4cb(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
leaq -0x88(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xefcf(%rip), %rsi      # 0x15005
movq %rax, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf492(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
leaq 0xf57b(%rip), %rsi      # 0x155db
movq %rax, %rdi
callq 0x3230
movq %rax, %rdi
movq %r14, %rsi
callq 0x3180
leaq 0xf55e(%rip), %rsi      # 0x155d8
movq %rax, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf44e(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
leaq 0xf1c8(%rip), %rsi      # 0x1526c
movq %rax, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf424(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
jmp 0x63ea
movq %r14, %rdi
callq 0xaa6c
movl %eax, %r15d
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0xab34
addq $0x328, %r12            # imm = 0x328
leaq 0xf156(%rip), %rsi      # 0x15249
movq %r12, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xeef7(%rip), %rsi      # 0x15005
movq %rax, %rdi
callq 0x3230
leaq -0xf8(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf3b7(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
leaq 0xf105(%rip), %rsi      # 0x15240
movq %rax, %rdi
callq 0x3230
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf47e(%rip), %rsi      # 0x155d4
movq %rax, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf0d5(%rip), %rsi      # 0x15246
movq %rax, %rdi
callq 0x3230
leaq 0xf174(%rip), %rsi      # 0x152f4
movq %rax, %rdi
callq 0x3230
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf348(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
leaq -0x88(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xee4c(%rip), %rsi      # 0x15005
movq %rax, %rdi
callq 0x3230
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf30f(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
leaq 0xf3ec(%rip), %rsi      # 0x155cf
movq %rax, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf3da(%rip), %rsi      # 0x155d8
movq %rax, %rdi
callq 0x3230
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf2ca(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
leaq 0xf044(%rip), %rsi      # 0x1526c
movq %rax, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf2a0(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
movq %r14, %rdi
movl %r15d, %esi
callq 0xac12
jmp 0x63e1
movq %r14, %rdi
callq 0xaa6c
movl %eax, %r15d
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0xab34
addq $0x328, %r12            # imm = 0x328
leaq 0xefbe(%rip), %rsi      # 0x15240
movq %r12, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf343(%rip), %rsi      # 0x155e0
movq %rax, %rdi
callq 0x3230
movl %r13d, %esi
movq %rax, %rdi
callq 0x3180
leaq 0xef8f(%rip), %rsi      # 0x15246
movq %rax, %rdi
callq 0x3230
leaq 0xef7a(%rip), %rsi      # 0x15240
movq %rax, %rdi
callq 0x3230
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf2f3(%rip), %rsi      # 0x155d4
movq %rax, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xef4a(%rip), %rsi      # 0x15246
movq %rax, %rdi
callq 0x3230
leaq 0xefe9(%rip), %rsi      # 0x152f4
movq %rax, %rdi
callq 0x3230
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf1bd(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
leaq -0x88(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xecc1(%rip), %rsi      # 0x15005
movq %rax, %rdi
callq 0x3230
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf184(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
leaq 0xf261(%rip), %rsi      # 0x155cf
movq %rax, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf24f(%rip), %rsi      # 0x155d8
movq %rax, %rdi
callq 0x3230
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf13f(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
leaq 0xeeb9(%rip), %rsi      # 0x1526c
movq %rax, %rdi
callq 0x3230
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3220
leaq 0xf115(%rip), %rsi      # 0x154e3
movq %rax, %rdi
callq 0x3230
movq %r14, %rdi
movl %r15d, %esi
callq 0xac12
leaq -0x68(%rbp), %rdi
callq 0x3110
leaq -0x48(%rbp), %rdi
callq 0x3110
leaq -0x88(%rbp), %rdi
callq 0x3110
leaq -0xf8(%rbp), %rdi
callq 0x135f8
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x644a
jmp 0x644a
jmp 0x644a
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
jmp 0x6458
jmp 0x644a
jmp 0x6445
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
jmp 0x6458
jmp 0x644a
jmp 0x6445
movq %rax, %rbx
jmp 0x6466
movq %rax, %rbx
jmp 0x645d
jmp 0x6451
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x3110
leaq -0x48(%rbp), %rdi
callq 0x3110
leaq -0x88(%rbp), %rdi
callq 0x3110
leaq -0xf8(%rbp), %rdi
callq 0x135f8
movq %rbx, %rdi
callq 0x3410