// File: /workspace/github_cpp_makefile_star2_O1/RuiDGPires[P]CrimLang/src/generator.cpp
// Function: gc_Tracker::assign_op(crl::Node*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void _gc_Tracker::assign_op(crl::Node *node, std::string op){
	crl::Token t;

	
	u32 reg1 = reg_tracker.alloc();
	std::string name1 = reg_tracker.reg_name(reg1);
	u32 reg2 = this->expression_reg(node->get_child(1), stream_funcs);
	std::string name2 = reg_tracker.reg_name(reg2);
	u32 offset = 0;

	if (node->get_child(0)->type == crl::Node::Type::VECTOR){
		t = get_token(node->get_child(0)->get_child(0));
		offset = atoi(get_token(node->get_child(0)->get_child(1)).str.c_str());
	}else
		t = get_token(node->get_child(0));

	if (symb_tracker.has_local(t.str)){
		std::pair<u32, bool> p = symb_tracker.get_local(t.str);

		if (p.second){
			u32 reg3 = reg_tracker.alloc();
			std::string name3 = reg_tracker.reg_name(reg3);
			stream_funcs <<
				"LOAD " << name1 << " m[RF][-" << p.first << "]\n" <<
				"LOAD " << name3 << " m[" << name1  << "][-" << offset << "]\n" <<
				op << " " << name3 << " " << name2 << "\n" <<
				"STORE m[" << name1 << "][-" << offset << "] " << name3 << "\n";
			reg_tracker.free(reg3);
		}else
			stream_funcs <<
				"LOAD " << name1 << " m[RF][-" << p.first + offset << "]\n" <<
				op << " " << name1 << " " << name2 << "\n" <<
				"STORE m[RF][-" << p.first + offset<< "] " << name1 << "\n";
	}else{
		u32 reg3 = reg_tracker.alloc();
		std::string name3 = reg_tracker.reg_name(reg3);

		stream_funcs	<<
		 	"MVI " << name1 << " " << t.str << "\n" <<
			"LOAD " << name3 << " m[" << name1 << "][-" << offset << "]\n" <<
			op << " " << name3 << " " << name2 <<  "\n" <<
			"STORE m[" << name1 << "][-" << offset << "] " << name3 << "\n";
		reg_tracker.free(reg3);
	}
	
	reg_tracker.free(reg1);
	reg_tracker.free(reg2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, -0x80(%rbp)
movq %rsi, %r14
movq %rdi, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x19244
leaq 0x500(%rbx), %r15
movq %r15, %rdi
callq 0xdc9a
movl %eax, %r12d
leaq -0x78(%rbp), %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0xdde4
movq (%r14), %rax
movq %r14, %rdi
movl $0x1, %esi
callq *0x18(%rax)
leaq 0x318(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6344
movl %r12d, -0x88(%rbp)
leaq -0xa8(%rbp), %rdi
movq %r15, %rsi
movl %eax, -0x84(%rbp)
movl %eax, %edx
callq 0xdde4
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0x19, 0x8(%rax)
jne 0xc8dd
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *0x18(%rax)
movq (%rax), %rcx
movq %rax, %rdi
xorl %esi, %esi
callq *0x18(%rcx)
movq %rax, %r13
leaq -0x48(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x58(%rax), %rsi
movq 0x60(%rax), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %rdi
callq 0x4d4a
movl 0x80(%r13), %eax
leaq -0x58(%rbp), %rsi
movl %eax, 0x28(%rsi)
movq 0x78(%r13), %rax
movq %rax, 0x20(%rsi)
leaq -0xd8(%rbp), %rdi
callq 0x3150
leaq -0x38(%rbp), %rax
movl 0x8(%rax), %ecx
movl %ecx, -0xb0(%rbp)
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x192b0
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *0x18(%rax)
movq (%rax), %rcx
movq %rax, %rdi
movl $0x1, %esi
callq *0x18(%rcx)
movq %rax, %r14
leaq -0x58(%rbp), %rdi
movq %r12, (%rdi)
movq 0x58(%rax), %rsi
movq 0x60(%rax), %rdx
addq %rsi, %rdx
callq 0x4d4a
movl 0x80(%r14), %eax
leaq -0x58(%rbp), %r12
movl %eax, 0x28(%r12)
movq 0x78(%r14), %rax
movq %rax, 0x20(%r12)
movq (%r12), %rdi
callq 0x3350
movl %eax, %r13d
movq %r12, %rdi
callq 0x192b0
jmp 0xc94c
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *0x18(%rax)
movq %rax, %r14
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x58(%r14), %rsi
movq 0x60(%r14), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %rdi
callq 0x4d4a
movl 0x80(%r14), %eax
leaq -0x58(%rbp), %rsi
movl %eax, 0x28(%rsi)
movq 0x78(%r14), %rax
movq %rax, 0x20(%rsi)
leaq -0xd8(%rbp), %rdi
callq 0x3150
leaq -0x38(%rbp), %rax
movl 0x8(%rax), %ecx
movl %ecx, -0xb0(%rbp)
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x192b0
xorl %r13d, %r13d
leaq -0x108(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x118(%rbp), %rdi
callq 0x4d4a
leaq 0x530(%rbx), %rdi
leaq -0x118(%rbp), %rsi
callq 0xdea0
movl %eax, %r14d
movq -0x118(%rbp), %rdi
cmpq %r12, %rdi
je 0xc9a6
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x3230
testb %r14b, %r14b
je 0xcb5c
leaq -0xe8(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf8(%rbp), %rdi
callq 0x4d4a
leaq 0x560(%rbx), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xe94c
movq (%rax), %rax
movq 0x10(%rax), %r14
movq -0xf8(%rbp), %rdi
cmpq %r12, %rdi
je 0xca0d
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x3230
btq $0x20, %r14
jb 0xcdab
addq $0x328, %rbx            # imm = 0x328
leaq 0xe81a(%rip), %rsi      # 0x1b240
movl $0x5, %edx
movq %rbx, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xeb93(%rip), %rsi      # 0x1b5e0
movl $0x8, %edx
movq %rax, %rdi
callq 0x3280
addl %r14d, %r13d
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3170
movq %rax, %rbx
leaq 0xe7d4(%rip), %rsi      # 0x1b246
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq -0x80(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe569(%rip), %rsi      # 0x1b005
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe542(%rip), %rsi      # 0x1b005
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe9f3(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
leaq 0xead7(%rip), %rsi      # 0x1b5db
movl $0xd, %edx
movq %rbx, %rdi
callq 0x3280
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3170
movq %rax, %rbx
leaq 0xeab2(%rip), %rsi      # 0x1b5d8
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
leaq 0xe999(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
jmp 0xd00b
movq %r15, %rdi
callq 0xdc9a
movl %eax, %r14d
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0xdde4
addq $0x328, %rbx            # imm = 0x328
leaq 0xe6c6(%rip), %rsi      # 0x1b249
movl $0x4, %edx
movq %rbx, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe45b(%rip), %rsi      # 0x1b005
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe90c(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
leaq 0xe655(%rip), %rsi      # 0x1b240
movl $0x5, %edx
movq %rbx, %rdi
callq 0x3280
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe9c2(%rip), %rsi      # 0x1b5d4
movl $0x3, %edx
movq %rax, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %r12
leaq 0xe9ac(%rip), %rsi      # 0x1b5e5
movl $0x3, %edx
movq %rax, %rdi
callq 0x3280
movl %r13d, %ebx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3170
movq %rax, %r12
leaq 0xe5e8(%rip), %rsi      # 0x1b246
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq -0x80(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r12, %rdi
callq 0x3280
movq %rax, %r12
leaq 0xe37d(%rip), %rsi      # 0x1b005
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %r12, %rdi
callq 0x3280
movq %rax, %r12
leaq 0xe356(%rip), %rsi      # 0x1b005
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq %r12, %rdi
callq 0x3280
movq %rax, %r12
leaq 0xe807(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
leaq 0xe8df(%rip), %rsi      # 0x1b5cf
movl $0x8, %edx
movq %r12, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %r12, %rdi
callq 0x3280
movq %rax, %r12
leaq 0xe8ce(%rip), %rsi      # 0x1b5e5
movl $0x3, %edx
movq %rax, %rdi
callq 0x3280
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3170
movq %rax, %rbx
leaq 0xe89f(%rip), %rsi      # 0x1b5d8
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
leaq 0xe786(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movslq %r14d, %rax
leaq 0x3f(%rax), %rdx
testq %rax, %rax
cmovnsq %rax, %rdx
sarq $0x6, %rdx
shlq $0x3, %rdx
addq (%r15), %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
leaq 0x3f(%rsi), %rcx
andq %rax, %rcx
xorl %eax, %eax
cmpq %rsi, %rcx
setbe %al
movq $-0x2, %rsi
movl %r14d, %ecx
jmp 0xcfea
movq %r15, %rdi
callq 0xdc9a
movl %eax, %r12d
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0xdde4
addq $0x328, %rbx            # imm = 0x328
leaq 0xe46e(%rip), %rsi      # 0x1b240
movl $0x5, %edx
movq %rbx, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe7e7(%rip), %rsi      # 0x1b5e0
movl $0x8, %edx
movq %rax, %rdi
callq 0x3280
movl %r14d, %esi
movq %rbx, %rdi
callq 0x3170
movq %rax, %rbx
leaq 0xe42b(%rip), %rsi      # 0x1b246
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
leaq 0xe411(%rip), %rsi      # 0x1b240
movl $0x5, %edx
movq %rbx, %rdi
callq 0x3280
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe77e(%rip), %rsi      # 0x1b5d4
movl $0x3, %edx
movq %rax, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %r14
leaq 0xe768(%rip), %rsi      # 0x1b5e5
movl $0x3, %edx
movq %rax, %rdi
callq 0x3280
movl %r13d, %ebx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3170
movq %rax, %r14
leaq 0xe3a4(%rip), %rsi      # 0x1b246
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq -0x80(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, %rdi
callq 0x3280
movq %rax, %r14
leaq 0xe139(%rip), %rsi      # 0x1b005
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %r14, %rdi
callq 0x3280
movq %rax, %r14
leaq 0xe112(%rip), %rsi      # 0x1b005
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq %r14, %rdi
callq 0x3280
movq %rax, %r14
leaq 0xe5c3(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
leaq 0xe69b(%rip), %rsi      # 0x1b5cf
movl $0x8, %edx
movq %r14, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %r14, %rdi
callq 0x3280
movq %rax, %r14
leaq 0xe68a(%rip), %rsi      # 0x1b5e5
movl $0x3, %edx
movq %rax, %rdi
callq 0x3280
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3170
movq %rax, %rbx
leaq 0xe65b(%rip), %rsi      # 0x1b5d8
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
leaq 0xe542(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movslq %r12d, %rax
leaq 0x3f(%rax), %rdx
testq %rax, %rax
cmovnsq %rax, %rdx
sarq $0x6, %rdx
shlq $0x3, %rdx
addq (%r15), %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
leaq 0x3f(%rsi), %rcx
andq %rax, %rcx
xorl %eax, %eax
cmpq %rsi, %rcx
setbe %al
movq $-0x2, %rsi
movl %r12d, %ecx
rolq %cl, %rsi
andq %rsi, -0x8(%rdx,%rax,8)
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd00b
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3230
movl -0x88(%rbp), %ecx
movslq %ecx, %r8
movq (%r15), %rax
leaq 0x3f(%r8), %rdx
testq %r8, %r8
cmovnsq %r8, %rdx
sarq $0x6, %rdx
movabsq $-0x8000000000000000, %r9 # imm = 0x8000000000000000
leaq 0x3f(%r9), %rsi
andq %rsi, %r8
xorl %edi, %edi
cmpq %r9, %r8
setbe %dil
movq $-0x2, %r8
rolq %cl, %r8
leaq (%rax,%rdx,8), %rcx
andq %r8, -0x8(%rcx,%rdi,8)
movq $-0x2, %rdx
movl -0x84(%rbp), %ecx
movslq %ecx, %r8
leaq 0x3f(%r8), %rdi
testq %r8, %r8
cmovnsq %r8, %rdi
sarq $0x6, %rdi
andq %rsi, %r8
xorl %esi, %esi
cmpq %r9, %r8
setbe %sil
rolq %cl, %rdx
leaq (%rax,%rdi,8), %rax
andq %rdx, -0x8(%rax,%rsi,8)
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd0a9
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd0c2
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0xd8(%rbp), %rdi
callq 0x192b0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd13e
jmp 0xd13e
jmp 0xd13e
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
cmpq %r12, %rdi
je 0xd161
movq -0xe8(%rbp), %rsi
jmp 0xd159
jmp 0xd13e
jmp 0xd102
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x192b0
jmp 0xd161
movq %rax, %rbx
movq -0x118(%rbp), %rdi
cmpq %r12, %rdi
je 0xd161
movq -0x108(%rbp), %rsi
jmp 0xd159
jmp 0xd13e
jmp 0xd139
jmp 0xd12e
movq %rax, %rbx
jmp 0xd199
jmp 0xd13e
jmp 0xd13e
jmp 0xd13e
movq %rax, %rbx
jmp 0xd180
movq %rax, %rbx
jmp 0xd161
jmp 0xd145
movq %rax, %rbx
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd161
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd180
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd199
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0xd8(%rbp), %rdi
callq 0x192b0
movq %rbx, %rdi
callq 0x33f0
nop