// File: /workspace/github_cpp_makefile_star2_O1/RuiDGPires[P]CrimLang/src/generator.cpp
// Function: gc_Tracker::expression_reg(crl::Node*, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&)
u32 _gc_Tracker::expression_reg(crl::Node *node, std::stringstream &stream){
	size_t size = node->children.size();
	size_t i = 0;

	u32 reg1 = this->comparison(node->get_child(i++), stream);
	std::string reg_name = reg_tracker.reg_name(reg1);

	for (; i < size; i += 2){
		u32 reg2 = this->comparison(node->get_child(i+1), stream);
		if (get_token(node->get_child(i)).type == crl::Token::Type::LAND)
			stream << "LAND " << reg_name << " " << reg_tracker.reg_name(reg2) << "\n";
		else
			stream << "LOR " << reg_name << " " << reg_tracker.reg_name(reg2) << "\n";
		reg_tracker.free(reg2);
	}
	return reg1; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %rbx
movq %rdi, %r15
movq (%rsi), %rax
movq 0x18(%rsi), %r12
subq 0x10(%rsi), %r12
sarq $0x3, %r12
movq %rsi, -0x80(%rbp)
movq %rsi, %rdi
xorl %esi, %esi
callq *0x18(%rax)
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, -0x78(%rbp)
movq %rbx, %rdx
callq 0x7efa
movq %r15, -0xb8(%rbp)
leaq 0x500(%r15), %r13
leaq -0xa0(%rbp), %rdi
movq %r13, %rsi
movl %eax, -0x3c(%rbp)
movl %eax, %edx
callq 0xdde4
movq %r12, -0xb0(%rbp)
cmpq $0x2, %r12
jb 0x65de
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
movq -0x78(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x38(%rbp)
movl $0x1, %r15d
leaq 0x3f(%rcx), %rax
movq %rax, -0xa8(%rbp)
leal 0x1(%r15), %esi
movq -0x80(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
movq -0x78(%rbp), %rdx
callq 0x7efa
movl %eax, -0x2c(%rbp)
movq %r13, %r14
movq -0x80(%rbp), %rdi
movq (%rdi), %rax
movq %r15, %rbx
movl %r15d, %esi
callq *0x18(%rax)
leaq -0x60(%rbp), %r13
leaq -0x70(%rbp), %r15
movq %rax, %r12
movq %r13, -0x70(%rbp)
movq 0x58(%rax), %rsi
movq 0x60(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x4d4a
movl 0x80(%r12), %eax
movl %eax, 0x18(%r13)
movq 0x78(%r12), %rax
movq %rax, 0x10(%r13)
movl -0x50(%rbp), %r12d
movq %r15, %rdi
callq 0x192b0
cmpl $0x36, %r12d
jne 0x64ee
movl $0x5, %edx
movq -0x38(%rbp), %rdi
leaq 0x14e75(%rip), %rsi     # 0x1b2ee
callq 0x3280
movq %r14, %r13
movl -0x2c(%rbp), %r14d
movq %rbx, %r15
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0x38(%rbp), %rdi
callq 0x3280
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x14b54(%rip), %rsi     # 0x1b005
callq 0x3280
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
movl %r14d, %edx
callq 0xdde4
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %r12, %rdi
callq 0x3280
movl $0x1, %edx
movq %rax, %rdi
leaq 0x14fff(%rip), %rsi     # 0x1b4e3
callq 0x3280
jmp 0x656e
movl $0x4, %edx
movq -0x38(%rbp), %rdi
leaq 0x14deb(%rip), %rsi     # 0x1b2e9
callq 0x3280
movq %r14, %r13
movl -0x2c(%rbp), %r14d
movq %rbx, %r15
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0x38(%rbp), %rdi
callq 0x3280
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x14acf(%rip), %rsi     # 0x1b005
callq 0x3280
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
movl %r14d, %edx
callq 0xdde4
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %r12, %rdi
callq 0x3280
movl $0x1, %edx
movq %rax, %rdi
leaq 0x14f7a(%rip), %rsi     # 0x1b4e3
callq 0x3280
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x6587
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3230
movslq %r14d, %rax
leaq 0x3f(%rax), %rdx
testq %rax, %rax
cmovnsq %rax, %rdx
sarq $0x6, %rdx
shlq $0x3, %rdx
addq (%r13), %rdx
andq -0xa8(%rbp), %rax
xorl %esi, %esi
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
cmpq %rcx, %rax
setbe %sil
movq $-0x2, %rax
movl %r14d, %ecx
rolq %cl, %rax
andq %rax, -0x8(%rdx,%rsi,8)
addq $0x2, %r15
cmpq -0xb0(%rbp), %r15
jb 0x63e5
leaq -0x90(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x65fd
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x3230
movl -0x3c(%rbp), %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6638
jmp 0x6638
jmp 0x6618
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x663b
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0x663b
jmp 0x6638
movq %rax, %rbx
leaq -0x90(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x665a
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x3230
movq %rbx, %rdi
callq 0x33f0