// File: /workspace/github_cpp_makefile_star2_O1/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 0x67bcb
movl $0x0, 0xc(%rsp)
jmp 0x67bed
cmpb $0x0, 0x90(%rdi)
je 0x67bc1
movq 0xb8(%rbx), %rax
subq 0xb0(%rbx), %rax
cmpq $0x20, %rax
setne %al
movl %eax, 0xc(%rsp)
callq 0x18ce0
movq 0x38(%rsp), %rax
movq 0x78(%rax), %r15
movq 0x80(%rax), %r12
cmpq %r12, %r15
je 0x67e91
movq 0x31396(%rip), %r13     # 0x98fa8
movq %r12, 0x70(%rsp)
movq (%r15), %rbp
movq 0x8(%r15), %r14
testq %r14, %r14
je 0x67c35
cmpb $0x0, (%r13)
je 0x67c30
incl 0x8(%r14)
jmp 0x67c35
lock
incl 0x8(%r14)
cmpb $0x0, 0xc(%rsp)
je 0x67c4e
movq 0x38(%rsp), %rax
movq 0x80(%rax), %rax
cmpq -0x10(%rax), %rbp
je 0x67c80
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x4f248
movq 0xa0(%rbx), %rdi
callq 0x18652
testq %r14, %r14
je 0x67c72
movq %r14, %rdi
callq 0xdcba
addq $0x10, %r15
cmpq %r12, %r15
jne 0x67c17
jmp 0x67e91
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x140e9(%rip), %rsi     # 0x7bd7f
leaq 0x140e6(%rip), %rdx     # 0x7bd83
callq 0xdf6a
movq 0x30(%rsp), %rcx
movq (%rcx), %rax
movq %rax, 0x60(%rsp)
movq 0x8(%rcx), %rax
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0x67ccd
cmpb $0x0, (%r13)
je 0x67cc9
incl 0x8(%rax)
jmp 0x67ccd
lock
incl 0x8(%rax)
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x78(%rsp), %r13
movq %r13, %rdi
leaq 0xed66(%rip), %rdx      # 0x76a4f
movq %rdx, %rsi
callq 0xdf6a
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %r13, %rcx
callq 0x1c0c4
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x67d1d
callq 0xa2b0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x67d2c
callq 0xdcba
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x67d40
callq 0xa2b0
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %r13
movq %r13, %rdi
leaq 0x14026(%rip), %rsi     # 0x7bd7f
leaq 0x14023(%rip), %rdx     # 0x7bd83
callq 0xdf6a
movq 0xa0(%rbx), %rdi
movq %r13, %rsi
callq 0x185d6
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x67d88
callq 0xa2b0
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %r13
movq %r13, %rdi
leaq 0x11bda(%rip), %rsi     # 0x7997b
leaq 0x11bd6(%rip), %rdx     # 0x7997e
callq 0xdf6a
movq 0xa0(%rbx), %rdi
movq %r13, %rsi
callq 0x1834e
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
movq 0x311d8(%rip), %r13     # 0x98fa8
je 0x67dd7
callq 0xa2b0
movq 0x28(%rbp), %rax
movq 0x30(%rsp), %rcx
cmpq (%rcx), %rax
movq 0x70(%rsp), %r12
je 0x67c4e
movq %rbp, 0x50(%rsp)
movq %r14, 0x58(%rsp)
testq %r14, %r14
je 0x67e0f
cmpb $0x0, (%r13)
je 0x67e0a
incl 0x8(%r14)
jmp 0x67e0f
lock
incl 0x8(%r14)
movq 0x30(%rsp), %rcx
movq (%rcx), %rax
movq %rax, 0x40(%rsp)
movq 0x8(%rcx), %rax
movq %rax, 0x48(%rsp)
testq %rax, %rax
je 0x67e3a
cmpb $0x0, (%r13)
je 0x67e36
incl 0x8(%rax)
jmp 0x67e3a
lock
incl 0x8(%rax)
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x69908
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x4f248
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x67e6a
callq 0xdcba
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x67e79
callq 0xdcba
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x67c59
callq 0xdcba
jmp 0x67c59
movq 0x38(%rsp), %rax
movq 0x90(%rax), %r15
movq 0x98(%rax), %r12
cmpq %r12, %r15
je 0x67ef7
movq 0x310f8(%rip), %rbp     # 0x98fa8
movq (%r15), %rdi
movq 0x8(%r15), %r14
testq %r14, %r14
je 0x67ecd
cmpb $0x0, (%rbp)
je 0x67ec8
incl 0x8(%r14)
jmp 0x67ecd
lock
incl 0x8(%r14)
movq %rbx, %rsi
callq 0x4f248
movq 0xa0(%rbx), %rdi
callq 0x18652
testq %r14, %r14
je 0x67eee
movq %r14, %rdi
callq 0xdcba
addq $0x10, %r15
cmpq %r12, %r15
jne 0x67eb0
cmpb $0x0, 0xc(%rsp)
je 0x67f8a
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x11990(%rip), %rsi     # 0x798a2
leaq 0x11990(%rip), %rdx     # 0x798a9
leaq 0x10(%rsp), %rdi
callq 0xdf6a
movq 0xa0(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1834e
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x67f43
callq 0xa2b0
leaq 0x10(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x13e2d(%rip), %rsi     # 0x7bd7f
leaq 0x13e2a(%rip), %rdx     # 0x7bd83
callq 0xdf6a
movq 0xa0(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x185d6
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x67f7e
callq 0xa2b0
movq 0xa0(%rbx), %rdi
callq 0x18652
movq 0xa0(%rbx), %rdi
callq 0x18e48
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x67fac
jmp 0x67fc7
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x68069
callq 0xa2b0
jmp 0x68069
movq %rax, %rbx
jmp 0x68069
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x67fe6
callq 0xdcba
jmp 0x67fe6
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x67ff5
callq 0xdcba
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x6805c
callq 0xdcba
jmp 0x6805c
jmp 0x6800a
jmp 0x68059
movq %rax, %rbx
jmp 0x6803f
jmp 0x68059
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x68030
callq 0xa2b0
jmp 0x68030
movq %rax, %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x6803f
callq 0xdcba
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x6805c
callq 0xa2b0
jmp 0x6805c
jmp 0x68059
jmp 0x68059
movq %rax, %rbx
testq %r14, %r14
je 0x68069
movq %r14, %rdi
callq 0xdcba
movq %rbx, %rdi
callq 0xa510
nop