// File: menhits[P]phplus/src/Actions/MakeTupleAction.cpp
// Function: GetElemFromTupleAction::addToProg(std::shared_ptr<ActionData>, std::shared_ptr<ActionData>, CppProgram*)
void addToProg(Action inLeft, Action inRight, CppProgram* prog)
	{
		if (typeIn->getAllSubTypes()->size()==1)
		{
			inLeft->addToProg(prog);
			return;
		}
		
		MakeTupleAction * makeTupleAction=nullptr;
		
		if (typeid(*inLeft)==typeid(MakeTupleAction))
		{
			makeTupleAction=(MakeTupleAction *)&*inLeft;
		}
		
		else if (typeid(*inLeft)==typeid(CppTupleCastAction))
		{
			Action castAction=((CppTupleCastAction *)&*inLeft)->action;
			
			if (typeid(*castAction)==typeid(MakeTupleAction))
			{
				makeTupleAction=(MakeTupleAction *)&*castAction;
			}
		}
		
		if (makeTupleAction)
		{
			auto types=*inLeft->getReturnType()->getAllSubTypes();
			
			for (int i=0; i<int(types.size()); i++)
			{
				if (types[i].name==name)
				{
					makeTupleAction->sourceActions[i]->addToProg(prog);
					break;
				}
			}
		}
		else
		{
			/*
			if (inLeft->nameHint=="in" || inLeft->nameHint=="me")
			{
				prog->code(name);
			}
			else
			*/
			{
				inLeft->addToProg(prog);
				prog->code("."+name);
			}
		}
	}

// Assembly:
subq $0xb8, %rsp
movq %rsi, 0x20(%rsp)
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xa0(%rsp)
movq %rcx, 0x98(%rsp)
movq 0xb0(%rsp), %rdi
movq %rdi, 0x28(%rsp)
addq $0x78, %rdi
callq 0x1a660
movq %rax, %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq %rax, %rdi
callq 0x2df40
cmpq $0x1, %rax
jne 0xc1b08
movq 0x20(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
movq 0x98(%rsp), %rsi
callq 0x97950
jmp 0xc1d5a
movq 0x20(%rsp), %rdi
movq $0x0, 0x90(%rsp)
callq 0xb9b40
movq (%rax), %rax
movq -0x8(%rax), %rdi
leaq 0x55de4(%rip), %rsi     # 0x117910
callq 0x48fd0
testb $0x1, %al
jne 0xc1b37
jmp 0xc1b4e
movq 0x20(%rsp), %rdi
callq 0xb9b40
movq %rax, 0x90(%rsp)
jmp 0xc1bd9
movq 0x20(%rsp), %rdi
callq 0xb9b40
movq (%rax), %rax
movq -0x8(%rax), %rdi
leaq 0x55e1a(%rip), %rsi     # 0x117980
callq 0x48fd0
testb $0x1, %al
jne 0xc1b71
jmp 0xc1bd7
movq 0x20(%rsp), %rdi
callq 0xb9b40
movq %rax, %rsi
addq $0x78, %rsi
leaq 0x80(%rsp), %rdi
callq 0x1ac60
leaq 0x80(%rsp), %rdi
callq 0xb9b40
movq (%rax), %rax
movq -0x8(%rax), %rdi
leaq 0x55d66(%rip), %rsi     # 0x117910
callq 0x48fd0
testb $0x1, %al
jne 0xc1bb5
jmp 0xc1bca
leaq 0x80(%rsp), %rdi
callq 0xb9b40
movq %rax, 0x90(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x1acc0
jmp 0xc1bd9
cmpq $0x0, 0x90(%rsp)
je 0xc1cda
movq 0x20(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
callq 0x1bed0
movq %rax, %rdi
callq 0x1a660
movq %rax, %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq %rax, %rsi
leaq 0x68(%rsp), %rdi
callq 0xa0590
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
movl %eax, 0x1c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x2df40
movq %rax, %rcx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
jge 0xc1ccb
movslq 0x64(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0x2df60
movq 0x28(%rsp), %rsi
movq %rax, %rdi
addq $0xa8, %rsi
callq 0x112a0
testb $0x1, %al
jne 0xc1c6a
jmp 0xc1cb9
movq 0x90(%rsp), %rdi
addq $0x78, %rdi
movslq 0x64(%rsp), %rsi
callq 0x3ef30
movq %rax, %rdi
callq 0x1bb50
movq %rax, %rdi
movq 0x98(%rsp), %rsi
callq 0x97950
jmp 0xc1c9a
jmp 0xc1ccb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x1e810
jmp 0xc1d62
jmp 0xc1cbb
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0xc1c20
leaq 0x68(%rsp), %rdi
callq 0x1e810
jmp 0xc1d5a
movq 0x20(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
movq 0x98(%rsp), %rsi
callq 0x97950
movq 0x28(%rsp), %rdx
movq 0x98(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0xa8, %rdx
leaq 0x13765(%rip), %rsi     # 0xd5479
leaq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xfab0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x96750
jmp 0xc1d34
leaq 0x30(%rsp), %rdi
callq 0xb6e8
jmp 0xc1d5a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x30(%rsp), %rdi
callq 0xb6e8
jmp 0xc1d62
addq $0xb8, %rsp
retq
movq 0x58(%rsp), %rdi
callq 0xb680
nopl (%rax)