// File: /workspace/github_cpp_makefile_star2_O3/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 $0x98, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, %rbx
movq %rdi, 0x38(%rsp)
movq 0xa0(%rsi), %rdi
cmpl $0x0, 0x24(%rdi)
je 0x68ae7
movl $0x0, 0xc(%rsp)
jmp 0x68b09
cmpb $0x0, 0x90(%rdi)
je 0x68add
movq 0xb8(%rbx), %rax
subq 0xb0(%rbx), %rax
cmpq $0x20, %rax
setne %al
movl %eax, 0xc(%rsp)
callq 0x18faa
movq 0x38(%rsp), %rax
movq 0x78(%rax), %r15
movq 0x80(%rax), %r12
cmpq %r12, %r15
je 0x68db2
movq 0x3147a(%rip), %r13     # 0x99fa8
movq %r12, 0x70(%rsp)
movq (%r15), %rbp
movq 0x8(%r15), %r14
testq %r14, %r14
je 0x68b51
cmpb $0x0, (%r13)
je 0x68b4c
incl 0x8(%r14)
jmp 0x68b51
lock
incl 0x8(%r14)
cmpb $0x0, 0xc(%rsp)
je 0x68b6a
movq 0x38(%rsp), %rax
movq 0x80(%rax), %rax
cmpq -0x10(%rax), %rbp
je 0x68b9c
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x4ff7c
movq 0xa0(%rbx), %rdi
callq 0x18918
testq %r14, %r14
je 0x68b8e
movq %r14, %rdi
callq 0xdce4
addq $0x10, %r15
cmpq %r12, %r15
jne 0x68b33
jmp 0x68db2
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x1418d(%rip), %rsi     # 0x7cd3f
leaq 0x1418a(%rip), %rdx     # 0x7cd43
callq 0xdfa8
movq 0x30(%rsp), %rcx
movq (%rcx), %rax
movq %rax, 0x60(%rsp)
movq 0x8(%rcx), %rax
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0x68be9
cmpb $0x0, (%r13)
je 0x68be5
incl 0x8(%rax)
jmp 0x68be9
lock
incl 0x8(%rax)
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x78(%rsp), %r13
movq %r13, %rdi
leaq 0xee4a(%rip), %rdx      # 0x77a4f
movq %rdx, %rsi
callq 0xdfa8
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %r13, %rcx
callq 0x1c3d8
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x68c39
callq 0xa2b0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x68c48
callq 0xdce4
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x68c5c
callq 0xa2b0
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %r13
movq %r13, %rdi
leaq 0x140ca(%rip), %rsi     # 0x7cd3f
leaq 0x140c7(%rip), %rdx     # 0x7cd43
callq 0xdfa8
movq 0xa0(%rbx), %rdi
movq %r13, %rsi
callq 0x1889c
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x68ca4
callq 0xa2b0
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %r13
movq %r13, %rdi
leaq 0x11c7e(%rip), %rsi     # 0x7a93b
leaq 0x11c7a(%rip), %rdx     # 0x7a93e
callq 0xdfa8
movq 0xa0(%rbx), %rdi
movq %r13, %rsi
callq 0x1861a
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
movq 0x312bc(%rip), %r13     # 0x99fa8
je 0x68cf3
callq 0xa2b0
movq 0x30(%rsp), %rax
movq (%rax), %rax
cmpq %rax, 0x28(%rbp)
movq 0x70(%rsp), %r12
je 0x68b6a
movq %rbp, 0x50(%rsp)
movq %r14, 0x58(%rsp)
testq %r14, %r14
je 0x68d33
cmpb $0x0, (%r13)
je 0x68d26
incl 0x8(%r14)
jmp 0x68d33
lock
incl 0x8(%r14)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
testq %rax, %rax
je 0x68d5b
cmpb $0x0, (%r13)
je 0x68d57
incl 0x8(%rax)
jmp 0x68d5b
lock
incl 0x8(%rax)
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x6a814
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x4ff7c
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x68d8b
callq 0xdce4
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x68d9a
callq 0xdce4
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x68b75
callq 0xdce4
jmp 0x68b75
movq 0x38(%rsp), %rax
movq 0x90(%rax), %r15
movq 0x98(%rax), %r12
cmpq %r12, %r15
je 0x68e18
movq 0x311d7(%rip), %rbp     # 0x99fa8
movq (%r15), %rdi
movq 0x8(%r15), %r14
testq %r14, %r14
je 0x68dee
cmpb $0x0, (%rbp)
je 0x68de9
incl 0x8(%r14)
jmp 0x68dee
lock
incl 0x8(%r14)
movq %rbx, %rsi
callq 0x4ff7c
movq 0xa0(%rbx), %rdi
callq 0x18918
testq %r14, %r14
je 0x68e0f
movq %r14, %rdi
callq 0xdce4
addq $0x10, %r15
cmpq %r12, %r15
jne 0x68dd1
cmpb $0x0, 0xc(%rsp)
je 0x68eab
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x11a2f(%rip), %rsi     # 0x7a862
leaq 0x11a2f(%rip), %rdx     # 0x7a869
leaq 0x10(%rsp), %rdi
callq 0xdfa8
movq 0xa0(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1861a
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x68e64
callq 0xa2b0
leaq 0x10(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x13ecc(%rip), %rsi     # 0x7cd3f
leaq 0x13ec9(%rip), %rdx     # 0x7cd43
callq 0xdfa8
movq 0xa0(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1889c
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x68e9f
callq 0xa2b0
movq 0xa0(%rbx), %rdi
callq 0x18918
movq 0xa0(%rbx), %rdi
callq 0x19110
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x68ecd
jmp 0x68ee8
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x68f8a
callq 0xa2b0
jmp 0x68f8a
movq %rax, %rbx
jmp 0x68f8a
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x68f07
callq 0xdce4
jmp 0x68f07
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x68f16
callq 0xdce4
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x68f7d
callq 0xdce4
jmp 0x68f7d
jmp 0x68f2b
jmp 0x68f7a
movq %rax, %rbx
jmp 0x68f60
jmp 0x68f7a
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x68f51
callq 0xa2b0
jmp 0x68f51
movq %rax, %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x68f60
callq 0xdce4
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x68f7d
callq 0xa2b0
jmp 0x68f7d
jmp 0x68f7a
jmp 0x68f7a
movq %rax, %rbx
testq %r14, %r14
je 0x68f8a
movq %r14, %rdi
callq 0xdce4
movq %rbx, %rdi
callq 0xa510