// File: /workspace/github_cpp_makefile_star2_O3/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 $0x108, %rsp            # imm = 0x108
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
leaq -0xd8(%rbp), %rdi
callq 0x1918c
leaq 0x500(%r12), %r15
movq %r15, %rdi
callq 0xdc82
movl %eax, %ebx
leaq -0x78(%rbp), %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0xdda4
movq (%r13), %rax
movq %r13, %rdi
movl $0x1, %esi
callq *0x18(%rax)
leaq 0x318(%r12), %rdx
movq %r12, %rdi
movq %rax, %rsi
callq 0x6328
movq %r14, -0x88(%rbp)
movq %rbx, -0xf0(%rbp)
leaq -0xa8(%rbp), %rdi
movq %r15, %rsi
movq %rax, -0xe8(%rbp)
movl %eax, %edx
callq 0xdda4
movq (%r13), %rax
movq %r13, %rdi
xorl %esi, %esi
callq *0x18(%rax)
cmpl $0x19, 0x8(%rax)
jne 0xc8a7
movq (%r13), %rax
movq %r13, %rdi
xorl %esi, %esi
callq *0x18(%rax)
movq (%rax), %rcx
movq %rax, %rdi
xorl %esi, %esi
callq *0x18(%rcx)
movq %rax, %rbx
leaq -0x48(%rbp), %r14
movq %r14, -0x10(%r14)
movq 0x58(%rax), %rsi
movq 0x60(%rax), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %rdi
callq 0x4d52
movl 0x80(%rbx), %eax
leaq -0x58(%rbp), %rsi
movl %eax, 0x28(%rsi)
movq 0x78(%rbx), %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 0x191f8
movq (%r13), %rax
movq %r13, %rdi
xorl %esi, %esi
callq *0x18(%rax)
movq (%rax), %rcx
movq %rax, %rdi
movl $0x1, %esi
callq *0x18(%rcx)
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
movq %r14, (%rdi)
movq 0x58(%rax), %rsi
movq 0x60(%rax), %rdx
addq %rsi, %rdx
callq 0x4d52
movl 0x80(%rbx), %eax
leaq -0x58(%rbp), %r13
movl %eax, 0x28(%r13)
movq 0x78(%rbx), %rax
movq %rax, 0x20(%r13)
movq (%r13), %rdi
callq 0x3350
movq %rax, -0x80(%rbp)
movq %r13, %rdi
callq 0x191f8
jmp 0xc91b
movq (%r13), %rax
movq %r13, %rdi
xorl %esi, %esi
callq *0x18(%rax)
movq %rax, %rbx
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x58(%rbx), %rsi
movq 0x60(%rbx), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %rdi
callq 0x4d52
movl 0x80(%rbx), %eax
leaq -0x58(%rbp), %rsi
movl %eax, 0x28(%rsi)
movq 0x78(%rbx), %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 0x191f8
movq $0x0, -0x80(%rbp)
leaq -0x120(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x130(%rbp), %rdi
callq 0x4d52
leaq 0x530(%r12), %rdi
leaq -0x130(%rbp), %rsi
callq 0xde60
movl %eax, %ebx
movq -0x130(%rbp), %rdi
cmpq %r14, %rdi
je 0xc974
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x3230
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
testb %bl, %bl
je 0xcb3a
leaq -0x100(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x110(%rbp), %rdi
callq 0x4d52
leaq 0x560(%r12), %rdi
leaq -0x110(%rbp), %rsi
callq 0xe8ec
movq (%rax), %rax
movq 0x10(%rax), %r13
movq -0x110(%rbp), %rdi
cmpq %r14, %rdi
je 0xc9e4
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x3230
btq $0x20, %r13
jb 0xcd85
addq $0x328, %r12            # imm = 0x328
leaq 0xe843(%rip), %rsi      # 0x1b240
movl $0x5, %edx
movq %r12, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %r12, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xebbc(%rip), %rsi      # 0x1b5e0
movl $0x8, %edx
movq %rax, %rdi
callq 0x3280
movq -0x80(%rbp), %rsi
addl %r13d, %esi
movq %rbx, %rdi
movq %rsi, %r14
callq 0x3170
movq %rax, %rbx
leaq 0xe7f9(%rip), %rsi      # 0x1b246
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq -0x88(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe58b(%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 0xe564(%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 0xea15(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
leaq 0xeaf9(%rip), %rsi      # 0x1b5db
movl $0xd, %edx
movq %rbx, %rdi
callq 0x3280
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3170
movq %rax, %rbx
leaq 0xead4(%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 0xe9bb(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
jmp 0xcff0
movq %r15, %rdi
callq 0xdc82
movl %eax, %r13d
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0xdda4
addq $0x328, %r12            # imm = 0x328
leaq 0xe6e8(%rip), %rsi      # 0x1b249
movl $0x4, %edx
movq %r12, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %r12, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe47d(%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, %r12
leaq 0xe92e(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
leaq 0xe677(%rip), %rsi      # 0x1b240
movl $0x5, %edx
movq %r12, %rdi
callq 0x3280
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %r12, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe9e4(%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, %rbx
leaq 0xe9ce(%rip), %rsi      # 0x1b5e5
movl $0x3, %edx
movq %rax, %rdi
callq 0x3280
movl -0x80(%rbp), %r12d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3170
movq %rax, %rbx
leaq 0xe609(%rip), %rsi      # 0x1b246
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq -0x88(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe39b(%rip), %rsi      # 0x1b005
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe374(%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 0xe825(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
leaq 0xe8fd(%rip), %rsi      # 0x1b5cf
movl $0x8, %edx
movq %rbx, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe8ec(%rip), %rsi      # 0x1b5e5
movl $0x3, %edx
movq %rax, %rdi
callq 0x3280
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3170
movq %rax, %rbx
leaq 0xe8bd(%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 0xe7a4(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
leal 0x3f(%r13), %eax
testl %r13d, %r13d
cmovnsl %r13d, %eax
sarl $0x6, %eax
cltq
shlq $0x3, %rax
addq (%r15), %rax
movslq %r13d, %rcx
leaq 0x3f(%r14), %rdx
andq %rcx, %rdx
xorl %esi, %esi
cmpq %r14, %rdx
setbe %sil
movq $-0x2, %rdx
movl %r13d, %ecx
jmp 0xcfcf
movq %r15, %rdi
callq 0xdc82
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
movq %rax, -0xe0(%rbp)
movl %eax, %edx
callq 0xdda4
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
addq $0x328, %r12            # imm = 0x328
leaq 0xe486(%rip), %rsi      # 0x1b240
movl $0x5, %edx
movq %r12, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %r12, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe7ff(%rip), %rsi      # 0x1b5e0
movl $0x8, %edx
movq %rax, %rdi
callq 0x3280
movl %r13d, %esi
movq %rbx, %rdi
callq 0x3170
movq %rax, %r12
leaq 0xe443(%rip), %rsi      # 0x1b246
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
leaq 0xe429(%rip), %rsi      # 0x1b240
movl $0x5, %edx
movq %r12, %rdi
callq 0x3280
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %r12, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe796(%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, %rbx
leaq 0xe780(%rip), %rsi      # 0x1b5e5
movl $0x3, %edx
movq %rax, %rdi
callq 0x3280
movl -0x80(%rbp), %r12d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3170
movq %rax, %rbx
leaq 0xe3bb(%rip), %rsi      # 0x1b246
movl $0x2, %edx
movq %rax, %rdi
callq 0x3280
movq -0x88(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe14d(%rip), %rsi      # 0x1b005
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe126(%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, %r13
leaq 0xe5d7(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
leaq 0xe6af(%rip), %rsi      # 0x1b5cf
movl $0x8, %edx
movq %r13, %rdi
callq 0x3280
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %r13, %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xe69e(%rip), %rsi      # 0x1b5e5
movl $0x3, %edx
movq %rax, %rdi
callq 0x3280
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3170
movq %rax, %rbx
leaq 0xe66f(%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 0xe556(%rip), %rsi      # 0x1b4e3
movl $0x1, %edx
movq %rax, %rdi
callq 0x3280
movq -0xe0(%rbp), %rcx
leal 0x3f(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x6, %eax
cltq
shlq $0x3, %rax
addq (%r15), %rax
movslq %ecx, %rsi
leaq 0x3f(%r14), %rdx
andq %rsi, %rdx
xorl %esi, %esi
cmpq %r14, %rdx
setbe %sil
movq $-0x2, %rdx
rolq %cl, %rdx
andq %rdx, -0x8(%rax,%rsi,8)
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xcff0
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3230
movq -0xf0(%rbp), %rcx
movslq %ecx, %r8
movq (%r15), %rax
leal 0x3f(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x6, %edx
movslq %edx, %rdx
leaq (%rax,%rdx,8), %rsi
movabsq $-0x8000000000000000, %r10 # imm = 0x8000000000000000
leaq 0x3f(%r10), %rdx
andq %rdx, %r8
xorl %edi, %edi
cmpq %r10, %r8
setbe %dil
movq $-0x2, %r8
rolq %cl, %r8
movq $-0x2, %r9
andq %r8, -0x8(%rsi,%rdi,8)
movq -0xe8(%rbp), %rcx
leal 0x3f(%rcx), %edi
testl %ecx, %ecx
cmovnsl %ecx, %edi
movslq %ecx, %rsi
sarl $0x6, %edi
movslq %edi, %rdi
andq %rdx, %rsi
xorl %edx, %edx
cmpq %r10, %rsi
setbe %dl
rolq %cl, %r9
leaq (%rax,%rdi,8), %rax
andq %r9, -0x8(%rax,%rdx,8)
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd08d
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd0a6
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0xd8(%rbp), %rdi
callq 0x191f8
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd122
jmp 0xd122
jmp 0xd122
movq %rax, %rbx
movq -0x110(%rbp), %rdi
cmpq %r14, %rdi
je 0xd145
movq -0x100(%rbp), %rsi
jmp 0xd13d
jmp 0xd122
jmp 0xd0e6
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x191f8
jmp 0xd145
movq %rax, %rbx
movq -0x130(%rbp), %rdi
cmpq %r14, %rdi
je 0xd145
movq -0x120(%rbp), %rsi
jmp 0xd13d
jmp 0xd122
jmp 0xd11d
jmp 0xd112
movq %rax, %rbx
jmp 0xd17d
jmp 0xd122
jmp 0xd122
jmp 0xd122
movq %rax, %rbx
jmp 0xd164
movq %rax, %rbx
jmp 0xd145
jmp 0xd129
movq %rax, %rbx
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd145
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd164
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd17d
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3230
leaq -0xd8(%rbp), %rdi
callq 0x191f8
movq %rbx, %rdi
callq 0x33f0
nop