// File: menhits[P]phplus/src/Actions/VarAction.cpp
// Function: VarSetAction::addToProg(std::shared_ptr<ActionData>, std::shared_ptr<ActionData>, CppProgram*)
void addToProg(Action inLeft, Action inRight, CppProgram* prog)
	{
		/*
		if ((nameHint=="me" || nameHint=="in") && getReturnType()->getType()==TypeBase::TUPLE)
		{
			if (prog->getExprLevel()>0)
			{
				throw PhplusError("can not set 'in' or 'me' inside expression in C++ because of some really dumb reason", INTERNAL_ERROR);
			}
			
			prog->pushBlock();
				prog->code(prog->getTypeCode(inRight->getReturnType()));
				prog->code(" tmp = ");
				prog->pushExpr();
					inRight->addToProg(prog);
				prog->popExpr();
				prog->endln();
				auto subs=*getReturnType()->getAllSubTypes();
				for (int i=0; i<(int)subs.size(); i++)
				{
					prog->name(subs[i].name);
					prog->code(" = ");
					prog->code("tmp."+(*inRight->getReturnType()->getAllSubTypes())[i].name);
					//prog->pushExpr();
						//getElemFromTupleAction(inRight->getReturnType(), (*inRight->getReturnType()->getAllSubTypes())[i].name)->addToProg(var, voidAction, prog);
					//prog->popExpr();
					prog->endln();
				}
			prog->popBlock();
		}
		else
		*/
		{
			prog->declareVar(nameHint, getInRightType());
			prog->name(nameHint);
			prog->code(" = ");
			prog->pushExpr();
			inRight->addToProg(prog);
			prog->popExpr();
			//if (prog->getExprLevel()==0)
			//	prog->endln();
		}
	}

// Assembly:
subq $0xc8, %rsp
movq %rdx, 0x10(%rsp)
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movq %rdx, 0xb0(%rsp)
movq %rcx, 0xa8(%rsp)
movq 0xc0(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %rdi, %rax
addq $0x8, %rax
movq %rax, 0x28(%rsp)
callq 0x3f070
movq %rax, %rsi
leaq 0x98(%rsp), %rdi
callq 0x1a920
leaq 0x77(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xb690
movq 0x30(%rsp), %rdx
leaq 0xb73d(%rip), %rsi      # 0xd1a1f
leaq 0x78(%rsp), %rdi
callq 0xb4c0
jmp 0xc62ee
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdi
leaq 0x98(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0x29fe0
jmp 0xc630c
leaq 0x78(%rsp), %rdi
callq 0xb6e8
leaq 0x77(%rsp), %rdi
callq 0xb3f0
leaq 0x98(%rsp), %rdi
callq 0x1a950
movq 0x18(%rsp), %rsi
movq 0xa8(%rsp), %rdi
addq $0x8, %rsi
callq 0x96790
movq 0xa8(%rsp), %rax
movq %rax, (%rsp)
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xb690
movq 0x8(%rsp), %rdx
leaq 0xeefd(%rip), %rsi      # 0xd5267
leaq 0x40(%rsp), %rdi
callq 0xb4c0
jmp 0xc6376
movq (%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x96750
jmp 0xc6386
leaq 0x40(%rsp), %rdi
callq 0xb6e8
leaq 0x3f(%rsp), %rdi
callq 0xb3f0
movq 0xa8(%rsp), %rdi
callq 0x97930
movq 0x10(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
movq 0xa8(%rsp), %rsi
callq 0x97950
movq 0xa8(%rsp), %rdi
callq 0x97a00
addq $0xc8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0xc63fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x78(%rsp), %rdi
callq 0xb6e8
leaq 0x77(%rsp), %rdi
callq 0xb3f0
leaq 0x98(%rsp), %rdi
callq 0x1a950
jmp 0xc6449
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0xc643f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xb6e8
leaq 0x3f(%rsp), %rdi
callq 0xb3f0
movq 0x68(%rsp), %rdi
callq 0xb680
nopw %cs:(%rax,%rax)
nopl (%rax)