// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, %rbx
movq %rdi, 0x38(%rsp)
movq 0xa0(%rsi), %rax
cmpl $0x0, 0x24(%rax)
je 0x4ac05
movl $0x0, 0x8(%rsp)
jmp 0x4ac27
cmpb $0x0, 0x90(%rax)
je 0x4abfb
movq 0xb8(%rbx), %rax
subq 0xb0(%rbx), %rax
cmpq $0x20, %rax
setne %al
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
callq 0x3b71e
movq 0x38(%rsp), %rax
movq 0x78(%rax), %rbp
movq 0x80(%rax), %rax
movq %rax, 0x50(%rsp)
leaq 0x10(%rsp), %r15
leaq 0x88(%rsp), %r12
cmpq 0x50(%rsp), %rbp
je 0x4addc
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x12c1e
movq 0x40(%rsp), %rdi
cmpb $0x0, 0x8(%rsp)
je 0x4ac87
movq 0x38(%rsp), %rax
movq 0x80(%rax), %rax
cmpq -0x10(%rax), %rdi
je 0x4aca7
movq %rbx, %rsi
callq 0x3a606
movq %rbx, %rdi
callq 0x3b712
leaq 0x48(%rsp), %rdi
callq 0xc984
addq $0x10, %rbp
jmp 0x4ac51
movq %r15, %r14
movq %r15, %rdi
leaq 0xf073(%rip), %rsi      # 0x59d27
leaq 0x7(%rsp), %rdx
callq 0xa150
leaq 0x78(%rsp), %r15
movq %r15, %rdi
movq 0x30(%rsp), %rsi
callq 0x12c0a
movq %r12, %rdi
leaq 0x9d45(%rip), %rsi      # 0x54a1f
leaq 0xf(%rsp), %rdx
callq 0xa150
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x16cbc
movq %r12, %rdi
callq 0xa558
leaq 0x80(%rsp), %rdi
callq 0xc984
movq %r14, %rdi
callq 0xa558
movq %r14, %rdi
leaq 0xf00b(%rip), %rsi      # 0x59d27
leaq 0x7(%rsp), %rdx
callq 0xa150
movq %r14, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x39d78
movq %r15, %rdi
callq 0xa558
movq %r15, %rdi
leaq 0xcccc(%rip), %rsi      # 0x57a12
leaq 0x7(%rsp), %rdx
callq 0xa150
movq %rbx, %rdi
movq %r15, %rsi
callq 0x39d6c
movq %r15, %rdi
callq 0xa558
movq 0x40(%rsp), %rdi
movq 0x28(%rdi), %rax
movq 0x30(%rsp), %rcx
cmpq (%rcx), %rax
je 0x4ac87
leaq 0x68(%rsp), %r14
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
callq 0x12c1e
leaq 0x58(%rsp), %r13
movq %r13, %rdi
movq 0x30(%rsp), %rsi
callq 0x12c0a
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x4c21a
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x3a606
leaq 0x18(%rsp), %rdi
callq 0xc984
leaq 0x60(%rsp), %rdi
callq 0xc984
leaq 0x70(%rsp), %rdi
callq 0xc984
jmp 0x4ac8f
movq 0x38(%rsp), %rax
movq 0x90(%rax), %r12
movq 0x98(%rax), %rbp
leaq 0x18(%rsp), %r14
leaq 0x10(%rsp), %r15
cmpq %rbp, %r12
je 0x4ae2c
movq %r15, %rdi
movq %r12, %rsi
callq 0x12c1e
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x3a606
movq %rbx, %rdi
callq 0x3b712
movq %r14, %rdi
callq 0xc984
addq $0x10, %r12
jmp 0x4adf9
cmpb $0x0, 0x8(%rsp)
je 0x4ae95
leaq 0xcaff(%rip), %rsi      # 0x57939
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0xa150
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x39d6c
leaq 0x10(%rsp), %rdi
callq 0xa558
leaq 0xeec0(%rip), %rsi      # 0x59d27
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0xa150
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x39d78
leaq 0x10(%rsp), %rdi
callq 0xa558
movq %rbx, %rdi
callq 0x3b712
movq %rbx, %rdi
callq 0x3b72a
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4aeb3
jmp 0x4aec2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa558
jmp 0x4af3f
movq %rax, %rbx
jmp 0x4af3f
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xc984
jmp 0x4aed9
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xc984
leaq 0x70(%rsp), %rdi
callq 0xc984
jmp 0x4af2d
jmp 0x4aef3
jmp 0x4af2a
movq %rax, %rbx
jmp 0x4af1c
jmp 0x4af2a
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xa558
jmp 0x4af0f
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xc984
leaq 0x10(%rsp), %rdi
callq 0xa558
jmp 0x4af2d
jmp 0x4af2a
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x4af3a
movq %rax, %rbx
movq %r14, %rdi
callq 0xc984
movq %rbx, %rdi
callq 0xa500
nop