// File: menhits[P]phplus/src/Actions/ListAction.cpp
// Function: ListAction::addToProg(CppProgram*, std::shared_ptr<TypeBase>)
void addToProg(CppProgram* prog, Type returnType)
	{
		bool shouldReturn=(prog->getBlockLevel()==0 && prog->getIfReturnsVal()) && !prog->isMain();
		
		prog->pushBlock();
		
		for (auto i: actions)
		{
			if (shouldReturn && i==actions.back())
			{
				prog->declareVar("-out", returnType);
				prog->name("-out");
				prog->code(" = ");
				if (i->getReturnType()!=returnType)
				{
					cppTupleCastAction(i, returnType)->addToProg(prog);
				}
				else
				{
					i->addToProg(prog);
				}
			}
			else
			{
				i->addToProg(prog);
			}
			prog->endln();
		}
		
		for (auto i: destroyers)
		{
			i->addToProg(prog);
			prog->endln();
		}
		
		if (shouldReturn)
		{
			prog->code("return ");
			prog->name("-out");
			prog->endln();
		}
		
		prog->popBlock();
	}

// Assembly:
subq $0x238, %rsp            # imm = 0x238
movq %rdx, 0x78(%rsp)
movq %rdi, 0x230(%rsp)
movq %rsi, 0x228(%rsp)
movq %rdx, 0x220(%rsp)
movq 0x230(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x228(%rsp), %rdi
callq 0xbd4f0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x8e(%rsp)
jne 0xbc7d4
movq 0x228(%rsp), %rdi
callq 0xbd510
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x8e(%rsp)
je 0xbc7d4
movq 0x228(%rsp), %rdi
callq 0x2e0e0
xorb $-0x1, %al
movb %al, 0x8e(%rsp)
movb 0x8e(%rsp), %al
andb $0x1, %al
movb %al, 0x21f(%rsp)
movq 0x228(%rsp), %rdi
callq 0x99d80
movq 0x80(%rsp), %rax
addq $0x78, %rax
movq %rax, 0x210(%rsp)
movq 0x210(%rsp), %rdi
callq 0x221a0
movq %rax, 0x208(%rsp)
movq 0x210(%rsp), %rdi
callq 0x22010
movq %rax, 0x200(%rsp)
leaq 0x208(%rsp), %rdi
leaq 0x200(%rsp), %rsi
callq 0xbd540
testb $0x1, %al
jne 0xbc84d
jmp 0xbcd21
leaq 0x208(%rsp), %rdi
callq 0xbd580
movq %rax, %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x1ac60
testb $0x1, 0x21f(%rsp)
je 0xbccc0
movq 0x80(%rsp), %rdi
addq $0x78, %rdi
callq 0xbd5d0
movq %rax, %rsi
leaq 0x1f0(%rsp), %rdi
callq 0xbd590
testb $0x1, %al
jne 0xbc8a2
jmp 0xbccc0
movq 0x228(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x1cf(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0xb690
movq 0x70(%rsp), %rdx
leaq 0x1aca2(%rip), %rsi     # 0xd756f
leaq 0x1d0(%rsp), %rdi
callq 0xb4c0
jmp 0xbc8dc
movq 0x78(%rsp), %rsi
leaq 0x1a8(%rsp), %rdi
callq 0x1a920
leaq 0x187(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0xb690
movq 0x60(%rsp), %rdx
leaq 0x15113(%rip), %rsi     # 0xd1a1f
leaq 0x188(%rsp), %rdi
callq 0xb4c0
jmp 0xbc91b
movq 0x68(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
leaq 0x1a8(%rsp), %rdx
leaq 0x188(%rsp), %rcx
callq 0x29fe0
jmp 0xbc93f
leaq 0x188(%rsp), %rdi
callq 0xb6e8
leaq 0x187(%rsp), %rdi
callq 0xb3f0
leaq 0x1a8(%rsp), %rdi
callq 0x1a950
leaq 0x1d0(%rsp), %rdi
callq 0xb6e8
leaq 0x1cf(%rsp), %rdi
callq 0xb3f0
movq 0x228(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x15f(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xb690
movq 0x58(%rsp), %rdx
leaq 0x1abc4(%rip), %rsi     # 0xd756f
leaq 0x160(%rsp), %rdi
callq 0xb4c0
jmp 0xbc9ba
movq 0x50(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x96790
jmp 0xbc9ce
leaq 0x160(%rsp), %rdi
callq 0xb6e8
leaq 0x15f(%rsp), %rdi
callq 0xb3f0
movq 0x228(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x137(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xb690
movq 0x48(%rsp), %rdx
leaq 0x18854(%rip), %rsi     # 0xd5267
leaq 0x138(%rsp), %rdi
callq 0xb4c0
jmp 0xbca22
movq 0x40(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x96750
jmp 0xbca36
leaq 0x138(%rsp), %rdi
callq 0xb6e8
leaq 0x137(%rsp), %rdi
callq 0xb3f0
leaq 0x1f0(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
callq 0x1bed0
movq %rax, 0x38(%rsp)
jmp 0xbca6c
movq 0x78(%rsp), %rsi
movq 0x38(%rsp), %rdi
callq 0x1be90
testb $0x1, %al
jne 0xbca84
jmp 0xbcc9d
leaq 0x110(%rsp), %rdi
movq %rdi, 0x28(%rsp)
leaq 0x1f0(%rsp), %rsi
callq 0x1ac60
movq 0x78(%rsp), %rsi
leaq 0x100(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x1a920
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x120(%rsp), %rdi
callq 0xc02c0
jmp 0xbcace
leaq 0x120(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
movq 0x228(%rsp), %rsi
callq 0x97950
jmp 0xbcaed
leaq 0x120(%rsp), %rdi
callq 0x1acc0
leaq 0x100(%rsp), %rdi
callq 0x1a950
leaq 0x110(%rsp), %rdi
callq 0x1acc0
jmp 0xbccbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xbcb8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xbcb66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x188(%rsp), %rdi
callq 0xb6e8
leaq 0x187(%rsp), %rdi
callq 0xb3f0
leaq 0x1a8(%rsp), %rdi
callq 0x1a950
leaq 0x1d0(%rsp), %rdi
callq 0xb6e8
leaq 0x1cf(%rsp), %rdi
callq 0xb3f0
jmp 0xbcd0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xbcbd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x160(%rsp), %rdi
callq 0xb6e8
leaq 0x15f(%rsp), %rdi
callq 0xb3f0
jmp 0xbcd0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xbcc1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x138(%rsp), %rdi
callq 0xb6e8
leaq 0x137(%rsp), %rdi
callq 0xb3f0
jmp 0xbcd0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xbcd0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xbcc81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x1acc0
leaq 0x100(%rsp), %rdi
callq 0x1a950
leaq 0x110(%rsp), %rdi
callq 0x1acc0
jmp 0xbcd0f
leaq 0x1f0(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
movq 0x228(%rsp), %rsi
callq 0x97950
jmp 0xbccbc
jmp 0xbccbe
jmp 0xbcce1
leaq 0x1f0(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
movq 0x228(%rsp), %rsi
callq 0x97950
jmp 0xbccdf
jmp 0xbcce1
movq 0x228(%rsp), %rdi
callq 0x99d60
jmp 0xbccf0
leaq 0x1f0(%rsp), %rdi
callq 0x1acc0
leaq 0x208(%rsp), %rdi
callq 0xbd610
jmp 0xbc82f
leaq 0x1f0(%rsp), %rdi
callq 0x1acc0
jmp 0xbcfa0
movq 0x80(%rsp), %rax
addq $0x90, %rax
movq %rax, 0xf8(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x221a0
movq %rax, 0xf0(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x22010
movq %rax, 0xe8(%rsp)
leaq 0xf0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xbd540
testb $0x1, %al
jne 0xbcd7f
jmp 0xbce11
leaq 0xf0(%rsp), %rdi
callq 0xbd580
movq %rax, %rsi
leaq 0xd8(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x1ac60
movq 0x20(%rsp), %rdi
callq 0x1bb50
movq %rax, %rdi
movq 0x228(%rsp), %rsi
callq 0x97950
jmp 0xbcdbd
movq 0x228(%rsp), %rdi
callq 0x99d60
jmp 0xbcdcc
leaq 0xd8(%rsp), %rdi
callq 0x1acc0
leaq 0xf0(%rsp), %rdi
callq 0xbd610
jmp 0xbcd61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x1acc0
jmp 0xbcfa0
testb $0x1, 0x21f(%rsp)
je 0xbcf8b
movq 0x228(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xb690
movq 0x18(%rsp), %rdx
leaq 0x18344(%rip), %rsi     # 0xd518e
leaq 0xb8(%rsp), %rdi
callq 0xb4c0
jmp 0xbce59
movq 0x10(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x96750
jmp 0xbce6d
leaq 0xb8(%rsp), %rdi
callq 0xb6e8
leaq 0xb7(%rsp), %rdi
callq 0xb3f0
movq 0x228(%rsp), %rax
movq %rax, (%rsp)
leaq 0x8f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xb690
movq 0x8(%rsp), %rdx
leaq 0x1a6be(%rip), %rsi     # 0xd756f
leaq 0x90(%rsp), %rdi
callq 0xb4c0
jmp 0xbcec0
movq (%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x96790
jmp 0xbced3
leaq 0x90(%rsp), %rdi
callq 0xb6e8
leaq 0x8f(%rsp), %rdi
callq 0xb3f0
movq 0x228(%rsp), %rdi
callq 0x99d60
jmp 0xbcf8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xbcf36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0xb6e8
leaq 0xb7(%rsp), %rdi
callq 0xb3f0
jmp 0xbcfa0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xbcf7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x90(%rsp), %rdi
callq 0xb6e8
leaq 0x8f(%rsp), %rdi
callq 0xb3f0
jmp 0xbcfa0
movq 0x228(%rsp), %rdi
callq 0x99da0
addq $0x238, %rsp            # imm = 0x238
retq
movq 0x1c0(%rsp), %rdi
callq 0xb680
nopl (%rax)